Skip to content

Commit

Permalink
Alphabetize system cards in "view systems" page (#3781)
Browse files Browse the repository at this point in the history
  • Loading branch information
jpople authored Jul 13, 2023
1 parent 369c789 commit 49fe64c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ The types of changes are:
- Bumped supported Python versions to `3.10.12`, `3.9.17`, and `3.8.17` [#3733](https://github.com/ethyca/fides/pull/3733)
- Logging Updates [#3758](https://github.com/ethyca/fides/pull/3758)
- Add polyfill service to fides-js route [#3759](https://github.com/ethyca/fides/pull/3759)
- Sort system cards alphabetically by name on "View systems" page [#3781](https://github.com/ethyca/fides/pull/3781)

### Removed

Expand Down
8 changes: 8 additions & 0 deletions clients/admin-ui/src/features/system/system.slice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@ const systemApi = baseApi.injectEndpoints({
getAllSystems: build.query<SystemResponse[], void>({
query: () => ({ url: `system/` }),
providesTags: () => ["System"],
transformResponse: (systems: SystemResponse[]) =>
systems.sort((a, b) => {
const displayName = (system: SystemResponse) =>
system.name === "" || system.name == null
? system.fides_key
: system.name;
return displayName(a).localeCompare(displayName(b));
}),
}),
getSystemByFidesKey: build.query<SystemResponse, string>({
query: (fides_key) => ({ url: `system/${fides_key}/` }),
Expand Down

0 comments on commit 49fe64c

Please sign in to comment.