fix(frontend): admin custom menu items not showing in sidebar#729
Merged
Wei-Shaw merged 1 commit intoWei-Shaw:mainfrom Mar 3, 2026
Merged
Conversation
The public settings API filters out menu items with visibility='admin', so customMenuItemsForAdmin was always empty when reading from cachedPublicSettings. Fix by loading custom menu items from the admin settings API (via adminSettingsStore) which returns all items unfiltered. Changes: - adminSettings store: store custom_menu_items from admin settings API - AppSidebar: read admin menu items from adminSettingsStore instead of cachedPublicSettings - CustomPageView: merge public and admin menu items so admin users can access admin-only custom pages
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景 / Background
自定义菜单功能(#727)合并后,公开设置 API(
/api/v1/settings/public)在服务端过滤掉了visibility='admin'的菜单项。但前端侧边栏的管理员菜单仍然从公开 API 数据中读取,导致管理员菜单项永远为空。After the custom menu feature (#727) was merged, the public settings API (
/api/v1/settings/public) filters out menu items withvisibility='admin'on the server side. However, the frontend sidebar still reads admin menu items from the public API data, causing admin menu items to never appear.目的 / Purpose
修复管理员自定义菜单项在侧边栏中不显示的问题。管理员菜单项应从管理员设置 API 获取(该接口返回全量数据,不过滤)。
Fix admin custom menu items not showing in the sidebar. Admin menu items should be loaded from the admin settings API, which returns all items without filtering.
改动内容 / Changes
前端 / Frontend
fetch中存储custom_menu_items,并导出customMenuItems供侧边栏使用customMenuItemsForAdmin改为从adminSettingsStore.customMenuItems读取,而非从cachedPublicSettings读取custom_menu_itemsinfetchand exportcustomMenuItemsfor sidebar usecustomMenuItemsForAdminfromadminSettingsStore.customMenuItemsinstead ofcachedPublicSettings