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
4fc5e7b5
Commit
4fc5e7b5
authored
May 14, 2020
by
Tristan Read
Committed by
Clement Ho
May 14, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove alert_management_minimal feature flag
parent
99d21e45
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
18 additions
and
55 deletions
+18
-55
app/controllers/projects/alert_management_controller.rb
app/controllers/projects/alert_management_controller.rb
+0
-5
app/views/layouts/nav/sidebar/_project.html.haml
app/views/layouts/nav/sidebar/_project.html.haml
+5
-6
changelogs/unreleased/tr-remove-alert-mgmt-feature-flag.yml
changelogs/unreleased/tr-remove-alert-mgmt-feature-flag.yml
+5
-0
spec/controllers/projects/alert_management_controller_spec.rb
.../controllers/projects/alert_management_controller_spec.rb
+5
-23
spec/views/layouts/nav/sidebar/_project.html.haml_spec.rb
spec/views/layouts/nav/sidebar/_project.html.haml_spec.rb
+3
-21
No files found.
app/controllers/projects/alert_management_controller.rb
View file @
4fc5e7b5
# frozen_string_literal: true
class
Projects::AlertManagementController
<
Projects
::
ApplicationController
before_action
:ensure_list_feature_enabled
,
only: :index
before_action
:ensure_detail_feature_enabled
,
only: :details
before_action
:authorize_read_alert_management_alert!
before_action
do
...
...
@@ -18,10 +17,6 @@ class Projects::AlertManagementController < Projects::ApplicationController
private
def
ensure_list_feature_enabled
render_404
unless
Feature
.
enabled?
(
:alert_management_minimal
,
project
)
end
def
ensure_detail_feature_enabled
render_404
unless
Feature
.
enabled?
(
:alert_management_detail
,
project
)
end
...
...
app/views/layouts/nav/sidebar/_project.html.haml
View file @
4fc5e7b5
...
...
@@ -222,12 +222,11 @@
%span
=
_
(
'Metrics'
)
-
if
Feature
.
enabled?
(
:alert_management_minimal
,
@project
)
-
if
project_nav_tab?
(
:alert_management
)
=
nav_link
(
controller: :alert_management
)
do
=
link_to
project_alert_management_index_path
(
@project
),
title:
_
(
'Alerts'
),
class:
'shortcuts-tracking qa-operations-tracking-link'
do
%span
=
_
(
'Alerts'
)
-
if
project_nav_tab?
(
:alert_management
)
=
nav_link
(
controller: :alert_management
)
do
=
link_to
project_alert_management_index_path
(
@project
),
title:
_
(
'Alerts'
),
class:
'shortcuts-tracking qa-operations-tracking-link'
do
%span
=
_
(
'Alerts'
)
-
if
project_nav_tab?
:environments
=
render_if_exists
"layouts/nav/sidebar/tracing_link"
...
...
changelogs/unreleased/tr-remove-alert-mgmt-feature-flag.yml
0 → 100644
View file @
4fc5e7b5
---
title
:
Enable Alert Management functionality
merge_request
:
31171
author
:
type
:
added
spec/controllers/projects/alert_management_controller_spec.rb
View file @
4fc5e7b5
...
...
@@ -14,32 +14,14 @@ describe Projects::AlertManagementController do
end
describe
'GET #index'
do
context
'when alert_management_minimal is enabled'
do
before
do
stub_feature_flags
(
alert_management_minimal:
true
)
end
it
'shows the page'
do
get
:index
,
params:
{
namespace_id:
project
.
namespace
,
project_id:
project
}
it
'shows the page'
do
get
:index
,
params:
{
namespace_id:
project
.
namespace
,
project_id:
project
}
expect
(
response
).
to
have_gitlab_http_status
(
:ok
)
end
context
'when user is unauthorized'
do
let
(
:role
)
{
:reporter
}
it
'shows 404'
do
get
:index
,
params:
{
namespace_id:
project
.
namespace
,
project_id:
project
}
expect
(
response
).
to
have_gitlab_http_status
(
:not_found
)
end
end
expect
(
response
).
to
have_gitlab_http_status
(
:ok
)
end
context
'when alert_management_minimal is disabled'
do
before
do
stub_feature_flags
(
alert_management_minimal:
false
)
end
context
'when user is unauthorized'
do
let
(
:role
)
{
:reporter
}
it
'shows 404'
do
get
:index
,
params:
{
namespace_id:
project
.
namespace
,
project_id:
project
}
...
...
spec/views/layouts/nav/sidebar/_project.html.haml_spec.rb
View file @
4fc5e7b5
...
...
@@ -163,28 +163,10 @@ describe 'layouts/nav/sidebar/_project' do
end
describe
'Alert Management'
do
context
'when alert_management_minimal is enabled'
do
before
do
stub_feature_flags
(
alert_management_minimal:
true
)
end
it
'shows the Alerts sidebar entry'
do
render
expect
(
rendered
).
to
have_css
(
'a[title="Alerts"]'
)
end
end
context
'when alert_management_minimal is disabled'
do
before
do
stub_feature_flags
(
alert_management_minimal:
false
)
end
it
'does not show the Alerts sidebar entry'
do
render
it
'shows the Alerts sidebar entry'
do
render
expect
(
rendered
).
to
have_no_css
(
'a[title="Alerts"]'
)
end
expect
(
rendered
).
to
have_css
(
'a[title="Alerts"]'
)
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