Fixed removing groups
This commit is contained in:
parent
11c0c65092
commit
73c4da1780
3 changed files with 17 additions and 2 deletions
|
@ -29,7 +29,12 @@ class Projects::GroupLinksController < Projects::ApplicationController
|
||||||
def destroy
|
def destroy
|
||||||
project.project_group_links.find(params[:id]).destroy
|
project.project_group_links.find(params[:id]).destroy
|
||||||
|
|
||||||
redirect_to namespace_project_group_links_path(project.namespace, project)
|
respond_to do |format|
|
||||||
|
format.html do
|
||||||
|
redirect_to namespace_project_group_links_path(project.namespace, project)
|
||||||
|
end
|
||||||
|
format.js { head :ok }
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
protected
|
protected
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
- group = local_assigns[:group]
|
- group = local_assigns[:group]
|
||||||
- group_link = local_assigns[:group_link]
|
- group_link = local_assigns[:group_link]
|
||||||
%li.member{ class: dom_class(group), id: dom_id(group) }
|
%li.member.group_member{ id: "group_member_#{group_link.id}" }
|
||||||
%span{ class: "list-item-name" }
|
%span{ class: "list-item-name" }
|
||||||
= image_tag group_icon(group), class: "avatar s40", alt: ''
|
= image_tag group_icon(group), class: "avatar s40", alt: ''
|
||||||
%strong
|
%strong
|
||||||
|
@ -21,6 +21,7 @@
|
||||||
= link_to namespace_project_group_link_path(@project.namespace, @project, group_link),
|
= link_to namespace_project_group_link_path(@project.namespace, @project, group_link),
|
||||||
remote: true,
|
remote: true,
|
||||||
method: :delete,
|
method: :delete,
|
||||||
|
data: { confirm: "Are you sure you want to remove #{group.name}?" },
|
||||||
class: 'btn btn-remove prepend-left-10' do
|
class: 'btn btn-remove prepend-left-10' do
|
||||||
%span.visible-xs-block
|
%span.visible-xs-block
|
||||||
Delete
|
Delete
|
||||||
|
|
|
@ -34,4 +34,13 @@ feature 'Projects > Members > Anonymous user sees members', feature: true, js: t
|
||||||
expect(page).to have_content('Expires in')
|
expect(page).to have_content('Expires in')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it 'deletes group link' do
|
||||||
|
page.within(first('.group_member')) do
|
||||||
|
find('.btn-remove').click
|
||||||
|
end
|
||||||
|
wait_for_ajax
|
||||||
|
|
||||||
|
expect(page).not_to have_selector('.group_member')
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue