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
b3659866
Commit
b3659866
authored
Nov 20, 2020
by
Sarah Yasonik
Committed by
Peter Leitzen
Nov 20, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable alert management for configured http integrations
parent
0b30d88d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
35 additions
and
4 deletions
+35
-4
app/helpers/projects/alert_management_helper.rb
app/helpers/projects/alert_management_helper.rb
+5
-1
changelogs/unreleased/sy-fix-alerts-active-state.yml
changelogs/unreleased/sy-fix-alerts-active-state.yml
+5
-0
spec/features/alert_management/alert_management_list_spec.rb
spec/features/alert_management/alert_management_list_spec.rb
+3
-3
spec/helpers/projects/alert_management_helper_spec.rb
spec/helpers/projects/alert_management_helper_spec.rb
+22
-0
No files found.
app/helpers/projects/alert_management_helper.rb
View file @
b3659866
...
...
@@ -27,7 +27,11 @@ module Projects::AlertManagementHelper
private
def
alert_management_enabled?
(
project
)
!!
(
project
.
alerts_service_activated?
||
project
.
prometheus_service_active?
)
!!
(
project
.
alerts_service_activated?
||
project
.
prometheus_service_active?
||
AlertManagement
::
HttpIntegrationsFinder
.
new
(
project
,
active:
true
).
execute
.
any?
)
end
end
...
...
changelogs/unreleased/sy-fix-alerts-active-state.yml
0 → 100644
View file @
b3659866
---
title
:
Ensure Alerts list loads when only HTTP integrations are enabled
merge_request
:
48247
author
:
type
:
fixed
spec/features/alert_management/alert_management_list_spec.rb
View file @
b3659866
...
...
@@ -18,7 +18,7 @@ RSpec.describe 'Alert Management index', :js do
wait_for_requests
end
context
'when a developer displays the alert list and
the alert service is
not enabled'
do
context
'when a developer displays the alert list and
alert integrations are
not enabled'
do
it
'shows the alert page title'
do
expect
(
page
).
to
have_content
(
'Alerts'
)
end
...
...
@@ -38,8 +38,8 @@ RSpec.describe 'Alert Management index', :js do
end
end
context
'when a developer displays the alert list and
the alert service
is enabled'
do
let_it_be
(
:
alerts_service
)
{
create
(
:alerts_service
,
project:
project
)
}
context
'when a developer displays the alert list and
an HTTP integration
is enabled'
do
let_it_be
(
:
integration
)
{
create
(
:alert_management_http_integration
,
project:
project
)
}
it
'shows the alert page title'
do
expect
(
page
).
to
have_content
(
'Alerts'
)
...
...
spec/helpers/projects/alert_management_helper_spec.rb
View file @
b3659866
...
...
@@ -83,6 +83,28 @@ RSpec.describe Projects::AlertManagementHelper do
end
end
context
'with http integration'
do
let_it_be
(
:integration
)
{
create
(
:alert_management_http_integration
,
project:
project
)
}
context
'when integration is active'
do
it
'enables alert management'
do
expect
(
data
).
to
include
(
'alert-management-enabled'
=>
'true'
)
end
end
context
'when integration is inactive'
do
it
'disables alert management'
do
integration
.
update!
(
active:
false
)
expect
(
data
).
to
include
(
'alert-management-enabled'
=>
'false'
)
end
end
end
context
'when user does not have requisite enablement permissions'
do
let
(
:user_can_enable_alert_management
)
{
false
}
...
...
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