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 hidden display of participants dialog
Oliver Günther1c3f95ac90e9
diff --git a/modules/meeting/app/components/_index.sass b/modules/meeting/app/components/_index.sassindex c3880088011..2f17a54aef6 100644--- a/modules/meeting/app/components/_index.sass+++ b/modules/meeting/app/components/_index.sass@@ -1,4 +1,3 @@@import "./meeting_agenda_items/item_component/show_component.sass"@import "./meeting_agenda_items/form_component.sass"@import "./meetings/sidebar/state_component.sass"-@import "./meetings/sidebar/details_component.sass"diff --git a/modules/meeting/app/components/meetings/sidebar/details_component.html.erb b/modules/meeting/app/components/meetings/sidebar/details_component.html.erbindex a3fcbbcc3b4..462d10d66d7 100644--- a/modules/meeting/app/components/meetings/sidebar/details_component.html.erb+++ b/modules/meeting/app/components/meetings/sidebar/details_component.html.erb@@ -88,8 +88,8 @@details.with_row(mt: 2, classes: 'meeting-detail-participants', display: [nil, nil, :none]) dorender_meeting_attribute_row(:people) do- flex_layout do |duration|- duration.with_column(mr: 2) do+ flex_layout do |people|+ people.with_column(mr: 2) dorender(Primer::Beta::Text.new) doMeeting.human_attribute_name(:participant,@@ -98,21 +98,28 @@endend- duration.with_column(mr: 2) do- render(OpTurbo::OpPrimer::AsyncDialogComponent.new(- id: "edit-participants-dialog",- src: participants_dialog_meeting_path(@meeting),- size: :medium_portrait,- title: Meeting.human_attribute_name(:participants),- button_text: t("label_meeting_show_all_participants"),- button_attributes: {- scheme: :link,- font_weight: :normal- }))+ people.with_column(mr: 2) do+ render(Primer::Beta::Button.new(+ scheme: :link,+ underline: false,+ data: { 'show-dialog-id': "edit-participants-dialog" }+ )) do+ t("label_meeting_show_all_participants")+ endendendendend++ details.with_row do+ render(OpTurbo::OpPrimer::AsyncDialogComponent.new(+ id: "edit-participants-dialog",+ src: participants_dialog_meeting_path(@meeting),+ size: :medium_portrait,+ title: Meeting.human_attribute_name(:participants),+ hide_button: true+ ))+ endendendenddiff --git a/modules/meeting/app/components/meetings/sidebar/details_component.sass b/modules/meeting/app/components/meetings/sidebar/details_component.sassdeleted file mode 100644index a15646b57e3..00000000000--- a/modules/meeting/app/components/meetings/sidebar/details_component.sass+++ /dev/null@@ -1,6 +0,0 @@-.meeting-detail-participants- // The modal is rendered inside the mobile participant list element and it can be- // triggered from both mobile and desktop views. The mobile participant list is hidden- // when the desktop view is active, but the modal inside it should still be visible.- .Overlay-backdrop--center- visibility: visiblediff --git a/modules/meeting/app/components/meetings/sidebar/participants_component.html.erb b/modules/meeting/app/components/meetings/sidebar/participants_component.html.erbindex 0ab7f53e488..913d6a470c9 100644--- a/modules/meeting/app/components/meetings/sidebar/participants_component.html.erb+++ b/modules/meeting/app/components/meetings/sidebar/participants_component.html.erb@@ -21,6 +21,7 @@icon: :gear,scheme: :invisible,'aria-label': t("label_meeting_manage_participants"),+ test_selector: "manage-participants-button",data: { 'show-dialog-id': "edit-participants-dialog" }))enddiff --git a/modules/meeting/spec/features/structured_meetings/structured_meeting_participant_spec.rb b/modules/meeting/spec/features/structured_meetings/structured_meeting_participant_spec.rbnew file mode 100644index 00000000000..41a2c7a475a--- /dev/null+++ b/modules/meeting/spec/features/structured_meetings/structured_meeting_participant_spec.rb@@ -0,0 +1,85 @@+#-- copyright+# OpenProject is an open source project management software.+# Copyright (C) 2012-2024 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.+#++++require "spec_helper"++require_relative "../../support/pages/structured_meeting//mobile/show"++RSpec.describe "Structured meetings participants",+ :js,+ :with_cuprite do+ include Components::Autocompleter::NgSelectAutocompleteHelpers++ shared_let(:project) { create(:project, enabled_module_names: %w[meetings work_package_tracking]) }+ shared_let(:user) do+ create(:user,+ lastname: "First",+ member_with_permissions: { project => %i[view_meetings create_meetings edit_meetings delete_meetings manage_agendas+ close_meeting_agendas view_work_packages] }).tap do |u|+ u.pref[:time_zone] = "utc"++ u.save!+ end+ end+ shared_let(:other_user) do+ create(:user,+ lastname: "Second",+ member_with_permissions: { project => %i[view_meetings view_work_packages] })+ end+ shared_let(:no_member_user) do+ create(:user,+ lastname: "Third")+ end++ shared_let(:meeting) do+ create(:structured_meeting, project:, author: user)+ end++ let(:current_user) { user }+ let(:show_page) { Pages::StructuredMeeting::Show.new(StructuredMeeting.order(id: :asc).last) }++ before do+ login_as current_user+ show_page.visit!+ end++ it "can edit participants of a structured meeting" do+ expect(page).to have_current_path(show_page.path)++ show_page.open_participant_form+ show_page.in_participant_form do+ show_page.expect_participant(user, invited: true, attended: false)+ show_page.expect_participant(other_user, invited: false, attended: false)+ show_page.expect_available_participants(count: 2)+ expect(page).to have_button("Save")++ check(id: "checkbox_invited_#{other_user.id}")+ click_on("Save")+ end+ end+enddiff --git a/modules/meeting/spec/support/pages/structured_meeting/show.rb b/modules/meeting/spec/support/pages/structured_meeting/show.rbindex 7f2421543ea..68d28ab9590 100644--- a/modules/meeting/spec/support/pages/structured_meeting/show.rb+++ b/modules/meeting/spec/support/pages/structured_meeting/show.rb@@ -156,6 +156,11 @@ module Pages::StructuredMeetingexpect(page).to have_css(".ng-input ", value: nil)end+ def open_participant_form+ page.find_test_selector("manage-participants-button").click+ expect(page).to have_css("#meetings-sidebar-participants-form-component")+ end+def in_participant_form(&)page.within("#meetings-sidebar-participants-form-component form", &)end