@@ -69,9 +69,7 @@ export class DashboardRenderComponent implements OnInit, OnDestroy, AfterViewIni
6969 private dashboardBehavior : DashboardBehavior ,
7070 private timeFilterBehavior : TimeFilterBehavior ,
7171 private exportPdfService : ExportPdfService ,
72- private spinner : NgxSpinnerService ,
73- private refreshService : RefreshService ,
74- private router : Router ) {
72+ private spinner : NgxSpinnerService ) {
7573 }
7674
7775 ngOnInit ( ) {
@@ -82,44 +80,11 @@ export class DashboardRenderComponent implements OnInit, OnDestroy, AfterViewIni
8280 tap ( ( visualizations ) => {
8381 this . dashboard = this . layoutService . dashboard ;
8482 this . filters = this . dashboard && this . dashboard . filters ? JSON . parse ( this . dashboard . filters ) : [ ] ;
85- /* if (this.dashboard.refreshTime) {
86- console.log(this.dashboard.refreshTime);
87- this.onRefreshTime(this.dashboard.refreshTime);
88- }*/
8983 this . loadingVisualizations = false ;
9084 } ) ,
9185 map ( data => data . response )
9286 ) ;
9387
94- /*this.activatedRoute.params.subscribe(params => {
95- this.dashboardId = params.id;
96- if (this.dashboardId) {
97- const request = {
98- page: 0,
99- size: 10000,
100- 'idDashboard.equals': this.dashboardId,
101- sort: 'order,asc'
102- };
103- this.utmRenderVisualization.query(request).subscribe(response => {
104- this.layoutService.layout = [];
105- this.timeEnable = [];
106- this.visualizationRender = response.body;
107- this.dashboard = this.visualizationRender.length > 0 ? this.visualizationRender[0].dashboard : null;
108- this.filters = this.dashboard.filters ? JSON.parse(this.dashboard.filters) : [];
109- if (this.dashboard.refreshTime) {
110- this.onRefreshTime(this.dashboard.refreshTime);
111- }
112- for (const vis of this.visualizationRender) {
113- if (vis.showTimeFilter) {
114- this.timeEnable.push(vis.visualization.id);
115- }
116- const grid = JSON.parse(vis.gridInfo);
117- this.layoutService.addItem(vis.visualization, grid);
118- }
119- this.loadingVisualizations = false;
120- });
121- }
122- });*/
12388 this . dashboardBehavior . $filterDashboard . subscribe ( dashboardFilter => {
12489 if ( dashboardFilter ) {
12590 mergeParams ( dashboardFilter . filter , this . filtersValues ) . then ( newFilters => {
@@ -158,13 +123,6 @@ export class DashboardRenderComponent implements OnInit, OnDestroy, AfterViewIni
158123 }
159124 }
160125
161- ngOnDestroy ( ) : void {
162- document . body . classList . remove ( 'overflow-hidden' ) ;
163- clearInterval ( this . interval ) ;
164- this . layoutService . clearLayout ( ) ;
165- this . dashboardBehavior . $filterDashboard . next ( null ) ;
166- }
167-
168126 ngAfterViewInit ( ) : void {
169127 this . cdr . detectChanges ( ) ;
170128 }
@@ -193,5 +151,12 @@ export class DashboardRenderComponent implements OnInit, OnDestroy, AfterViewIni
193151 trackByFn ( index : number , item : { grid : GridsterItem , visualization : VisualizationType } ) {
194152 return item . visualization . id ;
195153 }
154+
155+ ngOnDestroy ( ) : void {
156+ document . body . classList . remove ( 'overflow-hidden' ) ;
157+ clearInterval ( this . interval ) ;
158+ this . layoutService . clearLayout ( ) ;
159+ this . dashboardBehavior . $filterDashboard . next ( null ) ;
160+ }
196161}
197162
0 commit comments