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

Always pass in the recurring_meeting object

Oliver Güntherface73ff4f44
diff --git a/modules/meeting/app/components/recurring_meetings/table_component.rb b/modules/meeting/app/components/recurring_meetings/table_component.rb
index 05ec85654e7..4f2fa9dfb9c 100644
--- a/modules/meeting/app/components/recurring_meetings/table_component.rb
+++ b/modules/meeting/app/components/recurring_meetings/table_component.rb
@@ -30,7 +30,13 @@
module RecurringMeetings
class TableComponent < ::OpPrimer::BorderBoxTableComponent
- options :current_project, :count, :direction, :max_count, :blankslate_title, :blankslate_desc
+ options :current_project,
+ :recurring_meeting,
+ :count,
+ :direction,
+ :max_count,
+ :blankslate_title,
+ :blankslate_desc
columns :start_time, :relative_time, :status, :create
@@ -79,12 +85,6 @@ module RecurringMeetings
@columns ||= headers.map(&:first)
end
- def recurring_meeting
- return if model.blank?
-
- @recurring_meeting ||= model.first.recurring_meeting
- end
-
def count
@count ||= [options[:count], rows.count].max
end
diff --git a/modules/meeting/app/views/recurring_meetings/_show_upcoming.html.erb b/modules/meeting/app/views/recurring_meetings/_show_upcoming.html.erb
index 18b9fce5bef..e3142af24c7 100644
--- a/modules/meeting/app/views/recurring_meetings/_show_upcoming.html.erb
+++ b/modules/meeting/app/views/recurring_meetings/_show_upcoming.html.erb
@@ -45,6 +45,7 @@ See COPYRIGHT and LICENSE files for more details.
subtitle: I18n.t("recurring_meeting.open.subtitle")
) %>
<%= render RecurringMeetings::TableComponent.new(
+ recurring_meeting: @recurring_meeting,
rows: @meetings,
current_project: @project,
count: @count,
@@ -61,6 +62,7 @@ See COPYRIGHT and LICENSE files for more details.
planned: true
) %>
<%= render RecurringMeetings::TableComponent.new(
+ recurring_meeting: @recurring_meeting,
rows: @planned_meetings,
current_project: @project,
count: @count,
diff --git a/modules/meeting/app/views/recurring_meetings/show.html.erb b/modules/meeting/app/views/recurring_meetings/show.html.erb
index 58596f3bacc..000da9eca2a 100644
--- a/modules/meeting/app/views/recurring_meetings/show.html.erb
+++ b/modules/meeting/app/views/recurring_meetings/show.html.erb
@@ -37,12 +37,13 @@ See COPYRIGHT and LICENSE files for more details.
<% else -%>
<% if @direction == "past" -%>
<%= render RecurringMeetings::TableComponent.new(
- rows: @meetings,
- current_project: @project,
- count: @count,
- direction: @direction,
- max_count: @max_count
- ) %>
+ recurring_meeting: @recurring_meeting,
+ rows: @meetings,
+ current_project: @project,
+ count: @count,
+ direction: @direction,
+ max_count: @max_count
+ ) %>
<% else -%>
<%= render partial: "show_upcoming" %>
<% end -%>