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
new schedule without end_time
Oliver Günther6022f18d2be9
diff --git a/modules/meeting/app/components/meetings/index/form_component.html.erb b/modules/meeting/app/components/meetings/index/form_component.html.erbindex df5076b39ab..b060c476473 100644--- a/modules/meeting/app/components/meetings/index/form_component.html.erb+++ b/modules/meeting/app/components/meetings/index/form_component.html.erb@@ -36,15 +36,15 @@endmodal_body.with_row(mt: 3) do- render(Meeting::TimeGroup.new(f, meeting: @meeting))+ render(Meeting::Location.new(f, meeting: @meeting))endmodal_body.with_row(mt: 3) do- render(Meeting::Duration.new(f, meeting: @meeting))+ render(Meeting::TimeGroup.new(f, meeting: @meeting))endmodal_body.with_row(mt: 3) do- render(Meeting::Location.new(f, meeting: @meeting))+ render(Meeting::Duration.new(f, meeting: @meeting))endif @meeting.is_a?(RecurringMeeting)@@ -69,7 +69,7 @@endmodal_body.with_row(mt: 1) do- render(RecurringMeeting::EndAfter.new(f))+ render(Primer::Beta::Text.new(font_size: :small, color: :subtle)) { @meeting.human_frequency_schedule }endmodal_body.with_row(mt: 3) dodiff --git a/modules/meeting/app/components/recurring_meetings/footer_component.rb b/modules/meeting/app/components/recurring_meetings/footer_component.rbindex a3666e06393..5a68df141e9 100644--- a/modules/meeting/app/components/recurring_meetings/footer_component.rb+++ b/modules/meeting/app/components/recurring_meetings/footer_component.rb@@ -49,7 +49,7 @@ module RecurringMeetingsif @direction == "past"I18n.t("label_recurring_meeting_more_past#{label_suffix}", count:)else- I18n.t("label_recurring_meeting_more#{label_suffix}", count:, schedule: @meeting.schedule_in_words)+ I18n.t("label_recurring_meeting_more#{label_suffix}", count:, schedule: @meeting.full_schedule_in_words)endendenddiff --git a/modules/meeting/app/components/recurring_meetings/show_page_header_component.rb b/modules/meeting/app/components/recurring_meetings/show_page_header_component.rbindex 20cc8aa68e4..757fe2c6fe9 100644--- a/modules/meeting/app/components/recurring_meetings/show_page_header_component.rb+++ b/modules/meeting/app/components/recurring_meetings/show_page_header_component.rb@@ -69,7 +69,7 @@ module RecurringMeetingsenddef page_description- @meeting.schedule_in_words+ @meeting.full_schedule_in_wordsenddef breadcrumb_itemsdiff --git a/modules/meeting/app/forms/recurring_meeting/interval.rb b/modules/meeting/app/forms/recurring_meeting/interval.rbindex c28f27f4505..4818d530ec6 100644--- a/modules/meeting/app/forms/recurring_meeting/interval.rb+++ b/modules/meeting/app/forms/recurring_meeting/interval.rb@@ -32,7 +32,6 @@ class RecurringMeeting::Interval < ApplicationFormname: :interval,type: :number,label: I18n.t("activerecord.attributes.recurring_meeting.interval"),- caption: I18n.t("recurring_meeting.interval.instructions"),data: {"recurring-meetings--form-target": "interval",action: "input->recurring-meetings--form#updateFrequencyText"diff --git a/modules/meeting/app/models/recurring_meeting.rb b/modules/meeting/app/models/recurring_meeting.rbindex 7711a705713..bfae6d86890 100644--- a/modules/meeting/app/models/recurring_meeting.rb+++ b/modules/meeting/app/models/recurring_meeting.rb@@ -88,31 +88,38 @@ class RecurringMeeting < ApplicationRecordendend- def schedule_in_words # rubocop:disable Metrics/AbcSize- base =- case frequency- when "daily"- interval == 1 ? human_frequency : I18n.t("recurring_meeting.in_words.daily_interval", interval: interval.ordinalize)- when "working_days"- if interval == 1- I18n.t("recurring_meeting.in_words.working_days")- else- I18n.t("recurring_meeting.in_words.working_days_interval", interval: interval.ordinalize)- end- when "weekly"- if interval == 1- I18n.t("recurring_meeting.in_words.weekly", weekday:)- else- I18n.t("recurring_meeting.in_words.weekly_interval", interval: interval.ordinalize, weekday:)- end+ def base_schedule+ case frequency+ when "daily"+ if interval == 1+ human_frequency+ else+ I18n.t("recurring_meeting.in_words.daily_interval", interval: interval.ordinalize)+ end+ when "working_days"+ I18n.t("recurring_meeting.in_words.working_days")+ when "weekly"+ if interval == 1+ I18n.t("recurring_meeting.in_words.weekly", weekday:)+ else+ I18n.t("recurring_meeting.in_words.weekly_interval", interval: interval.ordinalize, weekday:)end+ end+ end+ def full_schedule_in_wordsI18n.t("recurring_meeting.in_words.full",- base:,+ base: base_schedule,time: format_time(start_time, include_date: false),end_date: format_date(last_occurrence))end+ def human_frequency_schedule+ I18n.t("recurring_meeting.in_words.frequency",+ base: base_schedule,+ time: format_time(start_time, include_date: false))+ end+def scheduled_occurrences(limit:)schedule.next_occurrences(limit, Time.current)end@@ -197,4 +204,8 @@ class RecurringMeeting < ApplicationRecordrule.until(end_date.to_time(:utc))endend++ def set_defaults+ self.end_date ||= 1.year.from_now+ endenddiff --git a/modules/meeting/config/locales/en.yml b/modules/meeting/config/locales/en.ymlindex afe8b3e90ba..5141b7066cb 100644--- a/modules/meeting/config/locales/en.yml+++ b/modules/meeting/config/locales/en.yml@@ -216,9 +216,6 @@ en:empty_text: "Drag items here or create a new one"recurring_meeting:- interval:- instructions: >- Enter the number of days or weeks between each occurrence.occurrence:infoline: "This meeting is part of a recurring meeting series."error_no_next: "There is no next occurrence for this meeting."@@ -254,8 +251,9 @@ en:daily_interval: "Every %{interval} day"working_days: "Every working day"working_days_interval: "Every %{interval} working day"- weekly: "Weekly on %{weekday}"+ weekly: "Every week on %{weekday}"weekly_interval: "Every %{interval} week on %{weekday}"+ frequency: "%{base} at %{time}"full: "%{base} at %{time}, ends on %{end_date}"notice_successful_notification: "Notification sent successfully"