From f8d4c458a54063cf5695ce97f9decafa4bf2f35e Mon Sep 17 00:00:00 2001 From: jz385p Date: Fri, 3 Jul 2020 18:18:28 +0530 Subject: Added new component for SDK report Added display area report Issue-ID: PORTAL-940 Change-Id: Ie8a176d21e09757baa454f0da380c34fd5128ccf Signed-off-by: jz385p --- .../display-area/display-area.component.html | 14 +++++ .../display-area/display-area.component.scss | 10 ++++ .../display-area/display-area.component.spec.ts | 26 +++++++++ .../display-area/display-area.component.ts | 65 ++++++++++++++++++++++ .../webapp/ngapp/src/app/pages/pages.module.ts | 2 + .../displayArea/display-area.service.spec.ts | 13 +++++ .../services/displayArea/display-area.service.ts | 16 ++++++ 7 files changed, 146 insertions(+) create mode 100644 ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/display-area/display-area.component.html create mode 100644 ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/display-area/display-area.component.scss create mode 100644 ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/display-area/display-area.component.spec.ts create mode 100644 ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/display-area/display-area.component.ts create mode 100644 ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/shared/services/displayArea/display-area.service.spec.ts create mode 100644 ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/shared/services/displayArea/display-area.service.ts (limited to 'ecomp-sdk/epsdk-app-overlay/src/main/webapp') diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/display-area/display-area.component.html b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/display-area/display-area.component.html new file mode 100644 index 00000000..eb07a769 --- /dev/null +++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/display-area/display-area.component.html @@ -0,0 +1,14 @@ + +
+
+

{{this.menuId}} Reports

+
+ +
+ + +
  • {{item.reportName}}
  • +
    + +
    +
    diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/display-area/display-area.component.scss b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/display-area/display-area.component.scss new file mode 100644 index 00000000..bc189348 --- /dev/null +++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/display-area/display-area.component.scss @@ -0,0 +1,10 @@ + +button{ + margin: 0; + font-size: 100%; + vertical-align: middle; + color:white; + background-color: #0568ae +} + + \ No newline at end of file diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/display-area/display-area.component.spec.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/display-area/display-area.component.spec.ts new file mode 100644 index 00000000..27329a9b --- /dev/null +++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/display-area/display-area.component.spec.ts @@ -0,0 +1,26 @@ +// import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +// import { DisplayAreaComponent } from './display-area.component'; + +// describe('DisplayAreaComponent', () => { +// let component: DisplayAreaComponent; +// let fixture: ComponentFixture; + +// beforeEach(async(() => { +// TestBed.configureTestingModule({ +// declarations: [ DisplayAreaComponent ] +// }) +// .compileComponents(); +// })); + +// beforeEach(() => { +// fixture = TestBed.createComponent(DisplayAreaComponent); +// component = fixture.componentInstance; +// fixture.detectChanges(); +// }); + +// it('should create', () => { +// expect(component).toBeTruthy(); +// }); +// }); + 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; + 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] ); +} + +} diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/pages.module.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/pages.module.ts index 37231147..45789f27 100644 --- a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/pages.module.ts +++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/pages.module.ts @@ -67,6 +67,7 @@ import { LayoutModule } from '@angular/cdk/layout'; import { DashboardReportGridComponent } from './analytics/Report_List/Report/definition/dashboard-report-grid/dashboard-report-grid.component'; import { DataChartComponent } from './analytics/Report_List/Report/definition/dashboard-report-grid/data-chart/data-chart.component'; import { RunDashboardReportComponent } from './analytics/Report_List/Report/run/run-report/run-dashboard-report/run-dashboard-report.component'; +import { DisplayAreaComponent } from './analytics/Report_List/display-area/display-area.component'; @@ -118,6 +119,7 @@ import { RdpModule } from 'portalsdk-tag-lib'; DashboardReportGridComponent, DataChartComponent, RunDashboardReportComponent, DialogOverviewExampleDialog, + DisplayAreaComponent ], diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/shared/services/displayArea/display-area.service.spec.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/shared/services/displayArea/display-area.service.spec.ts new file mode 100644 index 00000000..f8324dac --- /dev/null +++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/shared/services/displayArea/display-area.service.spec.ts @@ -0,0 +1,13 @@ +// import { TestBed } from '@angular/core/testing'; + +// import { DisplayAreaService } from './display-area.service'; + +// describe('DisplayAreaService', () => { +// beforeEach(() => TestBed.configureTestingModule({})); + +// it('should be created', () => { +// const service: DisplayAreaService = TestBed.get(DisplayAreaService); +// expect(service).toBeTruthy(); +// }); +// }); + diff --git a/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/shared/services/displayArea/display-area.service.ts b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/shared/services/displayArea/display-area.service.ts new file mode 100644 index 00000000..71433031 --- /dev/null +++ b/ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/shared/services/displayArea/display-area.service.ts @@ -0,0 +1,16 @@ +import { Injectable } from '@angular/core'; +import { HttpClient } from '@angular/common/http'; +import { Observable } from 'rxjs'; +import { environment } from '../../../../environments/environment'; +@Injectable({ + providedIn: 'root' +}) +export class DisplayAreaService { + + constructor(private _http : HttpClient) { } + + getMenuIdSpecificReports(menuId : string) : Observable + { + return this._http.get(environment.baseUrl + "raptor.htm?action=quicklinks.json&quick_links_menu_id=" + menuId); + } +} -- cgit 1.2.3-korg