Merge pull request #540 from automatisch/issue-539

feat(PowerInput/Suggestions): hide steps without execution steps
This commit is contained in:
Ömer Faruk Aydın
2022-09-25 22:48:19 +03:00
committed by GitHub
2 changed files with 13 additions and 7 deletions

View File

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

View File

@@ -35,10 +35,16 @@ const process = (data: any, parentKey?: any, index?: number): any[] => {
export const processStepWithExecutions = (steps: IStep[]): any[] => {
if (!steps) return [];
return steps.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}`),
}));
return steps
.filter((step: IStep) => {
const hasExecutionSteps = !!step.executionSteps?.length;
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}`),
}));
};