From 109dae4bdd354d69e200d0ebfa6032109acce516 Mon Sep 17 00:00:00 2001 From: Sergio Neves Barros Date: Sat, 9 Dec 2023 15:25:00 +0000 Subject: [PATCH 1/2] ux and ui improvements as well as changing all times displayed to be utc added home button link and changed main chart table to be clickable so it goes to the build --- .../common/execution-timeline/StepsTimeline.js | 4 ++-- .../screenshot-view/ScreenshotDetailsTable.js | 4 ++-- .../history/ScreenshotHistoryView.js | 2 +- .../common/test-suite/ExecutionTable.js | 2 +- src/components/pages/dashboard/BuildsTable.js | 6 +++--- .../pages/dashboard/charts/ExecutionBarChart.js | 15 ++++++++------- src/components/pages/dashboard/styles.less | 4 ++++ .../charts/TestExecutionTimeLineChart.js | 2 +- .../pages/test-run-compare/TestRunCompareTable.js | 2 +- src/containers/App.js | 10 ++++++---- 10 files changed, 29 insertions(+), 22 deletions(-) diff --git a/src/components/common/execution-timeline/StepsTimeline.js b/src/components/common/execution-timeline/StepsTimeline.js index ad3d920..f0204a2 100644 --- a/src/components/common/execution-timeline/StepsTimeline.js +++ b/src/components/common/execution-timeline/StepsTimeline.js @@ -82,7 +82,7 @@ const StepsTimeline = function (props) { return ( -

{step.timestamp}

+

{step.timestamp}

{step.name}

{`Expected: ${step.expected}, Actual: ${step.actual}`}

{screenshotImage}

@@ -93,7 +93,7 @@ const StepsTimeline = function (props) { return ( -

{step.timestamp}

+

{step.timestamp}

{convertTextToLinks(step.info)}

{screenshotImage}

diff --git a/src/components/common/screenshot-view/ScreenshotDetailsTable.js b/src/components/common/screenshot-view/ScreenshotDetailsTable.js index 6065bc9..3d50562 100644 --- a/src/components/common/screenshot-view/ScreenshotDetailsTable.js +++ b/src/components/common/screenshot-view/ScreenshotDetailsTable.js @@ -37,7 +37,7 @@ const ScreenshotDetailsTable = function (props) { : - + {currentScreenshotDetails.timestamp} @@ -50,7 +50,7 @@ const ScreenshotDetailsTable = function (props) { : - + {currentBaseLineDetails.screenshot.timestamp} diff --git a/src/components/common/screenshot-view/history/ScreenshotHistoryView.js b/src/components/common/screenshot-view/history/ScreenshotHistoryView.js index 681227a..eb9ccaf 100644 --- a/src/components/common/screenshot-view/history/ScreenshotHistoryView.js +++ b/src/components/common/screenshot-view/history/ScreenshotHistoryView.js @@ -101,7 +101,7 @@ const ScreenshotHistoryView = function (props) { : - + {screenshot.timestamp} diff --git a/src/components/common/test-suite/ExecutionTable.js b/src/components/common/test-suite/ExecutionTable.js index a3c961c..1863786 100644 --- a/src/components/common/test-suite/ExecutionTable.js +++ b/src/components/common/test-suite/ExecutionTable.js @@ -62,7 +62,7 @@ const ExecutionTable = function (props) {
- + {execution.start} diff --git a/src/components/pages/dashboard/BuildsTable.js b/src/components/pages/dashboard/BuildsTable.js index 2a95f57..5cbfcdd 100644 --- a/src/components/pages/dashboard/BuildsTable.js +++ b/src/components/pages/dashboard/BuildsTable.js @@ -94,12 +94,12 @@ const DateCell = function (props) {
- + {build.start} - + {build.start}
@@ -123,7 +123,7 @@ const ResultCell = function (props) { const { rowData: build } = props; return ( // eslint-disable-next-line react/jsx-props-no-spreading - + ); diff --git a/src/components/pages/dashboard/charts/ExecutionBarChart.js b/src/components/pages/dashboard/charts/ExecutionBarChart.js index 2bd1bf0..cabd68e 100644 --- a/src/components/pages/dashboard/charts/ExecutionBarChart.js +++ b/src/components/pages/dashboard/charts/ExecutionBarChart.js @@ -4,6 +4,7 @@ import { Panel, Stack } from 'rsuite'; import { useIntl } from 'react-intl'; import moment from 'moment'; // import { getBuildDurationInSeconds } from '../../../../utility/TimeUtilities'; +import { useNavigate } from 'react-router-dom'; const defaultOptions = { chart: { @@ -16,12 +17,7 @@ const defaultOptions = { background: 'var(--main-panel-background)', foreColor: 'var(--main-panel-font-color)', // TODO: could look at adding some click events for filtering etc - // events: - // { - // click: (event, chartContext, config) => { - // console.log(event, chartContext, config); - // }, - // }, + events: {}, }, plotOptions: { bar: { @@ -86,7 +82,7 @@ const generateResultsData = (builds) => { results.ERROR.push(ERROR || 0); results.FAIL.push(FAIL || 0); // results.executionTimes.push(getBuildDurationInSeconds(build)); - graphData.labels.push(moment(build.start).format('YYYY-MM-DD hh:mm:ss')); + graphData.labels.push(moment.utc(moment(build.start)).format('YYYY-MM-DD HH:mm:ss')); }); graphData.data.push( { @@ -120,7 +116,12 @@ const generateResultsData = (builds) => { const ExecutionBarChart = function (props) { const { builds, title } = props; + const reversedBuilds = [...builds].reverse(); + const navigate = useNavigate(); const graphData = generateResultsData(builds); + defaultOptions.chart.events.click = function (event, chartContext, config) { + navigate(`/test-run/?buildId=${reversedBuilds[config.dataPointIndex]._id}`); + }; const { data, labels } = graphData; return ( { const executionsToReverse = [...executions]; executionsToReverse.reverse().forEach((execution) => { executionTimes.push(getBuildDurationInSeconds(execution)); - graphData.labels.push(moment(execution.start).format('YYYY-MM-DD hh:mm:ss')); + graphData.labels.push(moment.utc(moment(execution.start)).format('YYYY-MM-DD hh:mm:ss')); }); graphData.data.push( { name: 'ExecutionTime', data: executionTimes, type: 'line' }, diff --git a/src/components/pages/test-run-compare/TestRunCompareTable.js b/src/components/pages/test-run-compare/TestRunCompareTable.js index 8983b91..4d17bef 100644 --- a/src/components/pages/test-run-compare/TestRunCompareTable.js +++ b/src/components/pages/test-run-compare/TestRunCompareTable.js @@ -183,7 +183,7 @@ const TestRunCompareTable = function (props) { }; testRunCompareBuilds.forEach((build) => { names[build._id] = build.name; - startDates[build._id] = {build.start}; + startDates[build._id] = {build.start}; environments[build._id] = build.environment.name; }); buildDetailsRows.push(names); diff --git a/src/containers/App.js b/src/containers/App.js index 1f3684f..8e1a1d7 100644 --- a/src/containers/App.js +++ b/src/containers/App.js @@ -168,10 +168,12 @@ const App = function (props) { > -
- Angles - Angles -
+ +
+ Angles + Angles +
+