Commit 71ae8692 authored by Alexander Turinske's avatar Alexander Turinske

Add a left-hand navigation to the security page

- create a new layout
- create a new sidebar
- update tests
parent e6d9271c
...@@ -2,5 +2,6 @@ ...@@ -2,5 +2,6 @@
module Security module Security
class DashboardController < ::Security::ApplicationController class DashboardController < ::Security::ApplicationController
layout 'instance_security'
end end
end end
- page_title _('Security')
- header_title _('Security'), instance_statistics_root_path
- nav 'security'
- @left_sidebar = true
= render template: 'layouts/application'
.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
.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
.nav-icon-container
= sprite_icon('dashboard')
%span.nav-item-name
= _('Security Dashboard')
= render 'shared/sidebar_toggle_button'
---
title: Add a left-hand navigation to the security page
merge_request: 38529
author:
type: changed
...@@ -3,11 +3,34 @@ ...@@ -3,11 +3,34 @@
require 'spec_helper' require 'spec_helper'
RSpec.describe Security::DashboardController do RSpec.describe Security::DashboardController do
let_it_be(:user) { create(:user) }
describe 'GET #show' do describe 'GET #show' do
subject { get :show }
it_behaves_like Security::ApplicationController do it_behaves_like Security::ApplicationController do
let(:security_application_controller_child_action) do let(:security_application_controller_child_action) do
get :show get :show
end end
end end
context 'when security dashboard feature' do
before do
sign_in(user)
end
context 'is enabled' do
before do
stub_licensed_features(security_dashboard: true)
end
it { is_expected.to render_template(:instance_security) }
end
context 'is disabled' do
it { is_expected.to have_gitlab_http_status(:not_found) }
it { is_expected.to render_template('errors/not_found') }
end
end
end end
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