Commit ab189d63 authored by Mehmet Emin INAC's avatar Mehmet Emin INAC Committed by Imre Farkas

Change the Security dashboard path

parent 185b5541
...@@ -9,7 +9,7 @@ module SecurityHelper ...@@ -9,7 +9,7 @@ module SecurityHelper
empty_state_svg_path: image_path('illustrations/operations-dashboard_empty.svg'), empty_state_svg_path: image_path('illustrations/operations-dashboard_empty.svg'),
project_add_endpoint: security_projects_path, project_add_endpoint: security_projects_path,
project_list_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'), 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) vulnerabilities_export_endpoint: expose_path(api_v4_security_vulnerability_exports_path)
} }
......
...@@ -5,5 +5,5 @@ ...@@ -5,5 +5,5 @@
= link_to operations_path, class: 'dropdown-item', data: { qa_selector: 'operations_link' } do = link_to operations_path, class: 'dropdown-item', data: { qa_selector: 'operations_link' } do
= _('Operations') = _('Operations')
- if dashboard_nav_link?(:security) - 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') = _('Security')
- page_title _('Security') - page_title _('Security')
- header_title _('Security'), security_root_path - header_title _('Security'), security_dashboard_path
- nav 'security' - nav 'security'
- @left_sidebar = true - @left_sidebar = true
......
.nav-sidebar{ class: ("sidebar-collapsed-desktop" if collapsed_sidebar?) } .nav-sidebar{ class: ("sidebar-collapsed-desktop" if collapsed_sidebar?) }
.nav-sidebar-inner-scroll .nav-sidebar-inner-scroll
.context-header .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 .avatar-container.s40.settings-avatar.rect-avatar
= brand_header_logo = brand_header_logo
.sidebar-context-title .sidebar-context-title
= _('Security') = _('Security')
%ul.sidebar-top-level-items %ul.sidebar-top-level-items
= nav_link(path: %w[dashboard#show]) do = 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 .nav-icon-container
= sprite_icon('dashboard') = sprite_icon('dashboard')
%span.nav-item-name %span.nav-item-name
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
%span.nav-item-name %span.nav-item-name
= _('Vulnerability Report') = _('Vulnerability Report')
= nav_link(path: %w[dashboard#settings]) do = 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 .nav-icon-container
= sprite_icon('settings') = sprite_icon('settings')
%span.nav-item-name %span.nav-item-name
......
---
title: Change the instance security dashboard path as `/-/security/dashboard`
merge_request: 43737
author:
type: fixed
# frozen_string_literal: true # frozen_string_literal: true
namespace :security do namespace :security do
root to: 'dashboard#show' root to: redirect('-/security/dashboard')
get 'dashboard/settings', to: 'dashboard#settings', as: :settings_dashboard
resource :dashboard, only: [:show], controller: :dashboard do
get :settings
end
resources :projects, only: [:index, :create, :destroy] resources :projects, only: [:index, :create, :destroy]
resources :vulnerabilities, only: [:index] resources :vulnerabilities, only: [:index]
end end
...@@ -14,7 +14,7 @@ RSpec.describe SecurityHelper do ...@@ -14,7 +14,7 @@ RSpec.describe SecurityHelper do
empty_state_svg_path: image_path('illustrations/operations-dashboard_empty.svg'), empty_state_svg_path: image_path('illustrations/operations-dashboard_empty.svg'),
project_add_endpoint: security_projects_path, project_add_endpoint: security_projects_path,
project_list_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'), 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 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