diff --git a/public/components/FormControls/FormikInputWrapper/FormikInputWrapper.js b/public/components/FormControls/FormikInputWrapper/FormikInputWrapper.js index f17edd8cc..5f716622e 100644 --- a/public/components/FormControls/FormikInputWrapper/FormikInputWrapper.js +++ b/public/components/FormControls/FormikInputWrapper/FormikInputWrapper.js @@ -15,7 +15,7 @@ const FormikInputWrapper = ({ name, fieldProps, render }) => ( FormikInputWrapper.propTypes = { name: PropTypes.string.isRequired, - fieldProps: PropTypes.object.isRequired, + fieldProps: PropTypes.object, render: PropTypes.func.isRequired, }; diff --git a/public/pages/CreateTrigger/components/CompositeTriggerCondition/ExpressionBuilder.js b/public/pages/CreateTrigger/components/CompositeTriggerCondition/ExpressionBuilder.js index 2a3b929da..f32d136dd 100644 --- a/public/pages/CreateTrigger/components/CompositeTriggerCondition/ExpressionBuilder.js +++ b/public/pages/CreateTrigger/components/CompositeTriggerCondition/ExpressionBuilder.js @@ -228,7 +228,8 @@ const ExpressionBuilder = ({ ); const hasInvalidExpression = () => - !!usedExpressions.filter((expression) => expression.monitor_id === '')?.length; + !!usedExpressions.filter((expression) => expression.monitor_id === '')?.length || + options.length < usedExpressions.length; const isValid = () => options.length > 1 && usedExpressions.length > 1 && !hasInvalidExpression(); @@ -236,6 +237,9 @@ const ExpressionBuilder = ({ if (options.length < 2) return 'Trigger condition requires at least two associated monitors.'; if (usedExpressions.length < 2) return 'Trigger condition requires at least two monitors selected.'; + if (options.length < usedExpressions.length) { + return 'Trigger condition is using unselected Delegate monitor.'; + } if (hasInvalidExpression()) return 'Invalid expressions.'; }; @@ -307,7 +311,7 @@ const ExpressionBuilder = ({ validate(), + validate, }} render={({ form }) => (