Skip to content

Commit f9f5bba

Browse files
authored
Merge pull request opf#18894 from opf/code-maintenance/64006-rename-admin_settings_primer_form_with-to-settings_primer_form_with
[64006] Rename `admin_settings_primer_form_with` to `settings_primer_form_with`
2 parents 21ddc67 + 8f8a62b commit f9f5bba

File tree

17 files changed

+26
-25
lines changed

17 files changed

+26
-25
lines changed

app/components/custom_fields/details_component.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
end
1616

1717
content.with_row do
18-
admin_settings_primer_form_with(
18+
settings_primer_form_with(
1919
model:,
2020
scope: :custom_field,
2121
id: "custom_field_form",

app/components/op_primer/form_helpers.rb

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -113,16 +113,17 @@ def render_inline_settings_form(form_builder, &blk)
113113
end
114114

115115
# An extension of primers default `primer_form_with`
116-
# Renders a primer form with a special wrapper around to limit the width.
116+
# Renders a primer form with a special wrapper around to limit the width for
117+
# legibility.
117118
#
118119
# This method dynamically creates a container around the actual form.
119120
# All arguments and the content are simply passed through to the `primer_form_with` call
120121
#
121-
# It is meant for settings pages within the administration to
122-
# have a unified look and feel for our users.
122+
# It is meant for any settings pages like in administration or project
123+
# settings to have a unified look and feel for our users.
123124
#
124125
# @example
125-
# admin_settings_primer_form_with(scope: :settings, action: :update, method: :patch) do |form|
126+
# settings_primer_form_with(scope: :settings, action: :update, method: :patch) do |form|
126127
# render_inline_settings_form(form) do |f|
127128
# f.check_box(name: :allow_tracking_start_and_end_times)
128129
# f.check_box(name: :enforce_tracking_start_and_end_times)
@@ -133,7 +134,7 @@ def render_inline_settings_form(form_builder, &blk)
133134
#
134135
# @param kwargs [Hash] The arguments for the form
135136
# @param block [Proc] A block that defines the form structure.
136-
def admin_settings_primer_form_with(**, &)
137+
def settings_primer_form_with(**, &)
137138
render(Primer::BaseComponent.new(tag: :div, classes: "op-admin-settings-form-wrapper")) do
138139
primer_form_with(**, &)
139140
end

app/components/projects/life_cycle_step_definitions/form_component.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ See COPYRIGHT and LICENSE files for more details.
2727
2828
++#%>
2929

30-
<%= admin_settings_primer_form_with(
30+
<%= settings_primer_form_with(
3131
model: [:admin, :settings, model],
3232
data: { controller: "show-when-checked" }
3333
) do |f|

app/components/projects/settings/general/show_component.html.erb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ See COPYRIGHT and LICENSE files for more details.
3030
<%=
3131
flex_layout do |container|
3232
container.with_row(mb: 3) do
33-
admin_settings_primer_form_with(model: project, url: project_settings_general_path(project)) do |f|
33+
settings_primer_form_with(model: project, url: project_settings_general_path(project)) do |f|
3434
concat(
3535
render(Primer::Beta::Subhead.new) do |component|
3636
component.with_heading(tag: :h2, size: :medium) { I18n.t("projects.settings.header_details") }
@@ -49,7 +49,7 @@ See COPYRIGHT and LICENSE files for more details.
4949
end
5050

5151
container.with_row(mb: 3) do
52-
admin_settings_primer_form_with(model: project, url: project_settings_general_path(project)) do |f|
52+
settings_primer_form_with(model: project, url: project_settings_general_path(project)) do |f|
5353
concat(
5454
render(Primer::Beta::Subhead.new) do |component|
5555
component.with_heading(tag: :h2, size: :medium) { I18n.t("projects.settings.header_status") }
@@ -68,7 +68,7 @@ See COPYRIGHT and LICENSE files for more details.
6868
end
6969

7070
container.with_row(mb: 3) do
71-
admin_settings_primer_form_with(model: project, url: project_settings_general_path(project)) do |f|
71+
settings_primer_form_with(model: project, url: project_settings_general_path(project)) do |f|
7272
concat(
7373
render(Primer::Beta::Subhead.new) do |component|
7474
component.with_heading(tag: :h2, size: :medium) { I18n.t("projects.settings.header_relations") }

app/components/work_packages/types/settings_component.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ See COPYRIGHT and LICENSE files for more details.
2828
++#%>
2929

3030
<%=
31-
admin_settings_primer_form_with(**form_options) do |f|
31+
settings_primer_form_with(**form_options) do |f|
3232
render(WorkPackages::Types::SettingsForm.new(f))
3333
end
3434
%>

app/components/work_packages/types/subject_configuration_component.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ See COPYRIGHT and LICENSE files for more details.
3232
%>
3333

3434
<%=
35-
admin_settings_primer_form_with(**form_options) do |f|
35+
settings_primer_form_with(**form_options) do |f|
3636
render(WorkPackages::Types::SubjectConfigurationForm.new(f))
3737
end
3838
%>

app/views/admin/settings/authentication_settings/_login.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ See COPYRIGHT and LICENSE files for more details.
2828
++#%>
2929

3030
<%=
31-
admin_settings_primer_form_with(scope: :settings,
31+
settings_primer_form_with(scope: :settings,
3232
url: admin_settings_authentication_path(tab: params[:tab]),
3333
method: :patch) do |f|
3434
render_inline_settings_form(f) do |form|

app/views/admin/settings/authentication_settings/_passwords.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ See COPYRIGHT and LICENSE files for more details.
2828
++#%>
2929

3030
<%=
31-
admin_settings_primer_form_with(scope: :settings,
31+
settings_primer_form_with(scope: :settings,
3232
url: admin_settings_authentication_path(tab: params[:tab]),
3333
data: { turbo_method: :patch },
3434
method: :patch) do |f|

app/views/admin/settings/authentication_settings/_registration.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ See COPYRIGHT and LICENSE files for more details.
2828
++#%>
2929

3030
<%=
31-
admin_settings_primer_form_with(scope: :settings,
31+
settings_primer_form_with(scope: :settings,
3232
url: admin_settings_authentication_path(tab: params[:tab]),
3333
data: { turbo_method: :patch },
3434
method: :patch) do |f|

app/views/admin/settings/progress_tracking/show.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ See COPYRIGHT and LICENSE files for more details.
3838
end
3939
%>
4040
<%=
41-
admin_settings_primer_form_with(
41+
settings_primer_form_with(
4242
scope: :settings, action: :update, method: :patch,
4343
data: {
4444
application_target: "dynamic",

app/views/admin/settings/work_package_priorities/edit.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,6 @@ See COPYRIGHT and LICENSE files for more details.
4343
end
4444
%>
4545

46-
<%= admin_settings_primer_form_with(model: @enumeration, scope: :enumeration, url: url_for(action: :update, id: @enumeration)) do |f| %>
46+
<%= settings_primer_form_with(model: @enumeration, scope: :enumeration, url: url_for(action: :update, id: @enumeration)) do |f| %>
4747
<%= render(Admin::Enumerations::ItemForm.new(f)) %>
4848
<% end %>

app/views/admin/settings/work_package_priorities/new.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,6 @@ See COPYRIGHT and LICENSE files for more details.
4141
end
4242
%>
4343

44-
<%= admin_settings_primer_form_with(model: @enumeration, scope: :enumeration, url: url_for(action: :create)) do |f| %>
44+
<%= settings_primer_form_with(model: @enumeration, scope: :enumeration, url: url_for(action: :create)) do |f| %>
4545
<%= render(Admin::Enumerations::ItemForm.new(f)) %>
4646
<% end %>

app/views/statuses/edit.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ See COPYRIGHT and LICENSE files for more details.
4444
<%= error_messages_for :status %>
4545

4646
<%=
47-
admin_settings_primer_form_with(
47+
settings_primer_form_with(
4848
model: @status,
4949
data: {
5050
application_target: "dynamic",

lookbook/docs/patterns/17-settings-pages.md.erb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ Settings pages usually stretch to the full width of the viewport as they tend no
44

55
As specified in the documentation for [forms](./forms), we prefer limiting the width of a form for legibility. Because the default behaviour of form elements to fill the full width of the container, we wrap forms in a container that limits its available width.
66

7-
Any view component rendering a form should use the the `admin_settings_primer_form_with` form helper instead of the standard `primer_form_with`. The form itself stays unchanged. This
7+
Any view component rendering a form should use the the `settings_primer_form_with` form helper instead of the standard `primer_form_with`. The form itself stays unchanged. This
88
way, the rendered form is wrapped into a container with `680px` max-width.
99

1010
```erb
1111
<%%=
12-
admin_settings_primer_form_with(**form_options) do |f|
12+
settings_primer_form_with(**form_options) do |f|
1313
render(WorkPackages::Types::SettingsForm.new(f))
1414
end %>
1515
```

modules/costs/app/views/admin/costs_settings/show.html.erb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ See COPYRIGHT and LICENSE files for more details.
5353
dismissable: false))
5454
%>
5555
<%=
56-
admin_settings_primer_form_with(scope: :settings, action: :update, method: :patch) do |time_form|
56+
settings_primer_form_with(scope: :settings, action: :update, method: :patch) do |time_form|
5757
render_inline_settings_form(time_form) do |form|
5858
form.html_content do
5959
render(Primer::Beta::Subhead.new(hide_border: true)) do |subhead|
@@ -76,7 +76,7 @@ See COPYRIGHT and LICENSE files for more details.
7676
component.with_tab(id: "tab-costs") do |tab|
7777
tab.with_text { I18n.t(:label_costs) }
7878
tab.with_panel do
79-
admin_settings_primer_form_with(scope: :settings, action: :update, method: :patch) do |time_form|
79+
settings_primer_form_with(scope: :settings, action: :update, method: :patch) do |time_form|
8080
render_inline_settings_form(time_form) do |form|
8181
form.html_content do
8282
render(Primer::Beta::Subhead.new(hide_border: true)) do |subhead|

modules/costs/app/views/admin/settings/time_entry_activities/edit.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,6 @@ See COPYRIGHT and LICENSE files for more details.
4343
end
4444
%>
4545

46-
<%= admin_settings_primer_form_with(model: @enumeration, scope: :enumeration, url: url_for(action: :update, id: @enumeration)) do |f| %>
46+
<%= settings_primer_form_with(model: @enumeration, scope: :enumeration, url: url_for(action: :update, id: @enumeration)) do |f| %>
4747
<%= render(Admin::Enumerations::ItemForm.new(f)) %>
4848
<% end %>

modules/documents/app/views/admin/settings/document_categories/edit.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,6 @@ See COPYRIGHT and LICENSE files for more details.
4242
end
4343
%>
4444

45-
<%= admin_settings_primer_form_with(model: @enumeration, scope: :enumeration, url: url_for(action: :update, id: @enumeration)) do |f| %>
45+
<%= settings_primer_form_with(model: @enumeration, scope: :enumeration, url: url_for(action: :update, id: @enumeration)) do |f| %>
4646
<%= render(Admin::Enumerations::ItemForm.new(f)) %>
4747
<% end %>

0 commit comments

Comments
 (0)