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

[chore] updated settings pages of lookbook

Eric Schubertf7e74391abfc
diff --git a/lookbook/docs/patterns/02-forms.md.erb b/lookbook/docs/patterns/02-forms.md.erb
index 4cef5bf0ca5..b0fa1d90633 100644
--- a/lookbook/docs/patterns/02-forms.md.erb
+++ b/lookbook/docs/patterns/02-forms.md.erb
@@ -31,9 +31,8 @@ If a form does not use Subhead sections, then there should be a single 'Save' (u
## Form width
In Primer, form elements automatically take the width of the container. In certain cases (especially Settings pages),
-full-width input fields will look strange. For those wide settings pages, the component rendering the form in its
-template should inherit from the base component `AdminSettingsFormComponent`. This component ensures a wrapping
-container, limiting the max-width of the form to `480px`.
+full-width input fields will look strange. For those wide settings pages, we introduced [a pattern](./settings_pages)
+that wraps the form into a container with limited width.
In any container though the form elements can still limit its own width. A good rule of thumb is to fit the size of the
fields to the expected length of the user input. Date fields can for example be rather small, as they are limited in
diff --git a/lookbook/docs/patterns/17-settings-pages.md.erb b/lookbook/docs/patterns/17-settings-pages.md.erb
index f975a73b902..2bd8b1e4b2f 100644
--- a/lookbook/docs/patterns/17-settings-pages.md.erb
+++ b/lookbook/docs/patterns/17-settings-pages.md.erb
@@ -1 +1,29 @@
-When working on Settings pages, please refer to the Forms pattern for information on how to implement form elements.
\ No newline at end of file
+Settings pages usually have content space that stretches to the full width of the viewport, as there is no other element
+horizontally positioned, except the left side menu.
+
+## Settings page base component
+
+According to the [form width specification](./forms), we avoid forms to stretch without limit. Because of the default
+behaviour of form elements to use the full width of the container, we use a base component that embeds the form inside
+such a wrapping container.
+
+Any view component rendering a form should inherit from `AdminSettingsFormComponent`. The template stays unchanged. This
+way, the rendered form is wrapped into a container with `480px` max-width.
+
+```ruby
+module WorkPackages
+ module Types
+ class SettingsComponent < AdminSettingsFormComponent
+ # component logic goes here
+ end
+ end
+end
+```
+
+```erb
+<%%=
+ primer_form_with(**form_options) do |f|
+ render(WorkPackages::Types::SettingsForm.new(f))
+ end
+%>
+```