Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
4c375338
Commit
4c375338
authored
May 09, 2017
by
Alfredo Sumaran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Set tree structure for groups
parent
4b488d72
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
50 additions
and
39 deletions
+50
-39
app/assets/javascripts/groups/components/group_folder.vue
app/assets/javascripts/groups/components/group_folder.vue
+18
-0
app/assets/javascripts/groups/components/group_item.vue
app/assets/javascripts/groups/components/group_item.vue
+21
-22
app/assets/javascripts/groups/components/groups.vue
app/assets/javascripts/groups/components/groups.vue
+5
-14
app/assets/javascripts/groups/index.js
app/assets/javascripts/groups/index.js
+6
-3
No files found.
app/assets/javascripts/groups/components/group_folder.vue
0 → 100644
View file @
4c375338
<
script
>
import
eventHub
from
'
../event_hub
'
;
export
default
{
props
:
{
groups
:
{
type
:
Array
,
required
:
true
,
},
},
};
</
script
>
<
template
>
<ul
class=
"list-group"
>
<group-item
v-for=
"group in groups"
:group=
"group"
/>
</ul>
</
template
>
app/assets/javascripts/groups/components/group_item.vue
View file @
4c375338
...
...
@@ -10,6 +10,10 @@ export default {
},
methods
:
{
toggleSubGroups
()
{
if
(
this
.
group
.
subGroups
&&
!
this
.
group
.
subGroups
.
length
)
{
return
;
}
eventHub
.
$emit
(
'
toggleSubGroups
'
,
this
.
group
);
},
},
...
...
@@ -17,26 +21,21 @@ export default {
</
script
>
<
template
>
<tr
@
click=
"toggleSubGroups"
>
<template
>
<td>
<span>
<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>
</td>
<td>
<div>
<a
:href=
"group.web_url"
>
{{
group
.
full_name
}}
</a>
</div>
<div>
{{
group
.
description
}}
</div>
</td>
</
template
>
</tr>
<li
@
click=
"toggleSubGroups"
class=
"list-group-item"
>
<span
v-show=
"group.subGroups && group.subGroups.length"
>
<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.web_url"
>
{{
group
.
full_name
}}
</a></p>
<p>
{{
group
.
description
}}
</p>
<group-folder
v-if=
"group.subGroups && group.isOpen"
:groups=
"group.subGroups"
/>
</li>
</
template
>
app/assets/javascripts/groups/components/groups.vue
View file @
4c375338
<
script
>
import
GroupsStore
from
'
../stores/groups_store
'
;
import
GroupsService
from
'
../services/groups_service
'
;
import
GroupItem
from
'
../components/group_item.vue
'
;
import
eventHub
from
'
../event_hub
'
;
export
default
{
components
:
{
'
group-item
'
:
GroupItem
,
},
data
()
{
const
store
=
new
GroupsStore
();
...
...
@@ -39,19 +34,15 @@ export default {
},
toggleSubGroups
(
group
)
{
GroupsStore
.
toggleSubGroups
(
group
);
this
.
fetchGroups
();
},
},
};
</
script
>
<
template
>
<table
class=
"table table-bordered"
>
<template
v-for=
"group in state.groups"
>
<tr
is=
"group-item"
:group=
"group"
/>
<tr
v-if=
"group.isOpen"
>
<td>
sub groups for
{{
group
.
name
}}
</td>
<td></td>
</tr>
</
template
>
</table>
<div>
<group-folder
:groups=
"state.groups"
/>
</div>
</
template
>
app/assets/javascripts/groups/index.js
View file @
4c375338
...
...
@@ -2,15 +2,18 @@
import
Vue
from
'
vue
'
;
import
GroupsComponent
from
'
./components/groups.vue
'
;
import
GroupFolder
from
'
./components/group_folder.vue
'
;
import
GroupItem
from
'
./components/group_item.vue
'
;
$
(()
=>
{
const
appEl
=
document
.
querySelector
(
'
#dashboard-group-app
'
);
Vue
.
component
(
'
groups-component
'
,
GroupsComponent
);
Vue
.
component
(
'
group-folder
'
,
GroupFolder
);
Vue
.
component
(
'
group-item
'
,
GroupItem
);
const
GroupsApp
=
new
Vue
({
el
:
appEl
,
components
:
{
'
groups-component
'
:
GroupsComponent
,
},
render
:
createElement
=>
createElement
(
'
groups-component
'
),
});
});
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment