summaryrefslogtreecommitdiffstats
path: root/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/display-area/display-area.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/display-area/display-area.component.ts')
-rw-r--r--ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/display-area/display-area.component.ts65
1 files changed, 65 insertions, 0 deletions
diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/display-area/display-area.component.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/display-area/display-area.component.ts
new file mode 100644
index 00000000..e08190e7
--- /dev/null
+++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/display-area/display-area.component.ts
@@ -0,0 +1,65 @@
+import { Component, OnInit, ViewChild } from '@angular/core';
+import { ActivatedRoute, Router } from '@angular/router';
+import { DisplayAreaService } from 'src/app/shared/services/displayArea/display-area.service';
+import { MatPaginator } from '@angular/material/paginator';
+import { MatSort } from '@angular/material/sort';
+import { MatTable, MatTableDataSource } from '@angular/material/table';
+
+@Component({
+ selector: 'app-display-area',
+ templateUrl: './display-area.component.html',
+ styleUrls: ['./display-area.component.scss']
+})
+export class DisplayAreaComponent 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<any>;
+ menuId:string;
+ showSpinner: boolean;
+ dataSource1: any;
+ displayedColumns = ["reportName", "reportDescr","reportURL"];
+ finalGETObj: {};
+ finalRowArr: any[];
+ rowObj: any;
+ reportId: string;
+
+ constructor(private _route: ActivatedRoute, private _router: Router, private _displayAreaService: DisplayAreaService) { }
+
+ ngOnInit() {
+ this._route.params.subscribe(params => {
+ this.menuId = params['menuId'];
+ console.log("displayArea " +this.menuId);
+ this.initializeReportList(this.menuId);
+ });
+
+
+
+ }
+
+ initializeReportList(menuId:string) {
+ this.showSpinner = true;
+ this.dataSource1 = new MatTableDataSource();
+ this.finalGETObj = new Object();
+//this.finalGETObjRowsArr = new Array();
+ this.finalRowArr = new Array();
+ this._displayAreaService.getMenuIdSpecificReports(this.menuId)
+ .subscribe(( responseObj ) => {
+ this.finalGETObj = responseObj;
+ for (let entry of responseObj) {
+ this.rowObj = new Object();
+ this.rowObj["reportName"] = entry["reportName"];
+ this.rowObj["reportDescr"] = entry["reportDescr"];
+ this.rowObj["reportURL"] = entry["reportURL"];
+ this.finalRowArr.push( this.rowObj );
+ }
+ this.showSpinner = false;
+ } );
+}
+
+runReport( reportId: string ) {
+ this.reportId = reportId;
+ this._router.navigate( [reportId] );
+}
+
+}