[frontend] feat(multi-tenant): strip detail segments on tenant switch (#4864)#5589
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## release/current #5589 +/- ##
==================================================
Coverage 63.77% 63.77%
Complexity 5848 5848
==================================================
Files 1147 1147
Lines 34494 34494
Branches 2658 2658
==================================================
Hits 21999 21999
Misses 11194 11194
Partials 1301 1301 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…latform/openaev into issue/4864-url-fallback-2
| * → "/admin/scenarios" | ||
| * "/admin/scenarios" → "/admin/scenarios" (unchanged) | ||
| */ | ||
| export const stripDetailSegments = (pathname: string): string => { |
There was a problem hiding this comment.
It seems a bit fragile to me. For example, if you’re on a list page and then switch tenant, but you don’t have access to that list in the new tenant, you’ll get an error as well.
Could we do something similar to what we do after login at first ?
There was a problem hiding this comment.
You mean loosing context and forward to home page?
The goal here was to allow end user to switch between tenant keeping context. For ex if a tenant user browse teams in tenantA and wants to check tenantB's teams.
In case the user has no read access to scenario, he will fallback to existing RBAC alert.
|
@copilot resolve the merge conflicts in this pull request |
…ant import conflict (#4864) Co-authored-by: corinnekrych <1395710+corinnekrych@users.noreply.github.com>
Resolved in commit |
… (#4864)
When a user views a detail page (e.g.
{tenant-id}/admin/scenarios/{scenario-id}) and switches to another tenant, the page reloads keeping the entity ID (ie: {scenario-id}) in the URL.The frontend URL becomes stale, showing an entity ID that doesn't exist in the new tenant. This results in a 404 error (once BE is fixed) and a confusing user experience.
Proposed changes
Testing Instructions
and see how we lan in list of scanearios
Related issues
Checklist
Further comments
If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...