-
Notifications
You must be signed in to change notification settings - Fork 364
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: [M3-8466] - Improve validation rules for create bucket schema #10842
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@linode/validation": Fixed | ||
--- | ||
|
||
Error validation for letter casing when creating object storage bucket now correctly appears for labels. ([#10842](https://github.com/linode/manager/pull/10842)) | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,10 @@ export const CreateBucketSchema = object() | |
label: string() | ||
.required('Label is required.') | ||
.matches(/^\S*$/, 'Label must not contain spaces.') | ||
.matches( | ||
/^[a-z0-9.-]*$/, | ||
'Label must consist only of lowercase letters, numbers, . (period), and - (dash).' | ||
Comment on lines
+12
to
+13
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we also check for the restriction that names cannot have adjacent periods or dashes? The following regex could work for that: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
) | ||
.min(3, 'Label must be between 3 and 63 characters.') | ||
.max(63, 'Label must be between 3 and 63 characters.') | ||
.test( | ||
|
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.
Suggestion is based on our best practices: