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

Update backlog actions to match latest spec

Mir Bhatia03713343f10b
diff --git a/modules/meeting/app/components/meeting_sections/backlogs/clear_backlog_dialog_component.html.erb b/modules/meeting/app/components/meeting_sections/backlogs/clear_backlog_dialog_component.html.erb
index 29a2502af4a..05b1706bab6 100644
--- a/modules/meeting/app/components/meeting_sections/backlogs/clear_backlog_dialog_component.html.erb
+++ b/modules/meeting/app/components/meeting_sections/backlogs/clear_backlog_dialog_component.html.erb
@@ -2,8 +2,8 @@
render(
Primer::OpenProject::DangerDialog.new(
id: "meetings-clear-backlog-dialog",
- confirm_button_text: I18n.t(:label_recurring_meeting_series_end_now),
- title: I18n.t("recurring_meeting.end_series_dialog.title"),
+ confirm_button_text: I18n.t(:label_backlog_clear_button),
+ title: I18n.t(:label_backlog_clear),
form_arguments: {
action: clear_backlog_meeting_sections_path(@meeting),
method: :post
@@ -11,10 +11,8 @@
)
) do |dialog|
dialog.with_confirmation_message do |message|
- message.with_heading(tag: :h2) { I18n.t(:text_meeting_series_end_early_heading) }
- message.with_description_content(I18n.t(:text_meeting_series_end_early))
+ message.with_heading(tag: :h2) { I18n.t(:label_agenda_backlog_clear_title) }
+ message.with_description_content(I18n.t(:text_agenda_backlog_clear_description))
end
-
- dialog.with_confirmation_check_box_content(I18n.t("text_permanent_delete_confirmation_checkbox_label"))
end
%>
diff --git a/modules/meeting/app/components/meeting_sections/backlogs/header_component.html.erb b/modules/meeting/app/components/meeting_sections/backlogs/header_component.html.erb
index 7f4327b5032..2515c418469 100644
--- a/modules/meeting/app/components/meeting_sections/backlogs/header_component.html.erb
+++ b/modules/meeting/app/components/meeting_sections/backlogs/header_component.html.erb
@@ -9,6 +9,9 @@
flex.with_column(classes: "hide-when-print") do
render(Primer::Alpha::ActionMenu.new(data: { test_selector: "meeting-section-action-menu" })) do |menu|
menu.with_show_button(icon: "kebab-horizontal", "aria-label": t("settings.project_attributes.label_section_actions"), scheme: :invisible)
+ add_agenda_item_action(menu)
+ add_work_package_action(menu)
+ menu.with_divider
clear_action_item(menu)
end
end
diff --git a/modules/meeting/app/components/meeting_sections/backlogs/header_component.rb b/modules/meeting/app/components/meeting_sections/backlogs/header_component.rb
index b7bea03934b..475ac9d9c5e 100644
--- a/modules/meeting/app/components/meeting_sections/backlogs/header_component.rb
+++ b/modules/meeting/app/components/meeting_sections/backlogs/header_component.rb
@@ -59,7 +59,7 @@ module MeetingSections
def clear_action_item(menu)
menu.with_item(
- label: I18n.t(:label_recurring_meeting_series_delete),
+ label: I18n.t(:label_backlog_clear),
href: clear_backlog_dialog_meeting_sections_path(@meeting),
scheme: :danger,
tag: :a,
@@ -70,5 +70,29 @@ module MeetingSections
item.with_leading_visual_icon(icon: :trash)
end
end
+
+ def add_agenda_item_action(menu)
+ menu.with_item(
+ label: t("activerecord.models.meeting_agenda_item", count: 1),
+ href: new_meeting_agenda_item_path(@meeting, type: "simple", meeting_section_id: @backlog.id),
+ content_arguments: {
+ data: { "turbo-stream": true, "test-selector": "meeting-backlog-add-agenda-item-from-menu" }
+ }
+ ) do |item|
+ item.with_leading_visual_icon(icon: :plus)
+ end
+ end
+
+ def add_work_package_action(menu)
+ menu.with_item(
+ label: t("activerecord.models.work_package", count: 1),
+ href: new_meeting_agenda_item_path(@meeting, type: "work_package", meeting_section_id: @backlog.id),
+ content_arguments: {
+ data: { "turbo-stream": true, "test-selector": "meeting-backlog-add-work-package-from-menu" }
+ }
+ ) do |item|
+ item.with_leading_visual_icon(icon: :plus)
+ end
+ end
end
end
diff --git a/modules/meeting/app/controllers/meeting_agenda_items_controller.rb b/modules/meeting/app/controllers/meeting_agenda_items_controller.rb
index 73aa2ccfee4..77f5efe6676 100644
--- a/modules/meeting/app/controllers/meeting_agenda_items_controller.rb
+++ b/modules/meeting/app/controllers/meeting_agenda_items_controller.rb
@@ -292,7 +292,7 @@ class MeetingAgendaItemsController < ApplicationController
def assign_drop_params # rubocop:disable Metrics/AbcSize
@target_id, @position =
if params[:type] == "to_current"
- section = @meeting.sections.order(position: :desc).first
+ section = @meeting.sections.reorder(position: :desc).first
[section&.id, section&.last_position]
elsif params[:type] == "to_backlog"
[@meeting.backlog.id, @meeting.backlog.last_position]
diff --git a/modules/meeting/config/locales/en.yml b/modules/meeting/config/locales/en.yml
index fc12601cfbc..d2fef072055 100644
--- a/modules/meeting/config/locales/en.yml
+++ b/modules/meeting/config/locales/en.yml
@@ -435,6 +435,9 @@ en:
label_backlog_clear_button: "Clear all"
text_backlog_clear_error: "One or more errors occurred while trying to clear the backlog."
+ label_backlog_clear: "Clear backlog"
+ label_backlog_clear_button: "Clear all"
+
label_agenda_backlog: "Agenda backlog"
text_agenda_backlog: "This backlog is unique to this one-time meeting. You can drag items in and out to add or remove them from the meeting agenda."
label_agenda_backlog_clear_title: "Clear agenda backlog?"