Skip to content

Commit

Permalink
feat: show execution create time when hovering on status badge
Browse files Browse the repository at this point in the history
Signed-off-by: xwk1246 <xwk1246@gmail.com>
  • Loading branch information
xwk1246 committed Feb 15, 2024
1 parent a162fb0 commit 9722b78
Showing 1 changed file with 39 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
IconButton,
Button,
CircularProgress,
Tooltip,
} from '@material-ui/core';
import ArchiveOutlined from '@material-ui/icons/ArchiveOutlined';
import UnarchiveOutline from '@material-ui/icons/UnarchiveOutlined';
Expand Down Expand Up @@ -54,24 +55,57 @@ export function getExecutionIdCell(

export function getStatusCell(execution: Execution): React.ReactNode {
const isArchived = isExecutionArchived(execution);
const { createdAt } = execution.closure;
const createdAtDate = timestampToDate(createdAt);
const phase = execution.closure.phase ?? WorkflowExecutionPhase.UNDEFINED;

return (
<ExecutionStatusBadge phase={phase} type="workflow" disabled={isArchived} />
<Tooltip
placement="top"
arrow
title={
<>
<Typography>Create Time</Typography>
<Typography>{formatDateUTC(createdAtDate)}</Typography>
<Typography>{formatDateLocalTimezone(createdAtDate)}</Typography>
</>
}
>
<div>
<ExecutionStatusBadge
phase={phase}
type="workflow"
disabled={isArchived}
/>
</div>
</Tooltip>
);
}

export function getStartTimeCell(execution: Execution): React.ReactNode {
const { startedAt } = execution.closure;
const { startedAt, createdAt } = execution.closure;

if (!startedAt) {
if (!startedAt || !createdAt) {
return null;
}

const startedAtDate = timestampToDate(startedAt);
const createdAtDate = timestampToDate(createdAt);

Check warning on line 93 in packages/console/src/components/Executions/Tables/WorkflowExecutionTable/cells.tsx

View workflow job for this annotation

GitHub Actions / lint_project

'createdAtDate' is assigned a value but never used
const isArchived = isExecutionArchived(execution);

return (
// <Tooltip
// placement="top"
// arrow
// title={
// <>
// <Typography>Create Time</Typography>
// <Typography>{formatDateUTC(createdAtDate)}</Typography>
// <Typography>{formatDateLocalTimezone(createdAtDate)}</Typography>
// </>
// }
// >
// <div>
<>
<Typography
variant="body1"
Expand All @@ -83,6 +117,8 @@ export function getStartTimeCell(execution: Execution): React.ReactNode {
{formatDateLocalTimezone(startedAtDate)}
</Typography>
</>
// </div>
// </Tooltip>
);
}

Expand Down

0 comments on commit 9722b78

Please sign in to comment.