summaryrefslogtreecommitdiffstats
path: root/webapp/src/components/GroupModule.vue
diff options
context:
space:
mode:
authorUdo Walter2018-08-01 22:17:33 +0200
committerUdo Walter2018-08-01 22:17:33 +0200
commitfaf1188d03e1302dd615a118bce73dd6197be8f1 (patch)
tree207d484a6d68f3d77bc49815ea92c13f4da057c3 /webapp/src/components/GroupModule.vue
parent[server/idoit] iDoIT api call returns now the object itself and the childs. (diff)
downloadbas-faf1188d03e1302dd615a118bce73dd6197be8f1.tar.gz
bas-faf1188d03e1302dd615a118bce73dd6197be8f1.tar.xz
bas-faf1188d03e1302dd615a118bce73dd6197be8f1.zip
[groups] add edit functionality to group infos
Diffstat (limited to 'webapp/src/components/GroupModule.vue')
-rw-r--r--webapp/src/components/GroupModule.vue36
1 files changed, 14 insertions, 22 deletions
diff --git a/webapp/src/components/GroupModule.vue b/webapp/src/components/GroupModule.vue
index b690628..a1a445c 100644
--- a/webapp/src/components/GroupModule.vue
+++ b/webapp/src/components/GroupModule.vue
@@ -14,24 +14,21 @@
<v-card>
<v-tabs :value="activeTab" @input="setActiveTab" :dark="tabsDark" :color="tabsColor" :slider-color="tabsSliderColor">
<template v-for="(item, index) in tabChain">
- <v-icon v-if="item.id > 0" :key="2*index">keyboard_arrow_right</v-icon>
- <v-tab :key="2*index+1" ripple>
- <v-icon v-if="item.id === 0">home</v-icon>
- <template v-else>
- <v-icon v-if="item.isClient" style="margin-right: 10px">computer</v-icon>
- {{ item.name ? item.name : item.id }}
- </template>
+ <v-icon v-if="item.tabType !== 'home'" :key="'arrow' + index">keyboard_arrow_right</v-icon>
+ <v-tab ripple :key="'tab' + index">
+ <v-icon v-if="item.tabType === 'home'">home</v-icon>
+ <v-icon v-if="item.tabType === 'client'" style="margin-right: 10px">computer</v-icon>
+ <template v-if="item.tabType !== 'home'">{{ item.name ? item.name : item.id }}</template>
</v-tab>
</template>
</v-tabs>
</v-card>
<v-tabs-items :value="activeTab" @input="setActiveTab" touchless style="padding-bottom: 20px">
- <template v-for="(item, index) in tabChain">
- <v-tab-item :key="index">
- <group-module-group-view :tabIndex="index" v-if="!item.isClient" />
- <group-module-client-view v-else />
- </v-tab-item>
- </template>
+ <v-tab-item v-for="(item, index) in tabChain" :key="index">
+ <group-module-home-view v-if="item.tabType === 'home'" :home="item" />
+ <group-module-group-view v-if="item.tabType === 'group'" :group="item" :tabIndex="index" />
+ <group-module-client-view v-if="item.tabType === 'client'" :client="item" />
+ </v-tab-item>
</v-tabs-items>
</v-flex>
</v-layout>
@@ -39,6 +36,7 @@
</template>
<script>
+import GroupModuleHomeView from '@/components/GroupModuleHomeView'
import GroupModuleGroupView from '@/components/GroupModuleGroupView'
import GroupModuleClientView from '@/components/GroupModuleClientView'
import { mapState, mapGetters, mapMutations } from 'vuex'
@@ -46,6 +44,7 @@ import { mapState, mapGetters, mapMutations } from 'vuex'
export default {
name: 'GroupModule',
components: {
+ GroupModuleHomeView,
GroupModuleGroupView,
GroupModuleClientView
},
@@ -55,21 +54,14 @@ export default {
},
computed: {
...mapGetters(['tabsDark', 'tabsColor', 'tabsSliderColor']),
- ...mapState('groups', ['groupChain', 'client', 'activeTab']),
- tabChain () {
- if (this.client) return this.groupChain.concat({ isClient: true, ...this.client })
- else return this.groupChain
- }
+ ...mapState('groups', ['tabChain', 'client', 'activeTab'])
},
methods: {
...mapMutations('groups', ['setActiveTab'])
},
created () {
this.$store.dispatch('groups/loadLists')
- this.$store.dispatch('groups/loadRoot')
- },
- destroyed () {
- this.$store.commit('groups/resetStore')
+ this.$store.dispatch('groups/loadHome')
}
}
</script>