summaryrefslogtreecommitdiffstats
path: root/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/columns/column-list/column-list.component.ts
diff options
context:
space:
mode:
Diffstat (limited to 'ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/columns/column-list/column-list.component.ts')
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/columns/column-list/column-list.component.ts98
1 files changed, 43 insertions, 55 deletions
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/columns/column-list/column-list.component.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/columns/column-list/column-list.component.ts
index 25f5109c..193e5ad0 100644
--- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/columns/column-list/column-list.component.ts
+++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/Report/columns/column-list/column-list.component.ts
@@ -1,28 +1,23 @@
-import { AfterViewInit, Component, OnInit, ViewChild, SimpleChange, Input, Output } from '@angular/core';
-import { MatPaginator } from '@angular/material/paginator';
-import { MatSort } from '@angular/material/sort';
-import { MatTable } from '@angular/material/table';
-import { DataTableDataSource, DataTableItem } from './column-list-datasource';
-import { HttpClient } from '@angular/common/http';
-import { environment } from '../../../../../../../environments/environment';
-import { ColumnService } from '../column.service';
+import {ChangeDetectionStrategy, ChangeDetectorRef, Component, Input, OnInit, ViewChild} from '@angular/core';
+import {MatPaginator} from '@angular/material/paginator';
+import {MatSort} from '@angular/material/sort';
+import {MatTable} from '@angular/material/table';
+import {DataTableDataSource, DataTableItem} from './column-list-datasource';
+import {HttpClient} from '@angular/common/http';
+import {ColumnService} from '../column.service';
import {SemaphoreList} from '../model/semaphore-list';
import {Semaphore} from '../model/semaphore';
@Component({
selector: 'app-column-list',
templateUrl: './column-list.component.html',
- styleUrls: ['./column-list.component.css']
+ styleUrls: ['./column-list.component.css'],
})
export class ColumnListComponent implements OnInit {
@ViewChild(MatPaginator, {static: false} as any) paginator: MatPaginator;
@ViewChild(MatSort, {static: false} as any) sort: MatSort;
@ViewChild(MatTable, {static: false} as any) table: MatTable<DataTableItem>;
-
@Input('reportId') reportId: number;
-
-
-
dataSource: DataTableDataSource;
finalGetObj: {};
finalEditRowGetObj: {};
@@ -31,7 +26,6 @@ export class ColumnListComponent implements OnInit {
message: string;
showDialog: boolean;
closable: boolean;
-
columnId: string;
id: string;
name: string;
@@ -59,8 +53,6 @@ export class ColumnListComponent implements OnInit {
finalPOSTObj: {};
isDisabled: boolean;
showConfirmButton: boolean;
-
- /** Columns displayed in the table. Columns IDs can be added, removed, or reordered. */
displayedColumns = ['no', 'id', 'name', 'edit'];
SQLstatus: string;
SQLmessage: string;
@@ -68,7 +60,6 @@ export class ColumnListComponent implements OnInit {
Colclosable: boolean;
EditColmessage: string;
EditColstatus: string;
-
showEditDrillDownPage: boolean;
showAdvancedDisplayPage = false;
drillDownReportId: string;
@@ -81,45 +72,47 @@ export class ColumnListComponent implements OnInit {
semaphoreList: SemaphoreList;
semaphoreName: String;
semaphoreId: String;
- private newSemaphoreList: any;
- private addDisplay = false;
incomingDrillDownParams: string;
isIncomingDrillDownParams: boolean;
+ SQLclosable: any;
+ private newSemaphoreList: any;
+ private addDisplay = false;
+ columnList: any;
- constructor(private _http: HttpClient, private _columnService: ColumnService) {
+ constructor(private _http: HttpClient,
+ private _columnService: ColumnService,
+ private changeDetectorRefs: ChangeDetectorRef) {
this.showEditDrillDownPage = false;
this.showAdvancedDisplayPage = false;
this.showConfirmButton = false;
this.addDisplay = false;
-
this.dataSource = new DataTableDataSource();
-
- this.finalGetObj = new Object();
- this.finalObjArr = new Array();
- this.finalEditRowGetObj = new Object();
- this.URLListObjArray = new Array();
- this.TotalColListObjArray = new Array();
- this.finalPOSTObj = new Object();
- this.drillDownObj = new Object();
+ this.finalGetObj = {};
+ this.finalObjArr = [];
+ this.finalEditRowGetObj = {};
+ this.URLListObjArray = [];
+ this.TotalColListObjArray = [];
+ this.finalPOSTObj = {};
+ this.drillDownObj = {};
this.checkCnt = 0;
this.showSpinner = false;
this.semaphoreList = new class implements SemaphoreList {
semaphore: Semaphore[];
};
this.semaphoreName = 'No Display';
+ this.semaphoreId = '';
this.incomingDrillDownParams = '';
this.isIncomingDrillDownParams = false;
-
}
ngOnInit() {
- this.showSpinner = true;
this.displayTable = true;
this._columnService.getColumnList()
.subscribe((response) => {
this.showSpinner = true;
this.finalGetObj = response;
+ this.columnList = response;
let fgo_counter = 0;
while (this.finalGetObj[fgo_counter]) {
this.finalGetObj[fgo_counter]['no'] = fgo_counter + 1;
@@ -136,8 +129,6 @@ export class ColumnListComponent implements OnInit {
});
this.showDialog = false;
this.showSaveColDialog = false;
-
-
}
@@ -151,7 +142,11 @@ export class ColumnListComponent implements OnInit {
editRecord(id: string) {
this.showSpinner = true;
-
+ this.semaphoreList = new class implements SemaphoreList {
+ semaphore: Semaphore[];
+ };
+ this.semaphoreName = 'No Display';
+ this.semaphoreId = '';
this.columnId = id;
this._columnService.getIndividualColumnData(id)
.subscribe((response) => {
@@ -162,13 +157,13 @@ export class ColumnListComponent implements OnInit {
this.visible = this.finalEditRowGetObj['visible'];
this.dependsOnFormFields = this.finalEditRowGetObj['depeondsOnForField'];
this.dataType = this.finalEditRowGetObj['dataType'];
- this.groupByPos = (this.finalEditRowGetObj['groupByPos'] == null ? 0 : this.finalEditRowGetObj['groupByPos'] );
+ this.groupByPos = (this.finalEditRowGetObj['groupByPos'] == null ? 0 : this.finalEditRowGetObj['groupByPos']);
this.customTextForSubTotal = this.finalEditRowGetObj['subTotalCustomText'];
this.hideRepeatedValues = this.finalEditRowGetObj['hideRepeatedKey'];
this.multiGroupColumnLevel = (this.finalEditRowGetObj['level'] == null ? 0 : this.finalEditRowGetObj['level']);
- this.colspan = (this.finalEditRowGetObj['colspan'] == null ? 0 : this.finalEditRowGetObj['colspan']);
+ this.colspan = (this.finalEditRowGetObj['colspan'] == null ? 0 : this.finalEditRowGetObj['colspan']);
this.displayName = this.finalEditRowGetObj['displayName'];
- this.displayWidthInPixel = (this.finalEditRowGetObj['displayWidthInPixel'] == null ? 0 : this.finalEditRowGetObj['displayWidthInPixel'] );
+ this.displayWidthInPixel = (this.finalEditRowGetObj['displayWidthInPixel'] == null ? 0 : this.finalEditRowGetObj['displayWidthInPixel']);
this.indentation = (this.finalEditRowGetObj['indentation'] == null ? 0 : this.finalEditRowGetObj['indentation']);
this.displayAlignment = this.finalEditRowGetObj['displayAlignment'];
this.displayHeaderAlignment = (this.finalEditRowGetObj['displayHeaderAlignment'] == null ? '' : this.finalEditRowGetObj['displayHeaderAlignment']);
@@ -179,7 +174,7 @@ export class ColumnListComponent implements OnInit {
this.drillDownObj['drillDownUrl'] = this.drilldownURL;
this.drillDownObj['drillDownParams'] = this.drilldownParams;
this.drillDownObj['drillDownType'] = this.drilldownType;
- this.semaphoreList = this.finalEditRowGetObj['semaphoreList'];
+ this.semaphoreList = this.finalEditRowGetObj['semaphoreList'];
this.semaphoreId = this.finalEditRowGetObj['semaphoreId'];
if (this.semaphoreId === '') {
this.semaphoreName = 'No Display';
@@ -192,7 +187,7 @@ export class ColumnListComponent implements OnInit {
}
}
}
- this. displayTotal = (this.finalEditRowGetObj['displayTotal'] == null ? '' : this.finalEditRowGetObj['displayTotal']);
+ this.displayTotal = (this.finalEditRowGetObj['displayTotal'] == null ? '' : this.finalEditRowGetObj['displayTotal']);
this._columnService.getDrillDownReportList()
.subscribe((responseURLList) => {
this.URLListObj = responseURLList;
@@ -203,7 +198,6 @@ export class ColumnListComponent implements OnInit {
listCtr++;
}
});
-
this._columnService.getResponseTotalColsList()
.subscribe((responseTotalColList) => {
this.TotalColListObj = responseTotalColList;
@@ -227,13 +221,13 @@ export class ColumnListComponent implements OnInit {
close() {
+ this.changeDetectorRefs.detectChanges();
this._columnService.getColumnList()
.subscribe((response) => {
this.showSpinner = true;
this.dataSource = new DataTableDataSource();
this.finalObjArr = [];
this.finalGetObj = response;
-
let fgo_counter = 0;
while (this.finalGetObj[fgo_counter]) {
this.finalGetObj[fgo_counter]['no'] = fgo_counter + 1;
@@ -270,15 +264,12 @@ export class ColumnListComponent implements OnInit {
save() {
-
+ this.changeDetectorRefs.detectChanges();
this.showSpinner = true;
-
this.finalPOSTObj['tabId'] = 'ColEdit';
this.finalPOSTObj['tabName'] = 'Column Edit';
-
this.finalPOSTObj['colId'] = this.id;
this.finalPOSTObj['colName'] = this.name;
-
this.finalPOSTObj['colType'] = '';
this.finalPOSTObj['colspan'] = this.colspan;
this.finalPOSTObj['dataType'] = this.dataType;
@@ -309,41 +300,38 @@ export class ColumnListComponent implements OnInit {
if (this.semaphoreName === 'No Display') {
this.semaphoreId = '';
} else {
- for ( let slcount = 0 ; slcount < this.semaphoreList.semaphore.length; slcount++) {
- if (this.semaphoreName === this.semaphoreList.semaphore[slcount].semaphoreName) {
- this.semaphoreId = this.semaphoreList.semaphore[slcount].semaphoreId;
+ if(this.semaphoreList && this.semaphoreList.semaphore){
+ for (let slcount = 0; slcount < this.semaphoreList.semaphore.length; slcount++) {
+ if (this.semaphoreName === this.semaphoreList.semaphore[slcount].semaphoreName) {
+ this.semaphoreId = this.semaphoreList.semaphore[slcount].semaphoreId;
+ this.semaphoreList.semaphore[slcount].comment = this.id;
+ }
}
}
}
this.finalPOSTObj['semaphoreId'] = this.semaphoreId;
this.finalPOSTObj['semaphoreList'] = this.semaphoreList;
-
this._columnService.postColumnChanges(this.finalPOSTObj)
.subscribe((finalPOSTResponse) => {
-
if (finalPOSTResponse) {
this.EditColstatus = 'Success!';
this.EditColmessage = 'Your change has been saved! Row definition is updated.';
this.showSaveColDialog = !this.showSaveColDialog;
-
this.Colclosable = true;
-
} else {
this.EditColstatus = 'Failure!';
this.EditColmessage = 'Row definition could not be updated.';
this.showSaveColDialog = !this.showSaveColDialog;
-
this.Colclosable = true;
}
-
this.showEditDrillDownPage = false;
this.showAdvancedDisplayPage = false;
this.isIncomingDrillDownParams = false;
this.addDisplay = false;
this.showSpinner = false;
- });
+ });
}