diff options
author | Sunder Tattavarada <statta@research.att.com> | 2020-07-07 14:48:24 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2020-07-07 14:48:24 +0000 |
commit | e50776db662555e4424a48c583ce39d79aea472e (patch) | |
tree | 0af9ac076e70cf7298ed07b0e5a820e0bcae01a6 /ecomp-sdk/epsdk-app-overlay/src/main | |
parent | ccb4274b6daa06b89b8d880ac3941a8323993b97 (diff) | |
parent | f8d4c458a54063cf5695ce97f9decafa4bf2f35e (diff) |
Merge "Added new component for SDK report"
Diffstat (limited to 'ecomp-sdk/epsdk-app-overlay/src/main')
7 files changed, 146 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.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 @@ + +<div > +<div class="tab-content"> + <h3>{{this.menuId}} Reports</h3> +</div> +<span class="ecomp-spinner" *ngIf="showSpinner"></span> +<div> + +<ng-container *ngFor="let item of finalRowArr"> + <li><a href="javascript:void(0);" (click)="runReport(item.reportURL)">{{item.reportName}}</a></li> +</ng-container> + +</div> +</div> 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<DisplayAreaComponent>; + +// 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<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] ); +} + +} 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<any> + { + return this._http.get(environment.baseUrl + "raptor.htm?action=quicklinks.json&quick_links_menu_id=" + menuId); + } +} |