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
docs[Op#56496]: touch up documentation
Kabiru Mwenjacab737f5328d
diff --git a/lookbook/docs/patterns/09-flash-modal.md.erb b/lookbook/docs/patterns/09-flash-modal.md.erbindex da831cb5595..5cd1aa59180 100644--- a/lookbook/docs/patterns/09-flash-modal.md.erb+++ b/lookbook/docs/patterns/09-flash-modal.md.erb@@ -6,9 +6,11 @@ This pattern defines use cases where a modal view component is rendered on the n## OverviewTo flash a modal, set a `flash[:op_modal]` hash in your controller action. The hash should contain the following keys:- * `type:` - the modal component to render+ * `component:` - the modal component to render* `parameters:` - the parameters to pass to the modal component+You can use the helper method `flash_op_modal` to set the flash modal properties.+Ex.```ruby@@ -18,6 +20,23 @@ flash_op_modal component: ::Storages::ProjectStorages::OAuthAccessGrantedModalCoInternally, the `FlashMessagesHelper#render_flash_messages` will select flash messages with the key `:op_modal` and render the modal component with the given parameters.+P.S. When the `component` is a `Primer::Alpha::Dialog` the `auto-show-dialog` stimulus controller should be declared in order to automatically show the dialog when the page is loaded.++Ex.++```ruby+render(+ Primer::Alpha::Dialog.new(+ id: dialog_id,+ title:,+ data: {+ controller: "auto-show-dialog",+ }+) do+ # ....+end+```+### Flash a modal on callback from external serviceWhen you want to display a modal after a callback request from an external service, store the op modal component directly in the `session` in the controller action that performs by calling `OpModalFlashable#store_callback_op_modal_flash` bofore the open redirect and then extract them in the controller action that handles the callback via `OpTurbo::Flashable#retrieve_callback_op_modal_flash`.