@veloceapps/sdk 6.0.0-95 → 6.0.0-96
Sign up to get free protection for your applications and to get access to all the features.
- package/bundles/veloceapps-sdk-cms.umd.js +1 -1
- package/bundles/veloceapps-sdk-cms.umd.js.map +1 -1
- package/bundles/veloceapps-sdk-core.umd.js +7 -0
- package/bundles/veloceapps-sdk-core.umd.js.map +1 -1
- package/bundles/veloceapps-sdk.umd.js +191 -9
- package/bundles/veloceapps-sdk.umd.js.map +1 -1
- package/cms/components/preview/preview.types.d.ts +2 -2
- package/cms/services/integration.state.d.ts +2 -3
- package/cms/types/integration.types.d.ts +5 -0
- package/core/services/context.service.d.ts +1 -0
- package/esm2015/cms/components/preview/preview.component.js +2 -2
- package/esm2015/cms/components/preview/preview.types.js +1 -1
- package/esm2015/cms/services/integration.state.js +1 -1
- package/esm2015/cms/types/integration.types.js +1 -1
- package/esm2015/core/services/context.service.js +4 -1
- package/esm2015/src/components/header/header.component.js +22 -4
- package/esm2015/src/flow-routing.module.js +14 -1
- package/esm2015/src/pages/assets/assets.component.js +117 -0
- package/esm2015/src/pages/assets/assets.module.js +20 -0
- package/esm2015/src/pages/catalog/catalog.component.js +3 -3
- package/esm2015/src/pages/shopping-cart/shopping-cart.component.js +3 -3
- package/esm2015/src/resolvers/quote.resolver.js +11 -6
- package/esm2015/src/services/flow-router.service.js +9 -1
- package/esm2015/src/services/flow.service.js +9 -2
- package/esm2015/src/types/flow-customization.types.js +1 -1
- package/fesm2015/veloceapps-sdk-cms.js +1 -1
- package/fesm2015/veloceapps-sdk-cms.js.map +1 -1
- package/fesm2015/veloceapps-sdk-core.js +3 -0
- package/fesm2015/veloceapps-sdk-core.js.map +1 -1
- package/fesm2015/veloceapps-sdk.js +178 -9
- package/fesm2015/veloceapps-sdk.js.map +1 -1
- package/package.json +1 -1
- package/src/components/header/header.component.d.ts +6 -1
- package/src/flow-routing.module.d.ts +4 -3
- package/src/pages/assets/assets.component.d.ts +32 -0
- package/src/pages/assets/assets.module.d.ts +10 -0
- package/src/resolvers/quote.resolver.d.ts +1 -0
- package/src/services/flow-router.service.d.ts +2 -0
- package/src/services/flow.service.d.ts +1 -0
- package/src/types/flow-customization.types.d.ts +1 -0
@@ -325,6 +325,9 @@ class FlowRouterService {
|
|
325
325
|
isCatalogRoute$() {
|
326
326
|
return this.getFlowSubpath$().pipe(map(url => url.startsWith('catalog')));
|
327
327
|
}
|
328
|
+
isAssetsRoute$() {
|
329
|
+
return this.getFlowSubpath$().pipe(map(url => url.startsWith('assets')));
|
330
|
+
}
|
328
331
|
navigateBack() {
|
329
332
|
const prevUrl = this.urlHistory[this.urlHistory.length - 2];
|
330
333
|
if (prevUrl) {
|
@@ -349,6 +352,11 @@ class FlowRouterService {
|
|
349
352
|
const flowRouteUrl = this.getFlowRootPath(routeSnapshot);
|
350
353
|
this.router.navigate([flowRouteUrl, 'catalog'], { queryParams: routeSnapshot.queryParams });
|
351
354
|
}
|
355
|
+
navigateToAssets() {
|
356
|
+
const routeSnapshot = this.getLastChildRouteSnapshot(this.route.snapshot);
|
357
|
+
const flowRouteUrl = this.getFlowRootPath(routeSnapshot);
|
358
|
+
this.router.navigate([flowRouteUrl, 'assets'], { queryParams: routeSnapshot.queryParams });
|
359
|
+
}
|
352
360
|
switchObject(id) {
|
353
361
|
const routeSnapshot = this.getLastChildRouteSnapshot(this.route.snapshot);
|
354
362
|
const route = this.getLastChildRoute(this.route);
|
@@ -865,10 +873,12 @@ class FlowHeaderComponent {
|
|
865
873
|
this.isReadonlyMode$ = this.quoteDraftService.hasProducts$.pipe(map(() => this.isReadonlyMode()));
|
866
874
|
this.status$ = this.contextService.resolve$().pipe(map(context => { var _a; return (_a = context.properties.Status) !== null && _a !== void 0 ? _a : ''; }));
|
867
875
|
this.isEditMode$ = this.quoteDraftService.isEditMode$();
|
868
|
-
this.
|
876
|
+
this.assetsCount$ = this.getAssets$().pipe(map(lineItems => lineItems.length));
|
877
|
+
this.products$ = this.getDraftItems$().pipe(map(lineItems => this.generateProducts(lineItems)));
|
869
878
|
this.isConfigurationRoute$ = this.routerService.isConfigurationRoute$();
|
870
879
|
this.isCartRoute$ = this.routerService.isCartRoute$();
|
871
880
|
this.isCatalogRoute$ = this.routerService.isCatalogRoute$();
|
881
|
+
this.isAssetsRoute$ = this.routerService.isAssetsRoute$();
|
872
882
|
this.objectDetails$ = this.getObjectDetails$();
|
873
883
|
this.shoppingCartSettingsApiService
|
874
884
|
.getSettingsMap()
|
@@ -942,6 +952,11 @@ class FlowHeaderComponent {
|
|
942
952
|
this.routerService.navigateToCatalog();
|
943
953
|
}
|
944
954
|
}
|
955
|
+
navigateToAssets() {
|
956
|
+
if (!this.isReadonlyMode()) {
|
957
|
+
this.routerService.navigateToAssets();
|
958
|
+
}
|
959
|
+
}
|
945
960
|
docGenButtonClickHandler(isCartRoute) {
|
946
961
|
if (this.isAccountMode) {
|
947
962
|
if (!this.quoteDraftService.hasUnsavedChanges) {
|
@@ -1084,6 +1099,17 @@ class FlowHeaderComponent {
|
|
1084
1099
|
formatMetric(value) {
|
1085
1100
|
return (value ? Number(value) : 0).toFixed(2);
|
1086
1101
|
}
|
1102
|
+
getDraftItems$() {
|
1103
|
+
return combineLatest([
|
1104
|
+
this.flowConfiguration.get(),
|
1105
|
+
this.integrationState.state$.pipe(map(state => state.modifiedAssets), distinctUntilChanged()),
|
1106
|
+
]).pipe(map(([lineItems, modifiedAssets]) => lineItems.filter(li => li.status !== 'EXIST' || (li.assetId && (modifiedAssets === null || modifiedAssets === void 0 ? void 0 : modifiedAssets[li.assetId])))));
|
1107
|
+
}
|
1108
|
+
getAssets$() {
|
1109
|
+
return this.flowConfiguration
|
1110
|
+
.get()
|
1111
|
+
.pipe(map(lineItems => lineItems.filter(li => (!!li.assetId || !!li.openOrderLineItemId) && !li.rampInstanceId)));
|
1112
|
+
}
|
1087
1113
|
generateProducts(lineItems) {
|
1088
1114
|
const date = new Date();
|
1089
1115
|
date.setHours(0, 0, 0, 0);
|
@@ -1130,7 +1156,7 @@ class FlowHeaderComponent {
|
|
1130
1156
|
}
|
1131
1157
|
}
|
1132
1158
|
FlowHeaderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FlowHeaderComponent, deps: [{ token: i1$1.ContextService }, { token: i1$1.QuoteDraftService }, { token: i2.QuoteApiService }, { token: i2.SalesforceApiService }, { token: i1$1.FlowConfigurationService }, { token: FlowRouterService }, { token: FlowDialogService }, { token: i4.IntegrationState }, { token: i2.ShoppingCartSettingsApiService }], target: i0.ɵɵFactoryTarget.Component });
|
1133
|
-
FlowHeaderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: FlowHeaderComponent, selector: "vl-flow-header", ngImport: i0, template: "<ng-container *ngIf=\"contextProperties$ | async as contextProperties\">\n <ng-container *ngIf=\"objectDetails$ | async as details\">\n <div class=\"flow-info\">\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 to {{ objectName$ | async | titlecase }}</span>\n </nav>\n\n <ng-container *ngIf=\"isAccountMode$ | async\">\n <span class=\"dot-separator\"></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$ | async\">\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)\">\n <span>{{ details.accountName }}</span>\n </a>\n </li>\n <li class=\"info-list__row\">\n <span>Opportunity Name:</span>\n <a target=\"_blank\" [href]=\"getSalesforceObjectLink(details.opportunityId)\">\n <span>{{ details.opportunityName }}</span>\n </a>\n </li>\n <li class=\"info-list__row\">\n <span>Quote Name:</span>\n <a target=\"_blank\" [href]=\"getSalesforceObjectLink(details.quoteId)\">\n <span>{{ details.quoteName }}</span>\n </a>\n </li>\n <li class=\"info-list__row\">\n <span>Quote Number:</span>\n <a target=\"_blank\" [href]=\"getSalesforceObjectLink(details.quoteId)\">\n <span>{{ details.quoteNumber }}</span>\n </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 <ng-container *vlLet=\"isReadonlyMode$ | async as isReadonlyMode\">\n <nav\n class=\"nav-item\"\n [ngClass]=\"{ active: (isCatalogRoute$ | async), disabled: isReadonlyMode }\"\n (click)=\"navigateToCatalog()\"\n >\n Catalog\n </nav>\n <nav class=\"nav-item disabled\" [ngClass]=\"{ active: isConfigurationRoute$ | async }\">Configurator</nav>\n <ng-container *vlLet=\"products$ | async as products\">\n <nav\n class=\"nav-item\"\n [ngClass]=\"{ active: (isCartRoute$ | async), disabled: isReadonlyMode }\"\n (click)=\"navigateToShoppingCart()\"\n >\n Shopping Cart ({{ products.length }})\n </nav>\n\n <nav\n class=\"nav-popover-toggle\"\n [ngClass]=\"{ active: (isCartRoute$ | async), disabled: isReadonlyMode }\"\n (click)=\"toggleCartOverlay(cart, $event)\"\n >\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-cart-preview #cart [products]=\"products\"></vl-cart-preview>\n </ng-container>\n </ng-container>\n </div>\n\n <div class=\"flow-controls\">\n <ng-container *ngIf=\"(isReadonlyMode$ | async) === false\">\n <ng-container *vlLet=\"activePriceList$ | async as priceList\">\n <div>\n <ng-container *vlLet=\"assetPriceLists$ | async as assetPriceLists\">\n <ng-container *ngIf=\"(isAccountMode$ | async) && assetPriceLists.length > 1; else singlePriceList\">\n <nav class=\"nav-item\" (click)=\"priceListsOverlay?.toggle($event)\">\n <span>{{ priceList?.name }}</span>\n <i\n *ngIf=\"!priceListsOverlay?.overlayVisible\"\n class=\"vl-icon vl-icon-chevron-down icon-with-margin\"\n ></i>\n <i *ngIf=\"priceListsOverlay?.overlayVisible\" class=\"vl-icon vl-icon-chevron-up icon-with-margin\"></i>\n </nav>\n\n <p-overlayPanel styleClass=\"price-list-overlay\" #priceListsOverlay>\n <ng-template pTemplate>\n <span\n *ngFor=\"let option of assetPriceLists\"\n class=\"price-list-option\"\n [class.active]=\"priceList?.id === option.id\"\n (click)=\"selectPriceList(option.id); priceListsOverlay.hide()\"\n >\n {{ option.name }}\n </span>\n </ng-template>\n </p-overlayPanel>\n </ng-container>\n </ng-container>\n\n <ng-template #singlePriceList>\n <div>{{ priceList?.name }}</div>\n </ng-template>\n\n <div *ngIf=\"contextProperties.StartDate\">{{ contextProperties.StartDate | date : dateFormat }}</div>\n </div>\n </ng-container>\n </ng-container>\n\n <vl-metrics></vl-metrics>\n\n <ng-container *vlLet=\"isCartRoute$ | async as isCartRoute\">\n <ng-container *vlLet=\"isReadonlyMode$ | async as isReadonlyMode\">\n <p-button\n class=\"doc-gen-button\"\n icon=\"vl-icon vl-icon-doc-gen\"\n [disabled]=\"isReadonlyMode\"\n (onClick)=\"docGenButtonClickHandler(isCartRoute)\"\n pTooltip=\"Generate Document\"\n tooltipPosition=\"bottom\"\n tooltipStyleClass=\"vl-info-tooltip\"\n ></p-button>\n\n <ng-container *vlLet=\"isSaveInProgress$ | async as isSaveInProgress\">\n <ng-container *vlLet=\"isSubmitInProgress$ | async as isSubmitInProgress\">\n <p-splitButton\n *ngIf=\"!isSaveInProgress && !isSubmitInProgress\"\n label=\"Save to Quote\"\n (onClick)=\"saveButtonClickHandler(isCartRoute)\"\n [model]=\"getSplitButtonActions(isCartRoute)\"\n [disabled]=\"isReadonlyMode\"\n styleClass=\"p-button-outlined\"\n >\n </p-splitButton>\n\n <p-button\n *ngIf=\"isSaveInProgress\"\n class=\"save-button\"\n styleClass=\"p-button\"\n label=\"Saving\"\n [loading]=\"true\"\n ></p-button>\n\n <p-button\n *ngIf=\"isSubmitInProgress\"\n class=\"submit-button\"\n styleClass=\"p-button\"\n label=\"Submitting\"\n [loading]=\"true\"\n ></p-button>\n </ng-container>\n </ng-container>\n </ng-container>\n </ng-container>\n </div>\n </ng-container>\n</ng-container>\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.no-padding .p-overlaypanel-content{padding:0}::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}::ng-deep .p-overlaypanel.price-list-overlay .p-overlaypanel-content{border-radius:5px;border-color:var(--vl-border-color);padding:0;display:flex;flex-direction:column;max-height:140px;overflow:auto}:host ::ng-deep p-splitButton{height:32px;width:146px;display:flex}:host ::ng-deep p-splitButton .p-splitbutton{display:flex;font-size:12px;border-radius:2px;height:100%;width:100%;-webkit-backface-visibility:hidden}:host ::ng-deep p-splitButton .p-splitbutton .p-button:focus{box-shadow:none}:host ::ng-deep p-splitButton .p-splitbutton .p-splitbutton-defaultbutton{padding:7px 12px 7px 10px}:host ::ng-deep p-splitButton .p-splitbutton .p-splitbutton-defaultbutton:disabled{opacity:.2}:host ::ng-deep p-splitButton .p-splitbutton .p-splitbutton-menubutton:disabled{opacity:.3}:host ::ng-deep p-splitButton .p-splitbutton.p-button-outlined .p-button{background-color:#fff;color:var(--vl-primary-color);border:1px solid #fff}:host ::ng-deep p-splitButton .p-splitbutton.p-button-outlined .p-button:enabled:hover{background-color:var(--vl-secondary-nav-bg);color:var(--vl-primary-color);border:1px solid var(--vl-secondary-nav-bg);outline:none}:host ::ng-deep p-splitButton .p-splitbutton.p-button-outlined .p-button.p-splitbutton-menubutton{background-color:var(--vl-secondary-nav-bg);border-radius:0 2px 2px 0;border:1px solid var(--vl-secondary-nav-bg);border-left:none}:host ::ng-deep p-splitButton .p-splitbutton.p-button-outlined .p-button.p-splitbutton-menubutton:hover{background-color:var(--vl-secondary-nav-bg);border:1px solid var(--vl-secondary-nav-bg);border-left:none}:host ::ng-deep p-splitButton .p-splitbutton.p-button-outlined .p-button.p-splitbutton-defaultbutton{border-radius:2px 0 0 2px}:host ::ng-deep p-splitButton .p-splitbutton.p-button-outlined .p-button.p-splitbutton-defaultbutton .p-button-label{font-size:12px;line-height:16px;letter-spacing:.3px;white-space:nowrap}:host ::ng-deep p-splitButton .p-splitbutton .p-menu{display:flex;width:auto;margin-top:2px;border-radius:4px;border:1px solid var(--vl-border-color);box-shadow:0 4px 20px #2767c11a}:host ::ng-deep p-splitButton .p-splitbutton .p-menu .p-menu-list{display:flex;flex-direction:column}:host ::ng-deep p-splitButton .p-splitbutton .p-menu .p-menu-list .p-menuitem{display:flex;width:100%;height:32px}:host ::ng-deep p-splitButton .p-splitbutton .p-menu .p-menu-list .p-menuitem .p-menuitem-link{padding:8px;width:100%;height:100%}:host ::ng-deep p-splitButton .p-splitbutton .p-menu .p-menu-list .p-menuitem .p-menuitem-link:not(.p-disabled):hover{background-color:var(--vl-secondary-nav-bg)}:host ::ng-deep p-splitButton .p-splitbutton .p-menu .p-menu-list .p-menuitem .p-menuitem-link:not(.p-disabled):hover .p-menuitem-text{color:var(--vl-primary-color)}:host ::ng-deep p-splitButton .p-splitbutton .p-menu .p-menu-list .p-menuitem .p-menuitem-link .p-menuitem-text{line-height:16px;font-size:12px;letter-spacing:.3px;white-space:nowrap}:host ::ng-deep .doc-gen-button{height:32px;width:32px;display:inline-flex}:host ::ng-deep .doc-gen-button .p-button{border:1px solid #fff;border-radius:2px;width:100%;height:100%}:host ::ng-deep .doc-gen-button .p-button.p-component:disabled{opacity:.3}:host ::ng-deep .save-button,:host ::ng-deep .submit-button{height:32px;width:146px;display:flex}:host ::ng-deep .save-button .p-button,:host ::ng-deep .submit-button .p-button{border-radius:3px;width:100%;height:100%;background:rgba(255,255,255,.3);opacity:1;border:none}:host ::ng-deep .save-button .p-button .p-button-label,:host ::ng-deep .submit-button .p-button .p-button-label{font-size:12px;line-height:16px;letter-spacing:.3px;white-space:nowrap}.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 .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;height:14px}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}.metrics__row{display:flex;justify-content:space-between;grid-gap:2px;gap:2px}.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__wrapper .info-list__row a{text-align:right}.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}.price-list-option{padding:8px;color:var(--vl-primary-color);cursor:pointer}.price-list-option.active,.price-list-option:hover{background:var(--vl-secondary-nav-bg)}.flow-controls{flex-shrink:0;display:flex;align-items:center;grid-gap:16px;gap:16px;font-size:12px;line-height:16px}\n"], components: [{ type: i3$1.OverlayPanel, selector: "p-overlayPanel", inputs: ["dismissable", "showCloseIcon", "style", "styleClass", "appendTo", "autoZIndex", "ariaCloseLabel", "baseZIndex", "focusOnShow", "showTransitionOptions", "hideTransitionOptions"], outputs: ["onShow", "onHide"] }, { type: CartPreviewComponent, selector: "vl-cart-preview", inputs: ["products"] }, { type: MetricsComponent, selector: "vl-metrics" }, { type: i5.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "style", "styleClass", "badgeClass"], outputs: ["onClick", "onFocus", "onBlur"] }, { type: i10$1.SplitButton, selector: "p-splitButton", inputs: ["model", "icon", "iconPos", "label", "style", "styleClass", "menuStyle", "menuStyleClass", "disabled", "tabindex", "appendTo", "dir", "expandAriaLabel", "showTransitionOptions", "hideTransitionOptions"], outputs: ["onClick", "onDropdownClick"] }], directives: [{ type: i5$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i12$1.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "appendTo", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "pTooltip", "tooltipDisabled", "tooltipOptions"] }, { type: i2$1.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { type: i3.LetDirective, selector: "[vlLet]", inputs: ["vlLet"] }, { type: i5$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i5$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "async": i5$1.AsyncPipe, "titlecase": i5$1.TitleCasePipe, "date": i5$1.DatePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
1159
|
+
FlowHeaderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: FlowHeaderComponent, selector: "vl-flow-header", ngImport: i0, template: "<ng-container *ngIf=\"contextProperties$ | async as contextProperties\">\n <ng-container *ngIf=\"objectDetails$ | async as details\">\n <div class=\"flow-info\">\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 to {{ objectName$ | async | titlecase }}</span>\n </nav>\n\n <ng-container *ngIf=\"isAccountMode$ | async\">\n <span class=\"dot-separator\"></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$ | async\">\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)\">\n <span>{{ details.accountName }}</span>\n </a>\n </li>\n <li class=\"info-list__row\">\n <span>Opportunity Name:</span>\n <a target=\"_blank\" [href]=\"getSalesforceObjectLink(details.opportunityId)\">\n <span>{{ details.opportunityName }}</span>\n </a>\n </li>\n <li class=\"info-list__row\">\n <span>Quote Name:</span>\n <a target=\"_blank\" [href]=\"getSalesforceObjectLink(details.quoteId)\">\n <span>{{ details.quoteName }}</span>\n </a>\n </li>\n <li class=\"info-list__row\">\n <span>Quote Number:</span>\n <a target=\"_blank\" [href]=\"getSalesforceObjectLink(details.quoteId)\">\n <span>{{ details.quoteNumber }}</span>\n </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 <ng-container *vlLet=\"isReadonlyMode$ | async as isReadonlyMode\">\n <nav\n class=\"nav-item\"\n [ngClass]=\"{ active: (isAssetsRoute$ | async), disabled: isReadonlyMode }\"\n (click)=\"navigateToAssets()\"\n >\n Assets ({{ assetsCount$ | async }})\n </nav>\n <nav\n class=\"nav-item\"\n [ngClass]=\"{ active: (isCatalogRoute$ | async), disabled: isReadonlyMode }\"\n (click)=\"navigateToCatalog()\"\n >\n Catalog\n </nav>\n <nav class=\"nav-item disabled\" [ngClass]=\"{ active: isConfigurationRoute$ | async }\">Configurator</nav>\n <ng-container *vlLet=\"products$ | async as products\">\n <nav\n class=\"nav-item\"\n [ngClass]=\"{ active: (isCartRoute$ | async), disabled: isReadonlyMode }\"\n (click)=\"navigateToShoppingCart()\"\n >\n Shopping Cart ({{ products.length }})\n </nav>\n\n <nav\n class=\"nav-popover-toggle\"\n [ngClass]=\"{ active: (isCartRoute$ | async), disabled: isReadonlyMode }\"\n (click)=\"toggleCartOverlay(cart, $event)\"\n >\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-cart-preview #cart [products]=\"products\"></vl-cart-preview>\n </ng-container>\n </ng-container>\n </div>\n\n <div class=\"flow-controls\">\n <ng-container *ngIf=\"(isReadonlyMode$ | async) === false\">\n <ng-container *vlLet=\"activePriceList$ | async as priceList\">\n <div>\n <ng-container *vlLet=\"assetPriceLists$ | async as assetPriceLists\">\n <ng-container *ngIf=\"(isAccountMode$ | async) && assetPriceLists.length > 1; else singlePriceList\">\n <nav class=\"nav-item\" (click)=\"priceListsOverlay?.toggle($event)\">\n <span>{{ priceList?.name }}</span>\n <i\n *ngIf=\"!priceListsOverlay?.overlayVisible\"\n class=\"vl-icon vl-icon-chevron-down icon-with-margin\"\n ></i>\n <i *ngIf=\"priceListsOverlay?.overlayVisible\" class=\"vl-icon vl-icon-chevron-up icon-with-margin\"></i>\n </nav>\n\n <p-overlayPanel styleClass=\"price-list-overlay\" #priceListsOverlay>\n <ng-template pTemplate>\n <span\n *ngFor=\"let option of assetPriceLists\"\n class=\"price-list-option\"\n [class.active]=\"priceList?.id === option.id\"\n (click)=\"selectPriceList(option.id); priceListsOverlay.hide()\"\n >\n {{ option.name }}\n </span>\n </ng-template>\n </p-overlayPanel>\n </ng-container>\n </ng-container>\n\n <ng-template #singlePriceList>\n <div>{{ priceList?.name }}</div>\n </ng-template>\n\n <div *ngIf=\"contextProperties.StartDate\">{{ contextProperties.StartDate | date : dateFormat }}</div>\n </div>\n </ng-container>\n </ng-container>\n\n <vl-metrics></vl-metrics>\n\n <ng-container *vlLet=\"isCartRoute$ | async as isCartRoute\">\n <ng-container *vlLet=\"isReadonlyMode$ | async as isReadonlyMode\">\n <p-button\n class=\"doc-gen-button\"\n icon=\"vl-icon vl-icon-doc-gen\"\n [disabled]=\"isReadonlyMode\"\n (onClick)=\"docGenButtonClickHandler(isCartRoute)\"\n pTooltip=\"Generate Document\"\n tooltipPosition=\"bottom\"\n tooltipStyleClass=\"vl-info-tooltip\"\n ></p-button>\n\n <ng-container *vlLet=\"isSaveInProgress$ | async as isSaveInProgress\">\n <ng-container *vlLet=\"isSubmitInProgress$ | async as isSubmitInProgress\">\n <p-splitButton\n *ngIf=\"!isSaveInProgress && !isSubmitInProgress\"\n label=\"Save to Quote\"\n (onClick)=\"saveButtonClickHandler(isCartRoute)\"\n [model]=\"getSplitButtonActions(isCartRoute)\"\n [disabled]=\"isReadonlyMode\"\n styleClass=\"p-button-outlined\"\n >\n </p-splitButton>\n\n <p-button\n *ngIf=\"isSaveInProgress\"\n class=\"save-button\"\n styleClass=\"p-button\"\n label=\"Saving\"\n [loading]=\"true\"\n ></p-button>\n\n <p-button\n *ngIf=\"isSubmitInProgress\"\n class=\"submit-button\"\n styleClass=\"p-button\"\n label=\"Submitting\"\n [loading]=\"true\"\n ></p-button>\n </ng-container>\n </ng-container>\n </ng-container>\n </ng-container>\n </div>\n </ng-container>\n</ng-container>\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.no-padding .p-overlaypanel-content{padding:0}::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}::ng-deep .p-overlaypanel.price-list-overlay .p-overlaypanel-content{border-radius:5px;border-color:var(--vl-border-color);padding:0;display:flex;flex-direction:column;max-height:140px;overflow:auto}:host ::ng-deep p-splitButton{height:32px;width:146px;display:flex}:host ::ng-deep p-splitButton .p-splitbutton{display:flex;font-size:12px;border-radius:2px;height:100%;width:100%;-webkit-backface-visibility:hidden}:host ::ng-deep p-splitButton .p-splitbutton .p-button:focus{box-shadow:none}:host ::ng-deep p-splitButton .p-splitbutton .p-splitbutton-defaultbutton{padding:7px 12px 7px 10px}:host ::ng-deep p-splitButton .p-splitbutton .p-splitbutton-defaultbutton:disabled{opacity:.2}:host ::ng-deep p-splitButton .p-splitbutton .p-splitbutton-menubutton:disabled{opacity:.3}:host ::ng-deep p-splitButton .p-splitbutton.p-button-outlined .p-button{background-color:#fff;color:var(--vl-primary-color);border:1px solid #fff}:host ::ng-deep p-splitButton .p-splitbutton.p-button-outlined .p-button:enabled:hover{background-color:var(--vl-secondary-nav-bg);color:var(--vl-primary-color);border:1px solid var(--vl-secondary-nav-bg);outline:none}:host ::ng-deep p-splitButton .p-splitbutton.p-button-outlined .p-button.p-splitbutton-menubutton{background-color:var(--vl-secondary-nav-bg);border-radius:0 2px 2px 0;border:1px solid var(--vl-secondary-nav-bg);border-left:none}:host ::ng-deep p-splitButton .p-splitbutton.p-button-outlined .p-button.p-splitbutton-menubutton:hover{background-color:var(--vl-secondary-nav-bg);border:1px solid var(--vl-secondary-nav-bg);border-left:none}:host ::ng-deep p-splitButton .p-splitbutton.p-button-outlined .p-button.p-splitbutton-defaultbutton{border-radius:2px 0 0 2px}:host ::ng-deep p-splitButton .p-splitbutton.p-button-outlined .p-button.p-splitbutton-defaultbutton .p-button-label{font-size:12px;line-height:16px;letter-spacing:.3px;white-space:nowrap}:host ::ng-deep p-splitButton .p-splitbutton .p-menu{display:flex;width:auto;margin-top:2px;border-radius:4px;border:1px solid var(--vl-border-color);box-shadow:0 4px 20px #2767c11a}:host ::ng-deep p-splitButton .p-splitbutton .p-menu .p-menu-list{display:flex;flex-direction:column}:host ::ng-deep p-splitButton .p-splitbutton .p-menu .p-menu-list .p-menuitem{display:flex;width:100%;height:32px}:host ::ng-deep p-splitButton .p-splitbutton .p-menu .p-menu-list .p-menuitem .p-menuitem-link{padding:8px;width:100%;height:100%}:host ::ng-deep p-splitButton .p-splitbutton .p-menu .p-menu-list .p-menuitem .p-menuitem-link:not(.p-disabled):hover{background-color:var(--vl-secondary-nav-bg)}:host ::ng-deep p-splitButton .p-splitbutton .p-menu .p-menu-list .p-menuitem .p-menuitem-link:not(.p-disabled):hover .p-menuitem-text{color:var(--vl-primary-color)}:host ::ng-deep p-splitButton .p-splitbutton .p-menu .p-menu-list .p-menuitem .p-menuitem-link .p-menuitem-text{line-height:16px;font-size:12px;letter-spacing:.3px;white-space:nowrap}:host ::ng-deep .doc-gen-button{height:32px;width:32px;display:inline-flex}:host ::ng-deep .doc-gen-button .p-button{border:1px solid #fff;border-radius:2px;width:100%;height:100%}:host ::ng-deep .doc-gen-button .p-button.p-component:disabled{opacity:.3}:host ::ng-deep .save-button,:host ::ng-deep .submit-button{height:32px;width:146px;display:flex}:host ::ng-deep .save-button .p-button,:host ::ng-deep .submit-button .p-button{border-radius:3px;width:100%;height:100%;background:rgba(255,255,255,.3);opacity:1;border:none}:host ::ng-deep .save-button .p-button .p-button-label,:host ::ng-deep .submit-button .p-button .p-button-label{font-size:12px;line-height:16px;letter-spacing:.3px;white-space:nowrap}.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 .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;height:14px}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}.metrics__row{display:flex;justify-content:space-between;grid-gap:2px;gap:2px}.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__wrapper .info-list__row a{text-align:right}.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}.price-list-option{padding:8px;color:var(--vl-primary-color);cursor:pointer}.price-list-option.active,.price-list-option:hover{background:var(--vl-secondary-nav-bg)}.flow-controls{flex-shrink:0;display:flex;align-items:center;grid-gap:16px;gap:16px;font-size:12px;line-height:16px}\n"], components: [{ type: i3$1.OverlayPanel, selector: "p-overlayPanel", inputs: ["dismissable", "showCloseIcon", "style", "styleClass", "appendTo", "autoZIndex", "ariaCloseLabel", "baseZIndex", "focusOnShow", "showTransitionOptions", "hideTransitionOptions"], outputs: ["onShow", "onHide"] }, { type: CartPreviewComponent, selector: "vl-cart-preview", inputs: ["products"] }, { type: MetricsComponent, selector: "vl-metrics" }, { type: i5.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "style", "styleClass", "badgeClass"], outputs: ["onClick", "onFocus", "onBlur"] }, { type: i10$1.SplitButton, selector: "p-splitButton", inputs: ["model", "icon", "iconPos", "label", "style", "styleClass", "menuStyle", "menuStyleClass", "disabled", "tabindex", "appendTo", "dir", "expandAriaLabel", "showTransitionOptions", "hideTransitionOptions"], outputs: ["onClick", "onDropdownClick"] }], directives: [{ type: i5$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i12$1.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "appendTo", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "pTooltip", "tooltipDisabled", "tooltipOptions"] }, { type: i2$1.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { type: i3.LetDirective, selector: "[vlLet]", inputs: ["vlLet"] }, { type: i5$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i5$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "async": i5$1.AsyncPipe, "titlecase": i5$1.TitleCasePipe, "date": i5$1.DatePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
1134
1160
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FlowHeaderComponent, decorators: [{
|
1135
1161
|
type: Component,
|
1136
1162
|
args: [{
|
@@ -1293,10 +1319,17 @@ class FlowService {
|
|
1293
1319
|
this.flowRouterService.navigateToShoppingCart();
|
1294
1320
|
}), takeUntil(this.cleanup$))
|
1295
1321
|
.subscribe();
|
1322
|
+
this.updateFlowPath();
|
1296
1323
|
}
|
1297
1324
|
cleanup() {
|
1298
1325
|
this.cleanup$.next();
|
1299
1326
|
}
|
1327
|
+
updateFlowPath() {
|
1328
|
+
this.flowRouterService
|
1329
|
+
.getFlowSubpath$()
|
1330
|
+
.pipe(map(path => { var _a; return (_a = path.split('/')) === null || _a === void 0 ? void 0 : _a[0]; }), takeUntil(this.cleanup$))
|
1331
|
+
.subscribe(flowPath => this.integrationState.patchState({ flowPath }));
|
1332
|
+
}
|
1300
1333
|
}
|
1301
1334
|
FlowService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FlowService, deps: [{ token: i4.IntegrationState }, { token: FlowRouterService }, { token: i1$1.QuoteDraftService }, { token: i1$1.ConfigurationService }, { token: i1$1.FlowConfigurationService }], target: i0.ɵɵFactoryTarget.Injectable });
|
1302
1335
|
FlowService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FlowService });
|
@@ -1508,6 +1541,126 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
|
|
1508
1541
|
|
1509
1542
|
const FLOW_CUSTOMIZATION = new InjectionToken('FLOW_CUSTOMIZATION');
|
1510
1543
|
|
1544
|
+
class AssetsComponent {
|
1545
|
+
constructor(templatesApi, contextService, cdr, toastService, customizationService) {
|
1546
|
+
var _a;
|
1547
|
+
this.templatesApi = templatesApi;
|
1548
|
+
this.contextService = contextService;
|
1549
|
+
this.cdr = cdr;
|
1550
|
+
this.toastService = toastService;
|
1551
|
+
this.customizationService = customizationService;
|
1552
|
+
this.uiDefinition = undefined;
|
1553
|
+
this.state$ = new BehaviorSubject({ loading: true, failure: false });
|
1554
|
+
this.templateApiName = '';
|
1555
|
+
this.destroyed$ = new Subject();
|
1556
|
+
this.templateApiName = (_a = this.contextService.resolve().properties.assetsTemplateApiName) !== null && _a !== void 0 ? _a : '';
|
1557
|
+
}
|
1558
|
+
ngOnInit() {
|
1559
|
+
this.generateUIDefinition$()
|
1560
|
+
.pipe(tap(uiDef => {
|
1561
|
+
if (!uiDef) {
|
1562
|
+
throw new Error(`Component with name '${this.templateApiName}' not found.`);
|
1563
|
+
}
|
1564
|
+
this.uiDefinition = uiDef;
|
1565
|
+
this.state$.next({ loading: false, failure: false });
|
1566
|
+
}), catchError(err => {
|
1567
|
+
var _a;
|
1568
|
+
const message = 'Failed to resolve Assets component. ' + ((_a = err.message) !== null && _a !== void 0 ? _a : '');
|
1569
|
+
this.toastService.add({ severity: ToastType.error, summary: message, sticky: true });
|
1570
|
+
this.uiDefinition = undefined;
|
1571
|
+
this.state$.next({ loading: false, failure: true });
|
1572
|
+
return of();
|
1573
|
+
}), takeUntil(this.destroyed$))
|
1574
|
+
.subscribe(() => this.cdr.detectChanges());
|
1575
|
+
}
|
1576
|
+
ngOnDestroy() {
|
1577
|
+
this.destroyed$.next();
|
1578
|
+
this.destroyed$.complete();
|
1579
|
+
}
|
1580
|
+
getTemplateRootComponent$(template) {
|
1581
|
+
return this.templatesApi
|
1582
|
+
.fetchComponents$(template.id)
|
1583
|
+
.pipe(map(components => { var _a; return (_a = components.find(c => c.type === UITemplateComponentType.ROOT)) !== null && _a !== void 0 ? _a : undefined; }));
|
1584
|
+
}
|
1585
|
+
getLocalAssetsComponentMeta$() {
|
1586
|
+
var _a, _b;
|
1587
|
+
if (!((_a = this.customizationService) === null || _a === void 0 ? void 0 : _a.getAssetsComponent)) {
|
1588
|
+
return of(undefined);
|
1589
|
+
}
|
1590
|
+
return (_b = this.customizationService) === null || _b === void 0 ? void 0 : _b.getAssetsComponent(this.templateApiName).pipe(map(component => {
|
1591
|
+
if (!component) {
|
1592
|
+
return;
|
1593
|
+
}
|
1594
|
+
return {
|
1595
|
+
html: component.html,
|
1596
|
+
css: component.css,
|
1597
|
+
js: component.js,
|
1598
|
+
json: component.json,
|
1599
|
+
};
|
1600
|
+
}));
|
1601
|
+
}
|
1602
|
+
getAssetsComponentMeta$() {
|
1603
|
+
return this.templatesApi.fetchTemplates$().pipe(map(templates => templates.find(template => template.name === this.templateApiName)), switchMap(template => (template ? this.getTemplateRootComponent$(template) : of(undefined))), switchMap(component => component ? this.templatesApi.fetchComponentAttachments$(component.uiTemplateId, component) : of(undefined)));
|
1604
|
+
}
|
1605
|
+
generateUIDefinition$() {
|
1606
|
+
return of(undefined).pipe(tap(() => {
|
1607
|
+
if (!this.templateApiName) {
|
1608
|
+
throw new Error("Flow Query parameter 'assetsTemplateApiName' is missing.");
|
1609
|
+
}
|
1610
|
+
}), switchMap(() => this.getLocalAssetsComponentMeta$()), switchMap(meta => (meta ? of(meta) : this.getAssetsComponentMeta$())), map(meta => {
|
1611
|
+
if (!meta) {
|
1612
|
+
return;
|
1613
|
+
}
|
1614
|
+
const uiDef = {
|
1615
|
+
name: '',
|
1616
|
+
createdTimestamp: 0,
|
1617
|
+
primary: true,
|
1618
|
+
type: 'DEFAULT',
|
1619
|
+
version: 2,
|
1620
|
+
children: [
|
1621
|
+
{
|
1622
|
+
children: [],
|
1623
|
+
template: meta.html && btoa(meta.html),
|
1624
|
+
script: meta.js && btoa(meta.js),
|
1625
|
+
styles: meta.css && btoa(meta.css),
|
1626
|
+
},
|
1627
|
+
],
|
1628
|
+
};
|
1629
|
+
return uiDef;
|
1630
|
+
}));
|
1631
|
+
}
|
1632
|
+
}
|
1633
|
+
AssetsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: AssetsComponent, deps: [{ token: i2.UITemplatesApiService }, { token: i1$1.ContextService }, { token: i0.ChangeDetectorRef }, { token: i3.ToastService }, { token: FLOW_CUSTOMIZATION, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
1634
|
+
AssetsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", 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: [""], components: [{ type: i3.LoaderComponent, selector: "vl-loader", inputs: ["label", "overlayVisible"] }, { type: i4.PreviewComponent, selector: "vl-cms-preview", inputs: ["modelId", "uiDefinition", "config"] }], directives: [{ type: i5$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "async": i5$1.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
1635
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: AssetsComponent, decorators: [{
|
1636
|
+
type: Component,
|
1637
|
+
args: [{
|
1638
|
+
selector: 'vl-flow-assets',
|
1639
|
+
templateUrl: './assets.component.html',
|
1640
|
+
styleUrls: ['./assets.component.scss'],
|
1641
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
1642
|
+
}]
|
1643
|
+
}], ctorParameters: function () { return [{ type: i2.UITemplatesApiService }, { type: i1$1.ContextService }, { type: i0.ChangeDetectorRef }, { type: i3.ToastService }, { type: undefined, decorators: [{
|
1644
|
+
type: Optional
|
1645
|
+
}, {
|
1646
|
+
type: Inject,
|
1647
|
+
args: [FLOW_CUSTOMIZATION]
|
1648
|
+
}] }]; } });
|
1649
|
+
|
1650
|
+
class AssetsModule {
|
1651
|
+
}
|
1652
|
+
AssetsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: AssetsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
1653
|
+
AssetsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: AssetsModule, declarations: [AssetsComponent], imports: [CommonModule, PreviewModule, LoaderModule], exports: [AssetsComponent] });
|
1654
|
+
AssetsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: AssetsModule, imports: [[CommonModule, PreviewModule, LoaderModule]] });
|
1655
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: AssetsModule, decorators: [{
|
1656
|
+
type: NgModule,
|
1657
|
+
args: [{
|
1658
|
+
declarations: [AssetsComponent],
|
1659
|
+
imports: [CommonModule, PreviewModule, LoaderModule],
|
1660
|
+
exports: [AssetsComponent],
|
1661
|
+
}]
|
1662
|
+
}] });
|
1663
|
+
|
1511
1664
|
class CatalogComponent {
|
1512
1665
|
constructor(templatesApi, contextService, cdr, toastService, customizationService) {
|
1513
1666
|
var _a;
|
@@ -1567,7 +1720,7 @@ class CatalogComponent {
|
|
1567
1720
|
}));
|
1568
1721
|
}
|
1569
1722
|
getCatalogComponentMeta$() {
|
1570
|
-
return this.templatesApi.fetchTemplates$().pipe(map(templates => templates.find(template => template.
|
1723
|
+
return this.templatesApi.fetchTemplates$().pipe(map(templates => templates.find(template => template.name === this.templateApiName)), switchMap(template => (template ? this.getTemplateRootComponent$(template) : of(undefined))), switchMap(component => component ? this.templatesApi.fetchComponentAttachments$(component.uiTemplateId, component) : of(undefined)));
|
1571
1724
|
}
|
1572
1725
|
generateUIDefinition$() {
|
1573
1726
|
return of(undefined).pipe(tap(() => {
|
@@ -2433,7 +2586,7 @@ class ShoppingCartComponent {
|
|
2433
2586
|
}));
|
2434
2587
|
}
|
2435
2588
|
getShoppingCartComponentMeta$() {
|
2436
|
-
return this.templatesApi.fetchTemplates$().pipe(map(templates => templates.find(template => template.
|
2589
|
+
return this.templatesApi.fetchTemplates$().pipe(map(templates => templates.find(template => template.name === this.templateApiName)), switchMap(template => (template ? this.getTemplateRootComponent$(template) : of(undefined))), switchMap(component => component ? this.templatesApi.fetchComponentAttachments$(component.uiTemplateId, component) : of(undefined)));
|
2437
2590
|
}
|
2438
2591
|
generateUIDefinition$() {
|
2439
2592
|
return of(undefined).pipe(tap(() => {
|
@@ -2575,8 +2728,8 @@ class QuoteResolver {
|
|
2575
2728
|
const queryParams = route.queryParams;
|
2576
2729
|
return this.quoteDraftService.init(headerId, queryParams).pipe(switchMap(() => this.calculate$()), tap(() => {
|
2577
2730
|
if (!this.quoteDraftService.isStandalone && queryParams.suppressInitialNavigation !== 'true') {
|
2578
|
-
if (this.
|
2579
|
-
this.changeNavigation('/
|
2731
|
+
if (this.shouldNavigateToAssets()) {
|
2732
|
+
this.changeNavigation('/assets', route);
|
2580
2733
|
}
|
2581
2734
|
else if (!this.quoteDraftService.isInitialized && this.quoteDraftService.hasProducts) {
|
2582
2735
|
this.changeNavigation('/cart', route);
|
@@ -2601,10 +2754,15 @@ class QuoteResolver {
|
|
2601
2754
|
return this.handleError(route, message);
|
2602
2755
|
});
|
2603
2756
|
}
|
2757
|
+
shouldNavigateToAssets() {
|
2758
|
+
var _a, _b;
|
2759
|
+
if (this.contextService.mode === ConfigurationContextMode.ACCOUNT) {
|
2760
|
+
return true;
|
2761
|
+
}
|
2762
|
+
return (_b = (_a = this.quoteDraftService.quoteDraft) === null || _a === void 0 ? void 0 : _a.currentState.some(li => !!li.assetId)) !== null && _b !== void 0 ? _b : false;
|
2763
|
+
}
|
2604
2764
|
accountHasNotAssets() {
|
2605
|
-
|
2606
|
-
return (((_a = this.quoteDraftService.quoteDraft) === null || _a === void 0 ? void 0 : _a.context.properties.mode) === ConfigurationContextMode.ACCOUNT &&
|
2607
|
-
!this.quoteDraftService.hasProducts);
|
2765
|
+
return this.contextService.mode === ConfigurationContextMode.ACCOUNT && !this.quoteDraftService.hasProducts;
|
2608
2766
|
}
|
2609
2767
|
}
|
2610
2768
|
QuoteResolver.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: QuoteResolver, deps: [{ token: i1$2.Router }, { token: i1$1.QuoteDraftService }, { token: FlowRouterService }, { token: i1$1.ContextService }, { token: i1$1.FlowConfigurationService }], target: i0.ɵɵFactoryTarget.Injectable });
|
@@ -2664,6 +2822,14 @@ const rootRoute = {
|
|
2664
2822
|
canActivate: [ContextGuard],
|
2665
2823
|
data: { showHeader: true },
|
2666
2824
|
},
|
2825
|
+
{
|
2826
|
+
path: 'assets',
|
2827
|
+
component: AssetsComponent,
|
2828
|
+
runGuardsAndResolvers: 'paramsOrQueryParamsChange',
|
2829
|
+
resolve: { quote: QuoteResolver },
|
2830
|
+
canActivate: [ContextGuard],
|
2831
|
+
data: { showHeader: true },
|
2832
|
+
},
|
2667
2833
|
{
|
2668
2834
|
path: 'empty',
|
2669
2835
|
component: EmptyAccountComponent,
|
@@ -2696,6 +2862,7 @@ FlowRoutingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", versi
|
|
2696
2862
|
LegacyProductModule,
|
2697
2863
|
ShoppingCartModule,
|
2698
2864
|
CatalogModule,
|
2865
|
+
AssetsModule,
|
2699
2866
|
RemoteModule,
|
2700
2867
|
EmptyAccountModule], exports: [RouterModule] });
|
2701
2868
|
FlowRoutingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: FlowRoutingModule, providers: [FlowRouterService, RootGuard, ContextGuard, ProductUnloadGuard, FlowResolver, QuoteResolver], imports: [[
|
@@ -2704,6 +2871,7 @@ FlowRoutingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", versi
|
|
2704
2871
|
LegacyProductModule,
|
2705
2872
|
ShoppingCartModule,
|
2706
2873
|
CatalogModule,
|
2874
|
+
AssetsModule,
|
2707
2875
|
RemoteModule,
|
2708
2876
|
EmptyAccountModule,
|
2709
2877
|
], RouterModule] });
|
@@ -2716,6 +2884,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
|
|
2716
2884
|
LegacyProductModule,
|
2717
2885
|
ShoppingCartModule,
|
2718
2886
|
CatalogModule,
|
2887
|
+
AssetsModule,
|
2719
2888
|
RemoteModule,
|
2720
2889
|
EmptyAccountModule,
|
2721
2890
|
],
|