aminghadersohi commented on code in PR #43190:
URL: https://github.com/apache/superset/pull/43190#discussion_r3806926766
##########
superset-frontend/src/pages/DatasetList/DatasetList.subdirectory.test.tsx:
##########
@@ -115,6 +123,27 @@ test('explore link is single-prefixed under a subdirectory
deployment', async ()
expect(exploreLink.getAttribute('href')).not.toContain('/superset/superset');
});
+test('legacy dashboard default URL uses the router basename once', async () =>
{
+ const dataset = {
+ ...mockDatasets[0],
+ explore_url: '/superset/dashboard/123/?standalone=1#section',
Review Comment:
Good catch — you are right that `stripAppRoot` was eating the only
`/superset` prefix, so the assertion held with `index.tsx` reverted. Applied
your suggestion in afc8841: the saved value is now the double-prefixed
`${APP_ROOT}/superset/dashboard/123/?standalone=1#section`, which is what a
subdirectory user pasting the full browser path would actually store.
`stripAppRoot` removes the application root (single-pass, per its documented
invariant), `normalizeLegacyDashboardUrl` removes the legacy prefix, and the
basename re-adds the root once — same expected href, but the assertion now
depends on the new normalization.
Note: I could not run the suite in this worktree (no `node_modules`
installed here), so I am relying on your local both-directions run plus CI for
confirmation.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]