fix(skill): Align Next console Create Skill name validation with backend param checker#14946
Merged
KomachiSion merged 2 commits intoApr 20, 2026
Merged
Conversation
Validate Skill name in CreateSkillDialog using the same rules as DefaultParamChecker (length, lowercase alphanumeric + hyphens, no leading/trailing or consecutive hyphens). Add i18n strings for errors. Made-with: Cursor
Update bundled assets from console-ui-next build. Made-with: Cursor
|
Thanks for your this PR. 🙏 感谢您提交的PR。 🙏 |
KomachiSion
approved these changes
Apr 20, 2026
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.
What is the purpose of the change
Align the Skill name validation in the Next console “Create Skill” dialog (
CreateSkillDialog) with the backend rules implemented inDefaultParamChecker.checkSkillNameFormat: length 1–64, pattern^[a-z0-9]([a-z0-9-]*[a-z0-9])?$, no leading/trailing hyphens, and no consecutive hyphens (--). Users now see errors before submit, and the primary button stays disabled when the name is invalid. i18n keys were added for the new error messages; bundledconsole/.../static/nextassets were rebuilt so packaged servers serve the updated UI.将 Next 控制台「创建 Skill」弹窗(
CreateSkillDialog)中的 Skill 名称校验,与后端DefaultParamChecker.checkSkillNameFormat的规则对齐:长度 1–64、正则^[a-z0-9]([a-z0-9-]*[a-z0-9])?$、不能以连字符开头或结尾、不能包含连续连字符--。用户在提交前即可看到错误提示,名称不合法时主按钮保持禁用。新增了对应中英文文案 key,并重新构建了console/.../static/next静态资源,以便打 jar 后直接访问到新界面。Brief changelog
Add
validateSkillNameand module-level pattern/length constants inCreateSkillDialog.tsx; validate on change and before create;maxLength={64}on name input; disable create button when validation fails.Add
skill.nameTooLong,skill.nameInvalidFormat,skill.nameNoConsecutiveHyphensinen-US.jsonandzh-CN.json.Rebuild and commit
console/src/main/resources/static/next(main.js,index30.js,main3.css).在
CreateSkillDialog.tsx中增加validateSkillName及模块级正则与长度常量;在输入与创建时校验;名称输入框maxLength={64};校验失败时禁用创建按钮。在
en-US.json、zh-CN.json中增加skill.nameTooLong、skill.nameInvalidFormat、skill.nameNoConsecutiveHyphens。重新构建并提交
console/src/main/resources/static/next(main.js、index30.js、main3.css等)。Verifying this change
Run the server (or
npm run devinconsole-ui-nextwith API proxy) and open Skill management → Create Skill.Try invalid names: uppercase, spaces, underscores, leading/trailing
-,--, length > 64 — expect inline error and disabled primary button; valid lowercase names likemy-skillora1should pass.启动后端(或在
console-ui-next下npm run dev并走代理)进入 Skill 管理 → 创建 Skill。分别输入非法名称:大写、空格、下划线、首尾
-、--、超过 64 字符等 —— 应出现错误提示且主按钮禁用;合法名称如my-skill、a1应可通过。