diff options
author | Simon Knox <psimyn@gmail.com> | 2019-08-16 23:04:05 +1000 |
---|---|---|
committer | Simon Knox <psimyn@gmail.com> | 2019-08-16 23:04:05 +1000 |
commit | 675639cca8894e386ec5b07807291c6e869a16a7 (patch) | |
tree | bf756909dc9543ee84c0a70a667ea28d334c09a1 | |
parent | d6550ad4f8e4c5663bb5afbe24ddf4c1cec49bdc (diff) | |
download | gitlab-ce-675639cca8894e386ec5b07807291c6e869a16a7.tar.gz |
Remove everything that isn't docs
3 files changed, 14 insertions, 29 deletions
diff --git a/app/assets/javascripts/monitoring/components/charts/area.vue b/app/assets/javascripts/monitoring/components/charts/area.vue index 90c764587a3..838447e6c75 100644 --- a/app/assets/javascripts/monitoring/components/charts/area.vue +++ b/app/assets/javascripts/monitoring/components/charts/area.vue @@ -45,11 +45,6 @@ export default { required: false, default: () => false, }, - singleEmbed: { - type: Boolean, - required: false, - default: false, - }, thresholds: { type: Array, required: false, @@ -245,10 +240,7 @@ export default { </script> <template> - <div - class="prometheus-graph col-12" - :class="[showBorder ? 'p-2' : 'p-0', { 'col-lg-6': !singleEmbed }]" - > + <div class="prometheus-graph col-12 col-lg-6" :class="[showBorder ? 'p-2' : 'p-0']"> <div :class="{ 'prometheus-graph-embed w-100 p-3': showBorder }"> <div class="prometheus-graph-header"> <h5 ref="graphTitle" class="prometheus-graph-title">{{ graphData.title }}</h5> diff --git a/app/assets/javascripts/monitoring/components/embed.vue b/app/assets/javascripts/monitoring/components/embed.vue index 895010f0df8..9e85b0633fe 100644 --- a/app/assets/javascripts/monitoring/components/embed.vue +++ b/app/assets/javascripts/monitoring/components/embed.vue @@ -36,15 +36,12 @@ export default { }, computed: { ...mapState('monitoringDashboard', ['groups', 'metricsWithData']), - charts() { - const groupWithMetrics = this.groups.find(group => - group.metrics.find(chart => this.chartHasData(chart)), - ) || { metrics: [] }; - - return groupWithMetrics.metrics.filter(chart => this.chartHasData(chart)); - }, - isSingleChart() { - return this.charts.length === 1; + groupData() { + const groupsWithData = this.groups.filter(group => this.chartsWithData(group.metrics).length); + if (groupsWithData.length) { + return groupsWithData[0]; + } + return null; }, }, mounted() { @@ -69,8 +66,10 @@ export default { 'setFeatureFlags', 'setShowErrorBanner', ]), - chartHasData(chart) { - return chart.metrics.some(metric => this.metricsWithData.includes(metric.metric_id)); + chartsWithData(charts) { + return charts.filter(chart => + chart.metrics.some(metric => this.metricsWithData.includes(metric.metric_id)), + ); }, onSidebarMutation() { setTimeout(() => { @@ -90,17 +89,16 @@ export default { }; </script> <template> - <div class="metrics-embed" :class="{ 'd-inline-flex col-lg-6 p-0': isSingleChart }"> - <div v-if="charts" class="row w-100 m-n2 pb-4"> + <div class="metrics-embed"> + <div v-if="groupData" class="row w-100 m-n2 pb-4"> <monitor-area-chart - v-for="graphData in charts" + v-for="graphData in chartsWithData(groupData.metrics)" :key="graphData.title" :graph-data="graphData" :container-width="elWidth" group-id="monitor-area-chart" :project-path="null" :show-border="true" - :single-embed="isSingleChart" /> </div> </div> diff --git a/changelogs/unreleased/62971-embed-specific-metrics-chart-in-issue.yml b/changelogs/unreleased/62971-embed-specific-metrics-chart-in-issue.yml deleted file mode 100644 index 01ca8e60477..00000000000 --- a/changelogs/unreleased/62971-embed-specific-metrics-chart-in-issue.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -title: styles for embedding specific metrics chart in issue -merge_request: 31644 -author: -type: added |