From 6e6a016084536b9a60823d1e6eb335a9da0c6932 Mon Sep 17 00:00:00 2001 From: Alex Karpov Date: Thu, 8 Aug 2024 13:02:34 +0300 Subject: [PATCH] NAS-130337: Reporting graph inconsistency between data, labels and units (#10412) --- .../reports-global-controls.component.ts | 4 ++-- .../pages/reports-dashboard/reports-dashboard.component.ts | 3 --- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/app/pages/reports-dashboard/components/reports-global-controls/reports-global-controls.component.ts b/src/app/pages/reports-dashboard/components/reports-global-controls/reports-global-controls.component.ts index 8245e590962..7426272140b 100644 --- a/src/app/pages/reports-dashboard/components/reports-global-controls/reports-global-controls.component.ts +++ b/src/app/pages/reports-dashboard/components/reports-global-controls/reports-global-controls.component.ts @@ -8,7 +8,7 @@ import { MatDialog } from '@angular/material/dialog'; import { ActivatedRoute } from '@angular/router'; import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy'; import { Store } from '@ngrx/store'; -import { take } from 'rxjs'; +import { debounceTime, take } from 'rxjs'; import { NetdataDialogComponent, } from 'app/pages/reports-dashboard/components/reports-global-controls/netdata-dialog/netdata-dialog.component'; @@ -80,7 +80,7 @@ export class ReportsGlobalControlsComponent implements OnInit { if (this.activeTab?.value !== ReportType.Disk) { return; } - this.form.valueChanges.pipe(untilDestroyed(this)).subscribe((values) => { + this.form.valueChanges.pipe(debounceTime(300), untilDestroyed(this)).subscribe((values) => { this.diskOptionsChanged.emit({ devices: values.devices, metrics: values.metrics, diff --git a/src/app/pages/reports-dashboard/reports-dashboard.component.ts b/src/app/pages/reports-dashboard/reports-dashboard.component.ts index 533e08b2958..8082a1c5a8a 100644 --- a/src/app/pages/reports-dashboard/reports-dashboard.component.ts +++ b/src/app/pages/reports-dashboard/reports-dashboard.component.ts @@ -4,7 +4,6 @@ import { ChangeDetectorRef, Component, ElementRef, - Inject, OnDestroy, OnInit, ViewChild, @@ -13,7 +12,6 @@ import { ActivatedRoute } from '@angular/router'; import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy'; import { ReportingGraphName } from 'app/enums/reporting.enum'; import { stringToTitleCase } from 'app/helpers/string-to-title-case'; -import { WINDOW } from 'app/helpers/window.helper'; import { Option } from 'app/interfaces/option.interface'; import { ReportTab, ReportType } from 'app/pages/reports-dashboard/interfaces/report-tab.interface'; import { Report } from 'app/pages/reports-dashboard/interfaces/report.interface'; @@ -48,7 +46,6 @@ export class ReportsDashboardComponent implements OnInit, OnDestroy { private layoutService: LayoutService, private reportsService: ReportsService, private cdr: ChangeDetectorRef, - @Inject(WINDOW) private window: Window, ) {} ngOnInit(): void {