Skip to content

fix(skill): Align Next console Create Skill name validation with backend param checker#14946

Merged
KomachiSion merged 2 commits into
alibaba:developfrom
FatOnionLee:fix/skill-name-validation
Apr 20, 2026
Merged

fix(skill): Align Next console Create Skill name validation with backend param checker#14946
KomachiSion merged 2 commits into
alibaba:developfrom
FatOnionLee:fix/skill-name-validation

Conversation

@FatOnionLee

Copy link
Copy Markdown
Contributor

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 in DefaultParamChecker.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; bundled console/.../static/next assets 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 validateSkillName and module-level pattern/length constants in CreateSkillDialog.tsx; validate on change and before create; maxLength={64} on name input; disable create button when validation fails.

  • Add skill.nameTooLong, skill.nameInvalidFormat, skill.nameNoConsecutiveHyphens in en-US.json and zh-CN.json.

  • Rebuild and commit console/src/main/resources/static/next (main.js, index30.js, main3.css).

  • CreateSkillDialog.tsx 中增加 validateSkillName 及模块级正则与长度常量;在输入与创建时校验;名称输入框 maxLength={64};校验失败时禁用创建按钮。

  • en-US.jsonzh-CN.json 中增加 skill.nameTooLongskill.nameInvalidFormatskill.nameNoConsecutiveHyphens

  • 重新构建并提交 console/src/main/resources/static/nextmain.jsindex30.jsmain3.css 等)。


Verifying this change

  1. Run the server (or npm run dev in console-ui-next with API proxy) and open Skill management → Create Skill.

  2. Try invalid names: uppercase, spaces, underscores, leading/trailing -, --, length > 64 — expect inline error and disabled primary button; valid lowercase names like my-skill or a1 should pass.

  3. 启动后端(或在 console-ui-nextnpm run dev 并走代理)进入 Skill 管理 → 创建 Skill。

  4. 分别输入非法名称:大写、空格、下划线、首尾 ---、超过 64 字符等 —— 应出现错误提示且主按钮禁用;合法名称如 my-skilla1 应可通过。

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
@github-actions

Copy link
Copy Markdown

Thanks for your this PR. 🙏
Please check again for your PR changes whether contains any usage/api/configuration change such as Add new API , Add new configuration, Change default value of configuration.
If so, please add or update documents(markdown type) in docs/next/ for repository nacos-group/nacos-group.github.io


感谢您提交的PR。 🙏
请再次查看您的PR内容,确认是否包含任何使用方式/API/配置参数的变更,如:新增API新增配置参数修改默认配置等操作。
如果是,请确保在提交之前,在仓库nacos-group/nacos-group.github.io中的docs/next/目录下添加或更新文档(markdown格式)。

@KomachiSion
KomachiSion merged commit f7029bd into alibaba:develop Apr 20, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants