[Bug]: API Portal settings drop the chosen view from the address

Aperta Adatta ai principianti
#4,369 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
1/5
Tempo stimato
Meno di un'ora
Idoneità per principianti
88/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
javascript
Ambito
frontend

Direzione di ricerca

Inizia da portals/api-portal/src/scripts/settings-nav.js e controlla activate(), dove history.replaceState ricostruisce l’URL delle impostazioni. Mantieni la stringa di query della vista selezionata quando aggiorni l’hash del pannello. Verifica scegliendo una vista non predefinita in Theming, quindi ricaricando la pagina o aprendo l’URL copiato e confermando che la vista rimane selezionata.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Area/DeveloperPortal Aspect/UI Severity/Minor Type/Bug
Please select the area the issue is related to

DeveloperPortal

Please select the aspect the issue is related to

Aspect/UI (Admin portal, developer portal, AI workspace UI)

Description

On the API Portal settings page, choosing a view in a view-scoped panel (Theming, LLM Instructions, API Workflows) loads …/settings?view=<view>#<panel>, but the page then removes ?view=<view> from the address bar. Reloading the page, or opening the copied link, shows the panel for the default view instead of the chosen one.

Cause

On load, activate() in portals/api-portal/src/scripts/settings-nav.js records the open panel with:

history.replaceState(null, '', location.pathname + '#' + id);

It rebuilds the address from the path and the hash only, so the query string, which carries the view, is dropped.

Observed (Playwright trace of the UI suite's theming journey, https://github.com/wso2/api-platform/actions/runs/44452694997/job/135322505050)

  • Choosing view theme_view_grzjk2ft_6 navigated to https://api-portal:9543/api-portal/default/settings?view=theme_view_grzjk2ft_6#cfg-theming.
  • The page then showed that view's settings, with the address https://api-portal:9543/api-portal/default/settings#cfg-theming.

Expected

The address keeps ?view=<view>, so reloading or sharing the page keeps the chosen view. For example, history.replaceState(null, '', location.pathname + location.search + '#' + id).

Steps to Reproduce
  1. In an organization with more than one view, open API Portal Settings → Theming.
  2. Choose a view other than the first in the view selector. The page reloads showing that view.
  3. Look at the address bar: ?view= is gone.
  4. Reload the page: the panel shows the default view again.
Severity Level of the Issue

Severity/Minor (Minor functionality is broken. Doesn't need immediate attention)

Environment Details (with versions)

Current main. API Portal built from source and run by the UI suite (tests/framework) in GitHub Actions.

Lingua principale
Go
Stelle
85
Fork
137
Merge medio
1g 12h
PR unite (30g)
247

Preparare l'ambiente

  • Nessun Dockerfile né file Docker Compose
  • Ha un modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di wso2/api-platform

Tutte le issue di wso2/api-platform

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.