@c8y/ngx-components 1021.55.1 → 1021.55.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/core/common/interval-based-reload.abstract.d.ts +13 -3
  2. package/core/common/interval-based-reload.abstract.d.ts.map +1 -1
  3. package/core/dashboard/widget-auto-refresh-context/auto-refresh-control.component.d.ts +3 -4
  4. package/core/dashboard/widget-auto-refresh-context/auto-refresh-control.component.d.ts.map +1 -1
  5. package/core/dashboard/widget-auto-refresh-context/widget-auto-refresh-context.component.d.ts +1 -0
  6. package/core/dashboard/widget-auto-refresh-context/widget-auto-refresh-context.component.d.ts.map +1 -1
  7. package/core/dashboard/widgets-dashboard-event.service.d.ts +7 -0
  8. package/core/dashboard/widgets-dashboard-event.service.d.ts.map +1 -1
  9. package/core/dashboard/wiget-time-context/widget-time-context.component.d.ts +6 -2
  10. package/core/dashboard/wiget-time-context/widget-time-context.component.d.ts.map +1 -1
  11. package/datapoint-explorer/view/configuration/workspace-configuration.component.d.ts.map +1 -1
  12. package/datapoints-export-selector/datapoints-export-selector-modal/datapoints-export-selector-file-exporter/data-fetching.service.d.ts.map +1 -1
  13. package/datapoints-export-selector/datapoints-export-selector.component.d.ts +3 -1
  14. package/datapoints-export-selector/datapoints-export-selector.component.d.ts.map +1 -1
  15. package/echart/charts.component.d.ts.map +1 -1
  16. package/esm2022/core/aggregation/aggregation.model.mjs +2 -2
  17. package/esm2022/core/common/interval-based-reload.abstract.mjs +13 -13
  18. package/esm2022/core/dashboard/dashboard-child.component.mjs +3 -3
  19. package/esm2022/core/dashboard/widget-auto-refresh-context/auto-refresh-control.component.mjs +6 -8
  20. package/esm2022/core/dashboard/widget-auto-refresh-context/widget-auto-refresh-context.component.mjs +9 -1
  21. package/esm2022/core/dashboard/widgets-dashboard-event.service.mjs +19 -2
  22. package/esm2022/core/dashboard/widgets-dashboard.component.mjs +3 -3
  23. package/esm2022/core/dashboard/wiget-time-context/widget-time-context-icon-bar/widget-time-context-icon-bar.component.mjs +3 -3
  24. package/esm2022/core/dashboard/wiget-time-context/widget-time-context.component.mjs +48 -23
  25. package/esm2022/datapoint-explorer/view/configuration/workspace-configuration.component.mjs +13 -8
  26. package/esm2022/datapoint-explorer/view/datapoint-explorer.component.mjs +2 -2
  27. package/esm2022/datapoints-export-selector/datapoints-export-selector-modal/datapoints-export-selector-file-exporter/data-fetching.service.mjs +1 -3
  28. package/esm2022/datapoints-export-selector/datapoints-export-selector.component.mjs +9 -5
  29. package/esm2022/echart/charts.component.mjs +22 -84
  30. package/esm2022/widgets/definitions/datapoints-table/index.mjs +3 -2
  31. package/esm2022/widgets/implementations/alarms/alarm-list-widget-view/alarm-list-widget.component.mjs +3 -3
  32. package/esm2022/widgets/implementations/alarms/alarm-widget-alarms-reload.component.mjs +17 -100
  33. package/esm2022/widgets/implementations/datapoints-table/datapoints-table-config/datapoints-table-config.component.mjs +47 -34
  34. package/esm2022/widgets/implementations/datapoints-table/datapoints-table-view/datapoints-reload/datapoints-reload.component.mjs +35 -13
  35. package/esm2022/widgets/implementations/datapoints-table/datapoints-table-view/datapoints-table/datapoints-table.component.mjs +3 -3
  36. package/esm2022/widgets/implementations/datapoints-table/datapoints-table-view/datapoints-table-view.component.mjs +75 -35
  37. package/esm2022/widgets/implementations/datapoints-table/datapoints-table-widget.model.mjs +3 -5
  38. package/fesm2022/c8y-ngx-components-datapoint-explorer-view.mjs +13 -8
  39. package/fesm2022/c8y-ngx-components-datapoint-explorer-view.mjs.map +1 -1
  40. package/fesm2022/c8y-ngx-components-datapoints-export-selector.mjs +7 -6
  41. package/fesm2022/c8y-ngx-components-datapoints-export-selector.mjs.map +1 -1
  42. package/fesm2022/c8y-ngx-components-echart.mjs +21 -83
  43. package/fesm2022/c8y-ngx-components-echart.mjs.map +1 -1
  44. package/fesm2022/c8y-ngx-components-widgets-definitions-datapoints-table.mjs +2 -1
  45. package/fesm2022/c8y-ngx-components-widgets-definitions-datapoints-table.mjs.map +1 -1
  46. package/fesm2022/c8y-ngx-components-widgets-implementations-alarms.mjs +18 -101
  47. package/fesm2022/c8y-ngx-components-widgets-implementations-alarms.mjs.map +1 -1
  48. package/fesm2022/c8y-ngx-components-widgets-implementations-datapoints-table.mjs +147 -76
  49. package/fesm2022/c8y-ngx-components-widgets-implementations-datapoints-table.mjs.map +1 -1
  50. package/fesm2022/c8y-ngx-components.mjs +209 -162
  51. package/fesm2022/c8y-ngx-components.mjs.map +1 -1
  52. package/locales/locales.pot +3 -7
  53. package/package.json +1 -1
  54. package/widgets/definitions/datapoints-table/index.d.ts.map +1 -1
  55. package/widgets/implementations/alarms/alarm-widget-alarms-reload.component.d.ts +18 -63
  56. package/widgets/implementations/alarms/alarm-widget-alarms-reload.component.d.ts.map +1 -1
  57. package/widgets/implementations/datapoints-table/datapoints-table-config/datapoints-table-config.component.d.ts +4 -2
  58. package/widgets/implementations/datapoints-table/datapoints-table-config/datapoints-table-config.component.d.ts.map +1 -1
  59. package/widgets/implementations/datapoints-table/datapoints-table-view/datapoints-reload/datapoints-reload.component.d.ts +16 -8
  60. package/widgets/implementations/datapoints-table/datapoints-table-view/datapoints-reload/datapoints-reload.component.d.ts.map +1 -1
  61. package/widgets/implementations/datapoints-table/datapoints-table-view/datapoints-table-view.component.d.ts +21 -4
  62. package/widgets/implementations/datapoints-table/datapoints-table-view/datapoints-table-view.component.d.ts.map +1 -1
  63. package/widgets/implementations/datapoints-table/datapoints-table-widget.model.d.ts +4 -1
  64. package/widgets/implementations/datapoints-table/datapoints-table-widget.model.d.ts.map +1 -1
