Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .changeset/mosaic-auth-start-over-block.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
2 changes: 1 addition & 1 deletion packages/mosaic/AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ Most problems a feature hits already have a shared answer. Find the line for you
- An action that may need step-up verification → `useReverificationFlow` (`src/features/reverification/`) in the model, passed to `useConfirmController`
- A direct action that needs step-up verification → `useReverificationFlow` in the model, with `ReverificationDialog` (`src/blocks/reverification/`) in the view
- A step that verifies a factor (a code, password, backup code or passkey, the method picker, help) → the steps in `src/blocks/verification/`, such as `VerificationCode`
- A screen sign-in and sign-up both show (an email link and its status, a loading or protect-check notice, a blocked request, the wallet or enterprise connection picker, the alternative phone channel, the identity line, the captcha) → the steps in `src/blocks/auth/`, such as `AuthEmailLink`
- A screen sign-in and sign-up both show (an email link and its status, a loading or protect-check notice, a blocked request, the start-over screen, the wallet or enterprise connection picker, the alternative phone channel, the identity line, the captcha) → the steps in `src/blocks/auth/`, such as `AuthEmailLink`
- Showing any error to the user → One of the owners above. They call `toLocalizableError` (or `toLocalizableErrors` for all errors) and resolve copy with `useErrorText`
- Moving focus after a list row is removed → `useListRemovalFocus` (`src/hooks/`)
- A debounced, abortable async check as the user types → `useDebouncedAsync` (`src/hooks/`)
Expand Down
45 changes: 45 additions & 0 deletions packages/mosaic/src/blocks/auth/auth-start-over.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import { SubmitButton } from '../../components/button';
import { Card } from '../../components/card';
import { useFlowAutoFocus } from '../../primitives/flow/flow-step-context';

export interface AuthStartOverMessages {
title: string;
description: string;
action: string;
pending: string;
}

interface AuthStartOverProps {
messages: AuthStartOverMessages;
globalErrorMessage?: string;
isPending?: boolean;
onStartOver: () => void;
}

export function AuthStartOver({ messages, globalErrorMessage, isPending, onStartOver }: AuthStartOverProps) {
return (
<>
<Card.Header>
<Card.Title>{messages.title}</Card.Title>
</Card.Header>
<Card.Banner
role='alert'
color='negative'
>
{globalErrorMessage ?? messages.description}
</Card.Banner>
<Card.Footer>
<SubmitButton
ref={useFlowAutoFocus<HTMLButtonElement>()}
type='button'
fullWidth
isPending={isPending}
pendingLabel={messages.pending}
onClick={onStartOver}
>
{messages.action}
</SubmitButton>
</Card.Footer>
</>
);
}
1 change: 1 addition & 0 deletions packages/mosaic/src/blocks/auth/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export { AuthEnterpriseConnections } from './auth-enterprise-connections';
export { AuthIdentityPreview } from './auth-identity-preview';
export { AuthLoading } from './auth-loading';
export { AuthProtectCheck } from './auth-protect-check';
export { AuthStartOver } from './auth-start-over';
export { AuthWallets } from './auth-wallets';
export type { AuthActionBlockedDetails, AuthEmailLinkStatusValue, AuthProvider } from './auth.types';
export type { AuthEmailLinkStatusMessages } from './auth-email-link-status';
1 change: 1 addition & 0 deletions packages/mosaic/src/features/sign-in/sign-in.messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ export const signInMessages = {
title: 'Something went wrong',
description: 'We couldn’t continue signing you in. Start over to try again.',
action: 'Start over',
pending: 'Starting over',
},
actionBlocked: {
title: 'We couldn’t complete this request',
Expand Down
11 changes: 9 additions & 2 deletions packages/mosaic/src/features/sign-in/steps/notice-step.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
AuthEmailLinkStatus,
AuthLoading,
AuthProtectCheck,
AuthStartOver,
} from '../../../blocks/auth';
import type { VerificationCodeResend } from '../../../blocks/verification';
import { VerificationHelp } from '../../../blocks/verification';
Expand All @@ -16,7 +17,6 @@ import { emailLinkStatusMessages } from '../sign-in.utils';
import { SignInEnterpriseSso } from './sign-in-enterprise-sso';
import { SignInForgotPassword } from './sign-in-forgot-password';
import { SignInPasswordCompromised } from './sign-in-password-compromised';
import { SignInStartOver } from './sign-in-start-over';

interface NoticeStepProps {
step: Extract<SignInStep, { kind: 'notice' }>;
Expand Down Expand Up @@ -187,7 +187,14 @@ export function NoticeStep({
/>
);
case 'start-over':
return <SignInStartOver onStartOver={onStartOver} />;
return (
<AuthStartOver
messages={m.startOver}
globalErrorMessage={globalErrorMessage}
isPending={isPending}
onStartOver={onStartOver}
/>
);
case 'email-link-status':
return (
<AuthEmailLinkStatus
Expand Down
31 changes: 0 additions & 31 deletions packages/mosaic/src/features/sign-in/steps/sign-in-start-over.tsx

This file was deleted.

Loading