Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
eed3c858
Commit
eed3c858
authored
Nov 18, 2019
by
Dhiraj Bodicherla
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix monitor charts zoom error
Monitor dashboard charts throw error when zoomed quickly and breaks the page
parent
689b6ee3
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
17 deletions
+37
-17
app/assets/javascripts/monitoring/components/charts/time_series.vue
.../javascripts/monitoring/components/charts/time_series.vue
+19
-17
changelogs/unreleased/32780-when-zooming-metrics-at-some-point-we-can-t-adjust-the-zoom-any-fur.yml
...etrics-at-some-point-we-can-t-adjust-the-zoom-any-fur.yml
+5
-0
spec/frontend/monitoring/charts/time_series_spec.js
spec/frontend/monitoring/charts/time_series_spec.js
+13
-0
No files found.
app/assets/javascripts/monitoring/components/charts/time_series.vue
View file @
eed3c858
...
@@ -253,6 +253,7 @@ export default {
...
@@ -253,6 +253,7 @@ export default {
this
.
tooltip
.
title
=
dateFormat
(
params
.
value
,
dateFormats
.
default
);
this
.
tooltip
.
title
=
dateFormat
(
params
.
value
,
dateFormats
.
default
);
this
.
tooltip
.
content
=
[];
this
.
tooltip
.
content
=
[];
params
.
seriesData
.
forEach
(
dataPoint
=>
{
params
.
seriesData
.
forEach
(
dataPoint
=>
{
if
(
dataPoint
.
value
)
{
const
[
xVal
,
yVal
]
=
dataPoint
.
value
;
const
[
xVal
,
yVal
]
=
dataPoint
.
value
;
this
.
tooltip
.
isDeployment
=
dataPoint
.
componentSubType
===
graphTypes
.
deploymentData
;
this
.
tooltip
.
isDeployment
=
dataPoint
.
componentSubType
===
graphTypes
.
deploymentData
;
if
(
this
.
tooltip
.
isDeployment
)
{
if
(
this
.
tooltip
.
isDeployment
)
{
...
@@ -271,6 +272,7 @@ export default {
...
@@ -271,6 +272,7 @@ export default {
color
,
color
,
});
});
}
}
}
});
});
},
},
setSvg
(
name
)
{
setSvg
(
name
)
{
...
...
changelogs/unreleased/32780-when-zooming-metrics-at-some-point-we-can-t-adjust-the-zoom-any-fur.yml
0 → 100644
View file @
eed3c858
---
title
:
Fixed monitor charts from throwing error when zoomed
merge_request
:
20331
author
:
type
:
fixed
spec/frontend/monitoring/charts/time_series_spec.js
View file @
eed3c858
...
@@ -116,6 +116,19 @@ describe('Time series component', () => {
...
@@ -116,6 +116,19 @@ describe('Time series component', () => {
});
});
});
});
it
(
'
does not throw error if data point is outside the zoom range
'
,
()
=>
{
const
seriesDataWithoutValue
=
generateSeriesData
(
'
line
'
);
expect
(
timeSeriesChart
.
vm
.
formatTooltipText
({
...
seriesDataWithoutValue
,
seriesData
:
seriesDataWithoutValue
.
seriesData
.
map
(
data
=>
({
...
data
,
value
:
undefined
,
})),
}),
).
toBeUndefined
();
});
describe
(
'
when series is of line type
'
,
()
=>
{
describe
(
'
when series is of line type
'
,
()
=>
{
beforeEach
(
done
=>
{
beforeEach
(
done
=>
{
timeSeriesChart
.
vm
.
formatTooltipText
(
generateSeriesData
(
'
line
'
));
timeSeriesChart
.
vm
.
formatTooltipText
(
generateSeriesData
(
'
line
'
));
...
...
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