Repository navigation
fix(designer): say that spaces are not allowed in the workflow name error - #9745
Ming (MaxonT) wants to merge 1 commit into
Conversation
…rror Signed-off-by: Ym <173550318+MaxonT@users.noreply.github.com>
🔒 AI Validation PendingThis PR is from an external contributor. AI validation will be performed after manual review. Maintainers: Add the |
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are recorded for the change clarifying whitespace-related workflow-name validation errors.
No open issues 🎉
What changed in this PR
Clarifies workflow-name validation errors in both designer libraries for #8960 by explicitly stating that spaces are not allowed, without changing which names are accepted.
Changes:
- Adds a whitespace-specific error message in
designeranddesigner-v2. - Registers the new message in the localization source catalog.
- Updates unit tests to cover names with embedded and leading spaces.
| File | Description |
|---|---|
Localize/lang/strings.json |
Adds the new error message and localization description. |
libs/designer/src/lib/core/templates/utils/helper.ts |
Returns the specific error for names containing whitespace. |
libs/designer/src/lib/core/templates/utils/__test__/validation.spec.ts |
Tests the whitespace-specific message. |
libs/designer-v2/src/lib/core/templates/utils/helper.ts |
Adds the same whitespace-specific error in designer-v2. |
libs/designer-v2/src/lib/core/templates/utils/__test__/validation.spec.ts |
Adds matching message assertions in designer-v2. |
Review effort: Balanced
|
Hi Krrish Mittal (@takyyon), Brian Lam (@lambrianmsft), could you please review this when you have a moment? In short: Say that spaces are not allowed in the workflow name error. I think this will be really valuable. You may want to take a look. Thanks! |
Thanks for pointing to checkWorkflowNameWithRegex in helper.ts; that let me confirm the regex already rejects spaces, so the patch only changes the message to say spaces aren't allowed, in designer and designer-v2.
The template workflow name check already rejects names with a space, but the message it returned was the general "must start with a letter and can contain letters, numbers, dashes and underscores" text, which does not tell someone who typed "My Workflow" what the problem is.
checkWorkflowNameWithRegexnow returns a specific message when the name contains whitespace: "Workflow name cannot contain spaces. Use letters, numbers, dashes ('-') and underscores ('_') instead." The regex itself is untouched, so the accepted and rejected names are exactly the same as before; only the text for whitespace names changes. I made the same change inlibs/designerandlibs/designer-v2, which both carry this helper, and added the string toLocalize/lang/strings.json(the ids2XJ/Tis the oneformatjs extractgenerates for it).Tests: in both libs the two old assertions that expected the general message for
workflow nameandworkflow_Name spacemoved into a new case that expects the new message (also forMy Workflowand a leading space).validation.spec.tspasses inlibs/designerandlibs/designer-v2(6 tests each), and the new case fails inlibs/designerwhen the helper change is removed.Not verified: the triage comment on the issue suggests the Portal may show a message from its own validation layer instead of this one; I could not check that, so this only covers the message produced in this repository. I did not run the full test suite or look at the UI in a browser.
Refs #8960