Merge pull request #18766 from nextcloud/bugfix/workflow-filter-store

Filter disabled operations out of the rule list
This commit is contained in:
blizzz 2020-01-09 12:11:22 +01:00 committed by GitHub
commit 31c74e87c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 7 additions and 6 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -121,6 +121,7 @@ export default {
this.deleteVisible = false this.deleteVisible = false
}, },
validate() { validate() {
this.valid = true
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)
} }

View File

@ -19,7 +19,7 @@
type="button" type="button"
class="check--add" class="check--add"
value="Add a new filter" value="Add a new filter"
@click="rule.checks.push({class: null, operator: null, value: null})"> @click="rule.checks.push({class: null, operator: null, value: ''})">
</p> </p>
</div> </div>
<div class="flow-icon icon-confirm" /> <div class="flow-icon icon-confirm" />

View File

@ -138,7 +138,7 @@ const store = new Vuex.Store({
}, },
getters: { getters: {
getRules(state) { getRules(state) {
return state.rules.sort((rule1, rule2) => { return state.rules.filter((rule) => typeof state.operations[rule.class] !== 'undefined').sort((rule1, rule2) => {
return rule1.id - rule2.id || rule2.class - rule1.class return rule1.id - rule2.id || rule2.class - rule1.class
}) })
}, },