feat(knowledge): 支持知识库文件夹重命名 - #417
Open
chujieHong wants to merge 2 commits into
Open
Conversation
- repo: 新增 rename_document,使用 path_parent + normalize_kb_path 计算新路径,
对文件夹执行基于 substr 的精确前缀匹配(替代 LIKE,避免 _/% 通配符误匹配),
同步重写所有后代文档的 path 字段
- service: 新增 rename_document,处理权限、名称校验、幂等性与重名冲突,
同名重命名直接返回避免无谓写库
- api: 新增 POST /{kb_id}/documents/{doc_id}/rename,新增 KNOWLEDGE_NAME_INVALID
错误码(400)与 KNOWLEDGE_NAME_TAKEN 错误码(409)路由映射
- 前端: KnowledgeBases 文件夹行删除按钮左侧新增重命名按钮(type=text size=small),
弹窗复用 Modal + Input,名称未变时直接关闭、不发请求
- i18n/locales: 新增 KNOMEDGE_NAME_INVALID 错误消息及重命名成功/失败提示
- tests: 新增 4 个 repo 测试、5 个 service 测试、2 个 api 错误映射测试,
覆盖后代路径改写、跨根/嵌套文件夹、重名冲突、含分隔符拒绝、幂等、ACL 拒绝
The folder-rename PR accidentally carried SKILL_DETAILS_PROTECTED from an unrelated feature branch into ErrorCode and _DEFAULT_STATUS without its i18n entries, failing test_dashboard_api_errors_match_backend and test_every_error_code_has_i18n_entry in CI. Drop it here; the published-expert skill-details feature ships it separately with locales.
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.
Summary
在知识库新增文件夹重命名功能
Target branch
develop(feature / fix — default)main(release/*orhotfix/*only)Type of change
Test plan
make allpasses locallyChecklist
CHANGELOG.md(if user-facing)