You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(router): move stackiq off hash routing to clean path URLs (#899)
* feat(router): move stackiq off hash routing to clean path URLs
Stackiq is one of seven fleet apps still serving its SPA behind a `#`.
This is the pilot for moving all of them: the source change is a single
line, and everything else here is the test surface that assumed hashes.
Verified BEFORE switching, because history mode fails at the SERVER when
the AppHost SPA catch-all is missing (fleet #133 is why apps fell back to
hash in the first place): /apps/stackiq/organisaties, /contracten and
/organisaties/abc-123 all already returned 200 with the app shell, so the
catch-all is present for this app.
What moved with it:
tests/e2e/spec-coverage/_helpers.ts gotoAppRoute built `${APP_BASE}#${route}`
tests/e2e/manifest-pages.spec.ts same URL construction
tests/e2e/spec-coverage/catalog-ratings.spec.ts 2 hash deep-links
tests/e2e/smoke/app-mounts.spec.ts `/stackiq/#/organisaties` -> a real sub-path
The helper docblock explaining vue-router 4's hash-relative `createHref`
is rewritten rather than deleted: the id-based nav selector it defends is
deliberately KEPT, because identifying the nav by a stable handle instead
of an href format the router owns is what makes it survive this change.
Verified in the browser against the published @conduction/nextcloud-vue
(USE_LOCAL_LIB=false):
/apps/stackiq/ -> 200, page id Dashboard, no hash
/apps/stackiq/organisaties -> 200, page id Organisaties, no hash
/apps/stackiq/contracten -> 200, page id Contracten, no hash
RELOAD on /organisaties -> 200, still Organisaties
That reload is the point: it is the case hash mode existed to avoid, and
it is served by the catch-all rather than 404ing. Zero JS errors.
The Playwright smoke project passes on both routes, including the
organisations sub-route now that it is a real path. eslint exits 0 and
webpack compiles.
* fix(router): derive the router base from the served URL
History mode broke deep links on the /index.php/... URL form. Nextcloud
serves the same app under BOTH /apps/stackiq/... and
/index.php/apps/stackiq/..., but generateUrl() returns only the form the
instance is configured for. Arriving on the other form left the path
outside the router base, vue-router could not resolve it, and the
catch-all redirected to '/' -- the visitor landed on the Dashboard with
no error and the deep link was silently swallowed.
Measured before the fix:
/apps/stackiq/komplianties -> Compliance
/index.php/apps/stackiq/komplianties -> Dashboard <- silently wrong
Hash routing never had this: the route travelled in the fragment, so the
path prefix was irrelevant. This is the one real regression the switch
introduced, and it would have applied to every app in the rollout.
The e2e suite navigates via /index.php/..., which is exactly how it was
caught -- two index specs failed while manual browsing on the pretty URL
looked fine.
Now both forms resolve, with the path preserved.
0 commit comments