diff --git a/src/components/Job/JobDetails.tsx b/src/components/Job/JobDetails.tsx index b297383d84c45f75a60e433faa268965f9b670d4..454ad5e353ea7a45d2285adddd7fb378e919d77d 100644 --- a/src/components/Job/JobDetails.tsx +++ b/src/components/Job/JobDetails.tsx @@ -10,7 +10,8 @@ import { formatDateAndTime, EmptyValue, Duration, - Step, + StepperComponents, + STEPPER_STATES, AccessControl } from "@ess-ics/ce-ui-common"; import { JobBadge } from "./JobBadge"; @@ -103,6 +104,9 @@ export const JobDetails = ({ operation, job }: JobDetailsProps) => { const [alerts, setAlerts] = useState< { type?: Status; message?: string; link?: string }[] >(operation.alerts ?? []); + const StepIcon = operation?.status + ? StepperComponents[operation.status.toLowerCase()] + : StepperComponents[STEPPER_STATES.unknown]; const awxJob = useMemo( () => new AWXJobDetails(operation, operation.type), @@ -144,7 +148,7 @@ export const JobDetails = ({ operation, job }: JobDetailsProps) => { > Job log stream </Typography> - <Step + <StepIcon showToolTip step={{ state: operation?.status?.toLowerCase(), diff --git a/src/components/Job/JobStatus.tsx b/src/components/Job/JobStatus.tsx index d860811605b68edc7a07206cc5f72e1394d8d009..d5015bb7fec1fc88c9ce49ad36837bedde402d1f 100644 --- a/src/components/Job/JobStatus.tsx +++ b/src/components/Job/JobStatus.tsx @@ -1,5 +1,5 @@ import { - StepperEvents, + STEPPER_STATES, LabeledIcon, IconRunning, IconSuccessful, @@ -14,22 +14,22 @@ interface JobStatusProps { const getStatus = (status: string) => { switch (status.toLowerCase()) { - case StepperEvents.queued: + case STEPPER_STATES.queued: return { label: "Queued", icon: IconRunning }; - case StepperEvents.running: + case STEPPER_STATES.running: return { label: "Running", icon: IconRunning }; - case StepperEvents.successful: + case STEPPER_STATES.successful: return { label: "Successful", icon: IconSuccessful }; - case StepperEvents.failed: + case STEPPER_STATES.failed: return { label: "Failed", icon: IconFailed @@ -54,7 +54,7 @@ export const JobStatus = ({ status }: JobStatusProps) => { labelPosition="right" LabelProps={{ color: - convertedStatus === StepperEvents.failed + convertedStatus === STEPPER_STATES.failed ? theme.palette.status.fail.main : "inherit" }}