summaryrefslogtreecommitdiffstats
path: root/webapp
diff options
context:
space:
mode:
authorUdo Walter2019-05-01 17:42:36 +0200
committerUdo Walter2019-05-01 17:42:36 +0200
commit302457e61b313fa301ede862402baa0fff10755f (patch)
treec7fe72e8effc54049cbf50e00f886ea01b7f62a7 /webapp
parent[webapp/groups] load into info if groups is opened via route (diff)
downloadbas-302457e61b313fa301ede862402baa0fff10755f.tar.gz
bas-302457e61b313fa301ede862402baa0fff10755f.tar.xz
bas-302457e61b313fa301ede862402baa0fff10755f.zip
[webapp/groups] fix tab switching when setting showall
Diffstat (limited to 'webapp')
-rw-r--r--webapp/src/components/GroupModuleGroupList.vue2
-rw-r--r--webapp/src/components/GroupModuleGroupView.vue5
-rw-r--r--webapp/src/store/groups.js8
3 files changed, 9 insertions, 6 deletions
diff --git a/webapp/src/components/GroupModuleGroupList.vue b/webapp/src/components/GroupModuleGroupList.vue
index 2bec2b8..b556509 100644
--- a/webapp/src/components/GroupModuleGroupList.vue
+++ b/webapp/src/components/GroupModuleGroupList.vue
@@ -81,7 +81,7 @@ export default {
methods: {
...mapMutations('groups', ['setActiveTab', 'setTab', 'setDialog']),
loadGroup (item) {
- this.$store.dispatch('groups/loadGroup', { id: item.id, name: item.name, tabIndex: this.tabIndex + 1, switchTab: true })
+ this.$store.dispatch('groups/loadGroup', { id: item.id, name: item.name, tabIndex: this.tabIndex + 1, switchTab: true, autoGoto: true })
},
newGroup () {
this.setTab({ index: 1, item: { id: 'create', tabType: 'group' } })
diff --git a/webapp/src/components/GroupModuleGroupView.vue b/webapp/src/components/GroupModuleGroupView.vue
index 9fba66e..159f249 100644
--- a/webapp/src/components/GroupModuleGroupView.vue
+++ b/webapp/src/components/GroupModuleGroupView.vue
@@ -148,8 +148,7 @@ export default {
},
data () {
return {
- activeTab: 0,
- showAllClicked: false
+ activeTab: 0
}
},
computed: {
@@ -161,6 +160,7 @@ export default {
this.activeTab = 0
return
}
+ if (!newValue.autoGoto) 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)
@@ -170,7 +170,6 @@ export default {
methods: {
...mapMutations('groups', ['setDialog', 'setActiveTab', 'adjustTabSlider', 'deleteFromTabChain', 'setCollapsedView']),
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 5fe15d3..2785468 100644
--- a/webapp/src/store/groups.js
+++ b/webapp/src/store/groups.js
@@ -27,7 +27,10 @@ export default {
setClientList: (state, list) => { state.clientList = list },
setConfigList: (state, list) => { state.configList = list },
setActiveTab (state, index) { state.activeTab = index },
- setShowAll (state, { index, value }) { state.tabChain[index].tabShowAll = value },
+ setShowAll (state, { index, value }) {
+ state.tabChain[index].tabShowAll = value
+ state.tabChain[index].autoGoto = false
+ },
deleteFromTabChain (state, { index, count }) { state.tabChain.splice(index, count) },
adjustTabSlider (state) { state.adjustTabSlider = true },
setTab (state, { index, item }) {
@@ -76,7 +79,7 @@ export default {
context.dispatch('loadClientList')
context.dispatch('loadConfigList')
},
- async loadGroup (context, { id, name, tabIndex, switchTab, asParent, gotoInfo }) {
+ async loadGroup (context, { id, name, tabIndex, switchTab, asParent, gotoInfo, autoGoto }) {
const tabChain = context.state.tabChain
const showAll = tabChain.length > tabIndex && tabChain[tabIndex].id === id && tabChain[tabIndex].tabShowAll
const insert = asParent && tabChain.length > tabIndex && tabIndex >= 1 && tabChain[tabIndex - 1].id !== id
@@ -98,6 +101,7 @@ export default {
res.data.tabShowAll = showAll
res.data.subgroups = Object.freeze(res.data.subgroups)
res.data.gotoInfo = asParent || gotoInfo
+ res.data.autoGoto = autoGoto
context.commit('setTab', { index: tabIndex, item: res.data })
} catch (e) {
if (switchTab) context.commit('setActiveTab', srcTabIndex)