diff options
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.ts | 65 |
1 files changed, 38 insertions, 27 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 5399d792..2cd68020 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,4 +1,4 @@ -import { AfterViewInit, Component, OnInit, ViewChild, SimpleChange, Input } from '@angular/core'; +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'; @@ -19,6 +19,7 @@ export class ColumnListComponent implements OnInit { @Input("reportId") reportId : number; + dataSource: DataTableDataSource; finalGetObj : {}; @@ -72,6 +73,8 @@ export class ColumnListComponent implements OnInit { drilldownType : string; drillDownObj : {}; checkCnt : number; + showSpinner : boolean; + displayTable : boolean; constructor(private _http : HttpClient, private _columnService : ColumnService){ @@ -88,14 +91,17 @@ export class ColumnListComponent implements OnInit { this.finalPOSTObj = new Object(); this.drillDownObj = new Object(); this.checkCnt = 0; + this.showSpinner = false; } ngOnInit() { + + this.displayTable = true; + this._columnService.getColumnList() .subscribe((response) => { - //console.log(response); - + this.showSpinner = true; this.finalGetObj = response; let k=0; @@ -106,8 +112,6 @@ export class ColumnListComponent implements OnInit { this.finalObjArr.push(this.finalGetObj[k]); - - //console.log(this.finalObjArr); k++; } @@ -115,12 +119,13 @@ export class ColumnListComponent implements OnInit { this.dataSource.data = this.finalObjArr; - + this.dataSource.sort = this.sort; this.dataSource.paginator = this.paginator; this.table.dataSource = this.dataSource; this.dataSource.data = this.finalObjArr; //this.dataSource.data = [{id:"1", no:1, name:"1", edit:""}]; + this.showSpinner = false; }); this.showDialog = false; this.showSaveColDialog =false; @@ -135,19 +140,17 @@ export class ColumnListComponent implements OnInit { this.drillDownObj["drillDownUrl"] = this.drilldownURL; this.drillDownObj["drillDownParams"] = this.drilldownParams; this.drillDownObj["drillDownType"] = this.drilldownType; - - - } editRecord(id : string) { + this.showSpinner = true; + this.columnId = id; this._columnService.getIndividualColumnData(id) .subscribe((response) => { this.finalEditRowGetObj = response; - //console.log(response); this.id = this.finalEditRowGetObj["colId"]; this.name = this.finalEditRowGetObj["colName"]; @@ -171,6 +174,11 @@ export class ColumnListComponent implements OnInit { this.drilldownURL = this.finalEditRowGetObj["drilldownURL"]; this.drilldownParams = this.finalEditRowGetObj["drilldownParams"]; this.drilldownType = this.finalEditRowGetObj["drilldownType"]; + this.drillDownObj["drillDownUrl"] = this.drilldownURL; + this.drillDownObj["drillDownParams"] = this.drilldownParams; + this.drillDownObj["drillDownType"] = this.drilldownType; + + this. displayTotal = (this.finalEditRowGetObj["displayTotal"] == null ? "" : this.finalEditRowGetObj["displayTotal"]); @@ -186,14 +194,11 @@ export class ColumnListComponent implements OnInit { this.URLListObjArray.push(this.URLListObj[l]); l++; } - //console.log(this.URLListObjArray); - }); this._columnService.getResponseTotalColsList() .subscribe((responseTotalColList) => { - //console.log(responseTotalColList); this.TotalColListObj = responseTotalColList; @@ -203,26 +208,36 @@ export class ColumnListComponent implements OnInit { this.TotalColListObjArray.push(this.TotalColListObj[l]); l++; } - //console.log(this.TotalColListObjArray); }); this.status = "Success!"; this.message = "Report Column - Edit"; this.showDialog = !this.showDialog; this.closable = true; + + + + this.showSpinner = false; }); } + ngOnChanges() + { + console.log("Hit"); + } + close() { + + this._columnService.getColumnList() .subscribe((response) => { - //console.log(response); - + this.showSpinner = true; + this.dataSource = new DataTableDataSource(); this.finalObjArr = []; this.finalGetObj = response; @@ -235,8 +250,6 @@ export class ColumnListComponent implements OnInit { this.finalObjArr.push(this.finalGetObj[k]); - - //console.log(this.finalObjArr); k++; } @@ -250,6 +263,8 @@ export class ColumnListComponent implements OnInit { this.table.dataSource = this.dataSource; this.dataSource.data = this.finalObjArr; //this.dataSource.data = [{id:"1", no:1, name:"1", edit:""}]; + + this.showSpinner = false; }); this.showDialog = false; this.showSaveColDialog =false; @@ -269,16 +284,16 @@ export class ColumnListComponent implements OnInit { this.showConfirmButton = false; } - onCompleted(arr : any) + onCompleted(drilldownParamsArr : any) { - console.log(arr); + this.drilldownParams = drilldownParamsArr["drilldownParams"]; } save() { - + this.showSpinner = true; this.finalPOSTObj["tabId"] = "ColEdit"; this.finalPOSTObj["tabName"] = "Column Edit"; @@ -296,7 +311,7 @@ export class ColumnListComponent implements OnInit { this.finalPOSTObj["displayTotal"] = this.displayTotal; this.finalPOSTObj["displayWidth"] = 10; this.finalPOSTObj["displayWidthInPixel"] = this.displayWidthInPixel; - this.finalPOSTObj["drilldownParams"] = ""; + this.finalPOSTObj["drilldownParams"] = this.drilldownParams; this.finalPOSTObj["drilldownType"] = ""; this.finalPOSTObj["drilldownURL"] = this.drilldownURL; this.finalPOSTObj["errorMessage"] = ""; @@ -310,11 +325,8 @@ export class ColumnListComponent implements OnInit { this.finalPOSTObj["subTotalCustomText"] = this.displayTotal; this.finalPOSTObj["visible"] = this.visible; - //console.log(this.finalPOSTObj); - this._columnService.postColumnChanges(this.finalPOSTObj) .subscribe((finalPOSTResponse) => { - console.log(finalPOSTResponse); if(finalPOSTResponse) { @@ -335,10 +347,9 @@ export class ColumnListComponent implements OnInit { } this.showEditDrillDownPage = false; + this.showSpinner = false; }); - - console.log("Saved!!!"); } |