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
bdf56236
Commit
bdf56236
authored
Nov 28, 2018
by
Filipa Lacerda
Committed by
Matija Čupić
Dec 08, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Renders feature flags link when ci/cd is disabled
Updates specs try to fix test
parent
f9f8ebea
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
1 deletion
+38
-1
app/views/layouts/nav/sidebar/_project.html.haml
app/views/layouts/nav/sidebar/_project.html.haml
+6
-1
ee/changelogs/unreleased/8400-operations-check.yml
ee/changelogs/unreleased/8400-operations-check.yml
+5
-0
ee/spec/views/layouts/nav/sidebar/_project.html.haml_spec.rb
ee/spec/views/layouts/nav/sidebar/_project.html.haml_spec.rb
+27
-0
No files found.
app/views/layouts/nav/sidebar/_project.html.haml
View file @
bdf56236
...
...
@@ -195,8 +195,13 @@
=
_
(
'Charts'
)
-
if
project_nav_tab?
:operations
-
if
can?
(
current_user
,
:read_environment
,
@project
)
||
can?
(
current_user
,
:read_cluster
,
@project
)
-
main_link
=
metrics_project_environments_path
(
@project
)
-
elsif
can?
(
current_user
,
:read_feature_flag
,
@project
)
-
main_link
=
project_feature_flags_path
(
@project
)
=
nav_link
(
controller:
sidebar_operations_paths
)
do
=
link_to
m
etrics_project_environments_path
(
@project
)
,
class:
'shortcuts-operations'
do
=
link_to
m
ain_link
,
class:
'shortcuts-operations'
do
.nav-icon-container
=
sprite_icon
(
'cloud-gear'
)
%span
.nav-item-name
...
...
ee/changelogs/unreleased/8400-operations-check.yml
0 → 100644
View file @
bdf56236
---
title
:
Defaults to feature flags link for Operations entry
merge_request
:
8622
author
:
type
:
fixed
ee/spec/views/layouts/nav/sidebar/_project.html.haml_spec.rb
View file @
bdf56236
...
...
@@ -13,6 +13,33 @@ describe 'layouts/nav/sidebar/_project' do
stub_licensed_features
(
tracing:
true
)
end
describe
'Operations main link'
do
describe
'when ci/cd is disabled'
do
let
(
:feature
)
{
ProjectFeature
::
DISABLED
}
it
'links to feature flags page'
do
allow
(
view
).
to
receive
(
:can?
).
with
(
:read_environment
).
and_return
(
false
)
allow
(
view
).
to
receive
(
:can?
).
with
(
:read_cluster
).
and_return
(
false
)
allow
(
view
).
to
receive
(
:can?
).
with
(
:read_feature_flag
).
and_return
(
true
)
render
expect
(
rendered
).
to
have_link
(
'Operations'
,
:href
=>
project_feature_flags_path
(
project
))
end
end
describe
'when ci/cd is enabled'
do
let
(
:feature
)
{
ProjectFeature
::
ENABLED
}
it
'links to metrics page'
do
allow
(
view
).
to
receive
(
:can?
).
and_return
(
true
)
render
expect
(
rendered
).
to
have_link
(
'Operations'
,
:href
=>
metrics_project_environments_path
(
project
))
end
end
end
describe
'Operations > Tracing'
do
it
'is not visible when no valid license'
do
allow
(
view
).
to
receive
(
:can?
).
and_return
(
true
)
...
...
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