Skip to content

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

Fix shares being appended to the wrong element

Klaus Zanders5d5f4d6a08b4
diff --git a/app/components/shares/manage_shares_component.rb b/app/components/shares/manage_shares_component.rb
index 3392779f2a7..ec76e35b49a 100644
--- a/app/components/shares/manage_shares_component.rb
+++ b/app/components/shares/manage_shares_component.rb
@@ -31,6 +31,7 @@ module Shares
include ApplicationHelper
include MemberHelper
include OpPrimer::ComponentHelpers
+ include OpTurbo::Streamable
attr_reader :strategy,
:entity,
@@ -47,7 +48,7 @@ module Shares
end
def self.wrapper_key
- "share_modal_body"
+ "share_modal_management_table"
end
private
diff --git a/app/controllers/shares_controller.rb b/app/controllers/shares_controller.rb
index a3272a1c0bb..e98ac1d4dc7 100644
--- a/app/controllers/shares_controller.rb
+++ b/app/controllers/shares_controller.rb
@@ -163,12 +163,7 @@ class SharesController < ApplicationController
def respond_with_replace_modal
sharing_strategy.shares(reload: true)
- replace_via_turbo_stream(
- component: Shares::ModalBodyComponent.new(
- strategy: sharing_strategy,
- errors: @errors
- )
- )
+ replace_via_turbo_stream(component: sharing_strategy.modal_body_component(@errors))
respond_with_turbo_streams
end
@@ -190,14 +185,8 @@ class SharesController < ApplicationController
new_shares.each do |share|
prepend_via_turbo_stream(
- component: Shares::ShareRowComponent.new(
- share:,
- strategy: sharing_strategy
- ),
- target_component: Shares::ModalBodyComponent.new(
- strategy: sharing_strategy,
- errors: @errors
- )
+ component: Shares::ShareRowComponent.new(share:, strategy: sharing_strategy),
+ target_component: Shares::ManageSharesComponent.new(strategy: sharing_strategy, modal_content: nil, errors: @errors)
)
end