Decorate server response objects
Set property defaults and match JS variable naming conventions
This commit is contained in:
parent
8b2eaa60fa
commit
fa6d7094ae
2 changed files with 11 additions and 6 deletions
|
@ -10,7 +10,7 @@ export default {
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
toggleSubGroups() {
|
toggleSubGroups() {
|
||||||
if (!this.group.subGroups || (this.group.subGroups && !this.group.subGroups.length)) {
|
if (!this.group.hasSubgroups) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ export default {
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<li @click="toggleSubGroups" class="list-group-item">
|
<li @click="toggleSubGroups" class="list-group-item">
|
||||||
<span v-show="group.subGroups && group.subGroups.length">
|
<span v-show="group.hasSubgroups">
|
||||||
<i
|
<i
|
||||||
v-show="group.isOpen"
|
v-show="group.isOpen"
|
||||||
class="fa fa-caret-down"
|
class="fa fa-caret-down"
|
||||||
|
@ -33,7 +33,7 @@ export default {
|
||||||
aria-hidden="true"/>
|
aria-hidden="true"/>
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<p><a :href="group.web_url">{{group.full_name}}</a></p>
|
<p><a :href="group.webUrl">{{group.fullName}}</a></p>
|
||||||
<p>{{group.description}}</p>
|
<p>{{group.description}}</p>
|
||||||
|
|
||||||
<group-folder v-if="group.subGroups && group.isOpen" :groups="group.subGroups" />
|
<group-folder v-if="group.subGroups && group.isOpen" :groups="group.subGroups" />
|
||||||
|
|
|
@ -18,9 +18,14 @@ export default class GroupsStore {
|
||||||
}
|
}
|
||||||
|
|
||||||
static decorateGroup(rawGroup) {
|
static decorateGroup(rawGroup) {
|
||||||
const group = rawGroup;
|
return {
|
||||||
group.isOpen = false;
|
fullName: rawGroup.name,
|
||||||
return group;
|
description: rawGroup.description,
|
||||||
|
webUrl: rawGroup.web_url,
|
||||||
|
parentId: rawGroup.parentId,
|
||||||
|
hasSubgroups: !!rawGroup.parent_id,
|
||||||
|
isOpen: false,
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
static toggleSubGroups(toggleGroup) {
|
static toggleSubGroups(toggleGroup) {
|
||||||
|
|
Loading…
Reference in a new issue