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
Léo-Paul Géneau
gitlab-ce
Commits
a472f078
Commit
a472f078
authored
May 24, 2017
by
Alfredo Sumaran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove parent group prefix from current orphan group
[ci skip]
parent
5eb885e5
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
3 deletions
+36
-3
app/assets/javascripts/groups/components/group_folder.vue
app/assets/javascripts/groups/components/group_folder.vue
+5
-1
app/assets/javascripts/groups/components/group_item.vue
app/assets/javascripts/groups/components/group_item.vue
+31
-2
No files found.
app/assets/javascripts/groups/components/group_folder.vue
View file @
a472f078
...
...
@@ -5,6 +5,10 @@ export default {
type
:
Object
,
required
:
true
,
},
baseGroup
:
{
type
:
Object
,
required
:
false
,
},
},
computed
:
{
hasGroups
()
{
...
...
@@ -16,6 +20,6 @@ export default {
<
template
>
<ul
class=
"content-list group-list-tree"
v-show=
"hasGroups"
>
<group-item
v-for=
"(group, index) in groups"
:key=
"index"
:group=
"group"
/>
<group-item
v-for=
"(group, index) in groups"
:key=
"index"
:group=
"group"
:baseGroup=
"baseGroup"
/>
</ul>
</
template
>
app/assets/javascripts/groups/components/group_item.vue
View file @
a472f078
...
...
@@ -7,6 +7,10 @@ export default {
type
:
Object
,
required
:
true
,
},
baseGroup
:
{
type
:
Object
,
required
:
false
,
},
},
methods
:
{
toggleSubGroups
(
e
)
{
...
...
@@ -31,6 +35,31 @@ export default {
isExpandable
()
{
return
Object
.
keys
(
this
.
group
.
subGroups
).
length
>
0
;
},
fullPath
()
{
let
fullPath
=
''
;
if
(
this
.
group
.
isOrphan
)
{
// check if current group is baseGroup
if
(
this
.
baseGroup
)
{
// Remove baseGroup prefix from our current group.fullName. e.g:
// baseGroup.fullName: `level1`
// group.fullName: `level1 / level2 / level3`
// Result: `level2 / level3`
const
gfn
=
this
.
group
.
fullName
;
const
bfn
=
this
.
baseGroup
.
fullName
;
const
length
=
bfn
.
length
;
const
start
=
gfn
.
indexOf
(
bfn
);
fullPath
=
gfn
.
substr
(
start
+
length
+
2
);
}
else
{
fullPath
=
this
.
group
.
fullName
;
}
}
else
{
fullPath
=
this
.
group
.
name
;
}
return
fullPath
;
},
},
};
</
script
>
...
...
@@ -92,13 +121,13 @@ export default {
</div>
<div
class=
"title"
>
<a
:href=
"group.webUrl"
>
{{
group
.
isOrphan
?
group
.
fullName
:
group
.
name
}}
</a>
<a
:href=
"group.webUrl"
>
{{
fullPath
}}
</a>
</div>
<div
class=
"description"
>
{{
group
.
description
}}
</div>
<group-folder
v-if=
"group.isOpen"
:groups=
"group.subGroups"
/>
<group-folder
v-if=
"group.isOpen"
:groups=
"group.subGroups"
:baseGroup=
"group"
/>
</li>
</
template
>
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