@@ -3,7 +3,7 @@ import { Injectable, EventEmitter, inject, Component, ChangeDetectionStrategy, I
3
3
  import * as i3 from '@angular/forms';
4
4
  import { ControlContainer, ReactiveFormsModule, FormControl, Validators } from '@angular/forms';
5
5
  import * as i1$1 from '@c8y/ngx-components';
6
- import { gettext, CoreModule, AGGREGATION_LABELS, AGGREGATION_VALUES_ARR, AGGREGATION_VALUES, IntervalBasedReload, CountdownIntervalComponent, CommonModule as CommonModule$1, CountdownIntervalModule, ListGroupModule, DynamicComponentAlertAggregator, DynamicComponentAlert, DocsModule, DynamicComponentModule, DismissAlertStrategy } from '@c8y/ngx-components';
6
+ import { gettext, CoreModule, AGGREGATION_LABELS, AGGREGATION_VALUES_ARR, AGGREGATION_VALUES, IntervalBasedReload, CountdownIntervalComponent, CommonModule as CommonModule$1, CountdownIntervalModule, ListGroupModule, DynamicComponentAlertAggregator, DynamicComponentAlert, DocsModule, DynamicComponentModule, DismissAlertStrategy, globalAutoRefreshLoading } from '@c8y/ngx-components';
7
7
  import * as i4 from '@c8y/ngx-components/context-dashboard';
8
8
  import * as i6 from '@c8y/ngx-components/datapoint-selector';
9
9
  import { DatapointSelectorModule } from '@c8y/ngx-components/datapoint-selector';
@@ -12,7 +12,7 @@ import { dateRangeValidator, DatapointsExportSelectorComponent } from '@c8y/ngx-
12
12
  import { INTERVAL_VALUES } from '@c8y/ngx-components/interval-picker';
13
13
  import * as i7 from 'ngx-bootstrap/popover';
14
14
  import { PopoverModule } from 'ngx-bootstrap/popover';
15
- import { Subject, takeUntil, merge, debounceTime } from 'rxjs';
15
+ import { Subject, takeUntil, merge, tap, BehaviorSubject, debounceTime } from 'rxjs';
16
16
  import * as i2 from '@angular/common';
17
17
  import { CommonModule } from '@angular/common';
18
18
  import { aggregationType } from '@c8y/client';
@@ -22,14 +22,12 @@ import { TooltipModule } from 'ngx-bootstrap/tooltip';
22
22
 
23
23
  const DEFAULT_DPT_REFRESH_INTERVAL_VALUE = 30_000;
24
24
  const DATE_SELECTION_VALUES = {
25
- // Will be uncommented in MTM-61920
26
- // dashboard_context: 'dashboard_context',
25
+ dashboard_context: 'dashboard_context',
27
26
  config: 'config',
28
27
  view_and_config: 'view_and_config'
29
28
  };
30
29
  const DATE_SELECTION_VALUES_ARR = [
31
- // Will be uncommented in MTM-61920
32
- // DATE_SELECTION_VALUES.dashboard_context,
30
+ DATE_SELECTION_VALUES.dashboard_context,
33
31
  DATE_SELECTION_VALUES.config,
34
32
  DATE_SELECTION_VALUES.view_and_config
35
33
  ];
@@ -223,9 +221,7 @@ class DatapointsTableWidgetConfigComponent {
223
221
  this.widgetConfig = widgetConfig;
224
222
  this.AGGREGATION_LABELS = AGGREGATION_LABELS;
225
223
  this.DATE_SELECTION_LABELS = DATE_SELECTION_LABELS;
226
- // Will be uncommented in MTM-61920
227
- // readonly DEFAULT_DATE_SELECTOR_VALUE = DATE_SELECTION_VALUES.dashboard_context;
228
- this.DEFAULT_DATE_SELECTOR_VALUE = DATE_SELECTION_VALUES.config;
224
+ this.DEFAULT_DATE_SELECTOR_VALUE = DATE_SELECTION_VALUES.dashboard_context;
229
225
  this.DEFAULT_INTERVAL_VALUE = INTERVAL_VALUES.hours;
230
226
  this.TIME_RANGE_INTERVAL_LABELS = TIME_RANGE_INTERVAL_LABELS;
231
227
  this.AGGREGATION_VALUES_ARR = AGGREGATION_VALUES_ARR;
@@ -260,14 +256,11 @@ class DatapointsTableWidgetConfigComponent {
260
256
  this.destroy$ = new Subject();
261
257
  }
262
258
  ngOnInit() {
263
- // Condition will be removed in MTM-61920
264
- if (this.config.widgetInstanceGlobalTimeContext) {
265
- this.config.widgetInstanceGlobalTimeContext = false;
266
- }
267
259
  if (this.widgetConfig.context?.id) {
268
260
  this.datapointSelectionConfig.contextAsset = this.widgetConfig?.context;
269
261
  }
270
- this.isWidgetLinkedToGlobalTimeContext = this.config.widgetInstanceGlobalTimeContext;
262
+ this.isWidgetLinkedToGlobalTimeContext =
263
+ this.config.widgetInstanceGlobalAutoRefreshContext ?? true;
271
264
  this.initForm();
272
265
  this.handleAutoRefreshToggleChanges();
273
266
  this.handleIntervalSelectorChanges();
@@ -283,8 +276,7 @@ class DatapointsTableWidgetConfigComponent {
283
276
  if (this.formGroup.value.aggregation === AGGREGATION_VALUES.none ||
284
277
  (!this.formGroup.value.aggregation && config.aggregation === AGGREGATION_VALUES.none)) {
285
278
  // The 'NONE' aggregation type is not handled by a backend, so it simply needs to be deleted to get data without aggregation.
286
- delete this.formGroup.value.aggregation;
287
- delete config.aggregation;
279
+ this.deleteAggregationProperty(config);
288
280
  }
289
281
  this.updateTimeContext(config, this.formGroup.value.globalDateSelector);
290
282
  Object.assign(config, this.formGroup.value);
@@ -296,19 +288,21 @@ class DatapointsTableWidgetConfigComponent {
296
288
  }
297
289
  updateTimeContext(config, selectedDateContext) {
298
290
  switch (selectedDateContext) {
299
- // Condition will be removed in MTM-61920
300
- // case DATE_SELECTION_VALUES.dashboard_context:
301
- // config.displayDateSelection = false;
302
- // config.widgetInstanceGlobalTimeContext = true;
303
- // break;
291
+ case DATE_SELECTION_VALUES.dashboard_context:
292
+ config.displayDateSelection = false;
293
+ config.widgetInstanceGlobalAutoRefreshContext = true;
294
+ if (config.aggregation !== 'NONE') {
295
+ this.deleteAggregationProperty(config);
296
+ }
297
+ break;
304
298
  case DATE_SELECTION_VALUES.view_and_config:
305
299
  config.displayDateSelection = true;
306
- config.widgetInstanceGlobalTimeContext = false;
300
+ config.widgetInstanceGlobalAutoRefreshContext = false;
307
301
  break;
308
302
  case DATE_SELECTION_VALUES.config:
309
303
  default:
310
304
  config.displayDateSelection = false;
311
- config.widgetInstanceGlobalTimeContext = false;
305
+ config.widgetInstanceGlobalAutoRefreshContext = false;
312
306
  }
313
307
  }
314
308
  initForm() {
@@ -322,7 +316,8 @@ class DatapointsTableWidgetConfigComponent {
322
316
  }
323
317
  createForm() {
324
318
  const { dateFrom, dateTo } = this.datapointsTableService.calculateDateRange(this.DEFAULT_INTERVAL_VALUE);
325
- const isLegacyWidget = this.config.realtime !== undefined && !this.config.decimalPlaces;
319
+ const isLegacyWidget = this.config.hasOwnProperty('widgetInstanceGlobalTimeContext') &&
320
+ !this.config.hasOwnProperty('decimalPlaces');
326
321
  return this.formBuilder.group({
327
322
  aggregation: new FormControl({
328
323
  value: AGGREGATION_VALUES.none,
@@ -333,7 +328,9 @@ class DatapointsTableWidgetConfigComponent {
333
328
  Validators.minLength(1),
334
329
  minOneDatapointActive()
335
330
  ]),
336
- globalDateSelector: new FormControl(this.DEFAULT_DATE_SELECTOR_VALUE),
331
+ globalDateSelector: new FormControl(isLegacyWidget
332
+ ? this.determineGlobalDateSelectorValueForLegacyWidget()
333
+ : this.DEFAULT_DATE_SELECTOR_VALUE),
337
334
  dateFrom: new FormControl(dateFrom),
338
335
  dateTo: new FormControl(dateTo),
339
336
  decimalPlaces: [
@@ -353,15 +350,26 @@ class DatapointsTableWidgetConfigComponent {
353
350
  })
354
351
  }, { validators: dateRangeValidator });
355
352
  }
353
+ determineGlobalDateSelectorValueForLegacyWidget() {
354
+ const { displayDateSelection, widgetInstanceGlobalAutoRefreshContext } = this.config;
355
+ // State of widgetInstanceGlobalTimeContext was converted to widgetInstanceGlobalAutoRefreshContext.
356
+ // That is why it use here in a legacy widget context.
357
+ if (widgetInstanceGlobalAutoRefreshContext) {
358
+ return DATE_SELECTION_VALUES.dashboard_context;
359
+ }
360
+ return displayDateSelection
361
+ ? DATE_SELECTION_VALUES.view_and_config
362
+ : DATE_SELECTION_VALUES.config;
363
+ }
356
364
  isAutoRefershDisabled() {
357
365
  const isInitialWidgetCreation = Object.keys(this.config).length === 1 && this.config['settings'];
358
366
  if (isInitialWidgetCreation) {
359
367
  return false;
360
368
  }
361
369
  const isLegacyWidgetRealtimeNotActive = !this.config.realtime &&
362
- !this.config.decimalPlaces &&
363
- !this.config.refreshInterval &&
364
- !this.config.isAutoRefreshEnabled;
370
+ !this.config.hasOwnProperty('decimalPlaces') &&
371
+ !this.config.hasOwnProperty('refreshInterval') &&
372
+ !this.config.hasOwnProperty('isAutoRefreshEnabled');
365
373
  if (isLegacyWidgetRealtimeNotActive) {
366
374
  return true;
367
375
  }
@@ -478,14 +486,13 @@ class DatapointsTableWidgetConfigComponent {
478
486
  handleGlobalDateSelectorChanges() {
479
487
  this.formGroup.controls.globalDateSelector.valueChanges
480
488
  .pipe(takeUntil(this.destroy$))
481
- .subscribe(() => {
482
- // .subscribe((selected: string) => {
483
- // Condition will be removed in MTM-61920
484
- // if (selected === DATE_SELECTION_VALUES.dashboard_context) {
485
- // this.handleDashboardContext();
486
- // } else {
487
- this.handleNonDashboardContext();
488
- // }
489
+ .subscribe((selected) => {
490
+ if (selected === DATE_SELECTION_VALUES.dashboard_context) {
491
+ this.handleDashboardContext();
492
+ }
493
+ else {
494
+ this.handleNonDashboardContext();
495
+ }
489
496
  });
490
497
  }
491
498
  handleDashboardContext() {
@@ -500,7 +507,7 @@ class DatapointsTableWidgetConfigComponent {
500
507
  this.setIntervalToCustom(this.formGroup.controls.interval);
501
508
  }
502
509
  isConfigSavedWithoutDashboardTimeOption() {
503
- return !this.config.widgetInstanceGlobalTimeContext;
510
+ return !this.config.widgetInstanceGlobalAutoRefreshContext;
504
511
  }
505
512
  updateAggregationIfNecessary() {
506
513
  const aggregationControl = this.formGroup.controls.aggregation;
@@ -533,8 +540,12 @@ class DatapointsTableWidgetConfigComponent {
533
540
  aggregationControl.setValue(newAggregationValue);
534
541
  }
535
542
  }
543
+ deleteAggregationProperty(config) {
544
+ delete this.formGroup.value.aggregation;
545
+ delete config.aggregation;
546
+ }
536
547
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DatapointsTableWidgetConfigComponent, deps: [{ token: i1$1.AggregationService }, { token: DatapointsTableService }, { token: i3.FormBuilder }, { token: i3.NgForm }, { token: i4.WidgetConfigComponent }], target: i0.ɵɵFactoryTarget.Component }); }
537
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: DatapointsTableWidgetConfigComponent, isStandalone: true, selector: "c8y-datapoints-table-view-config", inputs: { config: "config" }, ngImport: i0, template: "<div class=\"p-l-24 p-r-24\">\n <form\n class=\"no-card-context\"\n [formGroup]=\"formGroup\"\n >\n <!-- <datapoints-selector> -->\n <div class=\"col-md-6\">\n <div class=\"row\">\n <!-- global-time-context-selector -->\n <div class=\"form-group m-b-0 p-b-16 separator-bottom\">\n <label\n class=\"d-flex a-i-center p-t-4\"\n for=\"dateSelection\"\n >\n {{ 'Date selection' | translate }}\n <button\n class=\"btn-help btn-help--sm\"\n [attr.aria-label]=\"'Help' | translate\"\n [popover]=\"popoverTemplate\"\n placement=\"right\"\n triggers=\"focus\"\n container=\"body\"\n type=\"button\"\n [adaptivePosition]=\"true\"\n ></button>\n </label>\n <ng-template #popoverTemplate>\n <span translate>\n Choose how to select a date range, the available options are:\n <ul class=\"m-l-0 p-l-8 m-t-8 m-b-0\">\n <!-- Will be re-enabled in MTM-61920 -->\n <!-- <li>\n <b>Dashboard time range:</b>\n restricts date selection to the global dashboard configuration only\n </li> -->\n <li>\n <b>Widget configuration:</b>\n restricts the date selection only to the widget configuration\n </li>\n <li>\n <b>Widget and widget configuration:</b>\n restricts the date selection to the widget view and widget configuration only\n </li>\n </ul>\n </span>\n </ng-template>\n <div class=\"c8y-select-wrapper\">\n <select\n class=\"form-control text-12\"\n [title]=\"'Date selection' | translate\"\n [attr.aria-label]=\"'Date selection' | translate\"\n id=\"globalDateSelector\"\n formControlName=\"globalDateSelector\"\n >\n <option\n *ngFor=\"let dataSelectionValue of DATE_SELECTION_VALUES_ARR\"\n [ngValue]=\"dataSelectionValue\"\n >\n {{ DATE_SELECTION_LABELS[dataSelectionValue] | translate }}\n </option>\n </select>\n </div>\n </div>\n </div>\n <div class=\"row\">\n <c8y-datapoint-selection-list\n class=\"bg-inherit separator-top p-t-16 d-block\"\n listTitle=\"{{ 'Data points' | translate }}\"\n name=\"datapoints\"\n [defaultFormOptions]=\"defaultFormOptions\"\n [config]=\"datapointSelectionConfig\"\n [minActiveCount]=\"1\"\n formControlName=\"datapoints\"\n ></c8y-datapoint-selection-list>\n </div>\n </div>\n <div class=\"col-md-6\">\n <div class=\"row\">\n <ng-container *ngIf=\"!isWidgetLinkedToGlobalTimeContext\">\n <div class=\"col-md-6\">\n <!-- interval selector -->\n <fieldset class=\"c8y-fieldset\">\n <legend class=\"d-flex a-i-center\">\n {{ 'Auto refresh' | translate }}\n <button\n class=\"btn-help btn-help--sm\"\n [attr.aria-label]=\"'Help' | translate\"\n [popover]=\"\n 'Change the state of interval automatic refresh and set the refresh frequency.'\n | translate\n \"\n placement=\"top\"\n triggers=\"focus\"\n container=\"body\"\n type=\"button\"\n [adaptivePosition]=\"true\"\n ></button>\n </legend>\n <c8y-form-group class=\"m-b-16 form-group-sm\">\n <div class=\"d-flex gap-4 m-t-8 m-b-8 a-i-center\">\n <label class=\"c8y-switch\">\n <input\n id=\"refreshToggle\"\n name=\"isAutoRefreshEnabled\"\n type=\"checkbox\"\n formControlName=\"isAutoRefreshEnabled\"\n (click)=\"toggleRefreshIntervalControl()\"\n />\n <span></span>\n <span class=\"sr-only\">{{ 'Auto refresh' | translate }}</span>\n </label>\n <label\n class=\"m-b-0\"\n for=\"refreshInterval\"\n >\n {{ 'Interval' | translate }}\n </label>\n <div class=\"c8y-select-wrapper\">\n <select\n class=\"form-control text-12\"\n [title]=\"'Refresh interval in seconds' | translate\"\n id=\"refreshInterval\"\n formControlName=\"refreshInterval\"\n >\n <option\n *ngFor=\"let refreshInterval of REFRESH_INTERVAL_VALUES_ARR\"\n [ngValue]=\"refreshInterval\"\n >\n {{ '{{ seconds }} s' | translate: { seconds: refreshInterval / 1000 } }}\n </option>\n </select>\n </div>\n </div>\n </c8y-form-group>\n </fieldset>\n </div>\n </ng-container>\n <!-- decimal input -->\n <div class=\"col-md-6\">\n <fieldset class=\"c8y-fieldset\">\n <legend>\n {{ 'Decimal places' | translate }}\n </legend>\n <c8y-form-group class=\"p-t-8\">\n <input\n class=\"form-control\"\n name=\"decimalPlaces\"\n type=\"number\"\n formControlName=\"decimalPlaces\"\n step=\"1\"\n />\n </c8y-form-group>\n </fieldset>\n </div>\n </div>\n <!-- aggregation selector -->\n <ng-container *ngIf=\"!isWidgetLinkedToGlobalTimeContext\">\n <div class=\"row\">\n <div class=\"col-md-6\">\n <fieldset class=\"c8y-fieldset\">\n <legend>\n {{ 'Aggregation' | translate }}\n </legend>\n <c8y-form-group class=\"p-t-8\">\n <div class=\"c8y-select-wrapper\">\n <!-- Setting below [attr.disabled] ensures that the control is visually disabled and user interaction is prevented,\n while still allowing the value to be updated and saved correctly in the form.\n This solution covers the case where the user enables auto-refresh, in which case aggregation must be set to NONE. -->\n <select\n class=\"form-control text-12\"\n [title]=\"'Aggregation' | translate\"\n id=\"aggregation\"\n formControlName=\"aggregation\"\n [attr.disabled]=\"formGroup.value.isAutoRefreshEnabled ? true : null\"\n >\n <option\n *ngFor=\"let aggregationValue of AGGREGATION_VALUES_ARR\"\n [ngValue]=\"aggregationValue\"\n [disabled]=\"disabledAggregationOptions[aggregationValue]\"\n >\n {{ AGGREGATION_LABELS[aggregationValue] | translate }}\n </option>\n </select>\n </div>\n </c8y-form-group>\n </fieldset>\n </div>\n <!-- time interval selector -->\n <div class=\"col-md-6\">\n <fieldset class=\"c8y-fieldset\">\n <legend>\n {{ 'Time interval' | translate }}\n </legend>\n <c8y-form-group class=\"p-t-8\">\n <div class=\"c8y-select-wrapper\">\n <select\n class=\"form-control text-12\"\n [title]=\"'Interval' | translate\"\n id=\"interval\"\n formControlName=\"interval\"\n >\n <option\n *ngFor=\"let intervalValue of INTERVAL_VALUES_ARR\"\n [ngValue]=\"intervalValue\"\n >\n {{ TIME_RANGE_INTERVAL_LABELS[intervalValue] | translate }}\n </option>\n </select>\n </div>\n </c8y-form-group>\n </fieldset>\n </div>\n </div>\n <!-- date pickers -->\n <fieldset class=\"c8y-fieldset\">\n <legend>\n {{ 'Date range' | translate }}\n </legend>\n <c8y-date-range-picker></c8y-date-range-picker>\n </fieldset>\n </ng-container>\n </div>\n </form>\n</div>\n", dependencies: [{ kind: "ngmodule", type: CoreModule }, { kind: "pipe", type: i1$1.C8yTranslatePipe, name: "translate" }, { kind: "directive", type: i1$1.C8yTranslateDirective, selector: "[translate],[ngx-translate]" }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i3.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i3.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i3.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i3.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "component", type: i1$1.FormGroupComponent, selector: "c8y-form-group", inputs: ["hasError", "hasWarning", "hasSuccess", "novalidation", "status"] }, { kind: "directive", type: i1$1.RequiredInputPlaceholderDirective, selector: "input[required], input[formControlName]" }, { kind: "directive", type: i3.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i3.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: DatapointSelectorModule }, { kind: "component", type: i6.DatapointSelectionListComponent, selector: "c8y-datapoint-selection-list", inputs: ["actions", "allowDragAndDrop", "config", "defaultFormOptions", "maxActiveCount", "minActiveCount", "resolveContext", "listTitle"], outputs: ["isValid", "change"] }, { kind: "component", type: DateRangePickerComponent, selector: "c8y-date-range-picker", inputs: ["isEmittingDateChange", "showLabel"], outputs: ["updatedDate"] }, { kind: "ngmodule", type: PopoverModule }, { kind: "directive", type: i7.PopoverDirective, selector: "[popover]", inputs: ["adaptivePosition", "boundariesElement", "popover", "popoverContext", "popoverTitle", "placement", "outsideClick", "triggers", "container", "containerClass", "isOpen", "delay"], outputs: ["onShown", "onHidden"], exportAs: ["bs-popover"] }, { kind: "ngmodule", type: ReactiveFormsModule }] }); }
548
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: DatapointsTableWidgetConfigComponent, isStandalone: true, selector: "c8y-datapoints-table-view-config", inputs: { config: "config" }, ngImport: i0, template: "<div class=\"p-l-24 p-r-24\">\n <form\n class=\"no-card-context\"\n [formGroup]=\"formGroup\"\n >\n <!-- <datapoints-selector> -->\n <div class=\"col-md-6\">\n <div class=\"row\">\n <!-- global-time-context-selector -->\n <div class=\"form-group m-b-0 p-b-16 separator-bottom\">\n <label\n class=\"d-flex a-i-center p-t-4\"\n for=\"dateSelection\"\n >\n {{ 'Date selection' | translate }}\n <button\n class=\"btn-help btn-help--sm\"\n [attr.aria-label]=\"'Help' | translate\"\n [popover]=\"popoverTemplate\"\n placement=\"right\"\n triggers=\"focus\"\n container=\"body\"\n type=\"button\"\n [adaptivePosition]=\"true\"\n ></button>\n </label>\n <ng-template #popoverTemplate>\n <span translate>\n Choose how to select a date range, the available options are:\n <ul class=\"m-l-0 p-l-8 m-t-8 m-b-0\">\n <li>\n <b>Dashboard time range:</b>\n restricts date selection to the global dashboard configuration only\n </li>\n <li>\n <b>Widget configuration:</b>\n restricts the date selection only to the widget configuration\n </li>\n <li>\n <b>Widget and widget configuration:</b>\n restricts the date selection to the widget view and widget configuration only\n </li>\n </ul>\n </span>\n </ng-template>\n <div class=\"c8y-select-wrapper\">\n <select\n class=\"form-control text-12\"\n [title]=\"'Date selection' | translate\"\n [attr.aria-label]=\"'Date selection' | translate\"\n id=\"globalDateSelector\"\n formControlName=\"globalDateSelector\"\n >\n <option\n *ngFor=\"let dataSelectionValue of DATE_SELECTION_VALUES_ARR\"\n [ngValue]=\"dataSelectionValue\"\n >\n {{ DATE_SELECTION_LABELS[dataSelectionValue] | translate }}\n </option>\n </select>\n </div>\n </div>\n </div>\n <div class=\"row\">\n <c8y-datapoint-selection-list\n class=\"bg-inherit separator-top p-t-16 d-block\"\n listTitle=\"{{ 'Data points' | translate }}\"\n name=\"datapoints\"\n [defaultFormOptions]=\"defaultFormOptions\"\n [config]=\"datapointSelectionConfig\"\n [minActiveCount]=\"1\"\n formControlName=\"datapoints\"\n ></c8y-datapoint-selection-list>\n </div>\n </div>\n <div class=\"col-md-6\">\n <div class=\"row\">\n <ng-container *ngIf=\"!isWidgetLinkedToGlobalTimeContext\">\n <div class=\"col-md-6\">\n <!-- interval selector -->\n <fieldset class=\"c8y-fieldset\">\n <legend class=\"d-flex a-i-center\">\n {{ 'Auto refresh' | translate }}\n <button\n class=\"btn-help btn-help--sm\"\n [attr.aria-label]=\"'Help' | translate\"\n [popover]=\"\n 'Change the state of interval automatic refresh and set the refresh frequency.'\n | translate\n \"\n placement=\"top\"\n triggers=\"focus\"\n container=\"body\"\n type=\"button\"\n [adaptivePosition]=\"true\"\n ></button>\n </legend>\n <c8y-form-group class=\"m-b-16 form-group-sm\">\n <div class=\"d-flex gap-4 m-t-8 m-b-8 a-i-center\">\n <label class=\"c8y-switch\">\n <input\n id=\"refreshToggle\"\n name=\"isAutoRefreshEnabled\"\n type=\"checkbox\"\n formControlName=\"isAutoRefreshEnabled\"\n (click)=\"toggleRefreshIntervalControl()\"\n />\n <span></span>\n <span class=\"sr-only\">{{ 'Auto refresh' | translate }}</span>\n </label>\n <label\n class=\"m-b-0\"\n for=\"refreshInterval\"\n >\n {{ 'Interval' | translate }}\n </label>\n <div class=\"c8y-select-wrapper\">\n <select\n class=\"form-control text-12\"\n [title]=\"'Refresh interval in seconds' | translate\"\n id=\"refreshInterval\"\n formControlName=\"refreshInterval\"\n >\n <option\n *ngFor=\"let refreshInterval of REFRESH_INTERVAL_VALUES_ARR\"\n [ngValue]=\"refreshInterval\"\n >\n {{ '{{ seconds }} s' | translate: { seconds: refreshInterval / 1000 } }}\n </option>\n </select>\n </div>\n </div>\n </c8y-form-group>\n </fieldset>\n </div>\n </ng-container>\n <!-- decimal input -->\n <div class=\"col-md-6\">\n <fieldset class=\"c8y-fieldset\">\n <legend>\n {{ 'Decimal places' | translate }}\n </legend>\n <c8y-form-group class=\"p-t-8\">\n <input\n class=\"form-control\"\n name=\"decimalPlaces\"\n type=\"number\"\n formControlName=\"decimalPlaces\"\n step=\"1\"\n />\n </c8y-form-group>\n </fieldset>\n </div>\n </div>\n <!-- aggregation selector -->\n <div class=\"row\">\n <ng-container *ngIf=\"!isWidgetLinkedToGlobalTimeContext\">\n <div class=\"col-md-6\">\n <fieldset class=\"c8y-fieldset\">\n <legend>\n {{ 'Aggregation' | translate }}\n </legend>\n <c8y-form-group class=\"p-t-8\">\n <div class=\"c8y-select-wrapper\">\n <!-- Setting below [attr.disabled] ensures that the control is visually disabled and user interaction is prevented,\n while still allowing the value to be updated and saved correctly in the form.\n This solution covers the case where the user enables auto-refresh, in which case aggregation must be set to NONE. -->\n <select\n class=\"form-control text-12\"\n [title]=\"'Aggregation' | translate\"\n id=\"aggregation\"\n formControlName=\"aggregation\"\n [attr.disabled]=\"formGroup.value.isAutoRefreshEnabled ? true : null\"\n >\n <option\n *ngFor=\"let aggregationValue of AGGREGATION_VALUES_ARR\"\n [ngValue]=\"aggregationValue\"\n [disabled]=\"disabledAggregationOptions[aggregationValue]\"\n >\n {{ AGGREGATION_LABELS[aggregationValue] | translate }}\n </option>\n </select>\n </div>\n </c8y-form-group>\n </fieldset>\n </div>\n </ng-container>\n <!-- time interval selector -->\n <div class=\"col-md-6\">\n <fieldset class=\"c8y-fieldset\">\n <legend>\n {{ 'Time interval' | translate }}\n </legend>\n <c8y-form-group class=\"p-t-8\">\n <div class=\"c8y-select-wrapper\">\n <select\n class=\"form-control text-12\"\n [title]=\"'Interval' | translate\"\n id=\"interval\"\n formControlName=\"interval\"\n >\n <option\n *ngFor=\"let intervalValue of INTERVAL_VALUES_ARR\"\n [ngValue]=\"intervalValue\"\n >\n {{ TIME_RANGE_INTERVAL_LABELS[intervalValue] | translate }}\n </option>\n </select>\n </div>\n </c8y-form-group>\n </fieldset>\n </div>\n </div>\n <!-- date pickers -->\n <fieldset class=\"c8y-fieldset\">\n <legend>\n {{ 'Date range' | translate }}\n </legend>\n <c8y-date-range-picker></c8y-date-range-picker>\n </fieldset>\n </div>\n </form>\n</div>\n", dependencies: [{ kind: "ngmodule", type: CoreModule }, { kind: "pipe", type: i1$1.C8yTranslatePipe, name: "translate" }, { kind: "directive", type: i1$1.C8yTranslateDirective, selector: "[translate],[ngx-translate]" }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i3.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i3.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i3.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i3.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "component", type: i1$1.FormGroupComponent, selector: "c8y-form-group", inputs: ["hasError", "hasWarning", "hasSuccess", "novalidation", "status"] }, { kind: "directive", type: i1$1.RequiredInputPlaceholderDirective, selector: "input[required], input[formControlName]" }, { kind: "directive", type: i3.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i3.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: DatapointSelectorModule }, { kind: "component", type: i6.DatapointSelectionListComponent, selector: "c8y-datapoint-selection-list", inputs: ["actions", "allowDragAndDrop", "config", "defaultFormOptions", "maxActiveCount", "minActiveCount", "resolveContext", "listTitle"], outputs: ["isValid", "change"] }, { kind: "component", type: DateRangePickerComponent, selector: "c8y-date-range-picker", inputs: ["isEmittingDateChange", "showLabel"], outputs: ["updatedDate"] }, { kind: "ngmodule", type: PopoverModule }, { kind: "directive", type: i7.PopoverDirective, selector: "[popover]", inputs: ["adaptivePosition", "boundariesElement", "popover", "popoverContext", "popoverTitle", "placement", "outsideClick", "triggers", "container", "containerClass", "isOpen", "delay"], outputs: ["onShown", "onHidden"], exportAs: ["bs-popover"] }, { kind: "ngmodule", type: ReactiveFormsModule }] }); }
538
549
  }
