aboutsummaryrefslogtreecommitdiffstats
path: root/apps/workflowengine/src/components/Check.vue
diff options
context:
space:
mode:
Diffstat (limited to 'apps/workflowengine/src/components/Check.vue')
-rw-r--r--apps/workflowengine/src/components/Check.vue9
1 files changed, 7 insertions, 2 deletions
diff --git a/apps/workflowengine/src/components/Check.vue b/apps/workflowengine/src/components/Check.vue
index e77b9a0646f..96d686341fe 100644
--- a/apps/workflowengine/src/components/Check.vue
+++ b/apps/workflowengine/src/components/Check.vue
@@ -81,7 +81,11 @@ export default {
},
operators() {
if (!this.currentOption) { return [] }
- return this.checks[this.currentOption.class].operators
+ const operators = this.checks[this.currentOption.class].operators
+ if (typeof operators === 'function') {
+ return operators(this.check)
+ }
+ return operators
},
currentComponent() {
if (!this.currentOption) { return [] }
@@ -118,7 +122,8 @@ export default {
return this.valid
},
updateCheck() {
- if (this.check.class !== this.currentOption.class) {
+ const matchingOperator = this.operators.findIndex((operator) => this.check.operator === operator.operator)
+ if (this.check.class !== this.currentOption.class || matchingOperator === -1) {
this.currentOperator = this.operators[0]
}
this.check.class = this.currentOption.class