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

Add required breadcrumb elements to Storages and Project attribute page

Henriette Dargebbf0a0145582
diff --git a/app/components/settings/project_custom_fields/edit_form_header_component.rb b/app/components/settings/project_custom_fields/edit_form_header_component.rb
index c606dd4c5e8..61365dec332 100644
--- a/app/components/settings/project_custom_fields/edit_form_header_component.rb
+++ b/app/components/settings/project_custom_fields/edit_form_header_component.rb
@@ -37,9 +37,9 @@ module Settings
def breadcrumbs_items
[{ href: admin_index_path, text: t("label_administration") },
- { href: admin_settings_project_custom_fields_path, text: t("label_project_plural") },
- { href: admin_settings_project_custom_fields_path, text: t("settings.project_attributes.heading") },
- @custom_field.name
+ { href: admin_settings_project_custom_fields_path, text: t("label_project_plural") },
+ { href: admin_settings_project_custom_fields_path, text: t("settings.project_attributes.heading") },
+ @custom_field.name
]
end
end
diff --git a/app/components/settings/project_custom_fields/header_component.rb b/app/components/settings/project_custom_fields/header_component.rb
index cf0b3e54cce..7299ecc409a 100644
--- a/app/components/settings/project_custom_fields/header_component.rb
+++ b/app/components/settings/project_custom_fields/header_component.rb
@@ -32,8 +32,10 @@ module Settings
include ApplicationHelper
include OpPrimer::ComponentHelpers
include OpTurbo::Streamable
+
def breadcrumbs_items
[{ href: admin_index_path, text: t("label_administration") },
+ { href: admin_settings_project_custom_fields_path, text: t("label_project_plural") },
t("settings.project_attributes.heading")]
end
end
diff --git a/modules/storages/app/controllers/storages/admin/storages_controller.rb b/modules/storages/app/controllers/storages/admin/storages_controller.rb
index 31043280f70..9fa06960d48 100644
--- a/modules/storages/app/controllers/storages/admin/storages_controller.rb
+++ b/modules/storages/app/controllers/storages/admin/storages_controller.rb
@@ -194,17 +194,6 @@ class Storages::Admin::StoragesController < ApplicationController
end
end
- # Used by: admin layout
- # Breadcrumbs is something like OpenProject > Admin > Storages.
- # This returns the name of the last part (Storages admin page)
- def default_breadcrumb
- if action_name == "index"
- t(:project_module_storages)
- else
- ActionController::Base.helpers.link_to(t(:project_module_storages), admin_settings_storages_path)
- end
- end
-
private
def ensure_valid_provider_type_selected
diff --git a/modules/storages/app/views/storages/admin/storages/index.html.erb b/modules/storages/app/views/storages/admin/storages/index.html.erb
index 4601b5a0d68..edbc7b211a7 100644
--- a/modules/storages/app/views/storages/admin/storages/index.html.erb
+++ b/modules/storages/app/views/storages/admin/storages/index.html.erb
@@ -10,10 +10,9 @@
<%= t("storages.page_titles.file_storages.subtitle") %>
<% end %>
- <% header.with_breadcrumbs(breadcrumb_paths(
- link_to(t(:label_administration), admin_index_path),
- default_breadcrumb
- )) %>
+ <% header.with_breadcrumbs([{ href: admin_index_path, text: t("label_administration") },
+ t("project_module_storages")]) %>
+
<% header.with_action_button(mobile_icon: "star", mobile_label: "Star") do %>
<%= render(Storages::Admin::NewStorageButtonComponent.new) %>
<% end %>