539
550
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DatapointsTableWidgetConfigComponent, decorators: [{
540
551
  type: Component,
@@ -544,7 +555,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
544
555
  DateRangePickerComponent,
545
556
  PopoverModule,
546
557
  ReactiveFormsModule
547
- ], template: "<div class=\"p-l-24 p-r-24\">\n <form\n class=\"no-card-context\"\n [formGroup]=\"formGroup\"\n >\n <!-- <datapoints-selector> -->\n <div class=\"col-md-6\">\n <div class=\"row\">\n <!-- global-time-context-selector -->\n <div class=\"form-group m-b-0 p-b-16 separator-bottom\">\n <label\n class=\"d-flex a-i-center p-t-4\"\n for=\"dateSelection\"\n >\n {{ 'Date selection' | translate }}\n <button\n class=\"btn-help btn-help--sm\"\n [attr.aria-label]=\"'Help' | translate\"\n [popover]=\"popoverTemplate\"\n placement=\"right\"\n triggers=\"focus\"\n container=\"body\"\n type=\"button\"\n [adaptivePosition]=\"true\"\n ></button>\n </label>\n <ng-template #popoverTemplate>\n <span translate>\n Choose how to select a date range, the available options are:\n <ul class=\"m-l-0 p-l-8 m-t-8 m-b-0\">\n <!-- Will be re-enabled in MTM-61920 -->\n <!-- <li>\n <b>Dashboard time range:</b>\n restricts date selection to the global dashboard configuration only\n </li> -->\n <li>\n <b>Widget configuration:</b>\n restricts the date selection only to the widget configuration\n </li>\n <li>\n <b>Widget and widget configuration:</b>\n restricts the date selection to the widget view and widget configuration only\n </li>\n </ul>\n </span>\n </ng-template>\n <div class=\"c8y-select-wrapper\">\n <select\n class=\"form-control text-12\"\n [title]=\"'Date selection' | translate\"\n [attr.aria-label]=\"'Date selection' | translate\"\n id=\"globalDateSelector\"\n formControlName=\"globalDateSelector\"\n >\n <option\n *ngFor=\"let dataSelectionValue of DATE_SELECTION_VALUES_ARR\"\n [ngValue]=\"dataSelectionValue\"\n >\n {{ DATE_SELECTION_LABELS[dataSelectionValue] | translate }}\n </option>\n </select>\n </div>\n </div>\n </div>\n <div class=\"row\">\n <c8y-datapoint-selection-list\n class=\"bg-inherit separator-top p-t-16 d-block\"\n listTitle=\"{{ 'Data points' | translate }}\"\n name=\"datapoints\"\n [defaultFormOptions]=\"defaultFormOptions\"\n [config]=\"datapointSelectionConfig\"\n [minActiveCount]=\"1\"\n formControlName=\"datapoints\"\n ></c8y-datapoint-selection-list>\n </div>\n </div>\n <div class=\"col-md-6\">\n <div class=\"row\">\n <ng-container *ngIf=\"!isWidgetLinkedToGlobalTimeContext\">\n <div class=\"col-md-6\">\n <!-- interval selector -->\n <fieldset class=\"c8y-fieldset\">\n <legend class=\"d-flex a-i-center\">\n {{ 'Auto refresh' | translate }}\n <button\n class=\"btn-help btn-help--sm\"\n [attr.aria-label]=\"'Help' | translate\"\n [popover]=\"\n 'Change the state of interval automatic refresh and set the refresh frequency.'\n | translate\n \"\n placement=\"top\"\n triggers=\"focus\"\n container=\"body\"\n type=\"button\"\n [adaptivePosition]=\"true\"\n ></button>\n </legend>\n <c8y-form-group class=\"m-b-16 form-group-sm\">\n <div class=\"d-flex gap-4 m-t-8 m-b-8 a-i-center\">\n <label class=\"c8y-switch\">\n <input\n id=\"refreshToggle\"\n name=\"isAutoRefreshEnabled\"\n type=\"checkbox\"\n formControlName=\"isAutoRefreshEnabled\"\n (click)=\"toggleRefreshIntervalControl()\"\n />\n <span></span>\n <span class=\"sr-only\">{{ 'Auto refresh' | translate }}</span>\n </label>\n <label\n class=\"m-b-0\"\n for=\"refreshInterval\"\n >\n {{ 'Interval' | translate }}\n </label>\n <div class=\"c8y-select-wrapper\">\n <select\n class=\"form-control text-12\"\n [title]=\"'Refresh interval in seconds' | translate\"\n id=\"refreshInterval\"\n formControlName=\"refreshInterval\"\n >\n <option\n *ngFor=\"let refreshInterval of REFRESH_INTERVAL_VALUES_ARR\"\n [ngValue]=\"refreshInterval\"\n >\n {{ '{{ seconds }} s' | translate: { seconds: refreshInterval / 1000 } }}\n </option>\n </select>\n </div>\n </div>\n </c8y-form-group>\n </fieldset>\n </div>\n </ng-container>\n <!-- decimal input -->\n <div class=\"col-md-6\">\n <fieldset class=\"c8y-fieldset\">\n <legend>\n {{ 'Decimal places' | translate }}\n </legend>\n <c8y-form-group class=\"p-t-8\">\n <input\n class=\"form-control\"\n name=\"decimalPlaces\"\n type=\"number\"\n formControlName=\"decimalPlaces\"\n step=\"1\"\n />\n </c8y-form-group>\n </fieldset>\n </div>\n </div>\n <!-- aggregation selector -->\n <ng-container *ngIf=\"!isWidgetLinkedToGlobalTimeContext\">\n <div class=\"row\">\n <div class=\"col-md-6\">\n <fieldset class=\"c8y-fieldset\">\n <legend>\n {{ 'Aggregation' | translate }}\n </legend>\n <c8y-form-group class=\"p-t-8\">\n <div class=\"c8y-select-wrapper\">\n <!-- Setting below [attr.disabled] ensures that the control is visually disabled and user interaction is prevented,\n while still allowing the value to be updated and saved correctly in the form.\n This solution covers the case where the user enables auto-refresh, in which case aggregation must be set to NONE. -->\n <select\n class=\"form-control text-12\"\n [title]=\"'Aggregation' | translate\"\n id=\"aggregation\"\n formControlName=\"aggregation\"\n [attr.disabled]=\"formGroup.value.isAutoRefreshEnabled ? true : null\"\n >\n <option\n *ngFor=\"let aggregationValue of AGGREGATION_VALUES_ARR\"\n [ngValue]=\"aggregationValue\"\n [disabled]=\"disabledAggregationOptions[aggregationValue]\"\n >\n {{ AGGREGATION_LABELS[aggregationValue] | translate }}\n </option>\n </select>\n </div>\n </c8y-form-group>\n </fieldset>\n </div>\n <!-- time interval selector -->\n <div class=\"col-md-6\">\n <fieldset class=\"c8y-fieldset\">\n <legend>\n {{ 'Time interval' | translate }}\n </legend>\n <c8y-form-group class=\"p-t-8\">\n <div class=\"c8y-select-wrapper\">\n <select\n class=\"form-control text-12\"\n [title]=\"'Interval' | translate\"\n id=\"interval\"\n formControlName=\"interval\"\n >\n <option\n *ngFor=\"let intervalValue of INTERVAL_VALUES_ARR\"\n [ngValue]=\"intervalValue\"\n >\n {{ TIME_RANGE_INTERVAL_LABELS[intervalValue] | translate }}\n </option>\n </select>\n </div>\n </c8y-form-group>\n </fieldset>\n </div>\n </div>\n <!-- date pickers -->\n <fieldset class=\"c8y-fieldset\">\n <legend>\n {{ 'Date range' | translate }}\n </legend>\n <c8y-date-range-picker></c8y-date-range-picker>\n </fieldset>\n </ng-container>\n </div>\n </form>\n</div>\n" }]
558
+ ], template: "<div class=\"p-l-24 p-r-24\">\n <form\n class=\"no-card-context\"\n [formGroup]=\"formGroup\"\n >\n <!-- <datapoints-selector> -->\n <div class=\"col-md-6\">\n <div class=\"row\">\n <!-- global-time-context-selector -->\n <div class=\"form-group m-b-0 p-b-16 separator-bottom\">\n <label\n class=\"d-flex a-i-center p-t-4\"\n for=\"dateSelection\"\n >\n {{ 'Date selection' | translate }}\n <button\n class=\"btn-help btn-help--sm\"\n [attr.aria-label]=\"'Help' | translate\"\n [popover]=\"popoverTemplate\"\n placement=\"right\"\n triggers=\"focus\"\n container=\"body\"\n type=\"button\"\n [adaptivePosition]=\"true\"\n ></button>\n </label>\n <ng-template #popoverTemplate>\n <span translate>\n Choose how to select a date range, the available options are:\n <ul class=\"m-l-0 p-l-8 m-t-8 m-b-0\">\n <li>\n <b>Dashboard time range:</b>\n restricts date selection to the global dashboard configuration only\n </li>\n <li>\n <b>Widget configuration:</b>\n restricts the date selection only to the widget configuration\n </li>\n <li>\n <b>Widget and widget configuration:</b>\n restricts the date selection to the widget view and widget configuration only\n </li>\n </ul>\n </span>\n </ng-template>\n <div class=\"c8y-select-wrapper\">\n <select\n class=\"form-control text-12\"\n [title]=\"'Date selection' | translate\"\n [attr.aria-label]=\"'Date selection' | translate\"\n id=\"globalDateSelector\"\n formControlName=\"globalDateSelector\"\n >\n <option\n *ngFor=\"let dataSelectionValue of DATE_SELECTION_VALUES_ARR\"\n [ngValue]=\"dataSelectionValue\"\n >\n {{ DATE_SELECTION_LABELS[dataSelectionValue] | translate }}\n </option>\n </select>\n </div>\n </div>\n </div>\n <div class=\"row\">\n <c8y-datapoint-selection-list\n class=\"bg-inherit separator-top p-t-16 d-block\"\n listTitle=\"{{ 'Data points' | translate }}\"\n name=\"datapoints\"\n [defaultFormOptions]=\"defaultFormOptions\"\n [config]=\"datapointSelectionConfig\"\n [minActiveCount]=\"1\"\n formControlName=\"datapoints\"\n ></c8y-datapoint-selection-list>\n </div>\n </div>\n <div class=\"col-md-6\">\n <div class=\"row\">\n <ng-container *ngIf=\"!isWidgetLinkedToGlobalTimeContext\">\n <div class=\"col-md-6\">\n <!-- interval selector -->\n <fieldset class=\"c8y-fieldset\">\n <legend class=\"d-flex a-i-center\">\n {{ 'Auto refresh' | translate }}\n <button\n class=\"btn-help btn-help--sm\"\n [attr.aria-label]=\"'Help' | translate\"\n [popover]=\"\n 'Change the state of interval automatic refresh and set the refresh frequency.'\n | translate\n \"\n placement=\"top\"\n triggers=\"focus\"\n container=\"body\"\n type=\"button\"\n [adaptivePosition]=\"true\"\n ></button>\n </legend>\n <c8y-form-group class=\"m-b-16 form-group-sm\">\n <div class=\"d-flex gap-4 m-t-8 m-b-8 a-i-center\">\n <label class=\"c8y-switch\">\n <input\n id=\"refreshToggle\"\n name=\"isAutoRefreshEnabled\"\n type=\"checkbox\"\n formControlName=\"isAutoRefreshEnabled\"\n (click)=\"toggleRefreshIntervalControl()\"\n />\n <span></span>\n <span class=\"sr-only\">{{ 'Auto refresh' | translate }}</span>\n </label>\n <label\n class=\"m-b-0\"\n for=\"refreshInterval\"\n >\n {{ 'Interval' | translate }}\n </label>\n <div class=\"c8y-select-wrapper\">\n <select\n class=\"form-control text-12\"\n [title]=\"'Refresh interval in seconds' | translate\"\n id=\"refreshInterval\"\n formControlName=\"refreshInterval\"\n >\n <option\n *ngFor=\"let refreshInterval of REFRESH_INTERVAL_VALUES_ARR\"\n [ngValue]=\"refreshInterval\"\n >\n {{ '{{ seconds }} s' | translate: { seconds: refreshInterval / 1000 } }}\n </option>\n </select>\n </div>\n </div>\n </c8y-form-group>\n </fieldset>\n </div>\n </ng-container>\n <!-- decimal input -->\n <div class=\"col-md-6\">\n <fieldset class=\"c8y-fieldset\">\n <legend>\n {{ 'Decimal places' | translate }}\n </legend>\n <c8y-form-group class=\"p-t-8\">\n <input\n class=\"form-control\"\n name=\"decimalPlaces\"\n type=\"number\"\n formControlName=\"decimalPlaces\"\n step=\"1\"\n />\n </c8y-form-group>\n </fieldset>\n </div>\n </div>\n <!-- aggregation selector -->\n <div class=\"row\">\n <ng-container *ngIf=\"!isWidgetLinkedToGlobalTimeContext\">\n <div class=\"col-md-6\">\n <fieldset class=\"c8y-fieldset\">\n <legend>\n {{ 'Aggregation' | translate }}\n </legend>\n <c8y-form-group class=\"p-t-8\">\n <div class=\"c8y-select-wrapper\">\n <!-- Setting below [attr.disabled] ensures that the control is visually disabled and user interaction is prevented,\n while still allowing the value to be updated and saved correctly in the form.\n This solution covers the case where the user enables auto-refresh, in which case aggregation must be set to NONE. -->\n <select\n class=\"form-control text-12\"\n [title]=\"'Aggregation' | translate\"\n id=\"aggregation\"\n formControlName=\"aggregation\"\n [attr.disabled]=\"formGroup.value.isAutoRefreshEnabled ? true : null\"\n >\n <option\n *ngFor=\"let aggregationValue of AGGREGATION_VALUES_ARR\"\n [ngValue]=\"aggregationValue\"\n [disabled]=\"disabledAggregationOptions[aggregationValue]\"\n >\n {{ AGGREGATION_LABELS[aggregationValue] | translate }}\n </option>\n </select>\n </div>\n </c8y-form-group>\n </fieldset>\n </div>\n </ng-container>\n <!-- time interval selector -->\n <div class=\"col-md-6\">\n <fieldset class=\"c8y-fieldset\">\n <legend>\n {{ 'Time interval' | translate }}\n </legend>\n <c8y-form-group class=\"p-t-8\">\n <div class=\"c8y-select-wrapper\">\n <select\n class=\"form-control text-12\"\n [title]=\"'Interval' | translate\"\n id=\"interval\"\n formControlName=\"interval\"\n >\n <option\n *ngFor=\"let intervalValue of INTERVAL_VALUES_ARR\"\n [ngValue]=\"intervalValue\"\n >\n {{ TIME_RANGE_INTERVAL_LABELS[intervalValue] | translate }}\n </option>\n </select>\n </div>\n </c8y-form-group>\n </fieldset>\n </div>\n </div>\n <!-- date pickers -->\n <fieldset class=\"c8y-fieldset\">\n <legend>\n {{ 'Date range' | translate }}\n </legend>\n <c8y-date-range-picker></c8y-date-range-picker>\n </fieldset>\n </div>\n </form>\n</div>\n" }]
548
559
  }], ctorParameters: () => [{ type: i1$1.AggregationService }, { type: DatapointsTableService }, { type: i3.FormBuilder }, { type: i3.NgForm }, { type: i4.WidgetConfigComponent }], propDecorators: { config: [{
549
560
  type: Input
550
561
  }] } });
