From e9cd145e6de70f2c7f89571e17ad2bbb8781d510 Mon Sep 17 00:00:00 2001 From: Udo Walter Date: Wed, 1 May 2019 15:01:14 +0000 Subject: [webapp/groups] load into info if groups is opened via route --- webapp/src/components/GroupModule.vue | 2 +- webapp/src/components/GroupModuleGroupView.vue | 3 +-- webapp/src/store/groups.js | 6 +++--- 3 files changed, 5 insertions(+), 6 deletions(-) (limited to 'webapp') diff --git a/webapp/src/components/GroupModule.vue b/webapp/src/components/GroupModule.vue index 5d7a25d..1e85364 100644 --- a/webapp/src/components/GroupModule.vue +++ b/webapp/src/components/GroupModule.vue @@ -84,7 +84,7 @@ export default { this.setActiveTab(1) } else { const action = type === 'group' ? 'loadGroup' : type === 'client' ? 'loadClient' : null - if (action) this.$store.dispatch('groups/' + action, { id, tabIndex: id === 0 ? 0 : 1, switchTab: true }) + if (action) this.$store.dispatch('groups/' + action, { id, tabIndex: id === 0 ? 0 : 1, switchTab: true, gotoInfo: true }) } }, updateUrl () { diff --git a/webapp/src/components/GroupModuleGroupView.vue b/webapp/src/components/GroupModuleGroupView.vue index 6c4905c..9fba66e 100644 --- a/webapp/src/components/GroupModuleGroupView.vue +++ b/webapp/src/components/GroupModuleGroupView.vue @@ -157,8 +157,7 @@ export default { }, watch: { group (newValue, oldValue) { - if (!oldValue.isPlaceholder) return - if (newValue.loadedAsParent) { + if (newValue.gotoInfo) { this.activeTab = 0 return } diff --git a/webapp/src/store/groups.js b/webapp/src/store/groups.js index f52cdcf..5fe15d3 100644 --- a/webapp/src/store/groups.js +++ b/webapp/src/store/groups.js @@ -76,7 +76,7 @@ export default { context.dispatch('loadClientList') context.dispatch('loadConfigList') }, - async loadGroup (context, { id, name, tabIndex, switchTab, asParent }) { + async loadGroup (context, { id, name, tabIndex, switchTab, asParent, gotoInfo }) { 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 @@ -85,7 +85,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: [], isPlaceholder: true } + item: { id, name, tabType: 'group', tabShowAll: showAll, subgroups: [], clients: [] } }) } if (insert) tabIndex = 1 @@ -97,7 +97,7 @@ export default { res.data.tabType = 'group' res.data.tabShowAll = showAll res.data.subgroups = Object.freeze(res.data.subgroups) - res.data.loadedAsParent = asParent + res.data.gotoInfo = asParent || gotoInfo context.commit('setTab', { index: tabIndex, item: res.data }) } catch (e) { if (switchTab) context.commit('setActiveTab', srcTabIndex) -- cgit v1.2.3-55-g7522