@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.
- package/core/modules/configuration/services/test-mode-configuration.service.d.ts +3 -1
- package/core/modules/configuration/types/configuration.types.d.ts +3 -0
- package/esm2020/core/modules/configuration/services/configuration-state.service.mjs +3 -3
- package/esm2020/core/modules/configuration/services/test-mode-configuration.service.mjs +13 -4
- package/esm2020/core/modules/configuration/types/configuration.types.mjs +1 -1
- package/fesm2015/veloceapps-sdk-core.mjs +14 -5
- package/fesm2015/veloceapps-sdk-core.mjs.map +1 -1
- package/fesm2020/veloceapps-sdk-core.mjs +14 -5
- package/fesm2020/veloceapps-sdk-core.mjs.map +1 -1
- package/package.json +1 -1
@@ -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)),
|
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)),
|
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) {
|