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

Merge branch 'dev' into implementation/60959-separate-meeting-series-show-page-into-two-tables

Mir Bhatia853b7c5a2100
diff --cc modules/meeting/app/components/recurring_meetings/table_component.rb
index 733e85b7ec3,af74639b5a1..289c3c04b5d
--- a/modules/meeting/app/components/recurring_meetings/table_component.rb
+++ b/modules/meeting/app/components/recurring_meetings/table_component.rb
@@@ -39,7 -39,8 +39,8 @@@ module RecurringMeeting
end
def has_footer?
- return false unless recurring_meeting
+ return false unless recurring_meeting && rows.any?{ |r| r.id.nil? }
+ return true if options[:max_count].nil?
options[:max_count] - count > 0
end
diff --cc modules/meeting/app/components/recurring_meetings/table_header_component.html.erb
index 00ebb7a731a,00000000000..dd3846b36f3
mode 100644,000000..100644
--- a/modules/meeting/app/components/recurring_meetings/table_header_component.html.erb
+++ b/modules/meeting/app/components/recurring_meetings/table_header_component.html.erb
@@@ -1,46 -1,0 +1,60 @@@
+<%#-- copyright
+OpenProject is an open source project management software.
+Copyright (C) the OpenProject GmbH
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License version 3.
+
+OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
+Copyright (C) 2006-2013 Jean-Philippe Lang
+Copyright (C) 2010-2013 the ChiliProject Team
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+See COPYRIGHT and LICENSE files for more details.
+
+++#%>
+
+<%=
+ component_wrapper do
+ flex_layout do |flex|
- flex.with_row(mb: 2) do
- render(Primer::Beta::Heading.new(tag: :h3)) { @title }
++ flex.with_row(mb: 2, mt: space) do
++ # flex.with_column do
++ render(Primer::Beta::Heading.new(tag: :h3)) { @title }
++ # end
++
++ # flex.with_column do
++ # render(Primer::Beta::Button.new(
++ # tag: :a,
++ # mobile_label: I18n.t("recurring_meeting.template.label_view_template"),
++ # side: :medium,
++ # href: meeting_path(@meeting.template)
++ # )) do |button|
++ # button.with_leading_visual_icon(icon: :pencil)
++ # I18n.t("recurring_meeting.template.label_edit_template")
++ # end
++ # end
+ end
+
+ flex.with_row(mb: 2) do
+ render(Primer::Beta::Text.new(tag: :p)) do
+ @subtitle
+ end
+ end
+ end
+ end
+%>
+
+
diff --cc modules/meeting/app/components/recurring_meetings/table_header_component.rb
index 47f6569f6be,00000000000..a864e1969ad
mode 100644,000000..100644
--- a/modules/meeting/app/components/recurring_meetings/table_header_component.rb
+++ b/modules/meeting/app/components/recurring_meetings/table_header_component.rb
@@@ -1,42 -1,0 +1,50 @@@
+#-- copyright
+# OpenProject is an open source project management software.
+# Copyright (C) the OpenProject GmbH
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License version 3.
+#
+# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
+# Copyright (C) 2006-2013 Jean-Philippe Lang
+# Copyright (C) 2010-2013 the ChiliProject Team
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# See COPYRIGHT and LICENSE files for more details.
+#++
+
+module RecurringMeetings
+ class TableHeaderComponent < ApplicationComponent
+ include ApplicationHelper
+ include OpTurbo::Streamable
+ include OpPrimer::ComponentHelpers
+
- def initialize(title:, subtitle:)
++ def initialize(meeting:, title:, subtitle:, space: false)
+ super
+
++ @meeting = meeting
+ @title = title
+ @subtitle = subtitle
++ @space = space
++ end
++
++ private
++
++ def space
++ @space ? 2 : 0
+ end
+ end
+end
diff --cc modules/meeting/app/controllers/recurring_meetings_controller.rb
index 75cf76c3eda,9c5c71f7c29..eb89beec42a
--- a/modules/meeting/app/controllers/recurring_meetings_controller.rb
+++ b/modules/meeting/app/controllers/recurring_meetings_controller.rb
@@@ -41,16 -41,21 +41,21 @@@ class RecurringMeetingsController < App
@recurring_meeting = RecurringMeeting.new(project: @project)
end
- def show
+ def show # rubocop:disable Metrics/AbcSize
@direction = params[:direction]
@max_count = max_count
- @count = [(params[:count].to_i + 5), @max_count].min
+ @count =
+ if @max_count
+ [(params[:count].to_i + 5), @max_count].min
+ else
+ params[:count].to_i + 5
+ end
- @meetings = if @direction == "past"
- @recurring_meeting.scheduled_instances(upcoming: false).limit(@count)
- else
- upcoming_meetings(count: @count)
- end
+ if @direction == "past"
+ @meetings = @recurring_meeting.scheduled_instances(upcoming: false).limit(@count)
+ else
+ @meetings, @planned_meetings = upcoming_meetings(count: @count)
+ end
respond_to do |format|
format.html do
@@@ -226,27 -231,18 +231,23 @@@
end
def upcoming_meetings(count:)
-- meetings = @recurring_meeting
-- .scheduled_instances(upcoming: true)
++ instantiated = @recurring_meeting
++ .upcoming_not_cancelled_meetings
.index_by(&:start_time)
- size = 0
- counter = count
- while size <= 5
- merged = @recurring_meeting
- .scheduled_occurrences(limit: counter)
- .filter_map { |start_time| scheduled_meeting(start_time) unless meetings.include?(start_time) }
-
- cancelled = meetings.select { |_, meeting| meeting.cancelled == true }
- cancelled.each { |start_time, _| meetings.delete(start_time) }
- merged = @recurring_meeting
- .scheduled_occurrences(limit: count)
- .map do |start_time|
- meetings.delete(start_time) || scheduled_meeting(start_time)
- end
++ cancelled = @recurring_meeting
++ .upcoming_cancelled_meetings
++ .index_by(&:start_time)
+
- merged.concat(cancelled.values)
++ scheduled = @recurring_meeting
++ .scheduled_occurrences(limit: count + instantiated.count)
++ .reject { |start_time| instantiated.include?(start_time) }
++ .map { |start_time| cancelled[start_time] || scheduled_meeting(start_time) }
++ .first(count)
+
- counter += cancelled.blank? ? 1 : cancelled.count
- size = merged.count
- end
++ # binding.pry
- [meetings.values.sort_by(&:start_time), merged.sort_by(&:start_time).first(count)]
- # Ensure we keep any remaining future meetings that exceed the limit
- (merged + meetings.values).sort_by(&:start_time)
++ [instantiated.values.sort_by(&:start_time), scheduled]
end
def scheduled_meeting(start_time)
diff --cc modules/meeting/app/models/recurring_meeting.rb
index 9c0dd561e22,01ce9f1e962..0aeae17bd07
--- a/modules/meeting/app/models/recurring_meeting.rb
+++ b/modules/meeting/app/models/recurring_meeting.rb
@@@ -186,6 -194,6 +194,27 @@@ class RecurringMeeting < ApplicationRec
.order(start_time: direction)
end
++ def upcoming_not_cancelled_meetings
++ # filter_scope = upcoming ? :upcoming : :past
++ # direction = upcoming ? :asc : :desc
++
++ scheduled_meetings
++ .includes(:meeting)
++ .upcoming
++ .not_cancelled
++ .order(start_time: :asc)
++ end
++
++ def upcoming_cancelled_meetings
++ # filter_scope = upcoming ? :upcoming : :past
++ # direction = upcoming ? :asc : :desc
++
++ scheduled_meetings
++ .upcoming
++ .cancelled
++ .order(start_time: :asc)
++ end
++
private
def unset_schedule
diff --cc modules/meeting/app/views/recurring_meetings/show.html.erb
index 8f42d75e3e9,476c3b1dbdd..fc40e40eb51
--- a/modules/meeting/app/views/recurring_meetings/show.html.erb
+++ b/modules/meeting/app/views/recurring_meetings/show.html.erb
@@@ -35,12 -35,5 +35,12 @@@ See COPYRIGHT and LICENSE files for mor
<% if @recurring_meeting.nil? -%>
<%= no_results_box %>
<% else -%>
- <%= render RecurringMeetings::TableComponent.new(rows: @meetings, current_project: @project, count: @count, direction: @direction, max_count: @max_count) %>
+ <% if @direction == "past" -%>
+ <%= render RecurringMeetings::TableComponent.new(rows: @meetings, current_project: @project, count: @count, direction: @direction, max_count: @max_count) %>
+ <% else -%>
- <%= render RecurringMeetings::TableHeaderComponent.new(title: I18n.t("recurring_meeting.agenda_opened.title"), subtitle: I18n.t("recurring_meeting.agenda_opened.subtitle")) %>
++ <%= render RecurringMeetings::TableHeaderComponent.new(meeting: @recurring_meeting, title: I18n.t("recurring_meeting.agenda_opened.title"), subtitle: I18n.t("recurring_meeting.agenda_opened.subtitle")) %>
+ <%= render RecurringMeetings::TableComponent.new(rows: @meetings, current_project: @project, count: @count, direction: @direction, max_count: @max_count) %>
- <%= render RecurringMeetings::TableHeaderComponent.new(title: I18n.t("recurring_meeting.planned.title"), subtitle: I18n.t("recurring_meeting.planned.subtitle")) %>
++ <%= render RecurringMeetings::TableHeaderComponent.new(meeting: @recurring_meeting, title: I18n.t("recurring_meeting.planned.title"), subtitle: I18n.t("recurring_meeting.planned.subtitle"), space: true) %>
+ <%= render RecurringMeetings::TableComponent.new(rows: @planned_meetings, current_project: @project, count: @count, direction: @direction, max_count: @max_count) %>
+ <% end -%>
<% end -%>
diff --cc modules/meeting/config/locales/en.yml
index 3c23d4845b7,4e49c570381..3e259e4079e
--- a/modules/meeting/config/locales/en.yml
+++ b/modules/meeting/config/locales/en.yml
@@@ -265,18 -267,7 +267,18 @@@ en
weekly_interval: "Every %{interval} weeks on %{weekday}"
frequency: "%{base} at %{time}"
full: "%{base} at %{time}, ends on %{end_date}"
+ never_ending: "%{base} at %{time}"
+ agenda_opened:
+ title: "Agenda opened"
+ subtitle: >
+ Open meetings have agendas that can be edited and show up in individual users’ ‘My meetings’ section.
+ Changes to the meeting series template do not affect already-open meeting occurrences.
+ planned:
+ title: "Planned"
+ subtitle: >
+ The following meetings are planned in the recurring meeting schedule but are not open yet.
+ Every time a planned meeting starts, the next one will automatically be opened for you.
+ You can also open planned meetings manually to import the template and start editing the agenda.
-
notice_successful_notification: "Notification sent successfully"
notice_timezone_missing: No time zone is set and %{zone} is assumed. To choose your time zone, please click here.