Skip to content

Commit

Permalink
feat: added color icon to workflow details page last run status field (
Browse files Browse the repository at this point in the history
  • Loading branch information
batzionb authored and caponetto committed Jan 11, 2024
1 parent 6581bcc commit cd98e3e
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { Skeleton } from '@material-ui/lab';
import { WorkflowOverview } from '@janus-idp/backstage-plugin-orchestrator-common';

import WorkflowOverviewFormatter from '../../dataFormatters/WorkflowOverviewFormatter';
import { ProcessInstanceStatus } from '../next/ProcessInstanceStatus';

const useStyles = makeStyles({
details: {
Expand Down Expand Up @@ -49,6 +50,11 @@ const WorkflowDefinitionDetailsCard = ({
{
label: 'last run status',
value: formattedWorkflowOverview?.lastRunStatus,
children: formattedWorkflowOverview?.lastRunStatus ? (
<ProcessInstanceStatus
status={formattedWorkflowOverview?.lastRunStatus}
/>
) : null,
},
],
[formattedWorkflowOverview],
Expand All @@ -60,11 +66,11 @@ const WorkflowDefinitionDetailsCard = ({
<InfoCard title="Details" className={classes.details}>
<Grid container spacing={3} alignContent="flex-start">
<Grid container item md={4} spacing={3} alignContent="flex-start">
{details?.map(({ label, value }) => (
{details?.map(({ label, value, children }) => (
<Grid item md={6} key={label}>
{/* AboutField requires the value to be defined as a prop as well */}
<AboutField label={label} value={value}>
{loading ? <Skeleton variant="text" /> : value}
{loading ? <Skeleton variant="text" /> : children || value}
</AboutField>
</Grid>
))}
Expand Down

0 comments on commit cd98e3e

Please sign in to comment.