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

[#61306] Dialog text should use "Cancel occurrence"

Alexander Brandon Colesa42f8216de1c
diff --git a/modules/meeting/app/components/meetings/delete_dialog_component.html.erb b/modules/meeting/app/components/meetings/delete_dialog_component.html.erb
index 415a7dc9ba3..10b0ef49a47 100644
--- a/modules/meeting/app/components/meetings/delete_dialog_component.html.erb
+++ b/modules/meeting/app/components/meetings/delete_dialog_component.html.erb
@@ -31,6 +31,8 @@ See COPYRIGHT and LICENSE files for more details.
render(Primer::OpenProject::DangerDialog.new(
id:,
title:,
+ confirm_button_text:,
+ cancel_button_text:,
form_arguments: {
action: polymorphic_path([@project, @meeting.becomes(Meeting)]),
method: :delete,
diff --git a/modules/meeting/app/components/meetings/delete_dialog_component.rb b/modules/meeting/app/components/meetings/delete_dialog_component.rb
index 935a19c0680..f1fa3004a17 100644
--- a/modules/meeting/app/components/meetings/delete_dialog_component.rb
+++ b/modules/meeting/app/components/meetings/delete_dialog_component.rb
@@ -64,10 +64,26 @@ module Meetings
def confirmation_message
if recurring_meeting.present?
- t("meeting.delete_dialog.occurrence.confirmation_message_html", title: recurring_meeting.title)
+ t("meeting.delete_dialog.occurrence.confirmation_message_html")
else
t("meeting.delete_dialog.one_time.confirmation_message_html")
end
end
+
+ def confirm_button_text
+ if recurring_meeting.present?
+ I18n.t("meeting.delete_dialog.occurrence.confirm_button")
+ else
+ I18n.t("button_delete")
+ end
+ end
+
+ def cancel_button_text
+ if recurring_meeting.present?
+ I18n.t("button_close")
+ else
+ I18n.t("button_cancel")
+ end
+ end
end
end
diff --git a/modules/meeting/config/locales/en.yml b/modules/meeting/config/locales/en.yml
index ed6592ead40..17a1a9fd088 100644
--- a/modules/meeting/config/locales/en.yml
+++ b/modules/meeting/config/locales/en.yml
@@ -239,12 +239,13 @@ en:
confirmation_message_html: >
This action is not reversible. Please proceed with caution.
occurrence:
- title: "Delete meeting occurrence"
- heading: "Delete this meeting occurrence?"
+ title: "Cancel meeting occurrence"
+ heading: "Cancel this meeting occurrence?"
confirmation_message_html: >
- This meeting is part of a series called <strong>%{title}</strong>.
- This will only delete this particular occurrence and not the entire series.
+ Any meeting information not in the template will be lost.
+
Do you want to continue?
+ confirm_button: "Cancel occurrence"
blankslate:
title: "No meetings to display"
desc: "There are no meetings that meet the active filter criteria."
diff --git a/modules/meeting/spec/components/meetings/delete_dialog_component_spec.rb b/modules/meeting/spec/components/meetings/delete_dialog_component_spec.rb
index 5bb67d6c755..651b031ba58 100644
--- a/modules/meeting/spec/components/meetings/delete_dialog_component_spec.rb
+++ b/modules/meeting/spec/components/meetings/delete_dialog_component_spec.rb
@@ -82,11 +82,11 @@ RSpec.describe Meetings::DeleteDialogComponent, type: :component do
let(:meeting) { build_stubbed(:structured_meeting_template, recurring_meeting: series) }
it "shows a heading" do
- expect(subject).to have_text "Delete this meeting occurrence?"
+ expect(subject).to have_text "Cancel this meeting occurrence?"
end
- it "shows a message that the meeting is part of a series" do
- expect(subject).to have_text "meeting is part of a series"
+ it "shows a warning about potential information loss" do
+ expect(subject).to have_text "Any meeting information not in the template will be lost."
end
end
end
diff --git a/modules/meeting/spec/components/recurring_meetings/delete_scheduled_dialog_component_spec.rb b/modules/meeting/spec/components/recurring_meetings/delete_scheduled_dialog_component_spec.rb
index 0bb40390a6d..abfe691d2e0 100644
--- a/modules/meeting/spec/components/recurring_meetings/delete_scheduled_dialog_component_spec.rb
+++ b/modules/meeting/spec/components/recurring_meetings/delete_scheduled_dialog_component_spec.rb
@@ -74,4 +74,8 @@ RSpec.describe RecurringMeetings::DeleteScheduledDialogComponent, type: :compone
it "shows a heading" do
expect(subject).to have_text "Cancel this meeting occurrence?"
end
+
+ it "shows a warning about potential information loss" do
+ expect(subject).to have_text "Any meeting information not in the template will be lost."
+ end
end
diff --git a/modules/meeting/spec/features/recurring_meetings/recurring_meeting_crud_spec.rb b/modules/meeting/spec/features/recurring_meetings/recurring_meeting_crud_spec.rb
index 672c8f2fc2c..ea3388775ae 100644
--- a/modules/meeting/spec/features/recurring_meetings/recurring_meeting_crud_spec.rb
+++ b/modules/meeting/spec/features/recurring_meetings/recurring_meeting_crud_spec.rb
@@ -119,8 +119,8 @@ RSpec.describe "Recurring meetings CRUD",
show_page.visit!
show_page.cancel_occurrence date: "12/31/2024 01:30 PM"
- show_page.within_modal "Delete meeting occurrence" do
- click_on "Delete"
+ show_page.within_modal "Cancel meeting occurrence" do
+ click_on "Cancel occurrence"
end
expect_flash(type: :success, message: "Successful cancellation.")
@@ -134,7 +134,7 @@ RSpec.describe "Recurring meetings CRUD",
it "can cancel a planned occurrence from the show page" do
show_page.visit!
- show_page.cancel_planned_occurrence date: "01/07/2025 01:30 PM"
+ show_page.cancel_occurrence date: "01/07/2025 01:30 PM"
show_page.within_modal "Cancel meeting occurrence" do
click_on "Cancel occurrence"
end
@@ -175,8 +175,8 @@ RSpec.describe "Recurring meetings CRUD",
show_page.expect_planned_actions date: "01/07/2025 01:30 PM"
show_page.cancel_occurrence date: "12/31/2024 01:30 PM"
- show_page.within_modal "Delete meeting occurrence" do
- click_on "Delete"
+ show_page.within_modal "Cancel meeting occurrence" do
+ click_on "Cancel occurrence"
end
expect_flash(type: :success, message: "Successful cancellation.")
diff --git a/modules/meeting/spec/features/recurring_meetings/recurring_meeting_global_crud_spec.rb b/modules/meeting/spec/features/recurring_meetings/recurring_meeting_global_crud_spec.rb
index 62c5970abb3..50f748e2e73 100644
--- a/modules/meeting/spec/features/recurring_meetings/recurring_meeting_global_crud_spec.rb
+++ b/modules/meeting/spec/features/recurring_meetings/recurring_meeting_global_crud_spec.rb
@@ -107,8 +107,8 @@ RSpec.describe "Recurring meetings global CRUD", :js do
show_page.visit!
show_page.cancel_occurrence date: "12/31/2024 01:30 PM"
- show_page.within_modal "Delete meeting occurrence" do
- click_on "Delete"
+ show_page.within_modal "Cancel meeting occurrence" do
+ click_on "Cancel occurrence"
end
expect_flash(type: :success, message: "Successful cancellation.")
@@ -122,7 +122,7 @@ RSpec.describe "Recurring meetings global CRUD", :js do
it "can cancel a planned occurrence from the show page" do
show_page.visit!
- show_page.cancel_planned_occurrence date: "01/07/2025 01:30 PM"
+ show_page.cancel_occurrence date: "01/07/2025 01:30 PM"
show_page.within_modal "Cancel meeting occurrence" do
click_on "Cancel occurrence"
end
diff --git a/modules/meeting/spec/support/pages/recurring_meeting/show.rb b/modules/meeting/spec/support/pages/recurring_meeting/show.rb
index a7c0e6c34d0..959ba2144c4 100644
--- a/modules/meeting/spec/support/pages/recurring_meeting/show.rb
+++ b/modules/meeting/spec/support/pages/recurring_meeting/show.rb
@@ -101,15 +101,6 @@ module Pages::RecurringMeeting
click_on "Cancel this occurrence"
end
- expect_modal("Delete meeting occurrence")
- end
-
- def cancel_planned_occurrence(date:)
- within("li", text: date) do
- click_on "more-button"
- click_on "Cancel this occurrence"
- end
-
expect_modal("Cancel meeting occurrence")
end