-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding support for >=, <=, and between for threshold alerts (#35614)
* adding support for >=, <=, and between for threshold alerts * adding i18n for AND label * making prettier happy * appeasing the linter * more linting issues * more linting * fixing test * fixing error state for threshold expression * fixing alignment for treshold inputs * addressing PR feedback * one more PR review fix * eslint fixes * fixing a couple of watch viz bugs
- Loading branch information
1 parent
6b17a37
commit 2f79b06
Showing
11 changed files
with
279 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import { i18n } from '@kbn/i18n'; | ||
|
||
import { COMPARATORS } from '../../../common/constants'; | ||
|
||
export interface Comparator { | ||
text: string; | ||
value: string; | ||
requiredValues: number; | ||
} | ||
export const comparators: { [key: string]: Comparator } = { | ||
[COMPARATORS.GREATER_THAN]: { | ||
text: i18n.translate('xpack.watcher.thresholdWatchExpression.comparators.isAboveLabel', { | ||
defaultMessage: 'Is above', | ||
}), | ||
value: COMPARATORS.GREATER_THAN, | ||
requiredValues: 1, | ||
}, | ||
[COMPARATORS.GREATER_THAN_OR_EQUALS]: { | ||
text: i18n.translate( | ||
'xpack.watcher.thresholdWatchExpression.comparators.isAboveOrEqualsLabel', | ||
{ | ||
defaultMessage: 'Is above or equals', | ||
} | ||
), | ||
value: COMPARATORS.GREATER_THAN_OR_EQUALS, | ||
requiredValues: 1, | ||
}, | ||
[COMPARATORS.LESS_THAN]: { | ||
text: i18n.translate('xpack.watcher.thresholdWatchExpression.comparators.isBelowLabel', { | ||
defaultMessage: 'Is below', | ||
}), | ||
value: COMPARATORS.LESS_THAN, | ||
requiredValues: 1, | ||
}, | ||
[COMPARATORS.LESS_THAN_OR_EQUALS]: { | ||
text: i18n.translate( | ||
'xpack.watcher.thresholdWatchExpression.comparators.isBelowOrEqualsLabel', | ||
{ | ||
defaultMessage: 'Is below or equals', | ||
} | ||
), | ||
value: COMPARATORS.LESS_THAN_OR_EQUALS, | ||
requiredValues: 1, | ||
}, | ||
[COMPARATORS.BETWEEN]: { | ||
text: i18n.translate('xpack.watcher.thresholdWatchExpression.comparators.isBetweenLabel', { | ||
defaultMessage: 'Is between', | ||
}), | ||
value: COMPARATORS.BETWEEN, | ||
requiredValues: 2, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 0 additions & 28 deletions
28
x-pack/plugins/watcher/public/sections/watch_edit/comparators.ts
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.