Commit 3cf996df authored by Imre Farkas's avatar Imre Farkas

Merge branch '245011_fix_security_dashboard_urls' into 'master'

Change the Security dashboard path

See merge request gitlab-org/gitlab!43737
parents 5f752d2b ab189d63
......@@ -9,7 +9,7 @@ module SecurityHelper
empty_state_svg_path: image_path('illustrations/operations-dashboard_empty.svg'),
project_add_endpoint: security_projects_path,
project_list_endpoint: security_projects_path,
instance_dashboard_settings_path: security_settings_dashboard_path,
instance_dashboard_settings_path: settings_security_dashboard_path,
vulnerability_feedback_help_path: help_page_path('user/application_security/index', anchor: 'interacting-with-the-vulnerabilities'),
vulnerabilities_export_endpoint: expose_path(api_v4_security_vulnerability_exports_path)
}
......
......@@ -5,5 +5,5 @@
= link_to operations_path, class: 'dropdown-item', data: { qa_selector: 'operations_link' } do
= _('Operations')
- if dashboard_nav_link?(:security)
= link_to security_root_path, class: 'dropdown-item', data: { qa_selector: 'security_link' } do
= link_to security_dashboard_path, class: 'dropdown-item', data: { qa_selector: 'security_link' } do
= _('Security')
- page_title _('Security')
- header_title _('Security'), security_root_path
- header_title _('Security'), security_dashboard_path
- nav 'security'
- @left_sidebar = true
......
.nav-sidebar{ class: ("sidebar-collapsed-desktop" if collapsed_sidebar?) }
.nav-sidebar-inner-scroll
.context-header
= link_to security_root_path, title: _('Security Dashboard'), id: 'logo' do
= link_to security_dashboard_path, title: _('Security Dashboard'), id: 'logo' do
.avatar-container.s40.settings-avatar.rect-avatar
= brand_header_logo
.sidebar-context-title
= _('Security')
%ul.sidebar-top-level-items
= nav_link(path: %w[dashboard#show]) do
= link_to security_root_path, class: 'shortcuts-project rspec-project-link' do
= link_to security_dashboard_path, class: 'shortcuts-project rspec-project-link' do
.nav-icon-container
= sprite_icon('dashboard')
%span.nav-item-name
......@@ -20,7 +20,7 @@
%span.nav-item-name
= _('Vulnerability Report')
= nav_link(path: %w[dashboard#settings]) do
= link_to security_settings_dashboard_path, class: 'shortcuts-project rspec-project-link' do
= link_to settings_security_dashboard_path, class: 'shortcuts-project rspec-project-link' do
.nav-icon-container
= sprite_icon('settings')
%span.nav-item-name
......
---
title: Change the instance security dashboard path as `/-/security/dashboard`
merge_request: 43737
author:
type: fixed
# frozen_string_literal: true
namespace :security do
root to: 'dashboard#show'
get 'dashboard/settings', to: 'dashboard#settings', as: :settings_dashboard
root to: redirect('-/security/dashboard')
resource :dashboard, only: [:show], controller: :dashboard do
get :settings
end
resources :projects, only: [:index, :create, :destroy]
resources :vulnerabilities, only: [:index]
end
......@@ -14,7 +14,7 @@ RSpec.describe SecurityHelper do
empty_state_svg_path: image_path('illustrations/operations-dashboard_empty.svg'),
project_add_endpoint: security_projects_path,
project_list_endpoint: security_projects_path,
instance_dashboard_settings_path: security_settings_dashboard_path,
instance_dashboard_settings_path: settings_security_dashboard_path,
vulnerability_feedback_help_path: help_page_path('user/application_security/index', anchor: 'interacting-with-the-vulnerabilities'),
vulnerabilities_export_endpoint: api_v4_security_vulnerability_exports_path
})
......
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe 'Security routing', 'routing' do
describe 'root path' do
include RSpec::Rails::RequestExampleGroup
subject { get('/-/security') }
it { is_expected.to redirect_to('/-/security/dashboard') }
end
describe '/-/security/dashboard' do
subject { get('/-/security/dashboard') }
it { is_expected.to route_to('security/dashboard#show') }
end
describe '/-/security/dashboard/settings' do
subject { get('/-/security/dashboard/settings') }
it { is_expected.to route_to('security/dashboard#settings') }
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment