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
a6319d17
Commit
a6319d17
authored
Aug 20, 2019
by
Tristan Read
Committed by
Clement Ho
Aug 20, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Embed metrics undefined param fix
parent
b483598b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
2 deletions
+27
-2
app/assets/javascripts/monitoring/components/dashboard.vue
app/assets/javascripts/monitoring/components/dashboard.vue
+2
-2
changelogs/unreleased/tr-param-undefined-fix.yml
changelogs/unreleased/tr-param-undefined-fix.yml
+5
-0
spec/javascripts/monitoring/dashboard_spec.js
spec/javascripts/monitoring/dashboard_spec.js
+20
-0
No files found.
app/assets/javascripts/monitoring/components/dashboard.vue
View file @
a6319d17
...
@@ -264,12 +264,12 @@ export default {
...
@@ -264,12 +264,12 @@ export default {
showToast
()
{
showToast
()
{
this
.
$toast
.
show
(
__
(
'
Link copied to clipboard
'
));
this
.
$toast
.
show
(
__
(
'
Link copied to clipboard
'
));
},
},
// TODO: END
generateLink
(
group
,
title
,
yLabel
)
{
generateLink
(
group
,
title
,
yLabel
)
{
const
dashboard
=
this
.
currentDashboard
||
this
.
firstDashboard
.
path
;
const
dashboard
=
this
.
currentDashboard
||
this
.
firstDashboard
.
path
;
const
params
=
{
dashboard
,
group
,
title
,
y_label
:
yLabel
}
;
const
params
=
_
.
pick
({
dashboard
,
group
,
title
,
y_label
:
yLabel
},
value
=>
value
!=
null
)
;
return
mergeUrlParams
(
params
,
window
.
location
.
href
);
return
mergeUrlParams
(
params
,
window
.
location
.
href
);
},
},
// TODO: END
hideAddMetricModal
()
{
hideAddMetricModal
()
{
this
.
$refs
.
addMetricModal
.
hide
();
this
.
$refs
.
addMetricModal
.
hide
();
},
},
...
...
changelogs/unreleased/tr-param-undefined-fix.yml
0 → 100644
View file @
a6319d17
---
title
:
Fix for embedded metrics undefined params
merge_request
:
31975
author
:
type
:
fixed
spec/javascripts/monitoring/dashboard_spec.js
View file @
a6319d17
...
@@ -414,6 +414,26 @@ describe('Dashboard', () => {
...
@@ -414,6 +414,26 @@ describe('Dashboard', () => {
expect
(
clipboardText
()).
toContain
(
`y_label=`
);
expect
(
clipboardText
()).
toContain
(
`y_label=`
);
});
});
it
(
'
undefined parameter is stripped
'
,
done
=>
{
wrapper
.
setProps
({
currentDashboard
:
undefined
});
wrapper
.
vm
.
$nextTick
(()
=>
{
expect
(
clipboardText
()).
not
.
toContain
(
`dashboard=`
);
expect
(
clipboardText
()).
toContain
(
`y_label=`
);
done
();
});
});
it
(
'
null parameter is stripped
'
,
done
=>
{
wrapper
.
setProps
({
currentDashboard
:
null
});
wrapper
.
vm
.
$nextTick
(()
=>
{
expect
(
clipboardText
()).
not
.
toContain
(
`dashboard=`
);
expect
(
clipboardText
()).
toContain
(
`y_label=`
);
done
();
});
});
it
(
'
creates a toast when clicked
'
,
()
=>
{
it
(
'
creates a toast when clicked
'
,
()
=>
{
spyOn
(
wrapper
.
vm
.
$toast
,
'
show
'
).
and
.
stub
();
spyOn
(
wrapper
.
vm
.
$toast
,
'
show
'
).
and
.
stub
();
...
...
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