summaryrefslogtreecommitdiffstats
path: root/webapp
diff options
context:
space:
mode:
authorChristian Hofmaier2019-04-05 21:19:36 +0200
committerChristian Hofmaier2019-04-05 21:19:36 +0200
commitb331f16cec936cc25e9f6fb37c22d477dbbde7ed (patch)
treed89bc187fe3a2add841c092e2016faae0e2a1f26 /webapp
parent[eventmanager] fix bug tab-content not loading correctly (diff)
downloadbas-b331f16cec936cc25e9f6fb37c22d477dbbde7ed.tar.gz
bas-b331f16cec936cc25e9f6fb37c22d477dbbde7ed.tar.xz
bas-b331f16cec936cc25e9f6fb37c22d477dbbde7ed.zip
[eventmanager] fix blacklist not deselecting correctly
- clicking on step will now load childs into blacklist too
Diffstat (limited to 'webapp')
-rw-r--r--webapp/src/components/EventModuleEdit.vue23
1 files changed, 17 insertions, 6 deletions
diff --git a/webapp/src/components/EventModuleEdit.vue b/webapp/src/components/EventModuleEdit.vue
index 4ad68d9..196a94e 100644
--- a/webapp/src/components/EventModuleEdit.vue
+++ b/webapp/src/components/EventModuleEdit.vue
@@ -437,6 +437,9 @@ export default {
...mapState('groups', ['groupList', 'clientList'])
},
watch: {
+ step (val) {
+ if (val === '3') this.loadChilds()
+ },
dialog: {
immediate: true,
deep: true,
@@ -544,9 +547,7 @@ export default {
}
},
completeStepTwo () {
- if (this.groups.length > 0) {
- this.loadChilds()
- }
+ this.loadChilds()
this.step = 3
this.stepCompleted = Math.max(2, this.stepCompleted)
},
@@ -582,6 +583,7 @@ export default {
'end': (end.getTime() / 1000)
}
}
+ await this.loadChilds()
// Submit
await this.$http.post('/api/events/' + this.dialog.info.id, {
name: this.name,
@@ -620,9 +622,18 @@ export default {
this.$set(this.monthMap, i, this.monthMap[i] ? 0 : 1)
},
async loadChilds () {
- var response = await this.$http.post('/api/events/blacklist', { groups: this.groups })
- this.blackgroupList = response.data.subgroups
- this.blackclientList = response.data.clients
+ if (this.groups.length > 0) {
+ var response = await this.$http.post('/api/events/blacklist', { groups: this.groups })
+ this.blackgroupList = response.data.subgroups
+ this.blackclientList = response.data.clients
+ this.blacklistGroups = this.blacklistGroups.filter(g => this.blackgroupList.map(x => x.id).indexOf(g.id) !== -1)
+ this.blacklistClients = this.blacklistGroups.filter(c => this.blacklistClients.map(x => x.id).indexOf(c.id) !== -1)
+ } else {
+ this.blackgroupList = []
+ this.blackclientList = []
+ this.blacklistGroups = []
+ this.blacklistClients = []
+ }
}
}
}