Skip to content

Commit

Permalink
Fix filter option sorting for audit dashboard
Browse files Browse the repository at this point in the history
With this commit, the filter options should be sorted alphabetically,
like they were in the past.

Signed-off-by: Nick Gerace <[email protected]>
  • Loading branch information
nickgerace committed Dec 4, 2024
1 parent dd2ddd1 commit a4c1670
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions app/web/src/store/logs.store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,37 +150,43 @@ export const useLogsStore = (forceChangeSetId?: ChangeSetId) => {
Object.keys(inProgressChangeSets).forEach((key) => {
resultForChangeSet.push({ label: key, value: key });
});
resultForChangeSet.sort();
resultForChangeSet.sort((a, b) =>
a.label.localeCompare(b.label),
);
this.headerOptions.changeSet = resultForChangeSet;

const resultForEntityName: { label: string; value: string }[] =
[];
Object.keys(inProgressEntityNames).forEach((key) => {
resultForEntityName.push({ label: key, value: key });
});
resultForEntityName.sort();
resultForEntityName.sort((a, b) =>
a.label.localeCompare(b.label),
);
this.headerOptions.entityName = resultForEntityName;

const resultForEntityType: { label: string; value: string }[] =
[];
Object.keys(inProgressEntityTypes).forEach((key) => {
resultForEntityType.push({ label: key, value: key });
});
resultForEntityType.sort();
resultForEntityType.sort((a, b) =>
a.label.localeCompare(b.label),
);
this.headerOptions.entityType = resultForEntityType;

const resultForTitle: { label: string; value: string }[] = [];
Object.keys(inProgressTitles).forEach((key) => {
resultForTitle.push({ label: key, value: key });
});
resultForTitle.sort();
resultForTitle.sort((a, b) => a.label.localeCompare(b.label));
this.headerOptions.title = resultForTitle;

const resultForUser: { label: string; value: string }[] = [];
Object.keys(inProgressUsers).forEach((key) => {
resultForUser.push({ label: key, value: key });
});
resultForUser.sort();
resultForUser.sort((a, b) => a.label.localeCompare(b.label));
this.headerOptions.user = resultForUser;
},
});
Expand Down

0 comments on commit a4c1670

Please sign in to comment.