wso2 / wso2/api-platform

Fix org/project scope "ejection" bug — several pages bounce user to the wrong hierarchy level

Open
#3,265 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Aspect/UI Severity/Major Type/Bug
Dominant language
Go
Stars
71
Forks
111
Avg merge
1d 14h
Merged PRs (30d)
110

Description

Please select the area the issue is related to

AI Workspace

Please select the aspect the issue is related to

Aspect/UI (Frontend layouts, components, styling)

Description

When a user is browsing at Project scope, several pages redirect them to the Org-level equivalent instead of staying in the current Project context. Confirmed via code audit — this is not a routing/architecture issue, it's five specific components that hardcode org-level navigation and never branch on currentProject.

Offending files: entire gateways/ module (GatewaysList.tsx, AddGateway.tsx, ViewGateway.tsx, EditGateway.tsx, GatewaysLayout.tsx) has no currentProject/useAppShell reference anywhere, every internal link/back-nav uses buildOrgPath only. serviceProvider/EditServiceProvider.tsx only destructures currentOrganization, never currentProject, so saving/cancelling a project-scoped provider edit always redirects to the org-level view (contrast with ServiceProviderNew.tsx, ServiceProviderOverview.tsx, ProvidersList.tsx, which correctly branch on scope). insights/Main.tsx (~line 127) does an unconditional buildOrgPath(...,'/gateways'). appShellMain.tsx (~line 190) has an onboarding check that navigates via buildOrgPath(currentOrganization, '/quickstart') with no branch on currentProject, ejecting a project-scoped user to the org-level quickstart wizard.

Fix pattern is mechanical and already used correctly elsewhere in the codebase: branch on currentProject ? buildProjectPath(...) : buildOrgPath(...).

Scope note: this issue is intentionally narrow, just the "bounces to the wrong scope" bug. The broader question of whether every page should be available at both Org and Project levels (e.g. a Project-picker step on org-level "Create New" flows) is a separate, larger design question tracked elsewhere.

Steps to Reproduce
  1. Sign in and navigate into a Project (Organizations > [Org] > Projects > [Project]).
    1. Open any Gateway page under that project, or edit an existing LLM/Service Provider, or trigger the onboarding quickstart check while project-scoped.
    1. Observe: the app redirects to the Org-level equivalent page instead of staying within the current Project scope.
Severity Level of the Issue

Severity/Major (Important functionality is broken. Should be prioritized. Doesn't need immediate attention)

Environment Details (with versions)

Reproduces in all environments (code-level issue, not environment-specific).

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing the named gateways components, serviceProvider/EditServiceProvider.tsx, insights/Main.tsx, and appShellMain.tsx with the existing scope-aware components listed in the issue. Trace each org-level navigation and verify the project-scoped path construction. Done means Gateway, provider, insights, and quickstart navigation stays within the current project while org-scoped navigation remains unchanged.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.