yasithdev opened a new pull request, #231:
URL: https://github.com/apache/airavata-portals/pull/231

   Two related portal navigation/UX fixes.
   
   ## 1. No native "Leave site?" prompt on app-initiated navigation
   The experiment editor's `UnsavedChangesGuard` arms a `beforeunload` handler 
that pops the browser's native **"Leave site? Changes you made may not be 
saved."** dialog whenever the editor redirects after a save (Save / Save and 
Launch) — because those redirects are full-page `window.location` navigations, 
not SPA route changes.
   
   Fix: add an intentional-navigation latch in common (`utils.navigateTo` sets 
a flag then assigns `window.location`; `utils.isIntentionalNavigation` reads 
it). The guard now stays silent when the portal itself is navigating, and 
`workspace/.../utils/urls.js` routes all its redirects through `navigateTo`. 
Genuinely accidental leaves with unsaved edits (closing the tab, browser 
back/forward, following an unrelated link) still warn. The web-component editor 
uses the same `urls.js`, so it's covered too; the admin editor navigates via 
`vue-router` (no full unload) and is unaffected.
   
   ## 2. Account console link derived from the user's token
   The user-menu **User Settings** link now derives `<issuer>/account/` from 
the `iss` claim of the signed-in user's access token (the realm's OIDC 
discovery issuer) instead of a separately configured setting, so it always 
targets the realm the user authenticated against. Falls back to 
`KEYCLOAK_ACCOUNT_CONSOLE_URL` when the token carries no issuer. (The account 
console itself returning HTTP 500 is fixed separately in apache/airavata#693 — 
a Keycloak default-theme misconfig.)
   
   ## Test plan
   - `build_js.sh` + `lint_js.sh` clean; `ruff check` clean on 
`context_processors.py`.
   - Deployed to the dev portal; the `navigateTo` latch is present in the built 
workspace bundle.
   - Manual: Save / Save and Launch an experiment → redirects to the results 
without a "Leave site?" prompt; editing then closing the tab still warns; User 
Settings opens the Keycloak account console for the current realm.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)


-- 
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]

Reply via email to