From a07796e5e75fea1354110a7ec0af704fabfc6d97 Mon Sep 17 00:00:00 2001 From: Jose Ivan Vargas Date: Tue, 4 Jul 2017 17:03:33 -0500 Subject: Cleanup minor UX issues in the performance dashboard --- .../monitoring/components/monitoring_column.vue | 12 +++++++++--- .../monitoring/components/monitoring_flag.vue | 6 +++--- .../monitoring/components/monitoring_legends.vue | 10 +++++----- .../javascripts/monitoring/utils/measurements.js | 11 ++++++----- app/assets/stylesheets/pages/environments.scss | 20 ++++++++++++++------ ...3-minor-ux-cleanups-for-performance-dashboard.yml | 4 ++++ 6 files changed, 41 insertions(+), 22 deletions(-) create mode 100644 changelogs/unreleased/34653-minor-ux-cleanups-for-performance-dashboard.yml diff --git a/app/assets/javascripts/monitoring/components/monitoring_column.vue b/app/assets/javascripts/monitoring/components/monitoring_column.vue index e933634643b..bc563afc016 100644 --- a/app/assets/javascripts/monitoring/components/monitoring_column.vue +++ b/app/assets/javascripts/monitoring/components/monitoring_column.vue @@ -157,21 +157,27 @@ const xAxis = d3.svg.axis() .scale(axisXScale) - .ticks(measurements.ticks) + .ticks(measurements.xTicks) .orient('bottom'); const yAxis = d3.svg.axis() .scale(this.yScale) - .ticks(measurements.ticks) + .ticks(measurements.yTicks) .orient('left'); d3.select(this.$refs.baseSvg).select('.x-axis').call(xAxis); const width = this.graphWidth; + let line = 0; d3.select(this.$refs.baseSvg).select('.y-axis').call(yAxis) .selectAll('.tick') .each(function createTickLines() { - d3.select(this).select('line').attr('x2', width); + if (line !== 0) { + d3.select(this).select('line') + .attr('x2', width) + .attr('class', 'axis-tick'); + } + line = line += 1; // Avoid adding the class to the first tick, to prevent coloring }); // This will select all of the ticks once they're rendered this.xScale = d3.time.scale() diff --git a/app/assets/javascripts/monitoring/components/monitoring_flag.vue b/app/assets/javascripts/monitoring/components/monitoring_flag.vue index 180a771415b..5a0e50fcab3 100644 --- a/app/assets/javascripts/monitoring/components/monitoring_flag.vue +++ b/app/assets/javascripts/monitoring/components/monitoring_flag.vue @@ -87,14 +87,14 @@ {{formatTime}} {{formatDate}} diff --git a/app/assets/javascripts/monitoring/components/monitoring_legends.vue b/app/assets/javascripts/monitoring/components/monitoring_legends.vue index b30ed3cc889..922a5e1bf0e 100644 --- a/app/assets/javascripts/monitoring/components/monitoring_legends.vue +++ b/app/assets/javascripts/monitoring/components/monitoring_legends.vue @@ -109,13 +109,13 @@ @@ -131,13 +131,13 @@ + :y="graphHeight - 25"> {{legendTitle}} + :y="graphHeight - 10"> {{metricUsage}} diff --git a/app/assets/javascripts/monitoring/utils/measurements.js b/app/assets/javascripts/monitoring/utils/measurements.js index a60d2522f49..62cd19c86e1 100644 --- a/app/assets/javascripts/monitoring/utils/measurements.js +++ b/app/assets/javascripts/monitoring/utils/measurements.js @@ -8,14 +8,14 @@ export default { }, legends: { width: 15, - height: 30, + height: 25, }, backgroundLegend: { width: 30, height: 50, }, axisLabelLineOffset: -20, - legendOffset: 52, + legendOffset: 35, }, large: { // This covers both md and lg screen sizes margin: { @@ -26,14 +26,15 @@ export default { }, legends: { width: 20, - height: 35, + height: 30, }, backgroundLegend: { width: 30, height: 150, }, axisLabelLineOffset: 20, - legendOffset: 55, + legendOffset: 38, }, - ticks: 3, + xTicks: 8, + yTicks: 3, }; diff --git a/app/assets/stylesheets/pages/environments.scss b/app/assets/stylesheets/pages/environments.scss index a2be957655f..fa0e1fc0d41 100644 --- a/app/assets/stylesheets/pages/environments.scss +++ b/app/assets/stylesheets/pages/environments.scss @@ -187,8 +187,7 @@ } .text-metric { - font-weight: 600; - font-size: 14px; + font-size: 12px; } .selected-metric-line { @@ -232,10 +231,6 @@ width: 100%; padding: 0; padding-bottom: 100%; - - .text-metric-bold { - font-weight: 600; - } } .prometheus-svg-container > svg { @@ -250,6 +245,10 @@ stroke-width: 0; } + .text-metric-bold { + font-weight: 600; + } + .label-axis-text, .text-metric-usage { fill: $black; @@ -265,6 +264,15 @@ font-size: 14px; } + .y-label-text, + .x-label-text { + fill: $gray-darkest; + } + + .axis-tick { + stroke: $gray-darker; + } + @media (max-width: $screen-sm-max) { .label-axis-text, .text-metric-usage, diff --git a/changelogs/unreleased/34653-minor-ux-cleanups-for-performance-dashboard.yml b/changelogs/unreleased/34653-minor-ux-cleanups-for-performance-dashboard.yml new file mode 100644 index 00000000000..736991318d7 --- /dev/null +++ b/changelogs/unreleased/34653-minor-ux-cleanups-for-performance-dashboard.yml @@ -0,0 +1,4 @@ +--- +title: Cleanup minor UX issues in the performance dashboard +merge_request: +author: -- cgit v1.2.1