@@ -772,11 +783,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
772
783
  }] });
773
784
 
774
785
  class DatapointsReloadComponent extends IntervalBasedReload {
775
- constructor(cdRef, injector, translateService) {
786
+ constructor(cdRef, translateService, widgetGlobalAutoRefreshService) {
776
787
  super();
777
788
  this.cdRef = cdRef;
778
- this.injector = injector;
779
789
  this.translateService = translateService;
790
+ this.widgetGlobalAutoRefreshService = widgetGlobalAutoRefreshService;
791
+ /**
792
+ * @inheritdoc
793
+ */
794
+ this.isRefreshDisabled = false;
780
795
  /**
781
796
  * @inheritdoc
782
797
  */
@@ -785,9 +800,17 @@ class DatapointsReloadComponent extends IntervalBasedReload {
785
800
  * @inheritdoc
786
801
  */
787
802
  this.manuallyDisabledCountdown = false;
803
+ this.destroy$ = new Subject();
804
+ }
805
+ ngAfterViewInit() {
806
+ if (this.widgetInstanceGlobalAutoRefreshContext) {
807
+ this.widgetGlobalAutoRefreshService.countdownActions.countdownEnded$
808
+ .pipe(takeUntil(this.destroy$), tap(() => this.onCountdownEnded.emit()))
809
+ .subscribe();
810
+ }
788
811
  }
789
812
  ngOnChanges(changes) {
790
- if (this.isDisabled && this.isAutoRefreshEnabled) {
813
+ if (this.isRefreshDisabled && this.isAutoRefreshEnabled) {
791
814
  this.isIntervalRefreshToggleOn = false;
792
815
  this.disableCountdown();
793
816
  return;
@@ -799,13 +822,20 @@ class DatapointsReloadComponent extends IntervalBasedReload {
799
822
  else {
800
823
  if (this.canStartCountdown(changes)) {
801
824
  this.isIntervalRefreshToggleOn = true;
802
- this.startCountdown(this.injector);
825
+ this.startCountdown();
803
826
  }
804
827
  if (this.canHandleScrolling()) {
805
828
  this.handleScrolling();
806
829
  }
807
830
  }
808
831
  }
832
+ ngOnDestroy() {
833
+ if (this.countdownSubscription) {
834
+ this.countdownSubscription.unsubscribe();
835
+ }
836
+ this.destroy$.next();
837
+ this.destroy$.complete();
838
+ }
809
839
  /**
810
840
  * @inheritdoc
811
841
  */
@@ -828,7 +858,7 @@ class DatapointsReloadComponent extends IntervalBasedReload {
828
858
  this.hideCountdown = false;
829
859
  // Prevents the countdown from getting stuck on an initial value.
830
860
  this.cdRef.detectChanges();
831
- this.startCountdown(this.injector);
861
+ this.startCountdown();
832
862
  }
833
863
  /**
834
864
  * @inheritdoc
@@ -853,18 +883,18 @@ class DatapointsReloadComponent extends IntervalBasedReload {
853
883
  !this.isScrolling &&
854
884
  !this.hideCountdown);
855
885
  }
856
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DatapointsReloadComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.Injector }, { token: i1$2.TranslateService }], target: i0.ɵɵFactoryTarget.Component }); }
857
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: DatapointsReloadComponent, isStandalone: true, selector: "c8y-datapoints-reload", inputs: { isAutoRefreshEnabled: "isAutoRefreshEnabled", isDisabled: "isDisabled", isLoading: "isLoading", isScrolling: "isScrolling", isExportModalOpen: "isExportModalOpen", refreshInterval: "refreshInterval" }, outputs: { onCountdownEnded: "onCountdownEnded" }, viewQueries: [{ propertyName: "countdownIntervalComponent", first: true, predicate: CountdownIntervalComponent, descendants: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<div class=\"a-i-center input-group p-t-4 p-b-4 max-width-fit m-l-auto\">\n <label\n class=\"m-b-0 m-r-8 text-label-small text-truncate flex-no-shrink\"\n title=\" {{ 'Auto refresh' | translate }}\"\n *ngIf=\"refreshInterval && isAutoRefreshEnabled\"\n >\n {{ 'Auto refresh' | translate }}\n </label>\n <div class=\"input-group\">\n <label\n class=\"toggle-countdown\"\n [class.toggle-countdown-disabled]=\"isDisabled\"\n [attr.aria-label]=\"toggleCountdownButtonTooltipText\"\n [tooltip]=\"toggleCountdownButtonTooltipText\"\n placement=\"bottom\"\n *ngIf=\"refreshInterval && isAutoRefreshEnabled\"\n [adaptivePosition]=\"false\"\n [container]=\"'body'\"\n [delay]=\"500\"\n >\n <input\n type=\"checkbox\"\n [checked]=\"isIntervalRefreshToggleOn\"\n [disabled]=\"isDisabled\"\n data-cy=\"c8y-data-points-table-widget--interval-toggle-button\"\n (click)=\"onToggleCountdownButtonState($event)\"\n />\n\n <c8y-countdown-interval\n *ngIf=\"isIntervalRefreshToggleOn\"\n [countdownInterval]=\"refreshInterval\"\n (countdownEnded)=\"countdownEnded()\"\n ></c8y-countdown-interval>\n <i\n c8yIcon=\"pause\"\n *ngIf=\"!isIntervalRefreshToggleOn\"\n ></i>\n </label>\n\n <div class=\"input-group-btn\">\n <button\n class=\"btn btn-default\"\n [attr.aria-label]=\"'Refresh' | translate\"\n [tooltip]=\"'Refresh' | translate\"\n placement=\"bottom\"\n type=\"button\"\n [adaptivePosition]=\"false\"\n [container]=\"'body'\"\n [delay]=\"500\"\n [disabled]=\"isLoading()\"\n (click)=\"reload()\"\n data-cy=\"c8y-data-points-table-widget--reload-button\"\n >\n <i\n c8yIcon=\"refresh\"\n [ngClass]=\"{ 'icon-spin': isLoading() }\"\n ></i>\n </button>\n </div>\n </div>\n</div>\n", dependencies: [{ kind: "ngmodule", type: CommonModule$1 }, { kind: "directive", type: i1$1.IconDirective, selector: "[c8yIcon]", inputs: ["c8yIcon"] }, { kind: "pipe", type: i1$1.C8yTranslatePipe, name: "translate" }, { kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: CountdownIntervalModule }, { kind: "component", type: i1$1.CountdownIntervalComponent, selector: "c8y-countdown-interval", inputs: ["countdownInterval"], outputs: ["countdownEnded"] }, { kind: "ngmodule", type: ListGroupModule }, { kind: "ngmodule", type: TooltipModule }, { kind: "directive", type: i4$1.TooltipDirective, selector: "[tooltip], [tooltipHtml]", inputs: ["adaptivePosition", "tooltip", "placement", "triggers", "container", "containerClass", "boundariesElement", "isOpen", "isDisabled", "delay", "tooltipHtml", "tooltipPlacement", "tooltipIsOpen", "tooltipEnable", "tooltipAppendToBody", "tooltipAnimation", "tooltipClass", "tooltipContext", "tooltipPopupDelay", "tooltipFadeDuration", "tooltipTrigger"], outputs: ["tooltipChange", "onShown", "onHidden", "tooltipStateChanged"], exportAs: ["bs-tooltip"] }] }); }
886
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DatapointsReloadComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i1$2.TranslateService }, { token: i1$1.WidgetGlobalAutoRefreshService }], target: i0.ɵɵFactoryTarget.Component }); }
887
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: DatapointsReloadComponent, isStandalone: true, selector: "c8y-datapoints-reload", inputs: { isAutoRefreshEnabled: "isAutoRefreshEnabled", isRefreshDisabled: "isRefreshDisabled", isLoading: "isLoading", isScrolling: "isScrolling", isExportModalOpen: "isExportModalOpen", refreshInterval: "refreshInterval", widgetInstanceGlobalAutoRefreshContext: "widgetInstanceGlobalAutoRefreshContext" }, outputs: { onCountdownEnded: "onCountdownEnded" }, viewQueries: [{ propertyName: "countdownIntervalComponent", first: true, predicate: CountdownIntervalComponent, descendants: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<ng-container *ngIf=\"!widgetInstanceGlobalAutoRefreshContext\">\n <div class=\"a-i-center input-group p-t-4 p-b-4 max-width-fit m-l-auto\">\n <label\n class=\"m-b-0 m-r-8 text-label-small text-truncate flex-no-shrink\"\n title=\" {{ 'Auto refresh' | translate }}\"\n *ngIf=\"refreshInterval && isAutoRefreshEnabled\"\n >\n {{ 'Auto refresh' | translate }}\n </label>\n <div class=\"input-group\">\n <label\n class=\"toggle-countdown\"\n [class.toggle-countdown-disabled]=\"isRefreshDisabled\"\n [attr.aria-label]=\"toggleCountdownButtonTooltipText\"\n [tooltip]=\"toggleCountdownButtonTooltipText\"\n placement=\"bottom\"\n *ngIf=\"refreshInterval && isAutoRefreshEnabled\"\n [adaptivePosition]=\"false\"\n [container]=\"'body'\"\n [delay]=\"500\"\n >\n <input\n type=\"checkbox\"\n [checked]=\"isIntervalRefreshToggleOn\"\n [disabled]=\"isRefreshDisabled\"\n data-cy=\"c8y-data-points-table-widget--interval-toggle-button\"\n (click)=\"onToggleCountdownButtonState($event)\"\n />\n\n <c8y-countdown-interval\n *ngIf=\"isIntervalRefreshToggleOn\"\n [countdownInterval]=\"refreshInterval\"\n (countdownEnded)=\"countdownEnded()\"\n ></c8y-countdown-interval>\n <i\n c8yIcon=\"pause\"\n *ngIf=\"!isIntervalRefreshToggleOn\"\n ></i>\n </label>\n\n <div class=\"input-group-btn\">\n <button\n class=\"btn btn-default\"\n [attr.aria-label]=\"'Refresh' | translate\"\n [tooltip]=\"'Refresh' | translate\"\n placement=\"bottom\"\n type=\"button\"\n [adaptivePosition]=\"false\"\n [container]=\"'body'\"\n [delay]=\"500\"\n [disabled]=\"isRefreshDisabled || (isLoading | async)\"\n (click)=\"reload()\"\n data-cy=\"c8y-data-points-table-widget--reload-button\"\n >\n <i\n c8yIcon=\"refresh\"\n [ngClass]=\"{ 'icon-spin': isLoading | async }\"\n ></i>\n </button>\n </div>\n </div>\n </div>\n</ng-container>\n", dependencies: [{ kind: "ngmodule", type: CommonModule$1 }, { kind: "directive", type: i1$1.IconDirective, selector: "[c8yIcon]", inputs: ["c8yIcon"] }, { kind: "pipe", type: i1$1.C8yTranslatePipe, name: "translate" }, { kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }, { kind: "ngmodule", type: CountdownIntervalModule }, { kind: "component", type: i1$1.CountdownIntervalComponent, selector: "c8y-countdown-interval", inputs: ["countdownInterval"], outputs: ["countdownEnded"] }, { kind: "ngmodule", type: ListGroupModule }, { kind: "ngmodule", type: TooltipModule }, { kind: "directive", type: i4$1.TooltipDirective, selector: "[tooltip], [tooltipHtml]", inputs: ["adaptivePosition", "tooltip", "placement", "triggers", "container", "containerClass", "boundariesElement", "isOpen", "isDisabled", "delay", "tooltipHtml", "tooltipPlacement", "tooltipIsOpen", "tooltipEnable", "tooltipAppendToBody", "tooltipAnimation", "tooltipClass", "tooltipContext", "tooltipPopupDelay", "tooltipFadeDuration", "tooltipTrigger"], outputs: ["tooltipChange", "onShown", "onHidden", "tooltipStateChanged"], exportAs: ["bs-tooltip"] }] }); }
858
888
  }
859
889
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DatapointsReloadComponent, decorators: [{
860
890
  type: Component,
861
- args: [{ selector: 'c8y-datapoints-reload', standalone: true, imports: [CommonModule$1, CountdownIntervalModule, ListGroupModule, TooltipModule], template: "<div class=\"a-i-center input-group p-t-4 p-b-4 max-width-fit m-l-auto\">\n <label\n class=\"m-b-0 m-r-8 text-label-small text-truncate flex-no-shrink\"\n title=\" {{ 'Auto refresh' | translate }}\"\n *ngIf=\"refreshInterval && isAutoRefreshEnabled\"\n >\n {{ 'Auto refresh' | translate }}\n </label>\n <div class=\"input-group\">\n <label\n class=\"toggle-countdown\"\n [class.toggle-countdown-disabled]=\"isDisabled\"\n [attr.aria-label]=\"toggleCountdownButtonTooltipText\"\n [tooltip]=\"toggleCountdownButtonTooltipText\"\n placement=\"bottom\"\n *ngIf=\"refreshInterval && isAutoRefreshEnabled\"\n [adaptivePosition]=\"false\"\n [container]=\"'body'\"\n [delay]=\"500\"\n >\n <input\n type=\"checkbox\"\n [checked]=\"isIntervalRefreshToggleOn\"\n [disabled]=\"isDisabled\"\n data-cy=\"c8y-data-points-table-widget--interval-toggle-button\"\n (click)=\"onToggleCountdownButtonState($event)\"\n />\n\n <c8y-countdown-interval\n *ngIf=\"isIntervalRefreshToggleOn\"\n [countdownInterval]=\"refreshInterval\"\n (countdownEnded)=\"countdownEnded()\"\n ></c8y-countdown-interval>\n <i\n c8yIcon=\"pause\"\n *ngIf=\"!isIntervalRefreshToggleOn\"\n ></i>\n </label>\n\n <div class=\"input-group-btn\">\n <button\n class=\"btn btn-default\"\n [attr.aria-label]=\"'Refresh' | translate\"\n [tooltip]=\"'Refresh' | translate\"\n placement=\"bottom\"\n type=\"button\"\n [adaptivePosition]=\"false\"\n [container]=\"'body'\"\n [delay]=\"500\"\n [disabled]=\"isLoading()\"\n (click)=\"reload()\"\n data-cy=\"c8y-data-points-table-widget--reload-button\"\n >\n <i\n c8yIcon=\"refresh\"\n [ngClass]=\"{ 'icon-spin': isLoading() }\"\n ></i>\n </button>\n </div>\n </div>\n</div>\n" }]
862
- }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: i0.Injector }, { type: i1$2.TranslateService }], propDecorators: { countdownIntervalComponent: [{
891
+ args: [{ selector: 'c8y-datapoints-reload', standalone: true, imports: [CommonModule$1, CountdownIntervalModule, ListGroupModule, TooltipModule], template: "<ng-container *ngIf=\"!widgetInstanceGlobalAutoRefreshContext\">\n <div class=\"a-i-center input-group p-t-4 p-b-4 max-width-fit m-l-auto\">\n <label\n class=\"m-b-0 m-r-8 text-label-small text-truncate flex-no-shrink\"\n title=\" {{ 'Auto refresh' | translate }}\"\n *ngIf=\"refreshInterval && isAutoRefreshEnabled\"\n >\n {{ 'Auto refresh' | translate }}\n </label>\n <div class=\"input-group\">\n <label\n class=\"toggle-countdown\"\n [class.toggle-countdown-disabled]=\"isRefreshDisabled\"\n [attr.aria-label]=\"toggleCountdownButtonTooltipText\"\n [tooltip]=\"toggleCountdownButtonTooltipText\"\n placement=\"bottom\"\n *ngIf=\"refreshInterval && isAutoRefreshEnabled\"\n [adaptivePosition]=\"false\"\n [container]=\"'body'\"\n [delay]=\"500\"\n >\n <input\n type=\"checkbox\"\n [checked]=\"isIntervalRefreshToggleOn\"\n [disabled]=\"isRefreshDisabled\"\n data-cy=\"c8y-data-points-table-widget--interval-toggle-button\"\n (click)=\"onToggleCountdownButtonState($event)\"\n />\n\n <c8y-countdown-interval\n *ngIf=\"isIntervalRefreshToggleOn\"\n [countdownInterval]=\"refreshInterval\"\n (countdownEnded)=\"countdownEnded()\"\n ></c8y-countdown-interval>\n <i\n c8yIcon=\"pause\"\n *ngIf=\"!isIntervalRefreshToggleOn\"\n ></i>\n </label>\n\n <div class=\"input-group-btn\">\n <button\n class=\"btn btn-default\"\n [attr.aria-label]=\"'Refresh' | translate\"\n [tooltip]=\"'Refresh' | translate\"\n placement=\"bottom\"\n type=\"button\"\n [adaptivePosition]=\"false\"\n [container]=\"'body'\"\n [delay]=\"500\"\n [disabled]=\"isRefreshDisabled || (isLoading | async)\"\n (click)=\"reload()\"\n data-cy=\"c8y-data-points-table-widget--reload-button\"\n >\n <i\n c8yIcon=\"refresh\"\n [ngClass]=\"{ 'icon-spin': isLoading | async }\"\n ></i>\n </button>\n </div>\n </div>\n </div>\n</ng-container>\n" }]
892
+ }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: i1$2.TranslateService }, { type: i1$1.WidgetGlobalAutoRefreshService }], propDecorators: { countdownIntervalComponent: [{
863
893
  type: ViewChild,
864
894
  args: [CountdownIntervalComponent, { static: false }]
865
895
  }], isAutoRefreshEnabled: [{
866
896
  type: Input
867
- }], isDisabled: [{
897
+ }], isRefreshDisabled: [{
868
898
  type: Input
869
899
  }], isLoading: [{
870
900
  type: Input
@@ -874,6 +904,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
874
904
  type: Input
875
905
  }], refreshInterval: [{
876
906
  type: Input
907
+ }], widgetInstanceGlobalAutoRefreshContext: [{
908
+ type: Input
877
909
  }], onCountdownEnded: [{
878
910
  type: Output
879
911
  }] } });
@@ -1481,7 +1513,7 @@ class DatapointsTableComponent {
1481
1513
  }));
1482
1514
  }
1483
1515
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DatapointsTableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1484
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: DatapointsTableComponent, isStandalone: true, selector: "c8y-datapoints-table", inputs: { aggregationType: "aggregationType", datapointsTableItems: "datapointsTableItems", devicesColumnHeaders: "devicesColumnHeaders", decimalPlaces: "decimalPlaces", hasMultipleDatapoints: "hasMultipleDatapoints", isLoading: "isLoading", seriesWithoutPermissionToReadCount: "seriesWithoutPermissionToReadCount" }, outputs: { isScrolling: "isScrolling" }, host: { classAttribute: "d-col flex-grow" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"c8y-cq-440\">\n <div\n class=\"hidden-xs c8y-list__item c8y-list--timeline hidden-cq\"\n [ngClass]=\"{ 'separator-top-bottom': devicesColumnHeaders.length > 0 }\"\n >\n <div class=\"d-flex container-fluid\">\n <div class=\"c8y-list--timeline__item__date\"></div>\n <div class=\"c8y-list__item__block flex-grow min-width-0\">\n <div class=\"c8y-list__item__body\">\n <div class=\"d-flex row\">\n <ng-container *ngIf=\"hasMultipleDatapoints\">\n <div\n class=\"min-width-0\"\n [title]=\"'Device' | translate\"\n [c8yDynamicColumn]=\"devicesColumnHeaders.length\"\n >\n <span class=\"text-medium text-truncate\">\n {{ 'Device' | translate }}\n </span>\n </div>\n </ng-container>\n <!-- Data points column headers -->\n <ng-container *ngFor=\"let header of devicesColumnHeaders\">\n <div\n class=\"min-width-0\"\n title=\"{{ header | columnTitle }}\"\n [c8yDynamicColumn]=\"devicesColumnHeaders.length\"\n >\n <span class=\"text-medium text-truncate\">{{ header.label }} {{ header.unit }}</span>\n </div>\n </ng-container>\n </div>\n </div>\n </div>\n </div>\n </div>\n</div>\n<!-- The record list -->\n<ng-container *ngIf=\"!isLoading; else loading\">\n <ng-container *ngIf=\"!hasNoPermissionsToReadAnyMeasurement; else missingAllPermissions\">\n <ng-container *ngIf=\"datapointsTableItems.length; else emptyState\">\n <c8y-list-group\n class=\"p-t-8 flex-grow c8y-cq-440\"\n c8yVirtualScrollListener\n (scrolled)=\"onListScrolled()\"\n (scrolledToTop)=\"onListScrolledToTop()\"\n >\n <c8y-li-timeline\n *c8yFor=\"\n let tableItem of { data: datapointsTableItems, res: null };\n enableVirtualScroll: true;\n virtualScrollElementSize: 40;\n virtualScrollStrategy: 'fixed'\n \"\n >\n {{ tableItem.dateAndTime | c8yDate: 'mediumDate' }}\n {{\n tableItem.dateAndTime\n | c8yDate: 'mediumTime'\n | adjustAggregatedTimeRange: aggregationType\n }}\n <c8y-li>\n <c8y-li-body>\n <div class=\"d-flex row\">\n <div\n class=\"min-width-0\"\n [c8yDynamicColumn]=\"devicesColumnHeaders.length\"\n *ngIf=\"devicesColumnHeaders.length > 1\"\n [attr.data-label]=\"'Device' | translate\"\n >\n <div\n class=\"text-truncate\"\n title=\"{{ tableItem.deviceName }}\"\n >\n {{ tableItem.deviceName }}\n </div>\n </div>\n <!-- Data point value row cells -->\n <ng-container *ngFor=\"let row of tableItem.rowItems\">\n <ng-container *ngIf=\"row !== null; else emptyRowContent\">\n <ng-container [ngSwitch]=\"row.renderType\">\n <div\n [c8yDynamicColumn]=\"devicesColumnHeaders.length\"\n [ngClass]=\"row.value.min ?? null | applyRangeClass: getRangeValues(row)\"\n *ngSwitchCase=\"'min'\"\n [attr.data-label]=\"row.label\"\n >\n <div\n class=\"text-truncate\"\n title=\"{{ row.value.min ?? '' | number: getFractionSize(row.value.min) }}\"\n >\n {{ row.value.min ?? '' | number: getFractionSize(row.value.min) }}\n </div>\n </div>\n <div\n class=\"col-md-4\"\n [ngClass]=\"row.value.min ?? null | applyRangeClass: getRangeValues(row)\"\n *ngSwitchCase=\"'max'\"\n >\n <div\n class=\"text-truncate\"\n title=\"{{ row.value.min ?? '' | number: getFractionSize(row.value.min) }}\"\n >\n {{ row.value.min ?? '' | number: getFractionSize(row.value.min) }}\n </div>\n </div>\n <div\n [c8yDynamicColumn]=\"devicesColumnHeaders.length\"\n *ngSwitchCase=\"'area'\"\n >\n <span\n class=\"text-truncate\"\n title=\"{{ row.value.min ?? '' | number: getFractionSize(row.value.min) }}\"\n [ngClass]=\"row.value.min ?? null | applyRangeClass: getRangeValues(row)\"\n >\n {{ row.value.min ?? '' | number: getFractionSize(row.value.min) }}\n </span>\n ...\n <span\n class=\"text-truncate\"\n title=\"{{ row.value.min ?? '' | number: getFractionSize(row.value.min) }}\"\n [ngClass]=\"row.value.max ?? null | applyRangeClass: getRangeValues(row)\"\n >\n {{ row.value.min ?? '' | number: getFractionSize(row.value.min) }}\n </span>\n </div>\n <div\n [c8yDynamicColumn]=\"devicesColumnHeaders.length\"\n *ngSwitchDefault\n >\n <span\n class=\"text-truncate\"\n title=\"{{ row.value.min ?? '' | number: getFractionSize(row.value.min) }}\"\n [ngClass]=\"row.value.min ?? null | applyRangeClass: getRangeValues(row)\"\n >\n {{ row.value.min ?? '' | number: getFractionSize(row.value.min) }}\n </span>\n </div>\n </ng-container>\n </ng-container>\n <ng-template #emptyRowContent>\n <div [c8yDynamicColumn]=\"devicesColumnHeaders.length\"></div>\n </ng-template>\n </ng-container>\n </div>\n </c8y-li-body>\n </c8y-li>\n </c8y-li-timeline>\n </c8y-list-group>\n </ng-container>\n </ng-container>\n</ng-container>\n<ng-template #loading>\n <c8y-loading></c8y-loading>\n</ng-template>\n<ng-template #emptyState>\n <div class=\"p-relative p-l-24\">\n <c8y-ui-empty-state\n [icon]=\"'c8y-alert-idle'\"\n [title]=\"'No data to display.' | translate\"\n [horizontal]=\"true\"\n data-cy=\"datapoints-table-list--empty-state\"\n >\n <p c8y-guide-docs>\n <small translate>\n Find out more in the\n <a c8y-guide-href=\"/docs/cockpit/widgets-collection/#data-point-table\">\n user documentation\n </a>\n .\n </small>\n </p>\n </c8y-ui-empty-state>\n </div>\n</ng-template>\n<ng-template #missingAllPermissions>\n <div class=\"p-t-24 p-r-16 p-l-16 p-b-16 d-flex\">\n <div class=\"center-block\">\n <c8y-dynamic-component-alerts\n [alerts]=\"missingAllPermissionsAlert\"\n ></c8y-dynamic-component-alerts>\n </div>\n </div>\n</ng-template>\n", dependencies: [{ kind: "pipe", type: AdjustAggregatedTimeRangePipe, name: "adjustAggregatedTimeRange" }, { kind: "pipe", type: ApplyRangeClassPipe, name: "applyRangeClass" }, { kind: "pipe", type: ColumnTitlePipe, name: "columnTitle" }, { kind: "ngmodule", type: CommonModule$1 }, { kind: "component", type: i1$1.EmptyStateComponent, selector: "c8y-ui-empty-state", inputs: ["icon", "title", "subtitle", "horizontal"] }, { kind: "pipe", type: i1$1.C8yTranslatePipe, name: "translate" }, { kind: "directive", type: i1$1.C8yTranslateDirective, selector: "[translate],[ngx-translate]" }, { kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i2.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i2.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { kind: "pipe", type: i2.DecimalPipe, name: "number" }, { kind: "directive", type: i1$1.ForOfDirective, selector: "[c8yFor]", inputs: ["c8yForOf", "c8yForLoadMore", "c8yForPipe", "c8yForNotFound", "c8yForMaxIterations", "c8yForLoadingTemplate", "c8yForLoadNextLabel", "c8yForLoadingLabel", "c8yForRealtime", "c8yForRealtimeOptions", "c8yForComparator", "c8yForEnableVirtualScroll", "c8yForVirtualScrollElementSize", "c8yForVirtualScrollStrategy", "c8yForVirtualScrollContainerHeight"], outputs: ["c8yForCount", "c8yForChange", "c8yForLoadMoreComponent"] }, { kind: "pipe", type: i1$1.DatePipe, name: "c8yDate" }, { kind: "component", type: i1$1.LoadingComponent, selector: "c8y-loading", inputs: ["layout", "progress", "message"] }, { kind: "ngmodule", type: DocsModule }, { kind: "directive", type: i1$1.GuideHrefDirective, selector: "[c8y-guide-href]", inputs: ["c8y-guide-href"] }, { kind: "component", type: i1$1.GuideDocsComponent, selector: "[c8y-guide-docs]" }, { kind: "directive", type: DynamicColumnDirective, selector: "[c8yDynamicColumn]", inputs: ["c8yDynamicColumn"] }, { kind: "ngmodule", type: DynamicComponentModule }, { kind: "component", type: i1$1.DynamicComponentAlertsComponent, selector: "c8y-dynamic-component-alerts", inputs: ["alerts"] }, { kind: "ngmodule", type: ListGroupModule }, { kind: "component", type: i1$1.ListGroupComponent, selector: "c8y-list-group" }, { kind: "component", type: i1$1.ListItemComponent, selector: "c8y-list-item, c8y-li", inputs: ["active", "highlighted", "emptyActions", "dense", "collapsed", "selectable"], outputs: ["collapsedChange"] }, { kind: "component", type: i1$1.ListItemBodyComponent, selector: "c8y-list-item-body, c8y-li-body", inputs: ["body"] }, { kind: "component", type: i1$1.ListItemTimelineComponent, selector: "c8y-list-item-timeline, c8y-li-timeline" }, { kind: "directive", type: VirtualScrollListenerDirective, selector: "[c8yVirtualScrollListener]", inputs: ["scrollThreshold"], outputs: ["scrolled", "scrolledToTop"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1516
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: DatapointsTableComponent, isStandalone: true, selector: "c8y-datapoints-table", inputs: { aggregationType: "aggregationType", datapointsTableItems: "datapointsTableItems", devicesColumnHeaders: "devicesColumnHeaders", decimalPlaces: "decimalPlaces", hasMultipleDatapoints: "hasMultipleDatapoints", isLoading: "isLoading", seriesWithoutPermissionToReadCount: "seriesWithoutPermissionToReadCount" }, outputs: { isScrolling: "isScrolling" }, host: { classAttribute: "d-col flex-grow" }, usesOnChanges: true, ngImport: i0, template: "<ng-container *ngIf=\"!hasNoPermissionsToReadAnyMeasurement; else missingAllPermissions\">\n <div class=\"c8y-cq-440\">\n <div\n class=\"hidden-xs c8y-list__item c8y-list--timeline hidden-cq\"\n [ngClass]=\"{ 'separator-top-bottom': devicesColumnHeaders.length > 0 }\"\n >\n <div class=\"d-flex container-fluid\">\n <div class=\"c8y-list--timeline__item__date\"></div>\n <div class=\"c8y-list__item__block flex-grow min-width-0\">\n <div class=\"c8y-list__item__body\">\n <div class=\"d-flex row\">\n <ng-container *ngIf=\"hasMultipleDatapoints\">\n <div\n class=\"min-width-0\"\n [title]=\"'Device' | translate\"\n [c8yDynamicColumn]=\"devicesColumnHeaders.length\"\n >\n <span class=\"text-medium text-truncate\">\n {{ 'Device' | translate }}\n </span>\n </div>\n </ng-container>\n <!-- Data points column headers -->\n <ng-container *ngFor=\"let header of devicesColumnHeaders\">\n <div\n class=\"min-width-0\"\n title=\"{{ header | columnTitle }}\"\n [c8yDynamicColumn]=\"devicesColumnHeaders.length\"\n >\n <span class=\"text-medium text-truncate\">\n {{ header.label }} {{ header.unit }}\n </span>\n </div>\n </ng-container>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <!-- The record list -->\n <ng-container *ngIf=\"!isLoading; else loading\">\n <ng-container *ngIf=\"datapointsTableItems.length; else emptyState\">\n <c8y-list-group\n class=\"p-t-8 flex-grow c8y-cq-440\"\n c8yVirtualScrollListener\n (scrolled)=\"onListScrolled()\"\n (scrolledToTop)=\"onListScrolledToTop()\"\n >\n <c8y-li-timeline\n *c8yFor=\"\n let tableItem of { data: datapointsTableItems, res: null };\n enableVirtualScroll: true;\n virtualScrollElementSize: 40;\n virtualScrollStrategy: 'fixed'\n \"\n >\n {{ tableItem.dateAndTime | c8yDate: 'mediumDate' }}\n {{\n tableItem.dateAndTime\n | c8yDate: 'mediumTime'\n | adjustAggregatedTimeRange: aggregationType\n }}\n <c8y-li>\n <c8y-li-body>\n <div class=\"d-flex row\">\n <div\n class=\"min-width-0\"\n [c8yDynamicColumn]=\"devicesColumnHeaders.length\"\n *ngIf=\"devicesColumnHeaders.length > 1\"\n [attr.data-label]=\"'Device' | translate\"\n >\n <div\n class=\"text-truncate\"\n title=\"{{ tableItem.deviceName }}\"\n >\n {{ tableItem.deviceName }}\n </div>\n </div>\n <!-- Data point value row cells -->\n <ng-container *ngFor=\"let row of tableItem.rowItems\">\n <ng-container *ngIf=\"row !== null; else emptyRowContent\">\n <ng-container [ngSwitch]=\"row.renderType\">\n <div\n [c8yDynamicColumn]=\"devicesColumnHeaders.length\"\n [ngClass]=\"row.value.min ?? null | applyRangeClass: getRangeValues(row)\"\n *ngSwitchCase=\"'min'\"\n [attr.data-label]=\"row.label\"\n >\n <div\n class=\"text-truncate\"\n title=\"{{ row.value.min ?? '' | number: getFractionSize(row.value.min) }}\"\n >\n {{ row.value.min ?? '' | number: getFractionSize(row.value.min) }}\n </div>\n </div>\n <div\n class=\"col-md-4\"\n [ngClass]=\"row.value.min ?? null | applyRangeClass: getRangeValues(row)\"\n *ngSwitchCase=\"'max'\"\n >\n <div\n class=\"text-truncate\"\n title=\"{{ row.value.min ?? '' | number: getFractionSize(row.value.min) }}\"\n >\n {{ row.value.min ?? '' | number: getFractionSize(row.value.min) }}\n </div>\n </div>\n <div\n [c8yDynamicColumn]=\"devicesColumnHeaders.length\"\n *ngSwitchCase=\"'area'\"\n >\n <span\n class=\"text-truncate\"\n title=\"{{ row.value.min ?? '' | number: getFractionSize(row.value.min) }}\"\n [ngClass]=\"row.value.min ?? null | applyRangeClass: getRangeValues(row)\"\n >\n {{ row.value.min ?? '' | number: getFractionSize(row.value.min) }}\n </span>\n ...\n <span\n class=\"text-truncate\"\n title=\"{{ row.value.min ?? '' | number: getFractionSize(row.value.min) }}\"\n [ngClass]=\"row.value.max ?? null | applyRangeClass: getRangeValues(row)\"\n >\n {{ row.value.min ?? '' | number: getFractionSize(row.value.min) }}\n </span>\n </div>\n <div\n [c8yDynamicColumn]=\"devicesColumnHeaders.length\"\n *ngSwitchDefault\n >\n <span\n class=\"text-truncate\"\n title=\"{{ row.value.min ?? '' | number: getFractionSize(row.value.min) }}\"\n [ngClass]=\"row.value.min ?? null | applyRangeClass: getRangeValues(row)\"\n >\n {{ row.value.min ?? '' | number: getFractionSize(row.value.min) }}\n </span>\n </div>\n </ng-container>\n </ng-container>\n <ng-template #emptyRowContent>\n <div [c8yDynamicColumn]=\"devicesColumnHeaders.length\"></div>\n </ng-template>\n </ng-container>\n </div>\n </c8y-li-body>\n </c8y-li>\n </c8y-li-timeline>\n </c8y-list-group>\n </ng-container>\n </ng-container>\n</ng-container>\n<ng-template #loading>\n <c8y-loading></c8y-loading>\n</ng-template>\n<ng-template #emptyState>\n <div class=\"p-relative p-l-24\">\n <c8y-ui-empty-state\n [icon]=\"'c8y-alert-idle'\"\n [title]=\"'No data to display.' | translate\"\n [horizontal]=\"true\"\n data-cy=\"datapoints-table-list--empty-state\"\n >\n <p c8y-guide-docs>\n <small translate>\n Find out more in the\n <a c8y-guide-href=\"/docs/cockpit/widgets-collection/#data-point-table\">\n user documentation\n </a>\n .\n </small>\n </p>\n </c8y-ui-empty-state>\n </div>\n</ng-template>\n<ng-template #missingAllPermissions>\n <div class=\"p-t-24 p-r-16 p-l-16 p-b-16 d-flex\">\n <div class=\"center-block\">\n <c8y-dynamic-component-alerts\n [alerts]=\"missingAllPermissionsAlert\"\n ></c8y-dynamic-component-alerts>\n </div>\n </div>\n</ng-template>\n", dependencies: [{ kind: "pipe", type: AdjustAggregatedTimeRangePipe, name: "adjustAggregatedTimeRange" }, { kind: "pipe", type: ApplyRangeClassPipe, name: "applyRangeClass" }, { kind: "pipe", type: ColumnTitlePipe, name: "columnTitle" }, { kind: "ngmodule", type: CommonModule$1 }, { kind: "component", type: i1$1.EmptyStateComponent, selector: "c8y-ui-empty-state", inputs: ["icon", "title", "subtitle", "horizontal"] }, { kind: "pipe", type: i1$1.C8yTranslatePipe, name: "translate" }, { kind: "directive", type: i1$1.C8yTranslateDirective, selector: "[translate],[ngx-translate]" }, { kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i2.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i2.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { kind: "pipe", type: i2.DecimalPipe, name: "number" }, { kind: "directive", type: i1$1.ForOfDirective, selector: "[c8yFor]", inputs: ["c8yForOf", "c8yForLoadMore", "c8yForPipe", "c8yForNotFound", "c8yForMaxIterations", "c8yForLoadingTemplate", "c8yForLoadNextLabel", "c8yForLoadingLabel", "c8yForRealtime", "c8yForRealtimeOptions", "c8yForComparator", "c8yForEnableVirtualScroll", "c8yForVirtualScrollElementSize", "c8yForVirtualScrollStrategy", "c8yForVirtualScrollContainerHeight"], outputs: ["c8yForCount", "c8yForChange", "c8yForLoadMoreComponent"] }, { kind: "pipe", type: i1$1.DatePipe, name: "c8yDate" }, { kind: "component", type: i1$1.LoadingComponent, selector: "c8y-loading", inputs: ["layout", "progress", "message"] }, { kind: "ngmodule", type: DocsModule }, { kind: "directive", type: i1$1.GuideHrefDirective, selector: "[c8y-guide-href]", inputs: ["c8y-guide-href"] }, { kind: "component", type: i1$1.GuideDocsComponent, selector: "[c8y-guide-docs]" }, { kind: "directive", type: DynamicColumnDirective, selector: "[c8yDynamicColumn]", inputs: ["c8yDynamicColumn"] }, { kind: "ngmodule", type: DynamicComponentModule }, { kind: "component", type: i1$1.DynamicComponentAlertsComponent, selector: "c8y-dynamic-component-alerts", inputs: ["alerts"] }, { kind: "ngmodule", type: ListGroupModule }, { kind: "component", type: i1$1.ListGroupComponent, selector: "c8y-list-group" }, { kind: "component", type: i1$1.ListItemComponent, selector: "c8y-list-item, c8y-li", inputs: ["active", "highlighted", "emptyActions", "dense", "collapsed", "selectable"], outputs: ["collapsedChange"] }, { kind: "component", type: i1$1.ListItemBodyComponent, selector: "c8y-list-item-body, c8y-li-body", inputs: ["body"] }, { kind: "component", type: i1$1.ListItemTimelineComponent, selector: "c8y-list-item-timeline, c8y-li-timeline" }, { kind: "directive", type: VirtualScrollListenerDirective, selector: "[c8yVirtualScrollListener]", inputs: ["scrollThreshold"], outputs: ["scrolled", "scrolledToTop"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1485
1517
  }
1486
1518
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DatapointsTableComponent, decorators: [{
1487
1519
  type: Component,
@@ -1495,7 +1527,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
1495
1527
  DynamicComponentModule,
1496
1528
  ListGroupModule,
1497
1529
  VirtualScrollListenerDirective
1498
- ], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"c8y-cq-440\">\n <div\n class=\"hidden-xs c8y-list__item c8y-list--timeline hidden-cq\"\n [ngClass]=\"{ 'separator-top-bottom': devicesColumnHeaders.length > 0 }\"\n >\n <div class=\"d-flex container-fluid\">\n <div class=\"c8y-list--timeline__item__date\"></div>\n <div class=\"c8y-list__item__block flex-grow min-width-0\">\n <div class=\"c8y-list__item__body\">\n <div class=\"d-flex row\">\n <ng-container *ngIf=\"hasMultipleDatapoints\">\n <div\n class=\"min-width-0\"\n [title]=\"'Device' | translate\"\n [c8yDynamicColumn]=\"devicesColumnHeaders.length\"\n >\n <span class=\"text-medium text-truncate\">\n {{ 'Device' | translate }}\n </span>\n </div>\n </ng-container>\n <!-- Data points column headers -->\n <ng-container *ngFor=\"let header of devicesColumnHeaders\">\n <div\n class=\"min-width-0\"\n title=\"{{ header | columnTitle }}\"\n [c8yDynamicColumn]=\"devicesColumnHeaders.length\"\n >\n <span class=\"text-medium text-truncate\">{{ header.label }} {{ header.unit }}</span>\n </div>\n </ng-container>\n </div>\n </div>\n </div>\n </div>\n </div>\n</div>\n<!-- The record list -->\n<ng-container *ngIf=\"!isLoading; else loading\">\n <ng-container *ngIf=\"!hasNoPermissionsToReadAnyMeasurement; else missingAllPermissions\">\n <ng-container *ngIf=\"datapointsTableItems.length; else emptyState\">\n <c8y-list-group\n class=\"p-t-8 flex-grow c8y-cq-440\"\n c8yVirtualScrollListener\n (scrolled)=\"onListScrolled()\"\n (scrolledToTop)=\"onListScrolledToTop()\"\n >\n <c8y-li-timeline\n *c8yFor=\"\n let tableItem of { data: datapointsTableItems, res: null };\n enableVirtualScroll: true;\n virtualScrollElementSize: 40;\n virtualScrollStrategy: 'fixed'\n \"\n >\n {{ tableItem.dateAndTime | c8yDate: 'mediumDate' }}\n {{\n tableItem.dateAndTime\n | c8yDate: 'mediumTime'\n | adjustAggregatedTimeRange: aggregationType\n }}\n <c8y-li>\n <c8y-li-body>\n <div class=\"d-flex row\">\n <div\n class=\"min-width-0\"\n [c8yDynamicColumn]=\"devicesColumnHeaders.length\"\n *ngIf=\"devicesColumnHeaders.length > 1\"\n [attr.data-label]=\"'Device' | translate\"\n >\n <div\n class=\"text-truncate\"\n title=\"{{ tableItem.deviceName }}\"\n >\n {{ tableItem.deviceName }}\n </div>\n </div>\n <!-- Data point value row cells -->\n <ng-container *ngFor=\"let row of tableItem.rowItems\">\n <ng-container *ngIf=\"row !== null; else emptyRowContent\">\n <ng-container [ngSwitch]=\"row.renderType\">\n <div\n [c8yDynamicColumn]=\"devicesColumnHeaders.length\"\n [ngClass]=\"row.value.min ?? null | applyRangeClass: getRangeValues(row)\"\n *ngSwitchCase=\"'min'\"\n [attr.data-label]=\"row.label\"\n >\n <div\n class=\"text-truncate\"\n title=\"{{ row.value.min ?? '' | number: getFractionSize(row.value.min) }}\"\n >\n {{ row.value.min ?? '' | number: getFractionSize(row.value.min) }}\n </div>\n </div>\n <div\n class=\"col-md-4\"\n [ngClass]=\"row.value.min ?? null | applyRangeClass: getRangeValues(row)\"\n *ngSwitchCase=\"'max'\"\n >\n <div\n class=\"text-truncate\"\n title=\"{{ row.value.min ?? '' | number: getFractionSize(row.value.min) }}\"\n >\n {{ row.value.min ?? '' | number: getFractionSize(row.value.min) }}\n </div>\n </div>\n <div\n [c8yDynamicColumn]=\"devicesColumnHeaders.length\"\n *ngSwitchCase=\"'area'\"\n >\n <span\n class=\"text-truncate\"\n title=\"{{ row.value.min ?? '' | number: getFractionSize(row.value.min) }}\"\n [ngClass]=\"row.value.min ?? null | applyRangeClass: getRangeValues(row)\"\n >\n {{ row.value.min ?? '' | number: getFractionSize(row.value.min) }}\n </span>\n ...\n <span\n class=\"text-truncate\"\n title=\"{{ row.value.min ?? '' | number: getFractionSize(row.value.min) }}\"\n [ngClass]=\"row.value.max ?? null | applyRangeClass: getRangeValues(row)\"\n >\n {{ row.value.min ?? '' | number: getFractionSize(row.value.min) }}\n </span>\n </div>\n <div\n [c8yDynamicColumn]=\"devicesColumnHeaders.length\"\n *ngSwitchDefault\n >\n <span\n class=\"text-truncate\"\n title=\"{{ row.value.min ?? '' | number: getFractionSize(row.value.min) }}\"\n [ngClass]=\"row.value.min ?? null | applyRangeClass: getRangeValues(row)\"\n >\n {{ row.value.min ?? '' | number: getFractionSize(row.value.min) }}\n </span>\n </div>\n </ng-container>\n </ng-container>\n <ng-template #emptyRowContent>\n <div [c8yDynamicColumn]=\"devicesColumnHeaders.length\"></div>\n </ng-template>\n </ng-container>\n </div>\n </c8y-li-body>\n </c8y-li>\n </c8y-li-timeline>\n </c8y-list-group>\n </ng-container>\n </ng-container>\n</ng-container>\n<ng-template #loading>\n <c8y-loading></c8y-loading>\n</ng-template>\n<ng-template #emptyState>\n <div class=\"p-relative p-l-24\">\n <c8y-ui-empty-state\n [icon]=\"'c8y-alert-idle'\"\n [title]=\"'No data to display.' | translate\"\n [horizontal]=\"true\"\n data-cy=\"datapoints-table-list--empty-state\"\n >\n <p c8y-guide-docs>\n <small translate>\n Find out more in the\n <a c8y-guide-href=\"/docs/cockpit/widgets-collection/#data-point-table\">\n user documentation\n </a>\n .\n </small>\n </p>\n </c8y-ui-empty-state>\n </div>\n</ng-template>\n<ng-template #missingAllPermissions>\n <div class=\"p-t-24 p-r-16 p-l-16 p-b-16 d-flex\">\n <div class=\"center-block\">\n <c8y-dynamic-component-alerts\n [alerts]=\"missingAllPermissionsAlert\"\n ></c8y-dynamic-component-alerts>\n </div>\n </div>\n</ng-template>\n" }]
1530
+ ], changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngIf=\"!hasNoPermissionsToReadAnyMeasurement; else missingAllPermissions\">\n <div class=\"c8y-cq-440\">\n <div\n class=\"hidden-xs c8y-list__item c8y-list--timeline hidden-cq\"\n [ngClass]=\"{ 'separator-top-bottom': devicesColumnHeaders.length > 0 }\"\n >\n <div class=\"d-flex container-fluid\">\n <div class=\"c8y-list--timeline__item__date\"></div>\n <div class=\"c8y-list__item__block flex-grow min-width-0\">\n <div class=\"c8y-list__item__body\">\n <div class=\"d-flex row\">\n <ng-container *ngIf=\"hasMultipleDatapoints\">\n <div\n class=\"min-width-0\"\n [title]=\"'Device' | translate\"\n [c8yDynamicColumn]=\"devicesColumnHeaders.length\"\n >\n <span class=\"text-medium text-truncate\">\n {{ 'Device' | translate }}\n </span>\n </div>\n </ng-container>\n <!-- Data points column headers -->\n <ng-container *ngFor=\"let header of devicesColumnHeaders\">\n <div\n class=\"min-width-0\"\n title=\"{{ header | columnTitle }}\"\n [c8yDynamicColumn]=\"devicesColumnHeaders.length\"\n >\n <span class=\"text-medium text-truncate\">\n {{ header.label }} {{ header.unit }}\n </span>\n </div>\n </ng-container>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <!-- The record list -->\n <ng-container *ngIf=\"!isLoading; else loading\">\n <ng-container *ngIf=\"datapointsTableItems.length; else emptyState\">\n <c8y-list-group\n class=\"p-t-8 flex-grow c8y-cq-440\"\n c8yVirtualScrollListener\n (scrolled)=\"onListScrolled()\"\n (scrolledToTop)=\"onListScrolledToTop()\"\n >\n <c8y-li-timeline\n *c8yFor=\"\n let tableItem of { data: datapointsTableItems, res: null };\n enableVirtualScroll: true;\n virtualScrollElementSize: 40;\n virtualScrollStrategy: 'fixed'\n \"\n >\n {{ tableItem.dateAndTime | c8yDate: 'mediumDate' }}\n {{\n tableItem.dateAndTime\n | c8yDate: 'mediumTime'\n | adjustAggregatedTimeRange: aggregationType\n }}\n <c8y-li>\n <c8y-li-body>\n <div class=\"d-flex row\">\n <div\n class=\"min-width-0\"\n [c8yDynamicColumn]=\"devicesColumnHeaders.length\"\n *ngIf=\"devicesColumnHeaders.length > 1\"\n [attr.data-label]=\"'Device' | translate\"\n >\n <div\n class=\"text-truncate\"\n title=\"{{ tableItem.deviceName }}\"\n >\n {{ tableItem.deviceName }}\n </div>\n </div>\n <!-- Data point value row cells -->\n <ng-container *ngFor=\"let row of tableItem.rowItems\">\n <ng-container *ngIf=\"row !== null; else emptyRowContent\">\n <ng-container [ngSwitch]=\"row.renderType\">\n <div\n [c8yDynamicColumn]=\"devicesColumnHeaders.length\"\n [ngClass]=\"row.value.min ?? null | applyRangeClass: getRangeValues(row)\"\n *ngSwitchCase=\"'min'\"\n [attr.data-label]=\"row.label\"\n >\n <div\n class=\"text-truncate\"\n title=\"{{ row.value.min ?? '' | number: getFractionSize(row.value.min) }}\"\n >\n {{ row.value.min ?? '' | number: getFractionSize(row.value.min) }}\n </div>\n </div>\n <div\n class=\"col-md-4\"\n [ngClass]=\"row.value.min ?? null | applyRangeClass: getRangeValues(row)\"\n *ngSwitchCase=\"'max'\"\n >\n <div\n class=\"text-truncate\"\n title=\"{{ row.value.min ?? '' | number: getFractionSize(row.value.min) }}\"\n >\n {{ row.value.min ?? '' | number: getFractionSize(row.value.min) }}\n </div>\n </div>\n <div\n [c8yDynamicColumn]=\"devicesColumnHeaders.length\"\n *ngSwitchCase=\"'area'\"\n >\n <span\n class=\"text-truncate\"\n title=\"{{ row.value.min ?? '' | number: getFractionSize(row.value.min) }}\"\n [ngClass]=\"row.value.min ?? null | applyRangeClass: getRangeValues(row)\"\n >\n {{ row.value.min ?? '' | number: getFractionSize(row.value.min) }}\n </span>\n ...\n <span\n class=\"text-truncate\"\n title=\"{{ row.value.min ?? '' | number: getFractionSize(row.value.min) }}\"\n [ngClass]=\"row.value.max ?? null | applyRangeClass: getRangeValues(row)\"\n >\n {{ row.value.min ?? '' | number: getFractionSize(row.value.min) }}\n </span>\n </div>\n <div\n [c8yDynamicColumn]=\"devicesColumnHeaders.length\"\n *ngSwitchDefault\n >\n <span\n class=\"text-truncate\"\n title=\"{{ row.value.min ?? '' | number: getFractionSize(row.value.min) }}\"\n [ngClass]=\"row.value.min ?? null | applyRangeClass: getRangeValues(row)\"\n >\n {{ row.value.min ?? '' | number: getFractionSize(row.value.min) }}\n </span>\n </div>\n </ng-container>\n </ng-container>\n <ng-template #emptyRowContent>\n <div [c8yDynamicColumn]=\"devicesColumnHeaders.length\"></div>\n </ng-template>\n </ng-container>\n </div>\n </c8y-li-body>\n </c8y-li>\n </c8y-li-timeline>\n </c8y-list-group>\n </ng-container>\n </ng-container>\n</ng-container>\n<ng-template #loading>\n <c8y-loading></c8y-loading>\n</ng-template>\n<ng-template #emptyState>\n <div class=\"p-relative p-l-24\">\n <c8y-ui-empty-state\n [icon]=\"'c8y-alert-idle'\"\n [title]=\"'No data to display.' | translate\"\n [horizontal]=\"true\"\n data-cy=\"datapoints-table-list--empty-state\"\n >\n <p c8y-guide-docs>\n <small translate>\n Find out more in the\n <a c8y-guide-href=\"/docs/cockpit/widgets-collection/#data-point-table\">\n user documentation\n </a>\n .\n </small>\n </p>\n </c8y-ui-empty-state>\n </div>\n</ng-template>\n<ng-template #missingAllPermissions>\n <div class=\"p-t-24 p-r-16 p-l-16 p-b-16 d-flex\">\n <div class=\"center-block\">\n <c8y-dynamic-component-alerts\n [alerts]=\"missingAllPermissionsAlert\"\n ></c8y-dynamic-component-alerts>\n </div>\n </div>\n</ng-template>\n" }]
1499
1531
  }], propDecorators: { aggregationType: [{
1500
1532
  type: Input
1501
1533
  }], datapointsTableItems: [{
@@ -1515,12 +1547,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
1515
1547
  }] } });
1516
1548
 
1517
1549
  class DatapointsTableViewWidgetComponent {
1518
- constructor(dataFetchingService, datapointsTableConfigService, datapointsTableViewService, formBuilder, translateService) {
1550
+ constructor(alertService, dataFetchingService, datapointsTableConfigService, datapointsTableViewService, formBuilder, translateService, widgetGlobalAutoRefresh) {
1551
+ this.alertService = alertService;
1519
1552
  this.dataFetchingService = dataFetchingService;
1520
1553
  this.datapointsTableConfigService = datapointsTableConfigService;
1521
1554
  this.datapointsTableViewService = datapointsTableViewService;
1522
1555
  this.formBuilder = formBuilder;
1523
1556
  this.translateService = translateService;
1557
+ this.widgetGlobalAutoRefresh = widgetGlobalAutoRefresh;
1524
1558
  /**
1525
1559
  * Represents the data points where __active property is set to true.
1526
1560
  */
@@ -1530,7 +1564,11 @@ class DatapointsTableViewWidgetComponent {
1530
1564
  * Used to populate the table with data.
1531
1565
  */
1532
1566
  this.datapointsTableItems = [];
1533
- this.isDisabled = false;
1567
+ /**
1568
+ * Indicates whether refreshing should be enabled or disabled.
1569
+ * It's 'true' when user is not allowed to view a measurements.
1570
+ */
1571
+ this.isRefreshDisabled = false;
1534
1572
  /**
1535
1573
  * Indicates whether the component is in the initial request state
1536
1574
  * where data for a table structure is being prepared.
@@ -1539,9 +1577,12 @@ class DatapointsTableViewWidgetComponent {
1539
1577
  /**
1540
1578
  * Current isLoading state. Indicates whether the data is being loaded.
1541
1579
  */
1542
- this.isLoading = signal(true);
1580
+ this.isLoading$ = new BehaviorSubject(true);
1543
1581
  this.isExportModalOpen = false;
1544
1582
  this.isScrolling = signal(false);
1583
+ this.TIMEOUT_ERROR_TEXT = gettext('The request is taking longer than usual. We apologize for the inconvenience.');
1584
+ this.SERVER_ERROR_TEXT = gettext('Server error occurred.');
1585
+ this.destroy$ = new Subject();
1545
1586
  this.scrollingSubject$ = new Subject();
1546
1587
  /**
1547
1588
  * Indicates if the alert has already been displayed and can be dismissed.
@@ -1550,25 +1591,26 @@ class DatapointsTableViewWidgetComponent {
1550
1591
  this.isMissingAnyPermissionAlertShown = false;
1551
1592
  }
1552
1593
  async ngOnInit() {
1553
- // Will be uncommented in MTM-61920
1554
- // if (this.config.widgetInstanceGlobalTimeContext) {
1555
- // this.handleGlobalTimeContextSettings();
1556
- // }
1557
- // Condition will be removed in MTM-61920
1558
- // Dashboard context is temporary not supported in the new implementation
1594
+ if (this.config.widgetInstanceGlobalAutoRefreshContext) {
1595
+ this.containerClass = 'a-i-center input-group p-t-4 p-b-4 max-width-fit m-l-auto';
1596
+ }
1597
+ /**
1598
+ * Legacy widget used realtime so it must be converted to refresh approach
1599
+ * if it was enabled before migration.
1600
+ */
1559
1601
  if (this.config.widgetInstanceGlobalTimeContext) {
1602
+ this.config.widgetInstanceGlobalAutoRefreshContext = true;
1560
1603
  this.config.widgetInstanceGlobalTimeContext = false;
1604
+ this.config.displaySettings.globalAutoRefreshContext = true;
1561
1605
  }
1562
- // Condition will be removed in MTM-61920
1563
- // Dashboard context is temporary not supported in the new implementation
1564
- if (this.config['globalDateSelector'] === 'dashboard_context') {
1565
- this.config['globalDateSelector'] = DATE_SELECTION_VALUES.config;
1606
+ if (this.config.widgetInstanceGlobalAutoRefreshContext) {
1607
+ this.handleGlobalRefreshLoading();
1566
1608
  }
1567
1609
  this.setScrollingSubscription();
1568
1610
  const isLegacyWidgetRealtimeActive = this.config.realtime &&
1569
- !this.config.decimalPlaces &&
1570
- !this.config.refreshInterval &&
1571
- !this.config.isAutoRefreshEnabled;
1611
+ !this.config.hasOwnProperty('decimalPlaces') &&
1612
+ !this.config.hasOwnProperty('refreshInterval') &&
1613
+ !this.config.hasOwnProperty('isAutoRefreshEnabled');
1572
1614
  if (isLegacyWidgetRealtimeActive) {
1573
1615
  this.setDefaultRefreshRelatedProperties();
1574
1616
  }
@@ -1595,6 +1637,8 @@ class DatapointsTableViewWidgetComponent {
1595
1637
  if (this.subscription) {
1596
1638
  this.subscription.unsubscribe();
1597
1639
  }
1640
+ this.destroy$.next();
1641
+ this.destroy$.complete();
1598
1642
  }
1599
1643
  onDateChange(data) {
1600
1644
  if (this.formGroup.invalid) {
@@ -1648,7 +1692,7 @@ class DatapointsTableViewWidgetComponent {
1648
1692
  this.config.refreshInterval = DEFAULT_DPT_REFRESH_INTERVAL_VALUE;
1649
1693
  }
1650
1694
  recalculateIntervalToMatchFromNowDate() {
1651
- if (this.config.widgetInstanceGlobalTimeContext) {
1695
+ if (this.config.widgetInstanceGlobalAutoRefreshContext) {
1652
1696
  return;
1653
1697
  }
1654
1698
  const { dateFrom, dateTo } = this.datapointsTableConfigService.calculateDateRange(this.config.interval);
@@ -1680,7 +1724,7 @@ class DatapointsTableViewWidgetComponent {
1680
1724
  * If false, the seconds will be displayed as they are.
1681
1725
  */
1682
1726
  async prepareTableData(roundSeconds = true) {
1683
- this.isLoading.set(true);
1727
+ this.isLoading$.next(true);
1684
1728
  if (this.isInitialRequest) {
1685
1729
  this.activeDatapoints = this.datapointsTableViewService.filterOutInactiveDatapoints(this.config.datapoints);
1686
1730
  this.hasMultipleDatapoints = this.datapointsTableViewService.hasMultipleDatapoints(this.activeDatapoints);
@@ -1689,6 +1733,9 @@ class DatapointsTableViewWidgetComponent {
1689
1733
  }
1690
1734
  const activeDatapointsIdsWithSeries = this.datapointsTableViewService.groupSeriesByDeviceId(this.activeDatapoints);
1691
1735
  const activeDatapointsSeriesData = await this.getActiveDatapointsSeriesDataMap(activeDatapointsIdsWithSeries, this.config, roundSeconds);
1736
+ if (this.isFailedToFetchSeriesData) {
1737
+ return;
1738
+ }
1692
1739
  this.seriesWithoutPermissionToRead =
1693
1740
  this.datapointsTableViewService.getSeriesWithoutPermissionToRead(activeDatapointsSeriesData, activeDatapointsIdsWithSeries);
1694
1741
  if (!this.isMissingAnyPermissionAlertShown &&
@@ -1704,7 +1751,7 @@ class DatapointsTableViewWidgetComponent {
1704
1751
  const datapointsListItems = this.datapointsTableViewService.mapDatapointsWithValuesToList(this.datapointsWithValues);
1705
1752
  const groupedDatapointsListItems = this.datapointsTableViewService.groupByDateAndDevice(datapointsListItems, this.devicesColumnHeaders);
1706
1753
  this.datapointsTableItems = this.datapointsTableViewService.sortDataByDateDescending(groupedDatapointsListItems);
1707
- this.isLoading.set(false);
1754
+ this.isLoading$.next(false);
1708
1755
  }
1709
1756
  /**
1710
1757
  * Retrieves the active data points series data and returns it as a map.
@@ -1720,12 +1767,31 @@ class DatapointsTableViewWidgetComponent {
1720
1767
  */
1721
1768
  async getActiveDatapointsSeriesDataMap(datapointsIdsWithSeries, config, roundSeconds) {
1722
1769
  try {
1770
+ this.isFailedToFetchSeriesData = false;
1723
1771
  return await this.datapointsTableViewService.getAllActiveSeriesDataMap(datapointsIdsWithSeries, config, roundSeconds);
1724
1772
  }
1725
1773
  catch (error) {
1726
- this.isDisabled = true;
1727
- this.isLoading.set(false);
1774
+ this.isLoading$.next(false);
1775
+ this.handleFetchError(error);
1776
+ }
1777
+ }
1778
+ handleFetchError(error) {
1779
+ if (error?.message.includes('403')) {
1780
+ this.alerts.setAlertGroupDismissStrategy('warning', DismissAlertStrategy.NONE);
1781
+ this.isRefreshDisabled = true;
1782
+ return;
1728
1783
  }
1784
+ const isTimeoutError = error?.name === 'TimeoutError';
1785
+ const errorMessage = isTimeoutError
1786
+ ? this.TIMEOUT_ERROR_TEXT
1787
+ : error?.message ?? this.SERVER_ERROR_TEXT;
1788
+ this.alerts.setAlertGroupDismissStrategy('warning', DismissAlertStrategy.TEMPORARY_OR_PERMANENT);
1789
+ this.alerts.addAlerts(new DynamicComponentAlert({
1790
+ type: 'warning',
1791
+ text: errorMessage
1792
+ }));
1793
+ this.isFailedToFetchSeriesData = true;
1794
+ this.alertService.addServerFailure(error);
1729
1795
  }
1730
1796
  handleMissingAnyPermissionErrorMessage() {
1731
1797
  this.alerts.setAlertGroupDismissStrategy('system', DismissAlertStrategy.TEMPORARY);
@@ -1765,8 +1831,13 @@ class DatapointsTableViewWidgetComponent {
1765
1831
  this.exportConfig.dateFrom = this.config.dateFrom;
1766
1832
  this.exportConfig.dateTo = this.config.dateTo;
1767
1833
  }
1768
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DatapointsTableViewWidgetComponent, deps: [{ token: i1.DataFetchingService }, { token: DatapointsTableService }, { token: DatapointsTableViewService }, { token: i3.FormBuilder }, { token: i1$2.TranslateService }], target: i0.ɵɵFactoryTarget.Component }); }
1769
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: DatapointsTableViewWidgetComponent, isStandalone: true, selector: "c8y-datapoints-table-view", inputs: { config: "config" }, host: { classAttribute: "d-col fit-h" }, ngImport: i0, template: "<div class=\"d-flex gap-16 p-l-16 p-r-16 flex-wrap\">\n <ng-container *ngIf=\"config.displayDateSelection\">\n <form [formGroup]=\"formGroup\">\n <c8y-date-range-picker\n class=\"d-contents\"\n [isEmittingDateChange]=\"true\"\n [showLabel]=\"true\"\n (updatedDate)=\"onDateChange($event)\"\n ></c8y-date-range-picker>\n </form>\n </ng-container>\n <ng-container *ngIf=\"config.datapoints.length > 0\">\n <c8y-datapoints-reload\n class=\"d-contents\"\n [isAutoRefreshEnabled]=\"config.isAutoRefreshEnabled\"\n [refreshInterval]=\"config.refreshInterval\"\n [isDisabled]=\"isDisabled\"\n [isLoading]=\"isLoading\"\n [isScrolling]=\"isScrolling()\"\n [isExportModalOpen]=\"isExportModalOpen\"\n (onCountdownEnded)=\"onCountdownEnded()\"\n ></c8y-datapoints-reload>\n </ng-container>\n <c8y-datapoints-export-selector\n class=\"d-contents\"\n [exportConfig]=\"exportConfig\"\n (isOpen)=\"onExportModalOpen($event)\"\n ></c8y-datapoints-export-selector>\n</div>\n<ng-container *ngIf=\"devicesColumnHeaders\">\n <c8y-datapoints-table\n [aggregationType]=\"config.aggregation\"\n [datapointsTableItems]=\"datapointsTableItems\"\n [decimalPlaces]=\"config.decimalPlaces\"\n [devicesColumnHeaders]=\"devicesColumnHeaders\"\n [hasMultipleDatapoints]=\"hasMultipleDatapoints\"\n [isLoading]=\"isLoading()\"\n [seriesWithoutPermissionToReadCount]=\"seriesWithoutPermissionToRead?.length\"\n (isScrolling)=\"onScrolling($event)\"\n ></c8y-datapoints-table>\n</ng-container>\n", dependencies: [{ kind: "ngmodule", type: CommonModule$1 }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: DatapointsExportSelectorComponent, selector: "c8y-datapoints-export-selector", inputs: ["exportConfig"], outputs: ["isOpen"] }, { kind: "component", type: DatapointsReloadComponent, selector: "c8y-datapoints-reload", inputs: ["isAutoRefreshEnabled", "isDisabled", "isLoading", "isScrolling", "isExportModalOpen", "refreshInterval"], outputs: ["onCountdownEnded"] }, { kind: "component", type: DatapointsTableComponent, selector: "c8y-datapoints-table", inputs: ["aggregationType", "datapointsTableItems", "devicesColumnHeaders", "decimalPlaces", "hasMultipleDatapoints", "isLoading", "seriesWithoutPermissionToReadCount"], outputs: ["isScrolling"] }, { kind: "component", type: DateRangePickerComponent, selector: "c8y-date-range-picker", inputs: ["isEmittingDateChange", "showLabel"], outputs: ["updatedDate"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }] }); }
1834
+ handleGlobalRefreshLoading() {
1835
+ this.isLoading$
1836
+ .pipe(globalAutoRefreshLoading(this.widgetGlobalAutoRefresh), takeUntil(this.destroy$))
1837
+ .subscribe();
1838
+ }
1839
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DatapointsTableViewWidgetComponent, deps: [{ token: i1$1.AlertService }, { token: i1.DataFetchingService }, { token: DatapointsTableService }, { token: DatapointsTableViewService }, { token: i3.FormBuilder }, { token: i1$2.TranslateService }, { token: i1$1.WidgetGlobalAutoRefreshService }], target: i0.ɵɵFactoryTarget.Component }); }
1840
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: DatapointsTableViewWidgetComponent, isStandalone: true, selector: "c8y-datapoints-table-view", inputs: { config: "config" }, host: { classAttribute: "d-col fit-h" }, ngImport: i0, template: "<div class=\"d-flex gap-16 p-l-16 p-r-16 flex-wrap\">\n <ng-container *ngIf=\"config.displayDateSelection\">\n <form [formGroup]=\"formGroup\">\n <c8y-date-range-picker\n class=\"d-contents\"\n [isEmittingDateChange]=\"true\"\n [showLabel]=\"true\"\n (updatedDate)=\"onDateChange($event)\"\n ></c8y-date-range-picker>\n </form>\n </ng-container>\n <ng-container *ngIf=\"config.datapoints.length > 0\">\n <c8y-datapoints-reload\n class=\"d-contents\"\n [isAutoRefreshEnabled]=\"config.isAutoRefreshEnabled\"\n [refreshInterval]=\"config.refreshInterval\"\n [isRefreshDisabled]=\"isRefreshDisabled\"\n [isLoading]=\"isLoading$\"\n [isScrolling]=\"isScrolling()\"\n [isExportModalOpen]=\"isExportModalOpen\"\n [widgetInstanceGlobalAutoRefreshContext]=\"config.widgetInstanceGlobalAutoRefreshContext\"\n (onCountdownEnded)=\"onCountdownEnded()\"\n ></c8y-datapoints-reload>\n </ng-container>\n <c8y-datapoints-export-selector\n class=\"d-contents\"\n [exportConfig]=\"exportConfig\"\n (isOpen)=\"onExportModalOpen($event)\"\n ></c8y-datapoints-export-selector>\n</div>\n<ng-container *ngIf=\"devicesColumnHeaders\">\n <c8y-datapoints-table\n [aggregationType]=\"config.aggregation\"\n [datapointsTableItems]=\"datapointsTableItems\"\n [decimalPlaces]=\"config.decimalPlaces\"\n [devicesColumnHeaders]=\"devicesColumnHeaders\"\n [hasMultipleDatapoints]=\"hasMultipleDatapoints\"\n [isLoading]=\"isLoading$ | async\"\n [seriesWithoutPermissionToReadCount]=\"seriesWithoutPermissionToRead?.length\"\n (isScrolling)=\"onScrolling($event)\"\n ></c8y-datapoints-table>\n</ng-container>\n", dependencies: [{ kind: "ngmodule", type: CommonModule$1 }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }, { kind: "component", type: DatapointsExportSelectorComponent, selector: "c8y-datapoints-export-selector", inputs: ["containerClass", "exportConfig"], outputs: ["isOpen"] }, { kind: "component", type: DatapointsReloadComponent, selector: "c8y-datapoints-reload", inputs: ["isAutoRefreshEnabled", "isRefreshDisabled", "isLoading", "isScrolling", "isExportModalOpen", "refreshInterval", "widgetInstanceGlobalAutoRefreshContext"], outputs: ["onCountdownEnded"] }, { kind: "component", type: DatapointsTableComponent, selector: "c8y-datapoints-table", inputs: ["aggregationType", "datapointsTableItems", "devicesColumnHeaders", "decimalPlaces", "hasMultipleDatapoints", "isLoading", "seriesWithoutPermissionToReadCount"], outputs: ["isScrolling"] }, { kind: "component", type: DateRangePickerComponent, selector: "c8y-date-range-picker", inputs: ["isEmittingDateChange", "showLabel"], outputs: ["updatedDate"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }] }); }
1770
1841
  }
1771
1842
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DatapointsTableViewWidgetComponent, decorators: [{
1772
1843
  type: Component,
@@ -1777,8 +1848,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
1777
1848
  DatapointsTableComponent,
1778
1849
  DateRangePickerComponent,
1779
1850
  ReactiveFormsModule
1780
- ], template: "<div class=\"d-flex gap-16 p-l-16 p-r-16 flex-wrap\">\n <ng-container *ngIf=\"config.displayDateSelection\">\n <form [formGroup]=\"formGroup\">\n <c8y-date-range-picker\n class=\"d-contents\"\n [isEmittingDateChange]=\"true\"\n [showLabel]=\"true\"\n (updatedDate)=\"onDateChange($event)\"\n ></c8y-date-range-picker>\n </form>\n </ng-container>\n <ng-container *ngIf=\"config.datapoints.length > 0\">\n <c8y-datapoints-reload\n class=\"d-contents\"\n [isAutoRefreshEnabled]=\"config.isAutoRefreshEnabled\"\n [refreshInterval]=\"config.refreshInterval\"\n [isDisabled]=\"isDisabled\"\n [isLoading]=\"isLoading\"\n [isScrolling]=\"isScrolling()\"\n [isExportModalOpen]=\"isExportModalOpen\"\n (onCountdownEnded)=\"onCountdownEnded()\"\n ></c8y-datapoints-reload>\n </ng-container>\n <c8y-datapoints-export-selector\n class=\"d-contents\"\n [exportConfig]=\"exportConfig\"\n (isOpen)=\"onExportModalOpen($event)\"\n ></c8y-datapoints-export-selector>\n</div>\n<ng-container *ngIf=\"devicesColumnHeaders\">\n <c8y-datapoints-table\n [aggregationType]=\"config.aggregation\"\n [datapointsTableItems]=\"datapointsTableItems\"\n [decimalPlaces]=\"config.decimalPlaces\"\n [devicesColumnHeaders]=\"devicesColumnHeaders\"\n [hasMultipleDatapoints]=\"hasMultipleDatapoints\"\n [isLoading]=\"isLoading()\"\n [seriesWithoutPermissionToReadCount]=\"seriesWithoutPermissionToRead?.length\"\n (isScrolling)=\"onScrolling($event)\"\n ></c8y-datapoints-table>\n</ng-container>\n" }]
1781
- }], ctorParameters: () => [{ type: i1.DataFetchingService }, { type: DatapointsTableService }, { type: DatapointsTableViewService }, { type: i3.FormBuilder }, { type: i1$2.TranslateService }], propDecorators: { config: [{
1851
+ ], template: "<div class=\"d-flex gap-16 p-l-16 p-r-16 flex-wrap\">\n <ng-container *ngIf=\"config.displayDateSelection\">\n <form [formGroup]=\"formGroup\">\n <c8y-date-range-picker\n class=\"d-contents\"\n [isEmittingDateChange]=\"true\"\n [showLabel]=\"true\"\n (updatedDate)=\"onDateChange($event)\"\n ></c8y-date-range-picker>\n </form>\n </ng-container>\n <ng-container *ngIf=\"config.datapoints.length > 0\">\n <c8y-datapoints-reload\n class=\"d-contents\"\n [isAutoRefreshEnabled]=\"config.isAutoRefreshEnabled\"\n [refreshInterval]=\"config.refreshInterval\"\n [isRefreshDisabled]=\"isRefreshDisabled\"\n [isLoading]=\"isLoading$\"\n [isScrolling]=\"isScrolling()\"\n [isExportModalOpen]=\"isExportModalOpen\"\n [widgetInstanceGlobalAutoRefreshContext]=\"config.widgetInstanceGlobalAutoRefreshContext\"\n (onCountdownEnded)=\"onCountdownEnded()\"\n ></c8y-datapoints-reload>\n </ng-container>\n <c8y-datapoints-export-selector\n class=\"d-contents\"\n [exportConfig]=\"exportConfig\"\n (isOpen)=\"onExportModalOpen($event)\"\n ></c8y-datapoints-export-selector>\n</div>\n<ng-container *ngIf=\"devicesColumnHeaders\">\n <c8y-datapoints-table\n [aggregationType]=\"config.aggregation\"\n [datapointsTableItems]=\"datapointsTableItems\"\n [decimalPlaces]=\"config.decimalPlaces\"\n [devicesColumnHeaders]=\"devicesColumnHeaders\"\n [hasMultipleDatapoints]=\"hasMultipleDatapoints\"\n [isLoading]=\"isLoading$ | async\"\n [seriesWithoutPermissionToReadCount]=\"seriesWithoutPermissionToRead?.length\"\n (isScrolling)=\"onScrolling($event)\"\n ></c8y-datapoints-table>\n</ng-container>\n" }]
1852
+ }], ctorParameters: () => [{ type: i1$1.AlertService }, { type: i1.DataFetchingService }, { type: DatapointsTableService }, { type: DatapointsTableViewService }, { type: i3.FormBuilder }, { type: i1$2.TranslateService }, { type: i1$1.WidgetGlobalAutoRefreshService }], propDecorators: { config: [{
1782
1853
  type: Input
1783
1854
  }] } });
1784
1855