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
e78c35bc
Commit
e78c35bc
authored
Dec 06, 2018
by
Matija Čupić
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Stub feature_flags feature check for project
parent
bdf56236
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
11 deletions
+17
-11
app/views/layouts/nav/sidebar/_project.html.haml
app/views/layouts/nav/sidebar/_project.html.haml
+1
-1
ee/spec/views/layouts/nav/sidebar/_project.html.haml_spec.rb
ee/spec/views/layouts/nav/sidebar/_project.html.haml_spec.rb
+16
-10
No files found.
app/views/layouts/nav/sidebar/_project.html.haml
View file @
e78c35bc
...
...
@@ -195,7 +195,7 @@
=
_
(
'Charts'
)
-
if
project_nav_tab?
:operations
-
if
can?
(
current_user
,
:read_environment
,
@project
)
||
can?
(
current_user
,
:read_cluster
,
@project
)
-
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
)
...
...
ee/spec/views/layouts/nav/sidebar/_project.html.haml_spec.rb
View file @
e78c35bc
...
...
@@ -14,28 +14,34 @@ describe 'layouts/nav/sidebar/_project' do
end
describe
'Operations main link'
do
describe
'when ci/cd is disabled'
do
let
(
:user
)
{
create
(
:user
)
}
before
do
stub_licensed_features
(
feature_flags:
true
)
project
.
project_feature
.
update
(
builds_access_level:
feature
)
project
.
team
.
add_developer
(
user
)
sign_in
(
user
)
end
context
'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
))
expect
(
rendered
).
to
have_link
(
'Operations'
,
href:
project_feature_flags_path
(
project
))
end
end
describe
'when ci/cd is enabled'
do
context
'when ci/cd is enabled'
do
let
(
:feature
)
{
ProjectFeature
::
ENABLED
}
it
'links to metrics page'
do
allow
(
view
).
to
receive
(
:can?
).
and_return
(
true
)
it
'links to metrics page'
do
render
expect
(
rendered
).
to
have_link
(
'Operations'
,
:href
=>
metrics_project_environments_path
(
project
))
expect
(
rendered
).
to
have_link
(
'Operations'
,
href:
metrics_project_environments_path
(
project
))
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