BigW Consortium Gitlab

Commit 376a8c66 by Bob Van Landuyt

Remove the subgroups path on a group

parent 2eac1537
......@@ -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
......
- 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.
......@@ -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
......
......@@ -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
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment