diff options
author | jz385p <jz385p@us.att.com> | 2020-07-03 18:18:28 +0530 |
---|---|---|
committer | Jegadeesh Babu <jegadeesh.babu@att.com> | 2020-07-07 14:17:17 +0000 |
commit | f8d4c458a54063cf5695ce97f9decafa4bf2f35e (patch) | |
tree | 267d0c6bbd6bcb9c3bba0df379be259964622ff2 | |
parent | 5aa5ee5ba06bc361fe078274d8dea05d408ab706 (diff) |
Added new component for SDK report
Added display area report
Issue-ID: PORTAL-940
Change-Id: Ie8a176d21e09757baa454f0da380c34fd5128ccf
Signed-off-by: jz385p <jegadeesh.babu@att.com>
9 files changed, 152 insertions, 3 deletions
diff --git a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/ReportLoader.java b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/ReportLoader.java index a92d5244..01e9f3f4 100644 --- a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/ReportLoader.java +++ b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/ReportLoader.java @@ -501,9 +501,10 @@ public class ReportLoader extends org.onap.portalsdk.analytics.RaptorObject { for (int i = 0; i < ds.getRowCount(); i++) { QuickLink quickLink = new QuickLink(); StringBuffer link = new StringBuffer(""); - link.append(AppUtils.getReportExecuteActionURLNG() + "c_master=" + ds.getString(i, 0)); - if (b) - link.append("&PAGE_ID=" + menuId + "&refresh=Y"); + //link.append(AppUtils.getReportExecuteActionURLNG() + "c_master=" + ds.getString(i, 0)); + //if (b) + //link.append("&PAGE_ID=" + menuId + "&refresh=Y"); + link.append("v2/run/"+ ds.getString(i, 0)); quickLink.setReportURL(link.toString()); quickLink.setReportName(ds.getString(i, 1)); quickLink.setShowDescr(Globals.getShowDescrAtRuntime()); diff --git a/ecomp-sdk/epsdk-app-os/ngappsrc/src/app/pages/pages-routing.module.ts b/ecomp-sdk/epsdk-app-os/ngappsrc/src/app/pages/pages-routing.module.ts index 60052f92..459220ab 100644 --- a/ecomp-sdk/epsdk-app-os/ngappsrc/src/app/pages/pages-routing.module.ts +++ b/ecomp-sdk/epsdk-app-os/ngappsrc/src/app/pages/pages-routing.module.ts @@ -13,6 +13,7 @@ import { HeaderTabsWrapperComponent } from './analytics/Report_List/header-tabs- import { RunReportFormFieldsComponent } from './analytics/Report_List/Report/run/run-report-form-fields/run-report-form-fields.component'; import { WelcomeDashboardComponent } from './welcome-dashboard/welcome-dashboard.component'; import {RefreshComponent} from './refresh/refresh.component'; +import { DisplayAreaComponent } from './analytics/Report_List/display-area/display-area.component'; @@ -31,6 +32,7 @@ const routes: Routes = [ { path: 'run/:reportId', component: RunReportFormFieldsComponent}, { path: 'run/:reportId/:queryParameters', component: RunReportFormFieldsComponent}, { path: 'run', component: RunReportFormFieldsComponent}, + { path: 'displayArea/:menuId', component: DisplayAreaComponent}, { path: 'welcome', component :WelcomeDashboardComponent}, { path: 'refresh', component: RefreshComponent}, { path: '', redirectTo: 'welcome'} 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); + } +} |