fix(UI): display a generic step icon when replacing a step
@@ -57,11 +57,9 @@ export interface IEditorSidebarProps {
activeIndex: number;
initialExpanded?: boolean;
}
-export const EditorSidebar: React.FunctionComponent<
- IEditorSidebarProps & {
+export const EditorSidebar: React.FunctionComponent<IEditorSidebarProps & {
isAdding: boolean;
- }
-> = ({ activeIndex, activeStep, initialExpanded, steps, isAdding }) => {
+}> = ({ activeIndex, activeStep, initialExpanded, steps, isAdding }) => {
const UISteps = toUIStepCollection(steps);
return (
<IntegrationVerticalFlow initialExpanded={initialExpanded}>
@@ -123,6 +121,7 @@ export const EditorSidebar: React.FunctionComponent<
<>
{UISteps.map((s, idx) => {
const isActive = idx === activeIndex;
+ const step = isActive && activeStep ? activeStep : s;
const hasAddStep = isAdding && activeIndex === idx + 1;
const isAfterActiveAddStep = activeIndex - 1 < idx;
const position =
@@ -130,29 +129,41 @@ export const EditorSidebar: React.FunctionComponent<
return (
<React.Fragment key={idx}>
+ {!isAdding && isActive && !activeStep ? (
+ makeActiveStep(
+ position,
+ expanded,
+ 'Set up this step',
+ 'Choose a step',
+ undefined
+ )
+ ) : (
<IntegrationFlowStepWithOverview
icon={
<EntityIcon
- alt={s.name}
- entity={s}
+ alt={step.name}
+ entity={step}
width={24}
height={24}
/>
}
- i18nTitle={`${position}. ${s.name}`}
- i18nTooltip={`${position}. ${s.title}`}
+ i18nTitle={`${position}. ${step.name}`}
+ i18nTooltip={`${position}. ${step.title}`}
active={
- isAdding ? isActive && !isAfterActiveAddStep : isActive
+ isAdding
+ ? isActive && !isAfterActiveAddStep
+ : isActive
}
showDetails={expanded}
- name={s.name}
- action={s.action && s.action.name!}
+ name={step.name}
+ action={step.action && step.action.name!}
dataType={
idx === 0
- ? getDataShapeText(s.stepKind!, s.outputDataShape)
- : getDataShapeText(s.stepKind!, s.inputDataShape)
+ ? getDataShapeText(step.stepKind!, step.outputDataShape)
+ : getDataShapeText(step.stepKind!, step.inputDataShape)
}
/>
+ )}
{hasAddStep
? makeActiveStep(
position + 1,
