@veloceapps/sdk 8.0.0-134 → 8.0.0-136
Sign up to get free protection for your applications and to get access to all the features.
- package/core/modules/configuration/services/configuration-state.service.d.ts +3 -1
- package/core/services/context.service.d.ts +1 -0
- package/core/services/flow-info.service.d.ts +1 -0
- package/core/services/flow-state.service.d.ts +1 -0
- package/esm2020/core/modules/configuration/services/configuration-state.service.mjs +29 -13
- package/esm2020/core/services/context.service.mjs +12 -11
- package/esm2020/core/services/flow-info.service.mjs +4 -1
- package/esm2020/core/services/flow-state.service.mjs +16 -10
- package/esm2020/src/pages/product/product.component.mjs +2 -2
- package/esm2020/src/services/flow-router.service.mjs +3 -3
- package/esm2020/src/services/flow.service.mjs +7 -6
- package/fesm2015/veloceapps-sdk-core.mjs +61 -34
- package/fesm2015/veloceapps-sdk-core.mjs.map +1 -1
- package/fesm2015/veloceapps-sdk.mjs +9 -8
- package/fesm2015/veloceapps-sdk.mjs.map +1 -1
- package/fesm2020/veloceapps-sdk-core.mjs +56 -30
- package/fesm2020/veloceapps-sdk-core.mjs.map +1 -1
- package/fesm2020/veloceapps-sdk.mjs +9 -8
- package/fesm2020/veloceapps-sdk.mjs.map +1 -1
- package/package.json +1 -1
- package/src/services/flow.service.d.ts +1 -1
@@ -551,13 +551,13 @@ class FlowRouterService {
|
|
551
551
|
let updateContext$;
|
552
552
|
if (this.flowInfoService.isLegacy) {
|
553
553
|
updateContext$ = of(undefined).pipe(tap(() => {
|
554
|
-
this.contextService.update({ properties: { productId, lineItemId } });
|
554
|
+
this.contextService.update({ properties: { productId, lineItemId: lineItemId !== null && lineItemId !== void 0 ? lineItemId : '' } });
|
555
555
|
}));
|
556
556
|
}
|
557
557
|
else {
|
558
558
|
updateContext$ = this.flowStateService.dispatch$(UITemplateType.FLOW_ENGINE, 'UPDATE_CONTEXT_PROPERTIES', {
|
559
559
|
productId,
|
560
|
-
lineItemId,
|
560
|
+
lineItemId: lineItemId !== null && lineItemId !== void 0 ? lineItemId : '',
|
561
561
|
});
|
562
562
|
}
|
563
563
|
updateContext$
|
@@ -814,22 +814,23 @@ class FlowService {
|
|
814
814
|
return this.legacyApplyConfiguration();
|
815
815
|
}
|
816
816
|
else {
|
817
|
-
return this.configurationStateService
|
818
|
-
.saveConfiguration('', true)
|
819
|
-
.pipe(switchMap(() => this.flowStateService.dispatch$(UITemplateType.FLOW_ENGINE, 'UPDATE_ASSET_IDS')));
|
817
|
+
return this.configurationStateService.saveConfiguration('', true).pipe(switchMap(() => this.configurationStateService.cancelConfiguration()), switchMap(() => this.flowStateService.dispatch$(UITemplateType.FLOW_ENGINE, 'UPDATE_ASSET_IDS')));
|
820
818
|
}
|
821
819
|
}), tap(() => {
|
822
820
|
this.configurationService.hasUnsavedChanges = false;
|
823
821
|
this.flowRouterService.navigateToShoppingCart();
|
824
822
|
}), takeUntil(this.cleanup$))
|
825
823
|
.subscribe();
|
826
|
-
this.
|
824
|
+
this.updateFlowParams();
|
827
825
|
}
|
828
|
-
|
826
|
+
updateFlowParams() {
|
829
827
|
this.flowRouterService
|
830
828
|
.getFlowSubpath$()
|
831
829
|
.pipe(map(path => { var _a; return (_a = path.split('/')) === null || _a === void 0 ? void 0 : _a[0]; }), takeUntil(this.cleanup$))
|
832
830
|
.subscribe(flowPath => this.integrationState.patchState({ flowPath }));
|
831
|
+
this.flowRouterService.route$
|
832
|
+
.pipe(map(path => path.queryParams['productId']), takeUntil(this.cleanup$))
|
833
|
+
.subscribe(productId => this.integrationState.patchState({ productId }));
|
833
834
|
}
|
834
835
|
legacyApplyConfiguration() {
|
835
836
|
const quoteDraft = this.quoteDraftService.quoteDraft;
|
@@ -1468,7 +1469,7 @@ class ProductComponent {
|
|
1468
1469
|
}
|
1469
1470
|
init$() {
|
1470
1471
|
let quoteDraft$;
|
1471
|
-
if (this.flowInfoService.isLegacy) {
|
1472
|
+
if (this.flowInfoService.isLegacy || !this.flowInfoService.isStateful) {
|
1472
1473
|
quoteDraft$ = this.quoteDraftService.quoteDraft$;
|
1473
1474
|
}
|
1474
1475
|
else {
|