Merge pull request #540 from automatisch/issue-539
feat(PowerInput/Suggestions): hide steps without execution steps
This commit is contained in:
@@ -114,7 +114,7 @@ const Suggestions = (props: SuggestionsProps) => {
|
||||
</Button>
|
||||
)}
|
||||
|
||||
{listLength === undefined && (
|
||||
{listLength === Infinity && (
|
||||
<Button
|
||||
fullWidth
|
||||
onClick={collapseList}
|
||||
|
@@ -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}`),
|
||||
}));
|
||||
};
|
||||
|
Reference in New Issue
Block a user