summaryrefslogtreecommitdiffstats
path: root/ecomp-sdk/epsdk-app-overlay/src
diff options
context:
space:
mode:
authorSudarshan Kumar <sudarshan.kumar@att.com>2020-06-02 19:29:08 +0530
committerSudarshan Kumar <sudarshan.kumar@att.com>2020-06-03 16:39:50 +0530
commit1484acff4ddce388b61f46761c188d859a4309c5 (patch)
tree4c57886d841718c8ca6521d2e46b3159c1438cee /ecomp-sdk/epsdk-app-overlay/src
parent6d48b04c34a009323b92b23efc507c63e40b1d87 (diff)
Improved Profile Search performance
Improved Profile Search performance Issue-ID: PORTAL-915 Change-Id: I05fa030ff326ff38b1f12a10f40c4bb28590ed61 Signed-off-by: Sudarshan Kumar <sudarshan.kumar@att.com>
Diffstat (limited to 'ecomp-sdk/epsdk-app-overlay/src')
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/admin/admin.service.ts28
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/ext/profile/search/search.component.html10
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/ext/profile/search/search.component.scss37
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/ext/profile/search/search.component.ts13
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/shared/interceptors/header-interceptor.ts7
5 files changed, 35 insertions, 60 deletions
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<any> {
let updateMenuURL = environment.updateFnMenuItem;
- return this.http.post(updateMenuURL, menuObj, {withCredentials: true})
+ return this.http.post(updateMenuURL, menuObj)
}
getFunctionCdList(): Observable<any>{
let getFunctionCdListURL = environment.getFunctionCdList;
- return this.http.get(getFunctionCdListURL , { withCredentials: true } );
+ return this.http.get(getFunctionCdListURL);
}
getParentData(): Observable<any>{
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 @@
<ng-container matColumnDef="Last Name">
<th mat-header-cell *matHeaderCellDef id="heading2"> {{userHeaders[1]}} </th>
- <td mat-cell *matCellDef="let rowData"> {{rowData.lastName}} </td>
+ <td mat-cell *matCellDef="let rowData"> {{rowData.last_name}} </td>
</ng-container>
<ng-container matColumnDef="First Name">
<th mat-header-cell *matHeaderCellDef id="heading3">{{userHeaders[2]}} </th>
- <td mat-cell *matCellDef="let rowData"> {{rowData.firstName}}</td>
+ <td mat-cell *matCellDef="let rowData"> {{rowData.first_name}}</td>
</ng-container>
<ng-container matColumnDef="Email">
@@ -63,12 +63,12 @@
<td mat-cell *matCellDef="let rowData" > {{rowData.email}} </td>
</ng-container>
- <ng-container matColumnDef="orgUserId">
+ <ng-container matColumnDef="Org User ID">
<th mat-header-cell *matHeaderCellDef id="heading4"> {{userHeaders[4]}} </th>
<td mat-cell *matCellDef="let rowData" > {{rowData.orgUserId}} </td>
</ng-container>
- <ng-container matColumnDef="orgManagerUserId">
+ <ng-container matColumnDef="Org Manager User ID">
<th mat-header-cell *matHeaderCellDef id="heading4"> {{userHeaders[5]}} </th>
<td mat-cell *matCellDef="let rowData" > {{rowData.orgManagerUserId}} </td>
</ng-container>
@@ -86,7 +86,7 @@
<ng-container matColumnDef="Active?">
<th mat-header-cell *matHeaderCellDef id="heading6"> {{userHeaders[7]}} </th>
<td mat-cell *matCellDef="let rowData">
- <mat-slide-toggle [(ngModel)]="rowData.active" (change)="toggleUserActive(rowData)"></mat-slide-toggle>
+ <mat-slide-toggle [checked]="(rowData.active_yn =='Y' || rowData.active_yn == true) ? true : false" (change)="toggleUserActive(rowData,$event)"></mat-slide-toggle>
</td>
</ng-container>
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<any>, next: HttpHandler): Observable<HttpEvent<any>> {
- // 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{