summaryrefslogtreecommitdiffstats
path: root/webapp
diff options
context:
space:
mode:
authorUdo Walter2019-04-18 15:21:08 +0200
committerUdo Walter2019-04-18 15:21:08 +0200
commit843946b27642f5acdeb1d5dc0d46eada379dbd0c (patch)
treec58b4eff275bf5c057a092a1a0195620a7ee67e4 /webapp
parent[server] env variable PORT -> BAS_PORT (diff)
downloadbas-843946b27642f5acdeb1d5dc0d46eada379dbd0c.tar.gz
bas-843946b27642f5acdeb1d5dc0d46eada379dbd0c.tar.xz
bas-843946b27642f5acdeb1d5dc0d46eada379dbd0c.zip
[webapp/groups] automatically switch to subgroups or clients on load
Diffstat (limited to 'webapp')
-rw-r--r--webapp/src/components/GroupModuleGroupView.vue18
-rw-r--r--webapp/src/store/groups.js2
2 files changed, 11 insertions, 9 deletions
diff --git a/webapp/src/components/GroupModuleGroupView.vue b/webapp/src/components/GroupModuleGroupView.vue
index a793d8a..04b0be0 100644
--- a/webapp/src/components/GroupModuleGroupView.vue
+++ b/webapp/src/components/GroupModuleGroupView.vue
@@ -64,7 +64,7 @@
></v-switch>
<v-tabs-items touchless>
- <v-tab-item v-if="group.id !== 0" :transition="false" :reverse-transition="false">
+ <v-tab-item v-if="group.id !== 0" lazy :transition="false" :reverse-transition="false">
<v-divider></v-divider>
<v-card-text>
<v-layout wrap>
@@ -217,6 +217,7 @@ export default {
return {
activeTab: 0,
editMode: false,
+ showAllClicked: false,
info: {
name: '',
description: '',
@@ -239,18 +240,19 @@ export default {
},
watch: {
group (newValue, oldValue) {
- if (newValue.id === 'create') {
- this.editInfo()
- this.activeTab = 0
- } else if (newValue.id !== oldValue.id) {
- this.editMode = false
- this.activeTab = 0
- }
+ if (newValue.id === 'create') this.editInfo()
+ else if (newValue.id !== oldValue.id) this.editMode = false
+ else if (!oldValue.isPlaceholder) return
+
+ if (newValue.subgroups.length) this.activeTab = (this.group.id === 0 ? 0 : 1)
+ else if (newValue.clients.length) this.activeTab = (this.group.id === 0 ? 1 : 2)
+ else this.activeTab = 0
}
},
methods: {
...mapMutations('groups', ['setDialog', 'setActiveTab', 'adjustTabSlider', 'deleteFromTabChain']),
setShowAll (value) {
+ this.showAllClicked = true
this.$store.commit('groups/setShowAll', { index: this.tabIndex, value })
this.$store.dispatch('groups/loadGroup', { id: this.group.id, tabIndex: this.tabIndex })
},
diff --git a/webapp/src/store/groups.js b/webapp/src/store/groups.js
index c5df70a..24f58d3 100644
--- a/webapp/src/store/groups.js
+++ b/webapp/src/store/groups.js
@@ -78,7 +78,7 @@ export default {
if (insert) context.commit('setActiveTab', 2)
context.commit(insert ? 'insertTab' : 'setTab', {
index: tabIndex,
- item: { id, name, tabType: 'group', tabShowAll: showAll, subgroups: [], clients: [] }
+ item: { id, name, tabType: 'group', tabShowAll: showAll, subgroups: [], clients: [], isPlaceholder: true }
})
}
if (insert) tabIndex = 1