From 1484acff4ddce388b61f46761c188d859a4309c5 Mon Sep 17 00:00:00 2001 From: Sudarshan Kumar Date: Tue, 2 Jun 2020 19:29:08 +0530 Subject: Improved Profile Search performance Improved Profile Search performance Issue-ID: PORTAL-915 Change-Id: I05fa030ff326ff38b1f12a10f40c4bb28590ed61 Signed-off-by: Sudarshan Kumar --- .../ngapp/src/app/pages/admin/admin.service.ts | 28 ++++++++-------- .../pages/ext/profile/search/search.component.html | 10 +++--- .../pages/ext/profile/search/search.component.scss | 37 ++++++---------------- .../pages/ext/profile/search/search.component.ts | 13 ++++---- .../app/shared/interceptors/header-interceptor.ts | 7 ---- 5 files changed, 35 insertions(+), 60 deletions(-) (limited to 'ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp') diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/admin.service.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/admin.service.ts index 1240e981..c42235be 100644 --- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/admin.service.ts +++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/admin.service.ts @@ -51,7 +51,7 @@ export class AdminService { constructor(private http:HttpClient) { } getRoleFunctionList(){ - return this.http.get(environment.roleFunctionList,{ withCredentials: true }); + return this.http.get(environment.roleFunctionList); } saveRoleFunction(roleData:string){ @@ -60,65 +60,65 @@ export class AdminService { getUsageList() { - return this.http.get(environment.usageList,{ withCredentials: true }); + return this.http.get(environment.usageList); } getCacheRegions(){ - return this.http.get(environment.cachedRegions,{ withCredentials: true }); + return this.http.get(environment.cachedRegions); } getRole(roleId){ - return this.http.get(environment.getRole+'?role_id=' + roleId,{ withCredentials: true }); + return this.http.get(environment.getRole+'?role_id=' + roleId); } getFnMenuItems() { - return this.http.get(environment.getFnMenuItems,{ withCredentials: true }); + return this.http.get(environment.getFnMenuItems); } updateFnMenuItem(menuObj: any): Observable { let updateMenuURL = environment.updateFnMenuItem; - return this.http.post(updateMenuURL, menuObj, {withCredentials: true}) + return this.http.post(updateMenuURL, menuObj) } getFunctionCdList(): Observable{ let getFunctionCdListURL = environment.getFunctionCdList; - return this.http.get(getFunctionCdListURL , { withCredentials: true } ); + return this.http.get(getFunctionCdListURL); } getParentData(): Observable{ let getParentDataURL = environment.getParentList; - return this.http.get(getParentDataURL , { withCredentials: true } ); + return this.http.get(getParentDataURL); } deleteRole(roleData:any){ - return this.http.post(environment.deleteRole,JSON.stringify({role: roleData}),{ withCredentials: true }); + return this.http.post(environment.deleteRole,JSON.stringify({role: roleData})); } deleteRoleFunction(roleFunc:any) { - return this.http.post(environment.deleteRoleFunction,roleFunc,{ withCredentials: true }); + return this.http.post(environment.deleteRoleFunction,roleFunc); } removeRoleFunction(roleFunc:any, roleId:any){ let removeRoleFunctionURL = environment.removeRoleFunction+roleId; - return this.http.post(removeRoleFunctionURL,JSON.stringify({roleFunction:roleFunc}),{ withCredentials: true }); + return this.http.post(removeRoleFunctionURL,JSON.stringify({roleFunction:roleFunc})); } saveRole(roleObj:any, roleId:any){ let saveRoleURL = environment.saveRole+roleId; - return this.http.post(saveRoleURL,JSON.stringify(roleObj),{ withCredentials: true }); + return this.http.post(saveRoleURL,JSON.stringify(roleObj)); } deleteMenu(fnMenuItem:any){ - return this.http.post(environment.deleteMenu,JSON.stringify({fnMenuItem: fnMenuItem}),{ withCredentials: true }); + return this.http.post(environment.deleteMenu,JSON.stringify({fnMenuItem: fnMenuItem})); } getCacheRegionDetails(cacheName:any){ - return this.http.get(environment.getRegion+'?cacheName='+cacheName,{ withCredentials: true }); + return this.http.get(environment.getRegion+'?cacheName='+cacheName); } } diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/ext/profile/search/search.component.html b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/ext/profile/search/search.component.html index 5f131fb6..a6682306 100644 --- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/ext/profile/search/search.component.html +++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/ext/profile/search/search.component.html @@ -50,12 +50,12 @@ {{userHeaders[1]}} - {{rowData.lastName}} + {{rowData.last_name}} {{userHeaders[2]}} - {{rowData.firstName}} + {{rowData.first_name}} @@ -63,12 +63,12 @@ {{rowData.email}} - + {{userHeaders[4]}} {{rowData.orgUserId}} - + {{userHeaders[5]}} {{rowData.orgManagerUserId}} @@ -86,7 +86,7 @@ {{userHeaders[7]}} - + diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/ext/profile/search/search.component.scss b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/ext/profile/search/search.component.scss index 3b9e9d3b..ec84c3b0 100644 --- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/ext/profile/search/search.component.scss +++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/ext/profile/search/search.component.scss @@ -37,35 +37,18 @@ */ table { - width: 100%; - } - - .mat-form-field { - font-size: 14px; - width: 100%; - } - - td, th { - width: 25%; - } - .mat-form-field[_ngcontent-c4] { - font-size: 14px; - width: 20%; - float: right; - } + width: 100%; +} - /*td.mat-cell, td.mat-footer-cell{ - padding: 0; - border-bottom-width: 1px; - border-bottom-style: solid; - border-right-style: solid; - border-right-color: rgba(0,0,0,.12); - border-right-width: 1px; - } -*/ +::ng-deep .mat-header-cell{ + font-weight: bold; + font-size: 14px; + color: #343a40; +} -td[_ngcontent-c4], th[_ngcontent-c4] { - width: 15%; +::ng-deep .mat-form-field[_ngcontent-c4] { + font-size: 14px; + width: 20%; } #edit-button{ diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/ext/profile/search/search.component.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/ext/profile/search/search.component.ts index 9ae59ca8..734aaf09 100644 --- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/ext/profile/search/search.component.ts +++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/ext/profile/search/search.component.ts @@ -57,14 +57,13 @@ export class SearchComponent implements OnInit { response: any; result: any; profileList:any; - userHeaders = ["User ID","Last Name","First Name","Email","orgUserId","orgManagerUserId","Edit","Active?"]; + userHeaders = ["User ID","Last Name","First Name","Email","Org User ID","Org Manager User ID","Edit","Active?"]; constructor(public profileservice:ProfileService, public ngbModal: NgbModal,private _router: Router) { } dataSource: MatTableDataSource<[]>; @ViewChild(MatPaginator, {}) paginator: MatPaginator; @ViewChild(MatSort, {}) sort: MatSort; - ngOnInit() { this.getUsers(); } @@ -72,7 +71,7 @@ export class SearchComponent implements OnInit { getUsers(){ this.showSpinner = true; let response; - this.response = this.profileservice.getUserPagination(); + this.response = this.profileservice.getAllUsers(); this.response.subscribe(data => { response = data; this.result = JSON.parse(response.data); @@ -84,9 +83,9 @@ export class SearchComponent implements OnInit { }); } - toggleUserActive(user){ - let activeOrInactive = (user.active) ? 'activate' : 'inactivate'; - let confirmationMsg = 'You are about to ' + activeOrInactive + ' the user ' + user.firstName +" "+user.lastName+ '. Do you want to continue?'; + toggleUserActive(user, e){ + let activeOrInactive = (e.checked) ? 'activate' : 'inactivate'; + let confirmationMsg = 'You are about to ' + activeOrInactive + ' the user ' + user.first_name +" "+user.last_name+ '. Do you want to continue?'; const modalInfoRef = this.ngbModal.open(InformationModalComponent); modalInfoRef.componentInstance.title = 'Confirmation'; modalInfoRef.componentInstance.message = confirmationMsg; @@ -104,7 +103,7 @@ export class SearchComponent implements OnInit { this.openConfirmationModal("Error",error); }); } else { - user.active = !user.active; + this.ngOnInit(); } }, (result) => { diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/shared/interceptors/header-interceptor.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/shared/interceptors/header-interceptor.ts index 5a5a41a8..50973763 100644 --- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/shared/interceptors/header-interceptor.ts +++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/shared/interceptors/header-interceptor.ts @@ -45,18 +45,11 @@ import { } from '@angular/common/http'; import { Observable } from 'rxjs'; import { v4 as uuid } from 'uuid'; -declare const getWebJunctionXSRFToken: any; export class HeaderInterceptor implements HttpInterceptor { intercept(req: HttpRequest, next: HttpHandler): Observable> { - // Clone the request to add the new header - // HttpHeader object immutable - copy values - var XSRFToken = getWebJunctionXSRFToken(); - console.log('XSRFToken:', XSRFToken); const headerSettings: { [name: string]: string | string[]; } = {}; headerSettings['X-ECOMP-RequestID'] = uuid(); const requestType = req.params.get('requestType'); - if (XSRFToken.name && XSRFToken.value) - headerSettings['X-XSRF-TOKEN'] = XSRFToken.value; if(requestType!=null && requestType==='fileUpload'){ //headerSettings['Content-Type'] = 'multipart/form-data'; }else{ -- cgit 1.2.3-korg