-
Notifications
You must be signed in to change notification settings - Fork 84
Change request/ID verification flow to use separate pages instead of a modal #7238
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
f2182ec
216157d
34e8c91
c080c96
b9d638d
94f7b8e
7bd39f7
302dc23
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| type: Changed # One of: Added, Changed, Developer Experience, Deprecated, Docs, Fixed, Removed, Security | ||
| description: Updated privacy request and ID verification flow to use separate pages instead of a modal | ||
| pr: 7238 # PR number | ||
| labels: [] # Optional: ["high-risk", "db-migration"] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| "use server"; | ||
|
|
||
| import { | ||
| getPageMetadata, | ||
| getPrivacyCenterEnvironmentCached, | ||
| } from "~/app/server-utils"; | ||
| import LoadServerEnvironmentIntoStores from "~/components/LoadServerEnvironmentIntoStores"; | ||
| import PrivacyRequestFormPage from "~/components/privacy-request/PrivacyRequestFormPage"; | ||
| import { PrivacyRequestLayout } from "~/components/privacy-request/PrivacyRequestLayout"; | ||
| import { NextSearchParams } from "~/types/next"; | ||
|
|
||
| export const generateMetadata = getPageMetadata; | ||
|
|
||
| /** | ||
| * Privacy Request Form Page | ||
| * Full-page view for submitting privacy requests (replaces modal) | ||
| */ | ||
| const PrivacyRequestPage = async ({ | ||
| params, | ||
| searchParams, | ||
| }: { | ||
| params: Promise<{ actionIndex: string }>; | ||
| searchParams: NextSearchParams; | ||
| }) => { | ||
| const { actionIndex } = await params; | ||
| const serverEnvironment = await getPrivacyCenterEnvironmentCached({ | ||
| searchParams, | ||
| }); | ||
|
|
||
| return ( | ||
| <LoadServerEnvironmentIntoStores serverEnvironment={serverEnvironment}> | ||
| <PrivacyRequestLayout> | ||
| <PrivacyRequestFormPage actionIndex={actionIndex} /> | ||
| </PrivacyRequestLayout> | ||
| </LoadServerEnvironmentIntoStores> | ||
| ); | ||
| }; | ||
|
|
||
| export default PrivacyRequestPage; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| "use server"; | ||
|
|
||
| import { | ||
| getPageMetadata, | ||
| getPrivacyCenterEnvironmentCached, | ||
| } from "~/app/server-utils"; | ||
| import LoadServerEnvironmentIntoStores from "~/components/LoadServerEnvironmentIntoStores"; | ||
| import { PrivacyRequestLayout } from "~/components/privacy-request/PrivacyRequestLayout"; | ||
| import RequestSubmittedPage from "~/components/privacy-request/RequestSubmittedPage"; | ||
| import { NextSearchParams } from "~/types/next"; | ||
|
|
||
| export const generateMetadata = getPageMetadata; | ||
|
|
||
| /** | ||
| * Privacy Request Success Page | ||
| * Full-page view showing request submitted confirmation | ||
| */ | ||
| const PrivacyRequestSuccessPage = async ({ | ||
| searchParams, | ||
| }: { | ||
| searchParams: NextSearchParams; | ||
| }) => { | ||
| const serverEnvironment = await getPrivacyCenterEnvironmentCached({ | ||
| searchParams, | ||
| }); | ||
|
|
||
| return ( | ||
| <LoadServerEnvironmentIntoStores serverEnvironment={serverEnvironment}> | ||
| <PrivacyRequestLayout title="Request submitted"> | ||
| <RequestSubmittedPage /> | ||
| </PrivacyRequestLayout> | ||
| </LoadServerEnvironmentIntoStores> | ||
| ); | ||
| }; | ||
|
|
||
| export default PrivacyRequestSuccessPage; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| "use server"; | ||
|
|
||
| import { | ||
| getPageMetadata, | ||
| getPrivacyCenterEnvironmentCached, | ||
| } from "~/app/server-utils"; | ||
| import LoadServerEnvironmentIntoStores from "~/components/LoadServerEnvironmentIntoStores"; | ||
| import { PrivacyRequestLayout } from "~/components/privacy-request/PrivacyRequestLayout"; | ||
| import VerificationPage from "~/components/privacy-request/VerificationPage"; | ||
| import { NextSearchParams } from "~/types/next"; | ||
|
|
||
| export const generateMetadata = getPageMetadata; | ||
|
|
||
| /** | ||
| * Privacy Request Verification Page | ||
| * Full-page view for OTP verification (replaces modal) | ||
| */ | ||
| const PrivacyRequestVerifyPage = async ({ | ||
| params, | ||
| searchParams, | ||
| }: { | ||
| params: Promise<{ actionIndex: string }>; | ||
| searchParams: NextSearchParams; | ||
| }) => { | ||
| const { actionIndex } = await params; | ||
| const serverEnvironment = await getPrivacyCenterEnvironmentCached({ | ||
| searchParams, | ||
| }); | ||
|
|
||
| return ( | ||
| <LoadServerEnvironmentIntoStores serverEnvironment={serverEnvironment}> | ||
| <PrivacyRequestLayout title="Enter verification code"> | ||
| <VerificationPage actionIndex={actionIndex} /> | ||
| </PrivacyRequestLayout> | ||
| </LoadServerEnvironmentIntoStores> | ||
| ); | ||
| }; | ||
|
|
||
| export default PrivacyRequestVerifyPage; |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,101 @@ | ||||||||||||||||||||||||||||||||||||||||
| /* eslint-disable @next/next/no-img-element */ | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| "use client"; | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| /** | ||||||||||||||||||||||||||||||||||||||||
| * Shared Auth Form Layout Component | ||||||||||||||||||||||||||||||||||||||||
| * | ||||||||||||||||||||||||||||||||||||||||
| * Provides a reusable full-page layout for authentication and form flows. | ||||||||||||||||||||||||||||||||||||||||
| * Used by both ExternalAuthLayout and PrivacyRequestLayout to avoid duplication. | ||||||||||||||||||||||||||||||||||||||||
| */ | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| import { Flex, Space, Typography } from "fidesui"; | ||||||||||||||||||||||||||||||||||||||||
| import React from "react"; | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| import { useConfig } from "~/features/common/config.slice"; | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| interface AuthFormLayoutProps { | ||||||||||||||||||||||||||||||||||||||||
| children: React.ReactNode; | ||||||||||||||||||||||||||||||||||||||||
| title?: string; | ||||||||||||||||||||||||||||||||||||||||
| maxWidth?: string; | ||||||||||||||||||||||||||||||||||||||||
| showTitleOnDesktop?: boolean; | ||||||||||||||||||||||||||||||||||||||||
| dataTestId?: string; | ||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| export const AuthFormLayout = ({ | ||||||||||||||||||||||||||||||||||||||||
| children, | ||||||||||||||||||||||||||||||||||||||||
| title, | ||||||||||||||||||||||||||||||||||||||||
| maxWidth = "640px", | ||||||||||||||||||||||||||||||||||||||||
| showTitleOnDesktop = true, | ||||||||||||||||||||||||||||||||||||||||
| dataTestId = "auth-form-layout", | ||||||||||||||||||||||||||||||||||||||||
| }: AuthFormLayoutProps) => { | ||||||||||||||||||||||||||||||||||||||||
| const config = useConfig(); | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| return ( | ||||||||||||||||||||||||||||||||||||||||
| <Flex | ||||||||||||||||||||||||||||||||||||||||
| justify="center" | ||||||||||||||||||||||||||||||||||||||||
| align="center" | ||||||||||||||||||||||||||||||||||||||||
| style={{ | ||||||||||||||||||||||||||||||||||||||||
| width: "100%", | ||||||||||||||||||||||||||||||||||||||||
| minHeight: "100vh", | ||||||||||||||||||||||||||||||||||||||||
| backgroundColor: "#f5f5f5", // neutral-75 from palette | ||||||||||||||||||||||||||||||||||||||||
| padding: "32px 16px", | ||||||||||||||||||||||||||||||||||||||||
| }} | ||||||||||||||||||||||||||||||||||||||||
| data-testid={dataTestId} | ||||||||||||||||||||||||||||||||||||||||
| > | ||||||||||||||||||||||||||||||||||||||||
| <div style={{ width: "100%", maxWidth, padding: "48px 24px" }}> | ||||||||||||||||||||||||||||||||||||||||
| <Space direction="vertical" size={48} style={{ width: "100%" }}> | ||||||||||||||||||||||||||||||||||||||||
| {/* Logo */} | ||||||||||||||||||||||||||||||||||||||||
| <Flex justify="center"> | ||||||||||||||||||||||||||||||||||||||||
| <img | ||||||||||||||||||||||||||||||||||||||||
| src={config?.logo_path || "/logo.svg"} | ||||||||||||||||||||||||||||||||||||||||
| alt="Logo" | ||||||||||||||||||||||||||||||||||||||||
| width={205} | ||||||||||||||||||||||||||||||||||||||||
| height={46} | ||||||||||||||||||||||||||||||||||||||||
| /> | ||||||||||||||||||||||||||||||||||||||||
| </Flex> | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| {/* Form Container */} | ||||||||||||||||||||||||||||||||||||||||
| <div | ||||||||||||||||||||||||||||||||||||||||
| style={{ | ||||||||||||||||||||||||||||||||||||||||
| backgroundColor: "white", | ||||||||||||||||||||||||||||||||||||||||
| padding: "48px", | ||||||||||||||||||||||||||||||||||||||||
| width: "100%", | ||||||||||||||||||||||||||||||||||||||||
| borderRadius: "4px", | ||||||||||||||||||||||||||||||||||||||||
| boxShadow: | ||||||||||||||||||||||||||||||||||||||||
| "0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)", | ||||||||||||||||||||||||||||||||||||||||
| }} | ||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+59
to
+67
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. style: uses
Suggested change
Context Used: Rule from Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time! |
||||||||||||||||||||||||||||||||||||||||
| > | ||||||||||||||||||||||||||||||||||||||||
| {title && ( | ||||||||||||||||||||||||||||||||||||||||
| <Space | ||||||||||||||||||||||||||||||||||||||||
| direction="vertical" | ||||||||||||||||||||||||||||||||||||||||
| size={16} | ||||||||||||||||||||||||||||||||||||||||
| style={{ width: "100%", marginBottom: "32px" }} | ||||||||||||||||||||||||||||||||||||||||
| > | ||||||||||||||||||||||||||||||||||||||||
| {/* Desktop Title - conditionally shown */} | ||||||||||||||||||||||||||||||||||||||||
| {showTitleOnDesktop && ( | ||||||||||||||||||||||||||||||||||||||||
| <Flex justify="center"> | ||||||||||||||||||||||||||||||||||||||||
| <Typography.Title | ||||||||||||||||||||||||||||||||||||||||
| level={2} | ||||||||||||||||||||||||||||||||||||||||
| style={{ | ||||||||||||||||||||||||||||||||||||||||
| fontSize: "1.875rem", // 3xl | ||||||||||||||||||||||||||||||||||||||||
| color: "#2b2e35", // minos | ||||||||||||||||||||||||||||||||||||||||
| marginBottom: 0, | ||||||||||||||||||||||||||||||||||||||||
| textAlign: "center", | ||||||||||||||||||||||||||||||||||||||||
| }} | ||||||||||||||||||||||||||||||||||||||||
| > | ||||||||||||||||||||||||||||||||||||||||
| {title} | ||||||||||||||||||||||||||||||||||||||||
| </Typography.Title> | ||||||||||||||||||||||||||||||||||||||||
| </Flex> | ||||||||||||||||||||||||||||||||||||||||
| )} | ||||||||||||||||||||||||||||||||||||||||
| </Space> | ||||||||||||||||||||||||||||||||||||||||
| )} | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| {/* Content */} | ||||||||||||||||||||||||||||||||||||||||
| <div style={{ width: "100%" }}>{children}</div> | ||||||||||||||||||||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||||||||||||||||||
| </Space> | ||||||||||||||||||||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||||||||||||||||||
| </Flex> | ||||||||||||||||||||||||||||||||||||||||
| ); | ||||||||||||||||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: uses
divinstead of semantic components - per coding standards, prefer Ant Design's Flex component or other semantic elementsContext Used: Rule from
dashboard- Avoid usingdivelements when possible. Use semantic HTML elements or component library alternativ... (source)Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!