feat: auto-generate workspace slug from display name - #1333
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
854cd38 to
c8b273b
Compare
2f6a90c to
d0b4052
Compare
Signed-off-by: Sneha Das <154408198+Snehadas2005@users.noreply.github.com>
d0b4052 to
2060072
Compare
Signed-off-by: Sneha Das <154408198+Snehadas2005@users.noreply.github.com>
c0557e6 to
72a6b79
Compare
|
@Snehadas2005 Just to keep you in the loop on the current status: We now went with a different implementation (see #1335 (to be merged)) in the meantime in order to hit something for the upcoming beta release, we will revisit the complete version of the feature (which your PR can serve as a base for) after the release! 🤗 Please rebase your changes on top of that (once it got merged) and adapt a few of the patterns that it establishes 😊 |
|
/hold |
|
Thank you for the update, @christian-heusel! I completely understand the need for a quick stopgap for the beta release. I will rebase on top of #1335 once it's merged and adjust to the new patterns for the full feature. 🙇♀️ |
This PR introduces automatic slugging for the Workspace Name input derived from the Workspace Display Name, eliminating the friction of manually generating Kubernetes RFC1123-compliant names, alongside strict validation and form flow safety fixes.
Key Changes:
Slugging Utility (
generateWorkspaceSlug):[0-9, a-z, A-Z, -, ., _, space].-).workspace-1) if the display name contains only emojis/special characters.Validation & UI Integration (
WorkspaceFormPropertiesSelection.tsx):workspaceNamelive until the user manually edits the slug field or when in update mode.onValidityChangecallback to propagate properties validation state to the parent form.Form Logic & Navigation Fixes (
WorkspaceForm.tsx):isDisabledcondition logic to prevent submission with invalid custom slugs.Type Safety & Component Tests:
React.FC).slugify.spec.ts) for standard, special character, length limit, collapse, and fallback scenarios.WorkspaceFormPropertiesSelection.spec.tsx) for auto-slugging and manual lock behaviour.Testing Strategy:
npm run test:unit -- slugify.spec.tsnpm run type-check,npm run lint).closes: #1304