@veloceapps/sdk 11.0.0-13 → 11.0.0-130
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/cms/cms.actions.d.ts +94 -29
- package/cms/components/element-renderer/element-renderer.component.d.ts +3 -10
- package/cms/components/preview/preview.component.d.ts +5 -6
- package/cms/components/preview/preview.types.d.ts +0 -4
- package/cms/services/element-context.service.d.ts +0 -1
- package/cms/types/common.types.d.ts +2 -0
- package/cms/types/index.d.ts +0 -1
- package/cms/utils/path.utils.d.ts +1 -2
- package/cms/vendor-map.d.ts +21 -40
- package/core/index.d.ts +1 -1
- package/core/modules/configuration/index.d.ts +4 -4
- package/core/modules/configuration/services/configuration-runtime.service.d.ts +8 -17
- package/core/modules/configuration/services/configuration-state.service.d.ts +5 -4
- package/core/modules/configuration/services/configuration.service.d.ts +24 -47
- package/core/modules/configuration/services/guided-selling.service.d.ts +15 -0
- package/core/modules/configuration/services/test-mode-configuration.service.d.ts +26 -0
- package/core/modules/configuration/types/configuration-runtime.types.d.ts +0 -5
- package/core/modules/configuration/types/configuration.types.d.ts +8 -2
- package/core/modules/configuration/types/index.d.ts +2 -0
- package/core/modules/flow-configuration/index.d.ts +0 -3
- package/core/modules/flow-configuration/services/flow-configuration.service.d.ts +11 -17
- package/core/operators/filter-successful-execute.operator.d.ts +3 -0
- package/core/operators/index.d.ts +1 -0
- package/core/services/flow-info.service.d.ts +11 -9
- package/core/services/flow-state-configuration.service.d.ts +14 -8
- package/core/services/flow-state.service.d.ts +6 -15
- package/core/services/index.d.ts +1 -1
- package/core/services/integration.state.d.ts +1 -1
- package/core/services/product-images.service.d.ts +3 -3
- package/core/services/runtime-settings.service.d.ts +1 -1
- package/core/services/sales-transaction.service.d.ts +9 -10
- package/core/types/flow-customization.types.d.ts +2 -2
- package/core/types/index.d.ts +0 -1
- package/core/utils/index.d.ts +3 -2
- package/core/utils/pcm.utils.d.ts +5 -0
- package/core/utils/transaction-item.utils.d.ts +10 -0
- package/core/utils/transaction-item.worker.d.ts +8 -0
- package/esm2020/cms/cms.actions.mjs +93 -71
- package/esm2020/cms/cms.default.mjs +2 -3
- package/esm2020/cms/components/element-renderer/element-renderer.component.mjs +7 -64
- package/esm2020/cms/components/element-tools-panel/element-tools-panel.component.mjs +3 -3
- package/esm2020/cms/components/preview/preview.component.mjs +19 -28
- package/esm2020/cms/components/preview/preview.types.mjs +1 -1
- package/esm2020/cms/services/element-context.service.mjs +1 -1
- package/esm2020/cms/types/common.types.mjs +1 -1
- package/esm2020/cms/types/index.mjs +1 -2
- package/esm2020/cms/utils/element.utils.mjs +3 -3
- package/esm2020/cms/utils/elements-resolver.mjs +16 -5
- package/esm2020/cms/utils/path.utils.mjs +1 -10
- package/esm2020/cms/vendor-map.mjs +21 -18
- package/esm2020/core/core.module.mjs +3 -6
- package/esm2020/core/index.mjs +2 -2
- package/esm2020/core/modules/configuration/configuration.module.mjs +17 -4
- package/esm2020/core/modules/configuration/index.mjs +5 -5
- package/esm2020/core/modules/configuration/services/configuration-runtime.service.mjs +16 -64
- package/esm2020/core/modules/configuration/services/configuration-state.service.mjs +65 -62
- package/esm2020/core/modules/configuration/services/configuration.service.mjs +123 -229
- package/esm2020/core/modules/configuration/services/guided-selling.service.mjs +62 -0
- package/esm2020/core/modules/configuration/services/test-mode-configuration.service.mjs +97 -0
- package/esm2020/core/modules/configuration/types/configuration-runtime.types.mjs +1 -1
- package/esm2020/core/modules/configuration/types/configuration.types.mjs +1 -1
- package/esm2020/core/modules/configuration/types/index.mjs +3 -0
- package/esm2020/core/modules/flow-configuration/flow-configuration.module.mjs +3 -4
- package/esm2020/core/modules/flow-configuration/index.mjs +1 -4
- package/esm2020/core/modules/flow-configuration/services/flow-configuration.service.mjs +31 -39
- package/esm2020/core/operators/filter-successful-execute.operator.mjs +5 -0
- package/esm2020/core/operators/index.mjs +2 -0
- package/esm2020/core/services/flow-info.service.mjs +31 -22
- package/esm2020/core/services/flow-state-configuration.service.mjs +91 -24
- package/esm2020/core/services/flow-state.service.mjs +34 -82
- package/esm2020/core/services/index.mjs +2 -2
- package/esm2020/core/services/integration.state.mjs +2 -2
- package/esm2020/core/services/product-images.service.mjs +8 -8
- package/esm2020/core/services/runtime-settings.service.mjs +3 -3
- package/esm2020/core/services/sales-transaction.service.mjs +18 -13
- package/esm2020/core/types/flow-customization.types.mjs +1 -1
- package/esm2020/core/types/index.mjs +1 -2
- package/esm2020/core/utils/index.mjs +4 -3
- package/esm2020/core/utils/pcm.utils.mjs +15 -0
- package/esm2020/core/utils/transaction-item.utils.mjs +136 -0
- package/esm2020/core/utils/transaction-item.worker.mjs +16 -0
- package/esm2020/src/components/flow-header/flow-header.component.mjs +7 -8
- package/esm2020/src/components/guided-selling/guided-selling.component.mjs +7 -8
- package/esm2020/src/flow-routing.module.mjs +10 -8
- package/esm2020/src/guards/flow.guard.mjs +5 -7
- package/esm2020/src/guards/product-unload.guard.mjs +10 -8
- package/esm2020/src/index.mjs +1 -2
- package/esm2020/src/pages/assets/assets.component.mjs +7 -8
- package/esm2020/src/pages/catalog/catalog.component.mjs +7 -8
- package/esm2020/src/pages/debug/debug.component.mjs +12 -17
- package/esm2020/src/pages/product/product.component.mjs +39 -69
- package/esm2020/src/pages/record-not-found/record-not-found.component.mjs +5 -6
- package/esm2020/src/pages/shopping-cart/shopping-cart.component.mjs +7 -8
- package/esm2020/src/resolvers/pcm-model.resolver.mjs +12 -0
- package/esm2020/src/resolvers/sales-transaction.resolver.mjs +64 -0
- package/esm2020/src/resolvers/ui-definition.resolver.mjs +44 -0
- package/esm2020/src/services/flow-dialog.service.mjs +3 -24
- package/esm2020/src/services/flow-router.service.mjs +26 -33
- package/esm2020/src/services/flow.service.mjs +11 -17
- package/esm2020/src/types/index.mjs +2 -3
- package/esm2020/src/types/route.types.mjs +1 -1
- package/fesm2015/veloceapps-sdk-cms.mjs +166 -309
- package/fesm2015/veloceapps-sdk-cms.mjs.map +1 -1
- package/fesm2015/veloceapps-sdk-core.mjs +706 -1179
- package/fesm2015/veloceapps-sdk-core.mjs.map +1 -1
- package/fesm2015/veloceapps-sdk.mjs +194 -250
- package/fesm2015/veloceapps-sdk.mjs.map +1 -1
- package/fesm2020/veloceapps-sdk-cms.mjs +162 -300
- package/fesm2020/veloceapps-sdk-cms.mjs.map +1 -1
- package/fesm2020/veloceapps-sdk-core.mjs +764 -1204
- package/fesm2020/veloceapps-sdk-core.mjs.map +1 -1
- package/fesm2020/veloceapps-sdk.mjs +193 -247
- package/fesm2020/veloceapps-sdk.mjs.map +1 -1
- package/package.json +1 -1
- package/src/components/flow-header/flow-header.component.d.ts +3 -3
- package/src/components/guided-selling/guided-selling.component.d.ts +3 -3
- package/src/guards/product-unload.guard.d.ts +3 -3
- package/src/index.d.ts +0 -1
- package/src/pages/assets/assets.component.d.ts +3 -3
- package/src/pages/catalog/catalog.component.d.ts +3 -3
- package/src/pages/debug/debug.component.d.ts +2 -4
- package/src/pages/product/product.component.d.ts +14 -13
- package/src/pages/record-not-found/record-not-found.component.d.ts +2 -3
- package/src/pages/shopping-cart/shopping-cart.component.d.ts +3 -3
- package/src/resolvers/pcm-model.resolver.d.ts +3 -0
- package/src/resolvers/sales-transaction.resolver.d.ts +18 -0
- package/src/resolvers/ui-definition.resolver.d.ts +3 -0
- package/src/services/flow-dialog.service.d.ts +3 -5
- package/src/services/flow-router.service.d.ts +8 -8
- package/src/services/flow.service.d.ts +3 -3
- package/src/types/index.d.ts +1 -2
- package/src/types/route.types.d.ts +0 -5
- package/cms/plugins/configuration.plugin.d.ts +0 -23
- package/cms/types/configuration.types.d.ts +0 -21
- package/core/modules/configuration/helpers.d.ts +0 -7
- package/core/modules/configuration/services/runtime-context.service.d.ts +0 -12
- package/core/modules/flow-configuration/services/flow-update.service.d.ts +0 -13
- package/core/modules/flow-configuration/types/update.types.d.ts +0 -12
- package/core/services/quote-draft.service.d.ts +0 -50
- package/core/types/runtime.types.d.ts +0 -30
- package/core/utils/line-item.utils.d.ts +0 -25
- package/core/utils/line-item.worker.d.ts +0 -9
- package/esm2020/cms/plugins/configuration.plugin.mjs +0 -109
- package/esm2020/cms/types/configuration.types.mjs +0 -2
- package/esm2020/core/modules/configuration/helpers.mjs +0 -67
- package/esm2020/core/modules/configuration/services/runtime-context.service.mjs +0 -45
- package/esm2020/core/modules/flow-configuration/services/flow-update.service.mjs +0 -138
- package/esm2020/core/modules/flow-configuration/types/update.types.mjs +0 -2
- package/esm2020/core/services/quote-draft.service.mjs +0 -174
- package/esm2020/core/types/runtime.types.mjs +0 -16
- package/esm2020/core/utils/line-item.utils.mjs +0 -187
- package/esm2020/core/utils/line-item.worker.mjs +0 -19
- package/esm2020/src/resolvers/quote.resolver.mjs +0 -82
- package/esm2020/src/types/context-route.types.mjs +0 -2
- package/esm2020/src/types/metrics.types.mjs +0 -2
- package/esm2020/src/utils/flow.utils.mjs +0 -14
- package/esm2020/src/utils/index.mjs +0 -2
- package/src/resolvers/quote.resolver.d.ts +0 -18
- package/src/types/context-route.types.d.ts +0 -5
- package/src/types/metrics.types.d.ts +0 -5
- package/src/utils/flow.utils.d.ts +0 -1
- package/src/utils/index.d.ts +0 -1
@@ -2,30 +2,30 @@ import * as i4 from '@angular/common';
|
|
2
2
|
import { CommonModule } from '@angular/common';
|
3
3
|
import * as i0 from '@angular/core';
|
4
4
|
import { Component, ChangeDetectionStrategy, NgModule, Optional, Inject, Injectable, inject } from '@angular/core';
|
5
|
-
import * as i1$3 from '@veloceapps/api';
|
6
5
|
import { ApiModule } from '@veloceapps/api';
|
7
|
-
import * as i2
|
6
|
+
import * as i2 from '@veloceapps/components';
|
8
7
|
import { ToastType, LoaderModule, LetDirectiveModule } from '@veloceapps/components';
|
9
8
|
import * as i5 from '@veloceapps/sdk/cms';
|
10
9
|
import { btoaSafe, PreviewModule, FlowAction, LauncherModule } from '@veloceapps/sdk/cms';
|
11
|
-
import * as
|
12
|
-
import { FLOW_CUSTOMIZATION, RuntimeSettingsService, FlowStateService, FlowInfoService,
|
10
|
+
import * as i3$1 from '@veloceapps/sdk/core';
|
11
|
+
import { FLOW_CUSTOMIZATION, RuntimeSettingsService, FlowStateService, FlowInfoService, SalesTransactionService, ConfigurationService, IntegrationState, ConfigurationRuntimeService, SdkCoreModule } from '@veloceapps/sdk/core';
|
13
12
|
import * as i3 from 'primeng/button';
|
14
13
|
import { ButtonModule } from 'primeng/button';
|
15
14
|
import * as i1 from 'primeng/dynamicdialog';
|
16
15
|
import * as i1$1 from '@veloceapps/api/v2';
|
17
|
-
import {
|
16
|
+
import { UIDefinitionsAdminApiService } from '@veloceapps/api/v2';
|
17
|
+
import { BehaviorSubject, Subject, filter, first, tap, takeUntil, catchError, of, map, switchMap, shareReplay, startWith, distinctUntilChanged, from, take, combineLatest } from 'rxjs';
|
18
18
|
import { DomHandler } from 'primeng/dom';
|
19
19
|
import * as i1$2 from '@angular/router';
|
20
20
|
import { NavigationEnd, NavigationStart, NavigationCancel, NavigationError, RouterModule } from '@angular/router';
|
21
|
-
import { mapShoppingCartSettings, getMaxRenewalTermsValue,
|
21
|
+
import { mapShoppingCartSettings, getMaxRenewalTermsValue, SalesforceIdUtils, UITemplateType, isVeloceError, extractErrorDetails } from '@veloceapps/core';
|
22
22
|
import { HttpErrorResponse, HttpParams } from '@angular/common/http';
|
23
|
-
import * as
|
23
|
+
import * as i4$1 from '@angular/forms';
|
24
24
|
import { FormGroup, FormControl, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
25
25
|
import { DropdownModule } from 'primeng/dropdown';
|
26
|
-
import * as
|
26
|
+
import * as i7 from 'primeng/inputtext';
|
27
27
|
import { InputTextModule } from 'primeng/inputtext';
|
28
|
-
import * as
|
28
|
+
import * as i5$1 from 'primeng/radiobutton';
|
29
29
|
import { RadioButtonModule } from 'primeng/radiobutton';
|
30
30
|
import { catchError as catchError$1 } from 'rxjs/operators';
|
31
31
|
|
@@ -76,8 +76,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
|
|
76
76
|
}] });
|
77
77
|
|
78
78
|
class FlowHeaderComponent {
|
79
|
-
constructor(
|
80
|
-
this.
|
79
|
+
constructor(templatesAdminApiService, flowStateService, flowInfo, toastService, customizationService) {
|
80
|
+
this.templatesAdminApiService = templatesAdminApiService;
|
81
81
|
this.flowStateService = flowStateService;
|
82
82
|
this.flowInfo = flowInfo;
|
83
83
|
this.toastService = toastService;
|
@@ -131,7 +131,7 @@ class FlowHeaderComponent {
|
|
131
131
|
if (!template) {
|
132
132
|
return of(undefined);
|
133
133
|
}
|
134
|
-
return this.
|
134
|
+
return this.templatesAdminApiService.fetchComponentsAttachments$(template.id);
|
135
135
|
}
|
136
136
|
generateUIDefinition$() {
|
137
137
|
return of(undefined).pipe(tap(() => {
|
@@ -145,7 +145,6 @@ class FlowHeaderComponent {
|
|
145
145
|
const uiDef = {
|
146
146
|
name: '',
|
147
147
|
createdTimestamp: 0,
|
148
|
-
primary: true,
|
149
148
|
type: 'DEFAULT',
|
150
149
|
version: 2,
|
151
150
|
children: metaList.map(meta => ({
|
@@ -159,12 +158,12 @@ class FlowHeaderComponent {
|
|
159
158
|
}));
|
160
159
|
}
|
161
160
|
}
|
162
|
-
FlowHeaderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowHeaderComponent, deps: [{ token: i1$1.
|
161
|
+
FlowHeaderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowHeaderComponent, deps: [{ token: i1$1.UITemplatesAdminApiService }, { token: i3$1.FlowStateService }, { token: i3$1.FlowInfoService }, { token: i2.ToastService }, { token: FLOW_CUSTOMIZATION, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
163
162
|
FlowHeaderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: FlowHeaderComponent, selector: "vl-flow-new-header", ngImport: i0, template: "<ng-container *ngIf=\"uiDefinition$ | async as uiDefinition\">\n <vl-cms-preview [uiDefinition]=\"uiDefinition\"></vl-cms-preview>\n</ng-container>\n", styles: [":host,vl-cms-preview{display:contents}\n"], dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5.PreviewComponent, selector: "vl-cms-preview", inputs: ["uiDefinition", "config"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
164
163
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowHeaderComponent, decorators: [{
|
165
164
|
type: Component,
|
166
165
|
args: [{ selector: 'vl-flow-new-header', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngIf=\"uiDefinition$ | async as uiDefinition\">\n <vl-cms-preview [uiDefinition]=\"uiDefinition\"></vl-cms-preview>\n</ng-container>\n", styles: [":host,vl-cms-preview{display:contents}\n"] }]
|
167
|
-
}], ctorParameters: function () { return [{ type: i1$1.
|
166
|
+
}], ctorParameters: function () { return [{ type: i1$1.UITemplatesAdminApiService }, { type: i3$1.FlowStateService }, { type: i3$1.FlowInfoService }, { type: i2.ToastService }, { type: undefined, decorators: [{
|
168
167
|
type: Optional
|
169
168
|
}, {
|
170
169
|
type: Inject,
|
@@ -186,8 +185,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
|
|
186
185
|
}] });
|
187
186
|
|
188
187
|
class GuidedSellingComponent {
|
189
|
-
constructor(
|
190
|
-
this.
|
188
|
+
constructor(templatesAdminApiService, flowStateService, flowInfo, toastService, customizationService) {
|
189
|
+
this.templatesAdminApiService = templatesAdminApiService;
|
191
190
|
this.flowStateService = flowStateService;
|
192
191
|
this.flowInfo = flowInfo;
|
193
192
|
this.toastService = toastService;
|
@@ -241,7 +240,7 @@ class GuidedSellingComponent {
|
|
241
240
|
if (!template) {
|
242
241
|
return of(undefined);
|
243
242
|
}
|
244
|
-
return this.
|
243
|
+
return this.templatesAdminApiService.fetchComponentsAttachments$(template.id);
|
245
244
|
}
|
246
245
|
generateUIDefinition$() {
|
247
246
|
return of(undefined).pipe(tap(() => {
|
@@ -255,7 +254,6 @@ class GuidedSellingComponent {
|
|
255
254
|
const uiDef = {
|
256
255
|
name: '',
|
257
256
|
createdTimestamp: 0,
|
258
|
-
primary: true,
|
259
257
|
type: 'DEFAULT',
|
260
258
|
version: 2,
|
261
259
|
children: metaList.map(meta => ({
|
@@ -269,12 +267,12 @@ class GuidedSellingComponent {
|
|
269
267
|
}));
|
270
268
|
}
|
271
269
|
}
|
272
|
-
GuidedSellingComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: GuidedSellingComponent, deps: [{ token: i1$1.
|
270
|
+
GuidedSellingComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: GuidedSellingComponent, deps: [{ token: i1$1.UITemplatesAdminApiService }, { token: i3$1.FlowStateService }, { token: i3$1.FlowInfoService }, { token: i2.ToastService }, { token: FLOW_CUSTOMIZATION, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
273
271
|
GuidedSellingComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: GuidedSellingComponent, selector: "vl-flow-guided-selling", ngImport: i0, template: "<ng-container *ngIf=\"uiDefinition$ | async as uiDefinition\">\n <vl-cms-preview [uiDefinition]=\"uiDefinition\"></vl-cms-preview>\n</ng-container>\n", styles: [":host,vl-cms-preview{display:contents}\n"], dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5.PreviewComponent, selector: "vl-cms-preview", inputs: ["uiDefinition", "config"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
274
272
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: GuidedSellingComponent, decorators: [{
|
275
273
|
type: Component,
|
276
274
|
args: [{ selector: 'vl-flow-guided-selling', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngIf=\"uiDefinition$ | async as uiDefinition\">\n <vl-cms-preview [uiDefinition]=\"uiDefinition\"></vl-cms-preview>\n</ng-container>\n", styles: [":host,vl-cms-preview{display:contents}\n"] }]
|
277
|
-
}], ctorParameters: function () { return [{ type: i1$1.
|
275
|
+
}], ctorParameters: function () { return [{ type: i1$1.UITemplatesAdminApiService }, { type: i3$1.FlowStateService }, { type: i3$1.FlowInfoService }, { type: i2.ToastService }, { type: undefined, decorators: [{
|
278
276
|
type: Optional
|
279
277
|
}, {
|
280
278
|
type: Inject,
|
@@ -367,10 +365,10 @@ class FlowDialogService {
|
|
367
365
|
primaryButton: 'Ok',
|
368
366
|
});
|
369
367
|
}
|
370
|
-
|
368
|
+
showQuoteInConfiguratorDialog() {
|
371
369
|
return this.show({
|
372
370
|
title: 'Quote Cannot be Saved',
|
373
|
-
description: 'It
|
371
|
+
description: 'It not possible to save quotes from the Configurator. To proceed, finish configuring product.',
|
374
372
|
primaryButton: 'Ok',
|
375
373
|
});
|
376
374
|
}
|
@@ -390,27 +388,6 @@ class FlowDialogService {
|
|
390
388
|
oppositeButtonActions: true,
|
391
389
|
});
|
392
390
|
}
|
393
|
-
showReadonlyQuoteSubmitFailureDialog() {
|
394
|
-
return this.show({
|
395
|
-
title: 'Cannot Submit for Approval',
|
396
|
-
description: 'It is only possible to submit for approval quotes with the “Draft“ status. Please create a new quote to proceed.',
|
397
|
-
primaryButton: 'Ok',
|
398
|
-
});
|
399
|
-
}
|
400
|
-
showOutsideShoppingCartQuoteSubmitFailureDialog() {
|
401
|
-
return this.show({
|
402
|
-
title: 'Cannot Submit for Approval',
|
403
|
-
description: 'It is only possible to submit quotes for approval from the Shopping Cart. To proceed, go to the Shopping Cart.',
|
404
|
-
primaryButton: 'Ok',
|
405
|
-
});
|
406
|
-
}
|
407
|
-
showAccountSubmitFailureDialog() {
|
408
|
-
return this.show({
|
409
|
-
title: 'Save Changes',
|
410
|
-
description: 'To submit for approval, save the quote first, and then submit it for approval from the Shopping Cart.',
|
411
|
-
primaryButton: 'Ok',
|
412
|
-
});
|
413
|
-
}
|
414
391
|
showTermsLimitReachedDialog() {
|
415
392
|
const shoppingCartSettings = mapShoppingCartSettings(this.runtimeSettings.getShoppingCartSettings() || []);
|
416
393
|
const maxRenewalTerms = getMaxRenewalTermsValue(shoppingCartSettings);
|
@@ -425,18 +402,18 @@ class FlowDialogService {
|
|
425
402
|
return dialogFunction(dialog);
|
426
403
|
}
|
427
404
|
}
|
428
|
-
FlowDialogService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowDialogService, deps: [{ token: i1.DialogService }, { token:
|
405
|
+
FlowDialogService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowDialogService, deps: [{ token: i1.DialogService }, { token: i3$1.RuntimeSettingsService }, { token: i3$1.FlowInfoService }], target: i0.ɵɵFactoryTarget.Injectable });
|
429
406
|
FlowDialogService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowDialogService });
|
430
407
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowDialogService, decorators: [{
|
431
408
|
type: Injectable
|
432
|
-
}], ctorParameters: function () { return [{ type: i1.DialogService }, { type:
|
409
|
+
}], ctorParameters: function () { return [{ type: i1.DialogService }, { type: i3$1.RuntimeSettingsService }, { type: i3$1.FlowInfoService }]; } });
|
433
410
|
|
434
411
|
class FlowRouterService {
|
435
|
-
constructor(router, route, integrationState,
|
412
|
+
constructor(router, route, integrationState, flowInfoService) {
|
436
413
|
this.router = router;
|
437
414
|
this.route = route;
|
438
415
|
this.integrationState = integrationState;
|
439
|
-
this.
|
416
|
+
this.flowInfoService = flowInfoService;
|
440
417
|
this.urlHistory = [];
|
441
418
|
this.getLastChildRoute = (route) => {
|
442
419
|
return route.firstChild ? this.getLastChildRoute(route.firstChild) : route;
|
@@ -479,6 +456,15 @@ class FlowRouterService {
|
|
479
456
|
this.integrationState.dispatch(FlowAction.CloseGuidedSelling({ keepState: true }));
|
480
457
|
});
|
481
458
|
}
|
459
|
+
get route$() {
|
460
|
+
return this.lastChildRoute$;
|
461
|
+
}
|
462
|
+
get params$() {
|
463
|
+
return this.lastChildParams$;
|
464
|
+
}
|
465
|
+
get params() {
|
466
|
+
return this.getLastChildParams(this.route.snapshot);
|
467
|
+
}
|
482
468
|
getFlowRootRoute(route) {
|
483
469
|
const path = [...route.pathFromRoot];
|
484
470
|
while (path.length) {
|
@@ -503,15 +489,6 @@ class FlowRouterService {
|
|
503
489
|
.join('/');
|
504
490
|
return '/' + path;
|
505
491
|
}
|
506
|
-
get route$() {
|
507
|
-
return this.lastChildRoute$;
|
508
|
-
}
|
509
|
-
get params$() {
|
510
|
-
return this.lastChildParams$;
|
511
|
-
}
|
512
|
-
get params() {
|
513
|
-
return this.getLastChildParams(this.route.snapshot);
|
514
|
-
}
|
515
492
|
isConfigurationRoute$() {
|
516
493
|
return this.getFlowSubpath$().pipe(map(url => url.startsWith('product')));
|
517
494
|
}
|
@@ -530,7 +507,7 @@ class FlowRouterService {
|
|
530
507
|
this.router.navigateByUrl(prevUrl);
|
531
508
|
}
|
532
509
|
}
|
533
|
-
navigateTo(path, productId,
|
510
|
+
navigateTo(path, productId, transactionItemId) {
|
534
511
|
if (path === 'shopping-cart') {
|
535
512
|
this.navigateToShoppingCart();
|
536
513
|
}
|
@@ -541,23 +518,16 @@ class FlowRouterService {
|
|
541
518
|
this.navigateToAssets();
|
542
519
|
}
|
543
520
|
else if (path === 'product' && productId) {
|
544
|
-
this.navigateToProductConfiguration(productId,
|
521
|
+
this.navigateToProductConfiguration(productId, transactionItemId);
|
545
522
|
}
|
546
523
|
}
|
547
|
-
navigateToProductConfiguration(productId,
|
548
|
-
this.
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
-
const routeSnapshot = this.getLastChildRouteSnapshot(this.route.snapshot);
|
555
|
-
const flowRouteUrl = this.getFlowRootPath(routeSnapshot);
|
556
|
-
this.router.navigate([flowRouteUrl, 'product'], {
|
557
|
-
queryParams: { ...routeSnapshot.queryParams, productId },
|
558
|
-
});
|
559
|
-
}))
|
560
|
-
.subscribe();
|
524
|
+
navigateToProductConfiguration(productId, transactionItemId) {
|
525
|
+
this.flowInfoService.updateContext({ productId, transactionItemId });
|
526
|
+
const routeSnapshot = this.getLastChildRouteSnapshot(this.route.snapshot);
|
527
|
+
const flowRouteUrl = this.getFlowRootPath(routeSnapshot);
|
528
|
+
this.router.navigate([flowRouteUrl, 'product'], {
|
529
|
+
queryParams: { ...routeSnapshot.queryParams, productId, transactionItemId },
|
530
|
+
});
|
561
531
|
}
|
562
532
|
navigateToShoppingCart() {
|
563
533
|
const routeSnapshot = this.getLastChildRouteSnapshot(this.route.snapshot);
|
@@ -594,21 +564,22 @@ class FlowRouterService {
|
|
594
564
|
this.router.navigate([], { relativeTo: route, queryParams: { ...routeSnapshot.queryParams, ...queryParams } });
|
595
565
|
}
|
596
566
|
}
|
597
|
-
FlowRouterService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowRouterService, deps: [{ token: i1$2.Router }, { token: i1$2.ActivatedRoute }, { token:
|
567
|
+
FlowRouterService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowRouterService, deps: [{ token: i1$2.Router }, { token: i1$2.ActivatedRoute }, { token: i3$1.IntegrationState }, { token: i3$1.FlowInfoService }], target: i0.ɵɵFactoryTarget.Injectable });
|
598
568
|
FlowRouterService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowRouterService, providedIn: 'root' });
|
599
569
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowRouterService, decorators: [{
|
600
570
|
type: Injectable,
|
601
571
|
args: [{ providedIn: 'root' }]
|
602
|
-
}], ctorParameters: function () { return [{ type: i1$2.Router }, { type: i1$2.ActivatedRoute }, { type:
|
572
|
+
}], ctorParameters: function () { return [{ type: i1$2.Router }, { type: i1$2.ActivatedRoute }, { type: i3$1.IntegrationState }, { type: i3$1.FlowInfoService }]; } });
|
603
573
|
|
604
574
|
class FlowService {
|
605
|
-
constructor(integrationState, flowRouterService, configurationService, configurationStateService, flowDialogService, flowStateService) {
|
575
|
+
constructor(integrationState, flowRouterService, configurationService, configurationStateService, flowDialogService, flowStateService, flowInfoService) {
|
606
576
|
this.integrationState = integrationState;
|
607
577
|
this.flowRouterService = flowRouterService;
|
608
578
|
this.configurationService = configurationService;
|
609
579
|
this.configurationStateService = configurationStateService;
|
610
580
|
this.flowDialogService = flowDialogService;
|
611
581
|
this.flowStateService = flowStateService;
|
582
|
+
this.flowInfoService = flowInfoService;
|
612
583
|
this.cleanup$ = new Subject();
|
613
584
|
}
|
614
585
|
cleanup() {
|
@@ -617,9 +588,10 @@ class FlowService {
|
|
617
588
|
initSubscriptions() {
|
618
589
|
this.integrationState
|
619
590
|
.listen$(FlowAction.FLOW_CONFIGURE_PRODUCT)
|
620
|
-
.pipe(
|
591
|
+
.pipe(tap(payload => {
|
621
592
|
if (payload.productId) {
|
622
|
-
this.
|
593
|
+
this.flowInfoService.updateContext({ newProductQty: payload.qty });
|
594
|
+
this.flowRouterService.navigateToProductConfiguration(payload.productId, payload.transactionItemId);
|
623
595
|
}
|
624
596
|
else {
|
625
597
|
console.warn("Parameter 'productId' is needed to start configuration");
|
@@ -643,7 +615,7 @@ class FlowService {
|
|
643
615
|
this.integrationState.dispatch(FlowAction.ConfigureProductAction(payload));
|
644
616
|
}
|
645
617
|
else {
|
646
|
-
this.flowRouterService.navigateTo(payload.path, payload.productId, payload.
|
618
|
+
this.flowRouterService.navigateTo(payload.path, payload.productId, payload.transactionItemId);
|
647
619
|
}
|
648
620
|
}), takeUntil(this.cleanup$))
|
649
621
|
.subscribe();
|
@@ -682,20 +654,12 @@ class FlowService {
|
|
682
654
|
.pipe(map(path => path.queryParams['productId']), takeUntil(this.cleanup$))
|
683
655
|
.subscribe(productId => this.integrationState.patchState({ productId }));
|
684
656
|
}
|
685
|
-
prepareConfiguration$(lineItemId) {
|
686
|
-
if (!lineItemId) {
|
687
|
-
return of(undefined);
|
688
|
-
}
|
689
|
-
return this.flowStateService.dispatch$(UITemplateType.FLOW_ENGINE, 'UPDATE_PRICE_LIST', {
|
690
|
-
lineItemId,
|
691
|
-
});
|
692
|
-
}
|
693
657
|
}
|
694
|
-
FlowService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowService, deps: [{ token: i5.IntegrationState }, { token: FlowRouterService }, { token:
|
658
|
+
FlowService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowService, deps: [{ token: i5.IntegrationState }, { token: FlowRouterService }, { token: i3$1.ConfigurationService }, { token: i3$1.ConfigurationStateService }, { token: FlowDialogService }, { token: i3$1.FlowStateService }, { token: i3$1.FlowInfoService }], target: i0.ɵɵFactoryTarget.Injectable });
|
695
659
|
FlowService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowService });
|
696
660
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowService, decorators: [{
|
697
661
|
type: Injectable
|
698
|
-
}], ctorParameters: function () { return [{ type: i5.IntegrationState }, { type: FlowRouterService }, { type:
|
662
|
+
}], ctorParameters: function () { return [{ type: i5.IntegrationState }, { type: FlowRouterService }, { type: i3$1.ConfigurationService }, { type: i3$1.ConfigurationStateService }, { type: FlowDialogService }, { type: i3$1.FlowStateService }, { type: i3$1.FlowInfoService }]; } });
|
699
663
|
|
700
664
|
class FlowGuidedSellingService {
|
701
665
|
constructor(integrationState) {
|
@@ -719,11 +683,11 @@ class FlowGuidedSellingService {
|
|
719
683
|
.subscribe();
|
720
684
|
}
|
721
685
|
}
|
722
|
-
FlowGuidedSellingService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowGuidedSellingService, deps: [{ token:
|
686
|
+
FlowGuidedSellingService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowGuidedSellingService, deps: [{ token: i3$1.IntegrationState }], target: i0.ɵɵFactoryTarget.Injectable });
|
723
687
|
FlowGuidedSellingService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowGuidedSellingService });
|
724
688
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowGuidedSellingService, decorators: [{
|
725
689
|
type: Injectable
|
726
|
-
}], ctorParameters: function () { return [{ type:
|
690
|
+
}], ctorParameters: function () { return [{ type: i3$1.IntegrationState }]; } });
|
727
691
|
|
728
692
|
class FlowComponent {
|
729
693
|
constructor(routerService, flowService, flowInfoService, guidedSellingService) {
|
@@ -741,19 +705,18 @@ class FlowComponent {
|
|
741
705
|
this.flowService.cleanup();
|
742
706
|
}
|
743
707
|
}
|
744
|
-
FlowComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowComponent, deps: [{ token: FlowRouterService }, { token: FlowService }, { token:
|
745
|
-
FlowComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: FlowComponent, selector: "vl-flow", ngImport: i0, template: "<vl-flow-new-header *ngIf=\"showHeader$ | async\"></vl-flow-new-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 <div class=\"guided-selling\" [ngClass]=\"{ hidden: (guidedSellingVisible$ | async) === false }\">\n <vl-flow-guided-selling *ngIf=\"(isStandalone$ | async) !== true\"></vl-flow-guided-selling>\n </div>\n</div>\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}.guided-selling{position:absolute;top:0;width:100%;height:100%;z-index:100}.hidden{display:none}\n"], dependencies: [{ kind: "directive", type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$2.RouterOutlet, selector: "router-outlet", inputs: ["name"], outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }, { kind: "component", type: i2
|
708
|
+
FlowComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowComponent, deps: [{ token: FlowRouterService }, { token: FlowService }, { token: i3$1.FlowInfoService }, { token: FlowGuidedSellingService }], target: i0.ɵɵFactoryTarget.Component });
|
709
|
+
FlowComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: FlowComponent, selector: "vl-flow", ngImport: i0, template: "<vl-flow-new-header *ngIf=\"showHeader$ | async\"></vl-flow-new-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 <div class=\"guided-selling\" [ngClass]=\"{ hidden: (guidedSellingVisible$ | async) === false }\">\n <vl-flow-guided-selling *ngIf=\"(isStandalone$ | async) !== true\"></vl-flow-guided-selling>\n </div>\n</div>\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}.guided-selling{position:absolute;top:0;width:100%;height:100%;z-index:100}.hidden{display:none}\n"], dependencies: [{ kind: "directive", type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$2.RouterOutlet, selector: "router-outlet", inputs: ["name"], outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }, { kind: "component", type: i2.LoaderComponent, selector: "vl-loader", inputs: ["label", "overlayVisible"] }, { kind: "component", type: FlowHeaderComponent, selector: "vl-flow-new-header" }, { kind: "component", type: GuidedSellingComponent, selector: "vl-flow-guided-selling" }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
746
710
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowComponent, decorators: [{
|
747
711
|
type: Component,
|
748
712
|
args: [{ selector: 'vl-flow', changeDetection: ChangeDetectionStrategy.OnPush, template: "<vl-flow-new-header *ngIf=\"showHeader$ | async\"></vl-flow-new-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 <div class=\"guided-selling\" [ngClass]=\"{ hidden: (guidedSellingVisible$ | async) === false }\">\n <vl-flow-guided-selling *ngIf=\"(isStandalone$ | async) !== true\"></vl-flow-guided-selling>\n </div>\n</div>\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}.guided-selling{position:absolute;top:0;width:100%;height:100%;z-index:100}.hidden{display:none}\n"] }]
|
749
|
-
}], ctorParameters: function () { return [{ type: FlowRouterService }, { type: FlowService }, { type:
|
713
|
+
}], ctorParameters: function () { return [{ type: FlowRouterService }, { type: FlowService }, { type: i3$1.FlowInfoService }, { type: FlowGuidedSellingService }]; } });
|
750
714
|
|
751
715
|
const keepFlowInitialized = (route) => {
|
752
716
|
const routerService = inject(FlowRouterService);
|
753
717
|
const runtimeSettingsService = inject(RuntimeSettingsService);
|
754
718
|
const flowState = inject(FlowStateService);
|
755
719
|
const flowInfoService = inject(FlowInfoService);
|
756
|
-
const quoteDraft = inject(QuoteDraftService);
|
757
720
|
const salesTrasnsactionService = inject(SalesTransactionService);
|
758
721
|
const configurationService = inject(ConfigurationService);
|
759
722
|
const integrationState = inject(IntegrationState);
|
@@ -762,12 +725,11 @@ const keepFlowInitialized = (route) => {
|
|
762
725
|
return true;
|
763
726
|
}
|
764
727
|
// Cleanup
|
765
|
-
flowState.
|
766
|
-
quoteDraft.reset();
|
728
|
+
flowState.reset();
|
767
729
|
salesTrasnsactionService.reset();
|
768
730
|
configurationService.reset();
|
769
|
-
integrationState.
|
770
|
-
flowInfoService.
|
731
|
+
integrationState.reset();
|
732
|
+
flowInfoService.reset();
|
771
733
|
if (!flowId) {
|
772
734
|
return true;
|
773
735
|
}
|
@@ -780,21 +742,23 @@ const keepFlowInitialized = (route) => {
|
|
780
742
|
};
|
781
743
|
|
782
744
|
class ProductUnloadGuard {
|
783
|
-
constructor(router,
|
745
|
+
constructor(router, flowInfoService, configurationService, flowDialogService) {
|
784
746
|
this.router = router;
|
785
|
-
this.
|
747
|
+
this.flowInfoService = flowInfoService;
|
786
748
|
this.configurationService = configurationService;
|
787
749
|
this.flowDialogService = flowDialogService;
|
788
750
|
}
|
789
751
|
canDeactivate(_, route, currentState, nextState) {
|
790
752
|
let observable = of(true);
|
791
|
-
if (!this.
|
753
|
+
if (!this.flowInfoService.flow.properties.standalone && this.configurationService.hasUnsavedChanges) {
|
792
754
|
observable = this.flowDialogService.showUnsavedChangesDialog();
|
793
755
|
}
|
794
756
|
return observable.pipe(map(unload => {
|
795
757
|
if (unload) {
|
796
758
|
this.configurationService.reset();
|
797
|
-
|
759
|
+
const currentUrl = currentState.url.split('?')[0];
|
760
|
+
const nextUrl = (nextState?.url ?? '').split('?')[0];
|
761
|
+
if (!nextState || currentUrl === nextUrl) {
|
798
762
|
return true;
|
799
763
|
}
|
800
764
|
// clear obsolete queryParams
|
@@ -811,11 +775,11 @@ class ProductUnloadGuard {
|
|
811
775
|
}));
|
812
776
|
}
|
813
777
|
}
|
814
|
-
ProductUnloadGuard.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProductUnloadGuard, deps: [{ token: i1$2.Router }, { token:
|
778
|
+
ProductUnloadGuard.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProductUnloadGuard, deps: [{ token: i1$2.Router }, { token: i3$1.FlowInfoService }, { token: i3$1.ConfigurationService }, { token: FlowDialogService }], target: i0.ɵɵFactoryTarget.Injectable });
|
815
779
|
ProductUnloadGuard.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProductUnloadGuard });
|
816
780
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProductUnloadGuard, decorators: [{
|
817
781
|
type: Injectable
|
818
|
-
}], ctorParameters: function () { return [{ type: i1$2.Router }, { type:
|
782
|
+
}], ctorParameters: function () { return [{ type: i1$2.Router }, { type: i3$1.FlowInfoService }, { type: i3$1.ConfigurationService }, { type: FlowDialogService }]; } });
|
819
783
|
|
820
784
|
class RootGuard {
|
821
785
|
constructor(router, routerService) {
|
@@ -858,8 +822,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
|
|
858
822
|
}], ctorParameters: function () { return [{ type: i1$2.Router }, { type: FlowRouterService }]; } });
|
859
823
|
|
860
824
|
class AssetsComponent {
|
861
|
-
constructor(
|
862
|
-
this.
|
825
|
+
constructor(templatesAdminApiService, cdr, toastService, flowInfo, customizationService) {
|
826
|
+
this.templatesAdminApiService = templatesAdminApiService;
|
863
827
|
this.cdr = cdr;
|
864
828
|
this.toastService = toastService;
|
865
829
|
this.flowInfo = flowInfo;
|
@@ -912,7 +876,7 @@ class AssetsComponent {
|
|
912
876
|
if (!template) {
|
913
877
|
return of(undefined);
|
914
878
|
}
|
915
|
-
return this.
|
879
|
+
return this.templatesAdminApiService.fetchComponentsAttachments$(template.id);
|
916
880
|
}
|
917
881
|
generateUIDefinition$() {
|
918
882
|
return of(undefined).pipe(tap(() => {
|
@@ -926,7 +890,6 @@ class AssetsComponent {
|
|
926
890
|
const uiDef = {
|
927
891
|
name: '',
|
928
892
|
createdTimestamp: 0,
|
929
|
-
primary: true,
|
930
893
|
type: 'DEFAULT',
|
931
894
|
version: 2,
|
932
895
|
children: metaList.map(meta => ({
|
@@ -940,12 +903,12 @@ class AssetsComponent {
|
|
940
903
|
}));
|
941
904
|
}
|
942
905
|
}
|
943
|
-
AssetsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: AssetsComponent, deps: [{ token: i1$1.
|
944
|
-
AssetsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: AssetsComponent, selector: "vl-flow-assets", ngImport: i0, template: "<ng-container *ngIf=\"state$ | async as state\">\n <vl-loader *ngIf=\"state.loading; else content\" [label]=\"'Loading UI'\"></vl-loader>\n\n <ng-template #content>\n <ng-container *ngIf=\"!state.failure\">\n <vl-cms-preview [uiDefinition]=\"uiDefinition\"></vl-cms-preview>\n </ng-container>\n </ng-template>\n</ng-container>\n", styles: [""], dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5.PreviewComponent, selector: "vl-cms-preview", inputs: ["uiDefinition", "config"] }, { kind: "component", type: i2
|
906
|
+
AssetsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: AssetsComponent, deps: [{ token: i1$1.UITemplatesAdminApiService }, { token: i0.ChangeDetectorRef }, { token: i2.ToastService }, { token: i3$1.FlowInfoService }, { token: FLOW_CUSTOMIZATION, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
907
|
+
AssetsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: AssetsComponent, selector: "vl-flow-assets", ngImport: i0, template: "<ng-container *ngIf=\"state$ | async as state\">\n <vl-loader *ngIf=\"state.loading; else content\" [label]=\"'Loading UI'\"></vl-loader>\n\n <ng-template #content>\n <ng-container *ngIf=\"!state.failure\">\n <vl-cms-preview [uiDefinition]=\"uiDefinition\"></vl-cms-preview>\n </ng-container>\n </ng-template>\n</ng-container>\n", styles: [""], dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5.PreviewComponent, selector: "vl-cms-preview", inputs: ["uiDefinition", "config"] }, { kind: "component", type: i2.LoaderComponent, selector: "vl-loader", inputs: ["label", "overlayVisible"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
945
908
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: AssetsComponent, decorators: [{
|
946
909
|
type: Component,
|
947
910
|
args: [{ selector: 'vl-flow-assets', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngIf=\"state$ | async as state\">\n <vl-loader *ngIf=\"state.loading; else content\" [label]=\"'Loading UI'\"></vl-loader>\n\n <ng-template #content>\n <ng-container *ngIf=\"!state.failure\">\n <vl-cms-preview [uiDefinition]=\"uiDefinition\"></vl-cms-preview>\n </ng-container>\n </ng-template>\n</ng-container>\n" }]
|
948
|
-
}], ctorParameters: function () { return [{ type: i1$1.
|
911
|
+
}], ctorParameters: function () { return [{ type: i1$1.UITemplatesAdminApiService }, { type: i0.ChangeDetectorRef }, { type: i2.ToastService }, { type: i3$1.FlowInfoService }, { type: undefined, decorators: [{
|
949
912
|
type: Optional
|
950
913
|
}, {
|
951
914
|
type: Inject,
|
@@ -967,8 +930,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
|
|
967
930
|
}] });
|
968
931
|
|
969
932
|
class CatalogComponent {
|
970
|
-
constructor(
|
971
|
-
this.
|
933
|
+
constructor(templatesAdminApiService, cdr, toastService, flowInfo, customizationService) {
|
934
|
+
this.templatesAdminApiService = templatesAdminApiService;
|
972
935
|
this.cdr = cdr;
|
973
936
|
this.toastService = toastService;
|
974
937
|
this.flowInfo = flowInfo;
|
@@ -1021,7 +984,7 @@ class CatalogComponent {
|
|
1021
984
|
if (!template) {
|
1022
985
|
return of(undefined);
|
1023
986
|
}
|
1024
|
-
return this.
|
987
|
+
return this.templatesAdminApiService.fetchComponentsAttachments$(template.id);
|
1025
988
|
}
|
1026
989
|
generateUIDefinition$() {
|
1027
990
|
return of(undefined).pipe(tap(() => {
|
@@ -1035,7 +998,6 @@ class CatalogComponent {
|
|
1035
998
|
const uiDef = {
|
1036
999
|
name: '',
|
1037
1000
|
createdTimestamp: 0,
|
1038
|
-
primary: true,
|
1039
1001
|
type: 'DEFAULT',
|
1040
1002
|
version: 2,
|
1041
1003
|
children: metaList.map(meta => ({
|
@@ -1049,12 +1011,12 @@ class CatalogComponent {
|
|
1049
1011
|
}));
|
1050
1012
|
}
|
1051
1013
|
}
|
1052
|
-
CatalogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: CatalogComponent, deps: [{ token: i1$1.
|
1053
|
-
CatalogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: CatalogComponent, selector: "vl-flow-catalog", ngImport: i0, template: "<ng-container *ngIf=\"state$ | async as state\">\n <vl-loader *ngIf=\"state.loading; else content\" [label]=\"'Loading UI'\"></vl-loader>\n\n <ng-template #content>\n <ng-container *ngIf=\"!state.failure\">\n <vl-cms-preview [uiDefinition]=\"uiDefinition\"></vl-cms-preview>\n </ng-container>\n </ng-template>\n</ng-container>\n", styles: [""], dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5.PreviewComponent, selector: "vl-cms-preview", inputs: ["uiDefinition", "config"] }, { kind: "component", type: i2
|
1014
|
+
CatalogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: CatalogComponent, deps: [{ token: i1$1.UITemplatesAdminApiService }, { token: i0.ChangeDetectorRef }, { token: i2.ToastService }, { token: i3$1.FlowInfoService }, { token: FLOW_CUSTOMIZATION, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
1015
|
+
CatalogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: CatalogComponent, selector: "vl-flow-catalog", ngImport: i0, template: "<ng-container *ngIf=\"state$ | async as state\">\n <vl-loader *ngIf=\"state.loading; else content\" [label]=\"'Loading UI'\"></vl-loader>\n\n <ng-template #content>\n <ng-container *ngIf=\"!state.failure\">\n <vl-cms-preview [uiDefinition]=\"uiDefinition\"></vl-cms-preview>\n </ng-container>\n </ng-template>\n</ng-container>\n", styles: [""], dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5.PreviewComponent, selector: "vl-cms-preview", inputs: ["uiDefinition", "config"] }, { kind: "component", type: i2.LoaderComponent, selector: "vl-loader", inputs: ["label", "overlayVisible"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
1054
1016
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: CatalogComponent, decorators: [{
|
1055
1017
|
type: Component,
|
1056
1018
|
args: [{ selector: 'vl-flow-catalog', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngIf=\"state$ | async as state\">\n <vl-loader *ngIf=\"state.loading; else content\" [label]=\"'Loading UI'\"></vl-loader>\n\n <ng-template #content>\n <ng-container *ngIf=\"!state.failure\">\n <vl-cms-preview [uiDefinition]=\"uiDefinition\"></vl-cms-preview>\n </ng-container>\n </ng-template>\n</ng-container>\n" }]
|
1057
|
-
}], ctorParameters: function () { return [{ type: i1$1.
|
1019
|
+
}], ctorParameters: function () { return [{ type: i1$1.UITemplatesAdminApiService }, { type: i0.ChangeDetectorRef }, { type: i2.ToastService }, { type: i3$1.FlowInfoService }, { type: undefined, decorators: [{
|
1058
1020
|
type: Optional
|
1059
1021
|
}, {
|
1060
1022
|
type: Inject,
|
@@ -1076,11 +1038,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
|
|
1076
1038
|
}] });
|
1077
1039
|
|
1078
1040
|
class DebugComponent {
|
1079
|
-
constructor(flowsApiService, router, activatedRoute
|
1041
|
+
constructor(flowsApiService, router, activatedRoute) {
|
1080
1042
|
this.flowsApiService = flowsApiService;
|
1081
1043
|
this.router = router;
|
1082
1044
|
this.activatedRoute = activatedRoute;
|
1083
|
-
this.quoteDraftService = quoteDraftService;
|
1084
1045
|
this.form = new FormGroup({
|
1085
1046
|
id: new FormControl(''),
|
1086
1047
|
});
|
@@ -1091,8 +1052,6 @@ class DebugComponent {
|
|
1091
1052
|
if (!id || !this.selectedFlow) {
|
1092
1053
|
return;
|
1093
1054
|
}
|
1094
|
-
// Delete context before starting a new flow
|
1095
|
-
this.quoteDraftService.reset();
|
1096
1055
|
this.router.navigate(['..', 'flows'], {
|
1097
1056
|
queryParams: {
|
1098
1057
|
flowId: this.selectedFlow.id,
|
@@ -1106,12 +1065,12 @@ class DebugComponent {
|
|
1106
1065
|
return new HttpParams({ fromObject: params }).toString();
|
1107
1066
|
}
|
1108
1067
|
}
|
1109
|
-
DebugComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DebugComponent, deps: [{ token: i1$
|
1110
|
-
DebugComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: DebugComponent, selector: "vl-flow-debug", ngImport: i0, template: "<form [formGroup]=\"form\">\n <div class=\"fields-container\">\n <div class=\"field\">\n <label>SF Object ID</label>\n <input formControlName=\"id\" pInputText type=\"text\" />\n </div>\n </div>\n\n <p-button\n styleClass=\"p-button-primary\"\n label=\"Run Flow\"\n [disabled]=\"!form.value.id || !selectedFlow\"\n (onClick)=\"runFlow()\"\n ></p-button>\n</form>\n\n<table>\n <thead>\n <tr>\n <th [width]=\"30\"></th>\n <th [width]=\"160\">ID</th>\n <th [width]=\"160\">Entry Path</th>\n <th>QueryParams</th>\n <th [width]=\"100\">Standalone</th>\n <th [width]=\"100\">Stateful</th>\n </tr>\n </thead>\n <tbody>\n <tr *ngFor=\"let flow of flows$ | async\" (click)=\"selectedFlow = flow\">\n <td><p-radioButton [inputId]=\"flow.id\" name=\"flow\" [value]=\"flow\" [(ngModel)]=\"selectedFlow\"></p-radioButton></td>\n <td>{{ flow.id }}</td>\n <td>{{ flow.properties.entryPath }}</td>\n <td class=\"cell-query-params\">{{ getQueryParamsString(flow.properties.queryParams) }}</td>\n <td>{{ flow.properties.standalone }}</td>\n <td>{{ flow.properties.stateful }}</td>\n </tr>\n </tbody>\n</table>\n", styles: [":host{display:block;padding:24px 54px}form{display:flex;align-items:center;justify-content:space-between}.fields-container{display:flex;gap:24px}.field{display:flex;flex-direction:column;width:200px;flex-shrink:0}:host ::ng-deep .p-dropdown{width:100%}table{width:100%;border-collapse:collapse;table-layout:fixed}tbody>tr{cursor:pointer}tbody>tr:hover{background-color:#f0f5fa}th{text-align:left;font-weight:600}th,td{padding:0 10px;height:30px;border-bottom:1px solid var(--vl-border-color);margin-right:16px;line-height:18px}.cell-query-params{word-break:break-all}\n"], dependencies: [{ kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type:
|
1068
|
+
DebugComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DebugComponent, deps: [{ token: i1$1.FlowsApiService }, { token: i1$2.Router }, { token: i1$2.ActivatedRoute }], target: i0.ɵɵFactoryTarget.Component });
|
1069
|
+
DebugComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: DebugComponent, selector: "vl-flow-debug", ngImport: i0, template: "<form [formGroup]=\"form\">\n <div class=\"fields-container\">\n <div class=\"field\">\n <label>SF Object ID</label>\n <input formControlName=\"id\" pInputText type=\"text\" />\n </div>\n </div>\n\n <p-button\n styleClass=\"p-button-primary\"\n label=\"Run Flow\"\n [disabled]=\"!form.value.id || !selectedFlow\"\n (onClick)=\"runFlow()\"\n ></p-button>\n</form>\n\n<table>\n <thead>\n <tr>\n <th [width]=\"30\"></th>\n <th [width]=\"160\">ID</th>\n <th [width]=\"160\">Entry Path</th>\n <th>QueryParams</th>\n <th [width]=\"100\">Standalone</th>\n <th [width]=\"100\">Stateful</th>\n </tr>\n </thead>\n <tbody>\n <tr *ngFor=\"let flow of flows$ | async\" (click)=\"selectedFlow = flow\">\n <td><p-radioButton [inputId]=\"flow.id\" name=\"flow\" [value]=\"flow\" [(ngModel)]=\"selectedFlow\"></p-radioButton></td>\n <td>{{ flow.id }}</td>\n <td>{{ flow.properties.entryPath }}</td>\n <td class=\"cell-query-params\">{{ getQueryParamsString(flow.properties.queryParams) }}</td>\n <td>{{ flow.properties.standalone }}</td>\n <td>{{ flow.properties.stateful }}</td>\n </tr>\n </tbody>\n</table>\n", styles: [":host{display:block;padding:24px 54px}form{display:flex;align-items:center;justify-content:space-between}.fields-container{display:flex;gap:24px}.field{display:flex;flex-direction:column;width:200px;flex-shrink:0}:host ::ng-deep .p-dropdown{width:100%}table{width:100%;border-collapse:collapse;table-layout:fixed}tbody>tr{cursor:pointer}tbody>tr:hover{background-color:#f0f5fa}th{text-align:left;font-weight:600}th,td{padding:0 10px;height:30px;border-bottom:1px solid var(--vl-border-color);margin-right:16px;line-height:18px}.cell-query-params{word-break:break-all}\n"], dependencies: [{ kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i4$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i4$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i4$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i4$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i4$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i5$1.RadioButton, selector: "p-radioButton", inputs: ["value", "formControlName", "name", "disabled", "label", "tabindex", "inputId", "ariaLabelledBy", "ariaLabel", "style", "styleClass", "labelStyleClass"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: i3.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "style", "styleClass", "badgeClass"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "directive", type: i7.InputText, selector: "[pInputText]" }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
1111
1070
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DebugComponent, decorators: [{
|
1112
1071
|
type: Component,
|
1113
1072
|
args: [{ selector: 'vl-flow-debug', changeDetection: ChangeDetectionStrategy.OnPush, template: "<form [formGroup]=\"form\">\n <div class=\"fields-container\">\n <div class=\"field\">\n <label>SF Object ID</label>\n <input formControlName=\"id\" pInputText type=\"text\" />\n </div>\n </div>\n\n <p-button\n styleClass=\"p-button-primary\"\n label=\"Run Flow\"\n [disabled]=\"!form.value.id || !selectedFlow\"\n (onClick)=\"runFlow()\"\n ></p-button>\n</form>\n\n<table>\n <thead>\n <tr>\n <th [width]=\"30\"></th>\n <th [width]=\"160\">ID</th>\n <th [width]=\"160\">Entry Path</th>\n <th>QueryParams</th>\n <th [width]=\"100\">Standalone</th>\n <th [width]=\"100\">Stateful</th>\n </tr>\n </thead>\n <tbody>\n <tr *ngFor=\"let flow of flows$ | async\" (click)=\"selectedFlow = flow\">\n <td><p-radioButton [inputId]=\"flow.id\" name=\"flow\" [value]=\"flow\" [(ngModel)]=\"selectedFlow\"></p-radioButton></td>\n <td>{{ flow.id }}</td>\n <td>{{ flow.properties.entryPath }}</td>\n <td class=\"cell-query-params\">{{ getQueryParamsString(flow.properties.queryParams) }}</td>\n <td>{{ flow.properties.standalone }}</td>\n <td>{{ flow.properties.stateful }}</td>\n </tr>\n </tbody>\n</table>\n", styles: [":host{display:block;padding:24px 54px}form{display:flex;align-items:center;justify-content:space-between}.fields-container{display:flex;gap:24px}.field{display:flex;flex-direction:column;width:200px;flex-shrink:0}:host ::ng-deep .p-dropdown{width:100%}table{width:100%;border-collapse:collapse;table-layout:fixed}tbody>tr{cursor:pointer}tbody>tr:hover{background-color:#f0f5fa}th{text-align:left;font-weight:600}th,td{padding:0 10px;height:30px;border-bottom:1px solid var(--vl-border-color);margin-right:16px;line-height:18px}.cell-query-params{word-break:break-all}\n"] }]
|
1114
|
-
}], ctorParameters: function () { return [{ type: i1$
|
1073
|
+
}], ctorParameters: function () { return [{ type: i1$1.FlowsApiService }, { type: i1$2.Router }, { type: i1$2.ActivatedRoute }]; } });
|
1115
1074
|
|
1116
1075
|
const routes$1 = [{ path: '', component: DebugComponent }];
|
1117
1076
|
class DebugModule {
|
@@ -1149,80 +1108,50 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
|
|
1149
1108
|
}] });
|
1150
1109
|
|
1151
1110
|
class ProductComponent {
|
1152
|
-
constructor(
|
1153
|
-
|
1154
|
-
configurationService, configurationStateService, salesTransactionService, flowInfoService, integrationState, uiDefinitionsApiService, customizationService) {
|
1155
|
-
this.configurationService = configurationService;
|
1111
|
+
constructor(configurationRuntimeService, configurationStateService, flowService, route) {
|
1112
|
+
this.configurationRuntimeService = configurationRuntimeService;
|
1156
1113
|
this.configurationStateService = configurationStateService;
|
1157
|
-
this.
|
1158
|
-
this.
|
1159
|
-
this.integrationState = integrationState;
|
1160
|
-
this.uiDefinitionsApiService = uiDefinitionsApiService;
|
1161
|
-
this.customizationService = customizationService;
|
1114
|
+
this.flowService = flowService;
|
1115
|
+
this.route = route;
|
1162
1116
|
this.uiDefinitionContainer$ = new BehaviorSubject(null);
|
1117
|
+
this.showNotFound$ = new BehaviorSubject(false);
|
1118
|
+
this.isInitialized$ = new BehaviorSubject(true);
|
1119
|
+
this.destroy$ = new Subject();
|
1120
|
+
this.uiDefinitionContainer$.next(this.configurationRuntimeService.uiDefinitionContainer);
|
1163
1121
|
this.config = {
|
1164
1122
|
init$: () => this.init$(),
|
1165
1123
|
};
|
1166
1124
|
}
|
1167
|
-
|
1168
|
-
|
1169
|
-
|
1170
|
-
|
1171
|
-
|
1172
|
-
|
1173
|
-
|
1174
|
-
|
1175
|
-
|
1176
|
-
fetchUIDefinition$() {
|
1177
|
-
const flowContext = this.flowInfoService.context;
|
1178
|
-
if (flowContext.requiredUIDefinitionId) {
|
1179
|
-
return this.uiDefinitionsApiService
|
1180
|
-
.fetchUIDefinition$(flowContext.requiredUIDefinitionId)
|
1181
|
-
.pipe(map((uiDefContainer) => this.uiDefinitionContainer$.next(uiDefContainer)));
|
1182
|
-
}
|
1183
|
-
return this.uiDefinitionsApiService
|
1184
|
-
.fetchUIDefinitions$({
|
1185
|
-
productId: flowContext.productId,
|
1186
|
-
defaultUIDefinitionId: flowContext.defaultUIDefinitionId,
|
1187
|
-
})
|
1188
|
-
.pipe(map((uiDefinitionContainers) => {
|
1189
|
-
const uiDefContainer = uiDefinitionContainers[0];
|
1190
|
-
if (uiDefContainer) {
|
1191
|
-
this.uiDefinitionContainer$.next(uiDefContainer);
|
1125
|
+
ngOnInit() {
|
1126
|
+
let prevParams;
|
1127
|
+
this.route.queryParams
|
1128
|
+
.pipe(tap(params => {
|
1129
|
+
if (prevParams && prevParams['productId'] !== params['productId']) {
|
1130
|
+
this.isInitialized$.next(false);
|
1131
|
+
setTimeout(() => {
|
1132
|
+
this.isInitialized$.next(true);
|
1133
|
+
}, 0);
|
1192
1134
|
}
|
1193
|
-
|
1135
|
+
prevParams = params;
|
1136
|
+
}))
|
1137
|
+
.subscribe();
|
1138
|
+
}
|
1139
|
+
ngOnDestroy() {
|
1140
|
+
this.destroy$.next();
|
1141
|
+
this.destroy$.complete();
|
1194
1142
|
}
|
1195
1143
|
init$() {
|
1196
|
-
|
1197
|
-
|
1198
|
-
|
1199
|
-
}
|
1200
|
-
else {
|
1201
|
-
state$ = of(undefined);
|
1202
|
-
}
|
1203
|
-
return state$.pipe(first(), tap(() => {
|
1204
|
-
if (!this.flowInfoService.context.productId) {
|
1205
|
-
throw new Error(`Unable to start configuration for 'productId == null'`);
|
1206
|
-
}
|
1207
|
-
}), switchMap(() => this.customizeUI$()), switchMap(() => (this.uiDefinitionContainer$.value ? of(undefined) : this.fetchUIDefinition$())), tap(() => {
|
1208
|
-
if (!this.uiDefinitionContainer$.value) {
|
1209
|
-
throw new Error('Product does not have Configuration UI');
|
1210
|
-
}
|
1211
|
-
}), switchMap(() => this.configurationStateService.init$()), switchMap(() => timer(1)), // wait until updates inputs on child components
|
1212
|
-
map(noop));
|
1144
|
+
return this.configurationStateService.init$().pipe(tap(() => {
|
1145
|
+
this.showNotFound$.next(Boolean(!this.uiDefinitionContainer$.value));
|
1146
|
+
}));
|
1213
1147
|
}
|
1214
1148
|
}
|
1215
|
-
ProductComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProductComponent, deps: [{ token:
|
1216
|
-
ProductComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: ProductComponent, selector: "vl-flow-product", ngImport: i0, template: "<vl-cms-preview [uiDefinition]=\"(uiDefinitionContainer$ | async)?.source\"
|
1149
|
+
ProductComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProductComponent, deps: [{ token: i3$1.ConfigurationRuntimeService }, { token: i3$1.ConfigurationStateService }, { token: i3$1.FlowInfoService }, { token: i1$2.ActivatedRoute }], target: i0.ɵɵFactoryTarget.Component });
|
1150
|
+
ProductComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: ProductComponent, selector: "vl-flow-product", ngImport: i0, template: "<vl-cms-preview\n *ngIf=\"isInitialized$ | async\"\n [uiDefinition]=\"(uiDefinitionContainer$ | async)?.source\"\n [config]=\"config\"\n></vl-cms-preview>\n\n<div *ngIf=\"showNotFound$ | async\" class=\"not-found-wrapper\">\n <div class=\"not-found\">\n <div class=\"icon\"></div>\n <div class=\"message\">\n This product doesn't have a linked Configuration UI. <br />\n Please contact your system administrator for further assistance.\n </div>\n </div>\n</div>\n", styles: [".not-found-wrapper{position:absolute;top:0;display:flex;width:100%;height:100%;justify-content:center;align-items:center;background-color:#fff;z-index:1000}.not-found{display:flex;align-items:center;padding:16px;border-radius:8px;gap:8px;background-color:#f5f5f5}.not-found .icon{width:48px;height:42px;background-image:url(\"data:image/svg+xml,%3Csvg width='48' height='42' viewBox='0 0 48 42' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cellipse cx='24.0798' cy='32.6052' rx='2.85714' ry='2.63158' fill='%231F2029'/%3E%3Cpath d='M22.285 3.35831C23.0618 2.06363 24.9382 2.06363 25.715 3.35831L46.1826 37.471C46.9824 38.8041 46.0222 40.5 44.4676 40.5L3.53238 40.5C1.97779 40.5 1.01757 38.8041 1.8174 37.471L22.285 3.35831Z' stroke='%23141414' stroke-width='2'/%3E%3Cpath d='M24 17.342V26.8157' stroke='black' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E%0A\")}.not-found .message{font-size:14px;color:#141414;font-weight:300}\n"], dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5.PreviewComponent, selector: "vl-cms-preview", inputs: ["uiDefinition", "config"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
1217
1151
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProductComponent, decorators: [{
|
1218
1152
|
type: Component,
|
1219
|
-
args: [{ selector: 'vl-flow-product', changeDetection: ChangeDetectionStrategy.OnPush, template: "<vl-cms-preview [uiDefinition]=\"(uiDefinitionContainer$ | async)?.source\"
|
1220
|
-
}], ctorParameters: function () { return [{ type:
|
1221
|
-
type: Optional
|
1222
|
-
}, {
|
1223
|
-
type: Inject,
|
1224
|
-
args: [FLOW_CUSTOMIZATION]
|
1225
|
-
}] }]; } });
|
1153
|
+
args: [{ selector: 'vl-flow-product', changeDetection: ChangeDetectionStrategy.OnPush, template: "<vl-cms-preview\n *ngIf=\"isInitialized$ | async\"\n [uiDefinition]=\"(uiDefinitionContainer$ | async)?.source\"\n [config]=\"config\"\n></vl-cms-preview>\n\n<div *ngIf=\"showNotFound$ | async\" class=\"not-found-wrapper\">\n <div class=\"not-found\">\n <div class=\"icon\"></div>\n <div class=\"message\">\n This product doesn't have a linked Configuration UI. <br />\n Please contact your system administrator for further assistance.\n </div>\n </div>\n</div>\n", styles: [".not-found-wrapper{position:absolute;top:0;display:flex;width:100%;height:100%;justify-content:center;align-items:center;background-color:#fff;z-index:1000}.not-found{display:flex;align-items:center;padding:16px;border-radius:8px;gap:8px;background-color:#f5f5f5}.not-found .icon{width:48px;height:42px;background-image:url(\"data:image/svg+xml,%3Csvg width='48' height='42' viewBox='0 0 48 42' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cellipse cx='24.0798' cy='32.6052' rx='2.85714' ry='2.63158' fill='%231F2029'/%3E%3Cpath d='M22.285 3.35831C23.0618 2.06363 24.9382 2.06363 25.715 3.35831L46.1826 37.471C46.9824 38.8041 46.0222 40.5 44.4676 40.5L3.53238 40.5C1.97779 40.5 1.01757 38.8041 1.8174 37.471L22.285 3.35831Z' stroke='%23141414' stroke-width='2'/%3E%3Cpath d='M24 17.342V26.8157' stroke='black' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E%0A\")}.not-found .message{font-size:14px;color:#141414;font-weight:300}\n"] }]
|
1154
|
+
}], ctorParameters: function () { return [{ type: i3$1.ConfigurationRuntimeService }, { type: i3$1.ConfigurationStateService }, { type: i3$1.FlowInfoService }, { type: i1$2.ActivatedRoute }]; } });
|
1226
1155
|
|
1227
1156
|
class ProductModule {
|
1228
1157
|
}
|
@@ -1239,9 +1168,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
|
|
1239
1168
|
}] });
|
1240
1169
|
|
1241
1170
|
class RecordNotFoundComponent {
|
1242
|
-
constructor(router
|
1171
|
+
constructor(router) {
|
1243
1172
|
this.router = router;
|
1244
|
-
this.route = route;
|
1245
1173
|
this.subMessage = '';
|
1246
1174
|
this.type = '';
|
1247
1175
|
const navigation = this.router.getCurrentNavigation();
|
@@ -1254,12 +1182,12 @@ class RecordNotFoundComponent {
|
|
1254
1182
|
}
|
1255
1183
|
}
|
1256
1184
|
}
|
1257
|
-
RecordNotFoundComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RecordNotFoundComponent, deps: [{ token: i1$2.Router }
|
1185
|
+
RecordNotFoundComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RecordNotFoundComponent, deps: [{ token: i1$2.Router }], target: i0.ɵɵFactoryTarget.Component });
|
1258
1186
|
RecordNotFoundComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: RecordNotFoundComponent, selector: "vl-flow-record-not-found", ngImport: i0, template: "<div class=\"row\">\n <div class=\"col-md-12\">\n <div class=\"message-wrapper\">\n <div *ngIf=\"message; else defaultMessage\">\n <p class=\"text message-text\" [class]=\"type\">{{ message }}</p>\n\n <p *ngIf=\"subMessage\" class=\"text\">{{ subMessage }}</p>\n\n <div *ngIf=\"details && details.length > 0\">\n <div *ngFor=\"let detail of details\" class=\"text\">{{ detail }}</div>\n </div>\n </div>\n\n <ng-template #defaultMessage>Record not found</ng-template>\n </div>\n </div>\n</div>\n", styles: [":host{display:block;padding:24px 54px}:host .text{white-space:pre-line;word-break:break-word}:host .message-text.error{color:var(--vl-error-text-color)}\n"], dependencies: [{ kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
1259
1187
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RecordNotFoundComponent, decorators: [{
|
1260
1188
|
type: Component,
|
1261
1189
|
args: [{ selector: 'vl-flow-record-not-found', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"row\">\n <div class=\"col-md-12\">\n <div class=\"message-wrapper\">\n <div *ngIf=\"message; else defaultMessage\">\n <p class=\"text message-text\" [class]=\"type\">{{ message }}</p>\n\n <p *ngIf=\"subMessage\" class=\"text\">{{ subMessage }}</p>\n\n <div *ngIf=\"details && details.length > 0\">\n <div *ngFor=\"let detail of details\" class=\"text\">{{ detail }}</div>\n </div>\n </div>\n\n <ng-template #defaultMessage>Record not found</ng-template>\n </div>\n </div>\n</div>\n", styles: [":host{display:block;padding:24px 54px}:host .text{white-space:pre-line;word-break:break-word}:host .message-text.error{color:var(--vl-error-text-color)}\n"] }]
|
1262
|
-
}], ctorParameters: function () { return [{ type: i1$2.Router }
|
1190
|
+
}], ctorParameters: function () { return [{ type: i1$2.Router }]; } });
|
1263
1191
|
|
1264
1192
|
const routes = [{ path: '', component: RecordNotFoundComponent }];
|
1265
1193
|
class RecordNotFoundModule {
|
@@ -1276,8 +1204,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
|
|
1276
1204
|
}] });
|
1277
1205
|
|
1278
1206
|
class ShoppingCartComponent {
|
1279
|
-
constructor(
|
1280
|
-
this.
|
1207
|
+
constructor(templatesAdminApiService, cdr, toastService, flowInfo, customizationService) {
|
1208
|
+
this.templatesAdminApiService = templatesAdminApiService;
|
1281
1209
|
this.cdr = cdr;
|
1282
1210
|
this.toastService = toastService;
|
1283
1211
|
this.flowInfo = flowInfo;
|
@@ -1330,7 +1258,7 @@ class ShoppingCartComponent {
|
|
1330
1258
|
if (!template) {
|
1331
1259
|
return of(undefined);
|
1332
1260
|
}
|
1333
|
-
return this.
|
1261
|
+
return this.templatesAdminApiService.fetchComponentsAttachments$(template.id);
|
1334
1262
|
}
|
1335
1263
|
generateUIDefinition$() {
|
1336
1264
|
return of(undefined).pipe(tap(() => {
|
@@ -1344,7 +1272,6 @@ class ShoppingCartComponent {
|
|
1344
1272
|
const uiDef = {
|
1345
1273
|
name: '',
|
1346
1274
|
createdTimestamp: 0,
|
1347
|
-
primary: true,
|
1348
1275
|
type: 'DEFAULT',
|
1349
1276
|
version: 2,
|
1350
1277
|
children: metaList.map(meta => ({
|
@@ -1358,12 +1285,12 @@ class ShoppingCartComponent {
|
|
1358
1285
|
}));
|
1359
1286
|
}
|
1360
1287
|
}
|
1361
|
-
ShoppingCartComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ShoppingCartComponent, deps: [{ token: i1$1.
|
1362
|
-
ShoppingCartComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: ShoppingCartComponent, selector: "vl-flow-shopping-cart", ngImport: i0, template: "<ng-container *ngIf=\"state$ | async as state\">\n <vl-loader *ngIf=\"state.loading; else content\" [label]=\"'Loading UI'\"></vl-loader>\n\n <ng-template #content>\n <ng-container *ngIf=\"!state.failure\">\n <vl-cms-preview [uiDefinition]=\"uiDefinition\"></vl-cms-preview>\n </ng-container>\n </ng-template>\n</ng-container>\n", styles: [""], dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5.PreviewComponent, selector: "vl-cms-preview", inputs: ["uiDefinition", "config"] }, { kind: "component", type: i2
|
1288
|
+
ShoppingCartComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ShoppingCartComponent, deps: [{ token: i1$1.UITemplatesAdminApiService }, { token: i0.ChangeDetectorRef }, { token: i2.ToastService }, { token: i3$1.FlowInfoService }, { token: FLOW_CUSTOMIZATION, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
1289
|
+
ShoppingCartComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.9", type: ShoppingCartComponent, selector: "vl-flow-shopping-cart", ngImport: i0, template: "<ng-container *ngIf=\"state$ | async as state\">\n <vl-loader *ngIf=\"state.loading; else content\" [label]=\"'Loading UI'\"></vl-loader>\n\n <ng-template #content>\n <ng-container *ngIf=\"!state.failure\">\n <vl-cms-preview [uiDefinition]=\"uiDefinition\"></vl-cms-preview>\n </ng-container>\n </ng-template>\n</ng-container>\n", styles: [""], dependencies: [{ kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5.PreviewComponent, selector: "vl-cms-preview", inputs: ["uiDefinition", "config"] }, { kind: "component", type: i2.LoaderComponent, selector: "vl-loader", inputs: ["label", "overlayVisible"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
1363
1290
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ShoppingCartComponent, decorators: [{
|
1364
1291
|
type: Component,
|
1365
1292
|
args: [{ selector: 'vl-flow-shopping-cart', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngIf=\"state$ | async as state\">\n <vl-loader *ngIf=\"state.loading; else content\" [label]=\"'Loading UI'\"></vl-loader>\n\n <ng-template #content>\n <ng-container *ngIf=\"!state.failure\">\n <vl-cms-preview [uiDefinition]=\"uiDefinition\"></vl-cms-preview>\n </ng-container>\n </ng-template>\n</ng-container>\n" }]
|
1366
|
-
}], ctorParameters: function () { return [{ type: i1$1.
|
1293
|
+
}], ctorParameters: function () { return [{ type: i1$1.UITemplatesAdminApiService }, { type: i0.ChangeDetectorRef }, { type: i2.ToastService }, { type: i3$1.FlowInfoService }, { type: undefined, decorators: [{
|
1367
1294
|
type: Optional
|
1368
1295
|
}, {
|
1369
1296
|
type: Inject,
|
@@ -1416,19 +1343,29 @@ class FlowResolver {
|
|
1416
1343
|
}));
|
1417
1344
|
}
|
1418
1345
|
}
|
1419
|
-
FlowResolver.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowResolver, deps: [{ token: i1$2.Router }, { token: FlowRouterService }, { token:
|
1346
|
+
FlowResolver.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowResolver, deps: [{ token: i1$2.Router }, { token: FlowRouterService }, { token: i3$1.FlowInfoService }], target: i0.ɵɵFactoryTarget.Injectable });
|
1420
1347
|
FlowResolver.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowResolver });
|
1421
1348
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowResolver, decorators: [{
|
1422
1349
|
type: Injectable
|
1423
|
-
}], ctorParameters: function () { return [{ type: i1$2.Router }, { type: FlowRouterService }, { type:
|
1350
|
+
}], ctorParameters: function () { return [{ type: i1$2.Router }, { type: FlowRouterService }, { type: i3$1.FlowInfoService }]; } });
|
1351
|
+
|
1352
|
+
const resolvePCMModel = () => {
|
1353
|
+
const flowInfoService = inject(FlowInfoService);
|
1354
|
+
const configurationRuntimeService = inject(ConfigurationRuntimeService);
|
1355
|
+
const { productId } = flowInfoService.context;
|
1356
|
+
if (!productId) {
|
1357
|
+
throw new Error(`Unable to start configuration for 'productId == null'`);
|
1358
|
+
}
|
1359
|
+
return configurationRuntimeService.init$({ productId });
|
1360
|
+
};
|
1424
1361
|
|
1425
|
-
class
|
1426
|
-
constructor(router,
|
1362
|
+
class SalesTransactionResolver {
|
1363
|
+
constructor(router, routerService, flowInfoService, flowStateService, salesTransactionService) {
|
1427
1364
|
this.router = router;
|
1428
|
-
this.quoteDraftService = quoteDraftService;
|
1429
1365
|
this.routerService = routerService;
|
1430
1366
|
this.flowInfoService = flowInfoService;
|
1431
1367
|
this.flowStateService = flowStateService;
|
1368
|
+
this.salesTransactionService = salesTransactionService;
|
1432
1369
|
}
|
1433
1370
|
resolve(route) {
|
1434
1371
|
const flow = this.flowInfoService.flow;
|
@@ -1465,33 +1402,55 @@ class QuoteResolver {
|
|
1465
1402
|
}));
|
1466
1403
|
}
|
1467
1404
|
getNavigateTo() {
|
1468
|
-
|
1469
|
-
|
1470
|
-
if (flow?.properties.stateful) {
|
1471
|
-
return this.flowStateService.select$(UITemplateType.FLOW_ENGINE, 'NAVIGATE_TO').pipe(map(r => {
|
1472
|
-
if (r.success) {
|
1473
|
-
return r.result;
|
1474
|
-
}
|
1475
|
-
return '';
|
1476
|
-
}));
|
1477
|
-
}
|
1478
|
-
else {
|
1479
|
-
const isAccountMode = this.flowInfoService.context.mode === ConfigurationContextMode.ACCOUNT;
|
1480
|
-
if (isAccountMode || this.quoteDraftService.hasAssets) {
|
1481
|
-
navigateTo = '/assets';
|
1482
|
-
}
|
1483
|
-
else if (this.quoteDraftService.hasProducts) {
|
1484
|
-
navigateTo = '/cart';
|
1485
|
-
}
|
1486
|
-
}
|
1487
|
-
return of(navigateTo);
|
1405
|
+
// Implement when needed
|
1406
|
+
return of('');
|
1488
1407
|
}
|
1489
1408
|
}
|
1490
|
-
|
1491
|
-
|
1492
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type:
|
1409
|
+
SalesTransactionResolver.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SalesTransactionResolver, deps: [{ token: i1$2.Router }, { token: FlowRouterService }, { token: i3$1.FlowInfoService }, { token: i3$1.FlowStateService }, { token: i3$1.SalesTransactionService }], target: i0.ɵɵFactoryTarget.Injectable });
|
1410
|
+
SalesTransactionResolver.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SalesTransactionResolver });
|
1411
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SalesTransactionResolver, decorators: [{
|
1493
1412
|
type: Injectable
|
1494
|
-
}], ctorParameters: function () { return [{ type: i1$2.Router }, { type:
|
1413
|
+
}], ctorParameters: function () { return [{ type: i1$2.Router }, { type: FlowRouterService }, { type: i3$1.FlowInfoService }, { type: i3$1.FlowStateService }, { type: i3$1.SalesTransactionService }]; } });
|
1414
|
+
|
1415
|
+
const resolveUIDefinition = () => {
|
1416
|
+
const customizationService = inject(FLOW_CUSTOMIZATION, { optional: true });
|
1417
|
+
const flowInfoService = inject(FlowInfoService);
|
1418
|
+
const uiDefinitionsAdminApiService = inject(UIDefinitionsAdminApiService);
|
1419
|
+
const configurationRuntimeService = inject(ConfigurationRuntimeService);
|
1420
|
+
const { productId } = flowInfoService.context;
|
1421
|
+
if (!productId) {
|
1422
|
+
throw new Error(`Unable to start configuration for 'productId == null'`);
|
1423
|
+
}
|
1424
|
+
return of(undefined).pipe(switchMap(() => {
|
1425
|
+
// Try resolving via customization service
|
1426
|
+
if (!productId || !customizationService?.getUiDefinition) {
|
1427
|
+
return of(undefined);
|
1428
|
+
}
|
1429
|
+
return customizationService.getUiDefinition(flowInfoService.context);
|
1430
|
+
}), switchMap(uiDefContainer => {
|
1431
|
+
// Resolve UIDefinition from the org
|
1432
|
+
if (uiDefContainer) {
|
1433
|
+
return of(uiDefContainer);
|
1434
|
+
}
|
1435
|
+
if (flowInfoService.context.requiredUIDefinitionId) {
|
1436
|
+
return uiDefinitionsAdminApiService.fetch$(flowInfoService.context.requiredUIDefinitionId, {
|
1437
|
+
skipErrorHandler: true,
|
1438
|
+
});
|
1439
|
+
}
|
1440
|
+
return uiDefinitionsAdminApiService
|
1441
|
+
.fetchAll$({
|
1442
|
+
productId,
|
1443
|
+
defaultUIDefinitionId: flowInfoService.context.defaultUIDefinitionId,
|
1444
|
+
}, { skipErrorHandler: true })
|
1445
|
+
.pipe(map((uiDefinitionContainers) => {
|
1446
|
+
const uiDefContainer = uiDefinitionContainers[0];
|
1447
|
+
if (!uiDefContainer) {
|
1448
|
+
throw new Error(`UI Definition for productId=${productId} is not resolved`);
|
1449
|
+
}
|
1450
|
+
return uiDefContainer;
|
1451
|
+
}));
|
1452
|
+
}), catchError(() => of(null)), tap(uiDefContainer => (configurationRuntimeService.uiDefinitionContainer = uiDefContainer)));
|
1453
|
+
};
|
1495
1454
|
|
1496
1455
|
const rootRoute = {
|
1497
1456
|
id: VELOCE_FLOW_ROOT_ROUTE,
|
@@ -1515,7 +1474,7 @@ const rootRoute = {
|
|
1515
1474
|
path: 'product',
|
1516
1475
|
component: ProductComponent,
|
1517
1476
|
runGuardsAndResolvers: 'paramsOrQueryParamsChange',
|
1518
|
-
resolve: {
|
1477
|
+
resolve: { salesTransaction: SalesTransactionResolver, uiDef: resolveUIDefinition, pcm: resolvePCMModel },
|
1519
1478
|
canDeactivate: [ProductUnloadGuard],
|
1520
1479
|
data: { showHeader: true },
|
1521
1480
|
},
|
@@ -1523,21 +1482,21 @@ const rootRoute = {
|
|
1523
1482
|
path: 'cart',
|
1524
1483
|
component: ShoppingCartComponent,
|
1525
1484
|
runGuardsAndResolvers: 'paramsOrQueryParamsChange',
|
1526
|
-
resolve: {
|
1485
|
+
resolve: { salesTransaction: SalesTransactionResolver },
|
1527
1486
|
data: { showHeader: true },
|
1528
1487
|
},
|
1529
1488
|
{
|
1530
1489
|
path: 'catalog',
|
1531
1490
|
component: CatalogComponent,
|
1532
1491
|
runGuardsAndResolvers: 'paramsOrQueryParamsChange',
|
1533
|
-
resolve: {
|
1492
|
+
resolve: { salesTransaction: SalesTransactionResolver },
|
1534
1493
|
data: { showHeader: true },
|
1535
1494
|
},
|
1536
1495
|
{
|
1537
1496
|
path: 'assets',
|
1538
1497
|
component: AssetsComponent,
|
1539
1498
|
runGuardsAndResolvers: 'paramsOrQueryParamsChange',
|
1540
|
-
resolve: {
|
1499
|
+
resolve: { salesTransaction: SalesTransactionResolver },
|
1541
1500
|
data: { showHeader: true },
|
1542
1501
|
},
|
1543
1502
|
{
|
@@ -1556,13 +1515,13 @@ class FlowRoutingModule {
|
|
1556
1515
|
}
|
1557
1516
|
FlowRoutingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowRoutingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
1558
1517
|
FlowRoutingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: FlowRoutingModule, imports: [i1$2.RouterModule, ProductModule, ShoppingCartModule, CatalogModule, AssetsModule], exports: [RouterModule] });
|
1559
|
-
FlowRoutingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowRoutingModule, providers: [FlowRouterService, RootGuard, ProductUnloadGuard, FlowResolver,
|
1518
|
+
FlowRoutingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowRoutingModule, providers: [FlowRouterService, RootGuard, ProductUnloadGuard, FlowResolver, SalesTransactionResolver], imports: [RouterModule.forChild([rootRoute]), ProductModule, ShoppingCartModule, CatalogModule, AssetsModule, RouterModule] });
|
1560
1519
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowRoutingModule, decorators: [{
|
1561
1520
|
type: NgModule,
|
1562
1521
|
args: [{
|
1563
1522
|
imports: [RouterModule.forChild([rootRoute]), ProductModule, ShoppingCartModule, CatalogModule, AssetsModule],
|
1564
1523
|
exports: [RouterModule],
|
1565
|
-
providers: [FlowRouterService, RootGuard, ProductUnloadGuard, FlowResolver,
|
1524
|
+
providers: [FlowRouterService, RootGuard, ProductUnloadGuard, FlowResolver, SalesTransactionResolver],
|
1566
1525
|
}]
|
1567
1526
|
}] });
|
1568
1527
|
|
@@ -1610,22 +1569,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
|
|
1610
1569
|
}]
|
1611
1570
|
}] });
|
1612
1571
|
|
1613
|
-
const getFlowObjectIdPropertyName = (id) => {
|
1614
|
-
const objectName = SalesforceIdUtils.getSfObjectNameById(id);
|
1615
|
-
switch (objectName) {
|
1616
|
-
case 'Account':
|
1617
|
-
return 'accountId';
|
1618
|
-
case 'Order':
|
1619
|
-
return 'orderId';
|
1620
|
-
case 'Quote':
|
1621
|
-
default:
|
1622
|
-
return 'quoteId';
|
1623
|
-
}
|
1624
|
-
};
|
1625
|
-
|
1626
1572
|
/**
|
1627
1573
|
* Generated bundle index. Do not edit.
|
1628
1574
|
*/
|
1629
1575
|
|
1630
|
-
export { FlowDialogService, FlowModule, FlowRouterService, FlowService, VELOCE_FLOW_ROOT_ROUTE
|
1576
|
+
export { FlowDialogService, FlowModule, FlowRouterService, FlowService, VELOCE_FLOW_ROOT_ROUTE };
|
1631
1577
|
//# sourceMappingURL=veloceapps-sdk.mjs.map
|