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
Update specs
Mir Bhatiad05dc5eb0bff
diff --git a/app/components/table_component.rb b/app/components/table_component.rbindex 5a3c186661a..fd5d0ba28d0 100644--- a/app/components/table_component.rb+++ b/app/components/table_component.rb@@ -146,7 +146,7 @@ class TableComponent < ApplicationComponentenddef test_selector- self.class.name.dasherize+ options.fetch(:test_selector) { self.class.name.dasherize }enddef rowsdiff --git a/modules/meeting/app/components/recurring_meetings/table_header_component.html.erb b/modules/meeting/app/components/recurring_meetings/table_header_component.html.erbindex ca857599766..4a8c64331e9 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@@ -30,7 +30,7 @@ See COPYRIGHT and LICENSE files for more details.<%=component_wrapper doflex_layout do |flex|- flex.with_row(mb: 2, mt: planned) do+ flex.with_row(mb: 2, mt: @planned ? 5 : 0) doflex_layout(justify_content: :space_between) do |container|container.with_column dorender(Primer::Beta::Heading.new(tag: :h3)) { @title }diff --git a/modules/meeting/app/components/recurring_meetings/table_header_component.rb b/modules/meeting/app/components/recurring_meetings/table_header_component.rbindex f8731af8920..84054b8179d 100644--- a/modules/meeting/app/components/recurring_meetings/table_header_component.rb+++ b/modules/meeting/app/components/recurring_meetings/table_header_component.rb@@ -42,11 +42,5 @@ module RecurringMeetings@subtitle = subtitle@planned = plannedend-- private-- def planned- @planned ? 5 : 0- endendenddiff --git a/modules/meeting/app/controllers/recurring_meetings_controller.rb b/modules/meeting/app/controllers/recurring_meetings_controller.rbindex 7f607662c20..cdab022c30f 100644--- a/modules/meeting/app/controllers/recurring_meetings_controller.rb+++ b/modules/meeting/app/controllers/recurring_meetings_controller.rb@@ -242,8 +242,8 @@ class RecurringMeetingsController < ApplicationController# Planned meetings consist of scheduled occurrences and cancelled meetings# Open meetings are removed from the scheduled occurrences as they are displayed separatelyplanned = @recurring_meeting- .scheduled_occurrences(limit: count + instantiated.count)- .reject { |start_time| instantiated.include?(start_time) }+ .scheduled_occurrences(limit: count + opened.count)+ .reject { |start_time| opened.include?(start_time) }.map { |start_time| cancelled[start_time] || scheduled_meeting(start_time) }.first(count)diff --git a/modules/meeting/app/views/recurring_meetings/show.html.erb b/modules/meeting/app/views/recurring_meetings/show.html.erbindex ba3cad360e3..81e2184a738 100644--- a/modules/meeting/app/views/recurring_meetings/show.html.erb+++ b/modules/meeting/app/views/recurring_meetings/show.html.erb@@ -36,11 +36,40 @@ See COPYRIGHT and LICENSE files for more details.<%= no_results_box %><% else -%><% if @direction == "past" -%>- <%= render RecurringMeetings::TableComponent.new(rows: @meetings, current_project: @project, count: @count, direction: @direction, max_count: @max_count) %>+ <%= render RecurringMeetings::TableComponent.new(+ rows: @meetings,+ current_project: @project,+ count: @count,+ direction: @direction,+ max_count: @max_count+ ) %><% else -%>- <%= 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(meeting: @recurring_meeting, title: I18n.t("recurring_meeting.planned.title"), subtitle: I18n.t("recurring_meeting.planned.subtitle"), planned: true) %>- <%= render RecurringMeetings::TableComponent.new(rows: @planned_meetings, current_project: @project, count: @count, direction: @direction, max_count: @max_count) %>+ <%= 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,+ test_selector: "agenda-opened-table"+ ) %>+ <%= render RecurringMeetings::TableHeaderComponent.new(+ meeting: @recurring_meeting,+ title: I18n.t("recurring_meeting.planned.title"),+ subtitle: I18n.t("recurring_meeting.planned.subtitle"),+ planned: true+ ) %>+ <%= render RecurringMeetings::TableComponent.new(+ rows: @planned_meetings,+ current_project: @project,+ count: @count,+ direction: @direction,+ max_count: @max_count,+ test_selector: "planned-table"+ ) %><% end -%><% end -%>diff --git a/modules/meeting/spec/requests/recurring_meetings/recurring_meetings_show_spec.rb b/modules/meeting/spec/requests/recurring_meetings/recurring_meetings_show_spec.rbindex 587a96d121a..ca3bd9636c8 100644--- a/modules/meeting/spec/requests/recurring_meetings/recurring_meetings_show_spec.rb+++ b/modules/meeting/spec/requests/recurring_meetings/recurring_meetings_show_spec.rb@@ -88,6 +88,44 @@ RSpec.describe "Recurring meetings show",endend+ describe "upcoming tab" do+ let!(:upcoming_open_meeting) do+ create(:structured_meeting, recurring_meeting:, start_time: Time.zone.today + 10.hours, state: :open)+ end+ let!(:open_meeting) do+ create :scheduled_meeting,+ meeting: upcoming_open_meeting,+ recurring_meeting:,+ start_time: Time.zone.today + 1.day + 10.hours+ end++ let!(:cancelled_meeting) do+ create :scheduled_meeting,+ recurring_meeting:,+ start_time: Time.zone.today + 2.days + 10.hours,+ cancelled: true+ end++ it "sorts meetings into two tables based on state" do+ get recurring_meeting_path(recurring_meeting)++ content = page.find_by_id("content")+ expect(content).to have_text "Agenda opened"+ expect(content).to have_text "Planned"++ open_meeting_date = format_time(open_meeting.start_time)+ cancelled_meeting_date = format_time(cancelled_meeting.start_time)+ scheduled_meeting_date = format_time(Time.zone.today + 2.days + 10.hours)++ agenda_opened = page.find("[data-test-selector='agenda-opened-table']")+ expect(agenda_opened).to have_text open_meeting_date++ planned = page.find("[data-test-selector='planned-table']")+ expect(planned).to have_text cancelled_meeting_date+ expect(planned).to have_text scheduled_meeting_date+ end+ end+describe "upcoming quick filter" docontext "with a rescheduled meeting" dolet!(:rescheduled_instance) do