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
Harmonize breadcrumb structure for Authentication menu with the help of PageHeader
Henriette Darge337efdf50898
diff --git a/app/components/oauth/show_page_header_component.html.erb b/app/components/oauth/show_page_header_component.html.erbnew file mode 100644index 00000000000..c466d39405d--- /dev/null+++ b/app/components/oauth/show_page_header_component.html.erb@@ -0,0 +1,62 @@+<%#-- copyright+OpenProject is an open source project management software.+Copyright (C) 2012-2024 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.++++#%>++<%=+ render Primer::OpenProject::PageHeader.new do |header|+ header.with_title { h(@application.name) }+ header.with_breadcrumbs(breadcrumb_items)++ header.with_action_button(tag: :a,+ mobile_icon: :pencil,+ mobile_label: t(:button_edit),+ size: :medium,+ href: edit_oauth_application_path(@application),+ aria: { label: I18n.t(:button_edit) },+ title: I18n.t(:button_edit)) do |button|+ button.with_leading_visual_icon(icon: :pencil)+ t(:button_edit)+ end++ header.with_action_button(tag: :a,+ scheme: :danger,+ mobile_icon: :trash,+ mobile_label: t(:button_delete),+ size: :medium,+ href: oauth_application_path(@application),+ aria: { label: I18n.t(:button_delete) },+ data: {+ confirm: I18n.t(:text_are_you_sure),+ method: :delete+ },+ title: I18n.t(:button_delete)) do |button|+ button.with_leading_visual_icon(icon: :trash)+ t(:button_delete)+ end+ end+%>diff --git a/app/components/oauth/show_page_header_component.rb b/app/components/oauth/show_page_header_component.rbnew file mode 100644index 00000000000..dcffb5689be--- /dev/null+++ b/app/components/oauth/show_page_header_component.rb@@ -0,0 +1,46 @@+# frozen_string_literal: true++# -- copyright+# OpenProject is an open source project management software.+# Copyright (C) 2010-2024 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.+# ++++class OAuth::ShowPageHeaderComponent < ApplicationComponent+ include OpPrimer::ComponentHelpers+ include ApplicationHelper++ def initialize(application:)+ super+ @application = application+ end++ def breadcrumb_items+ [{ href: admin_index_path, text: t(:label_administration) },+ { href: admin_settings_authentication_path, text: t(:label_authentication) },+ { href: oauth_applications_path, text: t("oauth.application.plural") },+ h(@application.name)]+ end+enddiff --git a/app/controllers/admin/settings/authentication_settings_controller.rb b/app/controllers/admin/settings/authentication_settings_controller.rbindex 875d6c16789..723baac41a9 100644--- a/app/controllers/admin/settings/authentication_settings_controller.rb+++ b/app/controllers/admin/settings/authentication_settings_controller.rb@@ -29,13 +29,5 @@module Admin::Settingsclass AuthenticationSettingsController < ::Admin::SettingsControllermenu_item :authentication_settings-- def default_breadcrumb- t(:label_authentication)- end-- def show_local_breadcrumb- true- endendenddiff --git a/app/controllers/ldap_auth_sources_controller.rb b/app/controllers/ldap_auth_sources_controller.rbindex 172a358af68..08a71d7d8a2 100644--- a/app/controllers/ldap_auth_sources_controller.rb+++ b/app/controllers/ldap_auth_sources_controller.rb@@ -106,16 +106,8 @@ class LdapAuthSourcesController < ApplicationControllerendend- def default_breadcrumb- if action_name == "index"- t(:label_ldap_auth_source_plural)- else- ActionController::Base.helpers.link_to(t(:label_ldap_auth_source_plural), ldap_auth_sources_path)- end- end-def show_local_breadcrumb- true+ falseenddef block_if_password_login_disableddiff --git a/app/controllers/oauth/applications_controller.rb b/app/controllers/oauth/applications_controller.rbindex d77870eb801..35301d285bd 100644--- a/app/controllers/oauth/applications_controller.rb+++ b/app/controllers/oauth/applications_controller.rb@@ -86,16 +86,10 @@ module OAuthprotected- def default_breadcrumb- if action_name == "index"- t("oauth.application.plural")- else- ActionController::Base.helpers.link_to(t("oauth.application.plural"), oauth_applications_path)- end- end+ def default_breadcrumb; enddef show_local_breadcrumb- current_user.admin?+ falseendprivatediff --git a/app/views/admin/settings/authentication_settings/show.html.erb b/app/views/admin/settings/authentication_settings/show.html.erbindex afe95a411be..b1b977886c3 100644--- a/app/views/admin/settings/authentication_settings/show.html.erb+++ b/app/views/admin/settings/authentication_settings/show.html.erb@@ -28,7 +28,14 @@ See COPYRIGHT and LICENSE files for more details.++#%><% html_title t(:label_administration), t(:label_authentication) -%>-<%= toolbar title: t(:label_authentication) %>+<%=+ render Primer::OpenProject::PageHeader.new do |header|+ header.with_title { t(:label_authentication_settings) }+ header.with_breadcrumbs([{ href: admin_index_path, text: t(:label_administration) },+ { href: admin_settings_authentication_path, text: t(:label_authentication) },+ t(:label_authentication_settings)])+ end+%><%= styled_form_tag(admin_settings_authentication_path, method: :patch) do %><section class="form--section">diff --git a/app/views/ldap_auth_sources/edit.html.erb b/app/views/ldap_auth_sources/edit.html.erbindex 11c9bd88faa..beb4ba76e0d 100644--- a/app/views/ldap_auth_sources/edit.html.erb+++ b/app/views/ldap_auth_sources/edit.html.erb@@ -28,8 +28,16 @@ See COPYRIGHT and LICENSE files for more details.++#%><% html_title t(:label_administration), "#{t(:label_edit)} #{t(:label_ldap_auth_source)} #{@ldap_auth_source.name}" %>-<% local_assigns[:additional_breadcrumb] = @ldap_auth_source.name %>-<%= toolbar title: "#{t(:label_ldap_auth_source)}" %>++<%=+ render Primer::OpenProject::PageHeader.new do |header|+ header.with_title { @ldap_auth_source.name }+ header.with_breadcrumbs([{ href: admin_index_path, text: t(:label_administration) },+ { href: admin_settings_authentication_path, text: t(:label_authentication) },+ { href: ldap_auth_sources_path, text: t(:label_ldap_auth_source_plural) },+ @ldap_auth_source.name])+ end+%><%= labelled_tabular_form_for @ldap_auth_source do |f| %><%= render partial: 'form', locals: { f: f } %>diff --git a/app/views/ldap_auth_sources/index.html.erb b/app/views/ldap_auth_sources/index.html.erbindex cf2501c8cf5..405bfc644a2 100644--- a/app/views/ldap_auth_sources/index.html.erb+++ b/app/views/ldap_auth_sources/index.html.erb@@ -28,16 +28,28 @@ See COPYRIGHT and LICENSE files for more details.++#%><% html_title t(:label_administration), t(:label_ldap_auth_source_plural) %>-<%= toolbar title: t(:label_ldap_auth_source_plural) do %>- <li class="toolbar-item">- <%= link_to({ action: 'new' },- { class: 'button -primary',- aria: {label: t(:label_ldap_auth_source_new)},- title: t(:label_ldap_auth_source_new)}) do %>- <%= op_icon('button--icon icon-add') %>- <span class="button--text"><%= t(:label_ldap_auth_source) %></span>- <% end %>- </li>-<% end %>++<%=+ render Primer::OpenProject::PageHeader.new do |header|+ header.with_title { I18n.t(:label_ldap_auth_source_plural) }+ header.with_breadcrumbs([{ href: admin_index_path, text: t(:label_administration) },+ { href: admin_settings_authentication_path, text: t(:label_authentication) },+ I18n.t(:label_ldap_auth_source_plural)])+ end+%>++<%=+ render(Primer::OpenProject::SubHeader.new) do |subheader|+ subheader.with_action_button(scheme: :primary,+ aria: { label: I18n.t(:label_ldap_auth_source_new) },+ title: I18n.t(:label_ldap_auth_source_new),+ tag: :a,+ test_selector: "op-admin-ldap-connection--button-new",+ href: new_ldap_auth_source_path) do |button|+ button.with_leading_visual_icon(icon: :plus)+ t(:label_ldap_auth_source)+ end+ end+%><%= render ::LdapAuthSources::TableComponent.new(rows: @ldap_auth_sources) %>diff --git a/app/views/ldap_auth_sources/new.html.erb b/app/views/ldap_auth_sources/new.html.erbindex 9440a214ac0..dd51c283a0e 100644--- a/app/views/ldap_auth_sources/new.html.erb+++ b/app/views/ldap_auth_sources/new.html.erb@@ -28,8 +28,17 @@ See COPYRIGHT and LICENSE files for more details.++#%><% html_title t(:label_administration), t(:label_ldap_auth_source_new) %>-<% local_assigns[:additional_breadcrumb] = t(:label_ldap_auth_source_new) %>-<%= toolbar title: "#{t(:label_ldap_auth_source_new)}" %>++<%=+ render Primer::OpenProject::PageHeader.new do |header|+ header.with_title { I18n.t(:label_ldap_auth_source_new) }+ header.with_breadcrumbs([{ href: admin_index_path, text: t(:label_administration) },+ { href: admin_settings_authentication_path, text: t(:label_authentication) },+ { href: ldap_auth_sources_path, text: t(:label_ldap_auth_source_plural) },+ I18n.t(:label_ldap_auth_source_new)])+ end+%>+<%= labelled_tabular_form_for @ldap_auth_source, as: :ldap_auth_source do |f| %><%= render partial: 'form', locals: { f: f } %>diff --git a/app/views/oauth/applications/edit.html.erb b/app/views/oauth/applications/edit.html.erbindex db35803c9ad..3c78f85dbe5 100644--- a/app/views/oauth/applications/edit.html.erb+++ b/app/views/oauth/applications/edit.html.erb@@ -29,8 +29,16 @@ See COPYRIGHT and LICENSE files for more details.<% edit_label = "#{t(:label_edit)} #{@application.class.model_name.human} #{h(@application.name)}" %><% html_title(t(:label_administration), edit_label) -%>-<% local_assigns[:additional_breadcrumb] = h(@application.name) %>-<%= breadcrumb_toolbar(edit_label) %>++<%=+ render Primer::OpenProject::PageHeader.new do |header|+ header.with_title { h(@application.name) }+ header.with_breadcrumbs([{ href: admin_index_path, text: t(:label_administration) },+ { href: admin_settings_authentication_path, text: t(:label_authentication) },+ { href: oauth_applications_path, text: t("oauth.application.plural") },+ h(@application.name)])+ end+%><%= labelled_tabular_form_for @application,url: { action: "update" },diff --git a/app/views/oauth/applications/index.html.erb b/app/views/oauth/applications/index.html.erbindex 20f3c4c732c..8a909c9cbac 100644--- a/app/views/oauth/applications/index.html.erb+++ b/app/views/oauth/applications/index.html.erb@@ -26,17 +26,28 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.See COPYRIGHT and LICENSE files for more details.++#%>-<% html_title t(:label_administration), t('oauth.application.plural') -%>--<%= toolbar title: t('oauth.application.plural'), title_class: 'no-padding-bottom' do %>- <li class="toolbar-item">- <%= link_to new_oauth_application_path,- { class: 'button -primary',- title: t('oauth.application.new')} do %>- <%= op_icon('button--icon icon-add') %>- <span class="button--text"><%= t(:button_add) %></span>- <% end %>- </li>-<% end %>+<% html_title t(:label_administration), t("oauth.application.plural") -%>++<%=+ render Primer::OpenProject::PageHeader.new do |header|+ header.with_title { t("oauth.application.plural") }+ header.with_breadcrumbs([{ href: admin_index_path, text: t(:label_administration) },+ { href: admin_settings_authentication_path, text: t(:label_authentication) },+ t("oauth.application.plural")])+ end+%>+<%=+ render(Primer::OpenProject::SubHeader.new) do |subheader|+ subheader.with_action_button(scheme: :primary,+ aria: { label: I18n.t("oauth.application.new") },+ title: I18n.t("oauth.application.new"),+ tag: :a,+ test_selector: "op-admin-oauth--button-new",+ href: new_oauth_application_path) do |button|+ button.with_leading_visual_icon(icon: :plus)+ t("oauth.application.singular")+ end+ end+%><%= render ::OAuth::Applications::TableComponent.new(rows: @applications) %>diff --git a/app/views/oauth/applications/new.html.erb b/app/views/oauth/applications/new.html.erbindex c208d363ebc..78bb9457570 100644--- a/app/views/oauth/applications/new.html.erb+++ b/app/views/oauth/applications/new.html.erb@@ -28,8 +28,16 @@ See COPYRIGHT and LICENSE files for more details.++#%><% html_title t(:label_administration), t('oauth.application.new') %>-<% local_assigns[:additional_breadcrumb] = t('oauth.application.new') %>-<%= breadcrumb_toolbar(t('oauth.application.new')) %>++<%=+ render Primer::OpenProject::PageHeader.new do |header|+ header.with_title { t("oauth.application.new") }+ header.with_breadcrumbs([{ href: admin_index_path, text: t(:label_administration) },+ { href: admin_settings_authentication_path, text: t(:label_authentication) },+ { href: oauth_applications_path, text: t("oauth.application.plural") },+ t("oauth.application.new")])+ end+%><%= labelled_tabular_form_for @application,url: { action: "create" },diff --git a/app/views/oauth/applications/show.html.erb b/app/views/oauth/applications/show.html.erbindex 52d257225a4..c579b95f2c7 100644--- a/app/views/oauth/applications/show.html.erb+++ b/app/views/oauth/applications/show.html.erb@@ -29,25 +29,8 @@ See COPYRIGHT and LICENSE files for more details.<% html_title t(:label_administration), t('oauth.application.singular'), h(@application.name) -%><% local_assigns[:additional_breadcrumb] = h(@application.name) %>-<%= toolbar title: "#{t('oauth.application.singular')} - #{h(@application.name)}",- title_class: 'no-padding-bottom' do %>- <li class="toolbar-item">- <%= link_to edit_oauth_application_path(@application),- class: 'button' do %>- <%= op_icon('button--icon icon-edit') %>- <span class="button--text"><%= t(:button_edit) %></span>- <% end %>- </li>- <li class="toolbar-item">- <%= link_to oauth_application_path(@application),- method: :delete,- data: { confirm: I18n.t(:text_are_you_sure) },- class: 'button -danger' do %>- <%= op_icon('button--icon icon-delete') %>- <span class="button--text"><%= t(:button_delete) %></span>- <% end %>- </li>-<% end %>++<%= render OAuth::ShowPageHeaderComponent.new(application: @application) %><%= render(AttributeGroups::AttributeGroupComponent.new) do |component| %><% component.with_header(title: t(:label_details)) %>diff --git a/config/initializers/menus.rb b/config/initializers/menus.rbindex b443573e5bf..97d39d78335 100644--- a/config/initializers/menus.rb+++ b/config/initializers/menus.rb@@ -462,7 +462,7 @@ Redmine::MenuManager.map :admin_menu do |menu|menu.push :authentication_settings,{ controller: "/admin/settings/authentication_settings", action: :show },if: Proc.new { User.current.admin? },- caption: :label_setting_plural,+ caption: :label_authentication_settings,parent: :authenticationmenu.push :ldap_authentication,diff --git a/config/locales/en.yml b/config/locales/en.ymlindex 98f3e930a80..0ff36725602 100644--- a/config/locales/en.yml+++ b/config/locales/en.yml@@ -1975,6 +1975,7 @@ en:label_ldap_auth_source_plural: "LDAP connections"label_attribute_expand_text: "The complete text for '%{attribute}'"label_authentication: "Authentication"+ label_authentication_settings: "Authentication settings"label_available_global_roles: "Available global roles"label_available_project_attributes: "Available project attributes"label_available_project_forums: "Available forums"diff --git a/modules/bim/spec/features/bcf/api_authorization_spec.rb b/modules/bim/spec/features/bcf/api_authorization_spec.rbindex 86ee75b12cb..82afc5789fc 100644--- a/modules/bim/spec/features/bcf/api_authorization_spec.rb+++ b/modules/bim/spec/features/bcf/api_authorization_spec.rb@@ -49,7 +49,7 @@ RSpec.describe "authorization for BCF api", :js, with_config: { edition: "bim" }expect(page).to have_css(".generic-table--empty-row", text: "There is currently nothing to display")# Create application- find(".button", text: "Add").click+ page.find_test_selector("op-admin-oauth--button-new", text: "OAuth application").clickfill_in "application_name", with: "My API application"# Limit to bcf accesscheck scopediff --git a/modules/ldap_groups/app/components/ldap_groups/synchronized_filters/show_page_header_component.html.erb b/modules/ldap_groups/app/components/ldap_groups/synchronized_filters/show_page_header_component.html.erbnew file mode 100644index 00000000000..ca6f4216292--- /dev/null+++ b/modules/ldap_groups/app/components/ldap_groups/synchronized_filters/show_page_header_component.html.erb@@ -0,0 +1,64 @@+<%#-- copyright+OpenProject is an open source project management software.+Copyright (C) 2012-2024 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.++++#%>++<%=+ render Primer::OpenProject::PageHeader.new do |header|+ header.with_title { h(@filter.name) }+ header.with_breadcrumbs(breadcrumb_items, selected_item_font_weight: :normal)++ unless blocked?+ header.with_action_button(tag: :a,+ mobile_icon: :pencil,+ mobile_label: t(:button_edit),+ size: :medium,+ href: edit_ldap_groups_synchronized_filter_path(@filter),+ aria: { label: I18n.t(:button_edit) },+ title: I18n.t(:button_edit)) do |button|+ button.with_leading_visual_icon(icon: :pencil)+ t(:button_edit)+ end++ header.with_action_button(tag: :a,+ scheme: :danger,+ mobile_icon: :trash,+ mobile_label: t(:button_delete),+ size: :medium,+ href: ldap_groups_synchronized_filter_path(@filter),+ aria: { label: I18n.t(:button_delete) },+ data: {+ confirm: I18n.t(:text_are_you_sure),+ method: :delete+ },+ title: I18n.t(:button_delete)) do |button|+ button.with_leading_visual_icon(icon: :trash)+ t(:button_delete)+ end+ end+ end+%>diff --git a/modules/ldap_groups/app/components/ldap_groups/synchronized_filters/show_page_header_component.rb b/modules/ldap_groups/app/components/ldap_groups/synchronized_filters/show_page_header_component.rbnew file mode 100644index 00000000000..d444aad832a--- /dev/null+++ b/modules/ldap_groups/app/components/ldap_groups/synchronized_filters/show_page_header_component.rb@@ -0,0 +1,52 @@+# frozen_string_literal: true++# -- copyright+# OpenProject is an open source project management software.+# Copyright (C) 2010-2024 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.+# ++++class LdapGroups::SynchronizedFilters::ShowPageHeaderComponent < ApplicationComponent+ include OpPrimer::ComponentHelpers+ include ApplicationHelper++ def initialize(filter:)+ super+ @filter = filter+ end++ def breadcrumb_items+ [{ href: admin_index_path, text: t(:label_administration) },+ { href: admin_settings_authentication_path, text: t(:label_authentication) },+ { href: ldap_groups_synchronized_groups_path, text: I18n.t("ldap_groups.label_menu_item") },+ I18n.t("menus.breadcrumb.nested_element",+ section_header: t("ldap_groups.synchronized_filters.singular"),+ title: h(@filter.name)).html_safe]+ end++ def blocked?+ @filter.seeded_from_env?+ end+enddiff --git a/modules/ldap_groups/app/controllers/ldap_groups/synchronized_filters_controller.rb b/modules/ldap_groups/app/controllers/ldap_groups/synchronized_filters_controller.rbindex 3cb6f03a9bd..1226a9cc37f 100644--- a/modules/ldap_groups/app/controllers/ldap_groups/synchronized_filters_controller.rb+++ b/modules/ldap_groups/app/controllers/ldap_groups/synchronized_filters_controller.rb@@ -90,12 +90,10 @@ module LdapGroups.permit(:filter_string, :name, :ldap_auth_source_id, :group_name_attribute, :sync_users, :base_dn)end- def default_breadcrumb- ActionController::Base.helpers.link_to(t("ldap_groups.synchronized_groups.plural"), ldap_groups_synchronized_groups_path)- end+ def default_breadcrumb; enddef show_local_breadcrumb- true+ falseendendenddiff --git a/modules/ldap_groups/app/controllers/ldap_groups/synchronized_groups_controller.rb b/modules/ldap_groups/app/controllers/ldap_groups/synchronized_groups_controller.rbindex dd7a9ec3660..11276c1a3e1 100644--- a/modules/ldap_groups/app/controllers/ldap_groups/synchronized_groups_controller.rb+++ b/modules/ldap_groups/app/controllers/ldap_groups/synchronized_groups_controller.rb@@ -69,16 +69,10 @@ module LdapGroups.permit(:dn, :group_id, :ldap_auth_source_id, :sync_users)end- def default_breadcrumb- if action_name == "index"- t("ldap_groups.synchronized_groups.plural")- else- ActionController::Base.helpers.link_to(t("ldap_groups.synchronized_groups.plural"), ldap_groups_synchronized_groups_path)- end- end+ def default_breadcrumb; enddef show_local_breadcrumb- true+ falseendendenddiff --git a/modules/ldap_groups/app/views/ldap_groups/synchronized_filters/edit.html.erb b/modules/ldap_groups/app/views/ldap_groups/synchronized_filters/edit.html.erbindex 44ea00bf829..b3c8129aaf9 100644--- a/modules/ldap_groups/app/views/ldap_groups/synchronized_filters/edit.html.erb+++ b/modules/ldap_groups/app/views/ldap_groups/synchronized_filters/edit.html.erb@@ -1,7 +1,15 @@-<% local_assigns[:additional_breadcrumb] = h(@filter.name) %><% html_title(t(:label_administration), t(:label_edit_x, x: @filter.name)) -%>-<%= toolbar title: t(:label_edit_x, x: @filter.name) %>+<%=+ render Primer::OpenProject::PageHeader.new do |header|+ header.with_title { @filter.name }+ header.with_breadcrumbs([{ href: admin_index_path, text: t(:label_administration) },+ { href: admin_settings_authentication_path, text: t(:label_authentication) },+ { href: ldap_groups_synchronized_groups_path, text: I18n.t("ldap_groups.label_menu_item") },+ I18n.t("menus.breadcrumb.nested_element", section_header: t("ldap_groups.synchronized_filters.singular"), title: @filter.name).html_safe],+ selected_item_font_weight: :normal)+ end+%><%= labelled_tabular_form_for @filter,as: :synchronized_filter,diff --git a/modules/ldap_groups/app/views/ldap_groups/synchronized_filters/new.html.erb b/modules/ldap_groups/app/views/ldap_groups/synchronized_filters/new.html.erbindex 2953cf40fc9..98cdf988fa6 100644--- a/modules/ldap_groups/app/views/ldap_groups/synchronized_filters/new.html.erb+++ b/modules/ldap_groups/app/views/ldap_groups/synchronized_filters/new.html.erb@@ -1,7 +1,15 @@-<% local_assigns[:additional_breadcrumb] = t('ldap_groups.synchronized_filters.add_new') %><% html_title(t(:label_administration), t('ldap_groups.synchronized_filters.add_new')) -%>-<%= toolbar title: t('ldap_groups.synchronized_filters.add_new') %>+<%=+ render Primer::OpenProject::PageHeader.new do |header|+ header.with_title { t("ldap_groups.synchronized_filters.add_new") }+ header.with_breadcrumbs([{ href: admin_index_path, text: t(:label_administration) },+ { href: admin_settings_authentication_path, text: t(:label_authentication) },+ { href: ldap_groups_synchronized_groups_path, text: I18n.t("ldap_groups.label_menu_item") },+ t("ldap_groups.synchronized_filters.add_new")])+ end+%>+<%= labelled_tabular_form_for @filter,as: :synchronized_filter,diff --git a/modules/ldap_groups/app/views/ldap_groups/synchronized_filters/show.html.erb b/modules/ldap_groups/app/views/ldap_groups/synchronized_filters/show.html.erbindex e43b446b714..03201e21d03 100644--- a/modules/ldap_groups/app/views/ldap_groups/synchronized_filters/show.html.erb+++ b/modules/ldap_groups/app/views/ldap_groups/synchronized_filters/show.html.erb@@ -1,27 +1,10 @@<% html_title(t(:label_administration), t('ldap_groups.synchronized_filters.plural'), h(@filter.name)) -%>+<%= render LdapGroups::SynchronizedFilters::ShowPageHeaderComponent.new(filter: @filter) %>+<%= error_messages_for @filter %><% blocked = @filter.seeded_from_env? %>-<%= breadcrumb_toolbar(h(@filter.name)) do %>- <% unless blocked %>- <li class="toolbar-item">- <%= link_to({ action: :edit },- class: 'button') do %>- <%= op_icon('button--icon icon-edit') %>- <span class="button--text"><%= t(:button_edit) %></span>- <% end %>- </li>- <li class="toolbar-item">- <%= link_to({ action: :destroy_info },- class: 'button -danger') do %>- <%= op_icon('button--icon icon-delete') %>- <span class="button--text"><%= t(:button_delete) %></span>- <% end %>- </li>- <% end %>-<% end %>-<% if blocked %><div class="op-toast -warning"><div class="op-toast--content">@@ -63,4 +46,3 @@<% end %><%= render ::LdapGroups::SynchronizedGroups::TableComponent.new(rows: @filter.groups, show_inline_create: false, deletable: false) %></section>-diff --git a/modules/ldap_groups/app/views/ldap_groups/synchronized_groups/index.html.erb b/modules/ldap_groups/app/views/ldap_groups/synchronized_groups/index.html.erbindex cfc3727d02e..5ec8a97472f 100644--- a/modules/ldap_groups/app/views/ldap_groups/synchronized_groups/index.html.erb+++ b/modules/ldap_groups/app/views/ldap_groups/synchronized_groups/index.html.erb@@ -1,26 +1,39 @@<% html_title(t(:label_administration), t('ldap_groups.synchronized_groups.plural')) -%>-<%= breadcrumb_toolbar t('ldap_groups.synchronized_groups.plural') do %>- <li class="toolbar-item">- <%= link_to new_ldap_groups_synchronized_filter_path,- { class: 'button',- aria: {label: t('ldap_groups.synchronized_filters.singular')},- title: t('ldap_groups.synchronized_filters.add_new')} do %>- <%= op_icon('button--icon icon-add') %>- <span class="button--text"><%= t('ldap_groups.synchronized_filters.singular') %></span>- <% end %>- </li>+<%=+ render Primer::OpenProject::PageHeader.new do |header|+ header.with_title { I18n.t("ldap_groups.synchronized_groups.plural") }+ header.with_breadcrumbs([{ href: admin_index_path, text: t(:label_administration) },+ { href: admin_settings_authentication_path, text: t(:label_authentication) },+ I18n.t("ldap_groups.synchronized_groups.plural")])+ end+%>- <li class="toolbar-item">- <%= link_to new_ldap_groups_synchronized_group_path,- { class: 'button',- aria: {label: t('ldap_groups.synchronized_groups.singular')},- title: t('ldap_groups.synchronized_groups.add_new')} do %>- <%= op_icon('button--icon icon-add') %>- <span class="button--text"><%= t('ldap_groups.synchronized_groups.singular') %></span>- <% end %>- </li>-<% end %>+<%= render(Primer::OpenProject::SubHeader.new) do |subheader|+ subheader.with_action_component do+ render(Primer::Alpha::ActionMenu.new(anchor_align: :end)) do |menu|+ menu.with_show_button(scheme: :primary,+ test_selector: "op-admin-synchronized-groups--button-new",+ aria: { label: I18n.t(:button_add) }) do |button|+ button.with_leading_visual_icon(icon: :plus)+ button.with_trailing_action_icon(icon: :"triangle-down")+ I18n.t(:button_add)+ end++ menu.with_item(+ label: I18n.t("ldap_groups.synchronized_filters.singular"),+ test_selector: "op-admin-synchronized-groups--new-filters",+ href: new_ldap_groups_synchronized_filter_path+ )++ menu.with_item(+ label: I18n.t("ldap_groups.synchronized_groups.singular"),+ test_selector: "op-admin-synchronized-groups--new-groups",+ href: new_ldap_groups_synchronized_group_path+ )+ end+ end+end %><div class="op-toast -info"><div class="op-toast--content">@@ -38,4 +51,3 @@<h3 class="form--section-title"><%= t('ldap_groups.synchronized_groups.plural') %></h3><%= render ::LdapGroups::SynchronizedGroups::TableComponent.new(rows: @groups) %></section>-diff --git a/modules/ldap_groups/app/views/ldap_groups/synchronized_groups/new.html.erb b/modules/ldap_groups/app/views/ldap_groups/synchronized_groups/new.html.erbindex 42cf3962f80..e59c8acc5a8 100644--- a/modules/ldap_groups/app/views/ldap_groups/synchronized_groups/new.html.erb+++ b/modules/ldap_groups/app/views/ldap_groups/synchronized_groups/new.html.erb@@ -1,9 +1,16 @@-<% local_assigns[:additional_breadcrumb] = t('ldap_groups.synchronized_groups.add_new') %><% html_title(t(:label_administration), t('ldap_groups.synchronized_groups.add_new')) -%>-<%= error_messages_for @group %>+<%=+ render Primer::OpenProject::PageHeader.new do |header|+ header.with_title { t("ldap_groups.synchronized_groups.add_new") }+ header.with_breadcrumbs([{ href: admin_index_path, text: t(:label_administration) },+ { href: admin_settings_authentication_path, text: t(:label_authentication) },+ { href: ldap_groups_synchronized_groups_path, text: I18n.t("ldap_groups.label_menu_item") },+ t("ldap_groups.synchronized_groups.add_new")])+ end+%>-<%= toolbar title: t('ldap_groups.synchronized_groups.add_new') %>+<%= error_messages_for @group %><%= labelled_tabular_form_for @group,as: :synchronized_group,diff --git a/modules/ldap_groups/app/views/ldap_groups/synchronized_groups/show.html.erb b/modules/ldap_groups/app/views/ldap_groups/synchronized_groups/show.html.erbindex 06c3b5b6f4a..44c2a15f1c6 100644--- a/modules/ldap_groups/app/views/ldap_groups/synchronized_groups/show.html.erb+++ b/modules/ldap_groups/app/views/ldap_groups/synchronized_groups/show.html.erb@@ -1,8 +1,18 @@<% html_title(t(:label_administration), t('ldap_groups.synchronized_groups.plural'), h(@group.dn)) -%>+<%=+ render Primer::OpenProject::PageHeader.new do |header|+ header.with_title { h(@group.dn) }+ header.with_breadcrumbs([{ href: admin_index_path, text: t(:label_administration) },+ { href: admin_settings_authentication_path, text: t(:label_authentication) },+ { href: ldap_groups_synchronized_groups_path, text: I18n.t("ldap_groups.label_menu_item") },+ I18n.t("menus.breadcrumb.nested_element", section_header: t("ldap_groups.synchronized_groups.singular"), title: h(@group.dn)).html_safe],+ selected_item_font_weight: :normal)+ end+%>+<%= error_messages_for @group %>-<%= breadcrumb_toolbar(link_to(t('ldap_groups.synchronized_groups.plural'), { action: :index }), h(@group.dn)) %><section class="admin--edit-section"><%=render(AttributeGroups::AttributeGroupComponent.new) do |component|@@ -24,4 +34,3 @@<h2><%= t :label_user_plural %></h2><%= render ::LdapGroups::Memberships::TableComponent.new(rows: @group.users) %></section>-diff --git a/modules/ldap_groups/spec/features/administration_spec.rb b/modules/ldap_groups/spec/features/administration_spec.rbindex 2caeecc8b2e..98570a21c8d 100644--- a/modules/ldap_groups/spec/features/administration_spec.rb+++ b/modules/ldap_groups/spec/features/administration_spec.rb@@ -21,8 +21,12 @@ RSpec.describe "LDAP group sync administration spec", :js doit "allows synced group administration flow" doexpect(page).to have_no_css(".upsale-notification")+ # Open create menu+ page.find_test_selector("op-admin-synchronized-groups--button-new", text: I18n.t(:button_add)).click# Create group- find(".button", text: I18n.t("ldap_groups.synchronized_groups.singular")).click+ page.find_test_selector("op-admin-synchronized-groups--new-groups",+ text: I18n.t("ldap_groups.synchronized_groups.singular")).click+SeleniumHubWaiter.waitselect "ldap", from: "synchronized_group_ldap_auth_source_id"diff --git a/modules/openid_connect/app/controllers/openid_connect/providers_controller.rb b/modules/openid_connect/app/controllers/openid_connect/providers_controller.rbindex f3f817ffc72..dbf3136d117 100644--- a/modules/openid_connect/app/controllers/openid_connect/providers_controller.rb+++ b/modules/openid_connect/app/controllers/openid_connect/providers_controller.rb@@ -90,14 +90,10 @@ module OpenIDConnectendhelper_method :openid_connect_providers_available_for_configure- def default_breadcrumb- if action_name != "index"- ActionController::Base.helpers.link_to(t("openid_connect.providers.plural"), openid_connect_providers_path)- end- end+ def default_breadcrumb; enddef show_local_breadcrumb- true+ falseendendenddiff --git a/modules/openid_connect/app/views/openid_connect/providers/edit.html.erb b/modules/openid_connect/app/views/openid_connect/providers/edit.html.erbindex 2f244dabd58..fd27b98d44b 100644--- a/modules/openid_connect/app/views/openid_connect/providers/edit.html.erb+++ b/modules/openid_connect/app/views/openid_connect/providers/edit.html.erb@@ -3,7 +3,15 @@<% html_title(t(:label_administration), page_title) -%>-<%= toolbar title: page_title %>+<%=+ render Primer::OpenProject::PageHeader.new do |header|+ header.with_title { @provider.name }+ header.with_breadcrumbs([{ href: admin_index_path, text: t(:label_administration) },+ { href: admin_settings_authentication_path, text: t(:label_authentication) },+ { href: openid_connect_providers_path, text: t("openid_connect.providers.plural") },+ @provider.name])+ end+%><%= error_messages_for @provider %>diff --git a/modules/openid_connect/app/views/openid_connect/providers/index.html.erb b/modules/openid_connect/app/views/openid_connect/providers/index.html.erbindex 415c998f96f..4578dc4a5de 100644--- a/modules/openid_connect/app/views/openid_connect/providers/index.html.erb+++ b/modules/openid_connect/app/views/openid_connect/providers/index.html.erb@@ -1,16 +1,25 @@-<% html_title(t(:label_administration), t('openid_connect.providers.plural')) -%>-<% local_assigns[:additional_breadcrumb] = t('openid_connect.providers.plural') %>+<% html_title(t(:label_administration), t("openid_connect.providers.plural")) -%>-<%= toolbar title: t('openid_connect.providers.plural') do %>- <li class="toolbar-item">- <%= link_to new_openid_connect_provider_path,- { class: 'button -primary',- aria: {label: t('openid_connect.providers.label_add_new')},- title: t('openid_connect.providers.label_add_new')} do %>- <%= op_icon('button--icon icon-add') %>- <span class="button--text"><%= t('openid_connect.providers.singular') %></span>- <% end if openid_connect_providers_available_for_configure.any? %>- </li>-<% end %>+<%=+ render Primer::OpenProject::PageHeader.new do |header|+ header.with_title { t("openid_connect.providers.plural") }+ header.with_breadcrumbs([{ href: admin_index_path, text: t(:label_administration) },+ { href: admin_settings_authentication_path, text: t(:label_authentication) },+ t("openid_connect.providers.plural")])+ end+%>++<%=+ render(Primer::OpenProject::SubHeader.new) do |subheader|+ subheader.with_action_button(scheme: :primary,+ aria: { label: I18n.t("openid_connect.providers.label_add_new") },+ title: I18n.t("openid_connect.providers.label_add_new"),+ tag: :a,+ href: new_openid_connect_provider_path) do |button|+ button.with_leading_visual_icon(icon: :plus)+ t("openid_connect.providers.singular")+ end+ end if openid_connect_providers_available_for_configure.any?+%><%= render ::OpenIDConnect::Providers::TableComponent.new(rows: providers) %>diff --git a/modules/openid_connect/app/views/openid_connect/providers/new.html.erb b/modules/openid_connect/app/views/openid_connect/providers/new.html.erbindex c7cbf0dce17..a82a34b5f4e 100644--- a/modules/openid_connect/app/views/openid_connect/providers/new.html.erb+++ b/modules/openid_connect/app/views/openid_connect/providers/new.html.erb@@ -1,7 +1,14 @@-<% html_title(t(:label_administration), t('openid_connect.providers.label_add_new')) -%>-<% local_assigns[:additional_breadcrumb] = t('openid_connect.providers.label_add_new') %>+<% html_title(t(:label_administration), t("openid_connect.providers.label_add_new")) -%>-<%= toolbar title: t('openid_connect.providers.label_add_new') %>+<%=+ render Primer::OpenProject::PageHeader.new do |header|+ header.with_title { t("openid_connect.providers.label_add_new") }+ header.with_breadcrumbs([{ href: admin_index_path, text: t(:label_administration) },+ { href: admin_settings_authentication_path, text: t(:label_authentication) },+ { href: openid_connect_providers_path, text: t("openid_connect.providers.plural") },+ t("openid_connect.providers.label_add_new")])+ end+%><%= error_messages_for @provider %>diff --git a/modules/recaptcha/app/controllers/recaptcha/admin_controller.rb b/modules/recaptcha/app/controllers/recaptcha/admin_controller.rbindex 9749af2063b..9a5e895dbfa 100644--- a/modules/recaptcha/app/controllers/recaptcha/admin_controller.rb+++ b/modules/recaptcha/app/controllers/recaptcha/admin_controller.rb@@ -35,12 +35,10 @@ module ::Recaptchaparams.permit(:recaptcha_type, :website_key, :secret_key, :response_limit)end- def default_breadcrumb- t("recaptcha.label_recaptcha")- end+ def default_breadcrumb; enddef show_local_breadcrumb- true+ falseendendenddiff --git a/modules/recaptcha/app/views/recaptcha/admin/show.html.erb b/modules/recaptcha/app/views/recaptcha/admin/show.html.erbindex 8884afbb64e..8e36981f0fb 100644--- a/modules/recaptcha/app/views/recaptcha/admin/show.html.erb+++ b/modules/recaptcha/app/views/recaptcha/admin/show.html.erb@@ -1,6 +1,13 @@<% html_title(t(:label_administration), t('recaptcha.label_recaptcha')) -%>-<%= breadcrumb_toolbar t('recaptcha.label_recaptcha') %>+<%=+ render Primer::OpenProject::PageHeader.new do |header|+ header.with_title { I18n.t("recaptcha.label_recaptcha") }+ header.with_breadcrumbs([{ href: admin_index_path, text: t(:label_administration) },+ { href: admin_settings_authentication_path, text: t(:label_authentication) },+ I18n.t("recaptcha.label_recaptcha")])+ end+%><section class="admin--edit-section"><%= styled_form_tag({ action: :update },diff --git a/modules/storages/app/views/storages/admin/storages/upsale.html.erb b/modules/storages/app/views/storages/admin/storages/upsale.html.erbindex 9606edca7d7..92508024cde 100644--- a/modules/storages/app/views/storages/admin/storages/upsale.html.erb+++ b/modules/storages/app/views/storages/admin/storages/upsale.html.erb@@ -1,7 +1,5 @@<% html_title(t(:label_administration), t('storages.upsale.title')) -%>-<% local_assigns[:additional_breadcrumb] = t('storages.upsale.title') %>-<%= render template: 'common/upsale',locals: {feature_title: t('storages.upsale.title'),diff --git a/modules/two_factor_authentication/app/controllers/two_factor_authentication/two_factor_settings_controller.rb b/modules/two_factor_authentication/app/controllers/two_factor_authentication/two_factor_settings_controller.rbindex 41d46935a51..f92c098a2d7 100644--- a/modules/two_factor_authentication/app/controllers/two_factor_authentication/two_factor_settings_controller.rb+++ b/modules/two_factor_authentication/app/controllers/two_factor_authentication/two_factor_settings_controller.rb@@ -52,12 +52,10 @@ module ::TwoFactorAuthentication::OpenProject::TwoFactorAuthentication::TokenStrategyManagerend- def default_breadcrumb- t("two_factor_authentication.settings.title")- end+ def default_breadcrumb; enddef show_local_breadcrumb- true+ falseendendenddiff --git a/modules/two_factor_authentication/app/views/two_factor_authentication/settings.html.erb b/modules/two_factor_authentication/app/views/two_factor_authentication/settings.html.erbindex 6c43855e3d5..31a52b1145a 100644--- a/modules/two_factor_authentication/app/views/two_factor_authentication/settings.html.erb+++ b/modules/two_factor_authentication/app/views/two_factor_authentication/settings.html.erb@@ -1,6 +1,15 @@<% html_title(t(:label_administration), t('two_factor_authentication.settings.title')) -%>-<%= breadcrumb_toolbar(t('two_factor_authentication.settings.title')) %>+<%=+ render Primer::OpenProject::PageHeader.new do |header|+ header.with_title { I18n.t("two_factor_authentication.settings.title") }+ header.with_breadcrumbs([{ href: admin_index_path, text: t(:label_administration) },+ { href: admin_settings_authentication_path, text: t(:label_authentication) },+ I18n.t("two_factor_authentication.settings.title")])+ end+%>++<section class="admin--edit-section"><%= styled_form_tag({ action: :update },method: :post,diff --git a/spec/features/admin/oauth/oauth_applications_management_spec.rb b/spec/features/admin/oauth/oauth_applications_management_spec.rbindex f1b75ddad8c..07f886a67f5 100644--- a/spec/features/admin/oauth/oauth_applications_management_spec.rb+++ b/spec/features/admin/oauth/oauth_applications_management_spec.rb@@ -41,7 +41,7 @@ RSpec.describe "OAuth applications management", :js, :with_cuprite doexpect(page).to have_css(".generic-table--empty-row", text: "There is currently nothing to display")# Create application- find(".button", text: "Add").click+ page.find_test_selector("op-admin-oauth--button-new", text: "OAuth application").clickfill_in "application_name", with: "My API application"# Fill invalid redirect_uridiff --git a/spec/features/ldap_auth_sources/crud_spec.rb b/spec/features/ldap_auth_sources/crud_spec.rbindex e7e9fad2a1a..b08fc938ec9 100644--- a/spec/features/ldap_auth_sources/crud_spec.rb+++ b/spec/features/ldap_auth_sources/crud_spec.rb@@ -42,9 +42,7 @@ RSpec.describe "CRUD LDAP connections", :js, :with_cuprite doexpect(page).to have_text "LDAP connections"expect(page).to have_text "There is currently nothing to display."- page.within(".toolbar") do- click_link "LDAP connection"- end+ page.find_test_selector("op-admin-ldap-connection--button-new", text: "LDAP connection").clickexpect(page).to have_current_path new_ldap_auth_source_path