Properly validate individual checks

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl 2019-10-10 11:01:49 +02:00 committed by Arthur Schiwon
parent 71470463c6
commit b15c4a3a2e
No known key found for this signature in database
GPG Key ID: 7424F1874854DF23
2 changed files with 2 additions and 3 deletions

View File

@ -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)
} }

View File

@ -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',