Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
Greptile SummaryThis PR fixes a routing regression where the property path prefix (e.g., The fix is applied in two layers:
All routing paths are handled correctly: both the root path ( Confidence Score: 5/5
Last reviewed commit: 37ea34b |
| // Preserve search params and property path prefix when navigating | ||
| const currentSearchParams = searchParams?.toString(); | ||
| const encoded = encodePolicyKey(policyKey); | ||
| const prefix = pathname === "/" ? "" : pathname; |
There was a problem hiding this comment.
@jpople This check looks a bit fragile. Is there a way we can check for the propertyPath param like you do in other components instead?
There was a problem hiding this comment.
Good suggestion, fixed.
lucanovera
left a comment
There was a problem hiding this comment.
Nice work. The privacy center path works great with the new page navigation. Code changes look good. Approved!
Ticket ENG-2869
Description Of Changes
The privacy center supports multiple properties on custom URL paths (e.g.
/mypath). After the page-based privacy request flow was introduced, navigating from a property path home page to the privacy request form, verification, and success pages caused the property path prefix to be dropped from the URL. This fix restores correct routing throughout the full privacy request flow when accessed from a custom property path.Code Changes
usePathname()inHomePageto preserve the property path prefix when navigating to the privacy request form.PrivacyRequestFormPage,VerificationPage, andRequestSubmittedPageto useuseParams()so all internal navigation stays within the current property path.app/[propertyPath]/privacy-request/(form, verify, success) that load the property-specific environment, mirroring the existing root-level privacy request routes.Steps to Confirm
/mypath) and a privacy center config in the admin UI.localhost:3001/mypath.localhost:3001/mypath/privacy-request/[actionKey]and the form reflects the property's configured options..../verifyand then.../success— all still under/mypath/....localhost:3001/mypath.localhost:3001to confirm the default (non-property-path) flow is unaffected.Pre-Merge Checklist
CHANGELOG.mdupdated