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
Incorporate PR feedback
Mir Bhatiae6e6fd6670aa
diff --git a/app/components/op_primer/expandable_list_component.html.erb b/app/components/op_primer/expandable_list_component.html.erbindex 6a16288c97a..ae77f1808d4 100644--- a/app/components/op_primer/expandable_list_component.html.erb+++ b/app/components/op_primer/expandable_list_component.html.erb@@ -1,7 +1,7 @@<%=component_wrapper(data: wrapper_data_attributes) do- if elements.count == 0- render(Primer::Beta::Text.new(color: :subtle)) { t("label_meeting_no_participants") }+ if elements.none?+ render(Primer::Beta::Text.new(color: :subtle)) { t("meeting.participants.label.no_participants") }elsif @cutoff_limit.nil? || elements.count <= @cutoff_limitflex_layout do |list|elements.each do |item|diff --git a/frontend/src/global_styles/primer/_overrides.sass b/frontend/src/global_styles/primer/_overrides.sassindex 40481814396..552cb47e6e1 100644--- a/frontend/src/global_styles/primer/_overrides.sass+++ b/frontend/src/global_styles/primer/_overrides.sass@@ -75,6 +75,9 @@ ul.SegmentedControl,&-body_autocomplete_heightmin-height: 300px+ &--size-xlarge-maximized-empty-footer+ min-height: 534px+// For some specific cases like progress form in small screens,// we need to change the direction of elements to column,// therefore elements are placed below each otherdiff --git a/modules/meeting/app/components/_index.sass b/modules/meeting/app/components/_index.sassindex 725ead5b82f..a63adf42b4d 100644--- a/modules/meeting/app/components/_index.sass+++ b/modules/meeting/app/components/_index.sass@@ -6,4 +6,4 @@@import "./recurring_meetings/table_header_component.sass"@import "./meeting_agenda_items/outcomes/show_notes_component.sass"@import "./meetings/header_infoline_component.sass"-@import "./meetings/side_panel/participants/add_user_form_component.sass"+@import "./meetings/participants/add_user_form_component.sass"diff --git a/modules/meeting/app/components/meetings/side_panel/participants/add_user_form_component.html.erb b/modules/meeting/app/components/meetings/participants/add_user_form_component.html.erbsimilarity index 100%rename from modules/meeting/app/components/meetings/side_panel/participants/add_user_form_component.html.erbrename to modules/meeting/app/components/meetings/participants/add_user_form_component.html.erbdiff --git a/modules/meeting/app/components/meetings/side_panel/participants/add_user_form_component.rb b/modules/meeting/app/components/meetings/participants/add_user_form_component.rbsimilarity index 95%rename from modules/meeting/app/components/meetings/side_panel/participants/add_user_form_component.rbrename to modules/meeting/app/components/meetings/participants/add_user_form_component.rbindex 7e1ea9f7494..14716e3adf1 100644--- a/modules/meeting/app/components/meetings/side_panel/participants/add_user_form_component.rb+++ b/modules/meeting/app/components/meetings/participants/add_user_form_component.rb@@ -29,7 +29,7 @@#++module Meetings- class SidePanel::Participants::AddUserFormComponent < ApplicationComponent+ class Participants::AddUserFormComponent < ApplicationComponentinclude ApplicationHelperinclude OpenProject::FormTagHelperinclude OpTurbo::Streamablediff --git a/modules/meeting/app/components/meetings/side_panel/participants/add_user_form_component.sass b/modules/meeting/app/components/meetings/participants/add_user_form_component.sasssimilarity index 100%rename from modules/meeting/app/components/meetings/side_panel/participants/add_user_form_component.sassrename to modules/meeting/app/components/meetings/participants/add_user_form_component.sassdiff --git a/modules/meeting/app/components/meetings/side_panel/participants/attended_toggle_button_component.rb b/modules/meeting/app/components/meetings/participants/attended_toggle_button_component.rbsimilarity index 91%rename from modules/meeting/app/components/meetings/side_panel/participants/attended_toggle_button_component.rbrename to modules/meeting/app/components/meetings/participants/attended_toggle_button_component.rbindex f22f0ea894b..7a2740ccd19 100644--- a/modules/meeting/app/components/meetings/side_panel/participants/attended_toggle_button_component.rb+++ b/modules/meeting/app/components/meetings/participants/attended_toggle_button_component.rb@@ -29,7 +29,7 @@#++module Meetings- class SidePanel::Participants::AttendedToggleButtonComponent < ApplicationComponent+ class Participants::AttendedToggleButtonComponent < ApplicationComponentinclude ApplicationHelperinclude OpenProject::FormTagHelperinclude OpTurbo::Streamable@@ -66,7 +66,8 @@ module Meetingsenddef label- @participant.attended? ? "Attended" : "Mark as attended"+ key = @participant.attended? ? "attended" : "mark_as_attended"+ I18n.t("meeting.participants.label.#{key}")endendenddiff --git a/modules/meeting/app/components/meetings/participants/box_header_component.html.erb b/modules/meeting/app/components/meetings/participants/box_header_component.html.erbnew file mode 100644index 00000000000..258f592c5c5--- /dev/null+++ b/modules/meeting/app/components/meetings/participants/box_header_component.html.erb@@ -0,0 +1,31 @@+<%=+ flex_layout(align_items: :center, justify_content: :space_between) do |flex|+ flex.with_column do+ flex_layout(align_items: :center) do |participants|+ participants.with_column do+ render(Primer::Beta::Text.new(font_weight: :bold)) { I18n.t("meeting.participants.label.participants") }+ end+ participants.with_column(ml: 2) do+ render(Primer::Beta::Counter.new(count: @meeting.participants.count, round: true, scheme: :primary))+ end+ end+ end++ if show_mark_all_attended?+ flex.with_column do+ render(+ Primer::Beta::Button.new(+ tag: :a,+ scheme: :invisible,+ href: mark_all_attended_meeting_participants_path(@meeting),+ align_self: :center,+ data: { "turbo-method": :post }+ )+ ) do |button|+ button.with_leading_visual_icon(icon: :"op-people-all-assigned")+ I18n.t("meeting.participants.label.mark_all_as_attended")+ end+ end+ end+ end+%>diff --git a/modules/meeting/app/components/meetings/participants/box_header_component.rb b/modules/meeting/app/components/meetings/participants/box_header_component.rbnew file mode 100644index 00000000000..ee0d1965f48--- /dev/null+++ b/modules/meeting/app/components/meetings/participants/box_header_component.rb@@ -0,0 +1,50 @@+# frozen_string_literal: true++#-- copyright+# OpenProject is an open source project management software.+# Copyright (C) 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.+#++++module Meetings+ class Participants::BoxHeaderComponent < ApplicationComponent+ include ApplicationHelper+ include OpenProject::FormTagHelper+ include OpTurbo::Streamable+ include OpPrimer::ComponentHelpers++ def initialize(meeting:)+ super++ @meeting = meeting+ end++ private++ def show_mark_all_attended?+ [email protected]?(&:attended?) && @meeting.in_progress?+ end+ end+enddiff --git a/modules/meeting/app/components/meetings/participants/box_row_component.html.erb b/modules/meeting/app/components/meetings/participants/box_row_component.html.erbnew file mode 100644index 00000000000..9069f035a6b--- /dev/null+++ b/modules/meeting/app/components/meetings/participants/box_row_component.html.erb@@ -0,0 +1,37 @@+<%=+ flex_layout(align_items: :center, justify_content: :space_between) do |row|+ row.with_column(flex: 1, classes: "ellipsis") do+ render(+ Users::AvatarComponent.new(+ user: @participant.user,+ classes: "op-principal_flex",+ hover_card: { active: true, target: :custom }+ )+ )+ end+ row.with_column do+ flex_layout(align_items: :center, justify_content: :space_between) do |actions|+ if @meeting.in_progress?+ actions.with_column(ml: 2) do+ render(Meetings::Participants::AttendedToggleButtonComponent.new(meeting: @meeting, participant: @participant))+ end+ end+ actions.with_column(ml: 2) do+ render(+ Primer::Beta::IconButton.new(+ scheme: :invisible,+ tag: :a,+ href: meeting_participant_path(@meeting, @participant),+ icon: :x,+ aria: { label: I18n.t("meeting.participants.label.remove_participant") },+ data: {+ turbo_method: :delete,+ test_selector: "remove_button_#{@participant.user_id}"+ }+ )+ )+ end+ end+ end+ end+%>diff --git a/modules/meeting/app/components/meetings/participants/box_row_component.rb b/modules/meeting/app/components/meetings/participants/box_row_component.rbnew file mode 100644index 00000000000..193e170e2e2--- /dev/null+++ b/modules/meeting/app/components/meetings/participants/box_row_component.rb@@ -0,0 +1,45 @@+# frozen_string_literal: true++#-- copyright+# OpenProject is an open source project management software.+# Copyright (C) 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.+#++++module Meetings+ class Participants::BoxRowComponent < ApplicationComponent+ include ApplicationHelper+ include OpenProject::FormTagHelper+ include OpTurbo::Streamable+ include OpPrimer::ComponentHelpers++ def initialize(meeting:, participant:)+ super++ @meeting = meeting+ @participant = participant+ end+ end+enddiff --git a/modules/meeting/app/components/meetings/participants/list_component.html.erb b/modules/meeting/app/components/meetings/participants/list_component.html.erbnew file mode 100644index 00000000000..114dc079908--- /dev/null+++ b/modules/meeting/app/components/meetings/participants/list_component.html.erb@@ -0,0 +1,42 @@+<%=+ component_wrapper do+ flex_layout do |container|+ if @meeting.errors[:base].present?+ container.with_row(mb: 3) do+ render(Primer::Alpha::Banner.new(mb: 3, icon: :stop, scheme: :danger)) { @meeting.errors[:base].join("\n") }+ end+ end+ container.with_row do+ render(border_box_container) do |box|+ box.with_header(color: :muted) do+ render(Meetings::Participants::BoxHeaderComponent.new(meeting: @meeting))+ end++ if @meeting_participants.none?+ box.with_row do+ render(Primer::Beta::Blankslate.new) do |blankslate|+ blankslate.with_visual_icon(icon: :people, size: :medium)+ blankslate.with_heading(tag: :h2).with_content(I18n.t("meeting.participants.blankslate.heading"))+ blankslate.with_description do+ flex_layout do |flex|+ flex.with_row(mb: 4) do+ render(Primer::Beta::Text.new(color: :subtle)) { I18n.t("meeting.participants.blankslate.description") }+ end+ end+ end+ end+ end+ else+ render(Primer::BaseComponent.new(tag: :div, classes: "participants-list")) do+ @meeting_participants.sort.each do |participant|+ box.with_row do+ render(Meetings::Participants::BoxRowComponent.new(meeting: @meeting, participant:))+ end+ end+ end+ end+ end+ end+ end+ end+%>diff --git a/modules/meeting/app/components/meetings/side_panel/participants/list_component.rb b/modules/meeting/app/components/meetings/participants/list_component.rbsimilarity index 86%rename from modules/meeting/app/components/meetings/side_panel/participants/list_component.rbrename to modules/meeting/app/components/meetings/participants/list_component.rbindex 6e603b8caa7..f5c08939ae7 100644--- a/modules/meeting/app/components/meetings/side_panel/participants/list_component.rb+++ b/modules/meeting/app/components/meetings/participants/list_component.rb@@ -29,7 +29,7 @@#++module Meetings- class SidePanel::Participants::ListComponent < ApplicationComponent+ class Participants::ListComponent < ApplicationComponentinclude ApplicationHelperinclude OpenProject::FormTagHelperinclude OpTurbo::Streamable@@ -39,12 +39,7 @@ module Meetingssuper@meeting = meeting- end-- private-- def show_mark_all_attended?- @meeting.participants.where(attended: true).count != @meeting.participants.count && @meeting.in_progress?+ @meeting_participants = meeting.participantsendendenddiff --git a/modules/meeting/app/components/meetings/side_panel/participants/manage_participants_dialog.html.erb b/modules/meeting/app/components/meetings/participants/manage_participants_dialog.html.erbsimilarity index 52%rename from modules/meeting/app/components/meetings/side_panel/participants/manage_participants_dialog.html.erbrename to modules/meeting/app/components/meetings/participants/manage_participants_dialog.html.erbindex d6fc628e276..e6e5387ee7b 100644--- a/modules/meeting/app/components/meetings/side_panel/participants/manage_participants_dialog.html.erb+++ b/modules/meeting/app/components/meetings/participants/manage_participants_dialog.html.erb@@ -3,14 +3,14 @@render(Primer::Alpha::Dialog.new(id: "manage-participants-dialog",- size: :large,- title: "Manage participants",+ size: :xlarge,+ title: I18n.t("meeting.participants.label.manage_participants"),data: { "keep-open-on-submit": true })) do |d|d.with_header(variant: :large)- d.with_body do+ d.with_body(classes: "Overlay--size-xlarge-maximized-empty-footer") doflex_layout do |container|if @meeting.errors[:base].present?container.with_row(mb: 3) do@@ -23,30 +23,21 @@endcontainer.with_row(mb: 3) do- render(Primer::Beta::Text.new) { "Search for and add project members as participants to this meeting." }+ render(Primer::Beta::Text.new) { I18n.t("meeting.participants.text.manage_participants") }endcontainer.with_row(mb: 3) do- render(Meetings::SidePanel::Participants::AddUserFormComponent.new(meeting: @meeting))+ render(Meetings::Participants::AddUserFormComponent.new(meeting: @meeting))endcontainer.with_row do- render(Meetings::SidePanel::Participants::ListComponent.new(meeting: @meeting))+ render(Meetings::Participants::ListComponent.new(meeting: @meeting))endendend- if @meeting.editable?- d.with_footer do- flex_layout do |footer|- footer.with_row(mt: 3) do- render(Primer::Beta::Button.new(data: { "close-dialog-id": "manage-participants-dialog" })) do- t("button_cancel")- end- end- end- end- end+ # Empty, but necessary for proper padding of body content+ d.with_footerendend%>diff --git a/modules/meeting/app/components/meetings/side_panel/participants/manage_participants_dialog.rb b/modules/meeting/app/components/meetings/participants/manage_participants_dialog.rbsimilarity index 95%rename from modules/meeting/app/components/meetings/side_panel/participants/manage_participants_dialog.rbrename to modules/meeting/app/components/meetings/participants/manage_participants_dialog.rbindex cd4b2a661fc..4e529dfd629 100644--- a/modules/meeting/app/components/meetings/side_panel/participants/manage_participants_dialog.rb+++ b/modules/meeting/app/components/meetings/participants/manage_participants_dialog.rb@@ -29,7 +29,7 @@#++module Meetings- class SidePanel::Participants::ManageParticipantsDialog < ApplicationComponent+ class Participants::ManageParticipantsDialog < ApplicationComponentinclude ApplicationHelperinclude OpenProject::FormTagHelperinclude OpTurbo::Streamablediff --git a/modules/meeting/app/components/meetings/side_panel/details_component.html.erb b/modules/meeting/app/components/meetings/side_panel/details_component.html.erbindex 64432c543d1..0ff111a87a6 100644--- a/modules/meeting/app/components/meetings/side_panel/details_component.html.erb+++ b/modules/meeting/app/components/meetings/side_panel/details_component.html.erb@@ -131,7 +131,7 @@render(Primer::Beta::Text.new) doMeeting.human_attribute_name(:participant,- count: @meeting.invited_or_attended_participants.count+ count: @meeting.participants.count)endend@@ -148,7 +148,7 @@data: { controller: "async-dialog" })) do- t("label_meeting_show_all_participants")+ t("meeting.participants.label.show_all")endendenddiff --git a/modules/meeting/app/components/meetings/side_panel/participants/list_component.html.erb b/modules/meeting/app/components/meetings/side_panel/participants/list_component.html.erbdeleted file mode 100644index 611ea1641e3..00000000000--- a/modules/meeting/app/components/meetings/side_panel/participants/list_component.html.erb+++ /dev/null@@ -1,104 +0,0 @@-<%=- component_wrapper do- flex_layout do |container|- if @meeting.errors[:base].present?- container.with_row(mb: 3) do- render(Primer::Alpha::Banner.new(mb: 3, icon: :stop, scheme: :danger)) { @meeting.errors[:base].join("\n") }- end- end- container.with_row do- render(border_box_container) do |box|- box.with_header(color: :muted) do- flex_layout(align_items: :center, justify_content: :space_between) do |flex|- flex.with_column do- flex_layout(align_items: :center) do |participants|- participants.with_column do- render(Primer::Beta::Text.new(font_weight: :bold)) { "Participants" }- end- participants.with_column(ml: 2) do- render(Primer::Beta::Counter.new(count: @meeting.invited_participants.count, round: true, scheme: :primary))- end- end- end- if show_mark_all_attended?- flex.with_column do- render(- Primer::Beta::Button.new(- tag: :a,- href: mark_all_attended_meeting_participants_path(@meeting),- align_self: :center,- data: { "turbo-method": :post }- )- ) do |button|- button.with_leading_visual_icon(icon: :"op-person-assigned")- "Mark all as attended"- end- end- end- end- end-- if @meeting.invited_participants.none?- box.with_row do- render(Primer::Beta::Blankslate.new) do |blankslate|- blankslate.with_visual_icon(icon: :people, size: :medium)- blankslate.with_heading(tag: :h2).with_content("No participants")- blankslate.with_description do- flex_layout do |flex|- flex.with_row(mb: 2) do- render(Primer::Beta::Text.new(color: :subtle)) { "There are no participants yet." }- end- end- end- end- end- else- render(Primer::BaseComponent.new(tag: :div, classes: "participants-list")) do- @meeting.all_changeable_participants.sort.each do |user|- if @meeting.participants.present? && participant = @meeting.participants.detect { |p| p.user_id == user.id }- box.with_row do- flex_layout(align_items: :center, justify_content: :space_between) do |row|- row.with_column(flex: 1, classes: "ellipsis") do- render(- Users::AvatarComponent.new(- user: participant.user,- classes: "op-principal_flex",- hover_card: { active: true, target: :custom }- )- )- end- row.with_column do- flex_layout(align_items: :center, justify_content: :space_between) do |actions|- if @meeting.in_progress?- actions.with_column(ml: 2) do- render(Meetings::SidePanel::Participants::AttendedToggleButtonComponent.new(meeting: @meeting, participant:))- end- end- actions.with_column(ml: 2) do- render(- Primer::Beta::IconButton.new(- scheme: :invisible,- tag: :a,- href: meeting_participant_path(@meeting, participant),- icon: :x,- aria: { label: "Remove participant" },- data: {- turbo_method: :delete,- test_selector: "remove_button_#{participant.user_id}"- }- )- )- end- end- end- end- end- end- end- end- end- end- end- end- end-%>diff --git a/modules/meeting/app/components/meetings/side_panel/participants_component.html.erb b/modules/meeting/app/components/meetings/side_panel/participants_component.html.erbindex 8b83eb8bfe1..f34d90de394 100644--- a/modules/meeting/app/components/meetings/side_panel/participants_component.html.erb+++ b/modules/meeting/app/components/meetings/side_panel/participants_component.html.erb@@ -2,10 +2,10 @@component_wrapper dorender(Primer::OpenProject::SidePanel::Section.new) do |section|section.with_title { Meeting.human_attribute_name(:participants) }- section.with_counter(count: @meeting.invited_participants.count)+ section.with_counter(count: @meeting.participants.count)if @meeting.templated?- section.with_description { I18n.t("meeting.participants.template") }+ section.with_description { I18n.t("meeting.participants.text.template") }endif @meeting.editable?@@ -16,7 +16,7 @@href: manage_participants_dialog_meeting_participants_path(@meeting),classes: "hide-when-print",data: { controller: "async-dialog" },- "aria-label": t("label_meeting_manage_participants"),+ "aria-label": I18n.t("meeting.participants.label.manage_participants"),test_selector: "manage-participants-button")end@@ -46,7 +46,7 @@)) do |button|button.with_leading_visual_icon(icon: "person-add")- "Manage participants"+ I18n.t("meeting.participants.label.manage_participants")endendenddiff --git a/modules/meeting/app/components/meetings/side_panel/participants_component.rb b/modules/meeting/app/components/meetings/side_panel/participants_component.rbindex a3de2937897..8f1ba361f7a 100644--- a/modules/meeting/app/components/meetings/side_panel/participants_component.rb+++ b/modules/meeting/app/components/meetings/side_panel/participants_component.rb@@ -49,7 +49,7 @@ module Meetingsenddef elements- @elements ||= @meeting.invited_participants.sort+ @elements ||= @meeting.participants.sortenddef countdiff --git a/modules/meeting/app/controllers/concerns/meetings/agenda_component_streams.rb b/modules/meeting/app/controllers/concerns/meetings/agenda_component_streams.rbindex 4d57b796927..082ce87b52f 100644--- a/modules/meeting/app/controllers/concerns/meetings/agenda_component_streams.rb+++ b/modules/meeting/app/controllers/concerns/meetings/agenda_component_streams.rb@@ -85,13 +85,13 @@ module Meetingsdef update_add_user_form_component_via_turbo_stream(meeting: @meeting)update_via_turbo_stream(- component: Meetings::SidePanel::Participants::AddUserFormComponent.new(meeting:)+ component: Meetings::Participants::AddUserFormComponent.new(meeting:))enddef update_list_component_via_turbo_stream(meeting: @meeting)update_via_turbo_stream(- component: Meetings::SidePanel::Participants::ListComponent.new(meeting:)+ component: Meetings::Participants::ListComponent.new(meeting:))enddiff --git a/modules/meeting/app/controllers/meeting_participants_controller.rb b/modules/meeting/app/controllers/meeting_participants_controller.rbindex e04c61e42d9..b22b729365c 100644--- a/modules/meeting/app/controllers/meeting_participants_controller.rb+++ b/modules/meeting/app/controllers/meeting_participants_controller.rb@@ -40,7 +40,7 @@ class MeetingParticipantsController < ApplicationControllerdef createuser_id = params[:meeting_participant][:user_id]- if MeetingParticipant.exists?(user_id: user_id, meeting_id: @meeting.id)+ if MeetingParticipant.exists?(user_id: user_id, meeting_id: @meeting.id) || user_id.blank?update_add_user_form_component_via_turbo_streamupdate_list_component_via_turbo_stream@@ -87,7 +87,7 @@ class MeetingParticipantsController < ApplicationControllerenddef manage_participants_dialog- respond_with_dialog Meetings::SidePanel::Participants::ManageParticipantsDialog.new(meeting: @meeting)+ respond_with_dialog Meetings::Participants::ManageParticipantsDialog.new(meeting: @meeting)endprivatediff --git a/modules/meeting/app/forms/meeting/participant.rb b/modules/meeting/app/forms/meeting/participant.rbindex 28e2733f513..f61813a004b 100644--- a/modules/meeting/app/forms/meeting/participant.rb+++ b/modules/meeting/app/forms/meeting/participant.rb@@ -32,7 +32,7 @@ class Meeting::Participant < ApplicationFormform do |participant_form|participant_form.autocompleter(name: :user_id,- label: MeetingAgendaItem.human_attribute_name(:presenter),+ label: MeetingParticipant.model_name.human,visually_hide_label: true,autocomplete_options: {defaultData: true,@@ -41,11 +41,11 @@ class Meeting::Participant < ApplicationFormfilters:,searchKey: "any_name_attribute",resource: "principals",- focusDirectly: false,+ focusDirectly: true,multiple: false,isOpenedInModal: true,hoverCards: true,- placeholder: I18n.t("activerecord.attributes.meeting_agenda_item.presenter"),+ placeholder: I18n.t("meeting.participants.text.search_for_members"),data: {"test-selector": "participants-dialog-autocomplete"}@@ -56,12 +56,12 @@ class Meeting::Participant < ApplicationFormprivatedef excluded_ids- @excluded_ids ||= @builder.object.meeting.invited_participants.filter_map(&:user_id)+ @excluded_ids ||= @builder.object.meeting.participants.filter_map(&:user_id)enddef filterslist = [- { name: "type", operator: "=", values: %w[User Group] },+ { name: "type", operator: "=", values: %w[User] },{ name: "member", operator: "=", values: [@builder.object.meeting.project_id] },{ name: "status", operator: "=", values: [Principal.statuses[:active], Principal.statuses[:invited]] }]diff --git a/modules/meeting/app/forms/meeting_agenda_item/presenter.rb b/modules/meeting/app/forms/meeting_agenda_item/presenter.rbindex fb02d5049d3..5eb19e37ca7 100644--- a/modules/meeting/app/forms/meeting_agenda_item/presenter.rb+++ b/modules/meeting/app/forms/meeting_agenda_item/presenter.rb@@ -37,7 +37,7 @@ class MeetingAgendaItem::Presenter < ApplicationFormdefaultData: true,component: "opce-user-autocompleter",url: ::API::V3::Utilities::PathHelper::ApiV3Path.principals,- filters: [{ name: "type", operator: "=", values: %w[User Group] },+ filters: [{ name: "type", operator: "=", values: %w[User] },{ name: "member", operator: "=", values: [@builder.object.meeting.project_id] },{ name: "status", operator: "=", values: [Principal.statuses[:active], Principal.statuses[:invited]] }],searchKey: "any_name_attribute",diff --git a/modules/meeting/app/models/meeting.rb b/modules/meeting/app/models/meeting.rbindex b4ae17bc478..fd69113179c 100644--- a/modules/meeting/app/models/meeting.rb+++ b/modules/meeting/app/models/meeting.rb@@ -193,23 +193,6 @@ class Meeting < ApplicationRecordendend- def invited_participants- participants.select(&:invited)- end-- def invited_or_attended_participants- participants.where(invited: true).or(participants.where(attended: true))- end-- def all_changeable_participants- changeable_participants = participants.select(&:invited).collect(&:user)- changeable_participants = changeable_participants + participants.select(&:attended).collect(&:user)-- changeable_participants- .compact- .uniq(&:id)- end-def self.group_by_time(meetings)by_start_year_month_date = ActiveSupport::OrderedHash.new do |hy, year|hy[year] = ActiveSupport::OrderedHash.new do |hm, month|diff --git a/modules/meeting/app/views/meetings/_participants_section.html.erb b/modules/meeting/app/views/meetings/_participants_section.html.erbdeleted file mode 100644index d189bdaa78d..00000000000--- a/modules/meeting/app/views/meetings/_participants_section.html.erb+++ /dev/null@@ -1,75 +0,0 @@-<%#-- copyright-OpenProject is an open source project management software.-Copyright (C) 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.--++#%>--<div id="participants-section">- <% if @project %>- <div class="form--field">- <label class="form--label"><%= Meeting.human_attribute_name(:participants) %></label>- <div class="form--field-container">- <table class="form--matrix">- <thead>- <tr class="form--matrix-header-row">- <th class="form--matrix-header-cell"><%= Meeting.human_attribute_name(:name) %></th>- <th class="form--matrix-header-cell"><%= Meeting.human_attribute_name(:participants_invited) %></th>- <th class="form--matrix-header-cell"><%= Meeting.human_attribute_name(:participants_attended) %></th>- </tr>- </thead>- <tbody>- <% @meeting.all_changeable_participants.sort.each do |user| -%>- <%= hidden_field_tag "meeting[participants_attributes][][user_id]", user.id %>- <tr class="form--matrix-row">- <td class="form--matrix-cell"><%= h user %></td>- <% if @meeting.participants.present? && participant = @meeting.participants.detect{|p| p.user_id == user.id} -%>- <%= hidden_field_tag "meeting[participants_attributes][][id]", participant.id %>- <td class="form--matrix-checkbox-cell">- <%= label_tag "checkbox_invited_#{user.id}", user.name + " " + t(:description_invite), class: "sr-only" %>- <%= styled_check_box_tag "meeting[participants_attributes][][invited]", 1, participant.invited?, id: "checkbox_invited_#{user.id}" %>- </td>- <td class="form--matrix-checkbox-cell">- <%= label_tag "checkbox_attended_#{user.id}", user.name + " " + t(:description_attended), class: "sr-only" %>- <%= styled_check_box_tag "meeting[participants_attributes][][attended]", 1, participant.attended?, id: "checkbox_attended_#{user.id}" %>- </td>- <% else -%>- <td class="form--matrix-checkbox-cell">- <%= label_tag "checkbox_invited_#{user.id}", user.name + " " + t(:description_invite), class: "sr-only" %>- <%= styled_check_box_tag "meeting[participants_attributes][][invited]", value = "1", checked = false, id: "checkbox_invited_#{user.id}" %>- </td>- <td class="form--matrix-checkbox-cell">- <%= label_tag "checkbox_attended_#{user.id}", user.name + " " + t(:description_attended), class: "sr-only" %>- <%= styled_check_box_tag "meeting[participants_attributes][][attended]", value = "1", checked = false, id: "checkbox_attended_#{user.id}" %>- </td>- <% end -%>- </tr>- <% end -%>- </tbody>- </table>- </div>- </div>- <% end %>-</div>diff --git a/modules/meeting/app/views/meetings/new.turbo_stream.erb b/modules/meeting/app/views/meetings/new.turbo_stream.erbdeleted file mode 100644index 73dff758e4c..00000000000--- a/modules/meeting/app/views/meetings/new.turbo_stream.erb+++ /dev/null@@ -1,30 +0,0 @@-<%#-- copyright-OpenProject is an open source project management software.-Copyright (C) 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.--++#%>--<%= turbo_stream.replace "participants-section", partial: "meetings/participants_section" %>diff --git a/modules/meeting/app/workers/meetings/pdf/default/participants.rb b/modules/meeting/app/workers/meetings/pdf/default/participants.rbindex 918a70479fb..db2af422e3f 100644--- a/modules/meeting/app/workers/meetings/pdf/default/participants.rb+++ b/modules/meeting/app/workers/meetings/pdf/default/participants.rb@@ -55,7 +55,7 @@ module Meetings::PDF::Default::Participantsenddef participants- meeting.invited_or_attended_participants.sort_by(&:name)+ meeting.participants.sort_by(&:name)enddef participants_groups(columns_count)@@ -103,6 +103,6 @@ module Meetings::PDF::Default::Participantsenddef participants_title- "#{Meeting.human_attribute_name(:participants)} (#{meeting.invited_or_attended_participants.count})"+ "#{Meeting.human_attribute_name(:participants)} (#{meeting.participants.count})"endenddiff --git a/modules/meeting/config/locales/en.yml b/modules/meeting/config/locales/en.ymlindex b06fee0891d..ece7d7ac578 100644--- a/modules/meeting/config/locales/en.yml+++ b/modules/meeting/config/locales/en.yml@@ -194,7 +194,22 @@ en:meeting:participants:- template: "These participants will be invited automatically to all future meetings as they are created."+ label:+ participants: "Participants"+ attended: "Attended"+ mark_as_attended: "Mark as attended"+ mark_all_as_attended: "Mark all as attended"+ remove_participant: "Remove participant"+ manage_participants: "Manage participants"+ no_participants: "No participants"+ show_all: "Show all"+ text:+ template: "These participants will be invited automatically to all future meetings as they are created."+ manage_participants: "Search for and add project members as participants to this meeting."+ search_for_members: "Search for project members"+ blankslate:+ heading: "No participants"+ description: "There are no participants yet."attachments:template: "These attached files will be included in all future meetings in the series."text: "Attached files are available to all meeting participants. You can also drag and drop these into agenda item notes."@@ -573,12 +588,6 @@ en:text_meeting_in_progress_dropdown_description: "Document outcomes like information needs or decisions taken during the meeting."text_meeting_closed_dropdown_description: "This meeting is closed. You cannot modify agenda items or outcomes anymore."- label_meeting_manage_participants: "Manage participants"- label_meeting_no_participants: "No participants"- label_meeting_show_hide_participants: "Show/hide %{count} more"- label_meeting_show_all_participants: "Show all"- label_meeting_add_participants: "Add participants"-text_meeting_not_editable_anymore: "This meeting is not editable anymore."text_meeting_not_present_anymore: "This meeting was deleted. Please select another meeting."diff --git a/modules/meeting/spec/features/recurring_meetings/recurring_meeting_create_spec.rb b/modules/meeting/spec/features/recurring_meetings/recurring_meeting_create_spec.rbindex 8d9b710017b..65fa00794fa 100644--- a/modules/meeting/spec/features/recurring_meetings/recurring_meeting_create_spec.rb+++ b/modules/meeting/spec/features/recurring_meetings/recurring_meeting_create_spec.rb@@ -110,7 +110,7 @@ RSpec.describe "Recurring meetings creation",template_page.expect_participant(other_user, editable: false)template_page.expect_available_participants(count: 2)- click_on "Cancel"+ page.find(".close-button").clickendwait_for_network_idlediff --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 a08126c85d2..f11cc22c57b 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@@ -300,7 +300,7 @@ RSpec.describe "Meetings CRUD",show_page.in_participant_form doshow_page.select_participant(other_user)- click_on "Cancel"+ page.find(".close-button").clickendwait_for_network_idlediff --git a/modules/meeting/spec/models/meeting_spec.rb b/modules/meeting/spec/models/meeting_spec.rbindex 4c3d0d6707a..50e3395aff5 100644--- a/modules/meeting/spec/models/meeting_spec.rb+++ b/modules/meeting/spec/models/meeting_spec.rb@@ -107,37 +107,6 @@ RSpec.describe Meeting doendend- describe "all_changeable_participants" do- describe "WITH a user having the view_meetings permission" do- let(:project_members) { { user1 => role } }-- it "contains the user" do- expect(meeting.all_changeable_participants).to eq([user1])- end- end-- describe "WITH a user not having the view_meetings permission" do- let(:role2) { create(:project_role, permissions: []) }- let(:project_members) { { user1 => role, user2 => role2 } }-- it "does not contain the user" do- expect(meeting.all_changeable_participants).not_to include(user2)- end- end-- describe "WITH a user being locked but invited" do- let(:locked_user) { create(:locked_user) }-- before do- meeting.participants_attributes = [{ user_id: locked_user.id, invited: 1 }]- end-- it "contains the user" do- expect(meeting.all_changeable_participants).to include(locked_user)- end- end- end-describe "participants and author as watchers" dolet(:project_members) { { user1 => role, user2 => role } }