mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
fix filter bug
This commit is contained in:
parent
49144f07e4
commit
e61fa37db4
@ -44,7 +44,7 @@ export class FilterSegments {
|
|||||||
this.removeSegment.value = DefaultRemoveFilterValue;
|
this.removeSegment.value = DefaultRemoveFilterValue;
|
||||||
return Promise.resolve([this.removeSegment]);
|
return Promise.resolve([this.removeSegment]);
|
||||||
} else {
|
} else {
|
||||||
return this.getFilterKeysFunc(segment, DefaultRemoveFilterValue);
|
return this.getFilterKeysFunc(segment, DefaultRemoveFilterValue, segment.type === 'plus-button');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -89,7 +89,7 @@ export class StackdriverFilterCtrl {
|
|||||||
return elements;
|
return elements;
|
||||||
}
|
}
|
||||||
|
|
||||||
async getFilterKeys(segment, removeText?: string) {
|
async getFilterKeys(segment, removeText: string, hideRemoveButton: boolean) {
|
||||||
let elements = await this.createLabelKeyElements();
|
let elements = await this.createLabelKeyElements();
|
||||||
|
|
||||||
if (this.$scope.filters.indexOf(this.resourceTypeValue) !== -1) {
|
if (this.$scope.filters.indexOf(this.resourceTypeValue) !== -1) {
|
||||||
@ -101,10 +101,12 @@ export class StackdriverFilterCtrl {
|
|||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
return [
|
return hideRemoveButton
|
||||||
...elements,
|
? elements
|
||||||
this.uiSegmentSrv.newSegment({ fake: true, value: removeText || this.defaultRemoveGroupByValue }),
|
: [
|
||||||
];
|
...elements,
|
||||||
|
this.uiSegmentSrv.newSegment({ fake: true, value: removeText || this.defaultRemoveGroupByValue }),
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
async getGroupBys(segment) {
|
async getGroupBys(segment) {
|
||||||
@ -117,7 +119,7 @@ export class StackdriverFilterCtrl {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.removeSegment.value = this.defaultRemoveGroupByValue;
|
this.removeSegment.value = this.defaultRemoveGroupByValue;
|
||||||
return [...elements, this.removeSegment];
|
return segment.type === 'plus-button' ? elements : [...elements, this.removeSegment];
|
||||||
}
|
}
|
||||||
|
|
||||||
groupByChanged(segment, index) {
|
groupByChanged(segment, index) {
|
||||||
|
Loading…
Reference in New Issue
Block a user