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
Fix various bugs
Dombi Attilaab8bee4b8961
diff --git a/modules/meeting/app/components/meeting_agenda_items/form_component.rb b/modules/meeting/app/components/meeting_agenda_items/form_component.rbindex 5129f725856..3625ceb173d 100644--- a/modules/meeting/app/components/meeting_agenda_items/form_component.rb+++ b/modules/meeting/app/components/meeting_agenda_items/form_component.rb@@ -43,6 +43,10 @@ module MeetingAgendaItems@type = typeend+ def wrapper_uniq_by+ @meeting_agenda_item.id+ end+def render?User.current.allowed_in_project?(:manage_agendas, @meeting.project)enddiff --git a/modules/meeting/app/models/meeting.rb b/modules/meeting/app/models/meeting.rbindex 809e67c6156..2f76537a651 100644--- a/modules/meeting/app/models/meeting.rb+++ b/modules/meeting/app/models/meeting.rb@@ -62,11 +62,11 @@ class Meeting < ApplicationRecordacts_as_watchable permission: :view_meetingsacts_as_searchable columns: [- "#{table_name}.title",- "#{MeetingContent.table_name}.text",- "#{MeetingAgendaItem.table_name}.title",- "#{MeetingAgendaItem.table_name}.notes"- ],+ "#{table_name}.title",+ "#{MeetingContent.table_name}.text",+ "#{MeetingAgendaItem.table_name}.title",+ "#{MeetingAgendaItem.table_name}.notes"+ ],include: %i[contents project agenda_items],references: %i[meeting_contents agenda_items],date_column: "#{table_name}.created_at"diff --git a/modules/meeting/app/services/meeting_agenda_items/create_service.rb b/modules/meeting/app/services/meeting_agenda_items/create_service.rbindex 62faca01092..a8d7e9f5670 100644--- a/modules/meeting/app/services/meeting_agenda_items/create_service.rb+++ b/modules/meeting/app/services/meeting_agenda_items/create_service.rb@@ -29,5 +29,14 @@module MeetingAgendaItemsclass CreateService < ::BaseServices::Createinclude AfterPerformHook++ alias_method :original_after_perform, :after_perform++ def after_perform(call)+ # The reload is required because, the time slot calculations are changing the+ # `start_time`, `end_time` attributes and they should be available for rendering.+ call.result.reload+ original_after_perform(call)+ endendenddiff --git a/modules/meeting/spec/features/structured_meetings/structured_meeting_crud_spec.rb b/modules/meeting/spec/features/structured_meetings/structured_meeting_crud_spec.rbindex 6b1eb45f04e..a5a67e278d5 100644--- a/modules/meeting/spec/features/structured_meetings/structured_meeting_crud_spec.rb+++ b/modules/meeting/spec/features/structured_meetings/structured_meeting_crud_spec.rb@@ -132,7 +132,6 @@ RSpec.describe 'Structured meetings CRUD',find_field('Title').send_keys :escapeendshow_page.expect_item_edit_form(first, visible: false)-# Can removeshow_page.remove_agenda_item firstshow_page.assert_agenda_order! 'Updated title', 'Second'@@ -155,13 +154,14 @@ RSpec.describe 'Structured meetings CRUD',endshow_page.select_action(item, I18n.t(:label_sort_lowest))+ show_page.cancel_add_formshow_page.add_agenda_item dofill_in 'Title', with: 'My agenda item'fill_in 'Duration in minutes', with: '25'- click_button 'Save'end+ show_page.expect_agenda_item title: 'My agenda item'my_item = MeetingAgendaItem.find_by!(title: 'My agenda item')show_page.edit_agenda_item(my_item) do@@ -173,6 +173,7 @@ RSpec.describe 'Structured meetings CRUD',show_page.expect_item_edit_form(second)show_page.expect_item_edit_title(second, 'Second edited')+ show_page.cancel_edit_form(second)# user can see actionsexpect(page).to have_css('#meeting-agenda-items-new-button-component')diff --git a/modules/meeting/spec/support/pages/structured_meeting/show.rb b/modules/meeting/spec/support/pages/structured_meeting/show.rbindex 895a703ead5..80cf54d2a81 100644--- a/modules/meeting/spec/support/pages/structured_meeting/show.rb+++ b/modules/meeting/spec/support/pages/structured_meeting/show.rb@@ -34,20 +34,30 @@ module Pages::StructuredMeetingexpect(page).not_to have_css('[id^="meeting-agenda-items-item-component"]')end- def add_agenda_item(type: MeetingAgendaItem, &block)- page.within('#content') do+ def add_agenda_item(type: MeetingAgendaItem, &)+ page.within("#meeting-agenda-items-new-button-component") doclick_button I18n.t(:button_add)+ click_link type.model_name.humanend- click_link type.model_name.human-- in_agenda_form(&block)-- click_button 'Save'+ in_agenda_form do+ yield+ click_button 'Save'+ endenddef cancel_add_form- page.find('#meeting-agenda-items-new-component a', text: I18n.t(:button_cancel)).click+ page.within('#meeting-agenda-items-new-component') do+ click_link I18n.t(:button_cancel)+ expect(page).not_to have_link I18n.t(:button_cancel)+ end+ end++ def cancel_edit_form(item)+ page.within("#meeting-agenda-items-item-component-#{item.id}") do+ click_link I18n.t(:button_cancel)+ expect(page).not_to have_link I18n.t(:button_cancel)+ endenddef in_agenda_form(&)@@ -95,30 +105,34 @@ module Pages::StructuredMeetingenddef select_action(item, action)- page.within("#meeting-agenda-items-item-component-#{item.id}") do- page.find_test_selector('op-meeting-agenda-actions').click+ retry_block do+ page.within("#meeting-agenda-items-item-component-#{item.id}") do+ page.find_test_selector('op-meeting-agenda-actions').click+ end+ page.find('.Overlay')endpage.within('.Overlay') do- click_on action+ click_on action # rubocop:disable Capybara/ClickLinkOrButtonStyleendenddef edit_agenda_item(item, &)select_action item, 'Edit'- page.within("#meeting-agenda-items-item-component-#{item.id} #meeting-agenda-items-form-component", &)+ expect_item_edit_form(item)+ page.within("#meeting-agenda-items-form-component-#{item.id}", &)enddef expect_item_edit_form(item, visible: true)expect(page).to have_conditional_selector(visible,- "#meeting-agenda-items-item-component-#{item.id} #meeting-agenda-items-form-component"+ "#meeting-agenda-items-form-component-#{item.id}")enddef expect_item_edit_title(item, value)- page.within("#meeting-agenda-items-item-component-#{item.id} #meeting-agenda-items-form-component") do+ page.within("#meeting-agenda-items-form-component-#{item.id}") dofind_field('Title', with: value)endend