Merge pull request #18772 from nextcloud/backport/18766/stable18

[stable18] Filter disabled operations out of the rule list
This commit is contained in:
Roeland Jago Douma 2020-01-09 16:30:05 +01:00 committed by GitHub
commit 18315f44b8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 3 additions and 2 deletions

View file

@ -121,6 +121,7 @@ export default {
this.deleteVisible = false
},
validate() {
this.valid = true
if (this.currentOption && this.currentOption.validate) {
this.valid = !!this.currentOption.validate(this.check)
}

View file

@ -19,7 +19,7 @@
type="button"
class="check--add"
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>
</div>
<div class="flow-icon icon-confirm" />

View file

@ -138,7 +138,7 @@ const store = new Vuex.Store({
},
getters: {
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
})
},