* @file change password component
*/
import { Component, Injector, OnInit } from '@angular/core';
+import { Router } from '@angular/router';
import { NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap';
import { TranslateService } from '@ngx-translate/core';
import { AddEditUserComponent } from 'AddEditUserComponent';
/** Instance of the modal service @private */
private modalService: NgbModal;
+ /** Holds the instance of router class @private */
+ private router: Router;
constructor(injector: Injector) {
this.injector = injector;
this.translateService = this.injector.get(TranslateService);
this.sharedService = this.injector.get(SharedService);
this.modalService = this.injector.get(NgbModal);
+ this.router = this.injector.get(Router);
}
/** Lifecyle Hooks the trigger before component is instantiate @public */
if (this.editType === 'changePassword') {
modalRef.componentInstance.userTitle = this.translateService.instant('PAGE.USERS.EDITCREDENTIALS');
}
+ if (this.router.url === '/forgotpassword') {
+ this.editType = 'forgotPassword';
+ modalRef.componentInstance.userTitle = this.translateService.instant('PAGE.USERS.FORGOT');
+ }
+ if (this.router.url.startsWith('/forgotpassword/changepassword/')) {
+ this.editType = 'change_password';
+ modalRef.componentInstance.userTitle = this.translateService.instant('PAGE.USERS.EDITCREDENTIALS');
+ }
modalRef.componentInstance.userType = this.editType;
modalRef.result.then((result: MODALCLOSERESPONSEDATA): void => {
if (result) {