fix(classic): 侧边栏管理默认配置统一复用 mergeAdminConfig#15
Merged
Conversation
SettingsSidebarModulesAdmin 内维护了三份与 DEFAULT_ADMIN_CONFIG 重复的 硬编码默认值(useState 初始值、重置、解析失败兜底),新增模块时容易遗漏同步。 对公转账(bankTransfer)即因此在配置缺失/重置/解析失败旁路下开关显示为关、 实际菜单仍可见,且保存也无法真正隐藏。 改为统一调用 mergeAdminConfig(null) 复用唯一数据源 DEFAULT_ADMIN_CONFIG, 从结构上消除该类不一致。补充 classic 前端 5 个语种的'对公转账与发票审核管理'文案。
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.
背景
SettingsSidebarModulesAdmin内维护了三份与DEFAULT_ADMIN_CONFIG重复的硬编码默认值(useState初始值、重置按钮、解析失败兜底)。每次新增侧边栏模块都要同步四个地方,容易遗漏——这次的「对公转账(bankTransfer)」和之前的myfeedback都踩了同一个坑。问题
运行时真实数据源
useSidebar.js的DEFAULT_ADMIN_CONFIG已含admin.bankTransfer: true,且mergeAdminConfig会用它补齐缺失键。但本组件三处本地默认值缺bankTransfer,导致在配置缺失 / 点击重置 / 解析失败这三条旁路下:true→ 无法真正隐藏,反直觉。正常路径(已存配置可解析)经
mergeAdminConfig已无此问题,仅旁路受影响。改动
mergeAdminConfig(null),复用唯一数据源DEFAULT_ADMIN_CONFIG,从结构上消除该类不一致(净减 ~91 行)。验证
prettier --check:通过eslint(仅本文件):exit 0,无报错建议手测
侧边栏管理 → 点「重置为默认」,确认「对公转账」开关显示为开且与菜单可见状态一致;再关闭并保存,确认菜单确实隐藏。