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

switch to op_primer header component

Jonas Jabari99dbfceda6d5
diff --git a/app/components/projects/settings/project_custom_fields/header_component.html.erb b/app/components/projects/settings/project_custom_fields/header_component.html.erb
deleted file mode 100644
index d7e5a689eac..00000000000
--- a/app/components/projects/settings/project_custom_fields/header_component.html.erb
+++ /dev/null
@@ -1,15 +0,0 @@
-<%=
- flex_layout do |header_container|
- header_container.with_row do
- render(Primer::Beta::Heading.new(tag: :h1)) { t('projects.settings.project_custom_fields.header.title') }
- end
- header_container.with_row(mt: 1, pb: 3, mb: 2, border: :bottom) do
- render(Primer::Beta::Text.new(color: :muted)) do
- t('projects.settings.project_custom_fields.header.description',
- overview_url: project_path(@project),
- admin_settings_url: admin_settings_project_custom_fields_path
- ).html_safe
- end
- end
- end
-%>
diff --git a/app/components/projects/settings/project_custom_fields/header_component.rb b/app/components/projects/settings/project_custom_fields/header_component.rb
deleted file mode 100644
index c3881b428e8..00000000000
--- a/app/components/projects/settings/project_custom_fields/header_component.rb
+++ /dev/null
@@ -1,44 +0,0 @@
-#-- copyright
-# OpenProject is an open source project management software.
-# Copyright (C) 2012-2023 the OpenProject GmbH
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License version 3.
-#
-# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
-# Copyright (C) 2006-2013 Jean-Philippe Lang
-# Copyright (C) 2010-2013 the ChiliProject Team
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# See COPYRIGHT and LICENSE files for more details.
-#++
-
-module Projects
- module Settings
- module ProjectCustomFields
- class HeaderComponent < ApplicationComponent
- include ApplicationHelper
- include OpPrimer::ComponentHelpers
-
- def initialize(project:)
- super
-
- @project = project
- end
- end
- end
- end
-end
diff --git a/app/views/projects/settings/project_custom_fields/show.html.erb b/app/views/projects/settings/project_custom_fields/show.html.erb
index 9b62dc8d9f5..0941aa2111f 100644
--- a/app/views/projects/settings/project_custom_fields/show.html.erb
+++ b/app/views/projects/settings/project_custom_fields/show.html.erb
@@ -27,7 +27,13 @@ See COPYRIGHT and LICENSE files for more details.
++#%>
<div data-turbo="true">
- <%= render(Projects::Settings::ProjectCustomFields::HeaderComponent.new(project: @project)) %>
+ <%= render Primer::OpenProject::PageHeader.new do |header| %>
+ <%= header.with_title(variant: :default) { t('projects.settings.project_custom_fields.header.title') } %>
+ <%= header.with_description { t('projects.settings.project_custom_fields.header.description',
+ overview_url: project_path(@project),
+ admin_settings_url: admin_settings_project_custom_fields_path
+ ).html_safe } %>
+ <% end %>
<%= render(Projects::Settings::ProjectCustomFieldSections::IndexComponent.new(
project: @project,
project_custom_field_sections: @project_custom_field_sections,