From 611c9da62c2e266f9facd97dc9f340ce311060a3 Mon Sep 17 00:00:00 2001 From: asgar Date: Fri, 1 Mar 2019 15:32:47 +0530 Subject: multiple asible servers support multiple asible servers support for CDT Issue-ID: APPC-1510 Change-Id: Id1b1b02274487cfbf6f108a57211a192924a6b08 Signed-off-by: Mohamed Asgar Samiulla --- .../vnfs/userlogin-form/userlogin-form.component.ts | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'src/app/vnfs/userlogin-form/userlogin-form.component.ts') diff --git a/src/app/vnfs/userlogin-form/userlogin-form.component.ts b/src/app/vnfs/userlogin-form/userlogin-form.component.ts index 188fe81..c62e9bb 100644 --- a/src/app/vnfs/userlogin-form/userlogin-form.component.ts +++ b/src/app/vnfs/userlogin-form/userlogin-form.component.ts @@ -31,6 +31,8 @@ export class userloginFormComponent implements OnInit { userId: string = ''; returnUrl:string + invalid = true; + errorMessage = ''; constructor(private router: Router, private utiltiy: UtilityService, private route: ActivatedRoute ) { @@ -50,4 +52,23 @@ export class userloginFormComponent implements OnInit { this.router.navigateByUrl(this.returnUrl); } + validateUserName(){ + if (!this.userId.trim() || this.userId.length < 1) { + this.errorMessage = ''; + this.invalid = true; + }else if(this.userId.startsWith(' ') || this.userId.endsWith(' ')){ + this.errorMessage = 'Leading and trailing space is not allowed'; + this.invalid = true; + } else if(this.userId.includes(' ')){ + this.errorMessage = 'More than one space is not allowed in username'; + this.invalid = true; + } else if(this.userId.length > 50) { + this.errorMessage = 'Username should be of minimum one character and maximum 50 character'; + this.invalid = true; + }else { + this.invalid = false; + this.errorMessage = ''; + } + } + } -- cgit 1.2.3-korg