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
>
<
script
>
import
{
__
}
from
'
~/locale
'
;
import
{
__
}
from
'
~/locale
'
;
import
{
GlLink
}
from
'
@gitlab/ui
'
;
import
{
GlAreaChart
,
GlChartSeriesLabel
}
from
'
@gitlab/ui/dist/charts
'
;
import
{
GlAreaChart
,
GlChartSeriesLabel
}
from
'
@gitlab/ui/dist/charts
'
;
import
dateFormat
from
'
dateformat
'
;
import
dateFormat
from
'
dateformat
'
;
import
{
debounceByAnimationFrame
,
roundOffFloat
}
from
'
~/lib/utils/common_utils
'
;
import
{
debounceByAnimationFrame
,
roundOffFloat
}
from
'
~/lib/utils/common_utils
'
;
...
@@ -14,6 +15,7 @@ export default {
...
@@ -14,6 +15,7 @@ export default {
components
:
{
components
:
{
GlAreaChart
,
GlAreaChart
,
GlChartSeriesLabel
,
GlChartSeriesLabel
,
GlLink
,
Icon
,
Icon
,
},
},
inheritAttrs
:
false
,
inheritAttrs
:
false
,
...
@@ -44,6 +46,10 @@ export default {
...
@@ -44,6 +46,10 @@ export default {
required
:
false
,
required
:
false
,
default
:
()
=>
[],
default
:
()
=>
[],
},
},
projectPath
:
{
type
:
String
,
required
:
true
,
},
thresholds
:
{
thresholds
:
{
type
:
Array
,
type
:
Array
,
required
:
false
,
required
:
false
,
...
@@ -55,6 +61,7 @@ export default {
...
@@ -55,6 +61,7 @@ export default {
tooltip
:
{
tooltip
:
{
title
:
''
,
title
:
''
,
content
:
[],
content
:
[],
commitUrl
:
''
,
isDeployment
:
false
,
isDeployment
:
false
,
sha
:
''
,
sha
:
''
,
},
},
...
@@ -195,12 +202,13 @@ export default {
...
@@ -195,12 +202,13 @@ export default {
this
.
tooltip
.
title
=
dateFormat
(
params
.
value
,
'
dd mmm yyyy, h:MMTT
'
);
this
.
tooltip
.
title
=
dateFormat
(
params
.
value
,
'
dd mmm yyyy, h:MMTT
'
);
this
.
tooltip
.
content
=
[];
this
.
tooltip
.
content
=
[];
params
.
seriesData
.
forEach
(
seriesData
=>
{
params
.
seriesData
.
forEach
(
seriesData
=>
{
if
(
seriesData
.
componentSubType
===
graphTypes
.
deploymentData
)
{
this
.
tooltip
.
isDeployment
=
seriesData
.
componentSubType
===
graphTypes
.
deploymentData
;
this
.
tooltip
.
isDeployment
=
true
;
if
(
this
.
tooltip
.
isDeployment
)
{
const
[
deploy
]
=
this
.
recentDeployments
.
filter
(
const
[
deploy
]
=
this
.
recentDeployments
.
filter
(
deployment
=>
deployment
.
createdAt
===
seriesData
.
value
[
0
],
deployment
=>
deployment
.
createdAt
===
seriesData
.
value
[
0
],
);
);
this
.
tooltip
.
sha
=
deploy
.
sha
.
substring
(
0
,
8
);
this
.
tooltip
.
sha
=
deploy
.
sha
.
substring
(
0
,
8
);
this
.
tooltip
.
commitUrl
=
deploy
.
commitUrl
;
}
else
{
}
else
{
const
{
seriesName
,
color
}
=
seriesData
;
const
{
seriesName
,
color
}
=
seriesData
;
// seriesData.value contains the chart's [x, y] value pair
// seriesData.value contains the chart's [x, y] value pair
...
@@ -259,7 +267,7 @@ export default {
...
@@ -259,7 +267,7 @@ export default {
</
template
>
</
template
>
<div
slot=
"tooltipContent"
class=
"d-flex align-items-center"
>
<div
slot=
"tooltipContent"
class=
"d-flex align-items-center"
>
<icon
name=
"commit"
class=
"mr-2"
/>
<icon
name=
"commit"
class=
"mr-2"
/>
{{ tooltip.sha }}
<gl-link
:href=
"tooltip.commitUrl"
>
{{ tooltip.sha }}
</gl-link>
</div>
</div>
</template>
</template>
<
template
v-else
>
<
template
v-else
>
...
...
app/assets/javascripts/monitoring/components/dashboard.vue
View file @
0eb9988e
...
@@ -359,6 +359,7 @@ export default {
...
@@ -359,6 +359,7 @@ export default {
<monitor-area-chart
<monitor-area-chart
v-for=
"(graphData, graphIndex) in chartsWithData(groupData.metrics)"
v-for=
"(graphData, graphIndex) in chartsWithData(groupData.metrics)"
:key=
"graphIndex"
:key=
"graphIndex"
:project-path=
"projectPath"
:graph-data=
"graphData"
:graph-data=
"graphData"
:deployment-data=
"deploymentData"
:deployment-data=
"deploymentData"
:thresholds=
"getGraphAlertValues(graphData.queries)"
: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
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
GlLink
}
from
'
@gitlab/ui
'
;
import
{
GlAreaChart
,
GlChartSeriesLabel
}
from
'
@gitlab/ui/dist/charts
'
;
import
{
GlAreaChart
,
GlChartSeriesLabel
}
from
'
@gitlab/ui/dist/charts
'
;
import
{
shallowWrapperContainsSlotText
}
from
'
spec/helpers/vue_test_utils_helper
'
;
import
{
shallowWrapperContainsSlotText
}
from
'
spec/helpers/vue_test_utils_helper
'
;
import
Area
from
'
~/monitoring/components/charts/area.vue
'
;
import
Area
from
'
~/monitoring/components/charts/area.vue
'
;
import
{
createStore
}
from
'
~/monitoring/stores
'
;
import
{
createStore
}
from
'
~/monitoring/stores
'
;
import
*
as
types
from
'
~/monitoring/stores/mutation_types
'
;
import
*
as
types
from
'
~/monitoring/stores/mutation_types
'
;
import
{
TEST_HOST
}
from
'
spec/test_constants
'
;
import
MonitoringMock
,
{
deploymentData
}
from
'
../mock_data
'
;
import
MonitoringMock
,
{
deploymentData
}
from
'
../mock_data
'
;
describe
(
'
Area component
'
,
()
=>
{
describe
(
'
Area component
'
,
()
=>
{
const
mockSha
=
'
mockSha
'
;
const
mockWidgets
=
'
mockWidgets
'
;
const
mockWidgets
=
'
mockWidgets
'
;
const
mockSvgPathContent
=
'
mockSvgPathContent
'
;
const
mockSvgPathContent
=
'
mockSvgPathContent
'
;
const
projectPath
=
`
${
TEST_HOST
}
/path/to/project`
;
const
commitUrl
=
`
${
projectPath
}
/commit/
${
mockSha
}
`
;
let
mockGraphData
;
let
mockGraphData
;
let
areaChart
;
let
areaChart
;
let
spriteSpy
;
let
spriteSpy
;
...
@@ -26,6 +31,7 @@ describe('Area component', () => {
...
@@ -26,6 +31,7 @@ describe('Area component', () => {
graphData
:
mockGraphData
,
graphData
:
mockGraphData
,
containerWidth
:
0
,
containerWidth
:
0
,
deploymentData
:
store
.
state
.
monitoringDashboard
.
deploymentData
,
deploymentData
:
store
.
state
.
monitoringDashboard
.
deploymentData
,
projectPath
,
},
},
slots
:
{
slots
:
{
default
:
mockWidgets
,
default
:
mockWidgets
,
...
@@ -88,11 +94,14 @@ describe('Area component', () => {
...
@@ -88,11 +94,14 @@ describe('Area component', () => {
);
);
});
});
it
(
'
renders commit sha in tooltip content
'
,
()
=>
{
it
(
'
renders clickable commit sha in tooltip content
'
,
()
=>
{
const
mockSha
=
'
mockSha
'
;
areaChart
.
vm
.
tooltip
.
sha
=
mockSha
;
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