feat(PowerInput/Suggestions): hide steps without execution steps

This commit is contained in:
Ali BARIN
2022-09-25 20:42:39 +02:00
parent 2bc5da885e
commit 6ab7265a04
2 changed files with 13 additions and 7 deletions

View File

@@ -114,7 +114,7 @@ const Suggestions = (props: SuggestionsProps) => {
</Button> </Button>
)} )}
{listLength === undefined && ( {listLength === Infinity && (
<Button <Button
fullWidth fullWidth
onClick={collapseList} onClick={collapseList}

View File

@@ -35,10 +35,16 @@ const process = (data: any, parentKey?: any, index?: number): any[] => {
export const processStepWithExecutions = (steps: IStep[]): any[] => { export const processStepWithExecutions = (steps: IStep[]): any[] => {
if (!steps) return []; if (!steps) return [];
return steps.map((step: IStep, index: number) => ({ return steps
id: step.id, .filter((step: IStep) => {
// TODO: replace with step.name once introduced const hasExecutionSteps = !!step.executionSteps?.length;
name: `${index + 1}. ${step.appKey?.charAt(0)?.toUpperCase() + step.appKey?.slice(1)}`,
output: process(step.executionSteps?.[0]?.dataOut || {}, `step.${step.id}`), return hasExecutionSteps
})); })
.map((step: IStep, index: number) => ({
id: step.id,
// TODO: replace with step.name once introduced
name: `${index + 1}. ${step.appKey?.charAt(0)?.toUpperCase() + step.appKey?.slice(1)}`,
output: process(step.executionSteps?.[0]?.dataOut || {}, `step.${step.id}`),
}));
}; };