Added new component for SDK report 23/109823/6
authorjz385p <jz385p@us.att.com>
Fri, 3 Jul 2020 12:48:28 +0000 (18:18 +0530)
committerJegadeesh Babu <jegadeesh.babu@att.com>
Tue, 7 Jul 2020 14:17:17 +0000 (14:17 +0000)
Added display area report

Issue-ID: PORTAL-940
Change-Id: Ie8a176d21e09757baa454f0da380c34fd5128ccf
Signed-off-by: jz385p <jegadeesh.babu@att.com>
ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/ReportLoader.java
ecomp-sdk/epsdk-app-os/ngappsrc/src/app/pages/pages-routing.module.ts
ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/display-area/display-area.component.html [new file with mode: 0644]
ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/display-area/display-area.component.scss [new file with mode: 0644]
ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/display-area/display-area.component.spec.ts [new file with mode: 0644]
ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/analytics/Report_List/display-area/display-area.component.ts [new file with mode: 0644]
ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/pages/pages.module.ts
ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/shared/services/displayArea/display-area.service.spec.ts [new file with mode: 0644]
ecomp-sdk/epsdk-app-overlay/src/main/webapp/ngapp/src/app/shared/services/displayArea/display-area.service.ts [new file with mode: 0644]

index a92d524..01e9f3f 100644 (file)
@@ -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());
index 60052f9..459220a 100644 (file)
@@ -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 (file)
index 0000000..eb07a76
--- /dev/null
@@ -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 (file)
index 0000000..bc18934
--- /dev/null
@@ -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 (file)
index 0000000..27329a9
--- /dev/null
@@ -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 (file)
index 0000000..e08190e
--- /dev/null
@@ -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] );
+}
+
+}
index 3723114..45789f2 100644 (file)
@@ -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 (file)
index 0000000..f8324da
--- /dev/null
@@ -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 (file)
index 0000000..7143303
--- /dev/null
@@ -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);
+  }
+}