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
1f533ddf
Commit
1f533ddf
authored
Dec 12, 2018
by
Peter Holmberg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixing tests
parent
dbba523d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
10 deletions
+10
-10
public/app/plugins/panel/gauge/Threshold.test.tsx
+9
-9
public/app/plugins/panel/gauge/Thresholds.tsx
+1
-1
No files found.
public/app/plugins/panel/gauge/Threshold.test.tsx
View file @
1f533ddf
import
React
from
'react'
;
import
{
shallow
}
from
'enzyme'
;
import
Thresholds
from
'./Thresholds'
;
import
Thresholds
,
{
BasicGaugeColor
}
from
'./Thresholds'
;
import
{
OptionsProps
}
from
'./module'
;
import
{
PanelOptionsProps
}
from
'../../../types'
;
...
...
@@ -16,9 +16,9 @@ const setup = (propOverrides?: object) => {
};
const
thresholds
=
[
{
index
:
0
,
label
:
'Min'
,
value
:
0
,
canRemove
:
false
,
color
:
'rgba(50, 172, 45, 0.97)'
},
{
index
:
0
,
label
:
'Min'
,
value
:
0
,
canRemove
:
false
,
color
:
BasicGaugeColor
.
Green
},
{
index
:
1
,
label
:
''
,
value
:
50
,
canRemove
:
true
,
color
:
'rgba(237, 129, 40, 0.89)'
},
{
index
:
2
,
label
:
'Max'
,
value
:
100
,
canRemove
:
false
},
{
index
:
2
,
label
:
'Max'
,
value
:
100
,
canRemove
:
false
,
color
:
BasicGaugeColor
.
Red
},
];
describe
(
'Add threshold'
,
()
=>
{
...
...
@@ -28,9 +28,9 @@ describe('Add threshold', () => {
instance
.
onAddThreshold
(
1
);
expect
(
instance
.
state
.
thresholds
).
toEqual
([
{
index
:
0
,
label
:
'Min'
,
value
:
0
,
canRemove
:
false
,
color
:
'rgba(50, 172, 45, 0.97)'
},
{
index
:
1
,
label
:
''
,
value
:
50
,
canRemove
:
true
,
color
:
'rgba(
237, 129, 40, 0.8
9)'
},
{
index
:
2
,
label
:
'Max'
,
value
:
100
,
canRemove
:
false
},
{
index
:
0
,
label
:
'Min'
,
value
:
0
,
canRemove
:
false
,
color
:
BasicGaugeColor
.
Green
},
{
index
:
1
,
label
:
''
,
value
:
50
,
canRemove
:
true
,
color
:
'rgba(
131, 123, 52, 0.9
9)'
},
{
index
:
2
,
label
:
'Max'
,
value
:
100
,
canRemove
:
false
,
color
:
BasicGaugeColor
.
Red
},
]);
});
...
...
@@ -42,10 +42,10 @@ describe('Add threshold', () => {
instance
.
onAddThreshold
(
1
);
expect
(
instance
.
state
.
thresholds
).
toEqual
([
{
index
:
0
,
label
:
'Min'
,
value
:
0
,
canRemove
:
false
,
color
:
'rgba(50, 172, 45, 0.97)'
},
{
index
:
1
,
label
:
''
,
value
:
25
,
canRemove
:
true
,
color
:
'rgba(
237, 129, 40, 0.89
)'
},
{
index
:
0
,
label
:
'Min'
,
value
:
0
,
canRemove
:
false
,
color
:
BasicGaugeColor
.
Green
},
{
index
:
1
,
label
:
''
,
value
:
25
,
canRemove
:
true
,
color
:
'rgba(
144, 151, 43, 0.93
)'
},
{
index
:
2
,
label
:
''
,
value
:
50
,
canRemove
:
true
,
color
:
'rgba(237, 129, 40, 0.89)'
},
{
index
:
3
,
label
:
'Max'
,
value
:
100
,
canRemove
:
false
},
{
index
:
3
,
label
:
'Max'
,
value
:
100
,
canRemove
:
false
,
color
:
BasicGaugeColor
.
Red
},
]);
});
});
...
...
public/app/plugins/panel/gauge/Thresholds.tsx
View file @
1f533ddf
...
...
@@ -9,7 +9,7 @@ interface State {
thresholds
:
Threshold
[];
}
enum
BasicGaugeColor
{
e
xport
e
num
BasicGaugeColor
{
Green
=
'rgba(50, 172, 45, 0.97)'
,
Orange
=
'rgba(237, 129, 40, 0.89)'
,
Red
=
'rgb(212, 74, 58)'
,
...
...
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