Commit 95cbe90e authored by Adriel Santiago's avatar Adriel Santiago Committed by Kushal Pandya

Remove auto-appended units

Remove duplicate units from metrics dashboard graphs
parent a40bb1e8
...@@ -139,8 +139,7 @@ export default { ...@@ -139,8 +139,7 @@ export default {
return this.graphData.queries.map(query => query.label).join(', '); return this.graphData.queries.map(query => query.label).join(', ');
}, },
yAxisLabel() { yAxisLabel() {
const [query] = this.graphData.queries; return `${this.graphData.y_label}`;
return `${this.graphData.y_label} (${query.unit})`;
}, },
}, },
watch: { watch: {
......
---
title: Remove duplicate units from metrics graph
merge_request: 25485
author:
type: fixed
...@@ -127,7 +127,7 @@ describe('Area component', () => { ...@@ -127,7 +127,7 @@ describe('Area component', () => {
}); });
it('formats tooltip content', () => { it('formats tooltip content', () => {
expect(areaChart.vm.tooltip.content).toBe('CPU (Cores) 5.556'); expect(areaChart.vm.tooltip.content).toBe('CPU 5.556');
}); });
}); });
...@@ -213,7 +213,7 @@ describe('Area component', () => { ...@@ -213,7 +213,7 @@ describe('Area component', () => {
describe('yAxisLabel', () => { describe('yAxisLabel', () => {
it('constructs a label for the chart y-axis', () => { it('constructs a label for the chart y-axis', () => {
expect(areaChart.vm.yAxisLabel).toBe('CPU (Cores)'); expect(areaChart.vm.yAxisLabel).toBe('CPU');
}); });
}); });
}); });
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment