feat(translation): add translation for instance roles and remove User roles and RoleRequest roles from shared constants#8378
Open
LWS49 wants to merge 1 commit into
Open
Conversation
| TableState, | ||
| } from 'types/components/DataTable'; | ||
| import { AdminStats, UserMiniEntity, UserRoles } from 'types/users'; | ||
| import { AdminStats, USER_ROLES, UserMiniEntity, UserRoles } from 'types/users'; |
Contributor
There was a problem hiding this comment.
For the system admin roles, translations, etc., let's call the type SystemUserRoles to prevent ambiguity.
8bca175 to
3c098e2
Compare
| export type UserRoles = 'normal' | 'administrator'; | ||
| export const SYSTEM_USER_ROLES = ['normal', 'administrator'] as const; | ||
|
|
||
| export type UserRoles = (typeof SYSTEM_USER_ROLES)[number]; |
Contributor
There was a problem hiding this comment.
this type should also be called SystemUserRoles
| onClick={onDelete} | ||
| title={t(translations.deletionConfirmTitle, { | ||
| role: USER_ROLES[user.role], | ||
| role: t(instanceRoleTranslations[user.role]), |
Contributor
There was a problem hiding this comment.
this implicitly assumes that system roles are a subset of instance roles.
I don't think this assumption will change anytime soon, so I'm OK with doing this.
| expect(screen.getByText('Caitlyn')).toBeInTheDocument(), | ||
| ); | ||
| expect(screen.getByText('-')).toBeInTheDocument(); | ||
| expect(screen.queryByText('-')).not.toBeInTheDocument(); |
Contributor
There was a problem hiding this comment.
Now that we are never rendering - in the UserShow component, is this assertion necessary at all?
Collaborator
Author
There was a problem hiding this comment.
agreed, missed that on refactoring from my previous behaviour. will change accordingly.
3c098e2 to
8003a7b
Compare
… display of instance roles to use translation and remove userroles and role request roles from shared constants
8003a7b to
9a8558f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.