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
015ab370
Unverified
Commit
015ab370
authored
Sep 16, 2019
by
Ryan McKinley
Committed by
GitHub
Sep 16, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Alerts: show a warning/error if transformations are configured (#19027)
parent
85e128fe
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
1 deletions
+25
-1
public/app/core/components/AlertBox/AlertBox.tsx
+6
-0
public/app/features/alerting/AlertTab.tsx
+19
-1
No files found.
public/app/core/components/AlertBox/AlertBox.tsx
View file @
015ab370
...
@@ -15,6 +15,12 @@ function getIconFromSeverity(severity: AppNotificationSeverity): string {
...
@@ -15,6 +15,12 @@ function getIconFromSeverity(severity: AppNotificationSeverity): string {
case
AppNotificationSeverity
.
Error
:
{
case
AppNotificationSeverity
.
Error
:
{
return
'fa fa-exclamation-triangle'
;
return
'fa fa-exclamation-triangle'
;
}
}
case
AppNotificationSeverity
.
Warning
:
{
return
'fa fa-exclamation-triangle'
;
}
case
AppNotificationSeverity
.
Info
:
{
return
'fa fa-info-circle'
;
}
case
AppNotificationSeverity
.
Success
:
{
case
AppNotificationSeverity
.
Success
:
{
return
'fa fa-check'
;
return
'fa fa-check'
;
}
}
...
...
public/app/features/alerting/AlertTab.tsx
View file @
015ab370
...
@@ -15,6 +15,8 @@ import 'app/features/alerting/AlertTabCtrl';
...
@@ -15,6 +15,8 @@ import 'app/features/alerting/AlertTabCtrl';
import
{
DashboardModel
}
from
'../dashboard/state/DashboardModel'
;
import
{
DashboardModel
}
from
'../dashboard/state/DashboardModel'
;
import
{
PanelModel
}
from
'../dashboard/state/PanelModel'
;
import
{
PanelModel
}
from
'../dashboard/state/PanelModel'
;
import
{
TestRuleResult
}
from
'./TestRuleResult'
;
import
{
TestRuleResult
}
from
'./TestRuleResult'
;
import
{
AlertBox
}
from
'app/core/components/AlertBox/AlertBox'
;
import
{
AppNotificationSeverity
}
from
'app/types'
;
interface
Props
{
interface
Props
{
angularPanel
?:
AngularComponent
;
angularPanel
?:
AngularComponent
;
...
@@ -127,7 +129,16 @@ export class AlertTab extends PureComponent<Props> {
...
@@ -127,7 +129,16 @@ export class AlertTab extends PureComponent<Props> {
};
};
render
()
{
render
()
{
const
{
alert
}
=
this
.
props
.
panel
;
const
{
alert
,
transformations
}
=
this
.
props
.
panel
;
const
hasTransformations
=
transformations
&&
transformations
.
length
;
if
(
!
alert
&&
hasTransformations
)
{
return
(
<
EditorTabBody
heading=
"Alert"
>
<
AlertBox
severity=
{
AppNotificationSeverity
.
Warning
}
title=
"Transformations are not supported in alert queries"
/>
</
EditorTabBody
>
);
}
const
toolbarItems
=
alert
?
[
this
.
stateHistory
(),
this
.
testRule
(),
this
.
deleteAlert
()]
:
[];
const
toolbarItems
=
alert
?
[
this
.
stateHistory
(),
this
.
testRule
(),
this
.
deleteAlert
()]
:
[];
...
@@ -141,6 +152,13 @@ export class AlertTab extends PureComponent<Props> {
...
@@ -141,6 +152,13 @@ export class AlertTab extends PureComponent<Props> {
return
(
return
(
<
EditorTabBody
heading=
"Alert"
toolbarItems=
{
toolbarItems
}
>
<
EditorTabBody
heading=
"Alert"
toolbarItems=
{
toolbarItems
}
>
<>
<>
{
alert
&&
hasTransformations
&&
(
<
AlertBox
severity=
{
AppNotificationSeverity
.
Error
}
title=
"Transformations are not supported in alert queries"
/>
)
}
<
div
ref=
{
element
=>
(
this
.
element
=
element
)
}
/>
<
div
ref=
{
element
=>
(
this
.
element
=
element
)
}
/>
{
!
alert
&&
<
EmptyListCTA
{
...
model
}
/>
}
{
!
alert
&&
<
EmptyListCTA
{
...
model
}
/>
}
</>
</>
...
...
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