@veloceapps/sdk 3.1.5 → 3.1.7
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/bundles/veloce-sdk-core.umd.js +41 -16
- package/bundles/veloce-sdk-core.umd.js.map +1 -1
- package/bundles/veloce-sdk-runtime.umd.js +3 -13
- package/bundles/veloce-sdk-runtime.umd.js.map +1 -1
- package/bundles/veloce-sdk.umd.js +145 -120
- package/bundles/veloce-sdk.umd.js.map +1 -1
- package/core/modules/configuration/services/configuration.service.d.ts +2 -2
- package/core/modules/flow-configuration/services/flow-configuration.service.d.ts +2 -2
- package/core/services/context.service.d.ts +4 -4
- package/core/services/quote-draft.service.d.ts +3 -0
- package/esm2015/core/modules/configuration/services/configuration-runtime.service.js +2 -5
- package/esm2015/core/modules/configuration/services/configuration.service.js +2 -2
- package/esm2015/core/modules/flow-configuration/services/flow-configuration.service.js +1 -1
- package/esm2015/core/services/context.service.js +13 -10
- package/esm2015/core/services/quote-draft.service.js +26 -5
- package/esm2015/runtime/components/ui-runtime/runtime.component.js +1 -4
- package/esm2015/runtime/execution/directives/vl-ramp.directive.js +1 -4
- package/esm2015/runtime/services/cart.service.js +1 -1
- package/esm2015/runtime/services/configuration.service.js +3 -3
- package/esm2015/runtime/services/runtime-context.service.js +2 -3
- package/esm2015/runtime/services/runtime.service.js +1 -4
- package/esm2015/src/components/header/header.component.js +36 -19
- package/esm2015/src/flow.component.js +6 -6
- package/esm2015/src/flow.module.js +2 -2
- package/esm2015/src/guards/product-unload.guard.js +7 -6
- package/esm2015/src/pages/catalog/catalog.component.js +3 -3
- package/esm2015/src/pages/legacy-product/legacy-product.component.js +1 -1
- package/esm2015/src/pages/product/product.component.js +2 -3
- package/esm2015/src/pages/shopping-cart/shopping-cart.component.js +3 -3
- package/esm2015/src/resolvers/context.resolver.js +7 -5
- package/esm2015/src/resolvers/quote.resolver.js +2 -2
- package/esm2015/src/services/flow-dialog.service.js +80 -0
- package/esm2015/src/services/flow.service.js +2 -2
- package/esm2015/src/utils/flow.utils.js +1 -11
- package/fesm2015/veloce-sdk-core.js +38 -18
- package/fesm2015/veloce-sdk-core.js.map +1 -1
- package/fesm2015/veloce-sdk-runtime.js +3 -13
- package/fesm2015/veloce-sdk-runtime.js.map +1 -1
- package/fesm2015/veloce-sdk.js +117 -92
- package/fesm2015/veloce-sdk.js.map +1 -1
- package/package.json +1 -1
- package/runtime/services/cart.service.d.ts +1 -1
- package/src/components/header/header.component.d.ts +7 -4
- package/src/flow.component.d.ts +3 -3
- package/src/guards/product-unload.guard.d.ts +4 -3
- package/src/services/{fow-dialog.service.d.ts → flow-dialog.service.d.ts} +2 -0
- package/src/utils/flow.utils.d.ts +0 -2
- package/esm2015/src/services/fow-dialog.service.js +0 -66
package/fesm2015/veloce-sdk.js
CHANGED
@@ -2,13 +2,13 @@ import * as i9 from '@angular/common';
|
|
2
2
|
import { CommonModule } from '@angular/common';
|
3
3
|
import * as i0 from '@angular/core';
|
4
4
|
import { Component, ChangeDetectionStrategy, NgModule, Injectable, ViewChild, Input, InjectionToken, Optional, Inject } from '@angular/core';
|
5
|
-
import * as i1$
|
5
|
+
import * as i1$4 from '@veloce/api';
|
6
6
|
import { ApiModule } from '@veloce/api';
|
7
7
|
import * as i3 from '@veloce/components';
|
8
8
|
import { LetDirectiveModule, ToastType, LoaderModule } from '@veloce/components';
|
9
9
|
import * as i4$1 from '@veloce/sdk/cms';
|
10
10
|
import { FlowAction, PreviewModule, LauncherModule } from '@veloce/sdk/cms';
|
11
|
-
import * as
|
11
|
+
import * as i1$2 from '@veloce/sdk/core';
|
12
12
|
import { RuntimeOperation, SdkCoreModule } from '@veloce/sdk/core';
|
13
13
|
import * as i5 from 'primeng/button';
|
14
14
|
import { ButtonModule } from 'primeng/button';
|
@@ -22,11 +22,11 @@ import { FormGroup, FormControl, ReactiveFormsModule, FormsModule } from '@angul
|
|
22
22
|
import * as i6 from 'primeng/inputnumber';
|
23
23
|
import { InputNumberModule } from 'primeng/inputnumber';
|
24
24
|
import { map, filter, shareReplay, startWith, distinctUntilChanged, BehaviorSubject, Subject, combineLatest, takeUntil, noop, catchError, of, tap, finalize, switchMap, first as first$1, from } from 'rxjs';
|
25
|
-
import * as i1$
|
25
|
+
import * as i1$3 from '@veloce/core';
|
26
26
|
import { ConfigurationContextMode, UITemplateComponentType, UITemplateType, EntityUtil } from '@veloce/core';
|
27
27
|
import * as i1$1 from '@angular/router';
|
28
28
|
import { NavigationEnd, NavigationStart, NavigationCancel, NavigationError, RouterModule } from '@angular/router';
|
29
|
-
import * as i2
|
29
|
+
import * as i2 from 'primeng/api';
|
30
30
|
import * as i4$2 from 'primeng/dropdown';
|
31
31
|
import { DropdownModule } from 'primeng/dropdown';
|
32
32
|
import * as i8 from 'primeng/inputtext';
|
@@ -36,7 +36,7 @@ import { RadioButtonModule } from 'primeng/radiobutton';
|
|
36
36
|
import { first, takeUntil as takeUntil$1, take, map as map$1, switchMap as switchMap$1, tap as tap$1, catchError as catchError$1 } from 'rxjs/operators';
|
37
37
|
import * as i4$3 from '@veloce/sdk/runtime';
|
38
38
|
import { RuntimeModule } from '@veloce/sdk/runtime';
|
39
|
-
import * as i1$
|
39
|
+
import * as i1$5 from 'ngx-bootstrap/tooltip';
|
40
40
|
import { TooltipModule as TooltipModule$1 } from 'ngx-bootstrap/tooltip';
|
41
41
|
import { HttpErrorResponse } from '@angular/common/http';
|
42
42
|
|
@@ -191,12 +191,12 @@ class FlowRouterService {
|
|
191
191
|
this.router.navigate([flowRouteUrl, 'catalog'], { queryParams: routeSnapshot.queryParams });
|
192
192
|
}
|
193
193
|
}
|
194
|
-
FlowRouterService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: FlowRouterService, deps: [{ token: i1$1.Router }, { token: i1$1.ActivatedRoute }, { token:
|
194
|
+
FlowRouterService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: FlowRouterService, deps: [{ token: i1$1.Router }, { token: i1$1.ActivatedRoute }, { token: i1$2.ContextService }], target: i0.ɵɵFactoryTarget.Injectable });
|
195
195
|
FlowRouterService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: FlowRouterService, providedIn: 'root' });
|
196
196
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: FlowRouterService, decorators: [{
|
197
197
|
type: Injectable,
|
198
198
|
args: [{ providedIn: 'root' }]
|
199
|
-
}], ctorParameters: function () { return [{ type: i1$1.Router }, { type: i1$1.ActivatedRoute }, { type:
|
199
|
+
}], ctorParameters: function () { return [{ type: i1$1.Router }, { type: i1$1.ActivatedRoute }, { type: i1$2.ContextService }]; } });
|
200
200
|
|
201
201
|
class HeaderCartOverlayComponent {
|
202
202
|
constructor(baseHttpService, flowConfiguration, routerService) {
|
@@ -299,8 +299,8 @@ class HeaderCartOverlayComponent {
|
|
299
299
|
removedIds.forEach(id => this.form.removeControl(id));
|
300
300
|
}
|
301
301
|
}
|
302
|
-
HeaderCartOverlayComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: HeaderCartOverlayComponent, deps: [{ token: i1$
|
303
|
-
HeaderCartOverlayComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: HeaderCartOverlayComponent, selector: "vl-header-cart-overlay", inputs: { products: "products" }, viewQueries: [{ propertyName: "overlayPanel", first: true, predicate: OverlayPanel, descendants: true }], usesOnChanges: true, ngImport: i0, template: "<p-overlayPanel\n styleClass=\"navigation-settings-overlay flow-header-overlay center\"\n showTransitionOptions=\"0ms\"\n hideTransitionOptions=\"0ms\"\n>\n <ng-template pTemplate>\n <div class=\"flow-header-overlay__wrapper\" *vlLet=\"readonlyProductId$ | async as readonlyProductId\">\n <ng-container *ngIf=\"products.length > 0; else empty\">\n <h2 class=\"flow-header-overlay__title\">\n <span>Products ({{ products.length }})</span>\n <i class=\"vl-icon vl-icon-close close-icon\" (click)=\"overlayPanel.hide()\"></i>\n </h2>\n\n <div class=\"product header\">\n <span>Product</span>\n <span class=\"text-right\">Qty</span>\n <span class=\"text-right\">MRR</span>\n <span class=\"text-right\">NRR</span>\n </div>\n\n <div class=\"scrollable-wrapper\">\n <div class=\"product\" *ngFor=\"let product of products\">\n <div class=\"product__info\">\n <div class=\"product__image-wrapper\">\n <div\n *ngIf=\"getImageUrl(product.productId) | async as imageUrl; else noImage\"\n class=\"product__image\"\n [ngStyle]=\"{ 'background-image': 'url(' + imageUrl + ')' }\"\n ></div>\n </div>\n <div class=\"flex flex-column justify-content-center\">\n <div class=\"word-break\">{{ product.name }}</div>\n <div>\n <p-button\n label=\"Configure\"\n [disabled]=\"!product.configurable || readonlyProductId === product.productId\"\n styleClass=\"p-button-link p-button-sm pl-0\"\n (onClick)=\"navigateToProductConfiguration(product.productId, product.id)\"\n ></p-button>\n <p-button\n label=\"Delete\"\n [disabled]=\"readonlyProductId === product.productId\"\n styleClass=\"p-button-link p-button-sm p-button-danger pl-0 pr-0\"\n (onClick)=\"deleteHandler(product)\"\n ></p-button>\n </div>\n </div>\n </div>\n\n <span>\n <p-inputNumber\n *ngIf=\"form.controls[product.id] as control\"\n class=\"qty-control\"\n [formControl]=\"$any(control)\"\n [min]=\"1\"\n [required]=\"true\"\n (onBlur)=\"controlBlurHandler(product)\"\n ></p-inputNumber>\n </span>\n <span class=\"text-right pt-3\">$0.00</span>\n <span class=\"text-right pt-3\">$0.00</span>\n </div>\n\n <ng-template #noImage>\n <i class=\"vl-icon vl-icon-no-image no-image-icon\"></i>\n </ng-template>\n </div>\n\n <div class=\"flex justify-content-end mt-3\">\n <p-button\n label=\"Clear cart\"\n styleClass=\"p-button-link p-button-sm p-button-danger pl-0 pr-0\"\n [disabled]=\"readonlyProductId\"\n (onClick)=\"deleteAllHandler()\"\n ></p-button>\n </div>\n </ng-container>\n\n <ng-template #empty>\n <h2 class=\"flow-header-overlay__title\">\n <span>Empty Cart</span>\n <i class=\"vl-icon vl-icon-close close-icon\" (click)=\"overlayPanel.hide()\"></i>\n </h2>\n\n <span class=\"empty-state\">There are no products added to the Shopping Cart yet.</span>\n </ng-template>\n </div>\n </ng-template>\n</p-overlayPanel>\n", styles: [".flow-header-overlay__wrapper{display:flex;flex-direction:column;width:460px;max-height:600px}.flow-header-overlay__wrapper .close-icon{cursor:pointer}.flow-header-overlay__title{display:flex;justify-content:space-between;align-items:center;margin:0 0 16px}.empty-state{color:var(--vl-text-color-deep-accent)}.scrollable-wrapper{overflow:auto}.product{display:grid;grid-template-columns:auto 60px 80px 80px;padding:16px 0}.product:not(.header){border-bottom:1px solid var(--vl-border-color)}.product.header{color:var(--vl-text-color-deep-accent)}.product__info{display:flex;grid-gap:16px;gap:16px}.product__image-wrapper{flex-shrink:0;height:64px;width:64px;display:flex;justify-content:center;align-items:center;background:var(--vl-primary-nav-overlay-bg);border-radius:4px}.product__image{background-size:contain;background-repeat:no-repeat;background-position:center;height:calc(100% - 12px);width:calc(100% - 12px)}.product .qty-control ::ng-deep .p-inputnumber-input{align-self:flex-start;text-align:right;width:100%}.word-break{word-break:break-word}.no-image-icon{color:#b4d1ef;height:18px;width:18px}\n"], components: [{ type: i4.OverlayPanel, selector: "p-overlayPanel", inputs: ["dismissable", "showCloseIcon", "style", "styleClass", "appendTo", "autoZIndex", "ariaCloseLabel", "baseZIndex", "focusOnShow", "showTransitionOptions", "hideTransitionOptions"], outputs: ["onShow", "onHide"] }, { type: i5.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "style", "styleClass", "badgeClass"], outputs: ["onClick", "onFocus", "onBlur"] }, { type: i6.InputNumber, selector: "p-inputNumber", inputs: ["showButtons", "format", "buttonLayout", "inputId", "styleClass", "style", "placeholder", "size", "maxlength", "tabindex", "title", "ariaLabel", "ariaRequired", "name", "required", "autocomplete", "min", "max", "incrementButtonClass", "decrementButtonClass", "incrementButtonIcon", "decrementButtonIcon", "readonly", "step", "allowEmpty", "locale", "localeMatcher", "mode", "currency", "currencyDisplay", "useGrouping", "minFractionDigits", "maxFractionDigits", "prefix", "suffix", "inputStyle", "inputStyleClass", "disabled"], outputs: ["onInput", "onFocus", "onBlur", "onKeyDown"] }], directives: [{ type: i2
|
302
|
+
HeaderCartOverlayComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: HeaderCartOverlayComponent, deps: [{ token: i1$3.BaseHttpService }, { token: i1$2.FlowConfigurationService }, { token: FlowRouterService }], target: i0.ɵɵFactoryTarget.Component });
|
303
|
+
HeaderCartOverlayComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: HeaderCartOverlayComponent, selector: "vl-header-cart-overlay", inputs: { products: "products" }, viewQueries: [{ propertyName: "overlayPanel", first: true, predicate: OverlayPanel, descendants: true }], usesOnChanges: true, ngImport: i0, template: "<p-overlayPanel\n styleClass=\"navigation-settings-overlay flow-header-overlay center\"\n showTransitionOptions=\"0ms\"\n hideTransitionOptions=\"0ms\"\n>\n <ng-template pTemplate>\n <div class=\"flow-header-overlay__wrapper\" *vlLet=\"readonlyProductId$ | async as readonlyProductId\">\n <ng-container *ngIf=\"products.length > 0; else empty\">\n <h2 class=\"flow-header-overlay__title\">\n <span>Products ({{ products.length }})</span>\n <i class=\"vl-icon vl-icon-close close-icon\" (click)=\"overlayPanel.hide()\"></i>\n </h2>\n\n <div class=\"product header\">\n <span>Product</span>\n <span class=\"text-right\">Qty</span>\n <span class=\"text-right\">MRR</span>\n <span class=\"text-right\">NRR</span>\n </div>\n\n <div class=\"scrollable-wrapper\">\n <div class=\"product\" *ngFor=\"let product of products\">\n <div class=\"product__info\">\n <div class=\"product__image-wrapper\">\n <div\n *ngIf=\"getImageUrl(product.productId) | async as imageUrl; else noImage\"\n class=\"product__image\"\n [ngStyle]=\"{ 'background-image': 'url(' + imageUrl + ')' }\"\n ></div>\n </div>\n <div class=\"flex flex-column justify-content-center\">\n <div class=\"word-break\">{{ product.name }}</div>\n <div>\n <p-button\n label=\"Configure\"\n [disabled]=\"!product.configurable || readonlyProductId === product.productId\"\n styleClass=\"p-button-link p-button-sm pl-0\"\n (onClick)=\"navigateToProductConfiguration(product.productId, product.id)\"\n ></p-button>\n <p-button\n label=\"Delete\"\n [disabled]=\"readonlyProductId === product.productId\"\n styleClass=\"p-button-link p-button-sm p-button-danger pl-0 pr-0\"\n (onClick)=\"deleteHandler(product)\"\n ></p-button>\n </div>\n </div>\n </div>\n\n <span>\n <p-inputNumber\n *ngIf=\"form.controls[product.id] as control\"\n class=\"qty-control\"\n [formControl]=\"$any(control)\"\n [min]=\"1\"\n [required]=\"true\"\n (onBlur)=\"controlBlurHandler(product)\"\n ></p-inputNumber>\n </span>\n <span class=\"text-right pt-3\">$0.00</span>\n <span class=\"text-right pt-3\">$0.00</span>\n </div>\n\n <ng-template #noImage>\n <i class=\"vl-icon vl-icon-no-image no-image-icon\"></i>\n </ng-template>\n </div>\n\n <div class=\"flex justify-content-end mt-3\">\n <p-button\n label=\"Clear cart\"\n styleClass=\"p-button-link p-button-sm p-button-danger pl-0 pr-0\"\n [disabled]=\"readonlyProductId\"\n (onClick)=\"deleteAllHandler()\"\n ></p-button>\n </div>\n </ng-container>\n\n <ng-template #empty>\n <h2 class=\"flow-header-overlay__title\">\n <span>Empty Cart</span>\n <i class=\"vl-icon vl-icon-close close-icon\" (click)=\"overlayPanel.hide()\"></i>\n </h2>\n\n <span class=\"empty-state\">There are no products added to the Shopping Cart yet.</span>\n </ng-template>\n </div>\n </ng-template>\n</p-overlayPanel>\n", styles: [".flow-header-overlay__wrapper{display:flex;flex-direction:column;width:460px;max-height:600px}.flow-header-overlay__wrapper .close-icon{cursor:pointer}.flow-header-overlay__title{display:flex;justify-content:space-between;align-items:center;margin:0 0 16px}.empty-state{color:var(--vl-text-color-deep-accent)}.scrollable-wrapper{overflow:auto}.product{display:grid;grid-template-columns:auto 60px 80px 80px;padding:16px 0}.product:not(.header){border-bottom:1px solid var(--vl-border-color)}.product.header{color:var(--vl-text-color-deep-accent)}.product__info{display:flex;grid-gap:16px;gap:16px}.product__image-wrapper{flex-shrink:0;height:64px;width:64px;display:flex;justify-content:center;align-items:center;background:var(--vl-primary-nav-overlay-bg);border-radius:4px}.product__image{background-size:contain;background-repeat:no-repeat;background-position:center;height:calc(100% - 12px);width:calc(100% - 12px)}.product .qty-control ::ng-deep .p-inputnumber-input{align-self:flex-start;text-align:right;width:100%}.word-break{word-break:break-word}.no-image-icon{color:#b4d1ef;height:18px;width:18px}\n"], components: [{ type: i4.OverlayPanel, selector: "p-overlayPanel", inputs: ["dismissable", "showCloseIcon", "style", "styleClass", "appendTo", "autoZIndex", "ariaCloseLabel", "baseZIndex", "focusOnShow", "showTransitionOptions", "hideTransitionOptions"], outputs: ["onShow", "onHide"] }, { type: i5.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "style", "styleClass", "badgeClass"], outputs: ["onClick", "onFocus", "onBlur"] }, { type: i6.InputNumber, selector: "p-inputNumber", inputs: ["showButtons", "format", "buttonLayout", "inputId", "styleClass", "style", "placeholder", "size", "maxlength", "tabindex", "title", "ariaLabel", "ariaRequired", "name", "required", "autocomplete", "min", "max", "incrementButtonClass", "decrementButtonClass", "incrementButtonIcon", "decrementButtonIcon", "readonly", "step", "allowEmpty", "locale", "localeMatcher", "mode", "currency", "currencyDisplay", "useGrouping", "minFractionDigits", "maxFractionDigits", "prefix", "suffix", "inputStyle", "inputStyleClass", "disabled"], outputs: ["onInput", "onFocus", "onBlur", "onKeyDown"] }], directives: [{ type: i2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { type: i3.LetDirective, selector: "[vlLet]", inputs: ["vlLet"] }, { type: i9.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i9.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i9.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { type: i7.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i7.FormControlDirective, selector: "[formControl]", inputs: ["disabled", "formControl", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i7.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }], pipes: { "async": i9.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
304
304
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: HeaderCartOverlayComponent, decorators: [{
|
305
305
|
type: Component,
|
306
306
|
args: [{
|
@@ -309,7 +309,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImpo
|
|
309
309
|
styleUrls: ['./cart-overlay.component.scss'],
|
310
310
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
311
311
|
}]
|
312
|
-
}], ctorParameters: function () { return [{ type: i1$
|
312
|
+
}], ctorParameters: function () { return [{ type: i1$3.BaseHttpService }, { type: i1$2.FlowConfigurationService }, { type: FlowRouterService }]; }, propDecorators: { overlayPanel: [{
|
313
313
|
type: ViewChild,
|
314
314
|
args: [OverlayPanel]
|
315
315
|
}], products: [{
|
@@ -330,27 +330,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImpo
|
|
330
330
|
}]
|
331
331
|
}] });
|
332
332
|
|
333
|
-
const getFlowObjectIdPropertyName = (objectName) => {
|
334
|
-
switch (objectName) {
|
335
|
-
case 'Account':
|
336
|
-
return 'accountId';
|
337
|
-
case 'Order':
|
338
|
-
return 'orderId';
|
339
|
-
case 'Quote':
|
340
|
-
default:
|
341
|
-
return 'quoteId';
|
342
|
-
}
|
343
|
-
};
|
344
|
-
const getIsEditMode = (context) => {
|
345
|
-
if (context.mode === ConfigurationContextMode.QUOTE) {
|
346
|
-
return context.properties.Status === 'Draft';
|
347
|
-
}
|
348
|
-
else if (context.mode === ConfigurationContextMode.ACCOUNT) {
|
349
|
-
return true;
|
350
|
-
}
|
351
|
-
return false;
|
352
|
-
};
|
353
|
-
|
354
333
|
class FlowDialogService {
|
355
334
|
constructor(dialogService, contextService) {
|
356
335
|
this.dialogService = dialogService;
|
@@ -376,7 +355,7 @@ class FlowDialogService {
|
|
376
355
|
}
|
377
356
|
showReadonlyModeDialog() {
|
378
357
|
const ctx = this.contextService.resolve();
|
379
|
-
const objectName =
|
358
|
+
const objectName = ctx.mode ? ctx.mode[0].toUpperCase() + ctx.mode.substring(1).toLowerCase() : 'Object';
|
380
359
|
return this.show({
|
381
360
|
title: 'Error',
|
382
361
|
description: `${objectName} Cannot be Saved`,
|
@@ -405,17 +384,30 @@ class FlowDialogService {
|
|
405
384
|
secondaryButton: 'Discard Changes',
|
406
385
|
});
|
407
386
|
}
|
387
|
+
showReadonlyQuoteSubmitFailureDialog() {
|
388
|
+
return this.show({
|
389
|
+
title: 'Cannot Submit for Approval',
|
390
|
+
description: 'It is only possible to submit for approval quotes with the “Draft“ status. Please create a new quote to proceed.',
|
391
|
+
primaryButton: 'OK',
|
392
|
+
});
|
393
|
+
}
|
394
|
+
showAccountSubmitFailureDialog() {
|
395
|
+
return this.show({
|
396
|
+
title: 'Save Changes',
|
397
|
+
description: 'To submit for approval, save the quote first, and then submit it for approval from the Shopping Cart.',
|
398
|
+
primaryButton: 'OK',
|
399
|
+
});
|
400
|
+
}
|
408
401
|
}
|
409
|
-
FlowDialogService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: FlowDialogService, deps: [{ token: i1.DialogService }, { token:
|
402
|
+
FlowDialogService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: FlowDialogService, deps: [{ token: i1.DialogService }, { token: i1$2.ContextService }], target: i0.ɵɵFactoryTarget.Injectable });
|
410
403
|
FlowDialogService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: FlowDialogService });
|
411
404
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: FlowDialogService, decorators: [{
|
412
405
|
type: Injectable
|
413
|
-
}], ctorParameters: function () { return [{ type: i1.DialogService }, { type:
|
406
|
+
}], ctorParameters: function () { return [{ type: i1.DialogService }, { type: i1$2.ContextService }]; } });
|
414
407
|
|
415
408
|
class FlowHeaderComponent {
|
416
|
-
constructor(
|
417
|
-
|
418
|
-
this.context = context;
|
409
|
+
constructor(contextService, quoteDraftService, quoteApiService, sfApiService, flowConfiguration, routerService, dialogService) {
|
410
|
+
this.contextService = contextService;
|
419
411
|
this.quoteDraftService = quoteDraftService;
|
420
412
|
this.quoteApiService = quoteApiService;
|
421
413
|
this.sfApiService = sfApiService;
|
@@ -425,12 +417,14 @@ class FlowHeaderComponent {
|
|
425
417
|
this.disabledActionButtonTooltip = 'Available from the Shopping Cart';
|
426
418
|
this.objectDetails$ = new BehaviorSubject({});
|
427
419
|
this.isSaveInProgress$ = new BehaviorSubject(false);
|
420
|
+
this.isSubmitInProgress$ = new BehaviorSubject(false);
|
428
421
|
this.destroyed$ = new Subject();
|
429
|
-
const ctx = this.
|
430
|
-
this.mode = ctx
|
431
|
-
this.objectName =
|
432
|
-
this.contextProperties =
|
433
|
-
this.
|
422
|
+
const ctx = this.contextService.resolve();
|
423
|
+
this.mode = ctx.mode;
|
424
|
+
this.objectName = ctx.mode.toLowerCase();
|
425
|
+
this.contextProperties = ctx.properties;
|
426
|
+
this.status$ = this.contextService.resolve$().pipe(map(context => { var _a; return (_a = context.properties.Status) !== null && _a !== void 0 ? _a : ''; }));
|
427
|
+
this.isEditMode$ = this.quoteDraftService.isEditMode$();
|
434
428
|
this.products$ = this.flowConfiguration.get().pipe(map(lineItems => this.generateProducts(lineItems)));
|
435
429
|
this.isConfigurationRoute$ = this.routerService.isConfigurationRoute$();
|
436
430
|
this.isCartRoute$ = this.routerService.isCartRoute$();
|
@@ -450,8 +444,7 @@ class FlowHeaderComponent {
|
|
450
444
|
return this.mode === ConfigurationContextMode.QUOTE;
|
451
445
|
}
|
452
446
|
back() {
|
453
|
-
|
454
|
-
const objectId = (_a = this.context.resolve()) === null || _a === void 0 ? void 0 : _a.headerId;
|
447
|
+
const objectId = this.contextService.resolve().headerId;
|
455
448
|
if (objectId) {
|
456
449
|
window.VELO_BACK_FN.apply(null, [objectId]);
|
457
450
|
}
|
@@ -469,7 +462,7 @@ class FlowHeaderComponent {
|
|
469
462
|
this.routerService.navigateToCatalog();
|
470
463
|
}
|
471
464
|
saveButtonClickHandler() {
|
472
|
-
if (!this.isEditMode) {
|
465
|
+
if (!this.quoteDraftService.isEditMode()) {
|
473
466
|
if (this.mode === ConfigurationContextMode.QUOTE) {
|
474
467
|
this.dialogService.showQuoteReadonlyModeDialog().subscribe();
|
475
468
|
}
|
@@ -488,13 +481,12 @@ class FlowHeaderComponent {
|
|
488
481
|
return;
|
489
482
|
}
|
490
483
|
const quoteDraft = this.quoteDraftService.quoteSnapshot;
|
491
|
-
|
492
|
-
if (!quoteDraft || !context) {
|
484
|
+
if (!quoteDraft) {
|
493
485
|
return;
|
494
486
|
}
|
495
487
|
this.isSaveInProgress$.next(true);
|
496
488
|
this.quoteApiService
|
497
|
-
.upsertQuote(
|
489
|
+
.upsertQuote(quoteDraft)
|
498
490
|
.pipe(tap(() => {
|
499
491
|
// navigate back to quote on successful save
|
500
492
|
if (this.mode === ConfigurationContextMode.QUOTE) {
|
@@ -503,6 +495,25 @@ class FlowHeaderComponent {
|
|
503
495
|
}), finalize(() => this.isSaveInProgress$.next(false)))
|
504
496
|
.subscribe();
|
505
497
|
}
|
498
|
+
submitButtonClickHandler() {
|
499
|
+
if (this.mode === ConfigurationContextMode.QUOTE && !this.quoteDraftService.isEditMode()) {
|
500
|
+
this.dialogService.showReadonlyQuoteSubmitFailureDialog();
|
501
|
+
return;
|
502
|
+
}
|
503
|
+
if (this.mode === ConfigurationContextMode.ACCOUNT) {
|
504
|
+
this.dialogService.showAccountSubmitFailureDialog();
|
505
|
+
return;
|
506
|
+
}
|
507
|
+
const quoteDraft = this.quoteDraftService.quoteSnapshot;
|
508
|
+
if (!quoteDraft) {
|
509
|
+
return;
|
510
|
+
}
|
511
|
+
this.isSubmitInProgress$.next(true);
|
512
|
+
this.quoteApiService
|
513
|
+
.submitQuote(quoteDraft)
|
514
|
+
.pipe(switchMap(() => this.quoteApiService.getQuoteDraft(quoteDraft.quoteId)), tap(updatedQuoteDraft => this.contextService.update({ properties: updatedQuoteDraft.context.properties })), finalize(() => this.isSubmitInProgress$.next(false)), takeUntil(this.destroyed$))
|
515
|
+
.subscribe();
|
516
|
+
}
|
506
517
|
queryName$(objectName, id) {
|
507
518
|
if (!id) {
|
508
519
|
return of('');
|
@@ -563,8 +574,8 @@ class FlowHeaderComponent {
|
|
563
574
|
}, []);
|
564
575
|
}
|
565
576
|
}
|
566
|
-
FlowHeaderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: FlowHeaderComponent, deps: [{ token:
|
567
|
-
FlowHeaderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: FlowHeaderComponent, selector: "vl-flow-header", ngImport: i0, template: "<div class=\"flow-info\" *vlLet=\"objectDetails$ | async as details\">\n <nav class=\"nav-item nav-back\" (click)=\"back()\">\n <i class=\"nav-icon vl-icon vl-icon-arrow-left\"></i>\n\n <span> Back </span>\n <span *ngIf=\"objectName\" class=\"object-name\"> To {{ objectName }}</span>\n </nav>\n\n <ng-container *ngIf=\"isAccountMode\">\n <span class=\"dot-separator\"></span>\n\n <span>Account name</span>\n\n <nav class=\"account-name\" [pTooltip]=\"contextProperties.Name ?? ''\" tooltipPosition=\"bottom\" [showDelay]=\"1000\">\n <a target=\"_blank\" [href]=\"getSalesforceObjectLink(contextProperties.Id)\">{{ contextProperties.Name }}</a>\n </nav>\n </ng-container>\n\n <ng-container *ngIf=\"isQuoteMode\">\n <span class=\"dot-separator\"></span>\n\n <span>Quote #{{ details.quoteNumber }}</span>\n\n <span class=\"dot-separator\"></span>\n\n <nav class=\"nav-item\" (click)=\"quoteDetails.toggle($event)\">\n <span>{{
|
577
|
+
FlowHeaderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: FlowHeaderComponent, deps: [{ token: i1$2.ContextService }, { token: i1$2.QuoteDraftService }, { token: i1$4.QuoteApiService }, { token: i1$4.SalesforceApiService }, { token: i1$2.FlowConfigurationService }, { token: FlowRouterService }, { token: FlowDialogService }], target: i0.ɵɵFactoryTarget.Component });
|
578
|
+
FlowHeaderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: FlowHeaderComponent, selector: "vl-flow-header", ngImport: i0, template: "<div class=\"flow-info\" *vlLet=\"objectDetails$ | async as details\">\n <nav class=\"nav-item nav-back\" (click)=\"back()\">\n <i class=\"nav-icon vl-icon vl-icon-arrow-left\"></i>\n\n <span> Back </span>\n <span *ngIf=\"objectName\" class=\"object-name\"> To {{ objectName }}</span>\n </nav>\n\n <ng-container *ngIf=\"isAccountMode\">\n <span class=\"dot-separator\"></span>\n\n <span>Account name</span>\n\n <nav class=\"account-name\" [pTooltip]=\"contextProperties.Name ?? ''\" tooltipPosition=\"bottom\" [showDelay]=\"1000\">\n <a target=\"_blank\" [href]=\"getSalesforceObjectLink(contextProperties.Id)\">{{ contextProperties.Name }}</a>\n </nav>\n </ng-container>\n\n <ng-container *ngIf=\"isQuoteMode\">\n <span class=\"dot-separator\"></span>\n\n <span>Quote #{{ details.quoteNumber }}</span>\n\n <span class=\"dot-separator\"></span>\n\n <nav class=\"nav-item\" (click)=\"quoteDetails.toggle($event)\">\n <span>{{ status$ | async }}</span>\n\n <i *ngIf=\"!quoteDetails.overlayVisible\" class=\"vl-icon vl-icon-chevron-down icon-with-margin\"></i>\n <i *ngIf=\"quoteDetails.overlayVisible\" class=\"vl-icon vl-icon-chevron-up icon-with-margin\"></i>\n </nav>\n\n <p-overlayPanel styleClass=\"navigation-settings-overlay flow-header-overlay center\" #quoteDetails>\n <ng-template pTemplate>\n <div class=\"flow-header-overlay__wrapper\">\n <h2 class=\"flow-header-overlay__title\">\n <span>Quote Information</span>\n <i class=\"vl-icon vl-icon-close close-icon\" (click)=\"quoteDetails.hide()\"></i>\n </h2>\n\n <ul class=\"info-list\">\n <li class=\"info-list__row\">\n <span>Account Name:</span>\n <a target=\"_blank\" [href]=\"getSalesforceObjectLink(details.accountId)\">{{ details.accountName }}</a>\n </li>\n <li class=\"info-list__row\">\n <span>Opportunity Name:</span>\n <a target=\"_blank\" [href]=\"getSalesforceObjectLink(details.opportunityId)\">{{\n details.opportunityName\n }}</a>\n </li>\n <li class=\"info-list__row\">\n <span>Quote Name:</span>\n <a target=\"_blank\" [href]=\"getSalesforceObjectLink(details.quoteId)\">{{ details.quoteName }}</a>\n </li>\n </ul>\n </div>\n </ng-template>\n </p-overlayPanel>\n </ng-container>\n</div>\n\n<div class=\"flow-navigation\">\n <nav class=\"nav-item\" [ngClass]=\"{ active: isCatalogRoute$ | async }\" (click)=\"navigateToCatalog()\">Catalog</nav>\n <nav class=\"nav-item disabled\" [ngClass]=\"{ active: isConfigurationRoute$ | async }\">Configurator</nav>\n <ng-container *vlLet=\"products$ | async as products\">\n <nav class=\"nav-item\" [ngClass]=\"{ active: isCartRoute$ | async }\" (click)=\"navigateToShoppingCart()\">\n Shopping Cart ({{ products.length }})\n </nav>\n\n <nav class=\"nav-popover-toggle active\" (click)=\"cart?.overlayPanel?.toggle($event)\">\n <i *ngIf=\"!cart?.overlayPanel?.overlayVisible\" class=\"vl-icon vl-icon-chevron-down icon-with-margin\"></i>\n <i *ngIf=\"cart?.overlayPanel?.overlayVisible\" class=\"vl-icon vl-icon-chevron-up icon-with-margin\"></i>\n </nav>\n\n <vl-header-cart-overlay #cart [products]=\"products\"></vl-header-cart-overlay>\n </ng-container>\n</div>\n\n<div class=\"flow-controls\" *vlLet=\"objectDetails$ | async as details\">\n <ng-container *ngIf=\"isQuoteMode\">\n <span *ngIf=\"details.priceListName\">{{ details.priceListName }}</span>\n <span *ngIf=\"contextProperties.StartDate\">{{ contextProperties.StartDate | date: 'MM.dd.yyyy' }}</span>\n\n <span class=\"slash-separator\"></span>\n\n <span>MRR: <span class=\"font-semibold\">$0.00</span></span>\n <span>NRR: <span class=\"font-semibold\">$0.00</span></span>\n </ng-container>\n\n <ng-container *vlLet=\"isCartRoute$ | async as isCartRoute\">\n <p-button\n styleClass=\"p-button-outlined\"\n label=\"Generate Doc\"\n [disabled]=\"!isCartRoute\"\n tooltipPosition=\"bottom\"\n [showDelay]=\"300\"\n [pTooltip]=\"isCartRoute ? '' : disabledActionButtonTooltip\"\n ></p-button>\n\n <p-button\n *vlLet=\"isSaveInProgress$ | async as isSaveInProgress\"\n class=\"save-button\"\n styleClass=\"p-button-outlined\"\n [label]=\"isSaveInProgress ? 'Saving' : 'Save to Quote'\"\n (onClick)=\"saveButtonClickHandler()\"\n [loading]=\"isSaveInProgress\"\n ></p-button>\n\n <p-button\n *vlLet=\"isSubmitInProgress$ | async as isSubmitInProgress\"\n class=\"submit-button\"\n styleClass=\"p-button\"\n [label]=\"isSubmitInProgress ? 'Submitting' : 'Submit For Approval'\"\n [disabled]=\"!isCartRoute\"\n tooltipPosition=\"bottom\"\n [showDelay]=\"300\"\n [pTooltip]=\"isCartRoute ? '' : disabledActionButtonTooltip\"\n (onClick)=\"submitButtonClickHandler()\"\n [loading]=\"isSubmitInProgress\"\n ></p-button>\n </ng-container>\n</div>\n", styles: [":host{display:flex;align-items:center;height:48px;width:100%;background-color:var(--vl-primary-color);color:#fff;padding:0 32px;flex-shrink:0}::ng-deep .p-overlaypanel.flow-header-overlay .p-overlaypanel-content{background-color:#fff;padding:16px}::ng-deep .p-overlaypanel.flow-header-overlay.left:before{left:6px!important}::ng-deep .p-overlaypanel.flow-header-overlay.right:before{right:6px!important}::ng-deep .p-overlaypanel.flow-header-overlay.left .p-overlaypanel-content{margin-left:-16px}::ng-deep .p-overlaypanel.flow-header-overlay.right .p-overlaypanel-content{margin-right:-16px}::ng-deep .p-overlaypanel.flow-header-overlay:before{background-color:#fff}:host ::ng-deep .p-button{padding:5px 15px;font-size:12px}:host ::ng-deep .p-button{color:var(--vl-primary-color);background-color:#fff;border-color:#fff}:host ::ng-deep .p-button:enabled:hover{background-color:var(--vl-primary-color);color:#fff;border-color:#fff}:host ::ng-deep .p-button.p-button-outlined{background-color:var(--vl-primary-color);color:#fff;border-color:#fff}:host ::ng-deep .p-button.p-button-outlined:enabled:hover{color:var(--vl-primary-color);background-color:#fff;border-color:#fff}:host ::ng-deep .p-button .p-button-label{white-space:nowrap}:host ::ng-deep .save-button .p-button{width:120px}:host ::ng-deep .submit-button .p-button{width:160px}.vl-icon{display:inline-block}.flow-info{flex-shrink:0;display:flex;grid-gap:8px;gap:8px;align-items:center}.flow-info .nav-popover-toggle{margin-left:-8px}.flow-info .object-name{text-transform:capitalize}.flow-info .nav-back{font-weight:bold}.flow-info .nav-item:not(.disabled):hover,.flow-info .nav-popover-toggle:not(.disabled):hover{opacity:.6}nav{display:flex;align-items:center;cursor:pointer;padding:4px 0}nav.disabled{opacity:.6;cursor:default}nav .nav-icon{margin-right:10px}nav .icon-with-margin{margin:0 4px}nav a{color:#fff}nav.account-name{margin-left:4px;display:block;max-width:200px;overflow:hidden;text-overflow:ellipsis}nav.nav-popover-toggle{width:24px;display:flex;justify-content:center}nav.nav-popover-toggle i{pointer-events:none;margin:0}nav i{pointer-events:none}.dot-separator:after{content:\"\";display:block;width:4px;height:4px;border-radius:50%;background:#fff}.slash-separator:after{content:\"\";display:block;background:#fff;width:1px;height:16px}.flow-header-overlay__wrapper{width:360px}.flow-header-overlay__wrapper .close-icon{cursor:pointer}.flow-header-overlay__wrapper .info-list{list-style:none;padding:0;font-size:12px}.flow-header-overlay__wrapper .info-list__row{padding:8px 0;display:flex;justify-content:space-between}.flow-header-overlay__title{display:flex;justify-content:space-between;align-items:center;margin:0 0 24px}.flow-navigation{flex-grow:1;display:flex;grid-gap:16px;gap:16px;justify-content:center;font-weight:600}.flow-navigation .cart-nav-container{display:flex}.flow-navigation .nav-popover-toggle{margin-left:-14px}.flow-navigation .nav-item,.flow-navigation .nav-popover-toggle{opacity:.6}.flow-navigation .nav-item.active,.flow-navigation .nav-item:not(.disabled):hover,.flow-navigation .nav-popover-toggle.active,.flow-navigation .nav-popover-toggle:not(.disabled):hover{opacity:1}.flow-controls{flex-shrink:0;display:flex;align-items:center;grid-gap:8px;gap:8px}\n"], components: [{ type: i4.OverlayPanel, selector: "p-overlayPanel", inputs: ["dismissable", "showCloseIcon", "style", "styleClass", "appendTo", "autoZIndex", "ariaCloseLabel", "baseZIndex", "focusOnShow", "showTransitionOptions", "hideTransitionOptions"], outputs: ["onShow", "onHide"] }, { type: HeaderCartOverlayComponent, selector: "vl-header-cart-overlay", inputs: ["products"] }, { type: i5.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "style", "styleClass", "badgeClass"], outputs: ["onClick", "onFocus", "onBlur"] }], directives: [{ type: i3.LetDirective, selector: "[vlLet]", inputs: ["vlLet"] }, { type: i9.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i10.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "appendTo", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "pTooltip", "tooltipDisabled", "tooltipOptions"] }, { type: i2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { type: i9.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], pipes: { "async": i9.AsyncPipe, "date": i9.DatePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
568
579
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: FlowHeaderComponent, decorators: [{
|
569
580
|
type: Component,
|
570
581
|
args: [{
|
@@ -573,7 +584,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImpo
|
|
573
584
|
styleUrls: ['./header.component.scss'],
|
574
585
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
575
586
|
}]
|
576
|
-
}], ctorParameters: function () { return [{ type:
|
587
|
+
}], ctorParameters: function () { return [{ type: i1$2.ContextService }, { type: i1$2.QuoteDraftService }, { type: i1$4.QuoteApiService }, { type: i1$4.SalesforceApiService }, { type: i1$2.FlowConfigurationService }, { type: FlowRouterService }, { type: FlowDialogService }]; } });
|
577
588
|
|
578
589
|
class FlowHeaderModule {
|
579
590
|
}
|
@@ -624,7 +635,7 @@ class FlowService {
|
|
624
635
|
return of(undefined);
|
625
636
|
}
|
626
637
|
const currentState = this.flowConfigurationService.getSnapshot();
|
627
|
-
const isNewLineItem = currentState.
|
638
|
+
const isNewLineItem = currentState.every(li => li.id !== lineItem.id);
|
628
639
|
let updatedState;
|
629
640
|
if (isNewLineItem) {
|
630
641
|
updatedState = [...currentState, lineItem];
|
@@ -643,26 +654,26 @@ class FlowService {
|
|
643
654
|
this.cleanup$.next();
|
644
655
|
}
|
645
656
|
}
|
646
|
-
FlowService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: FlowService, deps: [{ token: i4$1.IntegrationState }, { token: FlowRouterService }, { token:
|
657
|
+
FlowService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: FlowService, deps: [{ token: i4$1.IntegrationState }, { token: FlowRouterService }, { token: i1$2.QuoteDraftService }, { token: i1$2.ConfigurationService }, { token: i1$2.FlowConfigurationService }], target: i0.ɵɵFactoryTarget.Injectable });
|
647
658
|
FlowService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: FlowService });
|
648
659
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: FlowService, decorators: [{
|
649
660
|
type: Injectable
|
650
|
-
}], ctorParameters: function () { return [{ type: i4$1.IntegrationState }, { type: FlowRouterService }, { type:
|
661
|
+
}], ctorParameters: function () { return [{ type: i4$1.IntegrationState }, { type: FlowRouterService }, { type: i1$2.QuoteDraftService }, { type: i1$2.ConfigurationService }, { type: i1$2.FlowConfigurationService }]; } });
|
651
662
|
|
652
663
|
class FlowComponent {
|
653
|
-
constructor(routerService,
|
664
|
+
constructor(routerService, quoteDraftService, flowService) {
|
654
665
|
this.routerService = routerService;
|
655
|
-
this.
|
666
|
+
this.quoteDraftService = quoteDraftService;
|
656
667
|
this.flowService = flowService;
|
657
668
|
this.isLoading$ = this.routerService.loading$;
|
658
|
-
this.showHeader$ = this.routerService.route$.pipe(map(route => route.data.showHeader && !this.
|
669
|
+
this.showHeader$ = this.routerService.route$.pipe(map(route => route.data.showHeader && !this.quoteDraftService.isStandalone));
|
659
670
|
this.flowService.initSubscriptions();
|
660
671
|
}
|
661
672
|
ngOnDestroy() {
|
662
673
|
this.flowService.cleanup();
|
663
674
|
}
|
664
675
|
}
|
665
|
-
FlowComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: FlowComponent, deps: [{ token: FlowRouterService }, { token:
|
676
|
+
FlowComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: FlowComponent, deps: [{ token: FlowRouterService }, { token: i1$2.QuoteDraftService }, { token: FlowService }], target: i0.ɵɵFactoryTarget.Component });
|
666
677
|
FlowComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: FlowComponent, selector: "vl-flow", ngImport: i0, template: "<vl-flow-header *ngIf=\"showHeader$ | async\"></vl-flow-header>\n\n<div class=\"flow-content\">\n <div class=\"loading-overlay\" *ngIf=\"isLoading$ | async\">\n <vl-loader label=\"LOADING\"></vl-loader>\n </div>\n\n <router-outlet></router-outlet>\n</div>\n", styles: [":host{display:flex;flex-direction:column;height:100%}.flow-content{flex-grow:1;position:relative;overflow:hidden}.loading-overlay{position:absolute;height:100%;width:100%;left:0;right:0;top:0;bottom:0;background-color:#ffffff80;z-index:4}\n"], components: [{ type: FlowHeaderComponent, selector: "vl-flow-header" }, { type: i3.LoaderComponent, selector: "vl-loader", inputs: ["label", "overlayVisible"] }], directives: [{ type: i9.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1$1.RouterOutlet, selector: "router-outlet", outputs: ["activate", "deactivate"], exportAs: ["outlet"] }], pipes: { "async": i9.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
667
678
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: FlowComponent, decorators: [{
|
668
679
|
type: Component,
|
@@ -672,7 +683,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImpo
|
|
672
683
|
styleUrls: ['./flow.component.scss'],
|
673
684
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
674
685
|
}]
|
675
|
-
}], ctorParameters: function () { return [{ type: FlowRouterService }, { type:
|
686
|
+
}], ctorParameters: function () { return [{ type: FlowRouterService }, { type: i1$2.QuoteDraftService }, { type: FlowService }]; } });
|
676
687
|
|
677
688
|
class ContextGuard {
|
678
689
|
constructor(router, routerService) {
|
@@ -733,14 +744,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImpo
|
|
733
744
|
}], ctorParameters: function () { return [{ type: i1$1.Router }, { type: FlowRouterService }]; } });
|
734
745
|
|
735
746
|
class ProductUnloadGuard {
|
736
|
-
constructor(contextService, configurationService, flowDialogService) {
|
747
|
+
constructor(contextService, quoteDraftService, configurationService, flowDialogService) {
|
737
748
|
this.contextService = contextService;
|
749
|
+
this.quoteDraftService = quoteDraftService;
|
738
750
|
this.configurationService = configurationService;
|
739
751
|
this.flowDialogService = flowDialogService;
|
740
752
|
}
|
741
753
|
canDeactivate() {
|
742
754
|
let observable = of(true);
|
743
|
-
if (!this.
|
755
|
+
if (!this.quoteDraftService.isStandalone && this.configurationService.hasUnsavedChanges) {
|
744
756
|
observable = this.flowDialogService.showUnsavedChangesDialog().pipe(map(confirmed => !confirmed));
|
745
757
|
}
|
746
758
|
return observable.pipe(tap(unload => {
|
@@ -751,11 +763,11 @@ class ProductUnloadGuard {
|
|
751
763
|
}));
|
752
764
|
}
|
753
765
|
}
|
754
|
-
ProductUnloadGuard.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: ProductUnloadGuard, deps: [{ token:
|
766
|
+
ProductUnloadGuard.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: ProductUnloadGuard, deps: [{ token: i1$2.ContextService }, { token: i1$2.QuoteDraftService }, { token: i1$2.ConfigurationService }, { token: FlowDialogService }], target: i0.ɵɵFactoryTarget.Injectable });
|
755
767
|
ProductUnloadGuard.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: ProductUnloadGuard });
|
756
768
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: ProductUnloadGuard, decorators: [{
|
757
769
|
type: Injectable
|
758
|
-
}], ctorParameters: function () { return [{ type:
|
770
|
+
}], ctorParameters: function () { return [{ type: i1$2.ContextService }, { type: i1$2.QuoteDraftService }, { type: i1$2.ConfigurationService }, { type: FlowDialogService }]; } });
|
759
771
|
|
760
772
|
class RootGuard {
|
761
773
|
constructor(router, routerService) {
|
@@ -798,7 +810,7 @@ const FLOW_CUSTOMIZATION = new InjectionToken('FLOW_CUSTOMIZATION');
|
|
798
810
|
|
799
811
|
class CatalogComponent {
|
800
812
|
constructor(templatesApi, contextService, cdr, toastService, customizationService) {
|
801
|
-
var _a
|
813
|
+
var _a;
|
802
814
|
this.templatesApi = templatesApi;
|
803
815
|
this.contextService = contextService;
|
804
816
|
this.cdr = cdr;
|
@@ -808,7 +820,7 @@ class CatalogComponent {
|
|
808
820
|
this.state$ = new BehaviorSubject({ loading: true, failure: false });
|
809
821
|
this.templateApiName = '';
|
810
822
|
this.destroyed$ = new Subject();
|
811
|
-
this.templateApiName = (
|
823
|
+
this.templateApiName = (_a = this.contextService.resolve().properties.catalogTemplateApiName) !== null && _a !== void 0 ? _a : '';
|
812
824
|
}
|
813
825
|
ngOnInit() {
|
814
826
|
this.generateUIDefinition$()
|
@@ -885,7 +897,7 @@ class CatalogComponent {
|
|
885
897
|
}));
|
886
898
|
}
|
887
899
|
}
|
888
|
-
CatalogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: CatalogComponent, deps: [{ token: i1$
|
900
|
+
CatalogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: CatalogComponent, deps: [{ token: i1$4.UITemplatesApiService }, { token: i1$2.ContextService }, { token: i0.ChangeDetectorRef }, { token: i3.ToastService }, { token: FLOW_CUSTOMIZATION, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
889
901
|
CatalogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", 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: [""], components: [{ type: i3.LoaderComponent, selector: "vl-loader", inputs: ["label", "overlayVisible"] }, { type: i4$1.PreviewComponent, selector: "vl-cms-preview", inputs: ["modelId", "uiDefinition", "clearState"] }], directives: [{ type: i9.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "async": i9.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
890
902
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: CatalogComponent, decorators: [{
|
891
903
|
type: Component,
|
@@ -895,7 +907,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImpo
|
|
895
907
|
styleUrls: ['./catalog.component.scss'],
|
896
908
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
897
909
|
}]
|
898
|
-
}], ctorParameters: function () { return [{ type: i1$
|
910
|
+
}], ctorParameters: function () { return [{ type: i1$4.UITemplatesApiService }, { type: i1$2.ContextService }, { type: i0.ChangeDetectorRef }, { type: i3.ToastService }, { type: undefined, decorators: [{
|
899
911
|
type: Optional
|
900
912
|
}, {
|
901
913
|
type: Inject,
|
@@ -916,6 +928,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImpo
|
|
916
928
|
}]
|
917
929
|
}] });
|
918
930
|
|
931
|
+
const getFlowObjectIdPropertyName = (objectName) => {
|
932
|
+
switch (objectName) {
|
933
|
+
case 'Account':
|
934
|
+
return 'accountId';
|
935
|
+
case 'Order':
|
936
|
+
return 'orderId';
|
937
|
+
case 'Quote':
|
938
|
+
default:
|
939
|
+
return 'quoteId';
|
940
|
+
}
|
941
|
+
};
|
942
|
+
|
919
943
|
class DebugComponent {
|
920
944
|
constructor(flowsApiService, router, activatedRoute, context, flowConfiguration, quoteDraftService) {
|
921
945
|
this.flowsApiService = flowsApiService;
|
@@ -955,7 +979,7 @@ class DebugComponent {
|
|
955
979
|
});
|
956
980
|
}
|
957
981
|
}
|
958
|
-
DebugComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: DebugComponent, deps: [{ token: i1$
|
982
|
+
DebugComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: DebugComponent, deps: [{ token: i1$4.FlowsApiService }, { token: i1$1.Router }, { token: i1$1.ActivatedRoute }, { token: i1$2.ContextService }, { token: i1$2.FlowConfigurationService }, { token: i1$2.QuoteDraftService }], target: i0.ɵɵFactoryTarget.Component });
|
959
983
|
DebugComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", 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\n <div class=\"field\">\n <label>SF Object Name</label>\n <p-dropdown\n appendTo=\"body\"\n formControlName=\"name\"\n [autoDisplayFirst]=\"false\"\n [options]=\"objectNames\"\n ></p-dropdown>\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 </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.entryPath }}</td>\n <td>{{ flow.queryParamsStr }}</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;grid-gap:24px;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}tr{cursor:pointer}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}\n"], components: [{ type: i4$2.Dropdown, selector: "p-dropdown", inputs: ["scrollHeight", "filter", "name", "style", "panelStyle", "styleClass", "panelStyleClass", "readonly", "required", "editable", "appendTo", "tabindex", "placeholder", "filterPlaceholder", "filterLocale", "inputId", "selectId", "dataKey", "filterBy", "autofocus", "resetFilterOnHide", "dropdownIcon", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "autoDisplayFirst", "group", "showClear", "emptyFilterMessage", "emptyMessage", "virtualScroll", "itemSize", "autoZIndex", "baseZIndex", "showTransitionOptions", "hideTransitionOptions", "ariaFilterLabel", "ariaLabelledBy", "filterMatchMode", "maxlength", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "autofocusFilter", "disabled", "options", "filterValue"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onShow", "onHide", "onClear"] }, { type: i5.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "style", "styleClass", "badgeClass"], outputs: ["onClick", "onFocus", "onBlur"] }, { type: i6$1.RadioButton, selector: "p-radioButton", inputs: ["value", "formControlName", "name", "disabled", "label", "tabindex", "inputId", "ariaLabelledBy", "ariaLabel", "style", "styleClass", "labelStyleClass"], outputs: ["onClick", "onFocus", "onBlur"] }], directives: [{ type: i7.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i7.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i7.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i7.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i7.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i7.FormControlName, selector: "[formControlName]", inputs: ["disabled", "formControlName", "ngModel"], outputs: ["ngModelChange"] }, { type: i8.InputText, selector: "[pInputText]" }, { type: i9.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i7.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], pipes: { "async": i9.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
960
984
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: DebugComponent, decorators: [{
|
961
985
|
type: Component,
|
@@ -965,7 +989,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImpo
|
|
965
989
|
styleUrls: ['./debug.component.scss'],
|
966
990
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
967
991
|
}]
|
968
|
-
}], ctorParameters: function () { return [{ type: i1$
|
992
|
+
}], ctorParameters: function () { return [{ type: i1$4.FlowsApiService }, { type: i1$1.Router }, { type: i1$1.ActivatedRoute }, { type: i1$2.ContextService }, { type: i1$2.FlowConfigurationService }, { type: i1$2.QuoteDraftService }]; } });
|
969
993
|
|
970
994
|
const routes$1 = [{ path: '', component: DebugComponent }];
|
971
995
|
class DebugModule {
|
@@ -1110,7 +1134,7 @@ class LegacyProductComponent {
|
|
1110
1134
|
}), switchMap$1(runtimeContext => this.customizeContext(productId, runtimeContext)));
|
1111
1135
|
}
|
1112
1136
|
}
|
1113
|
-
LegacyProductComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: LegacyProductComponent, deps: [{ token: i1$1.ActivatedRoute }, { token:
|
1137
|
+
LegacyProductComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: LegacyProductComponent, deps: [{ token: i1$1.ActivatedRoute }, { token: i1$2.QuoteDraftService }, { token: i1$4.QuoteApiService }, { token: i1$2.ContextService }, { token: i4$3.RuntimeContextService }, { token: i4$3.RuntimeService }, { token: i4$3.CurrentStateService }, { token: FLOW_CUSTOMIZATION, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
1114
1138
|
LegacyProductComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: LegacyProductComponent, selector: "ng-component", ngImport: i0, template: "<vl-runtime #runtimeView (solutionUpdated)=\"onSolutionUpdated($event)\"></vl-runtime>\n", styles: [":host{display:block;height:100%}\n"], components: [{ type: i4$3.RuntimeComponent, selector: "vl-runtime", outputs: ["solutionUpdated"] }] });
|
1115
1139
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: LegacyProductComponent, decorators: [{
|
1116
1140
|
type: Component,
|
@@ -1118,7 +1142,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImpo
|
|
1118
1142
|
templateUrl: './legacy-product.component.html',
|
1119
1143
|
styleUrls: ['./legacy-product.component.scss'],
|
1120
1144
|
}]
|
1121
|
-
}], ctorParameters: function () { return [{ type: i1$1.ActivatedRoute }, { type:
|
1145
|
+
}], ctorParameters: function () { return [{ type: i1$1.ActivatedRoute }, { type: i1$2.QuoteDraftService }, { type: i1$4.QuoteApiService }, { type: i1$2.ContextService }, { type: i4$3.RuntimeContextService }, { type: i4$3.RuntimeService }, { type: i4$3.CurrentStateService }, { type: undefined, decorators: [{
|
1122
1146
|
type: Optional
|
1123
1147
|
}, {
|
1124
1148
|
type: Inject,
|
@@ -1128,7 +1152,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImpo
|
|
1128
1152
|
class LegacyProductModule {
|
1129
1153
|
}
|
1130
1154
|
LegacyProductModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: LegacyProductModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
1131
|
-
LegacyProductModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: LegacyProductModule, declarations: [LegacyProductComponent], imports: [CommonModule, RuntimeModule, i1$
|
1155
|
+
LegacyProductModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: LegacyProductModule, declarations: [LegacyProductComponent], imports: [CommonModule, RuntimeModule, i1$5.TooltipModule], exports: [LegacyProductComponent] });
|
1132
1156
|
LegacyProductModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: LegacyProductModule, imports: [[CommonModule, RuntimeModule, TooltipModule$1.forRoot()]] });
|
1133
1157
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: LegacyProductModule, decorators: [{
|
1134
1158
|
type: NgModule,
|
@@ -1171,8 +1195,7 @@ class ProductComponent {
|
|
1171
1195
|
}));
|
1172
1196
|
}
|
1173
1197
|
init(quote) {
|
1174
|
-
|
1175
|
-
const contextProperties = (_b = (_a = this.contextService.resolve()) === null || _a === void 0 ? void 0 : _a.properties) !== null && _b !== void 0 ? _b : {};
|
1198
|
+
const contextProperties = this.contextService.resolve().properties;
|
1176
1199
|
const productId = contextProperties.productId;
|
1177
1200
|
if (!productId) {
|
1178
1201
|
return;
|
@@ -1208,7 +1231,7 @@ class ProductComponent {
|
|
1208
1231
|
return id;
|
1209
1232
|
}
|
1210
1233
|
}
|
1211
|
-
ProductComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: ProductComponent, deps: [{ token:
|
1234
|
+
ProductComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: ProductComponent, deps: [{ token: i1$2.ContextService }, { token: i1$2.ConfigurationRuntimeService }, { token: i1$2.ConfigurationService }, { token: i1$2.QuoteDraftService }, { token: i2.MessageService }, { token: FLOW_CUSTOMIZATION, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
1212
1235
|
ProductComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: ProductComponent, selector: "vl-flow-product", 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: [""], components: [{ type: i3.LoaderComponent, selector: "vl-loader", inputs: ["label", "overlayVisible"] }, { type: i4$1.PreviewComponent, selector: "vl-cms-preview", inputs: ["modelId", "uiDefinition", "clearState"] }], directives: [{ type: i9.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "async": i9.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
1213
1236
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: ProductComponent, decorators: [{
|
1214
1237
|
type: Component,
|
@@ -1218,7 +1241,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImpo
|
|
1218
1241
|
styleUrls: ['./product.component.scss'],
|
1219
1242
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
1220
1243
|
}]
|
1221
|
-
}], ctorParameters: function () { return [{ type:
|
1244
|
+
}], ctorParameters: function () { return [{ type: i1$2.ContextService }, { type: i1$2.ConfigurationRuntimeService }, { type: i1$2.ConfigurationService }, { type: i1$2.QuoteDraftService }, { type: i2.MessageService }, { type: undefined, decorators: [{
|
1222
1245
|
type: Optional
|
1223
1246
|
}, {
|
1224
1247
|
type: Inject,
|
@@ -1280,7 +1303,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImpo
|
|
1280
1303
|
|
1281
1304
|
class ShoppingCartComponent {
|
1282
1305
|
constructor(templatesApi, contextService, cdr, toastService, customizationService) {
|
1283
|
-
var _a
|
1306
|
+
var _a;
|
1284
1307
|
this.templatesApi = templatesApi;
|
1285
1308
|
this.contextService = contextService;
|
1286
1309
|
this.cdr = cdr;
|
@@ -1290,7 +1313,7 @@ class ShoppingCartComponent {
|
|
1290
1313
|
this.state$ = new BehaviorSubject({ loading: true, failure: false });
|
1291
1314
|
this.templateApiName = '';
|
1292
1315
|
this.destroyed$ = new Subject();
|
1293
|
-
this.templateApiName = (
|
1316
|
+
this.templateApiName = (_a = this.contextService.resolve().properties.cartTemplateApiName) !== null && _a !== void 0 ? _a : '';
|
1294
1317
|
}
|
1295
1318
|
ngOnInit() {
|
1296
1319
|
this.generateUIDefinition$()
|
@@ -1367,7 +1390,7 @@ class ShoppingCartComponent {
|
|
1367
1390
|
}));
|
1368
1391
|
}
|
1369
1392
|
}
|
1370
|
-
ShoppingCartComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: ShoppingCartComponent, deps: [{ token: i1$
|
1393
|
+
ShoppingCartComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: ShoppingCartComponent, deps: [{ token: i1$4.UITemplatesApiService }, { token: i1$2.ContextService }, { token: i0.ChangeDetectorRef }, { token: i3.ToastService }, { token: FLOW_CUSTOMIZATION, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
1371
1394
|
ShoppingCartComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", 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: [""], components: [{ type: i3.LoaderComponent, selector: "vl-loader", inputs: ["label", "overlayVisible"] }, { type: i4$1.PreviewComponent, selector: "vl-cms-preview", inputs: ["modelId", "uiDefinition", "clearState"] }], directives: [{ type: i9.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "async": i9.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
1372
1395
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: ShoppingCartComponent, decorators: [{
|
1373
1396
|
type: Component,
|
@@ -1377,7 +1400,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImpo
|
|
1377
1400
|
styleUrls: ['./shopping-cart.component.scss'],
|
1378
1401
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
1379
1402
|
}]
|
1380
|
-
}], ctorParameters: function () { return [{ type: i1$
|
1403
|
+
}], ctorParameters: function () { return [{ type: i1$4.UITemplatesApiService }, { type: i1$2.ContextService }, { type: i0.ChangeDetectorRef }, { type: i3.ToastService }, { type: undefined, decorators: [{
|
1381
1404
|
type: Optional
|
1382
1405
|
}, {
|
1383
1406
|
type: Inject,
|
@@ -1413,12 +1436,14 @@ class ContextResolver {
|
|
1413
1436
|
const { queryParams, data } = route;
|
1414
1437
|
const { uiDefinitionId } = queryParams;
|
1415
1438
|
const { headerId, mode } = data !== null && data !== void 0 ? data : {};
|
1416
|
-
|
1417
|
-
|
1418
|
-
|
1439
|
+
if (this.contextService.isInitialized) {
|
1440
|
+
const currentContext = this.contextService.resolve();
|
1441
|
+
if (headerId && currentContext.headerId === headerId) {
|
1442
|
+
return of(currentContext);
|
1443
|
+
}
|
1419
1444
|
}
|
1420
1445
|
return this.contextService.create(headerId, mode).pipe(tap$1((context) => {
|
1421
|
-
this.contextService.update(Object.assign(Object.assign({}, context), { uiDefinitionId, properties: Object.assign(Object.assign(
|
1446
|
+
this.contextService.update(Object.assign(Object.assign({}, context), { uiDefinitionId, properties: Object.assign(Object.assign({}, context.properties), (queryParams !== null && queryParams !== void 0 ? queryParams : {})) }));
|
1422
1447
|
}), catchError$1(e => {
|
1423
1448
|
const message = e instanceof HttpErrorResponse ? e.error.message : e;
|
1424
1449
|
this.handleError(route, message);
|
@@ -1426,11 +1451,11 @@ class ContextResolver {
|
|
1426
1451
|
}));
|
1427
1452
|
}
|
1428
1453
|
}
|
1429
|
-
ContextResolver.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: ContextResolver, deps: [{ token:
|
1454
|
+
ContextResolver.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: ContextResolver, deps: [{ token: i1$2.ContextService }, { token: i1$1.Router }, { token: FlowRouterService }], target: i0.ɵɵFactoryTarget.Injectable });
|
1430
1455
|
ContextResolver.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: ContextResolver });
|
1431
1456
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: ContextResolver, decorators: [{
|
1432
1457
|
type: Injectable
|
1433
|
-
}], ctorParameters: function () { return [{ type:
|
1458
|
+
}], ctorParameters: function () { return [{ type: i1$2.ContextService }, { type: i1$1.Router }, { type: FlowRouterService }]; } });
|
1434
1459
|
|
1435
1460
|
class FlowResolver {
|
1436
1461
|
constructor(router, flowsApiService, routerService) {
|
@@ -1477,11 +1502,11 @@ class FlowResolver {
|
|
1477
1502
|
}));
|
1478
1503
|
}
|
1479
1504
|
}
|
1480
|
-
FlowResolver.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: FlowResolver, deps: [{ token: i1$1.Router }, { token: i1$
|
1505
|
+
FlowResolver.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: FlowResolver, deps: [{ token: i1$1.Router }, { token: i1$4.FlowsApiService }, { token: FlowRouterService }], target: i0.ɵɵFactoryTarget.Injectable });
|
1481
1506
|
FlowResolver.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: FlowResolver });
|
1482
1507
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: FlowResolver, decorators: [{
|
1483
1508
|
type: Injectable
|
1484
|
-
}], ctorParameters: function () { return [{ type: i1$1.Router }, { type: i1$
|
1509
|
+
}], ctorParameters: function () { return [{ type: i1$1.Router }, { type: i1$4.FlowsApiService }, { type: FlowRouterService }]; } });
|
1485
1510
|
|
1486
1511
|
class QuoteResolver {
|
1487
1512
|
constructor(router, quoteDraftService, routerService, contextService, flowConfiguration) {
|
@@ -1496,7 +1521,7 @@ class QuoteResolver {
|
|
1496
1521
|
return from(this.router.navigate([parentUrl, '404'], { state: { message } }));
|
1497
1522
|
}
|
1498
1523
|
initFlow$() {
|
1499
|
-
if (this.
|
1524
|
+
if (this.quoteDraftService.isStandalone) {
|
1500
1525
|
return of(undefined);
|
1501
1526
|
}
|
1502
1527
|
return this.flowConfiguration.initialize$();
|
@@ -1514,11 +1539,11 @@ class QuoteResolver {
|
|
1514
1539
|
}));
|
1515
1540
|
}
|
1516
1541
|
}
|
1517
|
-
QuoteResolver.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: QuoteResolver, deps: [{ token: i1$1.Router }, { token:
|
1542
|
+
QuoteResolver.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: QuoteResolver, deps: [{ token: i1$1.Router }, { token: i1$2.QuoteDraftService }, { token: FlowRouterService }, { token: i1$2.ContextService }, { token: i1$2.FlowConfigurationService }], target: i0.ɵɵFactoryTarget.Injectable });
|
1518
1543
|
QuoteResolver.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: QuoteResolver });
|
1519
1544
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: QuoteResolver, decorators: [{
|
1520
1545
|
type: Injectable
|
1521
|
-
}], ctorParameters: function () { return [{ type: i1$1.Router }, { type:
|
1546
|
+
}], ctorParameters: function () { return [{ type: i1$1.Router }, { type: i1$2.QuoteDraftService }, { type: FlowRouterService }, { type: i1$2.ContextService }, { type: i1$2.FlowConfigurationService }]; } });
|
1522
1547
|
|
1523
1548
|
const rootRoute = {
|
1524
1549
|
id: VELOCE_FLOW_ROOT_ROUTE,
|
@@ -1654,5 +1679,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImpo
|
|
1654
1679
|
* Generated bundle index. Do not edit.
|
1655
1680
|
*/
|
1656
1681
|
|
1657
|
-
export { ContextGuard, FLOW_CUSTOMIZATION, FlowModule, FlowService, VELOCE_FLOW_ROOT_ROUTE, getFlowObjectIdPropertyName
|
1682
|
+
export { ContextGuard, FLOW_CUSTOMIZATION, FlowModule, FlowService, VELOCE_FLOW_ROOT_ROUTE, getFlowObjectIdPropertyName };
|
1658
1683
|
//# sourceMappingURL=veloce-sdk.js.map
|