Closed Tamir198 closed 8 months ago
Answer to both comments - if I would change the types into some thing like this :
type ImportToFlowDialogProps = {
setIsImportStepDialogOpen: React.Dispatch<React.SetStateAction<boolean>>;
isImportStepDialogOpen: boolean;
invocations: InvocationType[];
iconSize: number;
};
<ImportToFlowDialog
setIsImportStepDialogOpen={setIsImportStepDialogOpen}
isImportStepDialogOpen={isImportStepDialogOpen}
invocations={[invocation]}
iconSize={15}
/>
Then in this line:
invocations={[invocation]}
I would get this ts error :
This is because on the same page InvocationSectionProps.invocation
is of type InvocationType | undefined
:
This is being used all over the file so I figured that it's better to change 1 type to fit the system than refactor everything.
What do you think?
type ImportToFlowDialogProps = { setIsImportStepDialogOpen: React.Dispatch<React.SetStateAction<boolean>>; isImportStepDialogOpen: boolean; invocations: InvocationType[]; iconSize: number; };
If you don't have an invocation, just don't allow to import.
You can now select invocations and add them to a flow.
https://github.com/sharkio-dev/sharkio/assets/34707669/65454672-4c3e-40b3-91d7-5d7117438255