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
0
Merge Requests
0
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
Boxiang Sun
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
Show 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 {
...
@@ -10,6 +10,10 @@ export default {
},
},
methods
:
{
methods
:
{
toggleSubGroups
()
{
toggleSubGroups
()
{
if
(
this
.
group
.
subGroups
&&
!
this
.
group
.
subGroups
.
length
)
{
return
;
}
eventHub
.
$emit
(
'
toggleSubGroups
'
,
this
.
group
);
eventHub
.
$emit
(
'
toggleSubGroups
'
,
this
.
group
);
},
},
},
},
...
@@ -17,10 +21,8 @@ export default {
...
@@ -17,10 +21,8 @@ export default {
</
script
>
</
script
>
<
template
>
<
template
>
<tr
@
click=
"toggleSubGroups"
>
<li
@
click=
"toggleSubGroups"
class=
"list-group-item"
>
<template
>
<span
v-show=
"group.subGroups && group.subGroups.length"
>
<td>
<span>
<i
<i
v-show=
"group.isOpen"
v-show=
"group.isOpen"
class=
"fa fa-caret-down"
class=
"fa fa-caret-down"
...
@@ -30,13 +32,10 @@ export default {
...
@@ -30,13 +32,10 @@ export default {
class=
"fa fa-caret-right"
class=
"fa fa-caret-right"
aria-hidden=
"true"
/>
aria-hidden=
"true"
/>
</span>
</span>
</td>
<td>
<p><a
:href=
"group.web_url"
>
{{
group
.
full_name
}}
</a></p>
<div>
<p>
{{
group
.
description
}}
</p>
<a
:href=
"group.web_url"
>
{{
group
.
full_name
}}
</a>
</div>
<group-folder
v-if=
"group.subGroups && group.isOpen"
:groups=
"group.subGroups"
/>
<div>
{{
group
.
description
}}
</div>
</li>
</td>
</
template
>
</tr>
</
template
>
</
template
>
app/assets/javascripts/groups/components/groups.vue
View file @
4c375338
<
script
>
<
script
>
import
GroupsStore
from
'
../stores/groups_store
'
;
import
GroupsStore
from
'
../stores/groups_store
'
;
import
GroupsService
from
'
../services/groups_service
'
;
import
GroupsService
from
'
../services/groups_service
'
;
import
GroupItem
from
'
../components/group_item.vue
'
;
import
eventHub
from
'
../event_hub
'
;
import
eventHub
from
'
../event_hub
'
;
export
default
{
export
default
{
components
:
{
'
group-item
'
:
GroupItem
,
},
data
()
{
data
()
{
const
store
=
new
GroupsStore
();
const
store
=
new
GroupsStore
();
...
@@ -39,19 +34,15 @@ export default {
...
@@ -39,19 +34,15 @@ export default {
},
},
toggleSubGroups
(
group
)
{
toggleSubGroups
(
group
)
{
GroupsStore
.
toggleSubGroups
(
group
);
GroupsStore
.
toggleSubGroups
(
group
);
this
.
fetchGroups
();
},
},
},
},
};
};
</
script
>
</
script
>
<
template
>
<
template
>
<table
class=
"table table-bordered"
>
<div>
<template
v-for=
"group in state.groups"
>
<group-folder
:groups=
"state.groups"
/>
<tr
is=
"group-item"
:group=
"group"
/>
</div>
<tr
v-if=
"group.isOpen"
>
<td>
sub groups for
{{
group
.
name
}}
</td>
<td></td>
</tr>
</
template
>
</table>
</
template
>
</
template
>
app/assets/javascripts/groups/index.js
View file @
4c375338
...
@@ -2,15 +2,18 @@
...
@@ -2,15 +2,18 @@
import
Vue
from
'
vue
'
;
import
Vue
from
'
vue
'
;
import
GroupsComponent
from
'
./components/groups.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
'
);
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
({
const
GroupsApp
=
new
Vue
({
el
:
appEl
,
el
:
appEl
,
components
:
{
'
groups-component
'
:
GroupsComponent
,
},
render
:
createElement
=>
createElement
(
'
groups-component
'
),
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