-
Notifications
You must be signed in to change notification settings - Fork 78
Description
⚠️ Before implementing, read and follow the Implementation Rules in the epic issue #5364. These rules cover mandatory patterns for React component structure, BAI component usage, reactToWebComponent bridge, state management, i18n, error handling, styling, and code quality. The reference implementation isreact/src/components/SignupModal.tsx.Goal: Complete Lit file removal. Each migration must fully replace the Lit source file with React — not just the dialog parts. The migrated Lit
.tsfile and its type declarations must be deleted. This epic is a critical step toward removing all Lit/MWC/Vaadin dependencies from the codebase.
Description
Migrate backend-ai-email-verification-view.ts (Lit-Element) to a React component. This component handles email verification after user signup, with success and failure dialog states.
Part of epic #5364 — Phase 1 (Simple standalone views)
Current Implementation
File: src/components/backend-ai-email-verification-view.ts
Dialogs (2):
#verification-success-dialog— Shows verification success message + login button#verification-fail-dialog— Shows error + email input for resending verification
MWC Components Used:
mwc-textfield(email input in fail dialog)mwc-button(Login button, Send Email button)
State:
client: BackendAIClientclientConfig: ClientConfignotification
Flow:
- Extract
verification_codefrom URL query params - Call
client.cloud.verify_email(token) - On success → show
#verification-success-dialog - On error → show
#verification-fail-dialogwith resend option - Both dialogs redirect to login page on close (
didHideevent)
Resend Flow:
- Validate email format
- POST to
/auth/send_verification_email - Show notification on success/error
Migration Plan
- Create
react/src/components/EmailVerificationView.tsx - Use
BAIModalfor both success and fail states (single modal, conditional content) - Use Ant Design
Input+Formfor email validation - Use
BAIButtonwithactionprop for async resend - Use
useNavigateorwindow.location.hreffor redirect - Register as web component via
reactToWebComponent
Component Mapping
| Current (Lit) | Target (React) |
|---|---|
backend-ai-dialog x2 |
BAIModal with conditional content |
mwc-textfield |
Ant Design Input with Form validation |
mwc-button |
BAIButton |
addEventListener('didHide') |
afterClose callback |
| Direct fetch | useTanMutation or custom hook |
Acceptance Criteria
- EmailVerificationView.tsx created
- Email verification flow works (success + failure paths)
- Email resend functionality works
- Redirect to login after dialog close
- Form validation on email input
- i18n translations preserved
- Registered as web component for backward compatibility