@veloceapps/sdk 8.0.0-135 → 8.0.0-137
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/configuration-state.service.d.ts +3 -1
- 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/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 +50 -24
- 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 +45 -20
- 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
|
@@ -670,13 +670,13 @@ class FlowRouterService {
|
|
|
670
670
|
let updateContext$;
|
|
671
671
|
if (this.flowInfoService.isLegacy) {
|
|
672
672
|
updateContext$ = of(undefined).pipe(tap(() => {
|
|
673
|
-
this.contextService.update({ properties: { productId, lineItemId } });
|
|
673
|
+
this.contextService.update({ properties: { productId, lineItemId: lineItemId ?? '' } });
|
|
674
674
|
}));
|
|
675
675
|
}
|
|
676
676
|
else {
|
|
677
677
|
updateContext$ = this.flowStateService.dispatch$(UITemplateType.FLOW_ENGINE, 'UPDATE_CONTEXT_PROPERTIES', {
|
|
678
678
|
productId,
|
|
679
|
-
lineItemId,
|
|
679
|
+
lineItemId: lineItemId ?? '',
|
|
680
680
|
});
|
|
681
681
|
}
|
|
682
682
|
updateContext$
|
|
@@ -800,22 +800,23 @@ class FlowService {
|
|
|
800
800
|
return this.legacyApplyConfiguration();
|
|
801
801
|
}
|
|
802
802
|
else {
|
|
803
|
-
return this.configurationStateService
|
|
804
|
-
.saveConfiguration('', true)
|
|
805
|
-
.pipe(switchMap(() => this.flowStateService.dispatch$(UITemplateType.FLOW_ENGINE, 'UPDATE_ASSET_IDS')));
|
|
803
|
+
return this.configurationStateService.saveConfiguration('', true).pipe(switchMap(() => this.configurationStateService.cancelConfiguration()), switchMap(() => this.flowStateService.dispatch$(UITemplateType.FLOW_ENGINE, 'UPDATE_ASSET_IDS')));
|
|
806
804
|
}
|
|
807
805
|
}), tap(() => {
|
|
808
806
|
this.configurationService.hasUnsavedChanges = false;
|
|
809
807
|
this.flowRouterService.navigateToShoppingCart();
|
|
810
808
|
}), takeUntil(this.cleanup$))
|
|
811
809
|
.subscribe();
|
|
812
|
-
this.
|
|
810
|
+
this.updateFlowParams();
|
|
813
811
|
}
|
|
814
|
-
|
|
812
|
+
updateFlowParams() {
|
|
815
813
|
this.flowRouterService
|
|
816
814
|
.getFlowSubpath$()
|
|
817
815
|
.pipe(map(path => path.split('/')?.[0]), takeUntil(this.cleanup$))
|
|
818
816
|
.subscribe(flowPath => this.integrationState.patchState({ flowPath }));
|
|
817
|
+
this.flowRouterService.route$
|
|
818
|
+
.pipe(map(path => path.queryParams['productId']), takeUntil(this.cleanup$))
|
|
819
|
+
.subscribe(productId => this.integrationState.patchState({ productId }));
|
|
819
820
|
}
|
|
820
821
|
legacyApplyConfiguration() {
|
|
821
822
|
const quoteDraft = this.quoteDraftService.quoteDraft;
|
|
@@ -1451,7 +1452,7 @@ class ProductComponent {
|
|
|
1451
1452
|
}
|
|
1452
1453
|
init$() {
|
|
1453
1454
|
let quoteDraft$;
|
|
1454
|
-
if (this.flowInfoService.isLegacy) {
|
|
1455
|
+
if (this.flowInfoService.isLegacy || !this.flowInfoService.isStateful) {
|
|
1455
1456
|
quoteDraft$ = this.quoteDraftService.quoteDraft$;
|
|
1456
1457
|
}
|
|
1457
1458
|
else {
|