Commit 07fa2f17 by Torkel Ödegaard Committed by GitHub

fix: alert list links did not work, changed dashboardUri to Url, this is…

fix: alert list links did not work, changed dashboardUri to Url, this is breaking api change in alert api (#10756)
parent d379aa38
...@@ -62,7 +62,7 @@ Content-Type: application/json ...@@ -62,7 +62,7 @@ Content-Type: application/json
} }
"newStateDate": "2016-12-25", "newStateDate": "2016-12-25",
"executionError": "", "executionError": "",
"dashboardUri": "http://grafana.com/dashboard/db/sensors" "url": "http://grafana.com/dashboard/db/sensors"
} }
] ]
``` ```
...@@ -94,7 +94,7 @@ Content-Type: application/json ...@@ -94,7 +94,7 @@ Content-Type: application/json
"state": "alerting", "state": "alerting",
"newStateDate": "2016-12-25", "newStateDate": "2016-12-25",
"executionError": "", "executionError": "",
"dashboardUri": "http://grafana.com/dashboard/db/sensors" "url": "http://grafana.com/dashboard/db/sensors"
} }
``` ```
...@@ -196,7 +196,7 @@ Content-Type: application/json ...@@ -196,7 +196,7 @@ Content-Type: application/json
## Create alert notification ## Create alert notification
You can find the full list of [supported notifers](/alerting/notifications/#all-supported-notifier) at the alert notifiers page. You can find the full list of [supported notifers](/alerting/notifications/#all-supported-notifier) at the alert notifiers page.
`POST /api/alert-notifications` `POST /api/alert-notifications`
...@@ -294,4 +294,4 @@ Content-Type: application/json ...@@ -294,4 +294,4 @@ Content-Type: application/json
{ {
"message": "Notification deleted" "message": "Notification deleted"
} }
``` ```
\ No newline at end of file
...@@ -105,7 +105,7 @@ func transformToDTOs(alerts []*models.Alert, c *middleware.Context) ([]*dtos.Ale ...@@ -105,7 +105,7 @@ func transformToDTOs(alerts []*models.Alert, c *middleware.Context) ([]*dtos.Ale
for _, alert := range alertDTOs { for _, alert := range alertDTOs {
for _, dash := range dashboardsQuery.Result { for _, dash := range dashboardsQuery.Result {
if alert.DashboardId == dash.Id { if alert.DashboardId == dash.Id {
alert.DashbboardUri = dash.GenerateUrl() alert.Url = dash.GenerateUrl()
break break
} }
} }
......
...@@ -19,7 +19,7 @@ type AlertRule struct { ...@@ -19,7 +19,7 @@ type AlertRule struct {
EvalDate time.Time `json:"evalDate"` EvalDate time.Time `json:"evalDate"`
EvalData *simplejson.Json `json:"evalData"` EvalData *simplejson.Json `json:"evalData"`
ExecutionError string `json:"executionError"` ExecutionError string `json:"executionError"`
DashbboardUri string `json:"dashboardUri"` Url string `json:"url"`
CanEdit bool `json:"canEdit"` CanEdit bool `json:"canEdit"`
} }
......
...@@ -23,7 +23,7 @@ describe('AlertRuleList', () => { ...@@ -23,7 +23,7 @@ describe('AlertRuleList', () => {
.format(), .format(),
evalData: {}, evalData: {},
executionError: '', executionError: '',
dashboardUri: 'd/ufkcofof/my-goal', url: 'd/ufkcofof/my-goal',
canEdit: true, canEdit: true,
}, },
]) ])
......
...@@ -137,7 +137,7 @@ export class AlertRuleItem extends React.Component<AlertRuleItemProps, any> { ...@@ -137,7 +137,7 @@ export class AlertRuleItem extends React.Component<AlertRuleItemProps, any> {
'fa-pause': !rule.isPaused, 'fa-pause': !rule.isPaused,
}); });
let ruleUrl = `${rule.dashboardUri}?panelId=${rule.panelId}&fullscreen=true&edit=true&tab=alert`; let ruleUrl = `${rule.url}?panelId=${rule.panelId}&fullscreen=true&edit=true&tab=alert`;
return ( return (
<li className="alert-rule-item"> <li className="alert-rule-item">
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<div class="alert-rule-item__body"> <div class="alert-rule-item__body">
<div class="alert-rule-item__header"> <div class="alert-rule-item__header">
<p class="alert-rule-item__name"> <p class="alert-rule-item__name">
<a href="dashboard/{{alert.dashboardUri}}?panelId={{alert.panelId}}&fullscreen&edit&tab=alert"> <a href="{{alert.url}}?panelId={{alert.panelId}}&fullscreen&edit&tab=alert">
{{alert.name}} {{alert.name}}
</a> </a>
</p> </p>
......
...@@ -14,7 +14,7 @@ function getRule(name, state, info) { ...@@ -14,7 +14,7 @@ function getRule(name, state, info) {
.format(), .format(),
evalData: {}, evalData: {},
executionError: '', executionError: '',
dashboardUri: 'db/mygool', url: 'db/mygool',
stateText: state, stateText: state,
stateIcon: 'fa', stateIcon: 'fa',
stateClass: 'asd', stateClass: 'asd',
......
...@@ -13,7 +13,7 @@ export const AlertRule = types ...@@ -13,7 +13,7 @@ export const AlertRule = types
stateClass: types.string, stateClass: types.string,
stateAge: types.string, stateAge: types.string,
info: types.optional(types.string, ''), info: types.optional(types.string, ''),
dashboardUri: types.string, url: types.string,
canEdit: types.boolean, canEdit: types.boolean,
}) })
.views(self => ({ .views(self => ({
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment