Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
c4dcf5a4
Commit
c4dcf5a4
authored
Oct 16, 2018
by
Dave Waters
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix gofmt, add test, correct noted concerns with default value
parent
18c73631
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
10 additions
and
6 deletions
+10
-6
pkg/api/dtos/alerting.go
+0
-0
pkg/models/alert_notifications.go
+0
-0
pkg/services/alerting/notifiers/base.go
+0
-1
pkg/services/alerting/notifiers/base_test.go
+5
-0
pkg/services/sqlstore/alert_notification.go
+0
-0
pkg/services/sqlstore/alert_notification_test.go
+4
-4
pkg/services/sqlstore/migrations/alert_mig.go
+1
-1
No files found.
pkg/api/dtos/alerting.go
View file @
c4dcf5a4
pkg/models/alert_notifications.go
View file @
c4dcf5a4
pkg/services/alerting/notifiers/base.go
View file @
c4dcf5a4
...
...
@@ -6,7 +6,6 @@ import (
"github.com/grafana/grafana/pkg/log"
"github.com/grafana/grafana/pkg/models"
"github.com/grafana/grafana/pkg/services/alerting"
)
...
...
pkg/services/alerting/notifiers/base_test.go
View file @
c4dcf5a4
...
...
@@ -179,5 +179,10 @@ func TestBaseNotifier(t *testing.T) {
base
:=
NewNotifierBase
(
model
)
So
(
base
.
UploadImage
,
ShouldBeTrue
)
})
Convey
(
"default value should be false for backwards compatibility"
,
func
()
{
base
:=
NewNotifierBase
(
model
)
So
(
base
.
DisableResolvedMessage
,
ShouldBeFalse
)
})
})
}
pkg/services/sqlstore/alert_notification.go
View file @
c4dcf5a4
pkg/services/sqlstore/alert_notification_test.go
View file @
c4dcf5a4
...
...
@@ -259,10 +259,10 @@ func TestAlertNotificationSQLAccess(t *testing.T) {
})
Convey
(
"Can search using an array of ids"
,
func
()
{
cmd1
:=
m
odels
.
CreateAlertNotificationCommand
{
Name
:
"nagios"
,
Type
:
"webhook"
,
OrgId
:
1
,
SendReminder
:
true
,
DisableResolvedMessage
:
fals
e
,
Frequency
:
"10s"
,
Settings
:
simplejson
.
New
()}
cmd2
:=
m
odels
.
CreateAlertNotificationCommand
{
Name
:
"slack"
,
Type
:
"webhook"
,
OrgId
:
1
,
SendReminder
:
true
,
DisableResolvedMessage
:
fals
e
,
Frequency
:
"10s"
,
Settings
:
simplejson
.
New
()}
cmd3
:=
m
odels
.
CreateAlertNotificationCommand
{
Name
:
"ops2"
,
Type
:
"email"
,
OrgId
:
1
,
SendReminder
:
true
,
DisableResolvedMessage
:
fals
e
,
Frequency
:
"10s"
,
Settings
:
simplejson
.
New
()}
cmd4
:=
m
odels
.
CreateAlertNotificationCommand
{
IsDefault
:
true
,
Name
:
"default"
,
Type
:
"email"
,
OrgId
:
1
,
SendReminder
:
true
,
DisableResolvedMessage
:
fals
e
,
Frequency
:
"10s"
,
Settings
:
simplejson
.
New
()}
cmd1
:=
m
.
CreateAlertNotificationCommand
{
Name
:
"nagios"
,
Type
:
"webhook"
,
OrgId
:
1
,
SendReminder
:
tru
e
,
Frequency
:
"10s"
,
Settings
:
simplejson
.
New
()}
cmd2
:=
m
.
CreateAlertNotificationCommand
{
Name
:
"slack"
,
Type
:
"webhook"
,
OrgId
:
1
,
SendReminder
:
tru
e
,
Frequency
:
"10s"
,
Settings
:
simplejson
.
New
()}
cmd3
:=
m
.
CreateAlertNotificationCommand
{
Name
:
"ops2"
,
Type
:
"email"
,
OrgId
:
1
,
SendReminder
:
tru
e
,
Frequency
:
"10s"
,
Settings
:
simplejson
.
New
()}
cmd4
:=
m
.
CreateAlertNotificationCommand
{
IsDefault
:
true
,
Name
:
"default"
,
Type
:
"email"
,
OrgId
:
1
,
SendReminder
:
tru
e
,
Frequency
:
"10s"
,
Settings
:
simplejson
.
New
()}
otherOrg
:=
models
.
CreateAlertNotificationCommand
{
Name
:
"default"
,
Type
:
"email"
,
OrgId
:
2
,
SendReminder
:
true
,
DisableResolvedMessage
:
false
,
Frequency
:
"10s"
,
Settings
:
simplejson
.
New
()}
...
...
pkg/services/sqlstore/migrations/alert_mig.go
View file @
c4dcf5a4
...
...
@@ -72,7 +72,7 @@ func addAlertMigrations(mg *Migrator) {
Name
:
"send_reminder"
,
Type
:
DB_Bool
,
Nullable
:
true
,
Default
:
"0"
,
}))
mg
.
AddMigration
(
"Add column disable_resolved_message"
,
NewAddColumnMigration
(
alert_notification
,
&
Column
{
Name
:
"disable_resolved_message"
,
Type
:
DB_Bool
,
Nullable
:
false
,
Default
:
"
1
"
,
Name
:
"disable_resolved_message"
,
Type
:
DB_Bool
,
Nullable
:
false
,
Default
:
"
0
"
,
}))
mg
.
AddMigration
(
"add index alert_notification org_id & name"
,
NewAddIndexMigration
(
alert_notification
,
alert_notification
.
Indices
[
0
]))
...
...
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