@veloceapps/sdk 8.0.0-84 → 8.0.0-86

Sign up to get free protection for your applications and to get access to all the features.
@@ -9,7 +9,7 @@ import { ToastType, LetDirectiveModule, QuantityControlModule, ErrorTooltipModul
9
9
  import * as i5 from '@veloceapps/sdk/cms';
10
10
  import { FlowAction, extractElementMetadata, extendElementMetadata, PreviewModule, LauncherModule } from '@veloceapps/sdk/cms';
11
11
  import * as i1$2 from '@veloceapps/sdk/core';
12
- import { isLineItemModified, getOriginParent, SdkPipesModule, ContextService, generateModifiedAssetsMap, SdkCoreModule } from '@veloceapps/sdk/core';
12
+ import { isLineItemModified, getOriginParent, SdkPipesModule, ContextService, QuoteDraftService, ConfigurationService, generateModifiedAssetsMap, SdkCoreModule } from '@veloceapps/sdk/core';
13
13
  import * as i3 from 'primeng/button';
14
14
  import { ButtonModule } from 'primeng/button';
15
15
  import * as i1 from 'primeng/dynamicdialog';
@@ -1527,7 +1527,11 @@ class FlowComponent {
1527
1527
  this.integrationState = integrationState;
1528
1528
  this.contextService = contextService;
1529
1529
  this.isLoading$ = this.routerService.loading$;
1530
- this.showHeader$ = combineLatest([this.routerService.route$, this.quoteDraftService.isStandalone$]).pipe(map(([route, isStandalone]) => route.data['showHeader'] && !isStandalone));
1530
+ this.showHeader$ = combineLatest([
1531
+ this.routerService.route$,
1532
+ this.quoteDraftService.isStandalone$,
1533
+ this.contextService.isInitialized$,
1534
+ ]).pipe(map(([route, isStandalone, isContextInited]) => !!isContextInited && this.quoteDraftService.isInitialized && route.data['showHeader'] && !isStandalone));
1531
1535
  this.isStandalone$ = this.quoteDraftService.isStandalone$;
1532
1536
  this.flowService.initSubscriptions();
1533
1537
  }
@@ -1541,10 +1545,10 @@ class FlowComponent {
1541
1545
  }
1542
1546
  }
1543
1547
  FlowComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowComponent, deps: [{ token: FlowRouterService }, { token: i1$2.QuoteDraftService }, { token: FlowService }, { token: FlowDocGenService }, { token: i5.IntegrationState }, { token: i1$2.ContextService }], target: i0.ɵɵFactoryTarget.Component });
