Skip to content

Commit

Permalink
fix: Archive UI broken since v3.4.5 (argoproj#10606)
Browse files Browse the repository at this point in the history
Signed-off-by: Petri Kivikangas <36138+Kitanotori@users.noreply.github.com>
  • Loading branch information
nakamorichi committed Mar 2, 2023
1 parent 20adae4 commit e838002
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,10 @@ export class ArchivedWorkflowFilters extends React.Component<ArchivedWorkflowFil
});
}

private fetchArchivedWorkflowsLabels(key: string): Promise<any> {
return services.archivedWorkflows.listLabelValues(key, this.props.namespace).then(list => {
return list.items.map(i => key + '=' + i).sort((a, b) => a.localeCompare(b));
});
private async fetchArchivedWorkflowsLabels(key: string): Promise<string[]> {
const labels = await services.archivedWorkflows.listLabelValues(key, this.props?.namespace);
return labels.items
.map(i => key + '=' + i)
.sort((a, b) => a.localeCompare(b));
}
}
10 changes: 5 additions & 5 deletions ui/src/app/shared/services/archived-workflows-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ export class ArchivedWorkflowsService {
}
}

public listLabelValues(key: string, namespace: string) {
if (namespace === '') {
return requests.get(`api/v1/archived-workflows-label-values?listOptions.labelSelector=${key}`).then(res => res.body as models.Labels);
} else {
return requests.get(`api/v1/archived-workflows-label-values?namespace=${namespace}&listOptions.labelSelector=${key}`).then(res => res.body as models.Labels);
public async listLabelValues(key: string, namespace: string): Promise<models.Labels> {
let url = `api/v1/archived-workflows-label-values?listOptions.labelSelector=${key}`;
if (namespace !== '') {
url += `&namespace=${namespace}`;
}
return (await requests.get(url)).body as models.Labels;
}

public resubmit(uid: string, namespace: string) {
Expand Down

0 comments on commit e838002

Please sign in to comment.