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
Move modal pattern to lookbook docs
Oliver Günther3d75145e1292
diff --git a/app/views/layouts/component_preview.html.erb b/app/views/layouts/component_preview.html.erbindex 161be9fab86..82fc214be44 100644--- a/app/views/layouts/component_preview.html.erb+++ b/app/views/layouts/component_preview.html.erb@@ -30,9 +30,17 @@ See COPYRIGHT and LICENSE files for more details.<head><%= include_frontend_assets %></head>-<body class="viewcomponent-preview">+<%+ styles = []+ min_height = params[:lookbook][:display][:min_height]+ styles << "min-height: #{min_height}" if min_height.present?+%>++<%= content_tag :body,+ class: 'viewcomponent-preview',+ style: styles.join(";") do %><section class="viewcomponent-preview--content"><%= yield %></section>-</body>+<% end %></html>diff --git a/frontend/src/stories/ModalDialogue.mdx b/spec/components/docs/patterns/modals.md.erbsimilarity index 94%rename from frontend/src/stories/ModalDialogue.mdxrename to spec/components/docs/patterns/modals.md.erbindex 01e2c2cdadb..e2e89ab9ab2 100644--- a/frontend/src/stories/ModalDialogue.mdx+++ b/spec/components/docs/patterns/modals.md.erb@@ -1,10 +1,7 @@-import { Meta } from '@storybook/blocks';-<Meta title="Patterns/Modal Dialogue" />+<%= embed ModalPreview, :danger_zone %>-# Modal dialogue--> Example of modal with two buttons: Cancel and Delete (danger)+> Example of modal with two buttons: Cancel and Continue (danger)The modal dialogue is used to to provide actions that require the user’s attention. They interrupt the user’s regular navigation in that they cover the screen and make interaction behind it not possible whilst it is displayed.@@ -35,7 +32,7 @@ This component does not by itself define the types of content it can contain. So## Behaviour-The modal is launched by user action and displayed in a lightbox (a semi-transparent grey background).+The modal is launched by user action and displayed in a lightbox (a semi-transparent grey background).The action bar always has only two actions, one of which is always “Cancel” (secondary) and the other one usually an confirmational action like “Apply” or “Save”. As with any action bar, a third action (usually a checkbox) can optionally be displayed on the left corner.@@ -59,7 +56,7 @@ The container has 4px rounded corners.The modal (in desktop form) has two acceptable widths: 40 REM and 60 REM.-The header has 16px padding (left and right) and a 16px top margin.+The header has 16px padding (left and right) and a 16px top margin.Note that the optional divider in the header a 16px top margin but no additional margin/padding, and must take 100% of the width of the modal.diff --git a/spec/components/previews/modal_preview.rb b/spec/components/previews/modal_preview.rbindex c100b0f4cdf..33cbc03505d 100644--- a/spec/components/previews/modal_preview.rb+++ b/spec/components/previews/modal_preview.rb@@ -1,4 +1,5 @@# @logical_path OpenProject+# @display min_height 500pxclass ModalPreview < Lookbook::Previewdef default; end