summaryrefslogtreecommitdiffstats
path: root/webapp/src/components/GroupModuleGroupView.vue
diff options
context:
space:
mode:
authorUdo Walter2018-08-07 05:25:44 +0200
committerUdo Walter2018-08-07 05:25:44 +0200
commit8f64402237a74ddb380b7e9650fa5897505a665f (patch)
tree692971f50fa7d442bf6fa3be959e72f588626774 /webapp/src/components/GroupModuleGroupView.vue
parentmerge (diff)
downloadbas-8f64402237a74ddb380b7e9650fa5897505a665f.tar.gz
bas-8f64402237a74ddb380b7e9650fa5897505a665f.tar.xz
bas-8f64402237a74ddb380b7e9650fa5897505a665f.zip
[groups] add ability to show all nested children and not just direkt children + bug fixes
Diffstat (limited to 'webapp/src/components/GroupModuleGroupView.vue')
-rw-r--r--webapp/src/components/GroupModuleGroupView.vue45
1 files changed, 35 insertions, 10 deletions
diff --git a/webapp/src/components/GroupModuleGroupView.vue b/webapp/src/components/GroupModuleGroupView.vue
index b9b81f2..cf38ba4 100644
--- a/webapp/src/components/GroupModuleGroupView.vue
+++ b/webapp/src/components/GroupModuleGroupView.vue
@@ -2,6 +2,8 @@
{
"en": {
"info": "Info",
+ "showall": "Show All",
+ "groups": "Groups",
"subgroups": "Subgroups",
"clients": "Clients",
"name": "Name",
@@ -10,6 +12,8 @@
},
"de": {
"info": "Info",
+ "showall": "Show All",
+ "groups": "Groups",
"subgroups": "Untergruppen",
"clients": "Clienten",
"name": "Name",
@@ -21,8 +25,8 @@
<template>
<div>
- <v-subheader>Info</v-subheader>
- <v-card>
+ <v-subheader v-if="group.id !== 0">Info</v-subheader>
+ <v-card v-if="group.id !== 0">
<v-card-text>
<v-layout wrap>
<v-flex lg4 md6 xs12 order-lg1 order-xs2>
@@ -88,8 +92,19 @@
</v-layout>
</v-card-text>
</v-card>
- <template v-if="group.id">
- <v-subheader>{{ $t('subgroups') }}</v-subheader>
+ <template v-if="group.id !== 'create'">
+ <v-layout>
+ <v-spacer></v-spacer>
+ <div><v-switch
+ :input-value="group.tabShowAll"
+ @change="setShowAll"
+ class="show-toggle"
+ :label="$t('showall')"
+ hide-details
+ color="primary"
+ ></v-switch></div>
+ </v-layout>
+ <v-subheader>{{ group.id > 0 ? $t('subgroups') : $t('groups') }}</v-subheader>
<group-module-group-list :tabIndex="tabIndex" :groupId="group.id" :groups="group.subgroups" />
<v-subheader>{{ $t('clients') }}</v-subheader>
<group-module-client-list :tabIndex="tabIndex" :groupId="group.id" :clients="group.clients" />
@@ -118,9 +133,6 @@ export default {
parentIds: []
}
},
- created () {
- if (!this.group.id) this.editInfo()
- },
watch: {
group (newValue, oldValue) {
if (!newValue.id) this.editInfo()
@@ -128,6 +140,10 @@ export default {
}
},
methods: {
+ setShowAll (value) {
+ this.$store.commit('groups/setShowAll', { index: this.tabIndex, value })
+ this.$store.dispatch('groups/loadGroup', { id: this.group.id, tabIndex: this.tabIndex, reload: true })
+ },
removeParent (id) {
this.parentIds.splice(this.parentIds.indexOf(id), 1)
},
@@ -139,9 +155,10 @@ export default {
},
cancelEdit () {
this.editMode = false
- if (this.group.id) return
- this.$store.commit('groups/deleteFromTabChain', { index: this.tabIndex, count: 1 })
- this.$store.commit('groups/setActiveTab', this.tabIndex - 1)
+ if (this.group.id === 'create') {
+ this.$store.commit('groups/deleteFromTabChain', { index: this.tabIndex, count: 1 })
+ this.$store.commit('groups/setActiveTab', this.tabIndex - 1)
+ }
},
saveInfo () {
this.$store.dispatch('groups/saveGroup', {
@@ -159,6 +176,9 @@ export default {
params: { id, noReload: true }
})
}
+ },
+ created () {
+ if (this.group.id === 'create') this.editInfo()
}
}
</script>
@@ -182,4 +202,9 @@ export default {
.info-text {
margin-left: 34px;
}
+.show-toggle {
+ margin-top: 20px;
+ margin-right: 20px;
+ margin-bottom: -20px;
+}
</style>