Skip to content

Commit

Permalink
ux and ui improvements as well as changing all times displayed to be utc
Browse files Browse the repository at this point in the history
added home button link
and changed main chart table to be clickable so it goes to the build
  • Loading branch information
snevesbarros committed Dec 9, 2023
1 parent 7f63b92 commit 109dae4
Show file tree
Hide file tree
Showing 10 changed files with 29 additions and 22 deletions.
4 changes: 2 additions & 2 deletions src/components/common/execution-timeline/StepsTimeline.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ const StepsTimeline = function (props) {
return (
<Timeline.Item dot={getTimeLineIcon(step.status)} className="timeline-step" key={index}>
<Stack className="rg-stack" spacing={10}>
<p><Moment format="HH:mm:ss">{step.timestamp}</Moment></p>
<p><Moment utc format="HH:mm:ss">{step.timestamp}</Moment></p>
<p>{step.name}</p>
<p>{`Expected: ${step.expected}, Actual: ${step.actual}`}</p>
<p>{screenshotImage}</p>
Expand All @@ -93,7 +93,7 @@ const StepsTimeline = function (props) {
return (
<Timeline.Item dot={getTimeLineIcon(step.status)} className="timeline-step" key={index}>
<Stack className="rg-stack" spacing={10}>
<p><Moment format="HH:mm:ss">{step.timestamp}</Moment></p>
<p><Moment utc format="HH:mm:ss">{step.timestamp}</Moment></p>
<p>{convertTextToLinks(step.info)}</p>
<p>{screenshotImage}</p>
</Stack>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const ScreenshotDetailsTable = function (props) {
</span>
<span>: </span>
<span>
<Moment format="DD-MM-YYYY HH:mm:ss">
<Moment utc format="DD-MM-YYYY HH:mm:ss">
{currentScreenshotDetails.timestamp}
</Moment>
</span>
Expand All @@ -50,7 +50,7 @@ const ScreenshotDetailsTable = function (props) {
</span>
<span>: </span>
<span>
<Moment format="DD-MM-YYYY HH:mm:ss">
<Moment utc format="DD-MM-YYYY HH:mm:ss">
{currentBaseLineDetails.screenshot.timestamp}
</Moment>
</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ const ScreenshotHistoryView = function (props) {
<FormattedMessage id="common.component.screenshot-view.tabs.history.label.date" />
</span>
<span>: </span>
<Moment format="DD-MM-YYYY HH:mm:ss">
<Moment utc format="DD-MM-YYYY HH:mm:ss">
{screenshot.timestamp}
</Moment>
</td>
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/test-suite/ExecutionTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const ExecutionTable = function (props) {
<div className="execution-details-container">
<span className="date-details">
<CalendarIcon />
<Moment format="DD-MM-YYYY HH:mm:ss">
<Moment utc format="DD-MM-YYYY HH:mm:ss">
{execution.start}
</Moment>
</span>
Expand Down
6 changes: 3 additions & 3 deletions src/components/pages/dashboard/BuildsTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,12 @@ const DateCell = function (props) {
<div>
<div>
<span>
<Moment format="DD MMM">
<Moment utc format="DD MMM">
{build.start}
</Moment>
</span>
<span> </span>
<Moment format="HH:mm">
<Moment utc format="HH:mm">
{build.start}
</Moment>
</div>
Expand All @@ -123,7 +123,7 @@ const ResultCell = function (props) {
const { rowData: build } = props;
return (
// eslint-disable-next-line react/jsx-props-no-spreading
<Cell {...props}>
<Cell {...props} className="builds-table-result-cell">
<ExecutionsResultsBar result={build.result} />
</Cell>
);
Expand Down
15 changes: 8 additions & 7 deletions src/components/pages/dashboard/charts/ExecutionBarChart.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand All @@ -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: {
Expand Down Expand Up @@ -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(
{
Expand Down Expand Up @@ -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 (
<Panel
Expand Down
4 changes: 4 additions & 0 deletions src/components/pages/dashboard/styles.less
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,8 @@
padding-top: 10px;
}

.builds-table-result-cell {
padding-right: 10px;
display: flex
}

Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const generateResultsData = (executions) => {
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' },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ const TestRunCompareTable = function (props) {
};
testRunCompareBuilds.forEach((build) => {
names[build._id] = build.name;
startDates[build._id] = <Moment format="DD-MM-YYYY HH:mm">{build.start}</Moment>;
startDates[build._id] = <Moment utc format="DD-MM-YYYY HH:mm">{build.start}</Moment>;
environments[build._id] = build.environment.name;
});
buildDetailsRows.push(names);
Expand Down
10 changes: 6 additions & 4 deletions src/containers/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,12 @@ const App = function (props) {
>
<Sidenav expanded={expand} defaultOpenKeys={['3']} appearance="subtle">
<Sidenav.Header>
<div className="sidebar-header">
<img src="../assets/angles-icon.png" alt="Angles" className="sidebar-angles-icon" />
<img src="../assets/angles-text-logo.png" alt="Angles" className="sidebar-angles-text-icon" />
</div>
<a href="/">
<div className="sidebar-header">
<img src="../assets/angles-icon.png" alt="Angles" className="sidebar-angles-icon" />
<img src="../assets/angles-text-logo.png" alt="Angles" className="sidebar-angles-text-icon" />
</div>
</a>
</Sidenav.Header>
<Sidenav.Body>
<Nav>
Expand Down

0 comments on commit 109dae4

Please sign in to comment.