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

Fix mobile behavior for recurring meeting show

Oliver Güntherfbbca745471b
diff --git a/modules/meeting/app/components/recurring_meetings/footer_component.html.erb b/modules/meeting/app/components/recurring_meetings/footer_component.html.erb
index f2ad27c9f2e..53564ae36fc 100644
--- a/modules/meeting/app/components/recurring_meetings/footer_component.html.erb
+++ b/modules/meeting/app/components/recurring_meetings/footer_component.html.erb
@@ -30,7 +30,7 @@ See COPYRIGHT and LICENSE files for more details.
<%=
component_wrapper do
flex_layout(justify_content: :space_between) do |flex|
- flex.with_column(classes: "ellipsis") do
+ flex.with_column do
render(Primer::BaseComponent.new(tag: :span, color: :muted)) do
concat render(Primer::Beta::Octicon.new(icon: :iterations, mr: 1, ml: 1))
concat render(Primer::Beta::Text.new(font_weight: :bold)) { label }
diff --git a/modules/meeting/app/components/recurring_meetings/row_component.rb b/modules/meeting/app/components/recurring_meetings/row_component.rb
index 27602c1e777..f60ff76d765 100644
--- a/modules/meeting/app/components/recurring_meetings/row_component.rb
+++ b/modules/meeting/app/components/recurring_meetings/row_component.rb
@@ -112,8 +112,7 @@ module RecurringMeetings
end
def create
- return unless copy_allowed?
- return if instantiated? || cancelled?
+ return unless creatable?
render(
Primer::Beta::Button.new(
@@ -143,6 +142,7 @@ module RecurringMeetings
"test-selector": "more-button"
})
+ open_action(menu)
delete_scheduled_action(menu)
ical_action(menu)
delete_action(menu)
@@ -150,6 +150,29 @@ module RecurringMeetings
end
end
+ def open_action(menu)
+ return unless creatable?
+
+ menu.with_item(
+ label: I18n.t(:label_recurring_meeting_create),
+ tag: :a,
+ href: init_project_recurring_meeting_path(
+ project,
+ model.recurring_meeting.id,
+ start_time: model.start_time.iso8601
+ ),
+ content_arguments: {
+ data: { turbo_method: :post }
+ }
+ ) do |item|
+ item.with_leading_visual_icon(icon: :"issue-opened")
+ end
+ end
+
+ def creatable?
+ copy_allowed? && !(instantiated? || cancelled?)
+ end
+
def ical_action(menu)
return unless instantiated? && !cancelled?
diff --git a/modules/meeting/app/components/recurring_meetings/table_component.rb b/modules/meeting/app/components/recurring_meetings/table_component.rb
index cbd808c4bac..867ccdfd8f0 100644
--- a/modules/meeting/app/components/recurring_meetings/table_component.rb
+++ b/modules/meeting/app/components/recurring_meetings/table_component.rb
@@ -41,6 +41,8 @@ module RecurringMeetings
columns :start_time, :relative_time, :status, :create
+ mobile_columns :start_time, :status
+
def has_actions?
true
end
diff --git a/modules/meeting/spec/support/pages/recurring_meeting/show.rb b/modules/meeting/spec/support/pages/recurring_meeting/show.rb
index 6914ef7da82..461ee09ea13 100644
--- a/modules/meeting/spec/support/pages/recurring_meeting/show.rb
+++ b/modules/meeting/spec/support/pages/recurring_meeting/show.rb
@@ -157,7 +157,8 @@ module Pages::RecurringMeeting
within("li", text: date) do
click_on "more-button"
- expect(page).to have_css(".ActionListItem-label", count: 1)
+ expect(page).to have_css(".ActionListItem-label", count: 2)
+ expect(page).to have_css(".ActionListItem-label", text: "Open")
expect(page).to have_css(".ActionListItem-label", text: "Cancel this occurrence")
# Close it again