diff --git a/packages/web/src/components/ExecutionHeader/index.tsx b/packages/web/src/components/ExecutionHeader/index.tsx index a6bff309..15fde3e4 100644 --- a/packages/web/src/components/ExecutionHeader/index.tsx +++ b/packages/web/src/components/ExecutionHeader/index.tsx @@ -6,6 +6,8 @@ import Tooltip from '@mui/material/Tooltip'; import Typography from '@mui/material/Typography'; import type { IExecution } from '@automatisch/types'; +import useFormatMessage from 'hooks/useFormatMessage'; + type ExecutionHeaderProps = { execution: IExecution; }; @@ -19,13 +21,18 @@ function ExecutionName(props: Pick) { } function ExecutionId(props: Pick) { + const formatMessage = useFormatMessage(); + + const id = ( + + {props.id} + + ); + return ( - Execution ID:{' '} - - {props.id} - + {formatMessage('execution.id', { id })} ); diff --git a/packages/web/src/components/ExecutionStep/index.tsx b/packages/web/src/components/ExecutionStep/index.tsx index 82564e8a..c434cbd2 100644 --- a/packages/web/src/components/ExecutionStep/index.tsx +++ b/packages/web/src/components/ExecutionStep/index.tsx @@ -21,6 +21,7 @@ import { AppIconStatusIconWrapper, Content, Header, + Metadata, Wrapper, } from './style'; @@ -31,6 +32,24 @@ type ExecutionStepProps = { executionStep: IExecutionStep; }; +function ExecutionStepId(props: Pick) { + const formatMessage = useFormatMessage(); + + const id = ( + + {props.id} + + ); + + return ( + + + {formatMessage('executionStep.id', { id })} + + + ); +} + function ExecutionStepDate(props: Pick) { const formatMessage = useFormatMessage(); const createdAt = DateTime.fromMillis(parseInt(props.createdAt, 10)); @@ -76,30 +95,37 @@ export default function ExecutionStep( return (
- + - - + + {validationStatusIcon} - - - {isTrigger - ? formatMessage('flowStep.triggerType') - : formatMessage('flowStep.actionType')} - + + - - {step.position}. {app?.name} - - + + + {isTrigger && formatMessage('flowStep.triggerType')} + {isAction && formatMessage('flowStep.actionType')} + - - - + + {step.position}. {app?.name} + + + + + + +
diff --git a/packages/web/src/components/ExecutionStep/style.ts b/packages/web/src/components/ExecutionStep/style.ts index 5d8a87a6..e1b9007b 100644 --- a/packages/web/src/components/ExecutionStep/style.ts +++ b/packages/web/src/components/ExecutionStep/style.ts @@ -1,18 +1,22 @@ import { styled, alpha } from '@mui/material/styles'; import Card from '@mui/material/Card'; +import Box from '@mui/material/Box'; export const AppIconWrapper = styled('div')` - position: relative; + display: flex; + align-items: center; `; + export const AppIconStatusIconWrapper = styled('span')` - position: absolute; - right: 0; - top: 0; - transform: translate(50%, -50%); display: inline-flex; + position: relative; svg { + position: absolute; + right: 0; + top: 0; + transform: translate(50%, -50%); // to make it distinguishable over an app icon background: white; border-radius: 100%; @@ -31,7 +35,7 @@ type HeaderProps = { export const Header = styled('div', { shouldForwardProp: (prop) => prop !== 'collapsed', -})` +}) ` padding: ${({ theme }) => theme.spacing(2)}; cursor: ${({ collapsed }) => (collapsed ? 'pointer' : 'unset')}; `; @@ -42,3 +46,20 @@ export const Content = styled('div')` border-right: none; padding: ${({ theme }) => theme.spacing(2, 0)}; `; + +export const Metadata = styled(Box)` + display: grid; + grid-template-columns: 1fr auto; + grid-template-rows: auto auto; + grid-template-areas: + "step id" + "step date"; + + ${({ theme }) => theme.breakpoints.down('sm')} { + grid-template-rows: auto auto auto; + grid-template-areas: + "id" + "step" + "date"; + } +` as typeof Box; diff --git a/packages/web/src/locales/en.json b/packages/web/src/locales/en.json index 0e20261e..bb63e437 100644 --- a/packages/web/src/locales/en.json +++ b/packages/web/src/locales/en.json @@ -86,12 +86,14 @@ "flowEditor.goBack": "Go back to flows", "executions.title": "Executions", "executions.noExecutions": "There is no execution data point to show.", + "execution.id": "Execution ID: {id}", "execution.updatedAt": "updated {datetime}", "execution.test": "Test run", "execution.statusSuccess": "Success", "execution.statusFailure": "Failure", "execution.noDataTitle": "No data", "execution.noDataMessage": "We successfully ran the execution, but there was no new data to process.", + "executionStep.id": "ID: {id}", "executionStep.executedAt": "executed {datetime}", "profileSettings.title": "My Profile", "profileSettings.fullName": "Full name",