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
836cf8e6
Commit
836cf8e6
authored
Nov 18, 2019
by
Gabriel Kent
Committed by
Ryan McKinley
Nov 18, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Dashboard Migrator: persist thresholds param if already set (#20458)
parent
d02f4ea6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
1 deletions
+24
-1
public/app/features/dashboard/state/DashboardMigrator.test.ts
+21
-0
public/app/features/dashboard/state/DashboardMigrator.ts
+3
-1
No files found.
public/app/features/dashboard/state/DashboardMigrator.test.ts
View file @
836cf8e6
...
...
@@ -139,6 +139,27 @@ describe('DashboardModel', () => {
expect
(
graph
.
thresholds
[
1
].
value
).
toBe
(
400
);
expect
(
graph
.
thresholds
[
1
].
fillColor
).
toBe
(
'red'
);
});
it
(
'graph thresholds should be migrated onto specified thresholds'
,
()
=>
{
model
=
new
DashboardModel
({
panels
:
[
{
type
:
'graph'
,
y_formats
:
[
'kbyte'
,
'ms'
],
grid
:
{
threshold1
:
200
,
threshold2
:
400
,
},
thresholds
:
[{
value
:
100
}],
},
],
});
graph
=
model
.
panels
[
0
];
expect
(
graph
.
thresholds
.
length
).
toBe
(
3
);
expect
(
graph
.
thresholds
[
0
].
value
).
toBe
(
100
);
expect
(
graph
.
thresholds
[
1
].
value
).
toBe
(
200
);
expect
(
graph
.
thresholds
[
2
].
value
).
toBe
(
400
);
});
});
describe
(
'when migrating to the grid layout'
,
()
=>
{
...
...
public/app/features/dashboard/state/DashboardMigrator.ts
View file @
836cf8e6
...
...
@@ -316,7 +316,9 @@ export class DashboardMigrator {
return
;
}
panel
.
thresholds
=
[];
if
(
!
panel
.
thresholds
)
{
panel
.
thresholds
=
[];
}
const
t1
:
any
=
{},
t2
:
any
=
{};
...
...
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