0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2025-03-31 22:51:25 -05:00

fix(console,phrases): update content of assigning new roles on app details page (#4588)

This commit is contained in:
Darcy Ye 2023-09-27 14:13:14 +08:00 committed by GitHub
parent 6a32f50d15
commit 65b68a91f2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 28 additions and 19 deletions

View file

@ -1,4 +1,4 @@
import type { RoleResponse } from '@logto/schemas';
import { type RoleResponse, RoleType } from '@logto/schemas';
import { useTranslation } from 'react-i18next';
import Checkbox from '@/ds-components/Checkbox';
@ -8,13 +8,14 @@ import * as styles from './index.module.scss';
type Props = {
role: RoleResponse;
type: RoleType;
isSelected: boolean;
onSelect: () => void;
};
function SourceRoleItem({ role, isSelected, onSelect }: Props) {
function SourceRoleItem({ role, type, isSelected, onSelect }: Props) {
const { t } = useTranslation(undefined, { keyPrefix: 'admin_console' });
const { name, usersCount } = role;
const { name, usersCount, applicationsCount } = role;
return (
<div
@ -36,7 +37,14 @@ function SourceRoleItem({ role, isSelected, onSelect }: Props) {
/>
<div className={styles.name}>{name}</div>
<div className={styles.count}>
({t('user_details.roles.assigned_user_count', { value: usersCount })})
(
{t(
type === RoleType.User
? 'user_details.roles.assigned_user_count'
: 'application_details.roles.assigned_app_count',
{ value: type === RoleType.User ? usersCount : applicationsCount }
)}
)
</div>
</div>
);

View file

@ -95,6 +95,7 @@ function SourceRolesBox({ entityId, type, selectedRoles, onChange }: Props) {
<SourceRoleItem
key={role.id}
role={role}
type={type}
isSelected={isSelected}
onSelect={() => {
onChange(

View file

@ -83,7 +83,7 @@ const application_details = {
/** UNTRANSLATED */
added_text: '{{value, number}} added',
/** UNTRANSLATED */
assigned_user_count: '{{value, number}} users',
assigned_app_count: '{{value, number}} applications',
/** UNTRANSLATED */
confirm_assign: 'Assign roles',
/** UNTRANSLATED */

View file

@ -83,7 +83,7 @@ const application_details = {
/** UNTRANSLATED */
added_text: '{{value, number}} added',
/** UNTRANSLATED */
assigned_user_count: '{{value, number}} users',
assigned_app_count: '{{value, number}} applications',
/** UNTRANSLATED */
confirm_assign: 'Assign roles',
/** UNTRANSLATED */

View file

@ -83,7 +83,7 @@ const application_details = {
/** UNTRANSLATED */
added_text: '{{value, number}} added',
/** UNTRANSLATED */
assigned_user_count: '{{value, number}} users',
assigned_app_count: '{{value, number}} applications',
/** UNTRANSLATED */
confirm_assign: 'Assign roles',
/** UNTRANSLATED */

View file

@ -83,7 +83,7 @@ const application_details = {
/** UNTRANSLATED */
added_text: '{{value, number}} added',
/** UNTRANSLATED */
assigned_user_count: '{{value, number}} users',
assigned_app_count: '{{value, number}} applications',
/** UNTRANSLATED */
confirm_assign: 'Assign roles',
/** UNTRANSLATED */

View file

@ -83,7 +83,7 @@ const application_details = {
/** UNTRANSLATED */
added_text: '{{value, number}} added',
/** UNTRANSLATED */
assigned_user_count: '{{value, number}} users',
assigned_app_count: '{{value, number}} applications',
/** UNTRANSLATED */
confirm_assign: 'Assign roles',
/** UNTRANSLATED */

View file

@ -83,7 +83,7 @@ const application_details = {
/** UNTRANSLATED */
added_text: '{{value, number}} added',
/** UNTRANSLATED */
assigned_user_count: '{{value, number}} users',
assigned_app_count: '{{value, number}} applications',
/** UNTRANSLATED */
confirm_assign: 'Assign roles',
/** UNTRANSLATED */

View file

@ -83,7 +83,7 @@ const application_details = {
/** UNTRANSLATED */
added_text: '{{value, number}} added',
/** UNTRANSLATED */
assigned_user_count: '{{value, number}} users',
assigned_app_count: '{{value, number}} applications',
/** UNTRANSLATED */
confirm_assign: 'Assign roles',
/** UNTRANSLATED */

View file

@ -83,7 +83,7 @@ const application_details = {
/** UNTRANSLATED */
added_text: '{{value, number}} added',
/** UNTRANSLATED */
assigned_user_count: '{{value, number}} users',
assigned_app_count: '{{value, number}} applications',
/** UNTRANSLATED */
confirm_assign: 'Assign roles',
/** UNTRANSLATED */

View file

@ -83,7 +83,7 @@ const application_details = {
/** UNTRANSLATED */
added_text: '{{value, number}} added',
/** UNTRANSLATED */
assigned_user_count: '{{value, number}} users',
assigned_app_count: '{{value, number}} applications',
/** UNTRANSLATED */
confirm_assign: 'Assign roles',
/** UNTRANSLATED */

View file

@ -83,7 +83,7 @@ const application_details = {
/** UNTRANSLATED */
added_text: '{{value, number}} added',
/** UNTRANSLATED */
assigned_user_count: '{{value, number}} users',
assigned_app_count: '{{value, number}} applications',
/** UNTRANSLATED */
confirm_assign: 'Assign roles',
/** UNTRANSLATED */

View file

@ -83,7 +83,7 @@ const application_details = {
/** UNTRANSLATED */
added_text: '{{value, number}} added',
/** UNTRANSLATED */
assigned_user_count: '{{value, number}} users',
assigned_app_count: '{{value, number}} applications',
/** UNTRANSLATED */
confirm_assign: 'Assign roles',
/** UNTRANSLATED */

View file

@ -83,7 +83,7 @@ const application_details = {
/** UNTRANSLATED */
added_text: '{{value, number}} added',
/** UNTRANSLATED */
assigned_user_count: '{{value, number}} users',
assigned_app_count: '{{value, number}} applications',
/** UNTRANSLATED */
confirm_assign: 'Assign roles',
/** UNTRANSLATED */

View file

@ -80,7 +80,7 @@ const application_details = {
/** UNTRANSLATED */
added_text: '{{value, number}} added',
/** UNTRANSLATED */
assigned_user_count: '{{value, number}} users',
assigned_app_count: '{{value, number}} applications',
/** UNTRANSLATED */
confirm_assign: 'Assign roles',
/** UNTRANSLATED */

View file

@ -80,7 +80,7 @@ const application_details = {
/** UNTRANSLATED */
added_text: '{{value, number}} added',
/** UNTRANSLATED */
assigned_user_count: '{{value, number}} users',
assigned_app_count: '{{value, number}} applications',
/** UNTRANSLATED */
confirm_assign: 'Assign roles',
/** UNTRANSLATED */

View file

@ -81,7 +81,7 @@ const application_details = {
/** UNTRANSLATED */
added_text: '{{value, number}} added',
/** UNTRANSLATED */
assigned_user_count: '{{value, number}} users',
assigned_app_count: '{{value, number}} applications',
/** UNTRANSLATED */
confirm_assign: 'Assign roles',
/** UNTRANSLATED */