@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
|
-
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;
|
@@ -385,6 +383,15 @@ class FlowRouterService {
|
|
385
383
|
this.integrationState.dispatch(FlowAction.CloseGuidedSelling({ keepState: true }));
|
386
384
|
});
|
387
385
|
}
|
386
|
+
get route$() {
|
387
|
+
return this.lastChildRoute$;
|
388
|
+
}
|
389
|
+
get params$() {
|
390
|
+
return this.lastChildParams$;
|
391
|
+
}
|
392
|
+
get params() {
|
393
|
+
return this.getLastChildParams(this.route.snapshot);
|
394
|
+
}
|
388
395
|
getFlowRootRoute(route) {
|
389
396
|
var _a;
|
390
397
|
const path = [...route.pathFromRoot];
|
@@ -410,15 +417,6 @@ class FlowRouterService {
|
|
410
417
|
.join('/');
|
411
418
|
return '/' + path;
|
412
419
|
}
|
413
|
-
get route$() {
|
414
|
-
return this.lastChildRoute$;
|
415
|
-
}
|
416
|
-
get params$() {
|
417
|
-
return this.lastChildParams$;
|
418
|
-
}
|
419
|
-
get params() {
|
420
|
-
return this.getLastChildParams(this.route.snapshot);
|
421
|
-
}
|
422
420
|
isConfigurationRoute$() {
|
423
421
|
return this.getFlowSubpath$().pipe(map(url => url.startsWith('product')));
|
424
422
|
}
|
@@ -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,21 +754,24 @@ 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 => {
|
769
|
+
var _a;
|
807
770
|
if (unload) {
|
808
771
|
this.configurationService.reset();
|
809
|
-
|
772
|
+
const currentUrl = currentState.url.split('?')[0];
|
773
|
+
const nextUrl = ((_a = nextState === null || nextState === void 0 ? void 0 : nextState.url) !== null && _a !== void 0 ? _a : '').split('?')[0];
|
774
|
+
if (!nextState || currentUrl === nextUrl) {
|
810
775
|
return true;
|
811
776
|
}
|
812
777
|
// clear obsolete queryParams
|
@@ -823,11 +788,11 @@ class ProductUnloadGuard {
|
|
823
788
|
}));
|
824
789
|
}
|
825
790
|
}
|
826
|
-
ProductUnloadGuard.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProductUnloadGuard, deps: [{ token: i1$2.Router }, { token:
|
791
|
+
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
792
|
ProductUnloadGuard.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProductUnloadGuard });
|
828
793
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProductUnloadGuard, decorators: [{
|
829
794
|
type: Injectable
|
830
|
-
}], ctorParameters: function () { return [{ type: i1$2.Router }, { type:
|
795
|
+
}], ctorParameters: function () { return [{ type: i1$2.Router }, { type: i3$1.FlowInfoService }, { type: i3$1.ConfigurationService }, { type: FlowDialogService }]; } });
|
831
796
|
|
832
797
|
class RootGuard {
|
833
798
|
constructor(router, routerService) {
|
@@ -870,9 +835,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
|
|
870
835
|
}], ctorParameters: function () { return [{ type: i1$2.Router }, { type: FlowRouterService }]; } });
|
871
836
|
|
872
837
|
class AssetsComponent {
|
873
|
-
constructor(
|
838
|
+
constructor(templatesAdminApiService, cdr, toastService, flowInfo, customizationService) {
|
874
839
|
var _a, _b, _c;
|
875
|
-
this.
|
840
|
+
this.templatesAdminApiService = templatesAdminApiService;
|
876
841
|
this.cdr = cdr;
|
877
842
|
this.toastService = toastService;
|
878
843
|
this.flowInfo = flowInfo;
|
@@ -927,7 +892,7 @@ class AssetsComponent {
|
|
927
892
|
if (!template) {
|
928
893
|
return of(undefined);
|
929
894
|
}
|
930
|
-
return this.
|
895
|
+
return this.templatesAdminApiService.fetchComponentsAttachments$(template.id);
|
931
896
|
}
|
932
897
|
generateUIDefinition$() {
|
933
898
|
return of(undefined).pipe(tap(() => {
|
@@ -941,7 +906,6 @@ class AssetsComponent {
|
|
941
906
|
const uiDef = {
|
942
907
|
name: '',
|
943
908
|
createdTimestamp: 0,
|
944
|
-
primary: true,
|
945
909
|
type: 'DEFAULT',
|
946
910
|
version: 2,
|
947
911
|
children: metaList.map(meta => ({
|
@@ -955,13 +919,13 @@ class AssetsComponent {
|
|
955
919
|
}));
|
956
920
|
}
|
957
921
|
}
|
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
|
922
|
+
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 });
|
923
|
+
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
924
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: AssetsComponent, decorators: [{
|
961
925
|
type: Component,
|
962
926
|
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
927
|
}], ctorParameters: function () {
|
964
|
-
return [{ type: i1$1.
|
928
|
+
return [{ type: i1$1.UITemplatesAdminApiService }, { type: i0.ChangeDetectorRef }, { type: i2.ToastService }, { type: i3$1.FlowInfoService }, { type: undefined, decorators: [{
|
965
929
|
type: Optional
|
966
930
|
}, {
|
967
931
|
type: Inject,
|
@@ -984,9 +948,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
|
|
984
948
|
}] });
|
985
949
|
|
986
950
|
class CatalogComponent {
|
987
|
-
constructor(
|
951
|
+
constructor(templatesAdminApiService, cdr, toastService, flowInfo, customizationService) {
|
988
952
|
var _a, _b, _c;
|
989
|
-
this.
|
953
|
+
this.templatesAdminApiService = templatesAdminApiService;
|
990
954
|
this.cdr = cdr;
|
991
955
|
this.toastService = toastService;
|
992
956
|
this.flowInfo = flowInfo;
|
@@ -1041,7 +1005,7 @@ class CatalogComponent {
|
|
1041
1005
|
if (!template) {
|
1042
1006
|
return of(undefined);
|
1043
1007
|
}
|
1044
|
-
return this.
|
1008
|
+
return this.templatesAdminApiService.fetchComponentsAttachments$(template.id);
|
1045
1009
|
}
|
1046
1010
|
generateUIDefinition$() {
|
1047
1011
|
return of(undefined).pipe(tap(() => {
|
@@ -1055,7 +1019,6 @@ class CatalogComponent {
|
|
1055
1019
|
const uiDef = {
|
1056
1020
|
name: '',
|
1057
1021
|
createdTimestamp: 0,
|
1058
|
-
primary: true,
|
1059
1022
|
type: 'DEFAULT',
|
1060
1023
|
version: 2,
|
1061
1024
|
children: metaList.map(meta => ({
|
@@ -1069,13 +1032,13 @@ class CatalogComponent {
|
|
1069
1032
|
}));
|
1070
1033
|
}
|
1071
1034
|
}
|
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
|
1035
|
+
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 });
|
1036
|
+
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
1037
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: CatalogComponent, decorators: [{
|
1075
1038
|
type: Component,
|
1076
1039
|
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
1040
|
}], ctorParameters: function () {
|
1078
|
-
return [{ type: i1$1.
|
1041
|
+
return [{ type: i1$1.UITemplatesAdminApiService }, { type: i0.ChangeDetectorRef }, { type: i2.ToastService }, { type: i3$1.FlowInfoService }, { type: undefined, decorators: [{
|
1079
1042
|
type: Optional
|
1080
1043
|
}, {
|
1081
1044
|
type: Inject,
|
@@ -1098,11 +1061,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
|
|
1098
1061
|
}] });
|
1099
1062
|
|
1100
1063
|
class DebugComponent {
|
1101
|
-
constructor(flowsApiService, router, activatedRoute
|
1064
|
+
constructor(flowsApiService, router, activatedRoute) {
|
1102
1065
|
this.flowsApiService = flowsApiService;
|
1103
1066
|
this.router = router;
|
1104
1067
|
this.activatedRoute = activatedRoute;
|
1105
|
-
this.quoteDraftService = quoteDraftService;
|
1106
1068
|
this.form = new FormGroup({
|
1107
1069
|
id: new FormControl(''),
|
1108
1070
|
});
|
@@ -1113,8 +1075,6 @@ class DebugComponent {
|
|
1113
1075
|
if (!id || !this.selectedFlow) {
|
1114
1076
|
return;
|
1115
1077
|
}
|
1116
|
-
// Delete context before starting a new flow
|
1117
|
-
this.quoteDraftService.reset();
|
1118
1078
|
this.router.navigate(['..', 'flows'], {
|
1119
1079
|
queryParams: Object.assign({ flowId: this.selectedFlow.id, headerId: id }, this.selectedFlow.properties.queryParams),
|
1120
1080
|
relativeTo: this.activatedRoute,
|
@@ -1124,12 +1084,12 @@ class DebugComponent {
|
|
1124
1084
|
return new HttpParams({ fromObject: params }).toString();
|
1125
1085
|
}
|
1126
1086
|
}
|
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:
|
1087
|
+
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 });
|
1088
|
+
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
1089
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: DebugComponent, decorators: [{
|
1130
1090
|
type: Component,
|
1131
1091
|
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$
|
1092
|
+
}], ctorParameters: function () { return [{ type: i1$1.FlowsApiService }, { type: i1$2.Router }, { type: i1$2.ActivatedRoute }]; } });
|
1133
1093
|
|
1134
1094
|
const routes$1 = [{ path: '', component: DebugComponent }];
|
1135
1095
|
class DebugModule {
|
@@ -1167,83 +1127,50 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
|
|
1167
1127
|
}] });
|
1168
1128
|
|
1169
1129
|
class ProductComponent {
|
1170
|
-
constructor(
|
1171
|
-
|
1172
|
-
configurationService, configurationStateService, salesTransactionService, flowInfoService, integrationState, uiDefinitionsApiService, customizationService) {
|
1173
|
-
this.configurationService = configurationService;
|
1130
|
+
constructor(configurationRuntimeService, configurationStateService, flowService, route) {
|
1131
|
+
this.configurationRuntimeService = configurationRuntimeService;
|
1174
1132
|
this.configurationStateService = configurationStateService;
|
1175
|
-
this.
|
1176
|
-
this.
|
1177
|
-
this.integrationState = integrationState;
|
1178
|
-
this.uiDefinitionsApiService = uiDefinitionsApiService;
|
1179
|
-
this.customizationService = customizationService;
|
1133
|
+
this.flowService = flowService;
|
1134
|
+
this.route = route;
|
1180
1135
|
this.uiDefinitionContainer$ = new BehaviorSubject(null);
|
1136
|
+
this.showNotFound$ = new BehaviorSubject(false);
|
1137
|
+
this.isInitialized$ = new BehaviorSubject(true);
|
1138
|
+
this.destroy$ = new Subject();
|
1139
|
+
this.uiDefinitionContainer$.next(this.configurationRuntimeService.uiDefinitionContainer);
|
1181
1140
|
this.config = {
|
1182
1141
|
init$: () => this.init$(),
|
1183
1142
|
};
|
1184
1143
|
}
|
1185
|
-
|
1186
|
-
|
1187
|
-
|
1188
|
-
|
1189
|
-
|
1190
|
-
|
1191
|
-
|
1192
|
-
|
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);
|
1144
|
+
ngOnInit() {
|
1145
|
+
let prevParams;
|
1146
|
+
this.route.queryParams
|
1147
|
+
.pipe(tap(params => {
|
1148
|
+
if (prevParams && prevParams['productId'] !== params['productId']) {
|
1149
|
+
this.isInitialized$.next(false);
|
1150
|
+
setTimeout(() => {
|
1151
|
+
this.isInitialized$.next(true);
|
1152
|
+
}, 0);
|
1211
1153
|
}
|
1212
|
-
|
1154
|
+
prevParams = params;
|
1155
|
+
}))
|
1156
|
+
.subscribe();
|
1157
|
+
}
|
1158
|
+
ngOnDestroy() {
|
1159
|
+
this.destroy$.next();
|
1160
|
+
this.destroy$.complete();
|
1213
1161
|
}
|
1214
1162
|
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));
|
1163
|
+
return this.configurationStateService.init$().pipe(tap(() => {
|
1164
|
+
this.showNotFound$.next(Boolean(!this.uiDefinitionContainer$.value));
|
1165
|
+
}));
|
1232
1166
|
}
|
1233
1167
|
}
|
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\"
|
1168
|
+
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 });
|
1169
|
+
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 });
|
1236
1170
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ProductComponent, decorators: [{
|
1237
1171
|
type: Component,
|
1238
|
-
args: [{ selector: 'vl-flow-product', changeDetection: ChangeDetectionStrategy.OnPush, template: "<vl-cms-preview [uiDefinition]=\"(uiDefinitionContainer$ | async)?.source\"
|
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
|
-
} });
|
1172
|
+
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"] }]
|
1173
|
+
}], ctorParameters: function () { return [{ type: i3$1.ConfigurationRuntimeService }, { type: i3$1.ConfigurationStateService }, { type: i3$1.FlowInfoService }, { type: i1$2.ActivatedRoute }]; } });
|
1247
1174
|
|
1248
1175
|
class ProductModule {
|
1249
1176
|
}
|
@@ -1260,9 +1187,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
|
|
1260
1187
|
}] });
|
1261
1188
|
|
1262
1189
|
class RecordNotFoundComponent {
|
1263
|
-
constructor(router
|
1190
|
+
constructor(router) {
|
1264
1191
|
this.router = router;
|
1265
|
-
this.route = route;
|
1266
1192
|
this.subMessage = '';
|
1267
1193
|
this.type = '';
|
1268
1194
|
const navigation = this.router.getCurrentNavigation();
|
@@ -1275,12 +1201,12 @@ class RecordNotFoundComponent {
|
|
1275
1201
|
}
|
1276
1202
|
}
|
1277
1203
|
}
|
1278
|
-
RecordNotFoundComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RecordNotFoundComponent, deps: [{ token: i1$2.Router }
|
1204
|
+
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
1205
|
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
1206
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: RecordNotFoundComponent, decorators: [{
|
1281
1207
|
type: Component,
|
1282
1208
|
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 }
|
1209
|
+
}], ctorParameters: function () { return [{ type: i1$2.Router }]; } });
|
1284
1210
|
|
1285
1211
|
const routes = [{ path: '', component: RecordNotFoundComponent }];
|
1286
1212
|
class RecordNotFoundModule {
|
@@ -1297,9 +1223,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
|
|
1297
1223
|
}] });
|
1298
1224
|
|
1299
1225
|
class ShoppingCartComponent {
|
1300
|
-
constructor(
|
1226
|
+
constructor(templatesAdminApiService, cdr, toastService, flowInfo, customizationService) {
|
1301
1227
|
var _a, _b, _c;
|
1302
|
-
this.
|
1228
|
+
this.templatesAdminApiService = templatesAdminApiService;
|
1303
1229
|
this.cdr = cdr;
|
1304
1230
|
this.toastService = toastService;
|
1305
1231
|
this.flowInfo = flowInfo;
|
@@ -1354,7 +1280,7 @@ class ShoppingCartComponent {
|
|
1354
1280
|
if (!template) {
|
1355
1281
|
return of(undefined);
|
1356
1282
|
}
|
1357
|
-
return this.
|
1283
|
+
return this.templatesAdminApiService.fetchComponentsAttachments$(template.id);
|
1358
1284
|
}
|
1359
1285
|
generateUIDefinition$() {
|
1360
1286
|
return of(undefined).pipe(tap(() => {
|
@@ -1368,7 +1294,6 @@ class ShoppingCartComponent {
|
|
1368
1294
|
const uiDef = {
|
1369
1295
|
name: '',
|
1370
1296
|
createdTimestamp: 0,
|
1371
|
-
primary: true,
|
1372
1297
|
type: 'DEFAULT',
|
1373
1298
|
version: 2,
|
1374
1299
|
children: metaList.map(meta => ({
|
@@ -1382,13 +1307,13 @@ class ShoppingCartComponent {
|
|
1382
1307
|
}));
|
1383
1308
|
}
|
1384
1309
|
}
|
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
|
1310
|
+
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 });
|
1311
|
+
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
1312
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: ShoppingCartComponent, decorators: [{
|
1388
1313
|
type: Component,
|
1389
1314
|
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
1315
|
}], ctorParameters: function () {
|
1391
|
-
return [{ type: i1$1.
|
1316
|
+
return [{ type: i1$1.UITemplatesAdminApiService }, { type: i0.ChangeDetectorRef }, { type: i2.ToastService }, { type: i3$1.FlowInfoService }, { type: undefined, decorators: [{
|
1392
1317
|
type: Optional
|
1393
1318
|
}, {
|
1394
1319
|
type: Inject,
|
@@ -1439,19 +1364,29 @@ class FlowResolver {
|
|
1439
1364
|
}));
|
1440
1365
|
}
|
1441
1366
|
}
|
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:
|
1367
|
+
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
1368
|
FlowResolver.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowResolver });
|
1444
1369
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowResolver, decorators: [{
|
1445
1370
|
type: Injectable
|
1446
|
-
}], ctorParameters: function () { return [{ type: i1$2.Router }, { type: FlowRouterService }, { type:
|
1371
|
+
}], ctorParameters: function () { return [{ type: i1$2.Router }, { type: FlowRouterService }, { type: i3$1.FlowInfoService }]; } });
|
1447
1372
|
|
1448
|
-
|
1449
|
-
|
1373
|
+
const resolvePCMModel = () => {
|
1374
|
+
const flowInfoService = inject(FlowInfoService);
|
1375
|
+
const configurationRuntimeService = inject(ConfigurationRuntimeService);
|
1376
|
+
const { productId } = flowInfoService.context;
|
1377
|
+
if (!productId) {
|
1378
|
+
throw new Error(`Unable to start configuration for 'productId == null'`);
|
1379
|
+
}
|
1380
|
+
return configurationRuntimeService.init$({ productId });
|
1381
|
+
};
|
1382
|
+
|
1383
|
+
class SalesTransactionResolver {
|
1384
|
+
constructor(router, routerService, flowInfoService, flowStateService, salesTransactionService) {
|
1450
1385
|
this.router = router;
|
1451
|
-
this.quoteDraftService = quoteDraftService;
|
1452
1386
|
this.routerService = routerService;
|
1453
1387
|
this.flowInfoService = flowInfoService;
|
1454
1388
|
this.flowStateService = flowStateService;
|
1389
|
+
this.salesTransactionService = salesTransactionService;
|
1455
1390
|
}
|
1456
1391
|
resolve(route) {
|
1457
1392
|
const flow = this.flowInfoService.flow;
|
@@ -1488,33 +1423,55 @@ class QuoteResolver {
|
|
1488
1423
|
}));
|
1489
1424
|
}
|
1490
1425
|
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);
|
1426
|
+
// Implement when needed
|
1427
|
+
return of('');
|
1511
1428
|
}
|
1512
1429
|
}
|
1513
|
-
|
1514
|
-
|
1515
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type:
|
1430
|
+
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 });
|
1431
|
+
SalesTransactionResolver.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SalesTransactionResolver });
|
1432
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SalesTransactionResolver, decorators: [{
|
1516
1433
|
type: Injectable
|
1517
|
-
}], ctorParameters: function () { return [{ type: i1$2.Router }, { type:
|
1434
|
+
}], ctorParameters: function () { return [{ type: i1$2.Router }, { type: FlowRouterService }, { type: i3$1.FlowInfoService }, { type: i3$1.FlowStateService }, { type: i3$1.SalesTransactionService }]; } });
|
1435
|
+
|
1436
|
+
const resolveUIDefinition = () => {
|
1437
|
+
const customizationService = inject(FLOW_CUSTOMIZATION, { optional: true });
|
1438
|
+
const flowInfoService = inject(FlowInfoService);
|
1439
|
+
const uiDefinitionsAdminApiService = inject(UIDefinitionsAdminApiService);
|
1440
|
+
const configurationRuntimeService = inject(ConfigurationRuntimeService);
|
1441
|
+
const { productId } = flowInfoService.context;
|
1442
|
+
if (!productId) {
|
1443
|
+
throw new Error(`Unable to start configuration for 'productId == null'`);
|
1444
|
+
}
|
1445
|
+
return of(undefined).pipe(switchMap(() => {
|
1446
|
+
// Try resolving via customization service
|
1447
|
+
if (!productId || !(customizationService === null || customizationService === void 0 ? void 0 : customizationService.getUiDefinition)) {
|
1448
|
+
return of(undefined);
|
1449
|
+
}
|
1450
|
+
return customizationService.getUiDefinition(flowInfoService.context);
|
1451
|
+
}), switchMap(uiDefContainer => {
|
1452
|
+
// Resolve UIDefinition from the org
|
1453
|
+
if (uiDefContainer) {
|
1454
|
+
return of(uiDefContainer);
|
1455
|
+
}
|
1456
|
+
if (flowInfoService.context.requiredUIDefinitionId) {
|
1457
|
+
return uiDefinitionsAdminApiService.fetch$(flowInfoService.context.requiredUIDefinitionId, {
|
1458
|
+
skipErrorHandler: true,
|
1459
|
+
});
|
1460
|
+
}
|
1461
|
+
return uiDefinitionsAdminApiService
|
1462
|
+
.fetchAll$({
|
1463
|
+
productId,
|
1464
|
+
defaultUIDefinitionId: flowInfoService.context.defaultUIDefinitionId,
|
1465
|
+
}, { skipErrorHandler: true })
|
1466
|
+
.pipe(map((uiDefinitionContainers) => {
|
1467
|
+
const uiDefContainer = uiDefinitionContainers[0];
|
1468
|
+
if (!uiDefContainer) {
|
1469
|
+
throw new Error(`UI Definition for productId=${productId} is not resolved`);
|
1470
|
+
}
|
1471
|
+
return uiDefContainer;
|
1472
|
+
}));
|
1473
|
+
}), catchError(() => of(null)), tap(uiDefContainer => (configurationRuntimeService.uiDefinitionContainer = uiDefContainer)));
|
1474
|
+
};
|
1518
1475
|
|
1519
1476
|
const rootRoute = {
|
1520
1477
|
id: VELOCE_FLOW_ROOT_ROUTE,
|
@@ -1538,7 +1495,7 @@ const rootRoute = {
|
|
1538
1495
|
path: 'product',
|
1539
1496
|
component: ProductComponent,
|
1540
1497
|
runGuardsAndResolvers: 'paramsOrQueryParamsChange',
|
1541
|
-
resolve: {
|
1498
|
+
resolve: { salesTransaction: SalesTransactionResolver, uiDef: resolveUIDefinition, pcm: resolvePCMModel },
|
1542
1499
|
canDeactivate: [ProductUnloadGuard],
|
1543
1500
|
data: { showHeader: true },
|
1544
1501
|
},
|
@@ -1546,21 +1503,21 @@ const rootRoute = {
|
|
1546
1503
|
path: 'cart',
|
1547
1504
|
component: ShoppingCartComponent,
|
1548
1505
|
runGuardsAndResolvers: 'paramsOrQueryParamsChange',
|
1549
|
-
resolve: {
|
1506
|
+
resolve: { salesTransaction: SalesTransactionResolver },
|
1550
1507
|
data: { showHeader: true },
|
1551
1508
|
},
|
1552
1509
|
{
|
1553
1510
|
path: 'catalog',
|
1554
1511
|
component: CatalogComponent,
|
1555
1512
|
runGuardsAndResolvers: 'paramsOrQueryParamsChange',
|
1556
|
-
resolve: {
|
1513
|
+
resolve: { salesTransaction: SalesTransactionResolver },
|
1557
1514
|
data: { showHeader: true },
|
1558
1515
|
},
|
1559
1516
|
{
|
1560
1517
|
path: 'assets',
|
1561
1518
|
component: AssetsComponent,
|
1562
1519
|
runGuardsAndResolvers: 'paramsOrQueryParamsChange',
|
1563
|
-
resolve: {
|
1520
|
+
resolve: { salesTransaction: SalesTransactionResolver },
|
1564
1521
|
data: { showHeader: true },
|
1565
1522
|
},
|
1566
1523
|
{
|
@@ -1579,13 +1536,13 @@ class FlowRoutingModule {
|
|
1579
1536
|
}
|
1580
1537
|
FlowRoutingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowRoutingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
1581
1538
|
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,
|
1539
|
+
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
1540
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: FlowRoutingModule, decorators: [{
|
1584
1541
|
type: NgModule,
|
1585
1542
|
args: [{
|
1586
1543
|
imports: [RouterModule.forChild([rootRoute]), ProductModule, ShoppingCartModule, CatalogModule, AssetsModule],
|
1587
1544
|
exports: [RouterModule],
|
1588
|
-
providers: [FlowRouterService, RootGuard, ProductUnloadGuard, FlowResolver,
|
1545
|
+
providers: [FlowRouterService, RootGuard, ProductUnloadGuard, FlowResolver, SalesTransactionResolver],
|
1589
1546
|
}]
|
1590
1547
|
}] });
|
1591
1548
|
|
@@ -1633,22 +1590,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
|
|
1633
1590
|
}]
|
1634
1591
|
}] });
|
1635
1592
|
|
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
1593
|
/**
|
1650
1594
|
* Generated bundle index. Do not edit.
|
1651
1595
|
*/
|
1652
1596
|
|
1653
|
-
export { FlowDialogService, FlowModule, FlowRouterService, FlowService, VELOCE_FLOW_ROOT_ROUTE
|
1597
|
+
export { FlowDialogService, FlowModule, FlowRouterService, FlowService, VELOCE_FLOW_ROOT_ROUTE };
|
1654
1598
|
//# sourceMappingURL=veloceapps-sdk.mjs.map
|