@veloceapps/sdk 11.0.0-42 → 11.0.0-44

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.
@@ -6,7 +6,7 @@ import { ApiModule } from '@veloceapps/api';
6
6
  import * as i6 from '@veloceapps/components';
7
7
  import { ToastType, ConfirmationDialogModule } from '@veloceapps/components';
8
8
  import * as i1 from '@veloceapps/api/v2';
9
- import { tap, BehaviorSubject, map, filter, switchMap, of, forkJoin, throwError, noop, Subject, catchError as catchError$1, combineLatest, finalize as finalize$1, buffer, debounceTime, share, take, distinctUntilChanged, shareReplay, takeUntil } from 'rxjs';
9
+ import { tap, BehaviorSubject, map, filter, switchMap, of, forkJoin, throwError, noop, Subject, catchError as catchError$1, combineLatest, finalize as finalize$1, buffer, debounceTime, share, take, distinctUntilChanged, shareReplay, takeUntil, first } from 'rxjs';
10
10
  import { uniqBy, flatten, omit, cloneDeep, assign, isEqual } from 'lodash';
11
11
  import * as i2 from 'primeng/api';
12
12
  import { filter as filter$1, map as map$1, catchError, tap as tap$1, finalize } from 'rxjs/operators';
@@ -507,7 +507,7 @@ class TestModeConfigurationService {
507
507
  this.salesTransactionService = salesTransactionService;
508
508
  this.isInitialized = false;
509
509
  }
510
- initTestMode$(uiDefinitionContainer) {
510
+ initTestMode$(uiDefinitionContainer, options) {
511
511
  this.configurationRuntimeService.uiDefinitionContainer = uiDefinitionContainer;
512
512
  if (this.checkInitialized(uiDefinitionContainer)) {
513
513
  this.configurationRuntimeService.pcmModel = this.pcmModel;
@@ -521,9 +521,18 @@ class TestModeConfigurationService {
521
521
  if (!quoteId) {
522
522
  return throwError(() => `Unable to start the Configuration Preview: Quote is missing.`);
523
523
  }
524
- return this.flowInfoService.initTestFlow$(productId).pipe(switchMap(() => this.configurationRuntimeService.init$({ productId })), tap(pcmModel => (this.pcmModel = pcmModel)), tap(() => this.salesTransactionService.setState(this.getTestSalesTransaction(quoteId))), switchMap(() => this.configurationService.init$()), switchMap(() => this.configurationService.state
524
+ return this.flowInfoService.initTestFlow$(productId).pipe(switchMap(() => this.configurationRuntimeService.init$({ productId })), tap(pcmModel => (this.pcmModel = pcmModel)), switchMap(() => {
525
+ if (options?.customizationMode) {
526
+ return of(undefined);
527
+ }
528
+ return this.initConfiguration$(quoteId);
529
+ }), tap(() => (this.isInitialized = true)), map(noop));
530
+ }
531
+ initConfiguration$(quoteId) {
532
+ this.salesTransactionService.setState(this.getTestSalesTransaction(quoteId));
533
+ return this.configurationService.init$().pipe(switchMap(() => this.configurationService.state
525
534
  ? this.configurationService.configureRequest$(this.configurationService.state)
526
- : of(undefined)), tap(() => (this.isInitialized = true)), map(noop));
535
+ : of(undefined)), map(noop));
527
536
  }
528
537
  getTestSalesTransaction(quoteId) {
529
538
  const testTransaction = {
@@ -1418,7 +1427,7 @@ class ConfigurationStateService {
1418
1427
  }
1419
1428
  executeStateless$(request) {
1420
1429
  this.executionInProgress$.next(true);
1421
- return this.configurationService.state$.pipe(switchMap(state => {
1430
+ return this.configurationService.state$.pipe(first(), switchMap(state => {
1422
1431
  // Apply actions and execute configuration/price call
1423
1432
  // No need to run configuration if no actions in the request
1424
1433
  if (!request.actions?.length) {