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
b2edbce5
Commit
b2edbce5
authored
Feb 19, 2019
by
Victor Zagorodny
Committed by
Grzegorz Bizon
Feb 19, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add feature flag for "Group Overview content" preference
parent
06165c47
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
7 deletions
+47
-7
ee/app/helpers/ee/preferences_helper.rb
ee/app/helpers/ee/preferences_helper.rb
+13
-7
ee/app/views/profiles/preferences/_group_overview_selector.html.haml
...s/profiles/preferences/_group_overview_selector.html.haml
+2
-0
ee/spec/helpers/preferences_helper_spec.rb
ee/spec/helpers/preferences_helper_spec.rb
+32
-0
No files found.
ee/app/helpers/ee/preferences_helper.rb
View file @
b2edbce5
...
...
@@ -12,15 +12,21 @@ module EE
end
def
group_view_choices
choices
=
[
[
_
(
'Details (default)'
),
:details
]
]
if
License
.
feature_available?
(
:security_dashboard
)
choices
<<
[
_
(
'Security dashboard'
),
:security_dashboard
]
strong_memoize
(
:group_view_choices
)
do
[[
_
(
'Details (default)'
),
:details
]].
tap
do
|
choices
|
choices
<<
[
_
(
'Security dashboard'
),
:security_dashboard
]
if
group_view_security_dashboard_enabled?
end
end
end
def
group_overview_content_preference?
group_view_choices
.
size
>
1
end
private
choices
def
group_view_security_dashboard_enabled?
License
.
feature_available?
(
:security_dashboard
)
&&
::
Feature
.
enabled?
(
:group_overview_security_dashboard
)
end
end
end
ee/app/views/profiles/preferences/_group_overview_selector.html.haml
View file @
b2edbce5
-
return
unless
group_overview_content_preference?
.form-group
=
f
.
label
:group_view
,
class:
'label-bold'
do
=
_
(
'Group overview content'
)
...
...
ee/spec/helpers/preferences_helper_spec.rb
View file @
b2edbce5
...
...
@@ -40,10 +40,42 @@ describe PreferencesHelper do
end
it
{
is_expected
.
to
include
([
'Security dashboard'
,
:security_dashboard
])
}
context
'but feature flag is disabled'
do
before
do
stub_feature_flags
(
group_overview_security_dashboard:
false
)
end
it
{
is_expected
.
not_to
include
([
'Security dashboard'
,
:security_dashboard
])
}
end
end
context
'when security dashboard feature is disabled'
do
it
{
is_expected
.
not_to
include
([
'Security dashboard'
,
:security_dashboard
])
}
end
end
describe
'#group_overview_content_preference?'
do
subject
{
helper
.
group_overview_content_preference?
}
context
'when security dashboard feature is enabled'
do
before
do
stub_licensed_features
(
security_dashboard:
true
)
end
it
{
is_expected
.
to
eq
(
true
)
}
context
'but feature flag is disabled'
do
before
do
stub_feature_flags
(
group_overview_security_dashboard:
false
)
end
it
{
is_expected
.
to
eq
(
false
)
}
end
end
context
'when security dashboard feature is disabled'
do
it
{
is_expected
.
to
eq
(
false
)
}
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