[63485] Remove show_local_breadcrumb and default_breadcrumb (#18663)

* add a new helper for breadcrumb in wiki page

* set page header in destroy page

* set page header in edit page

* set page header in history and rename and edit parent pages

* change toolbar items into page header items

* add new wiki action to sub header

* remove version edit page which is not in use any more

* add export as a menu item of the header

* fix rubocup errors

* fix failing tests

* replace page header in annotate page

* replace page header in diff page

* add page header in select menu page

* fix rubocup errors

* fix errors on rename test

* fix errors on selecting items from toolbar

* fix errors on tests for child pages

* set correct permission for configure menu item

* replace page header in summary page

* replace page header in summary details page

* edit docs of sub header

* add page header in wiki new page

* remove controller and a route for edit method

* undo changes for docs of sub header

* extract header in show page into a new component

* use helper method in header component

* add wiki module to the breadcrumb

* rename page header component for wiki page

* simplify how lock and lock implemented

* extract sub header

* remove wiki title from header of history page

* fix page header in new page

* use page.find_test_selector in test

* fix failing test for summary page

* fix failing test for wiki child pages

* change the summary test

* use test selector for page header title

* undo changes for activate user in admin

* use test selector in adding editing history test

* use test selector in attachment upload test

* use test selector in child pages tests

* use test selector in wiki menu items tests

* change test selector for breadcrumbs

* extract conditions to show edit button into a method

* extract conditions to show rollback action menu item into a method

* extract conditions to show create button into a method

* fix duplicated code in test

* Remove outdated `show_local_breadcrumb` method which is replaced by the Primer::PageHeader breadcrumb

* Remove `default_breadcrumb` method as it serves no prupose any more

* Remove the old breadcrumb and its hook completely

* remove breadcrumbs path from rename

* fix translations errors in storages

* undo changes on translations

* remove default breadcrumbs in time tracking controller

---------

Co-authored-by: Behrokh Satarnejad <b.satarnejad@openproject.com>
Co-authored-by: Behrokh Satarnejad <62008897+bsatarnejad@users.noreply.github.com>
This commit is contained in:
Henriette Darge
2025-04-23 10:40:43 +02:00
committed by GitHub
parent 744d0397bd
commit ee8452282a
84 changed files with 1 additions and 471 deletions
@@ -51,12 +51,6 @@ module Admin
redirect_to action: :index
end
def default_breadcrumb; end
def show_local_breadcrumb
false
end
private
def create_journal(container, user, notes)
@@ -76,12 +76,6 @@ class Admin::BackupsController < ApplicationController
redirect_to action: "show"
end
def default_breadcrumb; end
def show_local_breadcrumb
false
end
def check_enabled
render_404 unless OpenProject::Configuration.backup_enabled?
end
@@ -89,12 +89,6 @@ class Admin::CustomFields::CustomFieldProjectsController < ApplicationController
respond_to_with_turbo_streams(status: delete_service.success? ? :ok : :unprocessable_entity)
end
def default_breadcrumb; end
def show_local_breadcrumb
false
end
private
def render_project_list(url_for_action: action_name)
@@ -30,12 +30,6 @@ module Admin::Settings
class AttachmentsSettingsController < ::Admin::SettingsController
menu_item :attachments
def default_breadcrumb; end
def show_local_breadcrumb
false
end
def settings_params
super.tap do |settings|
settings["attachment_whitelist"] = settings["attachment_whitelist"].split(/\r?\n/)
@@ -103,8 +103,6 @@ module Admin
@other_enumerations = enumeration_class.all - [@enumeration]
end
def default_breadcrumb; end
private
def move_params
@@ -32,10 +32,6 @@ module Admin::Settings
before_action :validate_enabled_modules, only: :update # rubocop:disable Rails/LexicallyScopedActionFilter
def default_breadcrumb
t(:label_project_new)
end
private
# rubocop:disable Metrics/AbcSize, Metrics/PerceivedComplexity
@@ -48,10 +48,6 @@ module Admin::Settings
before_action :find_unlink_project_custom_field_mapping, only: :unlink
# rubocop:enable Rails/LexicallyScopedActionFilter
def show_local_breadcrumb
false
end
def index
respond_to :html
end
@@ -37,10 +37,6 @@ module Admin::Settings
respond_to :html
end
def show_local_breadcrumb
false
end
def settings_params
super.tap do |settings|
if settings["consent_required"] == "1" && params["toggle_consent_time"] == "1"
@@ -35,10 +35,6 @@ module Admin::Settings
before_action :require_ee, except: :show # rubocop:disable Rails/LexicallyScopedActionFilter
before_action :check_clamav, only: %i[update], if: -> { scan_enabled? }
def show_local_breadcrumb
false
end
def av_form
selected = params.dig(:settings, :antivirus_scan_mode)&.to_sym || :disabled
@@ -81,18 +81,6 @@ module Admin
redirect_to action: :show_plugin, id: @plugin.id
end
def show_local_breadcrumb
false
end
def default_breadcrumb
if @plugin
@plugin.name
else
I18n.t(:label_setting_plural)
end
end
protected
def find_plugin
-6
View File
@@ -90,12 +90,6 @@ class AdminController < ApplicationController
@storage_information = OpenProject::Storage.mount_information
end
def default_breadcrumb; end
def show_local_breadcrumb
false
end
private
def hidden_admin_menu_items
@@ -20,10 +20,6 @@ class AnnouncementsController < ApplicationController
private
def show_local_breadcrumb
false
end
def announcement_params
params.require(:announcement).permit("text", "show_until", "active")
end
-15
View File
@@ -436,21 +436,6 @@ class ApplicationController < ActionController::Base
api_request? ? nil : super
end
def default_breadcrumb
label = "label_#{controller_name.singularize}"
I18n.t(label + "_plural",
default: label.to_sym)
end
helper_method :default_breadcrumb
def show_local_breadcrumb
false
end
helper_method :show_local_breadcrumb
def admin_first_level_menu_entry
menu_item = admin_menu_item(current_menu_item)
menu_item.parent
@@ -85,12 +85,6 @@ class AttributeHelpTextsController < ApplicationController
protected
def default_breadcrumb; end
def show_local_breadcrumb
false
end
private
def permitted_params_with_attachments
-6
View File
@@ -102,12 +102,6 @@ class ColorsController < ApplicationController
protected
def show_local_breadcrumb
false
end
def default_breadcrumb; end
def require_admin_unless_readonly_api_request
require_admin unless %w[index show].include? action_name and
api_request?
@@ -102,10 +102,4 @@ class CustomActionsController < ApplicationController
params[:custom_action][:conditions] ||= {}
params[:custom_action][:actions] ||= {}
end
def show_local_breadcrumb
false
end
def default_breadcrumb; end
end
@@ -61,12 +61,6 @@ class CustomFieldsController < ApplicationController
protected
def default_breadcrumb; end
def show_local_breadcrumb
false
end
def validate_enterprise_token
if params.dig(:custom_field, :field_format) == "hierarchy" && !EnterpriseToken.allows_to?(:custom_field_hierarchies)
render_403
@@ -98,12 +98,6 @@ class EnterprisesController < ApplicationController
helpers.write_augur_to_gon
end
def default_breadcrumb; end
def show_local_breadcrumb
false
end
def check_user_limit
if OpenProject::Enterprise.user_limit_reached?
flash.now[:warning] = I18n.t(
-4
View File
@@ -160,10 +160,6 @@ class GroupsController < ApplicationController
Group.in_project(Project.allowed_to(current_user, :view_members)).exists?
end
def show_local_breadcrumb
false
end
def respond_membership_altered(service_call)
if service_call.success?
flash[:notice] = I18n.t :notice_successful_update
-6
View File
@@ -61,10 +61,4 @@ class HomescreenController < ApplicationController
redirect_to_global_menu_item(params[:jump]) && return
end
end
def default_breadcrumb; end
def show_local_breadcrumb
false
end
end
@@ -106,10 +106,6 @@ class LdapAuthSourcesController < ApplicationController
end
end
def show_local_breadcrumb
false
end
def block_if_password_login_disabled
render_404 if OpenProject::Configuration.disable_password_login?
end
-8
View File
@@ -202,14 +202,6 @@ class MyController < ApplicationController
private
def default_breadcrumb
I18n.t(:label_my_account)
end
def show_local_breadcrumb
false
end
def redirect_if_password_change_not_allowed_for(user)
unless user.change_password_allowed?
flash[:error] = I18n.t(:notice_can_t_change_password)
@@ -73,8 +73,6 @@ class NotificationsController < ApplicationController
def split_view_base_route = notifications_path(request.query_parameters)
def default_breadcrumb; end
def render_notifications_layout
# Frontend will handle rendering
# but we will need to render with notification specific layout
@@ -97,14 +97,6 @@ module OAuth
redirect_to action: :index
end
protected
def default_breadcrumb; end
def show_local_breadcrumb
false
end
private
def prevent_builtin_edits
@@ -84,6 +84,4 @@ class OmniAuthLoginController < ApplicationController
def omniauth_back_url
request.env["omniauth.origin"].presence || params[:RelayState]
end
def default_breadcrumb; end
end
@@ -155,8 +155,4 @@ class PlaceholderUsersController < ApplicationController
render_403 message: I18n.t("placeholder_users.right_to_manage_members_missing")
end
end
def show_local_breadcrumb
false
end
end
-4
View File
@@ -149,10 +149,6 @@ class RolesController < ApplicationController
Role.visible.ordered_by_builtin_and_position
end
def show_local_breadcrumb
false
end
def new_params
permitted_params.role? || {}
end
-4
View File
@@ -85,10 +85,6 @@ class StatusesController < ApplicationController
protected
def show_local_breadcrumb
false
end
def recompute_progress_values
attributes_triggering_recomputing = ["excluded_from_totals"]
attributes_triggering_recomputing << "default_done_ratio" if WorkPackage.status_based_mode?
-4
View File
@@ -136,10 +136,6 @@ class TypesController < ApplicationController
render action: :edit, status:
end
def show_local_breadcrumb
false
end
def destroy_error_message
if @type.is_standard?
t(:error_can_not_delete_standard_type)
-4
View File
@@ -282,10 +282,6 @@ class UsersController < ApplicationController
protected
def show_local_breadcrumb
false
end
def build_user_update_params # rubocop:disable Metrics/AbcSize
pref_params = permitted_params.pref.to_h
update_params = permitted_params
-8
View File
@@ -414,14 +414,6 @@ class WikiController < ApplicationController
page.editable_by?(User.current)
end
def default_breadcrumb
Wiki.model_name.human
end
def show_local_breadcrumb
false
end
def redirect_to_show
redirect_to action: :show, project_id: @project, id: @page
end
@@ -118,10 +118,6 @@ class WorkPackages::BulkController < ApplicationController
current_user
end
def default_breadcrumb
I18n.t(:label_work_package_plural)
end
def transform_attributes(attributes)
Hash(attributes)
.compact_blank
@@ -100,6 +100,4 @@ class WorkPackages::DialogsController < ApplicationController
project: @project
}
end
def default_breadcrumb; end
end
@@ -97,10 +97,6 @@ class WorkPackages::MovesController < ApplicationController
end
end
def default_breadcrumb
I18n.t(:label_move_work_package)
end
# Check if project is unique before bulk operations
def check_project_uniqueness
unless @project
@@ -59,10 +59,4 @@ class WorkPackages::ReportsController < ApplicationController
end
end
end
private
def default_breadcrumb
I18n.t(:label_summary)
end
end
-4
View File
@@ -93,10 +93,6 @@ class WorkflowsController < ApplicationController
end
end
def show_local_breadcrumb
false
end
private
def statuses_for_form
-43
View File
@@ -27,20 +27,6 @@
#++
module BreadcrumbHelper
def full_breadcrumbs
render(Primer::Beta::Breadcrumbs.new(test_selector: "op-breadcrumb")) do |breadcrumbs|
breadcrumb_paths.each_with_index do |item, index|
item = anchor_string_to_object(item) if item.is_a?(String) && item.start_with?("\u003c")
if item.is_a?(Hash)
breadcrumbs.with_item(href: item[:href], classes: index == 0 ? "first-breadcrumb-element" : nil) { item[:text] }
else
breadcrumbs.with_item(href: "#", classes: index == 0 ? "first-breadcrumb-element" : nil) { item }
end
end
end
end
def nested_breadcrumb_element(section_header, title)
output = "".html_safe
output << "#{section_header}: "
@@ -48,33 +34,4 @@ module BreadcrumbHelper
output
end
def breadcrumb_paths(*args)
if args.empty?
@breadcrumb_paths ||= [default_breadcrumb]
else
@breadcrumb_paths ||= []
@breadcrumb_paths += args.flatten.compact
end
end
def show_breadcrumb
if !!(defined? show_local_breadcrumb)
show_local_breadcrumb
else
false
end
end
private
# transform anchor tag strings to {href, text} objects
# e.g "\u003ca href=\"/admin\"\u003eAdministration\u003c/a\u003e"
def anchor_string_to_object(html_string)
# Parse the HTML
doc = Nokogiri::HTML.fragment(html_string)
# Extract href and text
anchor = doc.at("a")
{ href: anchor["href"], text: anchor.text }
end
end
-1
View File
@@ -27,7 +27,6 @@ See COPYRIGHT and LICENSE files for more details.
++#%>
<% breadcrumb_paths(t("consent.title")) %>
<% html_title t("consent.title") %>
<%= call_hook :view_account_consent_top %>
<div id="login-form" class="account-consent form -bordered">
-1
View File
@@ -31,7 +31,6 @@ See COPYRIGHT and LICENSE files for more details.
fail ArgumentError, "missing instructions" unless defined? instructions %>
<% html_title t(:label_login) %>
<% breadcrumb_paths(t(:label_login)) %>
<%= call_hook :view_account_login_top %>
<%
-1
View File
@@ -27,7 +27,6 @@ See COPYRIGHT and LICENSE files for more details.
++#%>
<% breadcrumb_paths(t(:label_login)) %>
<% html_title t(:label_login) %>
<%= call_hook :view_account_login_top %>
<div id="login-form" class="form -bordered">
-1
View File
@@ -28,7 +28,6 @@ See COPYRIGHT and LICENSE files for more details.
++#%>
<% html_title t(:label_administration), "#{t('.label_edit_color')} #{h @color.name}" %>
<% local_assigns[:additional_breadcrumb] = @color.name %>
<%= render Colors::EditPageHeaderComponent.new(color: @color) %>
-15
View File
@@ -27,21 +27,6 @@ See COPYRIGHT and LICENSE files for more details.
++#%>
<%
if local_assigns[:additional_breadcrumb].nil?
breadcrumb_paths(
ActionController::Base.helpers.link_to(t(:label_administration), admin_index_path),
default_breadcrumb
)
else
breadcrumb_paths(
ActionController::Base.helpers.link_to(t(:label_administration), admin_index_path),
default_breadcrumb,
local_assigns[:additional_breadcrumb]
)
end
%>
<% @page_header_title = t(:label_administration) %>
<%= render template: "layouts/base", locals: { menu_name: :admin_menu } %>
-9
View File
@@ -131,15 +131,6 @@ See COPYRIGHT and LICENSE files for more details.
<% end %>
<div id="content-body">
<% if show_decoration %>
<div id="breadcrumb" class="<%= show_breadcrumb ? ' -show' : '' %>">
<%= you_are_here_info %>
<div id="full_breadcrumbs">
<%= full_breadcrumbs %>
</div>
<%= call_hook :view_layouts_base_breadcrumb %>
</div>
<% end %>
<%= content_for :content_body %>
<% unless local_assigns[:no_layout_yield] %>
<%= yield %>
@@ -27,7 +27,6 @@ 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) %>
<%= render OAuth::ShowPageHeaderComponent.new(application: @application) %>
@@ -27,7 +27,6 @@ See COPYRIGHT and LICENSE files for more details.
++#%>
<% html_title(t(:label_administration), t(:label_change_status_of_user, username: @user.name).to_s) -%>
<% local_assigns[:additional_breadcrumb] = @user.name %>
<% new_status = t("user.#{@status_change}") %>
<%= labelled_tabular_form_with model: @user, url: change_status_user_path(@user, @status_change => "1"), html: { method: :post, class: "form" } do %>
+1 -1
View File
@@ -28,7 +28,7 @@ See COPYRIGHT and LICENSE files for more details.
++#%>
<% html_title t(:permission_rename_wiki_pages) %>
<% breadcrumb_paths(*(@page.ancestors.reverse.collect { |parent| link_to h(parent.breadcrumb_title), { id: parent, project_id: parent.project } } + [h(@page.breadcrumb_title)])) %>
<%=
render Primer::OpenProject::PageHeader.new do |header|
header.with_title { h(@page.title) }
@@ -47,7 +47,6 @@
padding-left: 15px
padding-right: 15px
#breadcrumb,
.hidden-for-mobile
display: none !important
@@ -1,35 +0,0 @@
//-- copyright
// OpenProject is an open source project management software.
// Copyright (C) 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.
//++
#breadcrumb
@include global-breadcrumb-styles
min-height: var(--breadcrumb-height)
padding: 0
li
white-space: nowrap
@@ -32,7 +32,6 @@
@import grid
@import tree_menu
@import warning_bar
@import breadcrumb
@import main_menu
@import main_menu_mobile
@import searchable_menu
@@ -5,7 +5,6 @@
#main-menu,
#sidebar,
#footer,
#breadcrumb,
.op-app-header,
.contextual,
.other-formats,
@@ -37,9 +37,6 @@
flex-basis: 100%
border-color: var(--borderColor-accent-muted)
.controller-homescreen #breadcrumb
display: none
.homescreen--links
margin: 10px 0
display: flex
@@ -49,7 +49,6 @@
scroll-behavior: smooth
/* Remove margin-left: 2rem from Breadcrumbs */
#breadcrumb,
page-header,
sub-header,
.op-work-package-details-tab-component,
@@ -64,11 +63,6 @@ ul.SegmentedControl,
.Box > ul:not(.op-uc-list)
margin-left: 0
#breadcrumb
.breadcrumb-item.breadcrumb-item-selected
a
pointer-events: none
.op-primer-adjustments__toggle-switch--hidden-loading-indicator
.ToggleSwitch-statusIcon
display: none
@@ -36,7 +36,6 @@ RSpec.describe "layouts/base" do
before do
without_partial_double_verification do
allow(view).to receive(:default_breadcrumb)
allow(view).to receive_messages(current_menu_item: "overview", current_user: anonymous)
end
allow(OpenProject::Plugins::AuthPlugin).to receive(:providers).and_return([provider])
@@ -144,12 +144,6 @@ module Saml
redirect_to action: :index unless EnterpriseToken.allows_to?(:sso_auth_providers)
end
def default_breadcrumb; end
def show_local_breadcrumb
false
end
def update_provider_metadata_call
Saml::Providers::UpdateService
.new(model: @provider, user: User.current)
@@ -42,12 +42,6 @@ class BacklogsSettingsController < ApplicationController
redirect_to action: :show
end
def show_local_breadcrumb
false
end
def default_breadcrumb; end
private
def check_valid_settings
@@ -35,10 +35,4 @@ class RbMasterBacklogsController < RbApplicationController
@last_update = (@sprint_backlogs + @owner_backlogs).filter_map(&:updated_at).max
end
private
def default_breadcrumb
I18n.t(:label_backlogs)
end
end
@@ -38,8 +38,4 @@ class RbTaskboardsController < RbApplicationController
.order(Arel.sql("updated_at DESC"))
.first
end
def default_breadcrumb
I18n.t(:label_backlogs)
end
end
@@ -23,12 +23,6 @@ module ::Boards
render layout: "angular/angular"
end
def default_breadcrumb; end
def show_local_breadcrumb
false
end
def new; end
def create
@@ -152,9 +152,5 @@ module Admin
def find_cost_type
@cost_type = CostType.find(params[:id])
end
def show_local_breadcrumb
false
end
end
end
@@ -142,11 +142,5 @@ module My
def mobile?
browser.device.mobile?
end
def default_breadcrumb; end
def show_local_breadcrumb
false
end
end
end
@@ -44,11 +44,5 @@ module ::Gantt
end
end
end
private
def default_breadcrumb
t(:label_gantt_chart_plural)
end
end
end
@@ -87,11 +87,5 @@ module LdapGroups
.require(:synchronized_filter)
.permit(:filter_string, :name, :ldap_auth_source_id, :group_name_attribute, :sync_users, :base_dn)
end
def default_breadcrumb; end
def show_local_breadcrumb
false
end
end
end
@@ -66,11 +66,5 @@ module LdapGroups
.require(:synchronized_group)
.permit(:dn, :group_id, :ldap_auth_source_id, :sync_users)
end
def default_breadcrumb; end
def show_local_breadcrumb
false
end
end
end
@@ -32,7 +32,5 @@ module RecurringMeetings
.require(:meeting)
.permit(:start_date, :start_time_hour, :frequency, :interval)
end
def default_breadcrumb; end
end
end
@@ -43,9 +43,5 @@ module My
end
end
end
def default_breadcrumb
t("js.my_page.label")
end
end
end
@@ -130,12 +130,6 @@ module OpenIDConnect
@provider = OpenIDConnect::Provider.find(params[:id])
end
def default_breadcrumb; end
def show_local_breadcrumb
false
end
def successful_save_response
respond_to do |format|
format.turbo_stream do
@@ -1,5 +1,4 @@
<% page_title = t("openid_connect.providers.label_edit", name: @provider.display_name) %>
<% local_assigns[:additional_breadcrumb] = @provider.display_name %>
<% html_title(t(:label_administration), page_title) -%>
@@ -34,11 +34,5 @@ module ::Recaptcha
def permitted_params
params.permit(:recaptcha_type, :website_key, :secret_key, :response_limit)
end
def default_breadcrumb; end
def show_local_breadcrumb
false
end
end
end
@@ -1,5 +1,4 @@
<% html_title t("recaptcha.label_recaptcha") %>
<% breadcrumb_paths(t("recaptcha.label_recaptcha")) %>
<div id="login-form" class="form -bordered">
<h2 class="mb-3"><%= t "recaptcha.verify_account" %></h2>
<%= styled_form_tag({ action: :verify }, { autocomplete: "off", id: "submit_captcha" }) do %>
@@ -86,14 +86,6 @@ class Storages::Admin::AccessManagementController < ApplicationController
respond_with_turbo_streams
end
def default_breadcrumb
ActionController::Base.helpers.link_to(t(:project_module_storages), admin_settings_storages_path)
end
def show_local_breadcrumb
true
end
private
def find_model_object(object_id = :storage_id)
@@ -105,19 +105,6 @@ class Storages::Admin::AutomaticallyManagedProjectFoldersController < Applicatio
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
ActionController::Base.helpers.link_to(t(:project_module_storages), admin_settings_storages_path)
end
# See: default_breadcrum above
# Defines whether to show breadcrumbs on the page or not.
def show_local_breadcrumb
true
end
private
def respond_with_ampf_form_turbo_stream_or_edit_html
@@ -91,19 +91,6 @@ class Storages::Admin::OAuthClientsController < 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
ActionController::Base.helpers.link_to(t(:project_module_storages), admin_settings_storages_path)
end
# See: default_breadcrumb above
# Defines whether to show breadcrumbs on the page or not.
def show_local_breadcrumb
true
end
def show_redirect_uri
respond_to do |format|
format.html { render layout: false }
@@ -213,12 +213,6 @@ class Storages::Admin::StoragesController < ApplicationController
end
end
def default_breadcrumb; end
def show_local_breadcrumb
false
end
private
def prepare_storage_for_access_management_form
@@ -51,14 +51,6 @@ class Storages::ProjectSettings::ProjectStorageMembersController < Projects::Set
render "/storages/project_settings/project_storage_members/index"
end
def default_breadcrumb
t(:"storages.page_titles.project_settings.members_connection_status")
end
def show_local_breadcrumb
true
end
private
def find_model_object(object_id = :project_storage_id)
@@ -239,14 +239,6 @@ module ::TwoFactorAuthentication
current_user
end
def show_local_breadcrumb
true
end
def default_breadcrumb
t("two_factor_authentication.label_devices")
end
def available_devices
strategy_manager.available_devices
end
@@ -64,10 +64,6 @@ module ::TwoFactorAuthentication
@authenticated_user
end
def show_local_breadcrumb
false
end
def index_path
two_factor_authentication_request_path
end
@@ -112,10 +112,6 @@ module ::TwoFactorAuthentication
url_for action: :index
end
def show_local_breadcrumb
false
end
def registration_success_path
url_for(action: :index)
end
@@ -58,11 +58,5 @@ module ::TwoFactorAuthentication
def manager
::OpenProject::TwoFactorAuthentication::TokenStrategyManager
end
def default_breadcrumb; end
def show_local_breadcrumb
false
end
end
end
@@ -1,5 +1,4 @@
<% html_title t(:field_otp) %>
<% breadcrumb_paths(t(:field_otp)) %>
<div id="login-form" class="form -bordered">
<%= styled_form_tag({ action: :verify_backup_code }, { autocomplete: "off", id: "submit_backup_code" }) do %>
<h2><%= t "two_factor_authentication.login.enter_backup_code_title" %></h2>
@@ -2,7 +2,6 @@
<% has_other_devices = @active_devices.count > 1 %>
<% has_backup_codes = @authenticated_user.otp_backup_codes.exists? %>
<% html_title t(:field_otp) %>
<% breadcrumb_paths(t(:field_otp)) %>
<div id="login-form"
class="form -bordered"
data-controller="two-factor-authentication"
@@ -1,6 +1,4 @@
<% html_title(t(:label_my_account), t("two_factor_authentication.devices.confirm_device")) -%>
<% breadcrumb_paths link_to(t("two_factor_authentication.label_two_factor_authentication"), index_path),
t("two_factor_authentication.devices.confirm_device") -%>
<%= styled_form_tag(confirm_path, method: :post, id: "login-form", class: "form -bordered", autocomplete: "off") do %>
<h2><%= t("two_factor_authentication.devices.confirm_device") %></h2>
@@ -70,12 +70,6 @@ module Webhooks
.permit(:name, :description, :url, :secret, :enabled,
:project_ids, selected_project_ids: [], events: [])
end
def show_local_breadcrumb
false
end
def default_breadcrumb; end
end
end
end
@@ -36,7 +36,6 @@ RSpec.describe "layouts/admin" do
before do
without_partial_double_verification do
allow(view).to receive(:default_breadcrumb)
parent_menu_item = Object.new
allow(parent_menu_item).to receive(:name).and_return :root
-1
View File
@@ -42,7 +42,6 @@ RSpec.describe "layouts/base" do
before do
without_partial_double_verification do
allow(view).to receive(:default_breadcrumb)
allow(controller).to receive(:default_search_scope)
allow(view).to receive(:render_to_string)
allow(view).to receive_messages(current_menu_item: "overview", current_user:)