@veloceapps/sdk 8.0.0-103 → 8.0.0-104

Sign up to get free protection for your applications and to get access to all the features.
@@ -3,7 +3,7 @@ import { Injectable, InjectionToken, Optional, Inject, NgModule, inject, Directi
3
3
  import { UUID, ConfigurationContextMode, ConfigurationContext, UITemplateType, ConfigurationProcessorTypes, EntityUtil, isDefined, DEFAULT_CURRENCY_ISO_CODE, DEFAULT_CURRENCY_SYMBOL, validateDateFormat, DEFAULT_DATE_FORMAT, DEFAULT_DECIMALS_COUNT, getSupportedDateFormats, DEFAULT_DECIMAL_SEPARATOR, DEFAULT_THOUSANDS_SEPARATOR, DEFAULT_ACTION_CODE_LABELS, parseJsonSafely, ConfigurationMode, ConfigurationTranslatorUtils, ChargeGroupUtils, RuntimeModel, isNotLegacyUIDefinition, SalesforceIdUtils, DEFAULT_TIME_FORMAT, formatNumber } from '@veloceapps/core';
4
4
  import * as i1 from '@veloceapps/api';
5
5
  import { PriceApiService, ContextApiService, ProductModelApiService, ConfigurationApiService } from '@veloceapps/api';
6
- import { BehaviorSubject, tap as tap$1, switchMap, map as map$1, noop, catchError, throwError, of, forkJoin, Subject, filter as filter$1, zip, combineLatest, shareReplay as shareReplay$1, take as take$1, distinctUntilChanged } from 'rxjs';
6
+ import { BehaviorSubject, tap as tap$1, switchMap, map as map$1, noop, catchError, throwError, of, forkJoin, Subject, filter as filter$1, zip, combineLatest, skip as skip$1, shareReplay as shareReplay$1, take as take$1, distinctUntilChanged } from 'rxjs';
7
7
  import { map, filter, tap, switchMap as switchMap$1, skip, take, shareReplay, catchError as catchError$1, finalize, first } from 'rxjs/operators';
8
8
  import { merge, isEmpty, flatten, sortBy, map as map$2, omit, isEqual, uniqBy, transform, cloneDeep, uniq } from 'lodash';
9
9
  import * as i6 from '@veloceapps/components';
@@ -764,6 +764,13 @@ class FlowStateService {
764
764
  this.stateId$ = new BehaviorSubject(null);
765
765
  this.processors = {};
766
766
  this.subscriptions = {};
767
+ /*
768
+ In stateless mode watch QuoteDraft changes and call executeRequest so that
769
+ all subscriptions get their updates according to updated QuoteDraft
770
+ */
771
+ this.isInitialized$()
772
+ .pipe(filter$1(Boolean), filter$1(() => !this.getFlowSafe().properties.stateful), switchMap(() => this.quoteDraftService.quoteDraft$), skip$1(1), switchMap(() => this.executeRequest$({})))
773
+ .subscribe();
767
774
  }
768
775
  init$() {
769
776
  if (this.getFlowSafe().properties.stateful) {
@@ -942,12 +949,10 @@ class FlowStateService {
942
949
  }
943
950
  initStateless$() {
944
951
  const { headerId } = this.contextService.resolve();
945
- const { stateful } = this.getFlowSafe().properties;
946
- const processorsInit$ = stateful == false ? this.initProcessors$() : of(undefined);
947
952
  const stateInit$ = this.quoteDraftService
948
953
  .init(headerId, this.flowInfoService.params ?? {})
949
954
  .pipe(switchMap(() => this.calculate$()));
950
- return forkJoin([processorsInit$, stateInit$]).pipe(tap$1(() => this.quoteDraftService.finalizeInit()), map$1(noop));
955
+ return forkJoin([this.initProcessors$(), stateInit$]).pipe(tap$1(() => this.quoteDraftService.finalizeInit()), map$1(noop));
951
956
  }
952
957
  calculate$() {
953
958
  const flowState = this.quoteDraftService.quoteDraft;