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

Add submenu for agenda item move actions

Mir Bhatia3b7a284bc0fc
diff --git a/modules/meeting/app/components/meeting_agenda_items/item_component/show_component.html.erb b/modules/meeting/app/components/meeting_agenda_items/item_component/show_component.html.erb
index 246a67d1300..3e454e0d875 100644
--- a/modules/meeting/app/components/meeting_agenda_items/item_component/show_component.html.erb
+++ b/modules/meeting/app/components/meeting_agenda_items/item_component/show_component.html.erb
@@ -75,12 +75,24 @@
add_outcome_action_item(menu) if add_outcome_action?
end
- with_item_group(menu) { move_actions(menu) } unless first? && last?
-
with_item_group(menu) do
- move_to_current_meeting_action_item(menu) if in_backlog?
- move_to_backlog_action_item(menu) if !in_template? && !in_backlog?
- move_to_next_meeting_action_item(menu) if move_to_next_meeting_enabled?
+ menu.with_sub_menu_item(label: "Move") do |submenu|
+ with_item_group(submenu) { move_actions(submenu) } unless first? && last?
+
+ with_item_group(submenu) do
+ if !in_template? && !in_backlog?
+ move_to_backlog_action_item(submenu)
+ end
+
+ move_to_section_action_item(submenu)
+ end
+
+ with_item_group(submenu) do
+ move_to_next_meeting_action_item(submenu) if move_to_next_meeting_enabled?
+ end
+
+ submenu.with_divider if move_to_different_section_or_meeting_action_added?
+ end
end
with_item_group(menu) { delete_action_item(menu) }
diff --git a/modules/meeting/app/components/meeting_agenda_items/item_component/show_component.rb b/modules/meeting/app/components/meeting_agenda_items/item_component/show_component.rb
index 765d232dfc5..5b5358c191f 100644
--- a/modules/meeting/app/components/meeting_agenda_items/item_component/show_component.rb
+++ b/modules/meeting/app/components/meeting_agenda_items/item_component/show_component.rb
@@ -199,10 +199,10 @@ module MeetingAgendaItems
end
end
- def move_to_backlog_action_item(menu)
+ def move_to_section_action_item(menu)
return unless editable?
- menu.with_item(label: I18n.t(:label_agenda_item_move_to_backlog),
+ menu.with_item(label: "Move to section",
tag: :button,
content_arguments: { data: {
action: "click->meetings--add-params#interceptMoveTo",
@@ -225,6 +225,19 @@ module MeetingAgendaItems
end
end
+ def move_to_backlog_action_item(menu)
+ return unless editable?
+
+ menu.with_item(label: I18n.t(:label_agenda_item_move_to_backlog),
+ tag: :button,
+ content_arguments: { data: {
+ action: "click->meetings--add-params#interceptMoveTo",
+ href: drop_meeting_agenda_item_path(@meeting_agenda_item.meeting, @meeting_agenda_item, type: :to_backlog)
+ } }) do |item|
+ item.with_leading_visual_icon(icon: "discussion-outdated")
+ end
+ end
+
def notes_classes
if @meeting.open?
"op-uc-container override"
diff --git a/modules/meeting/spec/support/pages/meetings/show.rb b/modules/meeting/spec/support/pages/meetings/show.rb
index 0b1742cb27b..3ba4cb7cfa7 100644
--- a/modules/meeting/spec/support/pages/meetings/show.rb
+++ b/modules/meeting/spec/support/pages/meetings/show.rb
@@ -225,6 +225,9 @@ module Pages::Meetings
def select_action(item, action)
open_menu(item) do
+ if action.downcase.include?("move")
+ click_on "Move"
+ end
click_on action
end
end
@@ -644,6 +647,8 @@ module Pages::Meetings
def expect_backlog_actions(item, series: false)
open_menu(item) do
+ click_on "Move"
+
expect(page).to have_css(".ActionListItem-label", text: "Edit")
expect(page).to have_css(".ActionListItem-label", text: "Add notes")
expect(page).to have_css(".ActionListItem-label", text: "Move to current meeting")
@@ -651,6 +656,7 @@ module Pages::Meetings
expect(page).to have_no_css(".ActionListItem-label", text: "Move to backlog")
expect(page).to have_no_css(".ActionListItem-label", text: "Add outcome")
+
if series
expect(page).to have_no_css(".ActionListItem-label", text: "Move to next meeting")
end
@@ -663,8 +669,11 @@ module Pages::Meetings
def expect_non_backlog_actions(item, series: false)
open_menu(item) do
+ click_on "Move"
+
expect(page).to have_css(".ActionListItem-label", text: "Move to backlog")
expect(page).to have_no_css(".ActionListItem-label", text: "Move to current meeting")
+
if series
expect(page).to have_css(".ActionListItem-label", text: "Move to next meeting")
end