Skip to content

Commit

Permalink
fix: task recent runs should filter by version
Browse files Browse the repository at this point in the history
Signed-off-by: Carina Ursu <[email protected]>
  • Loading branch information
ursucarina committed May 16, 2023
1 parent a4802e0 commit 4babe59
Showing 1 changed file with 31 additions and 32 deletions.
63 changes: 31 additions & 32 deletions packages/console/src/components/Entities/generators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) =>
Expand All @@ -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.');
};
Expand Down

0 comments on commit 4babe59

Please sign in to comment.