From 52f0c20bd91763dcb0119c9c707da2707818e382 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Sun, 15 Nov 2026 23:43:16 +0000 Subject: [PATCH] Profile: make data-use consent match today's privacy policy The onboarding checkbox now says answers and reviews are stored for the student's own profile, and that unnamed aggregated ratings and recommendations are a future use that will be asked about again. The O*NET credit sentence is unchanged, with CC BY-ND 4.0 and the tools name linked. Co-authored-by: pschmeln --- .../profile/components/onboarding-flow.tsx | 56 +++++++++++++----- tests/profile/consent-copy.test.tsx | 57 +++++++++++++++++++ 2 files changed, 100 insertions(+), 13 deletions(-) create mode 100644 tests/profile/consent-copy.test.tsx diff --git a/src/features/profile/components/onboarding-flow.tsx b/src/features/profile/components/onboarding-flow.tsx index 35be3cc..fb94d61 100644 --- a/src/features/profile/components/onboarding-flow.tsx +++ b/src/features/profile/components/onboarding-flow.tsx @@ -25,10 +25,13 @@ import { GOAL_OPTIONS, LOCATION_OPTIONS, MAJOR_OPTIONS, YEAR_OPTIONS } from "./o const PAGE_SIZE = 6; const PAGE_COUNT = Math.ceil(INTEREST_ITEMS.length / PAGE_SIZE); +export const DATA_USE_CONSENT_LABEL = + "I agree that my answers and co-op reviews are stored for my own profile, and may in the future be used without my name to produce aggregated ratings and recommendations for UC students. I will be asked again before that starts."; + const FIELD_COPY: Record = { consentPrivacy: "Confirm that you have read the Privacy Policy.", consentDataUse: - "Confirm that your answers and co-op reviews may be stored and used as described.", + "Confirm that your answers and co-op reviews are stored for your profile as described.", major: "Select your major.", year: "Select your year.", coopTrack: "Use 40 characters or fewer.", @@ -49,6 +52,41 @@ const STEP_ONE_KEYS = new Set([ const textLinkClass = "inline-flex min-h-12 items-center font-medium underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-neutral-900 focus-visible:ring-offset-2"; +const creditLinkClass = + "underline underline-offset-2 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-neutral-900 focus-visible:ring-offset-2"; + +const ONET_TOOLS_LABEL = "O*NET Career Exploration Tools"; +const ONET_TOOLS_URL = "https://www.onetcenter.org/tools.html"; +const CC_LICENSE_LABEL = "CC BY-ND 4.0"; +const CC_LICENSE_URL = "https://creativecommons.org/licenses/by-nd/4.0/"; + +function CreditLink({ href, children }: { href: string; children: string }) { + return ( + + {children} + (opens in a new tab) + + ); +} + +export function AttributionCredit() { + const toolsAt = ATTRIBUTION.indexOf(ONET_TOOLS_LABEL); + const licenseAt = ATTRIBUTION.indexOf(CC_LICENSE_LABEL); + if (toolsAt < 0 || licenseAt < 0 || toolsAt > licenseAt) { + return <>{ATTRIBUTION}; + } + + return ( + <> + {ATTRIBUTION.slice(0, toolsAt)} + {ONET_TOOLS_LABEL} + {ATTRIBUTION.slice(toolsAt + ONET_TOOLS_LABEL.length, licenseAt)} + {CC_LICENSE_LABEL} + {ATTRIBUTION.slice(licenseAt + CC_LICENSE_LABEL.length)} + + ); +} + export type OnboardingDefaults = { consentPrivacy: boolean; consentDataUse: boolean; @@ -319,13 +357,13 @@ export function OnboardingFlow({ {fieldErrors.consentPrivacy ? {fieldErrors.consentPrivacy} : null} -
+
update("consentDataUse", event.target.checked)} - label="I agree that my answers and co-op reviews are stored and used, without my name, to produce ratings and recommendations for UC students" + label={DATA_USE_CONSENT_LABEL} aria-invalid={fieldErrors.consentDataUse ? true : undefined} /> {fieldErrors.consentDataUse ? {fieldErrors.consentDataUse} : null} @@ -477,16 +515,8 @@ export function OnboardingFlow({ ); })}
-

{ATTRIBUTION}

-

- - CC BY-ND 4.0 license - +

+

{fieldErrors.answers ? {fieldErrors.answers} : null}
diff --git a/tests/profile/consent-copy.test.tsx b/tests/profile/consent-copy.test.tsx new file mode 100644 index 0000000..1e983cc --- /dev/null +++ b/tests/profile/consent-copy.test.tsx @@ -0,0 +1,57 @@ +import { renderToStaticMarkup } from "react-dom/server"; +import { describe, expect, it, vi } from "vitest"; +import { ATTRIBUTION } from "@/content/interest-items"; +import { + AttributionCredit, + DATA_USE_CONSENT_LABEL, + OnboardingFlow, +} from "@/features/profile/components/onboarding-flow"; + +vi.mock("next/navigation", () => ({ + useRouter: () => ({ push: () => undefined }), +})); + +const blankDefaults = { + consentPrivacy: false, + consentDataUse: false, + major: "", + year: "", + coopTrack: "", + goal: "", + goalNotes: "", + locationConstraint: "", + constraintsNotes: "", +}; + +describe("data-use consent copy", () => { + it("stores answers for the student's own profile and defers aggregated use", () => { + expect(DATA_USE_CONSENT_LABEL).toBe( + "I agree that my answers and co-op reviews are stored for my own profile, and may in the future be used without my name to produce aggregated ratings and recommendations for UC students. I will be asked again before that starts.", + ); + const html = renderToStaticMarkup( + , + ); + expect(html).toContain(DATA_USE_CONSENT_LABEL); + expect(html).not.toContain( + "stored and used, without my name, to produce ratings and recommendations", + ); + }); +}); + +describe("O*NET credit line", () => { + it("keeps the verbatim sentence and links the license", () => { + const html = renderToStaticMarkup(); + const visible = html + .replace(/[\s\S]*?<\/span>/g, "") + .replace(/<[^>]+>/g, ""); + expect(visible).toBe(ATTRIBUTION); + expect(html).toContain( + 'href="https://creativecommons.org/licenses/by-nd/4.0/"', + ); + expect(html).toContain('href="https://www.onetcenter.org/tools.html"'); + expect(html.match(/target="_blank"/g)).toHaveLength(2); + expect(html.match(/rel="noopener noreferrer"/g)).toHaveLength(2); + expect(html).toContain(">CC BY-ND 4.0<"); + expect(html).toContain(">O*NET Career Exploration Tools<"); + }); +});