summaryrefslogtreecommitdiffstats
path: root/webapp
diff options
context:
space:
mode:
authorUdo Walter2019-05-01 17:01:14 +0200
committerUdo Walter2019-05-01 17:01:14 +0200
commite9cd145e6de70f2c7f89571e17ad2bbb8781d510 (patch)
tree49e43040781248f9077f4239de3998f5a38bd709 /webapp
parent[webapp/groups] small ux fix (diff)
downloadbas-e9cd145e6de70f2c7f89571e17ad2bbb8781d510.tar.gz
bas-e9cd145e6de70f2c7f89571e17ad2bbb8781d510.tar.xz
bas-e9cd145e6de70f2c7f89571e17ad2bbb8781d510.zip
[webapp/groups] load into info if groups is opened via route
Diffstat (limited to 'webapp')
-rw-r--r--webapp/src/components/GroupModule.vue2
-rw-r--r--webapp/src/components/GroupModuleGroupView.vue3
-rw-r--r--webapp/src/store/groups.js6
3 files changed, 5 insertions, 6 deletions
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)