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
Add an open paramter to the ShareDialog so we can open it in Lookbook
Klaus Zanders8f9e0afa2d74
diff --git a/app/components/shares/share_dialog_component.html.erb b/app/components/shares/share_dialog_component.html.erbindex 885fae1ddcf..d3c7f273265 100644--- a/app/components/shares/share_dialog_component.html.erb+++ b/app/components/shares/share_dialog_component.html.erb@@ -1,5 +1,5 @@<%=- render(Primer::Alpha::Dialog.new(title: t(:label_share_project_list), id: 'sharing-modal', data: { 'keep-open-on-submit': true }, size: :xlarge)) do |d|+ render(Primer::Alpha::Dialog.new(title: strategy.title, id: 'sharing-modal', data: { 'keep-open-on-submit': true }, size: :xlarge, open: open)) do |d|d.with_header(variant: :large, mb: 3)d.with_body dorender(strategy.modal_body_component(errors))diff --git a/app/components/shares/share_dialog_component.rb b/app/components/shares/share_dialog_component.rbindex 63ad3ba6f08..ea7a0444a20 100644--- a/app/components/shares/share_dialog_component.rb+++ b/app/components/shares/share_dialog_component.rb@@ -34,15 +34,16 @@ module Sharesinclude OpTurbo::Streamableinclude OpPrimer::ComponentHelpers- def initialize(strategy:, errors:)+ def initialize(strategy:, errors:, open: false)super@strategy = strategy@errors = errors+ @open = openendprivate- attr_reader :strategy, :errors+ attr_reader :strategy, :errors, :openendenddiff --git a/lookbook/previews/shares/share_dialog_component_preview.rb b/lookbook/previews/shares/share_dialog_component_preview.rbindex 8818bcb4e50..75d131c0ce5 100644--- a/lookbook/previews/shares/share_dialog_component_preview.rb+++ b/lookbook/previews/shares/share_dialog_component_preview.rb@@ -1,23 +1,22 @@module Shares+ # @logical_path OpenProject/Sharesclass ShareDialogComponentPreview < Lookbook::Previewdef project_queryuser = FactoryBot.build_stubbed(:admin)query = FactoryBot.build_stubbed(:project_query, user:)- strategy = SharingStrategies::ProjectQueryStrategy.new(query, user:)+ strategy = SharingStrategies::ProjectQueryStrategy.new(query, user:, query_params: {})errors = []- shares = []- render(Shares::ShareDialogComponent.new(strategy:, shares:, errors:))+ render(Shares::ShareDialogComponent.new(strategy:, errors:, open: true))enddef work_packageuser = FactoryBot.build_stubbed(:admin)work_package = FactoryBot.build_stubbed(:work_package)- strategy = SharingStrategies::WorkPackageStrategy.new(work_package, user:)+ strategy = SharingStrategies::WorkPackageStrategy.new(work_package, user:, query_params: {})errors = []- shares = []- render(Shares::ShareDialogComponent.new(strategy:, shares:, errors:))+ render(Shares::ShareDialogComponent.new(strategy:, errors:, open: true))endendend