From d29a8731cedb7a0bc827c86a5baff8be04ca6025 Mon Sep 17 00:00:00 2001 From: Igor Kulikov Date: Fri, 13 Sep 2019 13:10:24 +0300 Subject: [PATCH] Implement local timewindow handling. --- .../src/app/core/api/widget-subscription.ts | 16 +++++++--------- .../dashboard/dashboard.component.html | 3 ++- .../components/widget/widget.component.ts | 14 ++++++++++---- ui-ngx/src/polyfills.ts | 2 ++ ui-ngx/src/zone-flags.ts | 19 +++++++++++++++++++ 5 files changed, 40 insertions(+), 14 deletions(-) create mode 100644 ui-ngx/src/zone-flags.ts diff --git a/ui-ngx/src/app/core/api/widget-subscription.ts b/ui-ngx/src/app/core/api/widget-subscription.ts index 9d1ebd3b46..5545b22ef7 100644 --- a/ui-ngx/src/app/core/api/widget-subscription.ts +++ b/ui-ngx/src/app/core/api/widget-subscription.ts @@ -321,14 +321,6 @@ export class WidgetSubscription implements IWidgetSubscription { }); if (this.displayLegend) { this.legendData.keys = this.legendData.keys.sort((key1, key2) => key1.dataKey.label.localeCompare(key2.dataKey.label)); - // TODO: - } - if (this.type === widgetType.timeseries) { - if (this.useDashboardTimewindow) { - // TODO: - } else { - // TODO: - } } } @@ -395,6 +387,10 @@ export class WidgetSubscription implements IWidgetSubscription { } updateTimewindowConfig(newTimewindow: Timewindow): void { + if (!this.useDashboardTimewindow) { + this.timeWindowConfig = newTimewindow; + this.update(); + } } onResetTimewindow(): void { @@ -424,14 +420,17 @@ export class WidgetSubscription implements IWidgetSubscription { } sendOneWayCommand(method: string, params?: any, timeout?: number): Observable { + // TODO: return undefined; } sendTwoWayCommand(method: string, params?: any, timeout?: number): Observable { + // TODO: return undefined; } clearRpcError(): void { + // TODO: } update() { @@ -536,7 +535,6 @@ export class WidgetSubscription implements IWidgetSubscription { this.cafs[cafId] = null; } } - // TODO: } private notifyDataLoading() { diff --git a/ui-ngx/src/app/modules/home/components/dashboard/dashboard.component.html b/ui-ngx/src/app/modules/home/components/dashboard/dashboard.component.html index 775ee94c05..a352d2da46 100644 --- a/ui-ngx/src/app/modules/home/components/dashboard/dashboard.component.html +++ b/ui-ngx/src/app/modules/home/components/dashboard/dashboard.component.html @@ -50,6 +50,7 @@ {{widget.title}} @@ -98,7 +99,7 @@