Skip to content

Commit

Permalink
fix(ui): labels in report/archive should be sorted (#7009)
Browse files Browse the repository at this point in the history
Signed-off-by: Tianchu Zhao <evantczhao@gmail.com>
  • Loading branch information
tczhao committed Oct 21, 2021
1 parent 50813da commit 7f52623
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -194,14 +194,14 @@ export class ArchivedWorkflowFilters extends React.Component<ArchivedWorkflowFil
private fetchArchivedWorkflowsLabelKeys(): void {
services.archivedWorkflows.listLabelKeys().then(list => {
this.setState({
labels: list.items || []
labels: list.items.sort((a, b) => a.localeCompare(b)) || []
});
});
}

private fetchArchivedWorkflowsLabels(key: string): Promise<any> {
return services.archivedWorkflows.listLabelValues(key).then(list => {
return list.items.map(i => key + '=' + i);
return list.items.map(i => key + '=' + i).sort((a, b) => a.localeCompare(b));
});
}
}
4 changes: 2 additions & 2 deletions ui/src/app/reports/components/reports.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -260,15 +260,15 @@ export class Reports extends BasePage<RouteComponentProps<any>, State> {
if (isArchivedWorkflows) {
services.archivedWorkflows.listLabelKeys().then(list => {
this.setState({
autocompleteLabels: list.items || []
autocompleteLabels: list.items.sort((a, b) => a.localeCompare(b)) || []
});
});
}
}

private fetchArchivedWorkflowsLabels(key: string): Promise<any> {
return services.archivedWorkflows.listLabelValues(key).then(list => {
return list.items.map(i => key + '=' + i);
return list.items.map(i => key + '=' + i).sort((a, b) => a.localeCompare(b));
});
}

Expand Down

0 comments on commit 7f52623

Please sign in to comment.