Skip to content

Commit e2d4d78

Browse files
author
Roman Snapko
committed
Handle deleted steps in flow run details view
1 parent f2963e0 commit e2d4d78

1 file changed

Lines changed: 15 additions & 5 deletions

File tree

packages/react-ui/src/app/features/builder/run-details/flow-step-details-card-item.tsx

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
CollapsibleContent,
77
CollapsibleTrigger,
88
} from '@openops/components/ui';
9-
import { ChevronRight } from 'lucide-react';
9+
import { ChevronRight, TrashIcon } from 'lucide-react';
1010
import React, { useCallback, useMemo } from 'react';
1111

1212
import { blocksHooks } from '@/app/features/blocks/lib/blocks-hook';
@@ -18,6 +18,7 @@ import { ActionType, FlagId, flowHelper } from '@openops/shared';
1818
import { flagsHooks } from '@/app/common/hooks/flags-hooks';
1919
import { useCenterWorkflowViewOntoStep } from '@/app/features/builder/hooks/center-workflow-view-onto-step';
2020
import { StepStatusIcon } from '@/app/features/flow-runs/components/step-status-icon';
21+
import { t } from 'i18next';
2122
import { RUN_DETAILS_STEP_CARD_ID_PREFIX } from './constants';
2223
import { LoopIterationInput } from './loop-iteration-input';
2324

@@ -145,10 +146,19 @@ const FlowStepDetailsCardItem = ({
145146
/>
146147
</Button>
147148
)}
148-
<img className="w-6 h-6" alt={'logo'} src={stepMetadata?.logoUrl} />
149-
<div className="break-all truncate">{`${stepIndex + 1}. ${
150-
step?.displayName
151-
}`}</div>
149+
{stepMetadata?.logoUrl ? (
150+
<img
151+
className="w-6 h-6"
152+
alt={'logo'}
153+
src={stepMetadata?.logoUrl}
154+
/>
155+
) : (
156+
<TrashIcon className="w-6 h-6" />
157+
)}
158+
159+
<div className="break-all truncate">{`${
160+
stepIndex !== -1 ? `${stepIndex + 1}. ` : ''
161+
}${step?.displayName ?? t('Deleted Step')}`}</div>
152162
<div className="w-2"></div>
153163
<div className="flex gap-1 justify-end items-center flex-grow">
154164
{isLoopStep && (

0 commit comments

Comments
 (0)