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
1c9a1820
Commit
1c9a1820
authored
Aug 24, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
632c6a10
b15f0388
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
29 additions
and
15 deletions
+29
-15
app/assets/javascripts/monitoring/components/charts/time_series.vue
.../javascripts/monitoring/components/charts/time_series.vue
+9
-1
app/assets/javascripts/monitoring/components/embed.vue
app/assets/javascripts/monitoring/components/embed.vue
+3
-3
app/assets/javascripts/monitoring/components/panel_type.vue
app/assets/javascripts/monitoring/components/panel_type.vue
+4
-4
changelogs/unreleased/66073-use-time-series-chart-instead-of-area-chart-in-panel_types.yml
...ime-series-chart-instead-of-area-chart-in-panel_types.yml
+5
-0
spec/frontend/monitoring/embed/embed_spec.js
spec/frontend/monitoring/embed/embed_spec.js
+4
-4
spec/javascripts/monitoring/panel_type_spec.js
spec/javascripts/monitoring/panel_type_spec.js
+4
-3
No files found.
app/assets/javascripts/monitoring/components/charts/time_series.vue
View file @
1c9a1820
...
@@ -48,6 +48,11 @@ export default {
...
@@ -48,6 +48,11 @@ export default {
required
:
false
,
required
:
false
,
default
:
false
,
default
:
false
,
},
},
singleEmbed
:
{
type
:
Boolean
,
required
:
false
,
default
:
false
,
},
thresholds
:
{
thresholds
:
{
type
:
Array
,
type
:
Array
,
required
:
false
,
required
:
false
,
...
@@ -267,7 +272,10 @@ export default {
...
@@ -267,7 +272,10 @@ export default {
</
script
>
</
script
>
<
template
>
<
template
>
<div
class=
"prometheus-graph col-12 col-lg-6"
:class=
"[showBorder ? 'p-2' : 'p-0']"
>
<div
class=
"prometheus-graph col-12"
:class=
"[showBorder ? 'p-2' : 'p-0',
{ 'col-lg-6': !singleEmbed }]"
>
<div
:class=
"
{ 'prometheus-graph-embed w-100 p-3': showBorder }">
<div
:class=
"
{ 'prometheus-graph-embed w-100 p-3': showBorder }">
<div
class=
"prometheus-graph-header"
>
<div
class=
"prometheus-graph-header"
>
<h5
class=
"prometheus-graph-title js-graph-title"
>
{{
graphData
.
title
}}
</h5>
<h5
class=
"prometheus-graph-title js-graph-title"
>
{{
graphData
.
title
}}
</h5>
...
...
app/assets/javascripts/monitoring/components/embed.vue
View file @
1c9a1820
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
import
{
mapActions
,
mapState
}
from
'
vuex
'
;
import
{
mapActions
,
mapState
}
from
'
vuex
'
;
import
{
getParameterValues
,
removeParams
}
from
'
~/lib/utils/url_utility
'
;
import
{
getParameterValues
,
removeParams
}
from
'
~/lib/utils/url_utility
'
;
import
GraphGroup
from
'
./graph_group.vue
'
;
import
GraphGroup
from
'
./graph_group.vue
'
;
import
Monitor
AreaChart
from
'
./charts/area
.vue
'
;
import
Monitor
TimeSeriesChart
from
'
./charts/time_series
.vue
'
;
import
{
sidebarAnimationDuration
}
from
'
../constants
'
;
import
{
sidebarAnimationDuration
}
from
'
../constants
'
;
import
{
getTimeDiff
}
from
'
../utils
'
;
import
{
getTimeDiff
}
from
'
../utils
'
;
...
@@ -11,7 +11,7 @@ let sidebarMutationObserver;
...
@@ -11,7 +11,7 @@ let sidebarMutationObserver;
export
default
{
export
default
{
components
:
{
components
:
{
GraphGroup
,
GraphGroup
,
Monitor
Area
Chart
,
Monitor
TimeSeries
Chart
,
},
},
props
:
{
props
:
{
dashboardUrl
:
{
dashboardUrl
:
{
...
@@ -92,7 +92,7 @@ export default {
...
@@ -92,7 +92,7 @@ export default {
<
template
>
<
template
>
<div
class=
"metrics-embed"
:class=
"
{ 'd-inline-flex col-lg-6 p-0': isSingleChart }">
<div
class=
"metrics-embed"
:class=
"
{ 'd-inline-flex col-lg-6 p-0': isSingleChart }">
<div
v-if=
"charts.length"
class=
"row w-100 m-n2 pb-4"
>
<div
v-if=
"charts.length"
class=
"row w-100 m-n2 pb-4"
>
<monitor-
area
-chart
<monitor-
time-series
-chart
v-for=
"graphData in charts"
v-for=
"graphData in charts"
:key=
"graphData.title"
:key=
"graphData.title"
:graph-data=
"graphData"
:graph-data=
"graphData"
...
...
app/assets/javascripts/monitoring/components/panel_type.vue
View file @
1c9a1820
...
@@ -10,14 +10,14 @@ import {
...
@@ -10,14 +10,14 @@ import {
GlTooltipDirective
,
GlTooltipDirective
,
}
from
'
@gitlab/ui
'
;
}
from
'
@gitlab/ui
'
;
import
Icon
from
'
~/vue_shared/components/icon.vue
'
;
import
Icon
from
'
~/vue_shared/components/icon.vue
'
;
import
Monitor
AreaChart
from
'
./charts/area
.vue
'
;
import
Monitor
TimeSeriesChart
from
'
./charts/time_series
.vue
'
;
import
MonitorSingleStatChart
from
'
./charts/single_stat.vue
'
;
import
MonitorSingleStatChart
from
'
./charts/single_stat.vue
'
;
import
MonitorEmptyChart
from
'
./charts/empty_chart.vue
'
;
import
MonitorEmptyChart
from
'
./charts/empty_chart.vue
'
;
export
default
{
export
default
{
components
:
{
components
:
{
MonitorAreaChart
,
MonitorSingleStatChart
,
MonitorSingleStatChart
,
MonitorTimeSeriesChart
,
MonitorEmptyChart
,
MonitorEmptyChart
,
Icon
,
Icon
,
GlDropdown
,
GlDropdown
,
...
@@ -92,7 +92,7 @@ export default {
...
@@ -92,7 +92,7 @@ export default {
v-if=
"isPanelType('single-stat') && graphDataHasMetrics"
v-if=
"isPanelType('single-stat') && graphDataHasMetrics"
:graph-data=
"graphData"
:graph-data=
"graphData"
/>
/>
<monitor-
area
-chart
<monitor-
time-series
-chart
v-else-if=
"graphDataHasMetrics"
v-else-if=
"graphDataHasMetrics"
:graph-data=
"graphData"
:graph-data=
"graphData"
:deployment-data=
"deploymentData"
:deployment-data=
"deploymentData"
...
@@ -136,6 +136,6 @@ export default {
...
@@ -136,6 +136,6 @@ export default {
</gl-dropdown-item>
</gl-dropdown-item>
</gl-dropdown>
</gl-dropdown>
</div>
</div>
</monitor-
area
-chart>
</monitor-
time-series
-chart>
<monitor-empty-chart
v-else
:graph-title=
"graphData.title"
/>
<monitor-empty-chart
v-else
:graph-title=
"graphData.title"
/>
</template>
</template>
changelogs/unreleased/66073-use-time-series-chart-instead-of-area-chart-in-panel_types.yml
0 → 100644
View file @
1c9a1820
---
title
:
Enable line charts in dashbaord panels and embedded charts
merge_request
:
31920
author
:
type
:
added
spec/frontend/monitoring/embed/embed_spec.js
View file @
1c9a1820
import
{
createLocalVue
,
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
createLocalVue
,
shallowMount
}
from
'
@vue/test-utils
'
;
import
Vuex
from
'
vuex
'
;
import
Vuex
from
'
vuex
'
;
import
Embed
from
'
~/monitoring/components/embed.vue
'
;
import
Embed
from
'
~/monitoring/components/embed.vue
'
;
import
Monitor
AreaChart
from
'
~/monitoring/components/charts/area
.vue
'
;
import
Monitor
TimeSeriesChart
from
'
~/monitoring/components/charts/time_series
.vue
'
;
import
{
TEST_HOST
}
from
'
helpers/test_constants
'
;
import
{
TEST_HOST
}
from
'
helpers/test_constants
'
;
import
{
groups
,
initialState
,
metricsData
,
metricsWithData
}
from
'
./mock_data
'
;
import
{
groups
,
initialState
,
metricsData
,
metricsWithData
}
from
'
./mock_data
'
;
...
@@ -55,7 +55,7 @@ describe('Embed', () => {
...
@@ -55,7 +55,7 @@ describe('Embed', () => {
it
(
'
shows an empty state when no metrics are present
'
,
()
=>
{
it
(
'
shows an empty state when no metrics are present
'
,
()
=>
{
expect
(
wrapper
.
find
(
'
.metrics-embed
'
).
exists
()).
toBe
(
true
);
expect
(
wrapper
.
find
(
'
.metrics-embed
'
).
exists
()).
toBe
(
true
);
expect
(
wrapper
.
find
(
Monitor
Area
Chart
).
exists
()).
toBe
(
false
);
expect
(
wrapper
.
find
(
Monitor
TimeSeries
Chart
).
exists
()).
toBe
(
false
);
});
});
});
});
...
@@ -71,8 +71,8 @@ describe('Embed', () => {
...
@@ -71,8 +71,8 @@ describe('Embed', () => {
it
(
'
shows a chart when metrics are present
'
,
()
=>
{
it
(
'
shows a chart when metrics are present
'
,
()
=>
{
wrapper
.
setProps
({});
wrapper
.
setProps
({});
expect
(
wrapper
.
find
(
'
.metrics-embed
'
).
exists
()).
toBe
(
true
);
expect
(
wrapper
.
find
(
'
.metrics-embed
'
).
exists
()).
toBe
(
true
);
expect
(
wrapper
.
find
(
Monitor
Area
Chart
).
exists
()).
toBe
(
true
);
expect
(
wrapper
.
find
(
Monitor
TimeSeries
Chart
).
exists
()).
toBe
(
true
);
expect
(
wrapper
.
findAll
(
Monitor
Area
Chart
).
length
).
toBe
(
2
);
expect
(
wrapper
.
findAll
(
Monitor
TimeSeries
Chart
).
length
).
toBe
(
2
);
});
});
});
});
});
});
spec/javascripts/monitoring/panel_type_spec.js
View file @
1c9a1820
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
PanelType
from
'
~/monitoring/components/panel_type.vue
'
;
import
PanelType
from
'
~/monitoring/components/panel_type.vue
'
;
import
EmptyChart
from
'
~/monitoring/components/charts/empty_chart.vue
'
;
import
EmptyChart
from
'
~/monitoring/components/charts/empty_chart.vue
'
;
import
AreaChart
from
'
~/monitoring/components/charts/area
.vue
'
;
import
TimeSeriesChart
from
'
~/monitoring/components/charts/time_series
.vue
'
;
import
{
graphDataPrometheusQueryRange
}
from
'
./mock_data
'
;
import
{
graphDataPrometheusQueryRange
}
from
'
./mock_data
'
;
import
{
createStore
}
from
'
~/monitoring/stores
'
;
import
{
createStore
}
from
'
~/monitoring/stores
'
;
...
@@ -62,9 +62,10 @@ describe('Panel Type component', () => {
...
@@ -62,9 +62,10 @@ describe('Panel Type component', () => {
});
});
});
});
describe
(
'
Area
Chart panel type
'
,
()
=>
{
describe
(
'
Time Series
Chart panel type
'
,
()
=>
{
it
(
'
is rendered
'
,
()
=>
{
it
(
'
is rendered
'
,
()
=>
{
expect
(
panelType
.
find
(
AreaChart
).
exists
()).
toBe
(
true
);
expect
(
panelType
.
find
(
TimeSeriesChart
).
isVueInstance
()).
toBe
(
true
);
expect
(
panelType
.
find
(
TimeSeriesChart
).
exists
()).
toBe
(
true
);
});
});
it
(
'
sets clipboard text on the dropdown
'
,
()
=>
{
it
(
'
sets clipboard text on the dropdown
'
,
()
=>
{
...
...
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