X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=src%2Fapp%2Flogin%2FLoginComponent.ts;fp=src%2Fapp%2Flogin%2FLoginComponent.ts;h=53f6f98838de3541afb3a7f9f3e4e6724155252c;hb=c6c72e359f949e7595f3e7594d5d811ee7fd9d39;hp=1ffa8c3b4a336bf783a77053141c167d9f67cb57;hpb=c7e646225214c583463c859f267d314fb04e829e;p=osm%2FNG-UI.git diff --git a/src/app/login/LoginComponent.ts b/src/app/login/LoginComponent.ts index 1ffa8c3..53f6f98 100644 --- a/src/app/login/LoginComponent.ts +++ b/src/app/login/LoginComponent.ts @@ -318,24 +318,28 @@ export class LoginComponent implements OnInit { this.sharedService.passwordToaster(this.lastLogin, this.failedAttempts, this.passwordNoOfDays, this.passwordExpireMessage, this.passwordMessage); } else { - if (this.accountNoOfDays === '1') { - this.accountExpireMessage = this.translateService.instant('PAGE.LOGIN.ACCOUNTEXPIRETOMORROW'); - this.accountMessage = ''; - this.accountNoOfDays = ''; - } else if (this.accountNoOfDays === '0') { - this.accountExpireMessage = this.translateService.instant('PAGE.LOGIN.ACCOUNTEXPIRETODAY'); - this.accountMessage = ''; - this.accountNoOfDays = ''; - } else { - this.accountExpireMessage = this.accountExpireMessage = this.translateService.instant('PAGE.LOGIN.ACCOUNTEXPIRE'); - this.accountMessage = this.translateService.instant('PAGE.LOGIN.DAYS'); - } - this.sharedService.showToaster(this.lastLogin, this.failedAttempts, this.passwordNoOfDays, this.accountNoOfDays, - this.passwordExpireMessage, this.accountExpireMessage, this.passwordMessage, this.accountMessage); + this.accountDaysCheck(); } } } } + /** To check account no.of days with 0 & 1 @public */ + public accountDaysCheck(): void { + if (this.accountNoOfDays === '1') { + this.accountExpireMessage = this.translateService.instant('PAGE.LOGIN.ACCOUNTEXPIRETOMORROW'); + this.accountMessage = ''; + this.accountNoOfDays = ''; + } else if (this.accountNoOfDays === '0') { + this.accountExpireMessage = this.translateService.instant('PAGE.LOGIN.ACCOUNTEXPIRETODAY'); + this.accountMessage = ''; + this.accountNoOfDays = ''; + } else { + this.accountExpireMessage = this.accountExpireMessage = this.translateService.instant('PAGE.LOGIN.ACCOUNTEXPIRE'); + this.accountMessage = this.translateService.instant('PAGE.LOGIN.DAYS'); + } + this.sharedService.showToaster(this.lastLogin, this.failedAttempts, this.passwordNoOfDays, this.accountNoOfDays, + this.passwordExpireMessage, this.accountExpireMessage, this.passwordMessage, this.accountMessage); + } /** To display account expiry Toaster with required data @public */ public accountExpiryToaster(): void { if (!isNullOrUndefined(this.accountNoOfDays)) { @@ -356,24 +360,28 @@ export class LoginComponent implements OnInit { this.sharedService.accountToaster(this.lastLogin, this.failedAttempts, this.accountNoOfDays, this.accountExpireMessage, this.accountMessage); } else { - if (this.passwordNoOfDays === '1') { - this.passwordExpireMessage = this.translateService.instant('PAGE.LOGIN.PASSWORDEXPIRETOMORROW'); - this.passwordMessage = ''; - this.passwordNoOfDays = ''; - } else if (this.passwordNoOfDays === '0') { - this.passwordExpireMessage = this.translateService.instant('PAGE.LOGIN.PASSWORDEXPIRETODAY'); - this.passwordMessage = ''; - this.passwordNoOfDays = ''; - } else { - this.passwordExpireMessage = this.translateService.instant('PAGE.LOGIN.PASSWORDEXPIRE'); - this.passwordMessage = this.translateService.instant('PAGE.LOGIN.DAYS'); - } - this.sharedService.showToaster(this.lastLogin, this.failedAttempts, this.passwordNoOfDays, this.accountNoOfDays, - this.passwordExpireMessage, this.accountExpireMessage, this.passwordMessage, this.accountMessage); + this.passwordDaysCheck(); } } } } + /** To check password no.of days with 0 & 1 @public */ + public passwordDaysCheck(): void { + if (this.passwordNoOfDays === '1') { + this.passwordExpireMessage = this.translateService.instant('PAGE.LOGIN.PASSWORDEXPIRETOMORROW'); + this.passwordMessage = ''; + this.passwordNoOfDays = ''; + } else if (this.passwordNoOfDays === '0') { + this.passwordExpireMessage = this.translateService.instant('PAGE.LOGIN.PASSWORDEXPIRETODAY'); + this.passwordMessage = ''; + this.passwordNoOfDays = ''; + } else { + this.passwordExpireMessage = this.translateService.instant('PAGE.LOGIN.PASSWORDEXPIRE'); + this.passwordMessage = this.translateService.instant('PAGE.LOGIN.DAYS'); + } + this.sharedService.showToaster(this.lastLogin, this.failedAttempts, this.passwordNoOfDays, this.accountNoOfDays, + this.passwordExpireMessage, this.accountExpireMessage, this.passwordMessage, this.accountMessage); + } /** To display password & account expiry Toaster with required data @public */ public showToaster(): void { if (!isNullOrUndefined(this.accountNoOfDays) && !isNullOrUndefined(this.passwordNoOfDays)) {