fix: Administrator label in /settings/users #2594
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Headline
Fix the admin label on
<UsersTable />
within/settings/users
Details
In
src/app/(main)/settings/users/UsersTable.tsx:25
it expects to find a roleROLES['admin']
based on the role name in the database, which doesn't exist. Everywhere else in the codebase it seems to useROLES.administrator
.This is the easiest/most backwards compatible way I could think of to fix this, without requiring a migration to update the users' role fields in the database.
Before:
After:
I haven't worked with this translation lib before, so hopefully I updated things correctly- please check my work and let me know if there is a different/better way to do this with
react-intl