@veloceapps/sdk 8.0.0-135 → 8.0.0-137

Sign up to get free protection for your applications and to get access to all the features.
@@ -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.updateFlowPath();
810
+ this.updateFlowParams();
813
811
  }
814
- updateFlowPath() {
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 {