Remove age operator when drilling down from a dashboard to a query
By clicking on the section header in a custom dashboard one can navigate to the query of that section. In a dashboard space is limited which is why the section queries are often limited by using the limit and age operators so that a section cannot grow too big. Sometimes it makes sense to drill down into a query and look at the complete query result. This is why any limit operator is automatically removed when drilling down into a section query. Do the same for the age operator and remove it automatically when drilling down into a section query. Change-Id: I209be9516e0462a4d04fbba1b3ec128c0d411e7f Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
This commit is contained in:
parent
77167754ef
commit
780ab208e1
@ -70,7 +70,7 @@ public class DashboardTable extends ChangeTable2 {
|
||||
int i = 0;
|
||||
for (String title : titles) {
|
||||
Section s = new Section();
|
||||
String query = removeLimit(queries.get(i++));
|
||||
String query = removeLimitAndAge(queries.get(i++));
|
||||
s.setTitleWidget(new InlineHyperlink(title, PageLinks.toChangeQuery(query)));
|
||||
addSection(s);
|
||||
sections.add(s);
|
||||
@ -84,11 +84,12 @@ public class DashboardTable extends ChangeTable2 {
|
||||
});
|
||||
}
|
||||
|
||||
private String removeLimit(String query) {
|
||||
private String removeLimitAndAge(String query) {
|
||||
StringBuilder unlimitedQuery = new StringBuilder();
|
||||
String[] operators = query.split(" ");
|
||||
for (String o : operators) {
|
||||
if (!o.startsWith("limit:")) {
|
||||
if (!o.startsWith("limit:")
|
||||
&& !o.startsWith("age:") && !o.startsWith("-age:")) {
|
||||
unlimitedQuery.append(o).append(" ");
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user