Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
71ae8692
Commit
71ae8692
authored
Aug 03, 2020
by
Alexander Turinske
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a left-hand navigation to the security page
- create a new layout - create a new sidebar - update tests
parent
e6d9271c
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
52 additions
and
0 deletions
+52
-0
ee/app/controllers/security/dashboard_controller.rb
ee/app/controllers/security/dashboard_controller.rb
+1
-0
ee/app/views/layouts/instance_security.html.haml
ee/app/views/layouts/instance_security.html.haml
+6
-0
ee/app/views/layouts/nav/sidebar/_security.html.haml
ee/app/views/layouts/nav/sidebar/_security.html.haml
+17
-0
ee/changelogs/unreleased/230411-security-left-nav.yml
ee/changelogs/unreleased/230411-security-left-nav.yml
+5
-0
ee/spec/controllers/security/dashboard_controller_spec.rb
ee/spec/controllers/security/dashboard_controller_spec.rb
+23
-0
No files found.
ee/app/controllers/security/dashboard_controller.rb
View file @
71ae8692
...
...
@@ -2,5 +2,6 @@
module
Security
class
DashboardController
<
::
Security
::
ApplicationController
layout
'instance_security'
end
end
ee/app/views/layouts/instance_security.html.haml
0 → 100644
View file @
71ae8692
-
page_title
_
(
'Security'
)
-
header_title
_
(
'Security'
),
instance_statistics_root_path
-
nav
'security'
-
@left_sidebar
=
true
=
render
template:
'layouts/application'
ee/app/views/layouts/nav/sidebar/_security.html.haml
0 → 100644
View file @
71ae8692
.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'
ee/changelogs/unreleased/230411-security-left-nav.yml
0 → 100644
View file @
71ae8692
---
title
:
Add a left-hand navigation to the security page
merge_request
:
38529
author
:
type
:
changed
ee/spec/controllers/security/dashboard_controller_spec.rb
View file @
71ae8692
...
...
@@ -3,11 +3,34 @@
require
'spec_helper'
RSpec
.
describe
Security
::
DashboardController
do
let_it_be
(
:user
)
{
create
(
:user
)
}
describe
'GET #show'
do
subject
{
get
:show
}
it_behaves_like
Security
::
ApplicationController
do
let
(
:security_application_controller_child_action
)
do
get
:show
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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment