0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2024-12-16 20:26:19 -05:00

refactor(console,phrases): rename tenant member role to collaborator (#5618)

This commit is contained in:
Charles Zhao 2024-04-03 10:36:17 +08:00 committed by GitHub
parent b48479819e
commit 2368cf03c6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
22 changed files with 29 additions and 89 deletions

View file

@ -48,6 +48,6 @@
"access": "public"
},
"devDependencies": {
"@logto/cloud": "0.2.5-2a777a1"
"@logto/cloud": "0.2.5-c2fffa4"
}
}

View file

@ -28,7 +28,7 @@
"@fontsource/roboto-mono": "^5.0.0",
"@jest/types": "^29.5.0",
"@logto/app-insights": "workspace:^1.4.0",
"@logto/cloud": "0.2.5-2a777a1",
"@logto/cloud": "0.2.5-c2fffa4",
"@logto/connector-kit": "workspace:^2.1.0",
"@logto/core-kit": "workspace:^2.3.0",
"@logto/language-kit": "workspace:^1.1.0",

View file

@ -38,11 +38,10 @@ function EditMemberModal({ user, isOpen, onClose }: Props) {
const onSubmit = async () => {
setIsLoading(true);
try {
// TODO: @charles Uncomment later once the Cloud APIs are updated
// await cloudApi.put(`/api/tenants/:tenantId/members/:userId/roles`, {
// params: { tenantId: currentTenantId, userId: user.id },
// body: { roleName: role },
// });
await cloudApi.put(`/api/tenants/:tenantId/members/:userId/roles`, {
params: { tenantId: currentTenantId, userId: user.id },
body: { roleName: role },
});
onClose();
} finally {
setIsLoading(false);

View file

@ -1,4 +1,4 @@
import { OrganizationInvitationStatus } from '@logto/schemas';
import { OrganizationInvitationStatus, TenantRole } from '@logto/schemas';
import { condArray, conditional } from '@silverhand/essentials';
import { format } from 'date-fns';
import { useContext, useState } from 'react';
@ -142,9 +142,12 @@ function Invitations() {
return '-';
}
return organizationRoles.map(({ id, name }) => (
return organizationRoles.map(({ id }) => (
<Tag key={id} variant="cell">
<RoleOption value={id} title={name} />
<RoleOption
value={id}
title={t(id === TenantRole.Admin ? 'admin' : 'collaborator')}
/>
</Tag>
));
},

View file

@ -84,15 +84,14 @@ function InviteMemberModal({ isOpen, onClose }: Props) {
return;
}
// TODO: @charles Uncomment later once the Cloud APIs are updated
// await Promise.all(
// emails.map(async (email) =>
// cloudApi.post('/api/tenants/:tenantId/invitations', {
// params: { tenantId: currentTenantId },
// body: { invitee: email.value, roleName: role },
// })
// )
// );
await Promise.all(
emails.map(async (email) =>
cloudApi.post('/api/tenants/:tenantId/invitations', {
params: { tenantId: currentTenantId },
body: { invitee: email.value, roleName: role },
})
)
);
toast.success(t('messages.invitation_sent'));
onClose(true);
} finally {

View file

@ -91,7 +91,7 @@
"zod": "^3.22.4"
},
"devDependencies": {
"@logto/cloud": "0.2.5-2a777a1",
"@logto/cloud": "0.2.5-c2fffa4",
"@silverhand/eslint-config": "5.0.0",
"@silverhand/ts-config": "5.0.0",
"@types/debug": "^4.1.7",

View file

@ -2,8 +2,6 @@ const tenant_members = {
/** UNTRANSLATED */
members: 'Members',
/** UNTRANSLATED */
collaborators: 'Collaborators',
/** UNTRANSLATED */
invitations: 'Invitations',
/** UNTRANSLATED */
invite_members: 'Invite members',
@ -14,8 +12,6 @@ const tenant_members = {
/** UNTRANSLATED */
admin: 'Admin',
/** UNTRANSLATED */
member: 'Member',
/** UNTRANSLATED */
collaborator: 'Collaborator',
/** UNTRANSLATED */
invitation_status: 'Invitation status',

View file

@ -1,12 +1,10 @@
const tenant_members = {
members: 'Members',
collaborators: 'Collaborators',
invitations: 'Invitations',
invite_members: 'Invite members',
user: 'User',
roles: 'Roles',
admin: 'Admin',
member: 'Member',
collaborator: 'Collaborator',
invitation_status: 'Invitation status',
invitation_sent: 'Invitation sent',

View file

@ -2,8 +2,6 @@ const tenant_members = {
/** UNTRANSLATED */
members: 'Members',
/** UNTRANSLATED */
collaborators: 'Collaborators',
/** UNTRANSLATED */
invitations: 'Invitations',
/** UNTRANSLATED */
invite_members: 'Invite members',
@ -14,8 +12,6 @@ const tenant_members = {
/** UNTRANSLATED */
admin: 'Admin',
/** UNTRANSLATED */
member: 'Member',
/** UNTRANSLATED */
collaborator: 'Collaborator',
/** UNTRANSLATED */
invitation_status: 'Invitation status',

View file

@ -2,8 +2,6 @@ const tenant_members = {
/** UNTRANSLATED */
members: 'Members',
/** UNTRANSLATED */
collaborators: 'Collaborators',
/** UNTRANSLATED */
invitations: 'Invitations',
/** UNTRANSLATED */
invite_members: 'Invite members',
@ -14,8 +12,6 @@ const tenant_members = {
/** UNTRANSLATED */
admin: 'Admin',
/** UNTRANSLATED */
member: 'Member',
/** UNTRANSLATED */
collaborator: 'Collaborator',
/** UNTRANSLATED */
invitation_status: 'Invitation status',

View file

@ -2,8 +2,6 @@ const tenant_members = {
/** UNTRANSLATED */
members: 'Members',
/** UNTRANSLATED */
collaborators: 'Collaborators',
/** UNTRANSLATED */
invitations: 'Invitations',
/** UNTRANSLATED */
invite_members: 'Invite members',
@ -14,8 +12,6 @@ const tenant_members = {
/** UNTRANSLATED */
admin: 'Admin',
/** UNTRANSLATED */
member: 'Member',
/** UNTRANSLATED */
collaborator: 'Collaborator',
/** UNTRANSLATED */
invitation_status: 'Invitation status',

View file

@ -2,8 +2,6 @@ const tenant_members = {
/** UNTRANSLATED */
members: 'Members',
/** UNTRANSLATED */
collaborators: 'Collaborators',
/** UNTRANSLATED */
invitations: 'Invitations',
/** UNTRANSLATED */
invite_members: 'Invite members',
@ -14,8 +12,6 @@ const tenant_members = {
/** UNTRANSLATED */
admin: 'Admin',
/** UNTRANSLATED */
member: 'Member',
/** UNTRANSLATED */
collaborator: 'Collaborator',
/** UNTRANSLATED */
invitation_status: 'Invitation status',

View file

@ -2,8 +2,6 @@ const tenant_members = {
/** UNTRANSLATED */
members: 'Members',
/** UNTRANSLATED */
collaborators: 'Collaborators',
/** UNTRANSLATED */
invitations: 'Invitations',
/** UNTRANSLATED */
invite_members: 'Invite members',
@ -14,8 +12,6 @@ const tenant_members = {
/** UNTRANSLATED */
admin: 'Admin',
/** UNTRANSLATED */
member: 'Member',
/** UNTRANSLATED */
collaborator: 'Collaborator',
/** UNTRANSLATED */
invitation_status: 'Invitation status',

View file

@ -2,8 +2,6 @@ const tenant_members = {
/** UNTRANSLATED */
members: 'Members',
/** UNTRANSLATED */
collaborators: 'Collaborators',
/** UNTRANSLATED */
invitations: 'Invitations',
/** UNTRANSLATED */
invite_members: 'Invite members',
@ -14,8 +12,6 @@ const tenant_members = {
/** UNTRANSLATED */
admin: 'Admin',
/** UNTRANSLATED */
member: 'Member',
/** UNTRANSLATED */
collaborator: 'Collaborator',
/** UNTRANSLATED */
invitation_status: 'Invitation status',

View file

@ -2,8 +2,6 @@ const tenant_members = {
/** UNTRANSLATED */
members: 'Members',
/** UNTRANSLATED */
collaborators: 'Collaborators',
/** UNTRANSLATED */
invitations: 'Invitations',
/** UNTRANSLATED */
invite_members: 'Invite members',
@ -14,8 +12,6 @@ const tenant_members = {
/** UNTRANSLATED */
admin: 'Admin',
/** UNTRANSLATED */
member: 'Member',
/** UNTRANSLATED */
collaborator: 'Collaborator',
/** UNTRANSLATED */
invitation_status: 'Invitation status',

View file

@ -2,8 +2,6 @@ const tenant_members = {
/** UNTRANSLATED */
members: 'Members',
/** UNTRANSLATED */
collaborators: 'Collaborators',
/** UNTRANSLATED */
invitations: 'Invitations',
/** UNTRANSLATED */
invite_members: 'Invite members',
@ -14,8 +12,6 @@ const tenant_members = {
/** UNTRANSLATED */
admin: 'Admin',
/** UNTRANSLATED */
member: 'Member',
/** UNTRANSLATED */
collaborator: 'Collaborator',
/** UNTRANSLATED */
invitation_status: 'Invitation status',

View file

@ -2,8 +2,6 @@ const tenant_members = {
/** UNTRANSLATED */
members: 'Members',
/** UNTRANSLATED */
collaborators: 'Collaborators',
/** UNTRANSLATED */
invitations: 'Invitations',
/** UNTRANSLATED */
invite_members: 'Invite members',
@ -14,8 +12,6 @@ const tenant_members = {
/** UNTRANSLATED */
admin: 'Admin',
/** UNTRANSLATED */
member: 'Member',
/** UNTRANSLATED */
collaborator: 'Collaborator',
/** UNTRANSLATED */
invitation_status: 'Invitation status',

View file

@ -2,8 +2,6 @@ const tenant_members = {
/** UNTRANSLATED */
members: 'Members',
/** UNTRANSLATED */
collaborators: 'Collaborators',
/** UNTRANSLATED */
invitations: 'Invitations',
/** UNTRANSLATED */
invite_members: 'Invite members',
@ -14,8 +12,6 @@ const tenant_members = {
/** UNTRANSLATED */
admin: 'Admin',
/** UNTRANSLATED */
member: 'Member',
/** UNTRANSLATED */
collaborator: 'Collaborator',
/** UNTRANSLATED */
invitation_status: 'Invitation status',

View file

@ -2,8 +2,6 @@ const tenant_members = {
/** UNTRANSLATED */
members: 'Members',
/** UNTRANSLATED */
collaborators: 'Collaborators',
/** UNTRANSLATED */
invitations: 'Invitations',
/** UNTRANSLATED */
invite_members: 'Invite members',
@ -14,8 +12,6 @@ const tenant_members = {
/** UNTRANSLATED */
admin: 'Admin',
/** UNTRANSLATED */
member: 'Member',
/** UNTRANSLATED */
collaborator: 'Collaborator',
/** UNTRANSLATED */
invitation_status: 'Invitation status',

View file

@ -2,8 +2,6 @@ const tenant_members = {
/** UNTRANSLATED */
members: 'Members',
/** UNTRANSLATED */
collaborators: 'Collaborators',
/** UNTRANSLATED */
invitations: 'Invitations',
/** UNTRANSLATED */
invite_members: 'Invite members',
@ -14,8 +12,6 @@ const tenant_members = {
/** UNTRANSLATED */
admin: 'Admin',
/** UNTRANSLATED */
member: 'Member',
/** UNTRANSLATED */
collaborator: 'Collaborator',
/** UNTRANSLATED */
invitation_status: 'Invitation status',

View file

@ -2,8 +2,6 @@ const tenant_members = {
/** UNTRANSLATED */
members: 'Members',
/** UNTRANSLATED */
collaborators: 'Collaborators',
/** UNTRANSLATED */
invitations: 'Invitations',
/** UNTRANSLATED */
invite_members: 'Invite members',
@ -14,8 +12,6 @@ const tenant_members = {
/** UNTRANSLATED */
admin: 'Admin',
/** UNTRANSLATED */
member: 'Member',
/** UNTRANSLATED */
collaborator: 'Collaborator',
/** UNTRANSLATED */
invitation_status: 'Invitation status',

View file

@ -1235,8 +1235,8 @@ importers:
version: 3.22.4
devDependencies:
'@logto/cloud':
specifier: 0.2.5-2a777a1
version: 0.2.5-2a777a1(zod@3.22.4)
specifier: 0.2.5-c2fffa4
version: 0.2.5-c2fffa4(zod@3.22.4)
'@rollup/plugin-commonjs':
specifier: ^25.0.0
version: 25.0.7(rollup@4.12.0)
@ -2715,8 +2715,8 @@ importers:
specifier: workspace:^1.4.0
version: link:../app-insights
'@logto/cloud':
specifier: 0.2.5-2a777a1
version: 0.2.5-2a777a1(zod@3.22.4)
specifier: 0.2.5-c2fffa4
version: 0.2.5-c2fffa4(zod@3.22.4)
'@logto/connector-kit':
specifier: workspace:^2.1.0
version: link:../toolkit/connector-kit
@ -3202,8 +3202,8 @@ importers:
version: 3.22.4
devDependencies:
'@logto/cloud':
specifier: 0.2.5-2a777a1
version: 0.2.5-2a777a1(zod@3.22.4)
specifier: 0.2.5-c2fffa4
version: 0.2.5-c2fffa4(zod@3.22.4)
'@silverhand/eslint-config':
specifier: 5.0.0
version: 5.0.0(eslint@8.44.0)(prettier@3.0.0)(typescript@5.3.3)
@ -7644,8 +7644,8 @@ packages:
jose: 5.2.2
dev: true
/@logto/cloud@0.2.5-2a777a1(zod@3.22.4):
resolution: {integrity: sha512-RnU13Hrv5phYtIjVHDo0Ik1ZFvEOT5XBdQ0fDOHBFuGH+1Xd4X4HK79Mm5iC5JMM7KxxuH7bb6lStCvsOkUUYw==}
/@logto/cloud@0.2.5-c2fffa4(zod@3.22.4):
resolution: {integrity: sha512-l7x0LwqCCkn9rhi0U8vDN76TYWVDs0zJHQd1PVlRuaWKQp7ynxmW5885b1oN2ACsNu6YeHuTuZ/qW8OXsgw0wQ==}
engines: {node: ^20.9.0}
dependencies:
'@silverhand/essentials': 2.9.0
@ -17988,9 +17988,6 @@ packages:
resolution: {integrity: sha512-2GTVocFkwblV/TIg9AmT7TI2fO4xdWkyN8aFUEVtiVNWt96GTR3FgQyHFValfCbcj1k9Xf962Ws2hYXYUr9k1Q==}
engines: {node: '>= 12.0.0'}
hasBin: true
peerDependenciesMeta:
'@parcel/core':
optional: true
dependencies:
'@parcel/config-default': 2.9.3(@parcel/core@2.9.3)(postcss@8.4.31)
'@parcel/core': 2.9.3