Skip to content

Commit

Permalink
fix(orchestrator): remove completedWith status
Browse files Browse the repository at this point in the history
FLPATH-1845

Signed-off-by: Marek Libra <[email protected]>
  • Loading branch information
mareklibra committed Nov 11, 2024
1 parent 25f1787 commit 9c4a96a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ export const WorkflowInstancePageContent: React.FC<{
<WorkflowRunDetails
details={details}
assessedBy={assessedInstance.assessedBy}
completedWith={workflowdata?.result?.completedWith}
/>
</InfoCard>
</Grid>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import DotIcon from '@material-ui/icons/FiberManualRecord';
import {
capitalize,
ProcessInstanceStatusDTO,
WorkflowResultDTOCompletedWithEnum,
} from '@janus-idp/backstage-plugin-orchestrator-common';

import { VALUE_UNAVAILABLE } from '../constants';
Expand All @@ -18,40 +17,26 @@ import { workflowInstanceRouteRef } from '../routes';
export const WorkflowInstanceStatusIndicator = ({
status,
lastRunId,
completedWith,
}: {
status?: ProcessInstanceStatusDTO;
lastRunId?: string;
completedWith?: WorkflowResultDTOCompletedWithEnum;
}) => {
const iconColor = useWorkflowInstanceStateColors(
status === ProcessInstanceStatusDTO.Completed && completedWith === 'error'
? ProcessInstanceStatusDTO.Error
: status,
);
const iconColor = useWorkflowInstanceStateColors(status);
const workflowInstanceLink = useRouteRef(workflowInstanceRouteRef);

if (!status) {
return VALUE_UNAVAILABLE;
}

let statusText: string = status;
if (
status === ProcessInstanceStatusDTO.Completed &&
completedWith === 'error'
) {
statusText = 'Completed with error';
}

return (
<>
<DotIcon style={{ fontSize: '0.75rem' }} className={iconColor} />{' '}
{lastRunId ? (
<Link to={workflowInstanceLink({ instanceId: lastRunId })}>
{capitalize(statusText)}
{capitalize(status)}
</Link>
) : (
<>{capitalize(statusText)}</>
<>{capitalize(status)}</>
)}
</>
);
Expand Down
3 changes: 0 additions & 3 deletions plugins/orchestrator/src/components/WorkflowRunDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import { WorkflowRunDetail } from './WorkflowRunDetail';
type WorkflowDetailsCardProps = {
assessedBy?: ProcessInstanceDTO;
details: WorkflowRunDetail;
completedWith?: WorkflowResultDTOCompletedWithEnum;
};

const useStyles = makeStyles({
Expand All @@ -34,7 +33,6 @@ const useStyles = makeStyles({
export const WorkflowRunDetails: React.FC<WorkflowDetailsCardProps> = ({
assessedBy,
details,
completedWith,
}) => {
const styles = useStyles();
const workflowInstanceLink = useRouteRef(workflowInstanceRouteRef);
Expand All @@ -54,7 +52,6 @@ export const WorkflowRunDetails: React.FC<WorkflowDetailsCardProps> = ({
<b>
<WorkflowInstanceStatusIndicator
status={details.status as ProcessInstanceStatusDTO}
completedWith={completedWith}
/>
</b>
</Typography>
Expand Down

0 comments on commit 9c4a96a

Please sign in to comment.