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
0b1aea90
Commit
0b1aea90
authored
Jan 15, 2019
by
Hugo Häggmark
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed so that we can not change base threshold
parent
aaaf3f7f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
0 deletions
+19
-0
packages/grafana-ui/src/components/ThresholdsEditor/ThresholdsEditor.test.tsx
+15
-0
packages/grafana-ui/src/components/ThresholdsEditor/ThresholdsEditor.tsx
+4
-0
No files found.
packages/grafana-ui/src/components/ThresholdsEditor/ThresholdsEditor.test.tsx
View file @
0b1aea90
...
...
@@ -111,6 +111,21 @@ describe('Remove threshold', () => {
});
describe
(
'change threshold value'
,
()
=>
{
it
(
'should not change threshold at index 0'
,
()
=>
{
const
thresholds
=
[
{
index
:
0
,
value
:
-
Infinity
,
color
:
'#7EB26D'
},
{
index
:
1
,
value
:
50
,
color
:
'#EAB839'
},
{
index
:
2
,
value
:
75
,
color
:
'#6ED0E0'
},
];
const
instance
=
setup
({
thresholds
});
const
mockEvent
=
{
target
:
{
value
:
12
}
};
instance
.
onChangeThresholdValue
(
mockEvent
,
thresholds
[
0
]);
expect
(
instance
.
state
.
thresholds
).
toEqual
(
thresholds
);
});
it
(
'should update value'
,
()
=>
{
const
instance
=
setup
();
const
thresholds
=
[
...
...
packages/grafana-ui/src/components/ThresholdsEditor/ThresholdsEditor.tsx
View file @
0b1aea90
...
...
@@ -91,6 +91,10 @@ export class ThresholdsEditor extends PureComponent<Props, State> {
};
onChangeThresholdValue
=
(
event
:
any
,
threshold
:
Threshold
)
=>
{
if
(
threshold
.
index
===
0
)
{
return
;
}
const
{
thresholds
}
=
this
.
state
;
const
newThresholds
=
thresholds
.
map
(
t
=>
{
...
...
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