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

use op header component

Jonas Jabari376159cd4e66
diff --git a/app/components/settings/project_custom_fields/edit_form_header_component.html.erb b/app/components/settings/project_custom_fields/edit_form_header_component.html.erb
index 3c223eb5547..a9e2c805fac 100644
--- a/app/components/settings/project_custom_fields/edit_form_header_component.html.erb
+++ b/app/components/settings/project_custom_fields/edit_form_header_component.html.erb
@@ -27,24 +27,9 @@ See COPYRIGHT and LICENSE files for more details.
++#%>
<%=
- flex_layout(pb: 2, border: :bottom) do |header_container|
- header_container.with_row(mb: 2, flex_layout: true, align_items: :center) do |title_row_container|
- title_row_container.with_column(mr: 2) do
- render(Primer::Beta::IconButton.new(
- tag: :a,
- href: admin_settings_project_custom_fields_path,
- scheme: :invisible,
- icon: "arrow-left",
- size: :large,
- "aria-label": t("back")
- ))
- end
- title_row_container.with_column(mr: 2) do
- render(Primer::Beta::Heading.new(tag: :h1)) { @custom_field.name }
- end
- end
- header_container.with_row(mb: 2) do
- render(Primer::Beta::Text.new(color: :muted)) { t('settings.project_attributes.edit.description') }
- end
+ render(Primer::OpenProject::PageHeader.new) do |header|
+ header.with_title(variant: :medium) { @custom_field.name }
+ header.with_description { t('settings.project_attributes.edit.description') }
+ header.with_back_button(href: admin_settings_project_custom_fields_path, 'aria-label': t('button_back'))
end
%>
diff --git a/app/components/settings/project_custom_fields/new_form_header_component.html.erb b/app/components/settings/project_custom_fields/new_form_header_component.html.erb
index 19559fdeb6a..9f551e70af1 100644
--- a/app/components/settings/project_custom_fields/new_form_header_component.html.erb
+++ b/app/components/settings/project_custom_fields/new_form_header_component.html.erb
@@ -26,25 +26,11 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
See COPYRIGHT and LICENSE files for more details.
++#%>
+
<%=
- flex_layout(pb: 2, border: :bottom) do |header_container|
- header_container.with_row(mb: 2, flex_layout: true, align_items: :center) do |title_row_container|
- title_row_container.with_column(mr: 2) do
- render(Primer::Beta::IconButton.new(
- tag: :a,
- href: admin_settings_project_custom_fields_path,
- scheme: :invisible,
- icon: "arrow-left",
- size: :large,
- "aria-label": t("back")
- ))
- end
- title_row_container.with_column(mr: 2) do
- render(Primer::Beta::Heading.new(tag: :h1)) { t('settings.project_attributes.new.heading') }
- end
- end
- header_container.with_row(mb: 2) do
- render(Primer::Beta::Text.new(color: :muted)) { t('settings.project_attributes.new.description') }
- end
+ render(Primer::OpenProject::PageHeader.new) do |header|
+ header.with_title(variant: :medium) { t('settings.project_attributes.new.heading') }
+ header.with_description { t('settings.project_attributes.new.description') }
+ header.with_back_button(href: admin_settings_project_custom_fields_path, 'aria-label': t('button_back'))
end
%>