@veloceapps/sdk 11.0.0-12 → 11.0.0-120
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 +17 -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 +3 -3
- 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 +4 -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 +7 -5
- package/core/services/flow-state-configuration.service.d.ts +9 -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 +2 -2
- package/core/utils/transaction-item.utils.d.ts +7 -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 +17 -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 +58 -58
- package/esm2020/core/modules/configuration/services/configuration.service.mjs +125 -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 +20 -11
- package/esm2020/core/services/flow-state-configuration.service.mjs +55 -25
- 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 +3 -3
- package/esm2020/core/utils/transaction-item.utils.mjs +60 -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 +7 -7
- 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 +16 -70
- 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 +17 -24
- 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 +162 -309
- package/fesm2015/veloceapps-sdk-cms.mjs.map +1 -1
- package/fesm2015/veloceapps-sdk-core.mjs +571 -1166
- package/fesm2015/veloceapps-sdk-core.mjs.map +1 -1
- package/fesm2015/veloceapps-sdk.mjs +161 -242
- package/fesm2015/veloceapps-sdk.mjs.map +1 -1
- package/fesm2020/veloceapps-sdk-cms.mjs +158 -300
- package/fesm2020/veloceapps-sdk-cms.mjs.map +1 -1
- package/fesm2020/veloceapps-sdk-core.mjs +631 -1197
- package/fesm2020/veloceapps-sdk-core.mjs.map +1 -1
- package/fesm2020/veloceapps-sdk.mjs +161 -239
- 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 +5 -12
- 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 +5 -5
- 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
|
-
import { BehaviorSubject, Subject, filter, first, tap, takeUntil, catchError, of, map, switchMap, shareReplay, startWith, distinctUntilChanged, from, take, combineLatest
|
15
|
+
import { BehaviorSubject, Subject, filter, first, tap, takeUntil, catchError, of, map, switchMap, shareReplay, startWith, distinctUntilChanged, from, take, combineLatest } from 'rxjs';
|
17
16
|
import * as i1$1 from '@veloceapps/api/v2';
|
17
|
+
import { UIDefinitionsAdminApiService } from '@veloceapps/api/v2';
|
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 {
|
21
|
+
import { SalesforceIdUtils, mapShoppingCartSettings, getMaxRenewalTermsValue, 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;
|
@@ -134,7 +134,7 @@ class FlowHeaderComponent {
|
|
134
134
|
if (!template) {
|
135
135
|
return of(undefined);
|
136
136
|
}
|
137
|
-
return this.
|
137
|
+
return this.templatesAdminApiService.fetchComponentsAttachments$(template.id);
|
138
138
|
}
|
139
139
|
generateUIDefinition$() {
|
140
140
|
return of(undefined).pipe(tap(() => {
|
@@ -148,7 +148,6 @@ class FlowHeaderComponent {
|
|
148
148
|
const uiDef = {
|
149
149
|
name: '',
|
150
150
|
createdTimestamp: 0,
|
151
|
-
primary: true,
|
152
151
|
type: 'DEFAULT',
|
153
152
|
version: 2,
|
154
153
|
children: metaList.map(meta => ({
|
@@ -162,13 +161,13 @@ class FlowHeaderComponent {
|
|
162
161
|
}));
|
163
162
|
}
|
164
163
|
}
|
165
|
-
FlowHeaderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowHeaderComponent, deps: [{ token: i1$1.
|
164
|
+
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 });
|
166
165
|
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 });
|
167
166
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowHeaderComponent, decorators: [{
|
168
167
|
type: Component,
|
169
168
|
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"] }]
|
170
169
|
}], ctorParameters: function () {
|
171
|
-
return [{ type: i1$1.
|
170
|
+
return [{ type: i1$1.UITemplatesAdminApiService }, { type: i3$1.FlowStateService }, { type: i3$1.FlowInfoService }, { type: i2.ToastService }, { type: undefined, decorators: [{
|
172
171
|
type: Optional
|
173
172
|
}, {
|
174
173
|
type: Inject,
|
@@ -191,8 +190,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
|
|
191
190
|
}] });
|
192
191
|
|
193
192
|
class GuidedSellingComponent {
|
194
|
-
constructor(
|
195
|
-
this.
|
193
|
+
constructor(templatesAdminApiService, flowStateService, flowInfo, toastService, customizationService) {
|
194
|
+
this.templatesAdminApiService = templatesAdminApiService;
|
196
195
|
this.flowStateService = flowStateService;
|
197
196
|
this.flowInfo = flowInfo;
|
198
197
|
this.toastService = toastService;
|
@@ -249,7 +248,7 @@ class GuidedSellingComponent {
|
|
249
248
|
if (!template) {
|
250
249
|
return of(undefined);
|
251
250
|
}
|
252
|
-
return this.
|
251
|
+
return this.templatesAdminApiService.fetchComponentsAttachments$(template.id);
|
253
252
|
}
|
254
253
|
generateUIDefinition$() {
|
255
254
|
return of(undefined).pipe(tap(() => {
|
@@ -263,7 +262,6 @@ class GuidedSellingComponent {
|
|
263
262
|
const uiDef = {
|
264
263
|
name: '',
|
265
264
|
createdTimestamp: 0,
|
266
|
-
primary: true,
|
267
265
|
type: 'DEFAULT',
|
268
266
|
version: 2,
|
269
267
|
children: metaList.map(meta => ({
|
@@ -277,13 +275,13 @@ class GuidedSellingComponent {
|
|
277
275
|
}));
|
278
276
|
}
|
279
277
|
}
|
280
|
-
GuidedSellingComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: GuidedSellingComponent, deps: [{ token: i1$1.
|
278
|
+
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 });
|
281
279
|
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 });
|
282
280
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: GuidedSellingComponent, decorators: [{
|
283
281
|
type: Component,
|
284
282
|
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"] }]
|
285
283
|
}], ctorParameters: function () {
|
286
|
-
return [{ type: i1$1.
|
284
|
+
return [{ type: i1$1.UITemplatesAdminApiService }, { type: i3$1.FlowStateService }, { type: i3$1.FlowInfoService }, { type: i2.ToastService }, { type: undefined, decorators: [{
|
287
285
|
type: Optional
|
288
286
|
}, {
|
289
287
|
type: Inject,
|
@@ -338,11 +336,11 @@ const configurePrimengShadowDOM = () => {
|
|
338
336
|
};
|
339
337
|
|
340
338
|
class FlowRouterService {
|
341
|
-
constructor(router, route, integrationState,
|
339
|
+
constructor(router, route, integrationState, flowInfoService) {
|
342
340
|
this.router = router;
|
343
341
|
this.route = route;
|
344
342
|
this.integrationState = integrationState;
|
345
|
-
this.
|
343
|
+
this.flowInfoService = flowInfoService;
|
346
344
|
this.urlHistory = [];
|
347
345
|
this.getLastChildRoute = (route) => {
|
348
346
|
return route.firstChild ? this.getLastChildRoute(route.firstChild) : route;
|
@@ -437,7 +435,7 @@ class FlowRouterService {
|
|
437
435
|
this.router.navigateByUrl(prevUrl);
|
438
436
|
}
|
439
437
|
}
|
440
|
-
navigateTo(path, productId,
|
438
|
+
navigateTo(path, productId, transactionItemId) {
|
441
439
|
if (path === 'shopping-cart') {
|
442
440
|
this.navigateToShoppingCart();
|
443
441
|
}
|
@@ -448,23 +446,16 @@ class FlowRouterService {
|
|
448
446
|
this.navigateToAssets();
|
449
447
|
}
|
450
448
|
else if (path === 'product' && productId) {
|
451
|
-
this.navigateToProductConfiguration(productId,
|
449
|
+
this.navigateToProductConfiguration(productId, transactionItemId);
|
452
450
|
}
|
453
451
|
}
|
454
|
-
navigateToProductConfiguration(productId,
|
455
|
-
this.
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
const routeSnapshot = this.getLastChildRouteSnapshot(this.route.snapshot);
|
462
|
-
const flowRouteUrl = this.getFlowRootPath(routeSnapshot);
|
463
|
-
this.router.navigate([flowRouteUrl, 'product'], {
|
464
|
-
queryParams: Object.assign(Object.assign({}, routeSnapshot.queryParams), { productId }),
|
465
|
-
});
|
466
|
-
}))
|
467
|
-
.subscribe();
|
452
|
+
navigateToProductConfiguration(productId, transactionItemId) {
|
453
|
+
this.flowInfoService.updateContext({ productId, transactionItemId });
|
454
|
+
const routeSnapshot = this.getLastChildRouteSnapshot(this.route.snapshot);
|
455
|
+
const flowRouteUrl = this.getFlowRootPath(routeSnapshot);
|
456
|
+
this.router.navigate([flowRouteUrl, 'product'], {
|
457
|
+
queryParams: Object.assign(Object.assign({}, routeSnapshot.queryParams), { productId, transactionItemId }),
|
458
|
+
});
|
468
459
|
}
|
469
460
|
navigateToShoppingCart() {
|
470
461
|
const routeSnapshot = this.getLastChildRouteSnapshot(this.route.snapshot);
|
@@ -501,12 +492,12 @@ class FlowRouterService {
|
|
501
492
|
this.router.navigate([], { relativeTo: route, queryParams: Object.assign(Object.assign({}, routeSnapshot.queryParams), queryParams) });
|
502
493
|
}
|
503
494
|
}
|
504
|
-
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:
|
495
|
+
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 });
|
505
496
|
FlowRouterService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowRouterService, providedIn: 'root' });
|
506
497
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowRouterService, decorators: [{
|
507
498
|
type: Injectable,
|
508
499
|
args: [{ providedIn: 'root' }]
|
509
|
-
}], ctorParameters: function () { return [{ type: i1$2.Router }, { type: i1$2.ActivatedRoute }, { type:
|
500
|
+
}], ctorParameters: function () { return [{ type: i1$2.Router }, { type: i1$2.ActivatedRoute }, { type: i3$1.IntegrationState }, { type: i3$1.FlowInfoService }]; } });
|
510
501
|
|
511
502
|
class FlowDialogService {
|
512
503
|
constructor(dialogService, runtimeSettings, flowInfoService) {
|
@@ -549,10 +540,10 @@ class FlowDialogService {
|
|
549
540
|
primaryButton: 'Ok',
|
550
541
|
});
|
551
542
|
}
|
552
|
-
|
543
|
+
showQuoteInConfiguratorDialog() {
|
553
544
|
return this.show({
|
554
545
|
title: 'Quote Cannot be Saved',
|
555
|
-
description: 'It
|
546
|
+
description: 'It not possible to save quotes from the Configurator. To proceed, finish configuring product.',
|
556
547
|
primaryButton: 'Ok',
|
557
548
|
});
|
558
549
|
}
|
@@ -572,27 +563,6 @@ class FlowDialogService {
|
|
572
563
|
oppositeButtonActions: true,
|
573
564
|
});
|
574
565
|
}
|
575
|
-
showReadonlyQuoteSubmitFailureDialog() {
|
576
|
-
return this.show({
|
577
|
-
title: 'Cannot Submit for Approval',
|
578
|
-
description: 'It is only possible to submit for approval quotes with the “Draft“ status. Please create a new quote to proceed.',
|
579
|
-
primaryButton: 'Ok',
|
580
|
-
});
|
581
|
-
}
|
582
|
-
showOutsideShoppingCartQuoteSubmitFailureDialog() {
|
583
|
-
return this.show({
|
584
|
-
title: 'Cannot Submit for Approval',
|
585
|
-
description: 'It is only possible to submit quotes for approval from the Shopping Cart. To proceed, go to the Shopping Cart.',
|
586
|
-
primaryButton: 'Ok',
|
587
|
-
});
|
588
|
-
}
|
589
|
-
showAccountSubmitFailureDialog() {
|
590
|
-
return this.show({
|
591
|
-
title: 'Save Changes',
|
592
|
-
description: 'To submit for approval, save the quote first, and then submit it for approval from the Shopping Cart.',
|
593
|
-
primaryButton: 'Ok',
|
594
|
-
});
|
595
|
-
}
|
596
566
|
showTermsLimitReachedDialog() {
|
597
567
|
const shoppingCartSettings = mapShoppingCartSettings(this.runtimeSettings.getShoppingCartSettings() || []);
|
598
568
|
const maxRenewalTerms = getMaxRenewalTermsValue(shoppingCartSettings);
|
@@ -607,20 +577,21 @@ class FlowDialogService {
|
|
607
577
|
return dialogFunction(dialog);
|
608
578
|
}
|
609
579
|
}
|
610
|
-
FlowDialogService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowDialogService, deps: [{ token: i1.DialogService }, { token:
|
580
|
+
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 });
|
611
581
|
FlowDialogService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowDialogService });
|
612
582
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowDialogService, decorators: [{
|
613
583
|
type: Injectable
|
614
|
-
}], ctorParameters: function () { return [{ type: i1.DialogService }, { type:
|
584
|
+
}], ctorParameters: function () { return [{ type: i1.DialogService }, { type: i3$1.RuntimeSettingsService }, { type: i3$1.FlowInfoService }]; } });
|
615
585
|
|
616
586
|
class FlowService {
|
617
|
-
constructor(integrationState, flowRouterService, configurationService, configurationStateService, flowDialogService, flowStateService) {
|
587
|
+
constructor(integrationState, flowRouterService, configurationService, configurationStateService, flowDialogService, flowStateService, flowInfoService) {
|
618
588
|
this.integrationState = integrationState;
|
619
589
|
this.flowRouterService = flowRouterService;
|
620
590
|
this.configurationService = configurationService;
|
621
591
|
this.configurationStateService = configurationStateService;
|
622
592
|
this.flowDialogService = flowDialogService;
|
623
593
|
this.flowStateService = flowStateService;
|
594
|
+
this.flowInfoService = flowInfoService;
|
624
595
|
this.cleanup$ = new Subject();
|
625
596
|
}
|
626
597
|
cleanup() {
|
@@ -629,9 +600,10 @@ class FlowService {
|
|
629
600
|
initSubscriptions() {
|
630
601
|
this.integrationState
|
631
602
|
.listen$(FlowAction.FLOW_CONFIGURE_PRODUCT)
|
632
|
-
.pipe(
|
603
|
+
.pipe(tap(payload => {
|
633
604
|
if (payload.productId) {
|
634
|
-
this.
|
605
|
+
this.flowInfoService.updateContext({ newProductQty: payload.qty });
|
606
|
+
this.flowRouterService.navigateToProductConfiguration(payload.productId, payload.transactionItemId);
|
635
607
|
}
|
636
608
|
else {
|
637
609
|
console.warn("Parameter 'productId' is needed to start configuration");
|
@@ -655,7 +627,7 @@ class FlowService {
|
|
655
627
|
this.integrationState.dispatch(FlowAction.ConfigureProductAction(payload));
|
656
628
|
}
|
657
629
|
else {
|
658
|
-
this.flowRouterService.navigateTo(payload.path, payload.productId, payload.
|
630
|
+
this.flowRouterService.navigateTo(payload.path, payload.productId, payload.transactionItemId);
|
659
631
|
}
|
660
632
|
}), takeUntil(this.cleanup$))
|
661
633
|
.subscribe();
|
@@ -694,20 +666,12 @@ class FlowService {
|
|
694
666
|
.pipe(map(path => path.queryParams['productId']), takeUntil(this.cleanup$))
|
695
667
|
.subscribe(productId => this.integrationState.patchState({ productId }));
|
696
668
|
}
|
697
|
-
prepareConfiguration$(lineItemId) {
|
698
|
-
if (!lineItemId) {
|
699
|
-
return of(undefined);
|
700
|
-
}
|
701
|
-
return this.flowStateService.dispatch$(UITemplateType.FLOW_ENGINE, 'UPDATE_PRICE_LIST', {
|
702
|
-
lineItemId,
|
703
|
-
});
|
704
|
-
}
|
705
669
|
}
|
706
|
-
FlowService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowService, deps: [{ token: i5.IntegrationState }, { token: FlowRouterService }, { token:
|
670
|
+
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 });
|
707
671
|
FlowService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowService });
|
708
672
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowService, decorators: [{
|
709
673
|
type: Injectable
|
710
|
-
}], ctorParameters: function () { return [{ type: i5.IntegrationState }, { type: FlowRouterService }, { type:
|
674
|
+
}], 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 }]; } });
|
711
675
|
|
712
676
|
class FlowGuidedSellingService {
|
713
677
|
constructor(integrationState) {
|
@@ -731,11 +695,11 @@ class FlowGuidedSellingService {
|
|
731
695
|
.subscribe();
|
732
696
|
}
|
733
697
|
}
|
734
|
-
FlowGuidedSellingService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowGuidedSellingService, deps: [{ token:
|
698
|
+
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 });
|
735
699
|
FlowGuidedSellingService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowGuidedSellingService });
|
736
700
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowGuidedSellingService, decorators: [{
|
737
701
|
type: Injectable
|
738
|
-
}], ctorParameters: function () { return [{ type:
|
702
|
+
}], ctorParameters: function () { return [{ type: i3$1.IntegrationState }]; } });
|
739
703
|
|
740
704
|
class FlowComponent {
|
741
705
|
constructor(routerService, flowService, flowInfoService, guidedSellingService) {
|
@@ -753,19 +717,18 @@ class FlowComponent {
|
|
753
717
|
this.flowService.cleanup();
|
754
718
|
}
|
755
719
|
}
|
756
|
-
FlowComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowComponent, deps: [{ token: FlowRouterService }, { token: FlowService }, { token:
|
757
|
-
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
|
720
|
+
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 });
|
721
|
+
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 });
|
758
722
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowComponent, decorators: [{
|
759
723
|
type: Component,
|
760
724
|
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"] }]
|
761
|
-
}], ctorParameters: function () { return [{ type: FlowRouterService }, { type: FlowService }, { type:
|
725
|
+
}], ctorParameters: function () { return [{ type: FlowRouterService }, { type: FlowService }, { type: i3$1.FlowInfoService }, { type: FlowGuidedSellingService }]; } });
|
762
726
|
|
763
727
|
const keepFlowInitialized = (route) => {
|
764
728
|
const routerService = inject(FlowRouterService);
|
765
729
|
const runtimeSettingsService = inject(RuntimeSettingsService);
|
766
730
|
const flowState = inject(FlowStateService);
|
767
731
|
const flowInfoService = inject(FlowInfoService);
|
768
|
-
const quoteDraft = inject(QuoteDraftService);
|
769
732
|
const salesTrasnsactionService = inject(SalesTransactionService);
|
770
733
|
const configurationService = inject(ConfigurationService);
|
771
734
|
const integrationState = inject(IntegrationState);
|
@@ -774,12 +737,11 @@ const keepFlowInitialized = (route) => {
|
|
774
737
|
return true;
|
775
738
|
}
|
776
739
|
// Cleanup
|
777
|
-
flowState.
|
778
|
-
quoteDraft.reset();
|
740
|
+
flowState.reset();
|
779
741
|
salesTrasnsactionService.reset();
|
780
742
|
configurationService.reset();
|
781
|
-
integrationState.
|
782
|
-
flowInfoService.
|
743
|
+
integrationState.reset();
|
744
|
+
flowInfoService.reset();
|
783
745
|
if (!flowId) {
|
784
746
|
return true;
|
785
747
|
}
|
@@ -792,15 +754,15 @@ const keepFlowInitialized = (route) => {
|
|
792
754
|
};
|
793
755
|
|
794
756
|
class ProductUnloadGuard {
|
795
|
-
constructor(router,
|
757
|
+
constructor(router, flowInfoService, configurationService, flowDialogService) {
|
796
758
|
this.router = router;
|
797
|
-
this.
|
759
|
+
this.flowInfoService = flowInfoService;
|
798
760
|
this.configurationService = configurationService;
|
799
761
|
this.flowDialogService = flowDialogService;
|
800
762
|
}
|
801
763
|
canDeactivate(_, route, currentState, nextState) {
|
802
764
|
let observable = of(true);
|
803
|
-
if (!this.
|
765
|
+
if (!this.flowInfoService.flow.properties.standalone && this.configurationService.hasUnsavedChanges) {
|
804
766
|
observable = this.flowDialogService.showUnsavedChangesDialog();
|
805
767
|
}
|
806
768
|
return observable.pipe(map(unload => {
|
@@ -823,11 +785,11 @@ class ProductUnloadGuard {
|
|
823
785
|
}));
|
824
786
|
}
|
825
787
|
}
|
826
|
-
ProductUnloadGuard.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProductUnloadGuard, deps: [{ token: i1$2.Router }, { token:
|
788
|
+
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 });
|
827
789
|
ProductUnloadGuard.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProductUnloadGuard });
|
828
790
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProductUnloadGuard, decorators: [{
|
829
791
|
type: Injectable
|
830
|
-
}], ctorParameters: function () { return [{ type: i1$2.Router }, { type:
|
792
|
+
}], ctorParameters: function () { return [{ type: i1$2.Router }, { type: i3$1.FlowInfoService }, { type: i3$1.ConfigurationService }, { type: FlowDialogService }]; } });
|
831
793
|
|
832
794
|
class RootGuard {
|
833
795
|
constructor(router, routerService) {
|
@@ -870,9 +832,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
|
|
870
832
|
}], ctorParameters: function () { return [{ type: i1$2.Router }, { type: FlowRouterService }]; } });
|
871
833
|
|
872
834
|
class AssetsComponent {
|
873
|
-
constructor(
|
835
|
+
constructor(templatesAdminApiService, cdr, toastService, flowInfo, customizationService) {
|
874
836
|
var _a, _b, _c;
|
875
|
-
this.
|
837
|
+
this.templatesAdminApiService = templatesAdminApiService;
|
876
838
|
this.cdr = cdr;
|
877
839
|
this.toastService = toastService;
|
878
840
|
this.flowInfo = flowInfo;
|
@@ -927,7 +889,7 @@ class AssetsComponent {
|
|
927
889
|
if (!template) {
|
928
890
|
return of(undefined);
|
929
891
|
}
|
930
|
-
return this.
|
892
|
+
return this.templatesAdminApiService.fetchComponentsAttachments$(template.id);
|
931
893
|
}
|
932
894
|
generateUIDefinition$() {
|
933
895
|
return of(undefined).pipe(tap(() => {
|
@@ -941,7 +903,6 @@ class AssetsComponent {
|
|
941
903
|
const uiDef = {
|
942
904
|
name: '',
|
943
905
|
createdTimestamp: 0,
|
944
|
-
primary: true,
|
945
906
|
type: 'DEFAULT',
|
946
907
|
version: 2,
|
947
908
|
children: metaList.map(meta => ({
|
@@ -955,13 +916,13 @@ class AssetsComponent {
|
|
955
916
|
}));
|
956
917
|
}
|
957
918
|
}
|
958
|
-
AssetsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: AssetsComponent, deps: [{ token: i1$1.
|
959
|
-
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
|
919
|
+
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 });
|
920
|
+
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 });
|
960
921
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: AssetsComponent, decorators: [{
|
961
922
|
type: Component,
|
962
923
|
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" }]
|
963
924
|
}], ctorParameters: function () {
|
964
|
-
return [{ type: i1$1.
|
925
|
+
return [{ type: i1$1.UITemplatesAdminApiService }, { type: i0.ChangeDetectorRef }, { type: i2.ToastService }, { type: i3$1.FlowInfoService }, { type: undefined, decorators: [{
|
965
926
|
type: Optional
|
966
927
|
}, {
|
967
928
|
type: Inject,
|
@@ -984,9 +945,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
|
|
984
945
|
}] });
|
985
946
|
|
986
947
|
class CatalogComponent {
|
987
|
-
constructor(
|
948
|
+
constructor(templatesAdminApiService, cdr, toastService, flowInfo, customizationService) {
|
988
949
|
var _a, _b, _c;
|
989
|
-
this.
|
950
|
+
this.templatesAdminApiService = templatesAdminApiService;
|
990
951
|
this.cdr = cdr;
|
991
952
|
this.toastService = toastService;
|
992
953
|
this.flowInfo = flowInfo;
|
@@ -1041,7 +1002,7 @@ class CatalogComponent {
|
|
1041
1002
|
if (!template) {
|
1042
1003
|
return of(undefined);
|
1043
1004
|
}
|
1044
|
-
return this.
|
1005
|
+
return this.templatesAdminApiService.fetchComponentsAttachments$(template.id);
|
1045
1006
|
}
|
1046
1007
|
generateUIDefinition$() {
|
1047
1008
|
return of(undefined).pipe(tap(() => {
|
@@ -1055,7 +1016,6 @@ class CatalogComponent {
|
|
1055
1016
|
const uiDef = {
|
1056
1017
|
name: '',
|
1057
1018
|
createdTimestamp: 0,
|
1058
|
-
primary: true,
|
1059
1019
|
type: 'DEFAULT',
|
1060
1020
|
version: 2,
|
1061
1021
|
children: metaList.map(meta => ({
|
@@ -1069,13 +1029,13 @@ class CatalogComponent {
|
|
1069
1029
|
}));
|
1070
1030
|
}
|
1071
1031
|
}
|
1072
|
-
CatalogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: CatalogComponent, deps: [{ token: i1$1.
|
1073
|
-
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
|
1032
|
+
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 });
|
1033
|
+
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 });
|
1074
1034
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: CatalogComponent, decorators: [{
|
1075
1035
|
type: Component,
|
1076
1036
|
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" }]
|
1077
1037
|
}], ctorParameters: function () {
|
1078
|
-
return [{ type: i1$1.
|
1038
|
+
return [{ type: i1$1.UITemplatesAdminApiService }, { type: i0.ChangeDetectorRef }, { type: i2.ToastService }, { type: i3$1.FlowInfoService }, { type: undefined, decorators: [{
|
1079
1039
|
type: Optional
|
1080
1040
|
}, {
|
1081
1041
|
type: Inject,
|
@@ -1098,11 +1058,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
|
|
1098
1058
|
}] });
|
1099
1059
|
|
1100
1060
|
class DebugComponent {
|
1101
|
-
constructor(flowsApiService, router, activatedRoute
|
1061
|
+
constructor(flowsApiService, router, activatedRoute) {
|
1102
1062
|
this.flowsApiService = flowsApiService;
|
1103
1063
|
this.router = router;
|
1104
1064
|
this.activatedRoute = activatedRoute;
|
1105
|
-
this.quoteDraftService = quoteDraftService;
|
1106
1065
|
this.form = new FormGroup({
|
1107
1066
|
id: new FormControl(''),
|
1108
1067
|
});
|
@@ -1113,8 +1072,6 @@ class DebugComponent {
|
|
1113
1072
|
if (!id || !this.selectedFlow) {
|
1114
1073
|
return;
|
1115
1074
|
}
|
1116
|
-
// Delete context before starting a new flow
|
1117
|
-
this.quoteDraftService.reset();
|
1118
1075
|
this.router.navigate(['..', 'flows'], {
|
1119
1076
|
queryParams: Object.assign({ flowId: this.selectedFlow.id, headerId: id }, this.selectedFlow.properties.queryParams),
|
1120
1077
|
relativeTo: this.activatedRoute,
|
@@ -1124,12 +1081,12 @@ class DebugComponent {
|
|
1124
1081
|
return new HttpParams({ fromObject: params }).toString();
|
1125
1082
|
}
|
1126
1083
|
}
|
1127
|
-
DebugComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DebugComponent, deps: [{ token: i1$
|
1128
|
-
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:
|
1084
|
+
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 });
|
1085
|
+
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 });
|
1129
1086
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DebugComponent, decorators: [{
|
1130
1087
|
type: Component,
|
1131
1088
|
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"] }]
|
1132
|
-
}], ctorParameters: function () { return [{ type: i1$
|
1089
|
+
}], ctorParameters: function () { return [{ type: i1$1.FlowsApiService }, { type: i1$2.Router }, { type: i1$2.ActivatedRoute }]; } });
|
1133
1090
|
|
1134
1091
|
const routes$1 = [{ path: '', component: DebugComponent }];
|
1135
1092
|
class DebugModule {
|
@@ -1167,83 +1124,28 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
|
|
1167
1124
|
}] });
|
1168
1125
|
|
1169
1126
|
class ProductComponent {
|
1170
|
-
constructor(
|
1171
|
-
|
1172
|
-
configurationService, configurationStateService, salesTransactionService, flowInfoService, integrationState, uiDefinitionsApiService, customizationService) {
|
1173
|
-
this.configurationService = configurationService;
|
1127
|
+
constructor(configurationRuntimeService, configurationStateService) {
|
1128
|
+
this.configurationRuntimeService = configurationRuntimeService;
|
1174
1129
|
this.configurationStateService = configurationStateService;
|
1175
|
-
this.salesTransactionService = salesTransactionService;
|
1176
|
-
this.flowInfoService = flowInfoService;
|
1177
|
-
this.integrationState = integrationState;
|
1178
|
-
this.uiDefinitionsApiService = uiDefinitionsApiService;
|
1179
|
-
this.customizationService = customizationService;
|
1180
1130
|
this.uiDefinitionContainer$ = new BehaviorSubject(null);
|
1131
|
+
this.showNotFound$ = new BehaviorSubject(false);
|
1132
|
+
this.uiDefinitionContainer$.next(this.configurationRuntimeService.uiDefinitionContainer);
|
1181
1133
|
this.config = {
|
1182
1134
|
init$: () => this.init$(),
|
1183
1135
|
};
|
1184
1136
|
}
|
1185
|
-
customizeUI$() {
|
1186
|
-
var _a;
|
1187
|
-
const { productId } = this.flowInfoService.context;
|
1188
|
-
if (!productId || !((_a = this.customizationService) === null || _a === void 0 ? void 0 : _a.getUiDefinition)) {
|
1189
|
-
return of(undefined);
|
1190
|
-
}
|
1191
|
-
return this.customizationService.getUiDefinition(productId).pipe(map(uiDefinitionContainer => {
|
1192
|
-
this.uiDefinitionContainer$.next(uiDefinitionContainer);
|
1193
|
-
}));
|
1194
|
-
}
|
1195
|
-
fetchUIDefinition$() {
|
1196
|
-
const flowContext = this.flowInfoService.context;
|
1197
|
-
if (flowContext.requiredUIDefinitionId) {
|
1198
|
-
return this.uiDefinitionsApiService
|
1199
|
-
.fetchUIDefinition$(flowContext.requiredUIDefinitionId)
|
1200
|
-
.pipe(map((uiDefContainer) => this.uiDefinitionContainer$.next(uiDefContainer)));
|
1201
|
-
}
|
1202
|
-
return this.uiDefinitionsApiService
|
1203
|
-
.fetchUIDefinitions$({
|
1204
|
-
productId: flowContext.productId,
|
1205
|
-
defaultUIDefinitionId: flowContext.defaultUIDefinitionId,
|
1206
|
-
})
|
1207
|
-
.pipe(map((uiDefinitionContainers) => {
|
1208
|
-
const uiDefContainer = uiDefinitionContainers[0];
|
1209
|
-
if (uiDefContainer) {
|
1210
|
-
this.uiDefinitionContainer$.next(uiDefContainer);
|
1211
|
-
}
|
1212
|
-
}));
|
1213
|
-
}
|
1214
1137
|
init$() {
|
1215
|
-
|
1216
|
-
|
1217
|
-
|
1218
|
-
}
|
1219
|
-
else {
|
1220
|
-
state$ = of(undefined);
|
1221
|
-
}
|
1222
|
-
return state$.pipe(first(), tap(() => {
|
1223
|
-
if (!this.flowInfoService.context.productId) {
|
1224
|
-
throw new Error(`Unable to start configuration for 'productId == null'`);
|
1225
|
-
}
|
1226
|
-
}), switchMap(() => this.customizeUI$()), switchMap(() => (this.uiDefinitionContainer$.value ? of(undefined) : this.fetchUIDefinition$())), tap(() => {
|
1227
|
-
if (!this.uiDefinitionContainer$.value) {
|
1228
|
-
throw new Error('Product does not have Configuration UI');
|
1229
|
-
}
|
1230
|
-
}), switchMap(() => this.configurationStateService.init$()), switchMap(() => timer(1)), // wait until updates inputs on child components
|
1231
|
-
map(noop));
|
1138
|
+
return this.configurationStateService.init$().pipe(tap(() => {
|
1139
|
+
this.showNotFound$.next(Boolean(!this.uiDefinitionContainer$.value));
|
1140
|
+
}));
|
1232
1141
|
}
|
1233
1142
|
}
|
1234
|
-
ProductComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProductComponent, deps: [{ token:
|
1235
|
-
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\" [config]=\"config\"></vl-cms-preview>\n", styles: [""], dependencies: [{ kind: "component", type: i5.PreviewComponent, selector: "vl-cms-preview", inputs: ["uiDefinition", "config"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
1143
|
+
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 }], target: i0.ɵɵFactoryTarget.Component });
|
1144
|
+
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\" [config]=\"config\"></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 });
|
1236
1145
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProductComponent, decorators: [{
|
1237
1146
|
type: Component,
|
1238
|
-
args: [{ selector: 'vl-flow-product', changeDetection: ChangeDetectionStrategy.OnPush, template: "<vl-cms-preview [uiDefinition]=\"(uiDefinitionContainer$ | async)?.source\" [config]=\"config\"></vl-cms-preview>\n" }]
|
1239
|
-
}], ctorParameters: function () {
|
1240
|
-
return [{ type: i2.ConfigurationService }, { type: i2.ConfigurationStateService }, { type: i2.SalesTransactionService }, { type: i2.FlowInfoService }, { type: i2.IntegrationState }, { type: i1$1.UIDefinitionsApiService }, { type: undefined, decorators: [{
|
1241
|
-
type: Optional
|
1242
|
-
}, {
|
1243
|
-
type: Inject,
|
1244
|
-
args: [FLOW_CUSTOMIZATION]
|
1245
|
-
}] }];
|
1246
|
-
} });
|
1147
|
+
args: [{ selector: 'vl-flow-product', changeDetection: ChangeDetectionStrategy.OnPush, template: "<vl-cms-preview [uiDefinition]=\"(uiDefinitionContainer$ | async)?.source\" [config]=\"config\"></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"] }]
|
1148
|
+
}], ctorParameters: function () { return [{ type: i3$1.ConfigurationRuntimeService }, { type: i3$1.ConfigurationStateService }]; } });
|
1247
1149
|
|
1248
1150
|
class ProductModule {
|
1249
1151
|
}
|
@@ -1260,9 +1162,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
|
|
1260
1162
|
}] });
|
1261
1163
|
|
1262
1164
|
class RecordNotFoundComponent {
|
1263
|
-
constructor(router
|
1165
|
+
constructor(router) {
|
1264
1166
|
this.router = router;
|
1265
|
-
this.route = route;
|
1266
1167
|
this.subMessage = '';
|
1267
1168
|
this.type = '';
|
1268
1169
|
const navigation = this.router.getCurrentNavigation();
|
@@ -1275,12 +1176,12 @@ class RecordNotFoundComponent {
|
|
1275
1176
|
}
|
1276
1177
|
}
|
1277
1178
|
}
|
1278
|
-
RecordNotFoundComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RecordNotFoundComponent, deps: [{ token: i1$2.Router }
|
1179
|
+
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 });
|
1279
1180
|
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 });
|
1280
1181
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RecordNotFoundComponent, decorators: [{
|
1281
1182
|
type: Component,
|
1282
1183
|
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"] }]
|
1283
|
-
}], ctorParameters: function () { return [{ type: i1$2.Router }
|
1184
|
+
}], ctorParameters: function () { return [{ type: i1$2.Router }]; } });
|
1284
1185
|
|
1285
1186
|
const routes = [{ path: '', component: RecordNotFoundComponent }];
|
1286
1187
|
class RecordNotFoundModule {
|
@@ -1297,9 +1198,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
|
|
1297
1198
|
}] });
|
1298
1199
|
|
1299
1200
|
class ShoppingCartComponent {
|
1300
|
-
constructor(
|
1201
|
+
constructor(templatesAdminApiService, cdr, toastService, flowInfo, customizationService) {
|
1301
1202
|
var _a, _b, _c;
|
1302
|
-
this.
|
1203
|
+
this.templatesAdminApiService = templatesAdminApiService;
|
1303
1204
|
this.cdr = cdr;
|
1304
1205
|
this.toastService = toastService;
|
1305
1206
|
this.flowInfo = flowInfo;
|
@@ -1354,7 +1255,7 @@ class ShoppingCartComponent {
|
|
1354
1255
|
if (!template) {
|
1355
1256
|
return of(undefined);
|
1356
1257
|
}
|
1357
|
-
return this.
|
1258
|
+
return this.templatesAdminApiService.fetchComponentsAttachments$(template.id);
|
1358
1259
|
}
|
1359
1260
|
generateUIDefinition$() {
|
1360
1261
|
return of(undefined).pipe(tap(() => {
|
@@ -1368,7 +1269,6 @@ class ShoppingCartComponent {
|
|
1368
1269
|
const uiDef = {
|
1369
1270
|
name: '',
|
1370
1271
|
createdTimestamp: 0,
|
1371
|
-
primary: true,
|
1372
1272
|
type: 'DEFAULT',
|
1373
1273
|
version: 2,
|
1374
1274
|
children: metaList.map(meta => ({
|
@@ -1382,13 +1282,13 @@ class ShoppingCartComponent {
|
|
1382
1282
|
}));
|
1383
1283
|
}
|
1384
1284
|
}
|
1385
|
-
ShoppingCartComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ShoppingCartComponent, deps: [{ token: i1$1.
|
1386
|
-
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
|
1285
|
+
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 });
|
1286
|
+
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 });
|
1387
1287
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ShoppingCartComponent, decorators: [{
|
1388
1288
|
type: Component,
|
1389
1289
|
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" }]
|
1390
1290
|
}], ctorParameters: function () {
|
1391
|
-
return [{ type: i1$1.
|
1291
|
+
return [{ type: i1$1.UITemplatesAdminApiService }, { type: i0.ChangeDetectorRef }, { type: i2.ToastService }, { type: i3$1.FlowInfoService }, { type: undefined, decorators: [{
|
1392
1292
|
type: Optional
|
1393
1293
|
}, {
|
1394
1294
|
type: Inject,
|
@@ -1439,19 +1339,29 @@ class FlowResolver {
|
|
1439
1339
|
}));
|
1440
1340
|
}
|
1441
1341
|
}
|
1442
|
-
FlowResolver.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowResolver, deps: [{ token: i1$2.Router }, { token: FlowRouterService }, { token:
|
1342
|
+
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 });
|
1443
1343
|
FlowResolver.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowResolver });
|
1444
1344
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowResolver, decorators: [{
|
1445
1345
|
type: Injectable
|
1446
|
-
}], ctorParameters: function () { return [{ type: i1$2.Router }, { type: FlowRouterService }, { type:
|
1346
|
+
}], ctorParameters: function () { return [{ type: i1$2.Router }, { type: FlowRouterService }, { type: i3$1.FlowInfoService }]; } });
|
1447
1347
|
|
1448
|
-
|
1449
|
-
|
1348
|
+
const resolvePCMModel = () => {
|
1349
|
+
const flowInfoService = inject(FlowInfoService);
|
1350
|
+
const configurationRuntimeService = inject(ConfigurationRuntimeService);
|
1351
|
+
const { productId } = flowInfoService.context;
|
1352
|
+
if (!productId) {
|
1353
|
+
throw new Error(`Unable to start configuration for 'productId == null'`);
|
1354
|
+
}
|
1355
|
+
return configurationRuntimeService.init$({ productId });
|
1356
|
+
};
|
1357
|
+
|
1358
|
+
class SalesTransactionResolver {
|
1359
|
+
constructor(router, routerService, flowInfoService, flowStateService, salesTransactionService) {
|
1450
1360
|
this.router = router;
|
1451
|
-
this.quoteDraftService = quoteDraftService;
|
1452
1361
|
this.routerService = routerService;
|
1453
1362
|
this.flowInfoService = flowInfoService;
|
1454
1363
|
this.flowStateService = flowStateService;
|
1364
|
+
this.salesTransactionService = salesTransactionService;
|
1455
1365
|
}
|
1456
1366
|
resolve(route) {
|
1457
1367
|
const flow = this.flowInfoService.flow;
|
@@ -1488,33 +1398,55 @@ class QuoteResolver {
|
|
1488
1398
|
}));
|
1489
1399
|
}
|
1490
1400
|
getNavigateTo() {
|
1491
|
-
|
1492
|
-
|
1493
|
-
if (flow === null || flow === void 0 ? void 0 : flow.properties.stateful) {
|
1494
|
-
return this.flowStateService.select$(UITemplateType.FLOW_ENGINE, 'NAVIGATE_TO').pipe(map(r => {
|
1495
|
-
if (r.success) {
|
1496
|
-
return r.result;
|
1497
|
-
}
|
1498
|
-
return '';
|
1499
|
-
}));
|
1500
|
-
}
|
1501
|
-
else {
|
1502
|
-
const isAccountMode = this.flowInfoService.context.mode === ConfigurationContextMode.ACCOUNT;
|
1503
|
-
if (isAccountMode || this.quoteDraftService.hasAssets) {
|
1504
|
-
navigateTo = '/assets';
|
1505
|
-
}
|
1506
|
-
else if (this.quoteDraftService.hasProducts) {
|
1507
|
-
navigateTo = '/cart';
|
1508
|
-
}
|
1509
|
-
}
|
1510
|
-
return of(navigateTo);
|
1401
|
+
// Implement when needed
|
1402
|
+
return of('');
|
1511
1403
|
}
|
1512
1404
|
}
|
1513
|
-
|
1514
|
-
|
1515
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type:
|
1405
|
+
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 });
|
1406
|
+
SalesTransactionResolver.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SalesTransactionResolver });
|
1407
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SalesTransactionResolver, decorators: [{
|
1516
1408
|
type: Injectable
|
1517
|
-
}], ctorParameters: function () { return [{ type: i1$2.Router }, { type:
|
1409
|
+
}], ctorParameters: function () { return [{ type: i1$2.Router }, { type: FlowRouterService }, { type: i3$1.FlowInfoService }, { type: i3$1.FlowStateService }, { type: i3$1.SalesTransactionService }]; } });
|
1410
|
+
|
1411
|
+
const resolveUIDefinition = () => {
|
1412
|
+
const customizationService = inject(FLOW_CUSTOMIZATION, { optional: true });
|
1413
|
+
const flowInfoService = inject(FlowInfoService);
|
1414
|
+
const uiDefinitionsAdminApiService = inject(UIDefinitionsAdminApiService);
|
1415
|
+
const configurationRuntimeService = inject(ConfigurationRuntimeService);
|
1416
|
+
const { productId } = flowInfoService.context;
|
1417
|
+
if (!productId) {
|
1418
|
+
throw new Error(`Unable to start configuration for 'productId == null'`);
|
1419
|
+
}
|
1420
|
+
return of(undefined).pipe(switchMap(() => {
|
1421
|
+
// Try resolving via customization service
|
1422
|
+
if (!productId || !(customizationService === null || customizationService === void 0 ? void 0 : customizationService.getUiDefinition)) {
|
1423
|
+
return of(undefined);
|
1424
|
+
}
|
1425
|
+
return customizationService.getUiDefinition(flowInfoService.context);
|
1426
|
+
}), switchMap(uiDefContainer => {
|
1427
|
+
// Resolve UIDefinition from the org
|
1428
|
+
if (uiDefContainer) {
|
1429
|
+
return of(uiDefContainer);
|
1430
|
+
}
|
1431
|
+
if (flowInfoService.context.requiredUIDefinitionId) {
|
1432
|
+
return uiDefinitionsAdminApiService.fetch$(flowInfoService.context.requiredUIDefinitionId, {
|
1433
|
+
skipErrorHandler: true,
|
1434
|
+
});
|
1435
|
+
}
|
1436
|
+
return uiDefinitionsAdminApiService
|
1437
|
+
.fetchAll$({
|
1438
|
+
productId,
|
1439
|
+
defaultUIDefinitionId: flowInfoService.context.defaultUIDefinitionId,
|
1440
|
+
}, { skipErrorHandler: true })
|
1441
|
+
.pipe(map((uiDefinitionContainers) => {
|
1442
|
+
const uiDefContainer = uiDefinitionContainers[0];
|
1443
|
+
if (!uiDefContainer) {
|
1444
|
+
throw new Error(`UI Definition for productId=${productId} is not resolved`);
|
1445
|
+
}
|
1446
|
+
return uiDefContainer;
|
1447
|
+
}));
|
1448
|
+
}), catchError(() => of(null)), tap(uiDefContainer => (configurationRuntimeService.uiDefinitionContainer = uiDefContainer)));
|
1449
|
+
};
|
1518
1450
|
|
1519
1451
|
const rootRoute = {
|
1520
1452
|
id: VELOCE_FLOW_ROOT_ROUTE,
|
@@ -1538,7 +1470,7 @@ const rootRoute = {
|
|
1538
1470
|
path: 'product',
|
1539
1471
|
component: ProductComponent,
|
1540
1472
|
runGuardsAndResolvers: 'paramsOrQueryParamsChange',
|
1541
|
-
resolve: {
|
1473
|
+
resolve: { salesTransaction: SalesTransactionResolver, uiDef: resolveUIDefinition, pcm: resolvePCMModel },
|
1542
1474
|
canDeactivate: [ProductUnloadGuard],
|
1543
1475
|
data: { showHeader: true },
|
1544
1476
|
},
|
@@ -1546,21 +1478,21 @@ const rootRoute = {
|
|
1546
1478
|
path: 'cart',
|
1547
1479
|
component: ShoppingCartComponent,
|
1548
1480
|
runGuardsAndResolvers: 'paramsOrQueryParamsChange',
|
1549
|
-
resolve: {
|
1481
|
+
resolve: { salesTransaction: SalesTransactionResolver },
|
1550
1482
|
data: { showHeader: true },
|
1551
1483
|
},
|
1552
1484
|
{
|
1553
1485
|
path: 'catalog',
|
1554
1486
|
component: CatalogComponent,
|
1555
1487
|
runGuardsAndResolvers: 'paramsOrQueryParamsChange',
|
1556
|
-
resolve: {
|
1488
|
+
resolve: { salesTransaction: SalesTransactionResolver },
|
1557
1489
|
data: { showHeader: true },
|
1558
1490
|
},
|
1559
1491
|
{
|
1560
1492
|
path: 'assets',
|
1561
1493
|
component: AssetsComponent,
|
1562
1494
|
runGuardsAndResolvers: 'paramsOrQueryParamsChange',
|
1563
|
-
resolve: {
|
1495
|
+
resolve: { salesTransaction: SalesTransactionResolver },
|
1564
1496
|
data: { showHeader: true },
|
1565
1497
|
},
|
1566
1498
|
{
|
@@ -1579,13 +1511,13 @@ class FlowRoutingModule {
|
|
1579
1511
|
}
|
1580
1512
|
FlowRoutingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowRoutingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
1581
1513
|
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] });
|
1582
|
-
FlowRoutingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowRoutingModule, providers: [FlowRouterService, RootGuard, ProductUnloadGuard, FlowResolver,
|
1514
|
+
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] });
|
1583
1515
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowRoutingModule, decorators: [{
|
1584
1516
|
type: NgModule,
|
1585
1517
|
args: [{
|
1586
1518
|
imports: [RouterModule.forChild([rootRoute]), ProductModule, ShoppingCartModule, CatalogModule, AssetsModule],
|
1587
1519
|
exports: [RouterModule],
|
1588
|
-
providers: [FlowRouterService, RootGuard, ProductUnloadGuard, FlowResolver,
|
1520
|
+
providers: [FlowRouterService, RootGuard, ProductUnloadGuard, FlowResolver, SalesTransactionResolver],
|
1589
1521
|
}]
|
1590
1522
|
}] });
|
1591
1523
|
|
@@ -1633,22 +1565,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
|
|
1633
1565
|
}]
|
1634
1566
|
}] });
|
1635
1567
|
|
1636
|
-
const getFlowObjectIdPropertyName = (id) => {
|
1637
|
-
const objectName = SalesforceIdUtils.getSfObjectNameById(id);
|
1638
|
-
switch (objectName) {
|
1639
|
-
case 'Account':
|
1640
|
-
return 'accountId';
|
1641
|
-
case 'Order':
|
1642
|
-
return 'orderId';
|
1643
|
-
case 'Quote':
|
1644
|
-
default:
|
1645
|
-
return 'quoteId';
|
1646
|
-
}
|
1647
|
-
};
|
1648
|
-
|
1649
1568
|
/**
|
1650
1569
|
* Generated bundle index. Do not edit.
|
1651
1570
|
*/
|
1652
1571
|
|
1653
|
-
export { FlowDialogService, FlowModule, FlowRouterService, FlowService, VELOCE_FLOW_ROOT_ROUTE
|
1572
|
+
export { FlowDialogService, FlowModule, FlowRouterService, FlowService, VELOCE_FLOW_ROOT_ROUTE };
|
1654
1573
|
//# sourceMappingURL=veloceapps-sdk.mjs.map
|