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

Đang mở Phù hợp với người mới
#4,369 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
1/5
Thời gian dự kiến
Dưới một giờ
Mức phù hợp với người mới
88/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
javascript
Lĩnh vực
frontend

Hướng nghiên cứu

Bắt đầu tại portals/api-portal/src/scripts/settings-nav.js và kiểm tra activate(), nơi history.replaceState dựng lại URL cài đặt. Giữ nguyên chuỗi truy vấn của chế độ xem đã chọn khi cập nhật hash của bảng điều khiển. Xác minh bằng cách chọn một chế độ xem không mặc định trong Theming, sau đó tải lại trang hoặc mở URL đã sao chép và xác nhận chế độ xem đó vẫn được chọn.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
Go
Star
85
Fork
137
Merge trung bình
1 ngày 12 giờ
Pull request đã merge (30 ngày)
247

Chuẩn bị môi trường

  • Không có Dockerfile hay tệp Docker Compose
  • Có mẫu pull request
  • Không có hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của wso2/api-platform

Tất cả issue của wso2/api-platform

Issue tương tự

Thêm issue về Go

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.