gitlab-org--gitlab-foss/app/assets/javascripts/groups/components/group_item.vue

42 lines
843 B
Vue
Raw Normal View History

<script>
import eventHub from '../event_hub';
export default {
props: {
group: {
type: Object,
required: true,
},
},
methods: {
toggleSubGroups() {
if (!this.group.hasSubgroups) {
2017-05-09 19:10:19 -04:00
return;
}
eventHub.$emit('toggleSubGroups', this.group);
},
},
};
</script>
<template>
2017-05-09 19:10:19 -04:00
<li @click="toggleSubGroups" class="list-group-item">
<span v-show="group.hasSubgroups">
2017-05-09 19:10:19 -04:00
<i
v-show="group.isOpen"
class="fa fa-caret-down"
aria-hidden="true" />
<i
v-show="!group.isOpen"
class="fa fa-caret-right"
aria-hidden="true"/>
</span>
<p><a :href="group.webUrl">{{group.fullName}}</a></p>
2017-05-09 19:10:19 -04:00
<p>{{group.description}}</p>
<group-folder v-if="group.subGroups && group.isOpen" :groups="group.subGroups" />
</li>
</template>