summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorAlfredo Sumaran <alfredo@gitlab.com>2017-05-31 15:33:27 -0500
committerAlfredo Sumaran <alfredo@gitlab.com>2017-05-31 15:33:27 -0500
commit9cce9e735d89360ccead7151e74213a47a3b9e76 (patch)
treee1fcf7d436c3f7b0f5814d32e58ef162750f0295 /app
parentbfa371020e5a180c77a37c03d0f885eb2dcf2809 (diff)
downloadgitlab-ce-9cce9e735d89360ccead7151e74213a47a3b9e76.tar.gz
Move component visibility validation to parent component
Diffstat (limited to 'app')
-rw-r--r--app/assets/javascripts/groups/components/group_folder.vue7
-rw-r--r--app/assets/javascripts/groups/components/group_item.vue5
2 files changed, 5 insertions, 7 deletions
diff --git a/app/assets/javascripts/groups/components/group_folder.vue b/app/assets/javascripts/groups/components/group_folder.vue
index b99186a005e..dcf6f10e1ca 100644
--- a/app/assets/javascripts/groups/components/group_folder.vue
+++ b/app/assets/javascripts/groups/components/group_folder.vue
@@ -10,16 +10,11 @@ export default {
required: false,
},
},
- computed: {
- hasGroups() {
- return Object.keys(this.groups).length > 0;
- },
- },
};
</script>
<template>
- <ul class="content-list group-list-tree" v-show="hasGroups">
+ <ul class="content-list group-list-tree">
<group-item v-for="(group, index) in groups" :key="index" :group="group" :baseGroup="baseGroup" />
</ul>
</template>
diff --git a/app/assets/javascripts/groups/components/group_item.vue b/app/assets/javascripts/groups/components/group_item.vue
index 6fcc016110f..11b66610e29 100644
--- a/app/assets/javascripts/groups/components/group_item.vue
+++ b/app/assets/javascripts/groups/components/group_item.vue
@@ -87,6 +87,9 @@ export default {
return fullPath;
},
+ hasGroups() {
+ return Object.keys(this.group.subGroups).length > 0;
+ },
},
};
</script>
@@ -161,6 +164,6 @@ export default {
{{group.description}}
</div>
- <group-folder v-if="group.isOpen" :groups="group.subGroups" :baseGroup="group" />
+ <group-folder v-if="group.isOpen && hasGroups" :groups="group.subGroups" :baseGroup="group" />
</li>
</template>