Skip to content

Commit 3a84ff7

Browse files
authored
allow keyword filter to be attached to bucket level monitor trigger (#1325)
Signed-off-by: KashKondaka <37753523+KashKondaka@users.noreply.github.com>
1 parent 36ccb85 commit 3a84ff7

File tree

1 file changed

+8
-1
lines changed
  • public/pages/CreateMonitor/components/MonitorExpressions/expressions/utils

1 file changed

+8
-1
lines changed

public/pages/CreateMonitor/components/MonitorExpressions/expressions/utils/whereHelpers.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@
55

66
import _ from 'lodash';
77
import { OPERATORS_MAP, Expressions } from './constants';
8-
import { TRIGGER_COMPARISON_OPERATORS } from '../../../../../CreateTrigger/containers/DefineBucketLevelTrigger/DefineBucketLevelTrigger';
8+
import {
9+
TRIGGER_COMPARISON_OPERATORS,
10+
TRIGGER_OPERATORS_MAP,
11+
} from '../../../../../CreateTrigger/containers/DefineBucketLevelTrigger/DefineBucketLevelTrigger';
912
import { DATA_TYPES } from '../../../../../../utils/constants';
1013
import { FORMIK_INITIAL_WHERE_EXPRESSION_VALUES } from '../../../../containers/CreateMonitor/utils/constants';
1114

@@ -98,6 +101,10 @@ export const validateWhereFilter = (filter = FORMIK_INITIAL_WHERE_EXPRESSION_VAL
98101
// These operators don't store a query value in the FORMIK_INITIAL_WHERE_EXPRESSION_VALUES.
99102
// No further validation needed.
100103
break;
104+
case TRIGGER_OPERATORS_MAP.INCLUDE:
105+
case TRIGGER_OPERATORS_MAP.EXCLUDE:
106+
filterIsValid = filterIsValid && !_.isEmpty(filter.fieldValue?.toString());
107+
break;
101108
default:
102109
console.log('Unknown query operator detected:', fieldOperator);
103110
filterIsValid = false;

0 commit comments

Comments
 (0)