@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';
@@ -1542,7 +1542,11 @@ class FlowComponent {
1542
1542
  this.integrationState = integrationState;
1543
1543
  this.contextService = contextService;
1544
1544
  this.isLoading$ = this.routerService.loading$;
1545
- this.showHeader$ = combineLatest([this.routerService.route$, this.quoteDraftService.isStandalone$]).pipe(map(([route, isStandalone]) => route.data['showHeader'] && !isStandalone));
1545
+ this.showHeader$ = combineLatest([
1546
+ this.routerService.route$,
1547
+ this.quoteDraftService.isStandalone$,
1548
+ this.contextService.isInitialized$,
1549
+ ]).pipe(map(([route, isStandalone, isContextInited]) => !!isContextInited && this.quoteDraftService.isInitialized && route.data['showHeader'] && !isStandalone));
1546
1550
  this.isStandalone$ = this.quoteDraftService.isStandalone$;
1547
1551
  this.flowService.initSubscriptions();
1548
1552
  }
@@ -1556,10 +1560,10 @@ class FlowComponent {
1556
1560
  }
1557
1561
  }
1558
1562
  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 });
1559
- 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 });
1563
+ 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 });
1560
1564
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowComponent, decorators: [{
1561
1565
  type: Component,
1562
- 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"] }]
1566
+ 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"] }]
1563
1567
  }], ctorParameters: function () { return [{ type: FlowRouterService }, { type: i1$2.QuoteDraftService }, { type: FlowService }, { type: FlowDocGenService }, { type: i5.IntegrationState }, { type: i1$2.ContextService }]; } });
1564
1568
 
1565
1569
  const getFlowObjectIdPropertyName = (id) => {
@@ -1665,9 +1669,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
1665
1669
  type: Injectable
1666
1670
  }], ctorParameters: function () { return [{ type: i1$1.Router }, { type: FlowRouterService }, { type: i1$2.ContextService }, { type: i1$2.RuntimeSettingsService }]; } });
1667
1671
 
1668
- const isFlowInitialized = (route) => {
1672
+ const initFlow = (route) => {
1669
1673
  const contextService = inject(ContextService);
1670
1674
  const flowService = inject(FlowService);
1675
+ const quoteDraft = inject(QuoteDraftService);
1676
+ const configurationService = inject(ConfigurationService);
1671
1677
  const { flowId } = route.queryParams;
1672
1678
  const flow = flowService.flow;
1673
1679
  if (flow && (flow === null || flow === void 0 ? void 0 : flow.id) === flowId) {
@@ -1675,6 +1681,8 @@ const isFlowInitialized = (route) => {
1675
1681
  }
1676
1682
  // Cleanup
1677
1683
  contextService.delete();
1684
+ configurationService.reset();
1685
+ quoteDraft.reset();
1678
1686
  if (!flowId) {
1679
1687
  return true;
1680
1688
  }
@@ -2824,8 +2832,8 @@ const rootRoute = {
2824
2832
  id: VELOCE_FLOW_ROOT_ROUTE,
2825
2833
  path: '',
2826
2834
  component: FlowComponent,
2827
- canActivate: [RootGuard, isFlowInitialized],
2828
- canDeactivate: [RootGuard],
2835
+ canActivate: [initFlow],
2836
+ runGuardsAndResolvers: 'always',
2829
2837
  children: [
2830
2838
  {
2831
2839
  path: 'flows',