@nova-ui/dashboards 19.0.0 → 20.0.0

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.
@@ -31,6 +31,7 @@ import _isNil from 'lodash/isNil';
31
31
  import isEmpty from 'lodash/isEmpty';
32
32
  import uniq from 'lodash/uniq';
33
33
  import get from 'lodash/get';
34
+ import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
34
35
  import clone from 'lodash/clone';
35
36
  import pick from 'lodash/pick';
36
37
  import _difference from 'lodash/difference';
@@ -2388,19 +2389,21 @@ const DEFAULT_REFRESH_INTERVAL = 300;
2388
2389
  */
2389
2390
  class RefresherSettingsService {
2390
2391
  constructor() {
2391
- this._refreshRateSeconds = DEFAULT_REFRESH_INTERVAL;
2392
- this.refreshRateSeconds$ = new BehaviorSubject(this.refreshRateSeconds);
2392
+ /**
2393
+ * This is a system wide definition for disabling all refreshers.
2394
+ */
2395
+ this.disabled$ = new BehaviorSubject(false);
2396
+ this.refreshRateSeconds$ = new BehaviorSubject(DEFAULT_REFRESH_INTERVAL);
2393
2397
  }
2394
2398
  /**
2395
2399
  * This is a system wide definition of refresh rate. Widgets have to be configured to use
2396
2400
  * the system settings to leverage this value.
2397
2401
  */
2398
2402
  get refreshRateSeconds() {
2399
- return this._refreshRateSeconds;
2403
+ return this.refreshRateSeconds$.value;
2400
2404
  }
2401
2405
  set refreshRateSeconds(value) {
2402
- this._refreshRateSeconds = value;
2403
- this.refreshRateSeconds$.next(this._refreshRateSeconds);
2406
+ this.refreshRateSeconds$.next(value);
2404
2407
  }
2405
2408
  /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: RefresherSettingsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
2406
2409
  /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: RefresherSettingsService, providedIn: "root" }); }
@@ -2443,14 +2446,18 @@ class Refresher {
2443
2446
  this.overrideDefaultSettings = true;
2444
2447
  this.interval = DEFAULT_REFRESH_INTERVAL;
2445
2448
  this.eventDef = REFRESH;
2446
- this.destroy$ = new Subject();
2447
2449
  this.refresherSettings.refreshRateSeconds$
2448
- .pipe(takeUntil(this.destroy$))
2449
- .subscribe((systemRefreshRate) => {
2450
+ .pipe(takeUntilDestroyed())
2451
+ .subscribe(() => {
2450
2452
  if (!this.overrideDefaultSettings) {
2451
2453
  this.initializeInterval();
2452
2454
  }
2453
2455
  });
2456
+ this.refresherSettings.disabled$
2457
+ .pipe(takeUntilDestroyed())
2458
+ .subscribe(() => {
2459
+ this.initializeInterval();
2460
+ });
2454
2461
  }
2455
2462
  updateConfiguration(properties) {
2456
2463
  this.interval = properties.interval ?? DEFAULT_REFRESH_INTERVAL;
@@ -2462,14 +2469,13 @@ class Refresher {
2462
2469
  }
2463
2470
  ngOnDestroy() {
2464
2471
  this.clearInterval();
2465
- this.destroy$.next();
2466
- this.destroy$.complete();
2467
2472
  }
2468
2473
  initializeInterval() {
2469
2474
  this.clearInterval();
2470
2475
  if (typeof this.interval === "undefined" ||
2471
2476
  this.getInterval() <= 0 ||
2472
- this.enabled === false) {
2477
+ this.enabled === false ||
2478
+ this.refresherSettings.disabled$.value === true) {
2473
2479
  return;
2474
2480
  }
2475
2481
  this.ngZone.runOutsideAngular(() => {