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
376a8c66
Commit
376a8c66
authored
Sep 05, 2017
by
Bob Van Landuyt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove the subgroups path on a group
parent
2eac1537
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
10 additions
and
39 deletions
+10
-39
app/controllers/groups_controller.rb
app/controllers/groups_controller.rb
+0
-4
app/views/groups/subgroups.html.haml
app/views/groups/subgroups.html.haml
+0
-21
config/routes/group.rb
config/routes/group.rb
+0
-1
spec/controllers/groups_controller_spec.rb
spec/controllers/groups_controller_spec.rb
+1
-0
spec/features/groups_spec.rb
spec/features/groups_spec.rb
+9
-13
No files found.
app/controllers/groups_controller.rb
View file @
376a8c66
...
...
@@ -60,11 +60,7 @@ class GroupsController < Groups::ApplicationController
end
end
def
subgroups
return
not_found
unless
Group
.
supports_nested_groups?
@nested_groups
=
GroupsFinder
.
new
(
current_user
,
parent:
group
).
execute
@nested_groups
=
@nested_groups
.
search
(
params
[
:filter_groups
])
if
params
[
:filter_groups
].
present?
end
def
activity
...
...
app/views/groups/subgroups.html.haml
deleted
100644 → 0
View file @
2eac1537
-
breadcrumb_title
"Details"
-
@no_container
=
true
=
render
'groups/home_panel'
.groups-header
{
class:
container_class
}
.top-area
=
render
'groups/show_nav'
.nav-controls
=
form_tag
request
.
path
,
method: :get
do
|
f
|
=
search_field_tag
:filter_groups
,
params
[
:filter_groups
],
placeholder:
'Filter by name'
,
class:
'form-control'
,
spellcheck:
false
-
if
can?
(
current_user
,
:create_subgroup
,
@group
)
=
link_to
new_group_path
(
parent_id:
@group
.
id
),
class:
'btn btn-new pull-right'
do
New Subgroup
-
if
@nested_groups
.
present?
%ul
.content-list
=
render
partial:
'shared/groups/group'
,
collection:
@nested_groups
,
locals:
{
full_name:
false
}
-
else
.nothing-here-block
There are no subgroups to show.
config/routes/group.rb
View file @
376a8c66
...
...
@@ -41,7 +41,6 @@ scope(path: 'groups/*id',
get
:merge_requests
,
as: :merge_requests_group
get
:projects
,
as: :projects_group
get
:activity
,
as: :activity_group
get
:subgroups
,
as: :subgroups_group
get
'/'
,
action: :show
,
as: :group_canonical
end
...
...
spec/controllers/groups_controller_spec.rb
View file @
376a8c66
...
...
@@ -157,6 +157,7 @@ describe GroupsController do
context
'as a user'
do
before
do
sign_in
(
user
)
pending
(
'spec the children path instead'
)
end
it
'shows all subgroups'
do
...
...
spec/features/groups_spec.rb
View file @
376a8c66
...
...
@@ -90,7 +90,10 @@ feature 'Group' do
context
'as admin'
do
before
do
visit
subgroups_group_path
(
group
)
visit
group_path
(
group
)
pending
(
'use the new subgroup button'
)
click_link
'New Subgroup'
end
...
...
@@ -111,7 +114,10 @@ feature 'Group' do
sign_out
(
:user
)
sign_in
(
user
)
visit
subgroups_group_path
(
group
)
visit
group_path
(
group
)
pending
(
'use the new subgroup button'
)
click_link
'New Subgroup'
fill_in
'Group path'
,
with:
'bar'
click_button
'Create group'
...
...
@@ -120,16 +126,6 @@ feature 'Group' do
expect
(
page
).
to
have_content
(
"Group 'bar' was successfully created."
)
end
end
context
'when nested group feature is disabled'
do
it
'renders 404'
do
allow
(
Group
).
to
receive
(
:supports_nested_groups?
).
and_return
(
false
)
visit
subgroups_group_path
(
group
)
expect
(
page
.
status_code
).
to
eq
(
404
)
end
end
end
it
'checks permissions to avoid exposing groups by parent_id'
do
...
...
@@ -213,8 +209,8 @@ feature 'Group' do
let!
(
:path
)
{
group_path
(
group
)
}
it
'has nested groups tab with nested groups inside'
do
pending
(
'the child should be visible on the show page'
)
visit
path
click_link
'Subgroups'
expect
(
page
).
to
have_content
(
nested_group
.
name
)
end
...
...
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