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
0eb9988e
Commit
0eb9988e
authored
Jun 27, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
37e5bbd5
50b69083
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
6 deletions
+29
-6
app/assets/javascripts/monitoring/components/charts/area.vue
app/assets/javascripts/monitoring/components/charts/area.vue
+11
-3
app/assets/javascripts/monitoring/components/dashboard.vue
app/assets/javascripts/monitoring/components/dashboard.vue
+1
-0
changelogs/unreleased/11888-regression-deploy-correlation-markers-on-monitoring-graphs-not-clickable.yml
...orrelation-markers-on-monitoring-graphs-not-clickable.yml
+5
-0
spec/javascripts/monitoring/charts/area_spec.js
spec/javascripts/monitoring/charts/area_spec.js
+12
-3
No files found.
app/assets/javascripts/monitoring/components/charts/area.vue
View file @
0eb9988e
<
script
>
import
{
__
}
from
'
~/locale
'
;
import
{
GlLink
}
from
'
@gitlab/ui
'
;
import
{
GlAreaChart
,
GlChartSeriesLabel
}
from
'
@gitlab/ui/dist/charts
'
;
import
dateFormat
from
'
dateformat
'
;
import
{
debounceByAnimationFrame
,
roundOffFloat
}
from
'
~/lib/utils/common_utils
'
;
...
...
@@ -14,6 +15,7 @@ export default {
components
:
{
GlAreaChart
,
GlChartSeriesLabel
,
GlLink
,
Icon
,
},
inheritAttrs
:
false
,
...
...
@@ -44,6 +46,10 @@ export default {
required
:
false
,
default
:
()
=>
[],
},
projectPath
:
{
type
:
String
,
required
:
true
,
},
thresholds
:
{
type
:
Array
,
required
:
false
,
...
...
@@ -55,6 +61,7 @@ export default {
tooltip
:
{
title
:
''
,
content
:
[],
commitUrl
:
''
,
isDeployment
:
false
,
sha
:
''
,
},
...
...
@@ -195,12 +202,13 @@ export default {
this
.
tooltip
.
title
=
dateFormat
(
params
.
value
,
'
dd mmm yyyy, h:MMTT
'
);
this
.
tooltip
.
content
=
[];
params
.
seriesData
.
forEach
(
seriesData
=>
{
if
(
seriesData
.
componentSubType
===
graphTypes
.
deploymentData
)
{
this
.
tooltip
.
isDeployment
=
true
;
this
.
tooltip
.
isDeployment
=
seriesData
.
componentSubType
===
graphTypes
.
deploymentData
;
if
(
this
.
tooltip
.
isDeployment
)
{
const
[
deploy
]
=
this
.
recentDeployments
.
filter
(
deployment
=>
deployment
.
createdAt
===
seriesData
.
value
[
0
],
);
this
.
tooltip
.
sha
=
deploy
.
sha
.
substring
(
0
,
8
);
this
.
tooltip
.
commitUrl
=
deploy
.
commitUrl
;
}
else
{
const
{
seriesName
,
color
}
=
seriesData
;
// seriesData.value contains the chart's [x, y] value pair
...
...
@@ -259,7 +267,7 @@ export default {
</
template
>
<div
slot=
"tooltipContent"
class=
"d-flex align-items-center"
>
<icon
name=
"commit"
class=
"mr-2"
/>
{{ tooltip.sha }}
<gl-link
:href=
"tooltip.commitUrl"
>
{{ tooltip.sha }}
</gl-link>
</div>
</template>
<
template
v-else
>
...
...
app/assets/javascripts/monitoring/components/dashboard.vue
View file @
0eb9988e
...
...
@@ -359,6 +359,7 @@ export default {
<monitor-area-chart
v-for=
"(graphData, graphIndex) in chartsWithData(groupData.metrics)"
:key=
"graphIndex"
:project-path=
"projectPath"
:graph-data=
"graphData"
:deployment-data=
"deploymentData"
:thresholds=
"getGraphAlertValues(graphData.queries)"
...
...
changelogs/unreleased/11888-regression-deploy-correlation-markers-on-monitoring-graphs-not-clickable.yml
0 → 100644
View file @
0eb9988e
---
title
:
Turn commit sha in monitor charts popover to link
merge_request
:
29914
author
:
type
:
fixed
spec/javascripts/monitoring/charts/area_spec.js
View file @
0eb9988e
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
GlLink
}
from
'
@gitlab/ui
'
;
import
{
GlAreaChart
,
GlChartSeriesLabel
}
from
'
@gitlab/ui/dist/charts
'
;
import
{
shallowWrapperContainsSlotText
}
from
'
spec/helpers/vue_test_utils_helper
'
;
import
Area
from
'
~/monitoring/components/charts/area.vue
'
;
import
{
createStore
}
from
'
~/monitoring/stores
'
;
import
*
as
types
from
'
~/monitoring/stores/mutation_types
'
;
import
{
TEST_HOST
}
from
'
spec/test_constants
'
;
import
MonitoringMock
,
{
deploymentData
}
from
'
../mock_data
'
;
describe
(
'
Area component
'
,
()
=>
{
const
mockSha
=
'
mockSha
'
;
const
mockWidgets
=
'
mockWidgets
'
;
const
mockSvgPathContent
=
'
mockSvgPathContent
'
;
const
projectPath
=
`
${
TEST_HOST
}
/path/to/project`
;
const
commitUrl
=
`
${
projectPath
}
/commit/
${
mockSha
}
`
;
let
mockGraphData
;
let
areaChart
;
let
spriteSpy
;
...
...
@@ -26,6 +31,7 @@ describe('Area component', () => {
graphData
:
mockGraphData
,
containerWidth
:
0
,
deploymentData
:
store
.
state
.
monitoringDashboard
.
deploymentData
,
projectPath
,
},
slots
:
{
default
:
mockWidgets
,
...
...
@@ -88,11 +94,14 @@ describe('Area component', () => {
);
});
it
(
'
renders commit sha in tooltip content
'
,
()
=>
{
const
mockSha
=
'
mockSha
'
;
it
(
'
renders clickable commit sha in tooltip content
'
,
()
=>
{
areaChart
.
vm
.
tooltip
.
sha
=
mockSha
;
areaChart
.
vm
.
tooltip
.
commitUrl
=
commitUrl
;
const
commitLink
=
areaChart
.
find
(
GlLink
);
expect
(
shallowWrapperContainsSlotText
(
glAreaChart
,
'
tooltipContent
'
,
mockSha
)).
toBe
(
true
);
expect
(
shallowWrapperContainsSlotText
(
commitLink
,
'
default
'
,
mockSha
)).
toBe
(
true
);
expect
(
commitLink
.
attributes
(
'
href
'
)).
toEqual
(
commitUrl
);
});
});
});
...
...
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