Commit a56a02ee authored by pburdette's avatar pburdette

Add delete subscriptions

Add the ability to delete
pipeline subscriptions from
the UI.
parent 5cf068a4
......@@ -20,8 +20,9 @@
%tr
%th= _("Project")
%th= _("Author")
%th
%tbody
- @project.upstream_projects.each do |project|
= render 'projects/settings/subscriptions/project', project: project
- @project.downstream_projects.each do |project|
= render 'projects/settings/subscriptions/project', project: project
- @project.upstream_project_subscriptions.each do |subscription|
= render 'projects/settings/subscriptions/project', project: subscription.upstream_project, subscription: subscription
- @project.downstream_project_subscriptions.each do |subscription|
= render 'projects/settings/subscriptions/project', project: subscription.downstream_project, subscription: subscription
- tooltip = _('Delete subscription')
%tr
%td
= project.name
%td
= user_avatar_without_link(user: project.owner, size: 32)
= project.owner.name
%td.gl-text-right
= link_to project_subscription_path(@project, subscription.id), method: :delete, data: { toggle: 'tooltip', title: tooltip, container: 'body', testid: 'delete-subscription' }, class: "gl-button btn btn-danger" do
= sprite_icon('close', size: 16, css_class: 'gl-icon')
---
title: Delete pipeline subscriptions from the UI
merge_request: 45166
author:
type: added
......@@ -56,4 +56,18 @@ RSpec.describe 'Project Subscriptions', :js do
expect(page).to have_content('This project path either does not exist or you do not have access.')
end
it 'subscription is removed successfully' do
within '#pipeline-subscriptions' do
within 'form' do
fill_in 'upstream_project_path', with: upstream_project.full_path
click_on 'Subscribe'
end
end
find('[data-testid="delete-subscription"]').click
expect(page).to have_content('Subscription successfully deleted.')
end
end
......@@ -8606,6 +8606,9 @@ msgstr ""
msgid "Delete source branch"
msgstr ""
msgid "Delete subscription"
msgstr ""
msgid "Delete this attachment"
msgstr ""
......
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