-
Notifications
You must be signed in to change notification settings - Fork 8
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
Adding a custom validation for flexible VM naming #3057
Conversation
@@ -31,4 +31,25 @@ function validateHexSeed(seed: string, length: number): boolean { | |||
return true; | |||
} | |||
|
|||
export { validateObject, validateInput, validateHexSeed }; | |||
function IsAlphanumericExceptUnderscore(validationOptions?: ValidationOptions) { |
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.
is underscore allowed or not? :D
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.
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.
DeleteMachineModel
need to be updated as well
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.
…score in BaseGetDeleteModel
@@ -4,10 +4,10 @@ | |||
:rules="[ | |||
validators.required('Name is required.'), | |||
validators.isLowercase('Name should consist of lowercase letters only.'), | |||
validators.isAlphanumeric('Name should consist of letters and numbers only.'), | |||
validators.IsAlphanumericExpectUnderscore('Name should consist of letters ,numbers and undersocres only.'), |
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.
please change typo to "underscores".
@@ -18,9 +18,9 @@ | |||
:value="threebotName" | |||
:rules="[ | |||
validators.required('Name is required.'), | |||
validators.isAlphanumeric('Name should consist of letters and numbers only.'), | |||
validators.IsAlphanumericExpectUnderscore('Name should consist of letters ,numbers and undersocres only.'), |
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.
here too, there are 20 instances of the typo so please fix them all
Please fix the conflicts |
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.
I think the maxLength should be changed here:
@Expose() @IsString() @IsNotEmpty() @IsAlphanumeric() @MaxLength(NameLength + 20) name: string; |
@Expose() @IsString() @IsNotEmpty() @IsAlphanumeric() @MaxLength(NameLength + 20) name: string; |
@@ -29,11 +29,10 @@ | |||
:value="name" | |||
:rules="[ | |||
validators.required('Name is required.'), | |||
validators.isLowercase('Name should consist of lowercase letters only.'), | |||
validators.isAlphanumeric('Name should consist of letters and numbers only.'), |
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.
should be IsAlphanumericExpectUnderscore
.
@@ -17,11 +17,10 @@ | |||
:value="name" | |||
:rules="[ | |||
validators.required('Name is required.'), | |||
validators.isLowercase('Name should consist of lowercase letters only.'), | |||
validators.isAlphanumeric('Name should consist of letters and numbers only.'), |
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.
here too.
Description
Added a custom validation decorator accepting alphanumeric values and underscores
Related Issues
Documentation PR
For UI changes, Please provide the Documetation PR on info_grid
Checklist