Skip to content

Commit

Permalink
fix: Fix broken archive UI Fixes argoproj#10606 (argoproj#10622)
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 authored Mar 5, 2023
1 parent 781675d commit d536eec
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,8 @@ 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 d536eec

Please sign in to comment.