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
display share modal content
ulferts7011df548373
diff --git a/app/components/work_packages/share/modal_component.html.erb b/app/components/work_packages/share/modal_component.html.erbindex 4ce5f61e7e3..c08628a401f 100644--- a/app/components/work_packages/share/modal_component.html.erb+++ b/app/components/work_packages/share/modal_component.html.erb@@ -1,46 +1,49 @@<%=- flex_layout(data: { turbo: true }) do |modal_content|- modal_content.with_row do- # Todo: Wrap in Form+ # The identifier is a magic key also found in the wp-share modal template.+ turbo_frame_tag "work_package_share_list" do+ flex_layout(data: { turbo: true }) do |modal_content|+ modal_content.with_row do+ # Todo: Wrap in Form- flex_layout do |new_user_row|- new_user_row.with_column(mr: 2) do- # Todo: Show user autocompleter- end+ flex_layout do |new_user_row|+ new_user_row.with_column(mr: 2) do+ # Todo: Show user autocompleter+ end- new_user_row.with_column(mr: 2) do- render(WorkPackages::Share::PermissionButtonComponent.new(shown_value: I18n.t('work_package.sharing.permissions.comment')))- end+ new_user_row.with_column(mr: 2) do+ render(WorkPackages::Share::PermissionButtonComponent.new(shown_value: I18n.t('work_package.sharing.permissions.comment')))+ end- new_user_row.with_column do- render(Primer::Beta::Button.new(scheme: :primary)) { I18n.t('work_package.sharing.invite') }+ new_user_row.with_column do+ render(Primer::Beta::Button.new(scheme: :primary)) { I18n.t('work_package.sharing.invite') }+ endendend- end- if @shared_users.empty?- # Todo: show empty state?- else- modal_content.with_row(mt: 3) do- render(Primer::Beta::BorderBox.new) do |invited_user_list|- invited_user_list.with_header(color: :subtle) do- I18n.t('work_package.sharing.count', count: @shared_users.count)- end+ if @shared_users.empty?+ # Todo: show empty state?+ else+ modal_content.with_row(mt: 3) do+ render(Primer::Beta::BorderBox.new) do |invited_user_list|+ invited_user_list.with_header(color: :subtle) do+ I18n.t('work_package.sharing.count', count: @shared_users.count)+ end- @shared_users.each do |user|- invited_user_list.with_row do- flex_layout(align_items: :center) do |user_row_container|- user_row_container.with_column(flex: :auto) do- render(Users::AvatarComponent.new(user: User.find(user), size: :medium))- end+ @shared_users.each do |user|+ invited_user_list.with_row do+ flex_layout(align_items: :center) do |user_row_container|+ user_row_container.with_column(flex: :auto) do+ render(Users::AvatarComponent.new(user: User.find(user), size: :medium))+ end- user_row_container.with_column(color: :subtle, style: "width: 150px;") do- # ToDo: real permission- render(WorkPackages::Share::PermissionButtonComponent.new(shown_value: I18n.t('work_package.sharing.permissions.comment')))- end+ user_row_container.with_column(color: :subtle, style: "width: 150px;") do+ # ToDo: real permission+ render(WorkPackages::Share::PermissionButtonComponent.new(shown_value: I18n.t('work_package.sharing.permissions.comment')))+ end- user_row_container.with_column(text_align: :right, style: "width: 100px;") do- render(Primer::Beta::Button.new(scheme: :invisible)) { I18n.t('work_package.sharing.remove') }+ user_row_container.with_column(text_align: :right, style: "width: 100px;") do+ render(Primer::Beta::Button.new(scheme: :invisible)) { I18n.t('work_package.sharing.remove') }+ endendendenddiff --git a/app/components/work_packages/share/modal_component.rb b/app/components/work_packages/share/modal_component.rbindex bc392c9f98f..9d0f8328c57 100644--- a/app/components/work_packages/share/modal_component.rb+++ b/app/components/work_packages/share/modal_component.rb@@ -30,6 +30,7 @@ module WorkPackagesmodule Shareclass ModalComponent < ApplicationComponentinclude ApplicationHelper+ include Turbo::FramesHelperinclude OpPrimer::ComponentHelpersdef initialize(work_package:)diff --git a/app/controllers/work_packages/shares_controller.rb b/app/controllers/work_packages/shares_controller.rbindex 175cc3c7267..cb8c79c7ba9 100644--- a/app/controllers/work_packages/shares_controller.rb+++ b/app/controllers/work_packages/shares_controller.rb@@ -29,6 +29,7 @@class WorkPackages::SharesController < ApplicationControllerdef index@work_package = WorkPackage.find(params[:id])- render(WorkPackages::Share::ModalComponent.new(work_package: @work_package))++ render WorkPackages::Share::ModalComponent.new(work_package: @work_package), layout: nilendenddiff --git a/frontend/src/app/features/work-packages/components/wp-share-modal/wp-share.modal.html b/frontend/src/app/features/work-packages/components/wp-share-modal/wp-share.modal.htmlindex d963fc45c38..68e23a61b39 100644--- a/frontend/src/app/features/work-packages/components/wp-share-modal/wp-share.modal.html+++ b/frontend/src/app/features/work-packages/components/wp-share-modal/wp-share.modal.html@@ -6,7 +6,7 @@>TODO</div><div class="spot-modal--body spot-container">- <turbo-frame src="{{this.frameSrc}}">+ <turbo-frame id="work_package_share_list" src="{{this.frameSrc}}"></turbo-frame></div></div>