From b4ecd1d2310e7534b0961ec41dd779676ea89f31 Mon Sep 17 00:00:00 2001 From: giancarlo Date: Thu, 28 Mar 2024 20:48:41 +0800 Subject: [PATCH] Refactor invitation system and update UI layout Updated invitation link generation logic to use 'invitePath' instead of 'siteURL' improving the overall invitation system. The changes also entailed multiple updates to the UI ranging from layout modifications to enhanced alerts and descriptions. Additionally, the text and styling of several components, such as the team account settings container and the layout of personal account settings page, were significantly adjusted. --- .../(dashboard)/home/(user)/settings/page.tsx | 17 +++--- .../home/[account]/settings/page.tsx | 2 +- apps/web/public/locales/en/teams.json | 3 +- .../components/sign-up-methods-container.tsx | 11 ++++ .../accept-invitation-container.tsx | 2 +- .../settings/team-account-danger-zone.tsx | 55 ++++++++----------- .../services/account-invitations.service.ts | 2 +- 7 files changed, 49 insertions(+), 43 deletions(-) diff --git a/apps/web/app/(dashboard)/home/(user)/settings/page.tsx b/apps/web/app/(dashboard)/home/(user)/settings/page.tsx index 1a0500742..0bf3be672 100644 --- a/apps/web/app/(dashboard)/home/(user)/settings/page.tsx +++ b/apps/web/app/(dashboard)/home/(user)/settings/page.tsx @@ -1,4 +1,5 @@ import { PersonalAccountSettingsContainer } from '@kit/accounts/personal-account-settings'; +import { PageBody } from '@kit/ui/page'; import featureFlagsConfig from '~/config/feature-flags.config'; import pathsConfig from '~/config/paths.config'; @@ -14,13 +15,15 @@ const paths = { function PersonalAccountSettingsPage() { return ( -
- -
+ +
+ +
+
); } diff --git a/apps/web/app/(dashboard)/home/[account]/settings/page.tsx b/apps/web/app/(dashboard)/home/[account]/settings/page.tsx index 4d9967afc..154bfc61c 100644 --- a/apps/web/app/(dashboard)/home/[account]/settings/page.tsx +++ b/apps/web/app/(dashboard)/home/[account]/settings/page.tsx @@ -45,7 +45,7 @@ async function TeamAccountSettingsPage(props: Props) {
+ + + You have been invited to join a team + + Please sign up to continue with the invitation and create your + account. + + + + diff --git a/packages/features/team-accounts/src/components/invitations/accept-invitation-container.tsx b/packages/features/team-accounts/src/components/invitations/accept-invitation-container.tsx index ead04bbfc..740583a2e 100644 --- a/packages/features/team-accounts/src/components/invitations/accept-invitation-container.tsx +++ b/packages/features/team-accounts/src/components/invitations/accept-invitation-container.tsx @@ -28,7 +28,7 @@ export function AcceptInvitationContainer(props: { }; }) { return ( -
+
-

+

-
- - + + +
- +
+
- - - - - + + + + + - - - - + + + + - }> -
- - -
- -
-
-
-
+ }> +
+ +
+
@@ -287,8 +278,8 @@ function LeaveTeamContainer(props: { -
-
+ +
); } @@ -302,7 +293,7 @@ function LeaveTeamSubmitButton() { disabled={pending} variant={'destructive'} > - + ); } diff --git a/packages/features/team-accounts/src/server/services/account-invitations.service.ts b/packages/features/team-accounts/src/server/services/account-invitations.service.ts index d28f9ff6d..a9dde6141 100644 --- a/packages/features/team-accounts/src/server/services/account-invitations.service.ts +++ b/packages/features/team-accounts/src/server/services/account-invitations.service.ts @@ -238,6 +238,6 @@ export class AccountInvitationsService { } private getInvitationLink(token: string) { - return new URL(env.siteURL, env.siteURL).href + `?invite_token=${token}`; + return new URL(env.invitePath, env.siteURL).href + `?invite_token=${token}`; } }