Skip to content

fix(designer): say that spaces are not allowed in the workflow name error - #9745

Open
Ming (MaxonT) wants to merge 1 commit into
Azure:mainfrom
MaxonT:contrib/8960-auto
Open

Ming (MaxonT) wants to merge 1 commit into
Azure:mainfrom
MaxonT:contrib/8960-auto

Conversation

@MaxonT

Copy link
Copy Markdown

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.

checkWorkflowNameWithRegex now 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 in libs/designer and libs/designer-v2, which both carry this helper, and added the string to Localize/lang/strings.json (the id s2XJ/T is the one formatjs extract generates for it).

Tests: in both libs the two old assertions that expected the general message for workflow name and workflow_Name space moved into a new case that expects the new message (also for My Workflow and a leading space). validation.spec.ts passes in libs/designer and libs/designer-v2 (6 tests each), and the new case fails in libs/designer when 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

…rror

Signed-off-by: Ym <173550318+MaxonT@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 25, 2026 18:38
@github-actions

Copy link
Copy Markdown
Contributor

🔒 AI Validation Pending

This PR is from an external contributor. AI validation will be performed after manual review.

Maintainers: Add the external-approved label to enable AI validation.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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 designer and designer-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

This branch has not been deployed

No deployments
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