Update labels and refine hooks for teams and billing modules

This commit modifies several language labels and refines hooks related to 'teams' and 'billing' modules for better clarity and consistency. It also includes the deletion of unused locale files and package dependencies transfered to 'peerDependencies'. Lastly, it introduces minor enhancements in server command, error logging functionality, and scripts to interact with Stripe.
This commit is contained in:
giancarlo
2024-03-26 23:32:28 +08:00
parent 4032aed827
commit e402caff30
52 changed files with 1227 additions and 1049 deletions

View File

@@ -80,9 +80,9 @@ function VerifyOtpForm({
<Button disabled={verifyOtpMutation.isPending || !verifyCode}>
{verifyOtpMutation.isPending ? (
<Trans i18nKey={'profile:verifyingCode'} />
<Trans i18nKey={'account:verifyingCode'} />
) : (
<Trans i18nKey={'profile:submitVerificationCode'} />
<Trans i18nKey={'account:submitVerificationCode'} />
)}
</Button>
</div>

View File

@@ -55,7 +55,7 @@ export function MultiFactorChallengeContainer({
<form onSubmit={onSubmitClicked}>
<div className={'flex flex-col space-y-4'}>
<span className={'text-sm'}>
<Trans i18nKey={'profile:verifyActivationCodeDescription'} />
<Trans i18nKey={'account:verifyActivationCodeDescription'} />
</span>
<div className={'flex w-full flex-col space-y-2.5'}>
@@ -67,7 +67,7 @@ export function MultiFactorChallengeContainer({
<If condition={verifyMFAChallenge.error}>
<Alert variant={'destructive'}>
<AlertDescription>
<Trans i18nKey={'profile:invalidVerificationCode'} />
<Trans i18nKey={'account:invalidVerificationCode'} />
</AlertDescription>
</Alert>
</If>
@@ -75,9 +75,9 @@ export function MultiFactorChallengeContainer({
<Button disabled={verifyMFAChallenge.isPending || !verifyCode}>
{verifyMFAChallenge.isPending ? (
<Trans i18nKey={'profile:verifyingCode'} />
<Trans i18nKey={'account:verifyingCode'} />
) : (
<Trans i18nKey={'profile:submitVerificationCode'} />
<Trans i18nKey={'account:submitVerificationCode'} />
)}
</Button>
</div>
@@ -154,7 +154,7 @@ function FactorsListContainer({
<Spinner />
<div>
<Trans i18nKey={'profile:loadingFactors'} />
<Trans i18nKey={'account:loadingFactors'} />
</div>
</div>
);
@@ -165,7 +165,7 @@ function FactorsListContainer({
<div className={'w-full'}>
<Alert variant={'destructive'}>
<AlertDescription>
<Trans i18nKey={'profile:factorsListError'} />
<Trans i18nKey={'account:factorsListError'} />
</AlertDescription>
</Alert>
</div>
@@ -178,7 +178,7 @@ function FactorsListContainer({
<div className={'flex flex-col space-y-4'}>
<div>
<Heading level={6}>
<Trans i18nKey={'profile:selectFactor'} />
<Trans i18nKey={'account:selectFactor'} />
</Heading>
</div>

View File

@@ -114,11 +114,11 @@ function SuccessState() {
<div className={'flex flex-col space-y-4'}>
<Alert variant={'destructive'}>
<AlertTitle>
<Trans i18nKey={'profile:updatePasswordSuccess'} />
<Trans i18nKey={'account:updatePasswordSuccess'} />
</AlertTitle>
<AlertDescription>
<Trans i18nKey={'profile:updatePasswordSuccessMessage'} />
<Trans i18nKey={'account:updatePasswordSuccessMessage'} />
</AlertDescription>
</Alert>

View File

@@ -30,10 +30,9 @@ export function SignInMethodsContainer(props: {
const router = useRouter();
const nextPath = useSearchParams().get('next') ?? props.paths.home;
const redirectUrl = new URL(
props.paths.callback,
isBrowser() ? window?.location.origin : '',
).toString();
const redirectUrl = isBrowser()
? new URL(props.paths.callback, window?.location.origin).toString()
: '';
const onSignIn = () => {
router.replace(nextPath);