From b331f16cec936cc25e9f6fb37c22d477dbbde7ed Mon Sep 17 00:00:00 2001 From: Christian Hofmaier Date: Fri, 5 Apr 2019 19:19:36 +0000 Subject: [eventmanager] fix blacklist not deselecting correctly - clicking on step will now load childs into blacklist too --- webapp/src/components/EventModuleEdit.vue | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'webapp') 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 = [] + } } } } -- cgit v1.2.3-55-g7522