-
-
Notifications
You must be signed in to change notification settings - Fork 658
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: prevent variant name from containing extra whitespace #3777
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Ignored Deployment
|
After enabling |
1 similar comment
After enabling |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, however I would like to see a smarter behavior like it's described in the task: https://linear.app/unleash/issue/2-1052/bug-variants-name-with-space-in-the-name-return-error-on-save
This approach doesn't cover some edge cases, and in general it would be better to warn the user of an invalid variant name right away instead of allowing the user to save and only then providing an error, therefore losing the edited data.
Fair enough! Unpacked a little elsewhere, sounds like we should do a second pass at this to improve this app wide but this should still be merged |
What
This trims off the white space surrounding a variant name when adding/editing a variant.
Why
The behaviour here differs from feature toggle add/update. This patches the behaviour on variants to bring this inline with adding/updating a feature toggle name.
Variant names need to be URL safe, while we do get a nice error message back, we know on the frontend that a variant name with a white space buffer will fail. This should block the user from the most obvious ways of inputting text that will fail