monkey-front-core 0.0.619 → 0.0.620

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.
@@ -8,8 +8,8 @@ import * as i1$1 from '@ngx-translate/core';
8
8
  import { TranslateModule, TranslateService } from '@ngx-translate/core';
9
9
  import * as moment_ from 'moment';
10
10
  import { datadogLogs } from '@datadog/browser-logs';
11
- import { map, catchError, filter, takeWhile, take, first, takeUntil, mergeMap, finalize } from 'rxjs/operators';
12
- import { throwError, BehaviorSubject, Subscription, interval, concat, Subject, of, from } from 'rxjs';
11
+ import { map, catchError, filter, takeWhile, take, first, takeUntil, finalize, tap, mergeMap } from 'rxjs/operators';
12
+ import { throwError, BehaviorSubject, Subscription, interval, concat, Subject, of, EMPTY, from } from 'rxjs';
13
13
  import * as i1$2 from '@angular/common/http';
14
14
  import { HttpParams, HttpErrorResponse, HTTP_INTERCEPTORS, HttpClientModule } from '@angular/common/http';
15
15
  import * as i2$1 from '@angular/platform-browser';
@@ -6533,18 +6533,30 @@ class MonkeyEcxCommonsStoreBaseService extends MonkeyEcxCommonsService {
6533
6533
  throw new Error(`${e?.message}`);
6534
6534
  }
6535
6535
  }
6536
- async loadPageData(pagination) {
6537
- const { store, selector } = this;
6536
+ loadDataStream(url) {
6537
+ this.updateControl({ isLoading: true });
6538
+ return (this.monkeyecxService?.get(url).pipe(finalize(() => {
6539
+ this.updateControl({ isLoading: false });
6540
+ }), tap((resp) => {
6541
+ this.handleResponseData(resp);
6542
+ })) || EMPTY);
6543
+ }
6544
+ async loadPageData(pagination, dispatchLoadAction = false) {
6545
+ const { store, selector, action } = this;
6538
6546
  const data = await store
6539
6547
  .select(selector.selectLinks())
6540
6548
  .pipe(take(1))
6541
6549
  .toPromise();
6542
- const { action } = pagination;
6543
- const { href } = new MonkeyEcxLinksModel({ _links: data }).getAction(action) || {
6550
+ const { href } = new MonkeyEcxLinksModel({ _links: data }).getAction(pagination?.action) || {
6544
6551
  href: ''
6545
6552
  };
6546
6553
  if (href) {
6547
- this.loadData(href);
6554
+ if (dispatchLoadAction) {
6555
+ this.store.dispatch(action.load({ url: href, skipClear: true }));
6556
+ }
6557
+ else {
6558
+ this.loadData(href);
6559
+ }
6548
6560
  }
6549
6561
  }
6550
6562
  /**
@@ -6580,6 +6592,17 @@ __decorate([
6580
6592
  }
6581
6593
  })
6582
6594
  ], MonkeyEcxCommonsStoreBaseService.prototype, "loadData", null);
6595
+ __decorate([
6596
+ MonkeyEcxCoreService({
6597
+ httpResponse: {
6598
+ httpCodeIgnore: [412],
6599
+ httpCodeIgnoreRedirect: [412]
6600
+ },
6601
+ requestInProgress: {
6602
+ showProgress: true
6603
+ }
6604
+ })
6605
+ ], MonkeyEcxCommonsStoreBaseService.prototype, "loadDataStream", null);
6583
6606
 
6584
6607
  class MonkeyEcxCommonsActions {
6585
6608
  static getActions(actionName) {