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
support starting with sections only for conceptual testing, refactoring of code required
Jonas Jabari7cc5b27f535f
diff --git a/modules/meeting/app/components/meeting_agenda_items/new_button_component.html.erb b/modules/meeting/app/components/meeting_agenda_items/new_button_component.html.erbindex 496bdd629fe..f950248b5fc 100644--- a/modules/meeting/app/components/meeting_agenda_items/new_button_component.html.erb+++ b/modules/meeting/app/components/meeting_agenda_items/new_button_component.html.erb@@ -21,7 +21,7 @@data: { "turbo-stream": true }})- unless @meeting_section || @meeting.sections.empty?+ unless @meeting_sectioncomponent.with_item(label: "Section",tag: :a,diff --git a/modules/meeting/app/components/meeting_sections/show_component.rb b/modules/meeting/app/components/meeting_sections/show_component.rbindex e3014290cf3..fc190c32fdd 100644--- a/modules/meeting/app/components/meeting_sections/show_component.rb+++ b/modules/meeting/app/components/meeting_sections/show_component.rb@@ -56,11 +56,13 @@ module MeetingSectionsenddef hide_section?- @meeting.sections.count == 1 && @meeting_agenda_items.empty?+ false+ # @meeting.sections.count == 1 && @meeting_agenda_items.empty? && @meeting_section.untitled?enddef render_section_wrapper?- @meeting_section.meeting.sections.count > 1+ # true+ !@meeting_section.untitled? || @meeting.sections.count > 1enddef render_new_button_in_section?diff --git a/modules/meeting/app/controllers/meeting_sections_controller.rb b/modules/meeting/app/controllers/meeting_sections_controller.rbindex e5c0e2dee31..3c5e7ca744d 100644--- a/modules/meeting/app/controllers/meeting_sections_controller.rb+++ b/modules/meeting/app/controllers/meeting_sections_controller.rb@@ -61,7 +61,8 @@ class MeetingSectionsController < ApplicationController.new(user: current_user).call({- meeting_id: @meeting.id+ meeting_id: @meeting.id,+ title: "New Section"})diff --git a/modules/meeting/app/forms/meeting_section/title.rb b/modules/meeting/app/forms/meeting_section/title.rbindex 788698479c2..41e71e5ccc2 100644--- a/modules/meeting/app/forms/meeting_section/title.rb+++ b/modules/meeting/app/forms/meeting_section/title.rb@@ -46,7 +46,7 @@ class MeetingSection::Title < ApplicationFormprivatedef init_value(meeting_section_form)- if meeting_section_form.builder.object.has_default_title?+ if meeting_section_form.builder.object.has_default_title? || meeting_section_form.builder.object.untitled?"" # will be set to "Untitled" in the model if left emptyelsemeeting_section_form.builder.object.titlediff --git a/modules/meeting/app/models/meeting_agenda_item.rb b/modules/meeting/app/models/meeting_agenda_item.rbindex abc2a61df89..d69ae64c049 100644--- a/modules/meeting/app/models/meeting_agenda_item.rb+++ b/modules/meeting/app/models/meeting_agenda_item.rb@@ -69,7 +69,7 @@ class MeetingAgendaItem < ApplicationRecorditem.duration_in_minutes_previously_changed? || item.position_previously_changed?}after_destroy :trigger_meeting_agenda_item_time_slots_calculation- after_destroy :delete_meeting_section_if_empty+ # after_destroy :delete_meeting_section_if_emptydef add_to_latest_meeting_sectionif meeting_section_id.nil?@@ -87,13 +87,13 @@ class MeetingAgendaItem < ApplicationRecordmeeting.calculate_agenda_item_time_slotsend- def delete_meeting_section_if_empty- # we need to delete the last existing section if the last meeting agenda item is deleted- # as we don't render the section (including the section menu) if only one section exists- # thus the section would silently exist in the database when the very last agenda item was deleted- # which makes UI rendering inconsistent- meeting_section.destroy if meeting_section.agenda_items.empty? && meeting.sections.count == 1- end+ # def delete_meeting_section_if_empty+ # # we need to delete the last existing section if the last meeting agenda item is deleted+ # # as we don't render the section (including the section menu) if only one section exists+ # # thus the section would silently exist in the database when the very last agenda item was deleted+ # # which makes UI rendering inconsistent+ # meeting_section.destroy if meeting_section.agenda_items.empty? && meeting.sections.count == 1+ # enddef linked_work_package?item_type == "work_package" && work_package.present?diff --git a/modules/meeting/app/models/meeting_section.rb b/modules/meeting/app/models/meeting_section.rbindex 6cea75cfc43..3ac9fa419df 100644--- a/modules/meeting/app/models/meeting_section.rb+++ b/modules/meeting/app/models/meeting_section.rb@@ -49,6 +49,10 @@ class MeetingSection < ApplicationRecordenddef has_default_title?+ title == "New Section" # TODO: I18n+ end++ def untitled?title == "Untitled" # TODO: I18nend