fix: Prepend mount path to new-window links so they work under a subpath#3393
fix: Prepend mount path to new-window links so they work under a subpath#3393dblythy wants to merge 1 commit into
Conversation
|
🚀 Thanks for opening this pull request! We appreciate your effort in improving the project. Please let us know once your pull request is ready for review. Tip
Note Please respond to review comments from AI agents just like you would to comments from a human reviewer. Let the reviewer resolve their own comments, unless they have reviewed and accepted your commit, or agreed with your explanation for why the feedback was incorrect. Caution Pull requests must be written using an AI agent with human supervision. Pull requests written entirely by a human will likely be rejected, because of lower code quality, higher review effort and the higher risk of introducing bugs. Please note that AI review comments on this pull request alone do not satisfy this requirement. Our CI and AI review are safeguards, not development tools. If many issues are flagged, rethink your development approach. Invest more effort in planning and design rather than using review cycles to fix low-quality code. |
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 34 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Closes #2441
Problem
When the dashboard is mounted under a subpath (e.g.
/parseor/dashboard), links that open in a new browser tab/window point atorigin + /apps/<slug>/...and drop the mount path, so the new tab lands on a "Cannot GET" / wrong page. Same-window navigation is fine because it goes through react-router, whose<BrowserRouter basename={window.PARSE_DASHBOARD_PATH}>prepends the mount path automatically. New-window links (window.open,<a target="_blank">) bypass react-router and need the mount path applied explicitly.generatePath()already gained aprependMountPathflag in #2527, and the data-browser pointer cmd-click already passes it. This PR fixes the remaining new-window links that still omit it:PermissionsDialog.urlForKey(ACL/CLP user & role links; the exact regression introduced by feat: Add links to users and roles in ACL dialog and handle invalid entries #2436).AggregationPanelComponentsinfo-panel relative links.Viewscustom-view "Link" column.Fix
Route each of those new-window links through the existing mount-path-aware helper
generatePath(app, path, true), which prefixeswindow.PARSE_DASHBOARD_PATH(and falls back to a root-relative path when the dashboard is mounted at/).Verification
Local stack with the dashboard mounted at
/dashboard. In the data browser: open a class, then Security → Class Level Permissions, add a user, and click the user link (opens a new tab).The permissions dialog link (identical before and after; only the underlying
hrefdiffers):Before: the link
hrefis/apps/QA2441/browser/_User?...(no mount path), so the new tab fails:After: the link
hrefis/dashboard/apps/QA2441/browser/_User?..., so the new tab opens the correct filtered browser:Same-window navigation (sidebar class links, normal pointer click) continues to work under the subpath. Added
src/lib/tests/generatePath.test.jscovering the helper contract (default returns a root-relative path;prependMountPath=trueprepends the mount path, falling back to root-relative when unset).