1544
- FlowComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: FlowComponent, selector: "vl-flow", ngImport: i0, template: "<vl-flow-header *ngIf=\"showHeader$ | async\"></vl-flow-header>\n\n<div class=\"flow-content\">\n <div class=\"loading-overlay\" *ngIf=\"isLoading$ | async\">\n <vl-loader label=\"LOADING\"></vl-loader>\n </div>\n\n <router-outlet></router-outlet>\n\n <vl-flow-guided-selling *ngIf=\"(isStandalone$ | async) !== true\"></vl-flow-guided-selling>\n</div>\n\n<ng-container *ngIf=\"(isStandalone$ | async) !== true\">\n <vl-flow-doc-gen></vl-flow-doc-gen>\n</ng-container>\n", styles: [":host{display:flex;flex-direction:column;height:100%}.flow-content{flex-grow:1;position:relative;overflow:hidden}.loading-overlay{position:absolute;height:100%;width:100%;inset:0;background-color:#ffffff80;z-index:4}\n"], dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.RouterOutlet, selector: "router-outlet", inputs: ["name"], outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }, { kind: "component", type: i2$1.LoaderComponent, selector: "vl-loader", inputs: ["label", "overlayVisible"] }, { kind: "component", type: FlowHeaderComponent, selector: "vl-flow-header" }, { kind: "component", type: DocGenComponent, selector: "vl-flow-doc-gen" }, { kind: "component", type: GuidedSellingComponent, selector: "vl-flow-guided-selling" }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1548
+ FlowComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: FlowComponent, selector: "vl-flow", ngImport: i0, template: "<vl-flow-header *ngIf=\"showHeader$ | async\"></vl-flow-header>\n\n<div class=\"flow-content\">\n <div class=\"loading-overlay\" *ngIf=\"isLoading$ | async\">\n <vl-loader label=\"LOADING\"></vl-loader>\n </div>\n\n <router-outlet></router-outlet>\n\n <vl-flow-guided-selling *ngIf=\"(isStandalone$ | async) !== true\"></vl-flow-guided-selling>\n</div>\n\n<ng-container *ngIf=\"(isStandalone$ | async) !== true\">\n <vl-flow-doc-gen></vl-flow-doc-gen>\n</ng-container>\n", styles: [":host{display:flex;flex-direction:column;width:100%;height:100%}.flow-content{flex-grow:1;position:relative;overflow:hidden}.loading-overlay{position:absolute;height:100%;width:100%;inset:0;background-color:#fff;z-index:999}\n"], dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.RouterOutlet, selector: "router-outlet", inputs: ["name"], outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }, { kind: "component", type: i2$1.LoaderComponent, selector: "vl-loader", inputs: ["label", "overlayVisible"] }, { kind: "component", type: FlowHeaderComponent, selector: "vl-flow-header" }, { kind: "component", type: DocGenComponent, selector: "vl-flow-doc-gen" }, { kind: "component", type: GuidedSellingComponent, selector: "vl-flow-guided-selling" }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1545
1549
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowComponent, decorators: [{
1546
1550
  type: Component,
1547
- args: [{ selector: 'vl-flow', changeDetection: ChangeDetectionStrategy.OnPush, template: "<vl-flow-header *ngIf=\"showHeader$ | async\"></vl-flow-header>\n\n<div class=\"flow-content\">\n <div class=\"loading-overlay\" *ngIf=\"isLoading$ | async\">\n <vl-loader label=\"LOADING\"></vl-loader>\n </div>\n\n <router-outlet></router-outlet>\n\n <vl-flow-guided-selling *ngIf=\"(isStandalone$ | async) !== true\"></vl-flow-guided-selling>\n</div>\n\n<ng-container *ngIf=\"(isStandalone$ | async) !== true\">\n <vl-flow-doc-gen></vl-flow-doc-gen>\n</ng-container>\n", styles: [":host{display:flex;flex-direction:column;height:100%}.flow-content{flex-grow:1;position:relative;overflow:hidden}.loading-overlay{position:absolute;height:100%;width:100%;inset:0;background-color:#ffffff80;z-index:4}\n"] }]
1551
+ args: [{ selector: 'vl-flow', changeDetection: ChangeDetectionStrategy.OnPush, template: "<vl-flow-header *ngIf=\"showHeader$ | async\"></vl-flow-header>\n\n<div class=\"flow-content\">\n <div class=\"loading-overlay\" *ngIf=\"isLoading$ | async\">\n <vl-loader label=\"LOADING\"></vl-loader>\n </div>\n\n <router-outlet></router-outlet>\n\n <vl-flow-guided-selling *ngIf=\"(isStandalone$ | async) !== true\"></vl-flow-guided-selling>\n</div>\n\n<ng-container *ngIf=\"(isStandalone$ | async) !== true\">\n <vl-flow-doc-gen></vl-flow-doc-gen>\n</ng-container>\n", styles: [":host{display:flex;flex-direction:column;width:100%;height:100%}.flow-content{flex-grow:1;position:relative;overflow:hidden}.loading-overlay{position:absolute;height:100%;width:100%;inset:0;background-color:#fff;z-index:999}\n"] }]
1548
1552
  }], ctorParameters: function () { return [{ type: FlowRouterService }, { type: i1$2.QuoteDraftService }, { type: FlowService }, { type: FlowDocGenService }, { type: i5.IntegrationState }, { type: i1$2.ContextService }]; } });
1549
1553
 
1550
1554
  const getFlowObjectIdPropertyName = (id) => {
@@ -1655,9 +1659,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
1655
1659
  type: Injectable
1656
1660
  }], ctorParameters: function () { return [{ type: i1$1.Router }, { type: FlowRouterService }, { type: i1$2.ContextService }, { type: i1$2.RuntimeSettingsService }]; } });
1657
1661
 
1658
- const isFlowInitialized = (route) => {
1662
+ const initFlow = (route) => {
1659
1663
  const contextService = inject(ContextService);
1660
1664
  const flowService = inject(FlowService);
1665
+ const quoteDraft = inject(QuoteDraftService);
1666
+ const configurationService = inject(ConfigurationService);
1661
1667
  const { flowId } = route.queryParams;
1662
1668
  const flow = flowService.flow;
1663
1669
  if (flow && flow?.id === flowId) {
@@ -1665,6 +1671,8 @@ const isFlowInitialized = (route) => {
1665
1671
  }
1666
1672
  // Cleanup
1667
1673
  contextService.delete();
1674
+ configurationService.reset();
1675
+ quoteDraft.reset();
1668
1676
  if (!flowId) {
1669
1677
  return true;
1670
1678
  }
@@ -2794,8 +2802,8 @@ const rootRoute = {
2794
2802
  id: VELOCE_FLOW_ROOT_ROUTE,
2795
2803
  path: '',
2796
2804
  component: FlowComponent,
2797
- canActivate: [RootGuard, isFlowInitialized],
2798
- canDeactivate: [RootGuard],
2805
+ canActivate: [initFlow],
2806
+ runGuardsAndResolvers: 'always',
2799
2807
  children: [
2800
2808
  {
2801
2809
  path: 'flows',