Commit 2df97a0d authored by dev0tion's avatar dev0tion

Adjust wallet name restrictions

parent 80cdb66b
...@@ -30,7 +30,7 @@ export class CreateComponent { ...@@ -30,7 +30,7 @@ export class CreateComponent {
"walletName": ["", "walletName": ["",
Validators.compose([ Validators.compose([
Validators.required, Validators.required,
Validators.minLength(3), Validators.minLength(1),
Validators.maxLength(24), Validators.maxLength(24),
Validators.pattern(/^[a-zA-Z0-9]*$/) Validators.pattern(/^[a-zA-Z0-9]*$/)
]) ])
...@@ -75,10 +75,10 @@ export class CreateComponent { ...@@ -75,10 +75,10 @@ export class CreateComponent {
validationMessages = { validationMessages = {
'walletName': { 'walletName': {
'required': 'Name is required.', 'required': 'A wallet name is required.',
'minlength': 'Name must be at least 3 characters long.', 'minlength': 'A wallet name must be at least one character long.',
'maxlength': 'Name cannot be more than 24 characters long.', 'maxlength': 'A wallet name cannot be more than 24 characters long.',
'pattern': 'Enter a valid wallet name. [a-Z] and [0-9] are the only characters allowed.' 'pattern': 'Please enter a valid wallet name. [a-Z] and [0-9] are the only characters allowed.'
}, },
'walletPassword': { 'walletPassword': {
'required': 'A password is required.', 'required': 'A password is required.',
......
...@@ -35,8 +35,9 @@ export class RecoverComponent implements OnInit { ...@@ -35,8 +35,9 @@ export class RecoverComponent implements OnInit {
"walletPassword": ["", Validators.required], "walletPassword": ["", Validators.required],
"walletName": ["", [ "walletName": ["", [
Validators.required, Validators.required,
Validators.minLength(3), Validators.minLength(1),
Validators.maxLength(24) Validators.maxLength(24),
Validators.pattern(/^[a-zA-Z0-9]*$/)
] ]
], ],
"selectNetwork": ["test", Validators.required] "selectNetwork": ["test", Validators.required]
...@@ -77,10 +78,11 @@ export class RecoverComponent implements OnInit { ...@@ -77,10 +78,11 @@ export class RecoverComponent implements OnInit {
'required': 'A password is required.' 'required': 'A password is required.'
}, },
'walletName': { 'walletName': {
'required': 'Name is required.', 'required': 'A wallet name is required.',
'minlength': 'Name must be at least 3 characters long.', 'minlength': 'A wallet name must be at least one character long.',
'maxlength': 'Name cannot be more than 24 characters long.' 'maxlength': 'A wallet name cannot be more than 24 characters long.',
} 'pattern': 'Please enter a valid wallet name. [a-Z] and [0-9] are the only characters allowed.'
},
}; };
private onBackClicked() { private onBackClicked() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment