From 316c11128afde70d7a9dc46c834edd77ad26d104 Mon Sep 17 00:00:00 2001 From: Charles Zhao Date: Wed, 3 Apr 2024 16:28:45 +0800 Subject: [PATCH] refactor(console,phrases): display inviter name on tenant invitations table (#5622) * refactor(console,phrases): display inviter name on tenant invitations table * chore: bump @logto/cloud * chore: update pnpm lockfile --- .../connector-logto-email/package.json | 2 +- packages/console/package.json | 2 +- .../TenantMembers/Invitations/index.tsx | 17 +++++++++-------- packages/core/package.json | 2 +- .../translation/admin-console/tenant-members.ts | 2 +- .../translation/admin-console/tenant-members.ts | 2 +- .../translation/admin-console/tenant-members.ts | 2 +- .../translation/admin-console/tenant-members.ts | 2 +- .../translation/admin-console/tenant-members.ts | 2 +- .../translation/admin-console/tenant-members.ts | 2 +- .../translation/admin-console/tenant-members.ts | 2 +- .../translation/admin-console/tenant-members.ts | 2 +- .../translation/admin-console/tenant-members.ts | 2 +- .../translation/admin-console/tenant-members.ts | 2 +- .../translation/admin-console/tenant-members.ts | 2 +- .../translation/admin-console/tenant-members.ts | 2 +- .../translation/admin-console/tenant-members.ts | 2 +- .../translation/admin-console/tenant-members.ts | 2 +- .../translation/admin-console/tenant-members.ts | 2 +- pnpm-lock.yaml | 16 ++++++++-------- 20 files changed, 35 insertions(+), 34 deletions(-) diff --git a/packages/connectors/connector-logto-email/package.json b/packages/connectors/connector-logto-email/package.json index efd36eac3..c35c5cab5 100644 --- a/packages/connectors/connector-logto-email/package.json +++ b/packages/connectors/connector-logto-email/package.json @@ -48,6 +48,6 @@ "access": "public" }, "devDependencies": { - "@logto/cloud": "0.2.5-c2fffa4" + "@logto/cloud": "0.2.5-6c090b2" } } diff --git a/packages/console/package.json b/packages/console/package.json index abfabf42b..feb68a1ce 100644 --- a/packages/console/package.json +++ b/packages/console/package.json @@ -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-c2fffa4", + "@logto/cloud": "0.2.5-6c090b2", "@logto/connector-kit": "workspace:^2.1.0", "@logto/core-kit": "workspace:^2.3.0", "@logto/language-kit": "workspace:^1.1.0", diff --git a/packages/console/src/pages/TenantSettings/TenantMembers/Invitations/index.tsx b/packages/console/src/pages/TenantSettings/TenantMembers/Invitations/index.tsx index b8501f848..9b2eb0ae6 100644 --- a/packages/console/src/pages/TenantSettings/TenantMembers/Invitations/index.tsx +++ b/packages/console/src/pages/TenantSettings/TenantMembers/Invitations/index.tsx @@ -15,6 +15,7 @@ import UsersEmptyDark from '@/assets/images/users-empty-dark.svg'; import UsersEmpty from '@/assets/images/users-empty.svg'; import { useAuthedCloudApi } from '@/cloud/hooks/use-cloud-api'; import type { InvitationResponse, TenantInvitationResponse } from '@/cloud/types/router'; +import Breakable from '@/components/Breakable'; import { RoleOption } from '@/components/OrganizationRolesSelect'; import { TenantsContext } from '@/contexts/TenantsProvider'; import ActionMenu, { ActionMenuItem } from '@/ds-components/ActionMenu'; @@ -129,13 +130,13 @@ function Invitations() { columns={[ { dataIndex: 'user', - colSpan: 4, + colSpan: 2, title: t('user'), render: ({ invitee }) => {invitee}, }, { dataIndex: 'roles', - colSpan: 4, + colSpan: 2, title: t('roles'), render: ({ organizationRoles }) => { if (organizationRoles.length === 0) { @@ -154,7 +155,7 @@ function Invitations() { }, { dataIndex: 'status', - colSpan: 4, + colSpan: 2, title: t('invitation_status'), render: ({ status }) => ( @@ -163,14 +164,14 @@ function Invitations() { ), }, { - dataIndex: 'sentAt', - colSpan: 4, - title: t('invitation_sent'), - render: ({ createdAt }) => {format(createdAt, 'MMM do, yyyy')}, + dataIndex: 'inviter', + colSpan: 3, + title: t('inviter'), + render: ({ inviterName }) => {inviterName ?? '-'}, }, { dataIndex: 'expiresAt', - colSpan: 4, + colSpan: 2, title: t('expiration_date'), render: ({ expiresAt }) => {format(expiresAt, 'MMM do, yyyy')}, }, diff --git a/packages/core/package.json b/packages/core/package.json index bbf631a98..32157e3ad 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -91,7 +91,7 @@ "zod": "^3.22.4" }, "devDependencies": { - "@logto/cloud": "0.2.5-c2fffa4", + "@logto/cloud": "0.2.5-6c090b2", "@silverhand/eslint-config": "5.0.0", "@silverhand/ts-config": "5.0.0", "@types/debug": "^4.1.7", diff --git a/packages/phrases/src/locales/de/translation/admin-console/tenant-members.ts b/packages/phrases/src/locales/de/translation/admin-console/tenant-members.ts index 5a14577ca..2c8f036ae 100644 --- a/packages/phrases/src/locales/de/translation/admin-console/tenant-members.ts +++ b/packages/phrases/src/locales/de/translation/admin-console/tenant-members.ts @@ -16,7 +16,7 @@ const tenant_members = { /** UNTRANSLATED */ invitation_status: 'Invitation status', /** UNTRANSLATED */ - invitation_sent: 'Invitation sent', + inviter: 'Inviter', /** UNTRANSLATED */ expiration_date: 'Expiration date', invite_modal: { diff --git a/packages/phrases/src/locales/en/translation/admin-console/tenant-members.ts b/packages/phrases/src/locales/en/translation/admin-console/tenant-members.ts index 4ba130017..5f1cf508e 100644 --- a/packages/phrases/src/locales/en/translation/admin-console/tenant-members.ts +++ b/packages/phrases/src/locales/en/translation/admin-console/tenant-members.ts @@ -7,7 +7,7 @@ const tenant_members = { admin: 'Admin', collaborator: 'Collaborator', invitation_status: 'Invitation status', - invitation_sent: 'Invitation sent', + inviter: 'Inviter', expiration_date: 'Expiration date', invite_modal: { title: 'Invite people to Silverhand', diff --git a/packages/phrases/src/locales/es/translation/admin-console/tenant-members.ts b/packages/phrases/src/locales/es/translation/admin-console/tenant-members.ts index 5a14577ca..2c8f036ae 100644 --- a/packages/phrases/src/locales/es/translation/admin-console/tenant-members.ts +++ b/packages/phrases/src/locales/es/translation/admin-console/tenant-members.ts @@ -16,7 +16,7 @@ const tenant_members = { /** UNTRANSLATED */ invitation_status: 'Invitation status', /** UNTRANSLATED */ - invitation_sent: 'Invitation sent', + inviter: 'Inviter', /** UNTRANSLATED */ expiration_date: 'Expiration date', invite_modal: { diff --git a/packages/phrases/src/locales/fr/translation/admin-console/tenant-members.ts b/packages/phrases/src/locales/fr/translation/admin-console/tenant-members.ts index 5a14577ca..2c8f036ae 100644 --- a/packages/phrases/src/locales/fr/translation/admin-console/tenant-members.ts +++ b/packages/phrases/src/locales/fr/translation/admin-console/tenant-members.ts @@ -16,7 +16,7 @@ const tenant_members = { /** UNTRANSLATED */ invitation_status: 'Invitation status', /** UNTRANSLATED */ - invitation_sent: 'Invitation sent', + inviter: 'Inviter', /** UNTRANSLATED */ expiration_date: 'Expiration date', invite_modal: { diff --git a/packages/phrases/src/locales/it/translation/admin-console/tenant-members.ts b/packages/phrases/src/locales/it/translation/admin-console/tenant-members.ts index 5a14577ca..2c8f036ae 100644 --- a/packages/phrases/src/locales/it/translation/admin-console/tenant-members.ts +++ b/packages/phrases/src/locales/it/translation/admin-console/tenant-members.ts @@ -16,7 +16,7 @@ const tenant_members = { /** UNTRANSLATED */ invitation_status: 'Invitation status', /** UNTRANSLATED */ - invitation_sent: 'Invitation sent', + inviter: 'Inviter', /** UNTRANSLATED */ expiration_date: 'Expiration date', invite_modal: { diff --git a/packages/phrases/src/locales/ja/translation/admin-console/tenant-members.ts b/packages/phrases/src/locales/ja/translation/admin-console/tenant-members.ts index 5a14577ca..2c8f036ae 100644 --- a/packages/phrases/src/locales/ja/translation/admin-console/tenant-members.ts +++ b/packages/phrases/src/locales/ja/translation/admin-console/tenant-members.ts @@ -16,7 +16,7 @@ const tenant_members = { /** UNTRANSLATED */ invitation_status: 'Invitation status', /** UNTRANSLATED */ - invitation_sent: 'Invitation sent', + inviter: 'Inviter', /** UNTRANSLATED */ expiration_date: 'Expiration date', invite_modal: { diff --git a/packages/phrases/src/locales/ko/translation/admin-console/tenant-members.ts b/packages/phrases/src/locales/ko/translation/admin-console/tenant-members.ts index 5a14577ca..2c8f036ae 100644 --- a/packages/phrases/src/locales/ko/translation/admin-console/tenant-members.ts +++ b/packages/phrases/src/locales/ko/translation/admin-console/tenant-members.ts @@ -16,7 +16,7 @@ const tenant_members = { /** UNTRANSLATED */ invitation_status: 'Invitation status', /** UNTRANSLATED */ - invitation_sent: 'Invitation sent', + inviter: 'Inviter', /** UNTRANSLATED */ expiration_date: 'Expiration date', invite_modal: { diff --git a/packages/phrases/src/locales/pl-pl/translation/admin-console/tenant-members.ts b/packages/phrases/src/locales/pl-pl/translation/admin-console/tenant-members.ts index 5a14577ca..2c8f036ae 100644 --- a/packages/phrases/src/locales/pl-pl/translation/admin-console/tenant-members.ts +++ b/packages/phrases/src/locales/pl-pl/translation/admin-console/tenant-members.ts @@ -16,7 +16,7 @@ const tenant_members = { /** UNTRANSLATED */ invitation_status: 'Invitation status', /** UNTRANSLATED */ - invitation_sent: 'Invitation sent', + inviter: 'Inviter', /** UNTRANSLATED */ expiration_date: 'Expiration date', invite_modal: { diff --git a/packages/phrases/src/locales/pt-br/translation/admin-console/tenant-members.ts b/packages/phrases/src/locales/pt-br/translation/admin-console/tenant-members.ts index 5a14577ca..2c8f036ae 100644 --- a/packages/phrases/src/locales/pt-br/translation/admin-console/tenant-members.ts +++ b/packages/phrases/src/locales/pt-br/translation/admin-console/tenant-members.ts @@ -16,7 +16,7 @@ const tenant_members = { /** UNTRANSLATED */ invitation_status: 'Invitation status', /** UNTRANSLATED */ - invitation_sent: 'Invitation sent', + inviter: 'Inviter', /** UNTRANSLATED */ expiration_date: 'Expiration date', invite_modal: { diff --git a/packages/phrases/src/locales/pt-pt/translation/admin-console/tenant-members.ts b/packages/phrases/src/locales/pt-pt/translation/admin-console/tenant-members.ts index 5a14577ca..2c8f036ae 100644 --- a/packages/phrases/src/locales/pt-pt/translation/admin-console/tenant-members.ts +++ b/packages/phrases/src/locales/pt-pt/translation/admin-console/tenant-members.ts @@ -16,7 +16,7 @@ const tenant_members = { /** UNTRANSLATED */ invitation_status: 'Invitation status', /** UNTRANSLATED */ - invitation_sent: 'Invitation sent', + inviter: 'Inviter', /** UNTRANSLATED */ expiration_date: 'Expiration date', invite_modal: { diff --git a/packages/phrases/src/locales/ru/translation/admin-console/tenant-members.ts b/packages/phrases/src/locales/ru/translation/admin-console/tenant-members.ts index 5a14577ca..2c8f036ae 100644 --- a/packages/phrases/src/locales/ru/translation/admin-console/tenant-members.ts +++ b/packages/phrases/src/locales/ru/translation/admin-console/tenant-members.ts @@ -16,7 +16,7 @@ const tenant_members = { /** UNTRANSLATED */ invitation_status: 'Invitation status', /** UNTRANSLATED */ - invitation_sent: 'Invitation sent', + inviter: 'Inviter', /** UNTRANSLATED */ expiration_date: 'Expiration date', invite_modal: { diff --git a/packages/phrases/src/locales/tr-tr/translation/admin-console/tenant-members.ts b/packages/phrases/src/locales/tr-tr/translation/admin-console/tenant-members.ts index 5a14577ca..2c8f036ae 100644 --- a/packages/phrases/src/locales/tr-tr/translation/admin-console/tenant-members.ts +++ b/packages/phrases/src/locales/tr-tr/translation/admin-console/tenant-members.ts @@ -16,7 +16,7 @@ const tenant_members = { /** UNTRANSLATED */ invitation_status: 'Invitation status', /** UNTRANSLATED */ - invitation_sent: 'Invitation sent', + inviter: 'Inviter', /** UNTRANSLATED */ expiration_date: 'Expiration date', invite_modal: { diff --git a/packages/phrases/src/locales/zh-cn/translation/admin-console/tenant-members.ts b/packages/phrases/src/locales/zh-cn/translation/admin-console/tenant-members.ts index 5a14577ca..2c8f036ae 100644 --- a/packages/phrases/src/locales/zh-cn/translation/admin-console/tenant-members.ts +++ b/packages/phrases/src/locales/zh-cn/translation/admin-console/tenant-members.ts @@ -16,7 +16,7 @@ const tenant_members = { /** UNTRANSLATED */ invitation_status: 'Invitation status', /** UNTRANSLATED */ - invitation_sent: 'Invitation sent', + inviter: 'Inviter', /** UNTRANSLATED */ expiration_date: 'Expiration date', invite_modal: { diff --git a/packages/phrases/src/locales/zh-hk/translation/admin-console/tenant-members.ts b/packages/phrases/src/locales/zh-hk/translation/admin-console/tenant-members.ts index 5a14577ca..2c8f036ae 100644 --- a/packages/phrases/src/locales/zh-hk/translation/admin-console/tenant-members.ts +++ b/packages/phrases/src/locales/zh-hk/translation/admin-console/tenant-members.ts @@ -16,7 +16,7 @@ const tenant_members = { /** UNTRANSLATED */ invitation_status: 'Invitation status', /** UNTRANSLATED */ - invitation_sent: 'Invitation sent', + inviter: 'Inviter', /** UNTRANSLATED */ expiration_date: 'Expiration date', invite_modal: { diff --git a/packages/phrases/src/locales/zh-tw/translation/admin-console/tenant-members.ts b/packages/phrases/src/locales/zh-tw/translation/admin-console/tenant-members.ts index 5a14577ca..2c8f036ae 100644 --- a/packages/phrases/src/locales/zh-tw/translation/admin-console/tenant-members.ts +++ b/packages/phrases/src/locales/zh-tw/translation/admin-console/tenant-members.ts @@ -16,7 +16,7 @@ const tenant_members = { /** UNTRANSLATED */ invitation_status: 'Invitation status', /** UNTRANSLATED */ - invitation_sent: 'Invitation sent', + inviter: 'Inviter', /** UNTRANSLATED */ expiration_date: 'Expiration date', invite_modal: { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 882f5f939..44dfbd46f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1235,8 +1235,8 @@ importers: version: 3.22.4 devDependencies: '@logto/cloud': - specifier: 0.2.5-c2fffa4 - version: 0.2.5-c2fffa4(zod@3.22.4) + specifier: 0.2.5-6c090b2 + version: 0.2.5-6c090b2(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-c2fffa4 - version: 0.2.5-c2fffa4(zod@3.22.4) + specifier: 0.2.5-6c090b2 + version: 0.2.5-6c090b2(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-c2fffa4 - version: 0.2.5-c2fffa4(zod@3.22.4) + specifier: 0.2.5-6c090b2 + version: 0.2.5-6c090b2(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-c2fffa4(zod@3.22.4): - resolution: {integrity: sha512-l7x0LwqCCkn9rhi0U8vDN76TYWVDs0zJHQd1PVlRuaWKQp7ynxmW5885b1oN2ACsNu6YeHuTuZ/qW8OXsgw0wQ==} + /@logto/cloud@0.2.5-6c090b2(zod@3.22.4): + resolution: {integrity: sha512-hyPwnd3endAlvW3/55zde2g2hUFGDbHMswh1HqIQoizBikgdI1KjZL9YF/kfTGAOr8AYHJQOYOpphWNcNQ1AZQ==} engines: {node: ^20.9.0} dependencies: '@silverhand/essentials': 2.9.0