mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
Add NOT prefix to negated filter with custom label (#35521)
Negated filters disregarded the "NOT" when using custom labels. Therefore it was not possible to differentiate between the 2 filter states. This fix for #34979 adds the "NOT" also to custom labels
This commit is contained in:
parent
1794c8b01c
commit
73c3492035
1 changed files with 4 additions and 4 deletions
|
@ -72,16 +72,16 @@ export const FilterView: SFC<Props> = ({ filter, ...rest }: Props) => {
|
|||
};
|
||||
|
||||
export function getFilterDisplayText(filter: Filter) {
|
||||
if (filter.meta.alias !== null) {
|
||||
return filter.meta.alias;
|
||||
}
|
||||
|
||||
const prefix = filter.meta.negate
|
||||
? ` ${i18n.translate('common.ui.filterBar.negatedFilterPrefix', {
|
||||
defaultMessage: 'NOT ',
|
||||
})}`
|
||||
: '';
|
||||
|
||||
if (filter.meta.alias !== null) {
|
||||
return `${prefix}${filter.meta.alias}`;
|
||||
}
|
||||
|
||||
switch (filter.meta.type) {
|
||||
case 'exists':
|
||||
return `${prefix}${filter.meta.key} ${existsOperator.message}`;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue