Properly validate individual checks
Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
parent
71470463c6
commit
b15c4a3a2e
|
@ -112,7 +112,6 @@ export default {
|
||||||
if (this.currentOption && this.currentOption.validate) {
|
if (this.currentOption && this.currentOption.validate) {
|
||||||
this.valid = !!this.currentOption.validate(this.check);
|
this.valid = !!this.currentOption.validate(this.check);
|
||||||
}
|
}
|
||||||
this.$store.dispatch('setValid', { rule: this.rule, valid: this.rule.valid && this.valid })
|
|
||||||
return this.valid
|
return this.valid
|
||||||
},
|
},
|
||||||
updateCheck() {
|
updateCheck() {
|
||||||
|
@ -123,7 +122,7 @@ export default {
|
||||||
this.check.operator = this.currentOperator.operator
|
this.check.operator = this.currentOperator.operator
|
||||||
|
|
||||||
if (!this.validate()) {
|
if (!this.validate()) {
|
||||||
return
|
this.check.invalid = !this.valid
|
||||||
}
|
}
|
||||||
this.$emit('update', this.check)
|
this.$emit('update', this.check)
|
||||||
}
|
}
|
||||||
|
|
|
@ -85,7 +85,7 @@ export default {
|
||||||
return this.$store.getters.getOperationForRule(this.rule)
|
return this.$store.getters.getOperationForRule(this.rule)
|
||||||
},
|
},
|
||||||
ruleStatus() {
|
ruleStatus() {
|
||||||
if (this.error || !this.rule.valid) {
|
if (this.error || !this.rule.valid || this.rule.checks.some((check) => check.invalid === true)) {
|
||||||
return {
|
return {
|
||||||
title: t('workflowengine', 'The configuration is invalid'),
|
title: t('workflowengine', 'The configuration is invalid'),
|
||||||
class: 'icon-close-white invalid',
|
class: 'icon-close-white invalid',
|
||||||
|
|
Loading…
Reference in New Issue