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

[#61309] Shorten the label of 'Mark all as read' in Notification center and trigger browser confirmation dialog

Kabiru Mwenja6ea705be24f3
diff --git a/app/components/notifications/index_sub_header_component.html.erb b/app/components/notifications/index_sub_header_component.html.erb
index 819b58d1ae8..d60ba3816d0 100644
--- a/app/components/notifications/index_sub_header_component.html.erb
+++ b/app/components/notifications/index_sub_header_component.html.erb
@@ -21,7 +21,7 @@
subheader.with_action_button(
tag: :a,
href: mark_all_read_notifications_path(**current_filters),
- data: { method: :post },
+ data: { method: :post, confirm: I18n.t("js.notifications.center.mark_all_read_confirmation") },
size: :medium,
aria: { label: I18n.t("js.notifications.center.mark_all_read") }
) do |button|
diff --git a/config/locales/js-en.yml b/config/locales/js-en.yml
index d888477bd91..d2694999b6d 100644
--- a/config/locales/js-en.yml
+++ b/config/locales/js-en.yml
@@ -695,8 +695,9 @@ en:
no_results:
at_all: "New notifications will appear here when there is activity that concerns you."
with_current_filter: "There are no notifications in this view at the moment"
- mark_all_read: "Mark all as read"
+ mark_all_read: "Clear all"
mark_as_read: "Mark as read"
+ mark_all_read_confirmation: "This will mark all notifications in this view as read. Are you sure you want to do this?"
text_update_date_by: "%{date} by"
total_count_warning: "Showing the %{newest_count} most recent notifications. %{more_count} more are not displayed."
empty_state:
diff --git a/spec/support/pages/notifications/center.rb b/spec/support/pages/notifications/center.rb
index 0539b219212..4d293d7f818 100644
--- a/spec/support/pages/notifications/center.rb
+++ b/spec/support/pages/notifications/center.rb
@@ -40,7 +40,9 @@ module Pages
end
def mark_all_read
- click_link_or_button "Mark all as read"
+ accept_confirm do
+ click_link_or_button "Clear all"
+ end
end
def mark_notification_as_read(notification)