From 807c94e41751c1ad40303fd56913a21d63ebfc08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20G=C3=BCnther?= Date: Wed, 4 Dec 2024 12:41:08 +0100 Subject: [PATCH] Render meetings with correct project link --- .../components/recurring_meetings/row_component.rb | 13 +++++++++++-- .../recurring_meetings/table_component.rb | 2 ++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/modules/meeting/app/components/recurring_meetings/row_component.rb b/modules/meeting/app/components/recurring_meetings/row_component.rb index 16c7dc0104b5..109d6b92979c 100644 --- a/modules/meeting/app/components/recurring_meetings/row_component.rb +++ b/modules/meeting/app/components/recurring_meetings/row_component.rb @@ -35,6 +35,7 @@ class RowComponent < ::OpPrimer::BorderBoxRowComponent delegate :recurring_meeting, to: :model delegate :project, to: :recurring_meeting delegate :schedule, to: :meeting + delegate :current_project, to: :table def instantiated? meeting.present? @@ -50,12 +51,20 @@ def column_args(column) def start_time if instantiated? - link_to start_time_title, meeting_path(meeting) + link_to start_time_title, current_project_meeting_path(meeting) else start_time_title end end + def current_project_meeting_path(meeting) + if current_project + project_meeting_path(current_project, meeting) + else + meeting_path(meeting) + end + end + def user_time_zone(time) helpers.in_user_zone(time) end @@ -181,7 +190,7 @@ def delete_action(menu) menu.with_item( label: I18n.t(:label_recurring_meeting_cancel), scheme: :danger, - href: meeting_path(meeting), + href: current_project_meeting_path(meeting), form_arguments: { method: :delete, data: { confirm: I18n.t("text_are_you_sure"), turbo: false } } diff --git a/modules/meeting/app/components/recurring_meetings/table_component.rb b/modules/meeting/app/components/recurring_meetings/table_component.rb index 3d5aea0673c5..cd446823d142 100644 --- a/modules/meeting/app/components/recurring_meetings/table_component.rb +++ b/modules/meeting/app/components/recurring_meetings/table_component.rb @@ -30,6 +30,8 @@ module RecurringMeetings class TableComponent < ::OpPrimer::BorderBoxTableComponent + options :current_project + columns :start_time, :relative_time, :last_edited, :status, :create def has_actions?