X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=src%2Fapp%2Futilities%2Fusers-action%2FUsersActionComponent.ts;h=4f45f8186d3c299c2ecd81bbdae7740652f5d870;hb=6c6860802cae8fe2ae0db852476fc926ea899062;hp=04fd58a5dac678adb2879e5be9d4856ed9dd4ac2;hpb=1b17c432991a95035a1732426f0c11db57e511c9;p=osm%2FNG-UI.git diff --git a/src/app/utilities/users-action/UsersActionComponent.ts b/src/app/utilities/users-action/UsersActionComponent.ts index 04fd58a..4f45f81 100644 --- a/src/app/utilities/users-action/UsersActionComponent.ts +++ b/src/app/utilities/users-action/UsersActionComponent.ts @@ -18,7 +18,6 @@ /** * @file Users Action Component */ -import { isNullOrUndefined } from 'util'; import { Component, Injector } from '@angular/core'; import { NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap'; import { TranslateService } from '@ngx-translate/core'; @@ -26,7 +25,7 @@ import { AddEditUserComponent } from 'AddEditUserComponent'; import { MODALCLOSERESPONSEDATA } from 'CommonModel'; import { DeleteComponent } from 'DeleteComponent'; import { ProjectRoleComponent } from 'ProjectRoleComponent'; -import { SharedService } from 'SharedService'; +import { SharedService, isNullOrUndefined } from 'SharedService'; import { UserData } from 'UserModel'; import { WarningComponent } from 'WarningComponent'; /** @@ -74,8 +73,8 @@ export class UsersActionComponent { * Lifecyle Hooks the trigger before component is instantiate */ public ngOnInit(): void { - this.isAdminShow = localStorage.getItem('admin_show') === 'true' ? true : false; - this.isUserShow = localStorage.getItem('user_show') === 'true' ? true : false; + this.isAdminShow = sessionStorage.getItem('admin_show') === 'true' ? true : false; + this.isUserShow = sessionStorage.getItem('user_show') === 'true' ? true : false; if (!isNullOrUndefined(this.value.user_status)) { this.isUserStatus = this.value.user_status; } @@ -101,11 +100,14 @@ export class UsersActionComponent { modalRef.componentInstance.userID = this.value.identifier; if (editType === 'editPassword') { modalRef.componentInstance.userTitle = this.translateService.instant('PAGE.USERS.EDITCREDENTIALS'); + } else if (editType === 'editmail') { + modalRef.componentInstance.userTitle = this.translateService.instant('PAGE.USERS.CHANGEMAIL'); } else { modalRef.componentInstance.userTitle = this.translateService.instant('PAGE.USERS.EDITUSERNAME'); } modalRef.componentInstance.userType = editType; modalRef.componentInstance.userName = this.value.username; + modalRef.componentInstance.email = this.value.email_id; modalRef.result.then((result: MODALCLOSERESPONSEDATA) => { if (result) { this.sharedService.callData(); @@ -134,8 +136,8 @@ export class UsersActionComponent { public unlockRenewUser(editType: string): void { // eslint-disable-next-line security/detect-non-literal-fs-filename const modalRef: NgbModalRef = this.modalService.open(WarningComponent, { backdrop: 'static' }); - localStorage.setItem('renew', 'true'); - const id: string = localStorage.getItem('user_id'); + sessionStorage.setItem('renew', 'true'); + const id: string = sessionStorage.getItem('user_id'); if (editType === 'unlock') { modalRef.componentInstance.heading = this.translateService.instant('Unlock User'); modalRef.componentInstance.confirmationMessage = this.translateService.instant('Are you sure want to unlock this user');