diff --git a/packages/console/src/components/Entities/generators.ts b/packages/console/src/components/Entities/generators.ts index 5d4f3291e..ad98c4713 100644 --- a/packages/console/src/components/Entities/generators.ts +++ b/packages/console/src/components/Entities/generators.ts @@ -16,56 +16,55 @@ export const executionFilterGenerator: { ) => FilterOperation[]; } = { [ResourceType.DATASET]: noFilters, - [ResourceType.LAUNCH_PLAN]: ({ name }, version) => - version + [ResourceType.LAUNCH_PLAN]: ({ name }, version) => [ + { + key: 'launch_plan.name', + operation: FilterOperationName.EQ, + value: name, + }, + ...(version ? [ - { - key: 'launch_plan.name', - operation: FilterOperationName.EQ, - value: name, - }, { key: 'launch_plan.version', operation: FilterOperationName.EQ, value: version, }, ] - : [ - { - key: 'launch_plan.name', - operation: FilterOperationName.EQ, - value: name, - }, - ], - [ResourceType.TASK]: ({ name }) => [ + : []), + ], + [ResourceType.TASK]: ({ name }, version) => [ { key: 'task.name', operation: FilterOperationName.EQ, value: name, }, - ], - [ResourceType.UNSPECIFIED]: noFilters, - [ResourceType.WORKFLOW]: ({ name }, version) => - version + ...(version ? [ { key: 'workflow.version', operation: FilterOperationName.EQ, value: version, }, - { - key: 'workflow.name', - operation: FilterOperationName.EQ, - value: name, - }, ] - : [ + : []), + ], + [ResourceType.UNSPECIFIED]: noFilters, + [ResourceType.WORKFLOW]: ({ name }, version) => [ + { + key: 'workflow.name', + operation: FilterOperationName.EQ, + value: name, + }, + ...(version + ? [ { - key: 'workflow.name', + key: 'workflow.version', operation: FilterOperationName.EQ, - value: name, + value: version, }, - ], + ] + : []), + ], }; const workflowListGenerator = ({ project, domain }: ResourceIdentifier) => @@ -75,14 +74,14 @@ const launchPlanListGenerator = ({ project, domain }: ResourceIdentifier) => const taskListGenerator = ({ project, domain }: ResourceIdentifier) => Routes.ProjectDetails.sections.tasks.makeUrl(project, domain); const unspecifiedGenerator = ({ - project, - domain, + project: _project, + domain: _domain, }: ResourceIdentifier | Identifier) => { throw new Error('Unspecified Resourcetype.'); }; const unimplementedGenerator = ({ - project, - domain, + project: _project, + domain: _domain, }: ResourceIdentifier | Identifier) => { throw new Error('Method not implemented.'); };