Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Replace "remove" button with an icon button

Henriette Dargeb24477bbde3a
diff --git a/app/components/work_packages/share/modal_body_component.html.erb b/app/components/work_packages/share/modal_body_component.html.erb
index 3398190902c..fc5bc15cce0 100644
--- a/app/components/work_packages/share/modal_body_component.html.erb
+++ b/app/components/work_packages/share/modal_body_component.html.erb
@@ -79,7 +79,11 @@
form_with(url: work_package_shares_bulk_path(@work_package),
method: :delete,
data: { 'work-packages--share--bulk-selection-target': 'bulkForm' }) do
- render(Primer::Beta::Button.new(type: :submit, scheme: :invisible)) { I18n.t('work_package.sharing.remove') }
+ render(Primer::Beta::IconButton.new(icon: "trash",
+ type: :submit,
+ scheme: :danger,
+ "aria-label": I18n.t('work_package.sharing.remove'),
+ test_selector: 'op-share-wp--bulk-remove'))
end
)
end
diff --git a/app/components/work_packages/share/share_row_component.html.erb b/app/components/work_packages/share/share_row_component.html.erb
index 7c5b1e8e885..ff4061b2ea6 100644
--- a/app/components/work_packages/share/share_row_component.html.erb
+++ b/app/components/work_packages/share/share_row_component.html.erb
@@ -28,7 +28,11 @@
user_row_grid.with_area(:remove, tag: :div) do
form_with url: work_packages_share_path(share), method: :delete do
- render(Primer::Beta::Button.new(type: :submit, scheme: :link)) { I18n.t('work_package.sharing.remove') }
+ render(Primer::Beta::IconButton.new(icon: "trash",
+ type: :submit,
+ scheme: :danger,
+ "aria-label": I18n.t('work_package.sharing.remove'),
+ test_selector: 'op-share-wp--remove'))
end
end
end
diff --git a/spec/support/components/work_packages/share_modal.rb b/spec/support/components/work_packages/share_modal.rb
index e2b4954fe23..edd8ad3f9b2 100644
--- a/spec/support/components/work_packages/share_modal.rb
+++ b/spec/support/components/work_packages/share_modal.rb
@@ -129,21 +129,21 @@ module Components
def expect_bulk_actions_available
within shares_header do
- expect(page).to have_button "Remove"
+ expect(page).to have_test_selector("op-share-wp--bulk-remove")
expect(page).to have_test_selector("op-share-wp-bulk-update-role")
end
end
def expect_bulk_actions_not_available
within shares_header do
- expect(page).to have_no_button("Remove", wait: 0)
+ expect(page).not_to have_test_selector("op-share-wp--bulk-remove", wait: 0)
expect(page).not_to have_test_selector("op-share-wp-bulk-update-role", wait: 0)
end
end
def bulk_remove
within shares_header do
- click_button "Remove"
+ page.find_test_selector("op-share-wp--bulk-remove").click
end
end
@@ -238,7 +238,7 @@ module Components
def remove_user(user)
within user_row(user) do
- click_button "Remove"
+ page.find_test_selector("op-share-wp--remove").click
end
end