feat(MED-97): show person name instead of keycloak email in company invite form
This commit is contained in:
@@ -10,7 +10,7 @@ import { withI18n } from '~/lib/i18n/with-i18n';
|
||||
import Cart from '../../_components/cart';
|
||||
import CartTimer from '../../_components/cart/cart-timer';
|
||||
import { loadCurrentUserAccount } from '../../_lib/server/load-user-account';
|
||||
import { AccountBalanceService } from '~/lib/services/accountBalance.service';
|
||||
import { AccountBalanceService } from '@kit/accounts/services/account-balance.service';
|
||||
|
||||
export async function generateMetadata() {
|
||||
const { t } = await createI18nServerInstance();
|
||||
|
||||
@@ -17,6 +17,7 @@ import { Trans } from '@kit/ui/trans';
|
||||
|
||||
import { createI18nServerInstance } from '~/lib/i18n/i18n.server';
|
||||
import { withI18n } from '~/lib/i18n/with-i18n';
|
||||
import { toTitleCase } from '~/lib/utils';
|
||||
|
||||
interface JoinTeamAccountPageProps {
|
||||
searchParams: Promise<{
|
||||
@@ -110,12 +111,12 @@ async function JoinTeamAccountPage(props: JoinTeamAccountPageProps) {
|
||||
// once the user accepts the invitation, we redirect them to the account home page
|
||||
const membershipConfirmation = pathsConfig.auth.membershipConfirmation;
|
||||
|
||||
const email = auth.data.email ?? '';
|
||||
const fullName = toTitleCase(auth.data.user_metadata.full_name ?? '');
|
||||
|
||||
return (
|
||||
<AuthLayoutShell Logo={AppLogo}>
|
||||
<AcceptInvitationContainer
|
||||
email={email}
|
||||
fullName={fullName}
|
||||
inviteToken={token}
|
||||
invitation={invitation}
|
||||
paths={{
|
||||
|
||||
@@ -6,7 +6,7 @@ import { HttpTypes } from '@medusajs/types';
|
||||
|
||||
import { getAuthHeaders, getCacheOptions } from './cookies';
|
||||
|
||||
export const retrieveOrder = async (id: string) => {
|
||||
export const retrieveOrder = async (id: string, allowCache = true) => {
|
||||
const headers = {
|
||||
...(await getAuthHeaders()),
|
||||
};
|
||||
@@ -24,7 +24,7 @@ export const retrieveOrder = async (id: string) => {
|
||||
},
|
||||
headers,
|
||||
next,
|
||||
cache: 'force-cache',
|
||||
...(allowCache ? { cache: 'force-cache' } : {}),
|
||||
})
|
||||
.then(({ order }) => order)
|
||||
.catch((err) => medusaError(err));
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import Image from 'next/image';
|
||||
|
||||
import { useDismissNotification } from '@kit/notifications/hooks';
|
||||
import { Heading } from '@kit/ui/heading';
|
||||
import { If } from '@kit/ui/if';
|
||||
import { Separator } from '@kit/ui/separator';
|
||||
@@ -12,7 +11,7 @@ import { SignOutInvitationButton } from './sign-out-invitation-button';
|
||||
|
||||
export function AcceptInvitationContainer(props: {
|
||||
inviteToken: string;
|
||||
email: string;
|
||||
fullName: string;
|
||||
|
||||
invitation: {
|
||||
id: string;
|
||||
@@ -76,7 +75,7 @@ export function AcceptInvitationContainer(props: {
|
||||
/>
|
||||
|
||||
<InvitationSubmitButton
|
||||
email={props.email}
|
||||
fullName={props.fullName}
|
||||
accountName={props.invitation.account.name}
|
||||
/>
|
||||
</form>
|
||||
|
||||
@@ -7,7 +7,7 @@ import { Trans } from '@kit/ui/trans';
|
||||
|
||||
export function InvitationSubmitButton(props: {
|
||||
accountName: string;
|
||||
email: string;
|
||||
fullName: string;
|
||||
}) {
|
||||
const { pending } = useFormStatus();
|
||||
|
||||
@@ -17,7 +17,7 @@ export function InvitationSubmitButton(props: {
|
||||
i18nKey={pending ? 'teams:joiningTeam' : 'teams:continueAs'}
|
||||
values={{
|
||||
accountName: props.accountName,
|
||||
email: props.email,
|
||||
fullName: props.fullName,
|
||||
}}
|
||||
/>
|
||||
</Button>
|
||||
|
||||
Reference in New Issue
Block a user