diff --git a/public/pages/CreateTrigger/components/ExpressionQuery/ExpressionQuery.js b/public/pages/CreateTrigger/components/ExpressionQuery/ExpressionQuery.js index 13180ce09..97bf47b0d 100644 --- a/public/pages/CreateTrigger/components/ExpressionQuery/ExpressionQuery.js +++ b/public/pages/CreateTrigger/components/ExpressionQuery/ExpressionQuery.js @@ -16,8 +16,7 @@ const ExpressionQuery = ({ value, defaultText, label, - name = 'expressionQueries', - triggerValues, + formikName = 'expressionQueries', }) => { const DEFAULT_DESCRIPTION = defaultText ? defaultText : 'Select'; const OPERATORS = ['AND', 'OR', 'NOT']; @@ -79,7 +78,7 @@ const ExpressionQuery = ({ const onBlur = (form, expressions) => { form.setFieldTouched('expressionQueries', true); - form.setFieldValue('triggerDefinitions[0].triggerConditions', getValue(expressions)); + form.setFieldValue(formikName, getValue(expressions)); form.setFieldError('expressionQueries', validate()); }; diff --git a/public/pages/CreateTrigger/containers/CreateTrigger/utils/formikToTrigger.js b/public/pages/CreateTrigger/containers/CreateTrigger/utils/formikToTrigger.js index 0ef88c089..83e09017c 100644 --- a/public/pages/CreateTrigger/containers/CreateTrigger/utils/formikToTrigger.js +++ b/public/pages/CreateTrigger/containers/CreateTrigger/utils/formikToTrigger.js @@ -115,7 +115,7 @@ export function formikToDocumentLevelTriggerCondition(values, monitorUiMetadata) }; } -export function formikToCompositeTriggerCondition(values, monitorUiMetadata) { +export function formikToCompositeTriggerCondition(values) { const conditionMap = { and: '&&', or: '||', diff --git a/public/pages/CreateTrigger/containers/DefineCompositeLevelTrigger/DefineCompositeLevelTrigger.js b/public/pages/CreateTrigger/containers/DefineCompositeLevelTrigger/DefineCompositeLevelTrigger.js index 651084030..a06b8aa22 100644 --- a/public/pages/CreateTrigger/containers/DefineCompositeLevelTrigger/DefineCompositeLevelTrigger.js +++ b/public/pages/CreateTrigger/containers/DefineCompositeLevelTrigger/DefineCompositeLevelTrigger.js @@ -9,7 +9,7 @@ import _ from 'lodash'; import { EuiSpacer, EuiText } from '@elastic/eui'; import { FormikFieldText, FormikSelect } from '../../../../components/FormControls'; import { hasError, isInvalid } from '../../../../utils/validate'; -import { DEFAULT_TRIGGER_NAME, SEVERITY_OPTIONS } from '../../utils/constants'; +import { SEVERITY_OPTIONS } from '../../utils/constants'; import ExpressionQuery from '../../components/ExpressionQuery/ExpressionQuery'; import TriggerNotifications from './TriggerNotifications'; import ContentPanel from '../../../../components/ContentPanel'; @@ -123,7 +123,7 @@ class DefineCompositeLevelTrigger extends Component { setIsModalVisible(true); + const showConfig = () => setIsModalVisible(true); return (