Repository navigation
fix(designer): say that spaces are not allowed in the workflow name error - #9745
Open
Ming (MaxonT) wants to merge 1 commit into
Open
Ming (MaxonT) wants to merge 1 commit into
Ming (MaxonT) wants to merge 1 commit into
Conversation
…rror Signed-off-by: Ym <173550318+MaxonT@users.noreply.github.com>
Contributor
🔒 AI Validation PendingThis PR is from an external contributor. AI validation will be performed after manual review. Maintainers: Add the |
Contributor
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
This branch has not been deployed
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.
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