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
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
WIP
Mir Bhatia0e95ed191f33
diff --git a/modules/meeting/app/components/recurring_meetings/table_component.rb b/modules/meeting/app/components/recurring_meetings/table_component.rbindex 5b92be0e4ae..733e85b7ec3 100644--- a/modules/meeting/app/components/recurring_meetings/table_component.rb+++ b/modules/meeting/app/components/recurring_meetings/table_component.rb@@ -39,7 +39,7 @@ module RecurringMeetingsenddef has_footer?- return false unless recurring_meeting+ return false unless recurring_meeting && rows.any?{ |r| r.id.nil? }options[:max_count] - count > 0enddiff --git a/modules/meeting/app/components/recurring_meetings/table_header_component.html.erb b/modules/meeting/app/components/recurring_meetings/table_header_component.html.erbnew file mode 100644index 00000000000..00ebb7a731a--- /dev/null+++ b/modules/meeting/app/components/recurring_meetings/table_header_component.html.erb@@ -0,0 +1,46 @@+<%#-- 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 }+ end++ flex.with_row(mb: 2) do+ render(Primer::Beta::Text.new(tag: :p)) do+ @subtitle+ end+ end+ end+ end+%>++diff --git a/modules/meeting/app/components/recurring_meetings/table_header_component.rb b/modules/meeting/app/components/recurring_meetings/table_header_component.rbnew file mode 100644index 00000000000..47f6569f6be--- /dev/null+++ b/modules/meeting/app/components/recurring_meetings/table_header_component.rb@@ -0,0 +1,42 @@+#-- 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:)+ super++ @title = title+ @subtitle = subtitle+ end+ end+enddiff --git a/modules/meeting/app/controllers/recurring_meetings_controller.rb b/modules/meeting/app/controllers/recurring_meetings_controller.rbindex 9f37db89d7f..75cf76c3eda 100644--- a/modules/meeting/app/controllers/recurring_meetings_controller.rb+++ b/modules/meeting/app/controllers/recurring_meetings_controller.rb@@ -46,11 +46,11 @@ class RecurringMeetingsController < ApplicationController@max_count = max_count@count = [(params[:count].to_i + 5), @max_count].min- @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)+ endrespond_to do |format|format.html do@@ -230,14 +230,23 @@ class RecurringMeetingsController < ApplicationController.scheduled_instances(upcoming: true).index_by(&:start_time)- merged = @recurring_meeting- .scheduled_occurrences(limit: count)- .map do |start_time|- meetings.delete(start_time) || scheduled_meeting(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.concat(cancelled.values)++ counter += cancelled.blank? ? 1 : cancelled.count+ size = merged.countend- # Ensure we keep any remaining future meetings that exceed the limit- (merged + meetings.values).sort_by(&:start_time)+ [meetings.values.sort_by(&:start_time), merged.sort_by(&:start_time).first(count)]enddef scheduled_meeting(start_time)diff --git a/modules/meeting/app/views/recurring_meetings/show.html.erb b/modules/meeting/app/views/recurring_meetings/show.html.erbindex 476c3b1dbdd..8f42d75e3e9 100644--- a/modules/meeting/app/views/recurring_meetings/show.html.erb+++ b/modules/meeting/app/views/recurring_meetings/show.html.erb@@ -35,5 +35,12 @@ See COPYRIGHT and LICENSE files for more details.<% 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::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::TableComponent.new(rows: @planned_meetings, current_project: @project, count: @count, direction: @direction, max_count: @max_count) %>+ <% end -%><% end -%>diff --git a/modules/meeting/config/locales/en.yml b/modules/meeting/config/locales/en.ymlindex 3a055257032..3c23d4845b7 100644--- a/modules/meeting/config/locales/en.yml+++ b/modules/meeting/config/locales/en.yml@@ -265,6 +265,18 @@ en:weekly_interval: "Every %{interval} weeks on %{weekday}"frequency: "%{base} at %{time}"full: "%{base} at %{time}, ends on %{end_date}"+ 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.