@veloceapps/sdk 3.0.2 → 3.0.4
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.umd.js +1333 -1229
- package/bundles/veloce-sdk.umd.js.map +1 -1
- package/esm2015/src/components/header/header.component.js +73 -4
- package/esm2015/src/components/header/header.module.js +7 -4
- package/esm2015/src/components/header/header.types.js +2 -0
- package/esm2015/src/flow.component.js +1 -1
- package/esm2015/src/index.js +2 -1
- package/esm2015/src/pages/debug/debug.component.js +14 -9
- package/esm2015/src/pages/debug/debug.module.js +6 -2
- package/esm2015/src/pages/shopping-cart/shopping-cart.component.js +22 -6
- package/esm2015/src/types/flow-customization.types.js +1 -1
- package/esm2015/src/types/route.types.js +1 -1
- package/esm2015/src/utils/flow.utils.js +12 -0
- package/esm2015/src/utils/index.js +2 -0
- package/fesm2015/veloce-sdk.js +163 -64
- package/fesm2015/veloce-sdk.js.map +1 -1
- package/package.json +1 -1
- package/src/components/header/header.component.d.ts +23 -1
- package/src/components/header/header.module.d.ts +4 -1
- package/src/components/header/header.types.d.ts +8 -0
- package/src/index.d.ts +1 -0
- package/src/pages/debug/debug.component.d.ts +1 -0
- package/src/pages/debug/debug.module.d.ts +2 -1
- package/src/pages/shopping-cart/shopping-cart.component.d.ts +4 -2
- package/src/types/flow-customization.types.d.ts +2 -1
- package/src/types/route.types.d.ts +5 -0
- package/src/utils/flow.utils.d.ts +1 -0
- package/src/utils/index.d.ts +1 -0
|
@@ -1,1314 +1,1418 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
})(this, (function (exports,
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/common'), require('@angular/core'), require('@veloce/api'), require('@veloce/components'), require('@veloce/sdk/cms'), require('@veloce/sdk/runtime'), require('primeng/overlaypanel'), require('primeng/tooltip'), require('@veloce/core'), require('rxjs'), require('primeng/api'), require('@angular/router'), require('@angular/forms'), require('primeng/button'), require('primeng/dropdown'), require('primeng/inputtext'), require('primeng/radiobutton'), require('rxjs/operators'), require('ngx-bootstrap/tooltip'), require('@angular/common/http')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define('@veloce/sdk', ['exports', '@angular/common', '@angular/core', '@veloce/api', '@veloce/components', '@veloce/sdk/cms', '@veloce/sdk/runtime', 'primeng/overlaypanel', 'primeng/tooltip', '@veloce/core', 'rxjs', 'primeng/api', '@angular/router', '@angular/forms', 'primeng/button', 'primeng/dropdown', 'primeng/inputtext', 'primeng/radiobutton', 'rxjs/operators', 'ngx-bootstrap/tooltip', '@angular/common/http'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.veloce = global.veloce || {}, global.veloce.sdk = {}), global.ng.common, global.ng.core, global["@veloce/api"], global["@veloce/components"], global.veloce.sdk.cms, global.veloce.sdk.runtime, global.i3, global.i5, global["@veloce/core"], global.rxjs, global["primeng/api"], global.ng.router, global.ng.forms, global["primeng/button"], global.i4$2, global["primeng/inputtext"], global["primeng/radiobutton"], global.rxjs.operators, global["ngx-bootstrap/tooltip"], global.ng.common.http));
|
|
5
|
+
})(this, (function (exports, i4, i0, i1, i2$1, i1$3, i2, i3, i5, core, rxjs, i4$1, i1$1, i7, i5$1, i4$2, i8, i6, operators, i1$2, http) { 'use strict';
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
});
|
|
7
|
+
function _interopNamespace(e) {
|
|
8
|
+
if (e && e.__esModule) return e;
|
|
9
|
+
var n = Object.create(null);
|
|
10
|
+
if (e) {
|
|
11
|
+
Object.keys(e).forEach(function (k) {
|
|
12
|
+
if (k !== 'default') {
|
|
13
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
14
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: function () { return e[k]; }
|
|
17
|
+
});
|
|
20
18
|
}
|
|
21
|
-
|
|
22
|
-
return Object.freeze(n);
|
|
19
|
+
});
|
|
23
20
|
}
|
|
21
|
+
n["default"] = e;
|
|
22
|
+
return Object.freeze(n);
|
|
23
|
+
}
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
25
|
+
var i4__namespace = /*#__PURE__*/_interopNamespace(i4);
|
|
26
|
+
var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
|
|
27
|
+
var i1__namespace = /*#__PURE__*/_interopNamespace(i1);
|
|
28
|
+
var i2__namespace$1 = /*#__PURE__*/_interopNamespace(i2$1);
|
|
29
|
+
var i1__namespace$3 = /*#__PURE__*/_interopNamespace(i1$3);
|
|
30
|
+
var i2__namespace = /*#__PURE__*/_interopNamespace(i2);
|
|
31
|
+
var i3__namespace = /*#__PURE__*/_interopNamespace(i3);
|
|
32
|
+
var i5__namespace = /*#__PURE__*/_interopNamespace(i5);
|
|
33
|
+
var i4__namespace$1 = /*#__PURE__*/_interopNamespace(i4$1);
|
|
34
|
+
var i1__namespace$1 = /*#__PURE__*/_interopNamespace(i1$1);
|
|
35
|
+
var i7__namespace = /*#__PURE__*/_interopNamespace(i7);
|
|
36
|
+
var i5__namespace$1 = /*#__PURE__*/_interopNamespace(i5$1);
|
|
37
|
+
var i4__namespace$2 = /*#__PURE__*/_interopNamespace(i4$2);
|
|
38
|
+
var i8__namespace = /*#__PURE__*/_interopNamespace(i8);
|
|
39
|
+
var i6__namespace = /*#__PURE__*/_interopNamespace(i6);
|
|
40
|
+
var i1__namespace$2 = /*#__PURE__*/_interopNamespace(i1$2);
|
|
38
41
|
|
|
39
|
-
|
|
42
|
+
var VELOCE_FLOW_ROOT_ROUTE = 'VELOCE_FLOW_ROOT_ROUTE';
|
|
40
43
|
|
|
41
|
-
|
|
42
|
-
|
|
44
|
+
var FlowHeaderComponent = /** @class */ (function () {
|
|
45
|
+
function FlowHeaderComponent(context, sfApiService) {
|
|
46
|
+
var _a, _b, _c;
|
|
47
|
+
this.context = context;
|
|
48
|
+
this.sfApiService = sfApiService;
|
|
49
|
+
this.objectDetails$ = new rxjs.BehaviorSubject({});
|
|
50
|
+
this.destroyed$ = new rxjs.Subject();
|
|
51
|
+
var ctx = this.context.resolve();
|
|
52
|
+
this.mode = ctx === null || ctx === void 0 ? void 0 : ctx.mode;
|
|
53
|
+
this.objectName = (_b = (_a = ctx === null || ctx === void 0 ? void 0 : ctx.mode) === null || _a === void 0 ? void 0 : _a.toLowerCase()) !== null && _b !== void 0 ? _b : '';
|
|
54
|
+
this.contextProperties = (_c = ctx === null || ctx === void 0 ? void 0 : ctx.properties) !== null && _c !== void 0 ? _c : {};
|
|
55
|
+
}
|
|
56
|
+
FlowHeaderComponent.prototype.ngOnInit = function () {
|
|
57
|
+
this.populateObjectDetails();
|
|
58
|
+
};
|
|
59
|
+
FlowHeaderComponent.prototype.ngOnDestroy = function () {
|
|
60
|
+
this.destroyed$.next();
|
|
61
|
+
this.destroyed$.complete();
|
|
62
|
+
};
|
|
63
|
+
Object.defineProperty(FlowHeaderComponent.prototype, "isAccountMode", {
|
|
64
|
+
get: function () {
|
|
65
|
+
return this.mode === core.ConfigurationContextMode.ACCOUNT;
|
|
66
|
+
},
|
|
67
|
+
enumerable: false,
|
|
68
|
+
configurable: true
|
|
69
|
+
});
|
|
70
|
+
Object.defineProperty(FlowHeaderComponent.prototype, "isQuoteMode", {
|
|
71
|
+
get: function () {
|
|
72
|
+
return this.mode === core.ConfigurationContextMode.QUOTE;
|
|
73
|
+
},
|
|
74
|
+
enumerable: false,
|
|
75
|
+
configurable: true
|
|
76
|
+
});
|
|
77
|
+
FlowHeaderComponent.prototype.back = function () {
|
|
78
|
+
var _a;
|
|
79
|
+
var objectId = (_a = this.context.resolve()) === null || _a === void 0 ? void 0 : _a.headerId;
|
|
80
|
+
if (objectId) {
|
|
81
|
+
window.VELO_BACK_FN.apply(null, [objectId]);
|
|
43
82
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: FlowHeaderComponent, decorators: [{
|
|
49
|
-
type: i0.Component,
|
|
50
|
-
args: [{
|
|
51
|
-
selector: 'vl-flow-header',
|
|
52
|
-
templateUrl: './header.component.html',
|
|
53
|
-
styleUrls: ['./header.component.scss'],
|
|
54
|
-
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
55
|
-
}]
|
|
56
|
-
}] });
|
|
57
|
-
|
|
58
|
-
var FlowHeaderModule = /** @class */ (function () {
|
|
59
|
-
function FlowHeaderModule() {
|
|
83
|
+
};
|
|
84
|
+
FlowHeaderComponent.prototype.getSalesforceObjectLink = function (objectId) {
|
|
85
|
+
if (!objectId) {
|
|
86
|
+
return '';
|
|
60
87
|
}
|
|
61
|
-
return
|
|
62
|
-
}());
|
|
63
|
-
FlowHeaderModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: FlowHeaderModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
|
|
64
|
-
FlowHeaderModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: FlowHeaderModule, declarations: [FlowHeaderComponent], imports: [i5.CommonModule], exports: [FlowHeaderComponent] });
|
|
65
|
-
FlowHeaderModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: FlowHeaderModule, imports: [[i5.CommonModule]] });
|
|
66
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: FlowHeaderModule, decorators: [{
|
|
67
|
-
type: i0.NgModule,
|
|
68
|
-
args: [{
|
|
69
|
-
declarations: [FlowHeaderComponent],
|
|
70
|
-
imports: [i5.CommonModule],
|
|
71
|
-
exports: [FlowHeaderComponent],
|
|
72
|
-
}]
|
|
73
|
-
}] });
|
|
74
|
-
|
|
75
|
-
/*! *****************************************************************************
|
|
76
|
-
Copyright (c) Microsoft Corporation.
|
|
77
|
-
|
|
78
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
79
|
-
purpose with or without fee is hereby granted.
|
|
80
|
-
|
|
81
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
82
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
83
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
84
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
85
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
86
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
87
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
88
|
-
***************************************************************************** */
|
|
89
|
-
/* global Reflect, Promise */
|
|
90
|
-
var extendStatics = function (d, b) {
|
|
91
|
-
extendStatics = Object.setPrototypeOf ||
|
|
92
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
93
|
-
function (d, b) { for (var p in b)
|
|
94
|
-
if (Object.prototype.hasOwnProperty.call(b, p))
|
|
95
|
-
d[p] = b[p]; };
|
|
96
|
-
return extendStatics(d, b);
|
|
88
|
+
return window.location.origin + "/" + objectId;
|
|
97
89
|
};
|
|
98
|
-
function
|
|
99
|
-
if (
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
__assign = Object.assign || function __assign(t) {
|
|
107
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
108
|
-
s = arguments[i];
|
|
109
|
-
for (var p in s)
|
|
110
|
-
if (Object.prototype.hasOwnProperty.call(s, p))
|
|
111
|
-
t[p] = s[p];
|
|
112
|
-
}
|
|
113
|
-
return t;
|
|
90
|
+
FlowHeaderComponent.prototype.queryName$ = function (objectName, id) {
|
|
91
|
+
if (!id) {
|
|
92
|
+
return rxjs.of('');
|
|
93
|
+
}
|
|
94
|
+
var searchRequest = {
|
|
95
|
+
count: 1,
|
|
96
|
+
rawCondition: "Id = '" + id + "'",
|
|
97
|
+
fields: ['Name'],
|
|
114
98
|
};
|
|
115
|
-
return
|
|
99
|
+
return this.sfApiService.query(searchRequest, objectName).pipe(rxjs.map(function (result) { var _a, _b; return (_b = (_a = result[0]) === null || _a === void 0 ? void 0 : _a.Name) !== null && _b !== void 0 ? _b : ''; }), rxjs.takeUntil(this.destroyed$));
|
|
116
100
|
};
|
|
117
|
-
function
|
|
118
|
-
var
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
function
|
|
143
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
144
|
-
return Reflect.metadata(metadataKey, metadataValue);
|
|
145
|
-
}
|
|
146
|
-
function __awaiter(thisArg, _arguments, P, generator) {
|
|
147
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
148
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
149
|
-
function fulfilled(value) { try {
|
|
150
|
-
step(generator.next(value));
|
|
151
|
-
}
|
|
152
|
-
catch (e) {
|
|
153
|
-
reject(e);
|
|
154
|
-
} }
|
|
155
|
-
function rejected(value) { try {
|
|
156
|
-
step(generator["throw"](value));
|
|
157
|
-
}
|
|
158
|
-
catch (e) {
|
|
159
|
-
reject(e);
|
|
160
|
-
} }
|
|
161
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
162
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
163
|
-
});
|
|
101
|
+
FlowHeaderComponent.prototype.populateObjectDetails = function () {
|
|
102
|
+
var _this = this;
|
|
103
|
+
var accountId = this.isAccountMode ? this.contextProperties.Id : this.contextProperties.AccountId;
|
|
104
|
+
var opportunityId = this.contextProperties.OpportunityId;
|
|
105
|
+
var quoteId = this.isQuoteMode ? this.contextProperties.Id : undefined;
|
|
106
|
+
var quoteName = this.isQuoteMode ? this.contextProperties.Name : undefined;
|
|
107
|
+
this.objectDetails$.next(Object.assign(Object.assign({}, this.objectDetails$.value), { accountId: accountId, opportunityId: opportunityId, quoteId: quoteId, quoteName: quoteName }));
|
|
108
|
+
this.queryName$('Account', accountId).subscribe(function (accountName) { return _this.objectDetails$.next(Object.assign(Object.assign({}, _this.objectDetails$.value), { accountName: accountName })); });
|
|
109
|
+
this.queryName$('Opportunity', opportunityId).subscribe(function (opportunityName) { return _this.objectDetails$.next(Object.assign(Object.assign({}, _this.objectDetails$.value), { opportunityName: opportunityName })); });
|
|
110
|
+
};
|
|
111
|
+
return FlowHeaderComponent;
|
|
112
|
+
}());
|
|
113
|
+
FlowHeaderComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: FlowHeaderComponent, deps: [{ token: i2__namespace.ContextService }, { token: i1__namespace.SalesforceApiService }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
114
|
+
FlowHeaderComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: FlowHeaderComponent, selector: "vl-flow-header", ngImport: i0__namespace, template: "<nav class=\"nav-item nav-back\" (click)=\"back()\">\n <i class=\"nav-icon vl-icon vl-icon-arrow-left\"></i>\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 Account name\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 Quote #{{ contextProperties.QuoteNumber }}\n <span class=\"dot-separator\"></span>\n <nav (click)=\"quoteDetails.toggle($event)\">\n {{ contextProperties.Status }}\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 left\" #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\" *vlLet=\"objectDetails$ | async as details\">\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)\">{{ details.opportunityName }}</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", 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:before{background-color:#fff}.vl-icon{display:inline-block}.object-name{text-transform:capitalize}.nav-back{font-weight:bold}nav{display:flex;align-items:center;cursor:pointer;padding:4px 0}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:160px;overflow:hidden;text-overflow:ellipsis}.dot-separator:after{content:\"\";display:block;width:4px;height:4px;border-radius:50%;background:#fff;margin:0 8px}.flow-header-overlay__wrapper{width:360px}.flow-header-overlay__title{display:flex;justify-content:space-between;align-items:center;margin:0 0 24px}.close-icon{cursor:pointer}.info-list{list-style:none;padding:0;font-size:12px}.info-list__row{padding:8px 0;display:flex;justify-content:space-between}\n"], components: [{ type: i3__namespace.OverlayPanel, selector: "p-overlayPanel", inputs: ["dismissable", "showCloseIcon", "style", "styleClass", "appendTo", "autoZIndex", "ariaCloseLabel", "baseZIndex", "focusOnShow", "showTransitionOptions", "hideTransitionOptions"], outputs: ["onShow", "onHide"] }], directives: [{ type: i4__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i5__namespace.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "appendTo", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "pTooltip", "tooltipDisabled", "tooltipOptions"] }, { type: i4__namespace$1.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { type: i2__namespace$1.LetDirective, selector: "[vlLet]", inputs: ["vlLet"] }], pipes: { "async": i4__namespace.AsyncPipe }, changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
|
|
115
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: FlowHeaderComponent, decorators: [{
|
|
116
|
+
type: i0.Component,
|
|
117
|
+
args: [{
|
|
118
|
+
selector: 'vl-flow-header',
|
|
119
|
+
templateUrl: './header.component.html',
|
|
120
|
+
styleUrls: ['./header.component.scss'],
|
|
121
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
122
|
+
}]
|
|
123
|
+
}], ctorParameters: function () { return [{ type: i2__namespace.ContextService }, { type: i1__namespace.SalesforceApiService }]; } });
|
|
124
|
+
|
|
125
|
+
var FlowHeaderModule = /** @class */ (function () {
|
|
126
|
+
function FlowHeaderModule() {
|
|
164
127
|
}
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
_.ops.pop();
|
|
217
|
-
_.trys.pop();
|
|
218
|
-
continue;
|
|
219
|
-
}
|
|
220
|
-
op = body.call(thisArg, _);
|
|
221
|
-
}
|
|
222
|
-
catch (e) {
|
|
223
|
-
op = [6, e];
|
|
224
|
-
y = 0;
|
|
225
|
-
}
|
|
226
|
-
finally {
|
|
227
|
-
f = t = 0;
|
|
228
|
-
}
|
|
229
|
-
if (op[0] & 5)
|
|
230
|
-
throw op[1];
|
|
231
|
-
return { value: op[0] ? op[1] : void 0, done: true };
|
|
128
|
+
return FlowHeaderModule;
|
|
129
|
+
}());
|
|
130
|
+
FlowHeaderModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: FlowHeaderModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
|
|
131
|
+
FlowHeaderModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: FlowHeaderModule, declarations: [FlowHeaderComponent], imports: [i4.CommonModule, i3.OverlayPanelModule, i2$1.LetDirectiveModule, i5.TooltipModule], exports: [FlowHeaderComponent] });
|
|
132
|
+
FlowHeaderModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: FlowHeaderModule, imports: [[i4.CommonModule, i3.OverlayPanelModule, i2$1.LetDirectiveModule, i5.TooltipModule]] });
|
|
133
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: FlowHeaderModule, decorators: [{
|
|
134
|
+
type: i0.NgModule,
|
|
135
|
+
args: [{
|
|
136
|
+
declarations: [FlowHeaderComponent],
|
|
137
|
+
imports: [i4.CommonModule, i3.OverlayPanelModule, i2$1.LetDirectiveModule, i5.TooltipModule],
|
|
138
|
+
exports: [FlowHeaderComponent],
|
|
139
|
+
}]
|
|
140
|
+
}] });
|
|
141
|
+
|
|
142
|
+
/*! *****************************************************************************
|
|
143
|
+
Copyright (c) Microsoft Corporation.
|
|
144
|
+
|
|
145
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
146
|
+
purpose with or without fee is hereby granted.
|
|
147
|
+
|
|
148
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
149
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
150
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
151
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
152
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
153
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
154
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
155
|
+
***************************************************************************** */
|
|
156
|
+
/* global Reflect, Promise */
|
|
157
|
+
var extendStatics = function (d, b) {
|
|
158
|
+
extendStatics = Object.setPrototypeOf ||
|
|
159
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
160
|
+
function (d, b) { for (var p in b)
|
|
161
|
+
if (Object.prototype.hasOwnProperty.call(b, p))
|
|
162
|
+
d[p] = b[p]; };
|
|
163
|
+
return extendStatics(d, b);
|
|
164
|
+
};
|
|
165
|
+
function __extends(d, b) {
|
|
166
|
+
if (typeof b !== "function" && b !== null)
|
|
167
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
168
|
+
extendStatics(d, b);
|
|
169
|
+
function __() { this.constructor = d; }
|
|
170
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
171
|
+
}
|
|
172
|
+
var __assign = function () {
|
|
173
|
+
__assign = Object.assign || function __assign(t) {
|
|
174
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
175
|
+
s = arguments[i];
|
|
176
|
+
for (var p in s)
|
|
177
|
+
if (Object.prototype.hasOwnProperty.call(s, p))
|
|
178
|
+
t[p] = s[p];
|
|
232
179
|
}
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
__createBinding(o, m, p);
|
|
247
|
-
}
|
|
248
|
-
function __values(o) {
|
|
249
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
250
|
-
if (m)
|
|
251
|
-
return m.call(o);
|
|
252
|
-
if (o && typeof o.length === "number")
|
|
253
|
-
return {
|
|
254
|
-
next: function () {
|
|
255
|
-
if (o && i >= o.length)
|
|
256
|
-
o = void 0;
|
|
257
|
-
return { value: o && o[i++], done: !o };
|
|
258
|
-
}
|
|
259
|
-
};
|
|
260
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
261
|
-
}
|
|
262
|
-
function __read(o, n) {
|
|
263
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
264
|
-
if (!m)
|
|
265
|
-
return o;
|
|
266
|
-
var i = m.call(o), r, ar = [], e;
|
|
267
|
-
try {
|
|
268
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
|
|
269
|
-
ar.push(r.value);
|
|
180
|
+
return t;
|
|
181
|
+
};
|
|
182
|
+
return __assign.apply(this, arguments);
|
|
183
|
+
};
|
|
184
|
+
function __rest(s, e) {
|
|
185
|
+
var t = {};
|
|
186
|
+
for (var p in s)
|
|
187
|
+
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
188
|
+
t[p] = s[p];
|
|
189
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
190
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
191
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
192
|
+
t[p[i]] = s[p[i]];
|
|
270
193
|
}
|
|
271
|
-
|
|
272
|
-
|
|
194
|
+
return t;
|
|
195
|
+
}
|
|
196
|
+
function __decorate(decorators, target, key, desc) {
|
|
197
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
198
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
199
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
200
|
+
else
|
|
201
|
+
for (var i = decorators.length - 1; i >= 0; i--)
|
|
202
|
+
if (d = decorators[i])
|
|
203
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
204
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
205
|
+
}
|
|
206
|
+
function __param(paramIndex, decorator) {
|
|
207
|
+
return function (target, key) { decorator(target, key, paramIndex); };
|
|
208
|
+
}
|
|
209
|
+
function __metadata(metadataKey, metadataValue) {
|
|
210
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
211
|
+
return Reflect.metadata(metadataKey, metadataValue);
|
|
212
|
+
}
|
|
213
|
+
function __awaiter(thisArg, _arguments, P, generator) {
|
|
214
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
215
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
216
|
+
function fulfilled(value) { try {
|
|
217
|
+
step(generator.next(value));
|
|
273
218
|
}
|
|
274
|
-
|
|
219
|
+
catch (e) {
|
|
220
|
+
reject(e);
|
|
221
|
+
} }
|
|
222
|
+
function rejected(value) { try {
|
|
223
|
+
step(generator["throw"](value));
|
|
224
|
+
}
|
|
225
|
+
catch (e) {
|
|
226
|
+
reject(e);
|
|
227
|
+
} }
|
|
228
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
229
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
function __generator(thisArg, body) {
|
|
233
|
+
var _ = { label: 0, sent: function () { if (t[0] & 1)
|
|
234
|
+
throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
235
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
|
|
236
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
237
|
+
function step(op) {
|
|
238
|
+
if (f)
|
|
239
|
+
throw new TypeError("Generator is already executing.");
|
|
240
|
+
while (_)
|
|
275
241
|
try {
|
|
276
|
-
if (
|
|
277
|
-
|
|
242
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
|
|
243
|
+
return t;
|
|
244
|
+
if (y = 0, t)
|
|
245
|
+
op = [op[0] & 2, t.value];
|
|
246
|
+
switch (op[0]) {
|
|
247
|
+
case 0:
|
|
248
|
+
case 1:
|
|
249
|
+
t = op;
|
|
250
|
+
break;
|
|
251
|
+
case 4:
|
|
252
|
+
_.label++;
|
|
253
|
+
return { value: op[1], done: false };
|
|
254
|
+
case 5:
|
|
255
|
+
_.label++;
|
|
256
|
+
y = op[1];
|
|
257
|
+
op = [0];
|
|
258
|
+
continue;
|
|
259
|
+
case 7:
|
|
260
|
+
op = _.ops.pop();
|
|
261
|
+
_.trys.pop();
|
|
262
|
+
continue;
|
|
263
|
+
default:
|
|
264
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
265
|
+
_ = 0;
|
|
266
|
+
continue;
|
|
267
|
+
}
|
|
268
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
|
|
269
|
+
_.label = op[1];
|
|
270
|
+
break;
|
|
271
|
+
}
|
|
272
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
273
|
+
_.label = t[1];
|
|
274
|
+
t = op;
|
|
275
|
+
break;
|
|
276
|
+
}
|
|
277
|
+
if (t && _.label < t[2]) {
|
|
278
|
+
_.label = t[2];
|
|
279
|
+
_.ops.push(op);
|
|
280
|
+
break;
|
|
281
|
+
}
|
|
282
|
+
if (t[2])
|
|
283
|
+
_.ops.pop();
|
|
284
|
+
_.trys.pop();
|
|
285
|
+
continue;
|
|
286
|
+
}
|
|
287
|
+
op = body.call(thisArg, _);
|
|
288
|
+
}
|
|
289
|
+
catch (e) {
|
|
290
|
+
op = [6, e];
|
|
291
|
+
y = 0;
|
|
278
292
|
}
|
|
279
293
|
finally {
|
|
280
|
-
|
|
281
|
-
throw e.error;
|
|
294
|
+
f = t = 0;
|
|
282
295
|
}
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
/** @deprecated */
|
|
287
|
-
function __spread() {
|
|
288
|
-
for (var ar = [], i = 0; i < arguments.length; i++)
|
|
289
|
-
ar = ar.concat(__read(arguments[i]));
|
|
290
|
-
return ar;
|
|
296
|
+
if (op[0] & 5)
|
|
297
|
+
throw op[1];
|
|
298
|
+
return { value: op[0] ? op[1] : void 0, done: true };
|
|
291
299
|
}
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
300
|
+
}
|
|
301
|
+
var __createBinding = Object.create ? (function (o, m, k, k2) {
|
|
302
|
+
if (k2 === undefined)
|
|
303
|
+
k2 = k;
|
|
304
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
|
|
305
|
+
}) : (function (o, m, k, k2) {
|
|
306
|
+
if (k2 === undefined)
|
|
307
|
+
k2 = k;
|
|
308
|
+
o[k2] = m[k];
|
|
309
|
+
});
|
|
310
|
+
function __exportStar(m, o) {
|
|
311
|
+
for (var p in m)
|
|
312
|
+
if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
|
|
313
|
+
__createBinding(o, m, p);
|
|
314
|
+
}
|
|
315
|
+
function __values(o) {
|
|
316
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
317
|
+
if (m)
|
|
318
|
+
return m.call(o);
|
|
319
|
+
if (o && typeof o.length === "number")
|
|
320
|
+
return {
|
|
321
|
+
next: function () {
|
|
322
|
+
if (o && i >= o.length)
|
|
323
|
+
o = void 0;
|
|
324
|
+
return { value: o && o[i++], done: !o };
|
|
309
325
|
}
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
|
322
|
-
function resume(n, v) { try {
|
|
323
|
-
step(g[n](v));
|
|
324
|
-
}
|
|
325
|
-
catch (e) {
|
|
326
|
-
settle(q[0][3], e);
|
|
327
|
-
} }
|
|
328
|
-
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
|
329
|
-
function fulfill(value) { resume("next", value); }
|
|
330
|
-
function reject(value) { resume("throw", value); }
|
|
331
|
-
function settle(f, v) { if (f(v), q.shift(), q.length)
|
|
332
|
-
resume(q[0][0], q[0][1]); }
|
|
333
|
-
}
|
|
334
|
-
function __asyncDelegator(o) {
|
|
335
|
-
var i, p;
|
|
336
|
-
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
|
337
|
-
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
|
|
326
|
+
};
|
|
327
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
328
|
+
}
|
|
329
|
+
function __read(o, n) {
|
|
330
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
331
|
+
if (!m)
|
|
332
|
+
return o;
|
|
333
|
+
var i = m.call(o), r, ar = [], e;
|
|
334
|
+
try {
|
|
335
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
|
|
336
|
+
ar.push(r.value);
|
|
338
337
|
}
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
342
|
-
var m = o[Symbol.asyncIterator], i;
|
|
343
|
-
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
|
|
344
|
-
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
|
345
|
-
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
|
|
338
|
+
catch (error) {
|
|
339
|
+
e = { error: error };
|
|
346
340
|
}
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
341
|
+
finally {
|
|
342
|
+
try {
|
|
343
|
+
if (r && !r.done && (m = i["return"]))
|
|
344
|
+
m.call(i);
|
|
350
345
|
}
|
|
351
|
-
|
|
352
|
-
|
|
346
|
+
finally {
|
|
347
|
+
if (e)
|
|
348
|
+
throw e.error;
|
|
353
349
|
}
|
|
354
|
-
return cooked;
|
|
355
350
|
}
|
|
356
|
-
;
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
351
|
+
return ar;
|
|
352
|
+
}
|
|
353
|
+
/** @deprecated */
|
|
354
|
+
function __spread() {
|
|
355
|
+
for (var ar = [], i = 0; i < arguments.length; i++)
|
|
356
|
+
ar = ar.concat(__read(arguments[i]));
|
|
357
|
+
return ar;
|
|
358
|
+
}
|
|
359
|
+
/** @deprecated */
|
|
360
|
+
function __spreadArrays() {
|
|
361
|
+
for (var s = 0, i = 0, il = arguments.length; i < il; i++)
|
|
362
|
+
s += arguments[i].length;
|
|
363
|
+
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
|
364
|
+
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
|
365
|
+
r[k] = a[j];
|
|
366
|
+
return r;
|
|
367
|
+
}
|
|
368
|
+
function __spreadArray(to, from, pack) {
|
|
369
|
+
if (pack || arguments.length === 2)
|
|
370
|
+
for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
371
|
+
if (ar || !(i in from)) {
|
|
372
|
+
if (!ar)
|
|
373
|
+
ar = Array.prototype.slice.call(from, 0, i);
|
|
374
|
+
ar[i] = from[i];
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
378
|
+
}
|
|
379
|
+
function __await(v) {
|
|
380
|
+
return this instanceof __await ? (this.v = v, this) : new __await(v);
|
|
381
|
+
}
|
|
382
|
+
function __asyncGenerator(thisArg, _arguments, generator) {
|
|
383
|
+
if (!Symbol.asyncIterator)
|
|
384
|
+
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
385
|
+
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
|
386
|
+
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
|
387
|
+
function verb(n) { if (g[n])
|
|
388
|
+
i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
|
389
|
+
function resume(n, v) { try {
|
|
390
|
+
step(g[n](v));
|
|
375
391
|
}
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
392
|
+
catch (e) {
|
|
393
|
+
settle(q[0][3], e);
|
|
394
|
+
} }
|
|
395
|
+
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
|
396
|
+
function fulfill(value) { resume("next", value); }
|
|
397
|
+
function reject(value) { resume("throw", value); }
|
|
398
|
+
function settle(f, v) { if (f(v), q.shift(), q.length)
|
|
399
|
+
resume(q[0][0], q[0][1]); }
|
|
400
|
+
}
|
|
401
|
+
function __asyncDelegator(o) {
|
|
402
|
+
var i, p;
|
|
403
|
+
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
|
404
|
+
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
|
|
405
|
+
}
|
|
406
|
+
function __asyncValues(o) {
|
|
407
|
+
if (!Symbol.asyncIterator)
|
|
408
|
+
throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
409
|
+
var m = o[Symbol.asyncIterator], i;
|
|
410
|
+
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
|
|
411
|
+
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
|
412
|
+
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
|
|
413
|
+
}
|
|
414
|
+
function __makeTemplateObject(cooked, raw) {
|
|
415
|
+
if (Object.defineProperty) {
|
|
416
|
+
Object.defineProperty(cooked, "raw", { value: raw });
|
|
382
417
|
}
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
throw new TypeError("Private method is not writable");
|
|
386
|
-
if (kind === "a" && !f)
|
|
387
|
-
throw new TypeError("Private accessor was defined without a setter");
|
|
388
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
389
|
-
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
390
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
418
|
+
else {
|
|
419
|
+
cooked.raw = raw;
|
|
391
420
|
}
|
|
421
|
+
return cooked;
|
|
422
|
+
}
|
|
423
|
+
;
|
|
424
|
+
var __setModuleDefault = Object.create ? (function (o, v) {
|
|
425
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
426
|
+
}) : function (o, v) {
|
|
427
|
+
o["default"] = v;
|
|
428
|
+
};
|
|
429
|
+
function __importStar(mod) {
|
|
430
|
+
if (mod && mod.__esModule)
|
|
431
|
+
return mod;
|
|
432
|
+
var result = {};
|
|
433
|
+
if (mod != null)
|
|
434
|
+
for (var k in mod)
|
|
435
|
+
if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
|
|
436
|
+
__createBinding(result, mod, k);
|
|
437
|
+
__setModuleDefault(result, mod);
|
|
438
|
+
return result;
|
|
439
|
+
}
|
|
440
|
+
function __importDefault(mod) {
|
|
441
|
+
return (mod && mod.__esModule) ? mod : { default: mod };
|
|
442
|
+
}
|
|
443
|
+
function __classPrivateFieldGet(receiver, state, kind, f) {
|
|
444
|
+
if (kind === "a" && !f)
|
|
445
|
+
throw new TypeError("Private accessor was defined without a getter");
|
|
446
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
447
|
+
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
448
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
449
|
+
}
|
|
450
|
+
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
|
451
|
+
if (kind === "m")
|
|
452
|
+
throw new TypeError("Private method is not writable");
|
|
453
|
+
if (kind === "a" && !f)
|
|
454
|
+
throw new TypeError("Private accessor was defined without a setter");
|
|
455
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
456
|
+
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
457
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
458
|
+
}
|
|
392
459
|
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
};
|
|
401
|
-
this.getNthChildRoute = function (route, index) {
|
|
402
|
-
if (index <= 0) {
|
|
403
|
-
return route;
|
|
404
|
-
}
|
|
405
|
-
return route.firstChild ? _this.getNthChildRoute(route.firstChild, index - 1) : route;
|
|
406
|
-
};
|
|
407
|
-
this.getLastChildRouteSnapshot = function (route) {
|
|
408
|
-
return route.firstChild ? _this.getLastChildRouteSnapshot(route.firstChild) : route;
|
|
409
|
-
};
|
|
410
|
-
this.watchLastChildRoute$ = function (route) {
|
|
411
|
-
return _this.routeChange$.pipe(rxjs.map(function () { return _this.getLastChildRouteSnapshot(route.snapshot); }));
|
|
412
|
-
};
|
|
413
|
-
this.getLastChildParams = function (route) {
|
|
414
|
-
return route.firstChild ? _this.getLastChildParams(route.firstChild) : route.params;
|
|
415
|
-
};
|
|
416
|
-
this.watchLastChildParams$ = function (route) {
|
|
417
|
-
return _this.routeChange$.pipe(rxjs.map(function () { return _this.getLastChildParams(route.snapshot); }));
|
|
418
|
-
};
|
|
419
|
-
this.routeChange$ = this.router.events.pipe(rxjs.filter(function (e) { return e instanceof i1.NavigationEnd; }), rxjs.shareReplay());
|
|
420
|
-
this.lastChildParams$ = this.watchLastChildParams$(this.route).pipe(rxjs.startWith(this.getLastChildParams(this.route.snapshot)), rxjs.shareReplay());
|
|
421
|
-
this.lastChildRoute$ = this.watchLastChildRoute$(this.route).pipe(rxjs.startWith(this.getLastChildRouteSnapshot(this.route.snapshot)), rxjs.shareReplay());
|
|
422
|
-
this.loading$ = this.router.events.pipe(rxjs.filter(function (e) { return e instanceof i1.NavigationStart ||
|
|
423
|
-
e instanceof i1.NavigationCancel ||
|
|
424
|
-
e instanceof i1.NavigationEnd ||
|
|
425
|
-
e instanceof i1.NavigationError; }), rxjs.map(function (e) { return e instanceof i1.NavigationStart; }), rxjs.startWith(false), rxjs.distinctUntilChanged());
|
|
426
|
-
}
|
|
427
|
-
RouterService.prototype.getFlowRootRoute = function (route) {
|
|
428
|
-
var _a;
|
|
429
|
-
var path = __spreadArray([], __read(route.pathFromRoot));
|
|
430
|
-
while (path.length) {
|
|
431
|
-
var parent = path.pop();
|
|
432
|
-
if (!parent) {
|
|
433
|
-
break;
|
|
434
|
-
}
|
|
435
|
-
if (((_a = parent.routeConfig) === null || _a === void 0 ? void 0 : _a.id) === VELOCE_FLOW_ROOT_ROUTE) {
|
|
436
|
-
return parent;
|
|
437
|
-
}
|
|
438
|
-
}
|
|
439
|
-
return;
|
|
460
|
+
var RouterService = /** @class */ (function () {
|
|
461
|
+
function RouterService(router, route) {
|
|
462
|
+
var _this = this;
|
|
463
|
+
this.router = router;
|
|
464
|
+
this.route = route;
|
|
465
|
+
this.getLastChildRoute = function (route) {
|
|
466
|
+
return route.firstChild ? _this.getLastChildRoute(route.firstChild) : route;
|
|
440
467
|
};
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
return '';
|
|
468
|
+
this.getNthChildRoute = function (route, index) {
|
|
469
|
+
if (index <= 0) {
|
|
470
|
+
return route;
|
|
445
471
|
}
|
|
446
|
-
|
|
447
|
-
.map(function (r) { var _a; return (_a = r.routeConfig) === null || _a === void 0 ? void 0 : _a.path; })
|
|
448
|
-
.filter(Boolean)
|
|
449
|
-
.join('/');
|
|
450
|
-
return '/' + path;
|
|
472
|
+
return route.firstChild ? _this.getNthChildRoute(route.firstChild, index - 1) : route;
|
|
451
473
|
};
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
return this.lastChildRoute$;
|
|
455
|
-
},
|
|
456
|
-
enumerable: false,
|
|
457
|
-
configurable: true
|
|
458
|
-
});
|
|
459
|
-
Object.defineProperty(RouterService.prototype, "params$", {
|
|
460
|
-
get: function () {
|
|
461
|
-
return this.lastChildParams$;
|
|
462
|
-
},
|
|
463
|
-
enumerable: false,
|
|
464
|
-
configurable: true
|
|
465
|
-
});
|
|
466
|
-
return RouterService;
|
|
467
|
-
}());
|
|
468
|
-
RouterService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: RouterService, deps: [{ token: i1__namespace.Router }, { token: i1__namespace.ActivatedRoute }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
469
|
-
RouterService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: RouterService, providedIn: 'root' });
|
|
470
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: RouterService, decorators: [{
|
|
471
|
-
type: i0.Injectable,
|
|
472
|
-
args: [{ providedIn: 'root' }]
|
|
473
|
-
}], ctorParameters: function () { return [{ type: i1__namespace.Router }, { type: i1__namespace.ActivatedRoute }]; } });
|
|
474
|
-
|
|
475
|
-
var FlowComponent = /** @class */ (function () {
|
|
476
|
-
function FlowComponent(routerService, context) {
|
|
477
|
-
var _this = this;
|
|
478
|
-
this.routerService = routerService;
|
|
479
|
-
this.context = context;
|
|
480
|
-
this.isLoading$ = this.routerService.loading$;
|
|
481
|
-
this.showHeader$ = this.routerService.route$.pipe(rxjs.map(function (route) {
|
|
482
|
-
var _a;
|
|
483
|
-
var showHeader = ((_a = _this.context.resolve()) === null || _a === void 0 ? void 0 : _a.properties.standalone) !== 'true';
|
|
484
|
-
return route.data.showHeader && showHeader;
|
|
485
|
-
}));
|
|
486
|
-
}
|
|
487
|
-
return FlowComponent;
|
|
488
|
-
}());
|
|
489
|
-
FlowComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: FlowComponent, deps: [{ token: RouterService }, { token: i2__namespace.ContextService }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
490
|
-
FlowComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: FlowComponent, selector: "vl-flow", ngImport: i0__namespace, 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}.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: i2__namespace$1.LoaderComponent, selector: "vl-loader", inputs: ["label", "overlayVisible"] }], directives: [{ type: i5__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1__namespace.RouterOutlet, selector: "router-outlet", outputs: ["activate", "deactivate"], exportAs: ["outlet"] }], pipes: { "async": i5__namespace.AsyncPipe }, changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
|
|
491
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: FlowComponent, decorators: [{
|
|
492
|
-
type: i0.Component,
|
|
493
|
-
args: [{
|
|
494
|
-
selector: 'vl-flow',
|
|
495
|
-
templateUrl: './flow.component.html',
|
|
496
|
-
styleUrls: ['./flow.component.scss'],
|
|
497
|
-
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
498
|
-
}]
|
|
499
|
-
}], ctorParameters: function () { return [{ type: RouterService }, { type: i2__namespace.ContextService }]; } });
|
|
500
|
-
|
|
501
|
-
var ContextGuard = /** @class */ (function () {
|
|
502
|
-
function ContextGuard(router, routerService) {
|
|
503
|
-
this.router = router;
|
|
504
|
-
this.routerService = routerService;
|
|
505
|
-
}
|
|
506
|
-
ContextGuard.prototype.getConfigurationContextMode = function (accountId, quoteId, orderId, rpcMessage) {
|
|
507
|
-
if (accountId) {
|
|
508
|
-
return core.ConfigurationContextMode.ACCOUNT;
|
|
509
|
-
}
|
|
510
|
-
if (quoteId) {
|
|
511
|
-
return core.ConfigurationContextMode.QUOTE;
|
|
512
|
-
}
|
|
513
|
-
if (orderId) {
|
|
514
|
-
return core.ConfigurationContextMode.ORDER;
|
|
515
|
-
}
|
|
516
|
-
if (rpcMessage) {
|
|
517
|
-
return core.ConfigurationContextMode.REMOTE;
|
|
518
|
-
}
|
|
519
|
-
return;
|
|
474
|
+
this.getLastChildRouteSnapshot = function (route) {
|
|
475
|
+
return route.firstChild ? _this.getLastChildRouteSnapshot(route.firstChild) : route;
|
|
520
476
|
};
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
var queryParams = route.queryParams;
|
|
524
|
-
var accountId = queryParams.accountId, quoteId = queryParams.quoteId, orderId = queryParams.orderId;
|
|
525
|
-
var rpcMessage = window['RPC_MESSAGE'];
|
|
526
|
-
var rpcMessageId = rpcMessage && ((_b = (_a = JSON.parse(rpcMessage)) === null || _a === void 0 ? void 0 : _a.quote) === null || _b === void 0 ? void 0 : _b.Id);
|
|
527
|
-
var headerId = accountId || quoteId || orderId || rpcMessageId || 'empty-for-test-mode';
|
|
528
|
-
var mode = this.getConfigurationContextMode(accountId, quoteId, orderId, rpcMessage);
|
|
529
|
-
if (mode === void 0) {
|
|
530
|
-
return this.reject(route, 'Mode is undefined');
|
|
531
|
-
}
|
|
532
|
-
var contextRouteData = {
|
|
533
|
-
headerId: headerId,
|
|
534
|
-
mode: mode,
|
|
535
|
-
};
|
|
536
|
-
route.data = Object.assign(Object.assign({}, route.data), contextRouteData);
|
|
537
|
-
return true;
|
|
538
|
-
};
|
|
539
|
-
ContextGuard.prototype.canActivate = function (route) {
|
|
540
|
-
return this.checkActivation(route);
|
|
477
|
+
this.watchLastChildRoute$ = function (route) {
|
|
478
|
+
return _this.routeChange$.pipe(rxjs.map(function () { return _this.getLastChildRouteSnapshot(route.snapshot); }));
|
|
541
479
|
};
|
|
542
|
-
|
|
543
|
-
return
|
|
480
|
+
this.getLastChildParams = function (route) {
|
|
481
|
+
return route.firstChild ? _this.getLastChildParams(route.firstChild) : route.params;
|
|
544
482
|
};
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
this.router.navigate([parentUrl, '404'], {
|
|
548
|
-
state: { message: message },
|
|
549
|
-
});
|
|
550
|
-
return false;
|
|
483
|
+
this.watchLastChildParams$ = function (route) {
|
|
484
|
+
return _this.routeChange$.pipe(rxjs.map(function () { return _this.getLastChildParams(route.snapshot); }));
|
|
551
485
|
};
|
|
552
|
-
return
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
}
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
RootGuard.prototype.canActivate = function (route) {
|
|
568
|
-
var _this = this;
|
|
569
|
-
// We always need to initialize root component first, and only then start checking guards/resolvers
|
|
570
|
-
var _a;
|
|
571
|
-
if (!this.initialized) {
|
|
572
|
-
this.initialized = true;
|
|
573
|
-
this.navToRestore = this.router.getCurrentNavigation();
|
|
574
|
-
var rootUrl = this.routerService.getFlowRootPath(route);
|
|
575
|
-
this.router.navigate([rootUrl], { replaceUrl: !((_a = this.navToRestore) === null || _a === void 0 ? void 0 : _a.previousNavigation) });
|
|
486
|
+
this.routeChange$ = this.router.events.pipe(rxjs.filter(function (e) { return e instanceof i1$1.NavigationEnd; }), rxjs.shareReplay());
|
|
487
|
+
this.lastChildParams$ = this.watchLastChildParams$(this.route).pipe(rxjs.startWith(this.getLastChildParams(this.route.snapshot)), rxjs.shareReplay());
|
|
488
|
+
this.lastChildRoute$ = this.watchLastChildRoute$(this.route).pipe(rxjs.startWith(this.getLastChildRouteSnapshot(this.route.snapshot)), rxjs.shareReplay());
|
|
489
|
+
this.loading$ = this.router.events.pipe(rxjs.filter(function (e) { return e instanceof i1$1.NavigationStart ||
|
|
490
|
+
e instanceof i1$1.NavigationCancel ||
|
|
491
|
+
e instanceof i1$1.NavigationEnd ||
|
|
492
|
+
e instanceof i1$1.NavigationError; }), rxjs.map(function (e) { return e instanceof i1$1.NavigationStart; }), rxjs.startWith(false), rxjs.distinctUntilChanged());
|
|
493
|
+
}
|
|
494
|
+
RouterService.prototype.getFlowRootRoute = function (route) {
|
|
495
|
+
var _a;
|
|
496
|
+
var path = __spreadArray([], __read(route.pathFromRoot));
|
|
497
|
+
while (path.length) {
|
|
498
|
+
var parent = path.pop();
|
|
499
|
+
if (!parent) {
|
|
500
|
+
break;
|
|
576
501
|
}
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
setTimeout(function () {
|
|
580
|
-
_this.router.navigateByUrl(nav_1.extractedUrl, nav_1.extras);
|
|
581
|
-
_this.navToRestore = null;
|
|
582
|
-
});
|
|
502
|
+
if (((_a = parent.routeConfig) === null || _a === void 0 ? void 0 : _a.id) === VELOCE_FLOW_ROOT_ROUTE) {
|
|
503
|
+
return parent;
|
|
583
504
|
}
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
505
|
+
}
|
|
506
|
+
return;
|
|
507
|
+
};
|
|
508
|
+
RouterService.prototype.getFlowRootPath = function (route) {
|
|
509
|
+
var rootRoute = this.getFlowRootRoute(route);
|
|
510
|
+
if (!rootRoute) {
|
|
511
|
+
return '';
|
|
512
|
+
}
|
|
513
|
+
var path = rootRoute.pathFromRoot
|
|
514
|
+
.map(function (r) { var _a; return (_a = r.routeConfig) === null || _a === void 0 ? void 0 : _a.path; })
|
|
515
|
+
.filter(Boolean)
|
|
516
|
+
.join('/');
|
|
517
|
+
return '/' + path;
|
|
518
|
+
};
|
|
519
|
+
Object.defineProperty(RouterService.prototype, "route$", {
|
|
520
|
+
get: function () {
|
|
521
|
+
return this.lastChildRoute$;
|
|
522
|
+
},
|
|
523
|
+
enumerable: false,
|
|
524
|
+
configurable: true
|
|
525
|
+
});
|
|
526
|
+
Object.defineProperty(RouterService.prototype, "params$", {
|
|
527
|
+
get: function () {
|
|
528
|
+
return this.lastChildParams$;
|
|
529
|
+
},
|
|
530
|
+
enumerable: false,
|
|
531
|
+
configurable: true
|
|
532
|
+
});
|
|
533
|
+
return RouterService;
|
|
534
|
+
}());
|
|
535
|
+
RouterService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: RouterService, deps: [{ token: i1__namespace$1.Router }, { token: i1__namespace$1.ActivatedRoute }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
536
|
+
RouterService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: RouterService, providedIn: 'root' });
|
|
537
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: RouterService, decorators: [{
|
|
538
|
+
type: i0.Injectable,
|
|
539
|
+
args: [{ providedIn: 'root' }]
|
|
540
|
+
}], ctorParameters: function () { return [{ type: i1__namespace$1.Router }, { type: i1__namespace$1.ActivatedRoute }]; } });
|
|
541
|
+
|
|
542
|
+
var FlowComponent = /** @class */ (function () {
|
|
543
|
+
function FlowComponent(routerService, context) {
|
|
544
|
+
var _this = this;
|
|
545
|
+
this.routerService = routerService;
|
|
546
|
+
this.context = context;
|
|
547
|
+
this.isLoading$ = this.routerService.loading$;
|
|
548
|
+
this.showHeader$ = this.routerService.route$.pipe(rxjs.map(function (route) {
|
|
549
|
+
var _a;
|
|
550
|
+
var showHeader = ((_a = _this.context.resolve()) === null || _a === void 0 ? void 0 : _a.properties.standalone) !== 'true';
|
|
551
|
+
return route.data.showHeader && showHeader;
|
|
552
|
+
}));
|
|
553
|
+
}
|
|
554
|
+
return FlowComponent;
|
|
555
|
+
}());
|
|
556
|
+
FlowComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: FlowComponent, deps: [{ token: RouterService }, { token: i2__namespace.ContextService }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
557
|
+
FlowComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: FlowComponent, selector: "vl-flow", ngImport: i0__namespace, 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;padding:24px 54px;overflow:auto}.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: i2__namespace$1.LoaderComponent, selector: "vl-loader", inputs: ["label", "overlayVisible"] }], directives: [{ type: i4__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1__namespace$1.RouterOutlet, selector: "router-outlet", outputs: ["activate", "deactivate"], exportAs: ["outlet"] }], pipes: { "async": i4__namespace.AsyncPipe }, changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
|
|
558
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: FlowComponent, decorators: [{
|
|
559
|
+
type: i0.Component,
|
|
560
|
+
args: [{
|
|
561
|
+
selector: 'vl-flow',
|
|
562
|
+
templateUrl: './flow.component.html',
|
|
563
|
+
styleUrls: ['./flow.component.scss'],
|
|
564
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
565
|
+
}]
|
|
566
|
+
}], ctorParameters: function () { return [{ type: RouterService }, { type: i2__namespace.ContextService }]; } });
|
|
598
567
|
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
568
|
+
var ContextGuard = /** @class */ (function () {
|
|
569
|
+
function ContextGuard(router, routerService) {
|
|
570
|
+
this.router = router;
|
|
571
|
+
this.routerService = routerService;
|
|
572
|
+
}
|
|
573
|
+
ContextGuard.prototype.getConfigurationContextMode = function (accountId, quoteId, orderId, rpcMessage) {
|
|
574
|
+
if (accountId) {
|
|
575
|
+
return core.ConfigurationContextMode.ACCOUNT;
|
|
603
576
|
}
|
|
604
|
-
|
|
605
|
-
return
|
|
606
|
-
}
|
|
607
|
-
|
|
608
|
-
return
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
577
|
+
if (quoteId) {
|
|
578
|
+
return core.ConfigurationContextMode.QUOTE;
|
|
579
|
+
}
|
|
580
|
+
if (orderId) {
|
|
581
|
+
return core.ConfigurationContextMode.ORDER;
|
|
582
|
+
}
|
|
583
|
+
if (rpcMessage) {
|
|
584
|
+
return core.ConfigurationContextMode.REMOTE;
|
|
585
|
+
}
|
|
586
|
+
return;
|
|
587
|
+
};
|
|
588
|
+
ContextGuard.prototype.checkActivation = function (route) {
|
|
589
|
+
var _a, _b;
|
|
590
|
+
var queryParams = route.queryParams;
|
|
591
|
+
var accountId = queryParams.accountId, quoteId = queryParams.quoteId, orderId = queryParams.orderId;
|
|
592
|
+
var rpcMessage = window['RPC_MESSAGE'];
|
|
593
|
+
var rpcMessageId = rpcMessage && ((_b = (_a = JSON.parse(rpcMessage)) === null || _a === void 0 ? void 0 : _a.quote) === null || _b === void 0 ? void 0 : _b.Id);
|
|
594
|
+
var headerId = accountId || quoteId || orderId || rpcMessageId || 'empty-for-test-mode';
|
|
595
|
+
var mode = this.getConfigurationContextMode(accountId, quoteId, orderId, rpcMessage);
|
|
596
|
+
if (mode === void 0) {
|
|
597
|
+
return this.reject(route, 'Mode is undefined');
|
|
598
|
+
}
|
|
599
|
+
var contextRouteData = {
|
|
600
|
+
headerId: headerId,
|
|
601
|
+
mode: mode,
|
|
614
602
|
};
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
603
|
+
route.data = Object.assign(Object.assign({}, route.data), contextRouteData);
|
|
604
|
+
return true;
|
|
605
|
+
};
|
|
606
|
+
ContextGuard.prototype.canActivate = function (route) {
|
|
607
|
+
return this.checkActivation(route);
|
|
608
|
+
};
|
|
609
|
+
ContextGuard.prototype.canActivateChild = function (childRoute) {
|
|
610
|
+
return this.checkActivation(childRoute);
|
|
611
|
+
};
|
|
612
|
+
ContextGuard.prototype.reject = function (route, message) {
|
|
613
|
+
var parentUrl = this.routerService.getFlowRootPath(route);
|
|
614
|
+
this.router.navigate([parentUrl, '404'], {
|
|
615
|
+
state: { message: message },
|
|
616
|
+
});
|
|
617
|
+
return false;
|
|
618
|
+
};
|
|
619
|
+
return ContextGuard;
|
|
620
|
+
}());
|
|
621
|
+
ContextGuard.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: ContextGuard, deps: [{ token: i1__namespace$1.Router }, { token: RouterService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
622
|
+
ContextGuard.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: ContextGuard });
|
|
623
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: ContextGuard, decorators: [{
|
|
624
|
+
type: i0.Injectable
|
|
625
|
+
}], ctorParameters: function () { return [{ type: i1__namespace$1.Router }, { type: RouterService }]; } });
|
|
622
626
|
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
queryParamsStr: JSON.stringify(queryParams),
|
|
640
|
-
};
|
|
641
|
-
}); }), rxjs.shareReplay());
|
|
627
|
+
var RootGuard = /** @class */ (function () {
|
|
628
|
+
function RootGuard(router, routerService) {
|
|
629
|
+
this.router = router;
|
|
630
|
+
this.routerService = routerService;
|
|
631
|
+
this.initialized = false;
|
|
632
|
+
this.navToRestore = null;
|
|
633
|
+
}
|
|
634
|
+
RootGuard.prototype.canActivate = function (route) {
|
|
635
|
+
var _this = this;
|
|
636
|
+
// We always need to initialize root component first, and only then start checking guards/resolvers
|
|
637
|
+
var _a;
|
|
638
|
+
if (!this.initialized) {
|
|
639
|
+
this.initialized = true;
|
|
640
|
+
this.navToRestore = this.router.getCurrentNavigation();
|
|
641
|
+
var rootUrl = this.routerService.getFlowRootPath(route);
|
|
642
|
+
this.router.navigate([rootUrl], { replaceUrl: !((_a = this.navToRestore) === null || _a === void 0 ? void 0 : _a.previousNavigation) });
|
|
642
643
|
}
|
|
643
|
-
|
|
644
|
-
var
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
// Delete context before starting a new flow
|
|
649
|
-
this.context.delete();
|
|
650
|
-
this.router.navigate(['..', 'flows'], {
|
|
651
|
-
queryParams: Object.assign({ flowId: this.selectedFlow.id, quoteId: id }, this.selectedFlow.queryParams),
|
|
652
|
-
relativeTo: this.activatedRoute,
|
|
644
|
+
else if (this.navToRestore) {
|
|
645
|
+
var nav_1 = this.navToRestore;
|
|
646
|
+
setTimeout(function () {
|
|
647
|
+
_this.router.navigateByUrl(nav_1.extractedUrl, nav_1.extras);
|
|
648
|
+
_this.navToRestore = null;
|
|
653
649
|
});
|
|
654
|
-
};
|
|
655
|
-
return DebugComponent;
|
|
656
|
-
}());
|
|
657
|
-
DebugComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: DebugComponent, deps: [{ token: FlowService }, { token: i1__namespace.Router }, { token: i1__namespace.ActivatedRoute }, { token: i2__namespace.ContextService }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
658
|
-
DebugComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: DebugComponent, selector: "vl-flow-debug", ngImport: i0__namespace, template: "<form [formGroup]=\"form\">\n <div class=\"field\">\n <label>SF Object ID</label>\n <input formControlName=\"id\" pInputText type=\"text\" />\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: ["form{display:flex;align-items:center;justify-content:space-between}.field{display:flex;flex-direction:column;width:200px;flex-shrink:0}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__namespace.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "style", "styleClass", "badgeClass"], outputs: ["onClick", "onFocus", "onBlur"] }, { type: i5__namespace$1.RadioButton, selector: "p-radioButton", inputs: ["value", "formControlName", "name", "disabled", "label", "tabindex", "inputId", "ariaLabelledBy", "ariaLabel", "style", "styleClass", "labelStyleClass"], outputs: ["onClick", "onFocus", "onBlur"] }], directives: [{ type: i6__namespace.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i6__namespace.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i6__namespace.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i6__namespace.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: i6__namespace.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i6__namespace.FormControlName, selector: "[formControlName]", inputs: ["disabled", "formControlName", "ngModel"], outputs: ["ngModelChange"] }, { type: i7__namespace.InputText, selector: "[pInputText]" }, { type: i5__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i6__namespace.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], pipes: { "async": i5__namespace.AsyncPipe }, changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
|
|
659
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: DebugComponent, decorators: [{
|
|
660
|
-
type: i0.Component,
|
|
661
|
-
args: [{
|
|
662
|
-
selector: 'vl-flow-debug',
|
|
663
|
-
templateUrl: './debug.component.html',
|
|
664
|
-
styleUrls: ['./debug.component.scss'],
|
|
665
|
-
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
666
|
-
}]
|
|
667
|
-
}], ctorParameters: function () { return [{ type: FlowService }, { type: i1__namespace.Router }, { type: i1__namespace.ActivatedRoute }, { type: i2__namespace.ContextService }]; } });
|
|
668
|
-
|
|
669
|
-
var routes$1 = [{ path: '', component: DebugComponent }];
|
|
670
|
-
var DebugModule = /** @class */ (function () {
|
|
671
|
-
function DebugModule() {
|
|
672
650
|
}
|
|
673
|
-
return
|
|
674
|
-
}
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
i4.ButtonModule,
|
|
688
|
-
i7.InputTextModule,
|
|
689
|
-
]] });
|
|
690
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: DebugModule, decorators: [{
|
|
691
|
-
type: i0.NgModule,
|
|
692
|
-
args: [{
|
|
693
|
-
declarations: [DebugComponent],
|
|
694
|
-
imports: [
|
|
695
|
-
i5.CommonModule,
|
|
696
|
-
i6.FormsModule,
|
|
697
|
-
i6.ReactiveFormsModule,
|
|
698
|
-
i1.RouterModule.forChild(routes$1),
|
|
699
|
-
i5$1.RadioButtonModule,
|
|
700
|
-
i4.ButtonModule,
|
|
701
|
-
i7.InputTextModule,
|
|
702
|
-
],
|
|
703
|
-
}]
|
|
704
|
-
}] });
|
|
651
|
+
return true;
|
|
652
|
+
};
|
|
653
|
+
RootGuard.prototype.canDeactivate = function () {
|
|
654
|
+
this.initialized = false;
|
|
655
|
+
return true;
|
|
656
|
+
};
|
|
657
|
+
return RootGuard;
|
|
658
|
+
}());
|
|
659
|
+
RootGuard.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: RootGuard, deps: [{ token: i1__namespace$1.Router }, { token: RouterService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
660
|
+
RootGuard.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: RootGuard, providedIn: 'root' });
|
|
661
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: RootGuard, decorators: [{
|
|
662
|
+
type: i0.Injectable,
|
|
663
|
+
args: [{ providedIn: 'root' }]
|
|
664
|
+
}], ctorParameters: function () { return [{ type: i1__namespace$1.Router }, { type: RouterService }]; } });
|
|
705
665
|
|
|
706
|
-
|
|
666
|
+
var getFlowObjectIdPropertyName = function (objectName) {
|
|
667
|
+
switch (objectName) {
|
|
668
|
+
case 'Account':
|
|
669
|
+
return 'accountId';
|
|
670
|
+
case 'Order':
|
|
671
|
+
return 'orderId';
|
|
672
|
+
case 'Quote':
|
|
673
|
+
default:
|
|
674
|
+
return 'quoteId';
|
|
675
|
+
}
|
|
676
|
+
};
|
|
707
677
|
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
this.
|
|
678
|
+
var FlowService = /** @class */ (function () {
|
|
679
|
+
function FlowService(configurationSettingsApiService) {
|
|
680
|
+
this.configurationSettingsApiService = configurationSettingsApiService;
|
|
681
|
+
this.flowsKey = 'flows';
|
|
682
|
+
}
|
|
683
|
+
FlowService.prototype.getFlow = function (id) {
|
|
684
|
+
return this.fetchFlows().pipe(operators.map(function (flows) { return flows.find(function (flow) { return flow.id == id; }); }));
|
|
685
|
+
};
|
|
686
|
+
FlowService.prototype.fetchFlows = function () {
|
|
687
|
+
return this.configurationSettingsApiService
|
|
688
|
+
.fetchSetting(this.flowsKey)
|
|
689
|
+
.pipe(operators.map(function (_a) {
|
|
690
|
+
var value = _a.value;
|
|
691
|
+
return (value ? JSON.parse(value) : []);
|
|
692
|
+
}));
|
|
693
|
+
};
|
|
694
|
+
return FlowService;
|
|
695
|
+
}());
|
|
696
|
+
FlowService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: FlowService, deps: [{ token: i1__namespace.ConfigurationSettingsApiService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
697
|
+
FlowService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: FlowService });
|
|
698
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: FlowService, decorators: [{
|
|
699
|
+
type: i0.Injectable
|
|
700
|
+
}], ctorParameters: function () { return [{ type: i1__namespace.ConfigurationSettingsApiService }]; } });
|
|
701
|
+
|
|
702
|
+
var DebugComponent = /** @class */ (function () {
|
|
703
|
+
function DebugComponent(flowService, router, activatedRoute, context) {
|
|
704
|
+
this.flowService = flowService;
|
|
705
|
+
this.router = router;
|
|
706
|
+
this.activatedRoute = activatedRoute;
|
|
707
|
+
this.context = context;
|
|
708
|
+
this.objectNames = ['Account', 'Quote', 'Order'];
|
|
709
|
+
this.form = new i7.FormGroup({
|
|
710
|
+
id: new i7.FormControl(''),
|
|
711
|
+
name: new i7.FormControl('Quote'),
|
|
712
|
+
});
|
|
713
|
+
this.flows$ = this.flowService.fetchFlows().pipe(rxjs.map(function (flows) { return flows.map(function (flow) {
|
|
714
|
+
var _a, _b, _c;
|
|
715
|
+
var queryParams = (_b = (_a = flow === null || flow === void 0 ? void 0 : flow.properties) === null || _a === void 0 ? void 0 : _a.queryParams) !== null && _b !== void 0 ? _b : {};
|
|
716
|
+
return {
|
|
717
|
+
id: flow.id,
|
|
718
|
+
entryPath: (_c = flow === null || flow === void 0 ? void 0 : flow.properties) === null || _c === void 0 ? void 0 : _c.entryPath,
|
|
719
|
+
queryParams: queryParams,
|
|
720
|
+
queryParamsStr: JSON.stringify(queryParams),
|
|
721
|
+
};
|
|
722
|
+
}); }), rxjs.shareReplay());
|
|
723
|
+
}
|
|
724
|
+
DebugComponent.prototype.runFlow = function () {
|
|
725
|
+
var _d;
|
|
726
|
+
var _e = this.form.value, id = _e.id, name = _e.name;
|
|
727
|
+
var objectPropertyName = getFlowObjectIdPropertyName(name);
|
|
728
|
+
if (!id || !this.selectedFlow) {
|
|
729
|
+
return;
|
|
719
730
|
}
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
731
|
+
// Delete context before starting a new flow
|
|
732
|
+
this.context.delete();
|
|
733
|
+
this.router.navigate(['..', 'flows'], {
|
|
734
|
+
queryParams: Object.assign((_d = { flowId: this.selectedFlow.id }, _d[objectPropertyName] = id, _d), this.selectedFlow.queryParams),
|
|
735
|
+
relativeTo: this.activatedRoute,
|
|
736
|
+
});
|
|
737
|
+
};
|
|
738
|
+
return DebugComponent;
|
|
739
|
+
}());
|
|
740
|
+
DebugComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: DebugComponent, deps: [{ token: FlowService }, { token: i1__namespace$1.Router }, { token: i1__namespace$1.ActivatedRoute }, { token: i2__namespace.ContextService }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
741
|
+
DebugComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: DebugComponent, selector: "vl-flow-debug", ngImport: i0__namespace, 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: ["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__namespace$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__namespace$1.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "style", "styleClass", "badgeClass"], outputs: ["onClick", "onFocus", "onBlur"] }, { type: i6__namespace.RadioButton, selector: "p-radioButton", inputs: ["value", "formControlName", "name", "disabled", "label", "tabindex", "inputId", "ariaLabelledBy", "ariaLabel", "style", "styleClass", "labelStyleClass"], outputs: ["onClick", "onFocus", "onBlur"] }], directives: [{ type: i7__namespace.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i7__namespace.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i7__namespace.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i7__namespace.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__namespace.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i7__namespace.FormControlName, selector: "[formControlName]", inputs: ["disabled", "formControlName", "ngModel"], outputs: ["ngModelChange"] }, { type: i8__namespace.InputText, selector: "[pInputText]" }, { type: i4__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i7__namespace.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], pipes: { "async": i4__namespace.AsyncPipe }, changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
|
|
742
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: DebugComponent, decorators: [{
|
|
743
|
+
type: i0.Component,
|
|
744
|
+
args: [{
|
|
745
|
+
selector: 'vl-flow-debug',
|
|
746
|
+
templateUrl: './debug.component.html',
|
|
747
|
+
styleUrls: ['./debug.component.scss'],
|
|
748
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
749
|
+
}]
|
|
750
|
+
}], ctorParameters: function () { return [{ type: FlowService }, { type: i1__namespace$1.Router }, { type: i1__namespace$1.ActivatedRoute }, { type: i2__namespace.ContextService }]; } });
|
|
751
|
+
|
|
752
|
+
var routes$1 = [{ path: '', component: DebugComponent }];
|
|
753
|
+
var DebugModule = /** @class */ (function () {
|
|
754
|
+
function DebugModule() {
|
|
755
|
+
}
|
|
756
|
+
return DebugModule;
|
|
757
|
+
}());
|
|
758
|
+
DebugModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: DebugModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
|
|
759
|
+
DebugModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: DebugModule, declarations: [DebugComponent], imports: [i4.CommonModule,
|
|
760
|
+
i7.FormsModule,
|
|
761
|
+
i7.ReactiveFormsModule, i1__namespace$1.RouterModule, i6.RadioButtonModule,
|
|
762
|
+
i5$1.ButtonModule,
|
|
763
|
+
i8.InputTextModule,
|
|
764
|
+
i4$2.DropdownModule] });
|
|
765
|
+
DebugModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: DebugModule, imports: [[
|
|
766
|
+
i4.CommonModule,
|
|
767
|
+
i7.FormsModule,
|
|
768
|
+
i7.ReactiveFormsModule,
|
|
769
|
+
i1$1.RouterModule.forChild(routes$1),
|
|
770
|
+
i6.RadioButtonModule,
|
|
771
|
+
i5$1.ButtonModule,
|
|
772
|
+
i8.InputTextModule,
|
|
773
|
+
i4$2.DropdownModule,
|
|
774
|
+
]] });
|
|
775
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: DebugModule, decorators: [{
|
|
776
|
+
type: i0.NgModule,
|
|
777
|
+
args: [{
|
|
778
|
+
declarations: [DebugComponent],
|
|
779
|
+
imports: [
|
|
780
|
+
i4.CommonModule,
|
|
781
|
+
i7.FormsModule,
|
|
782
|
+
i7.ReactiveFormsModule,
|
|
783
|
+
i1$1.RouterModule.forChild(routes$1),
|
|
784
|
+
i6.RadioButtonModule,
|
|
785
|
+
i5$1.ButtonModule,
|
|
786
|
+
i8.InputTextModule,
|
|
787
|
+
i4$2.DropdownModule,
|
|
788
|
+
],
|
|
789
|
+
}]
|
|
790
|
+
}] });
|
|
791
|
+
|
|
792
|
+
var FLOW_CUSTOMIZATION = new i0.InjectionToken('FLOW_CUSTOMIZATION');
|
|
793
|
+
|
|
794
|
+
var LegacyProductComponent = /** @class */ (function () {
|
|
795
|
+
function LegacyProductComponent(route, quoteService, quoteApiService, contextService, runtimeContextService, runtimeService, currentStateService, customizationService) {
|
|
796
|
+
this.route = route;
|
|
797
|
+
this.quoteService = quoteService;
|
|
798
|
+
this.quoteApiService = quoteApiService;
|
|
799
|
+
this.contextService = contextService;
|
|
800
|
+
this.runtimeContextService = runtimeContextService;
|
|
801
|
+
this.runtimeService = runtimeService;
|
|
802
|
+
this.currentStateService = currentStateService;
|
|
803
|
+
this.customizationService = customizationService;
|
|
804
|
+
this.destroyed$ = new rxjs.Subject();
|
|
805
|
+
}
|
|
806
|
+
LegacyProductComponent.prototype.ngOnInit = function () {
|
|
807
|
+
var _this = this;
|
|
808
|
+
this.quoteService.quote$
|
|
809
|
+
.pipe(operators.first(), operators.takeUntil(this.destroyed$))
|
|
810
|
+
.subscribe(function (quote) { return _this.init(quote, _this.route.snapshot.queryParams); });
|
|
811
|
+
this.runtimeService.onSolutionStopEvent.pipe(operators.take(1)).subscribe(function (lineItem) { return _this.onSolutionStop(lineItem); });
|
|
812
|
+
this.runtimeService.onSolutionReadyEvent.pipe(operators.take(1)).subscribe(function (event) { return _this.onSolutionReady(event); });
|
|
813
|
+
this.runtimeService.onSolutionCancelEvent.pipe(operators.take(1)).subscribe(function () { return _this.onSolutionCancel(); });
|
|
814
|
+
};
|
|
815
|
+
LegacyProductComponent.prototype.ngOnDestroy = function () {
|
|
816
|
+
this.destroyed$.next();
|
|
817
|
+
this.destroyed$.complete();
|
|
818
|
+
};
|
|
819
|
+
LegacyProductComponent.prototype.onSolutionReady = function (lineItem) {
|
|
820
|
+
var _a;
|
|
821
|
+
lineItem.actionCode = (_a = lineItem.actionCode) !== null && _a !== void 0 ? _a : 'ADD';
|
|
822
|
+
};
|
|
823
|
+
LegacyProductComponent.prototype.onSolutionCancel = function () {
|
|
824
|
+
this.quoteService.quote$.pipe(operators.first(), operators.takeUntil(this.destroyed$)).subscribe(function (quote) {
|
|
825
|
+
window['VELO_BACK_FN'].apply(null, [quote.quoteId]);
|
|
826
|
+
});
|
|
827
|
+
};
|
|
828
|
+
LegacyProductComponent.prototype.onSolutionUpdated = function (lineItem) {
|
|
829
|
+
var states = {
|
|
830
|
+
configurableRamp: lineItem,
|
|
831
|
+
currentState: this.currentStateService.currentState,
|
|
832
|
+
asset: this.getAsset(lineItem),
|
|
736
833
|
};
|
|
737
|
-
|
|
738
|
-
|
|
834
|
+
this.runtimeService.updateRuntime(states);
|
|
835
|
+
};
|
|
836
|
+
LegacyProductComponent.prototype.onSolutionStop = function (lineItem) {
|
|
837
|
+
var _this = this;
|
|
838
|
+
this.quoteService.quote$.pipe(operators.first(), operators.takeUntil(this.destroyed$)).subscribe(function (quote) {
|
|
839
|
+
var quoteToUpsert = Object.assign(Object.assign({}, quote), { context: _this.contextService.resolve(), currentState: __spreadArray(__spreadArray([], __read((_this.currentStateService.currentState || []).filter(function (li) { return li.id !== lineItem.id; }))), [lineItem]) });
|
|
840
|
+
_this.quoteApiService
|
|
841
|
+
.upsertQuote(quoteToUpsert)
|
|
842
|
+
.pipe(operators.take(1))
|
|
843
|
+
.subscribe(function (quote) {
|
|
739
844
|
window['VELO_BACK_FN'].apply(null, [quote.quoteId]);
|
|
740
845
|
});
|
|
846
|
+
});
|
|
847
|
+
};
|
|
848
|
+
LegacyProductComponent.prototype.init = function (quote, queryParams) {
|
|
849
|
+
var productId = queryParams['productId'];
|
|
850
|
+
var lineItemId = this.getLineItemId(quote, queryParams);
|
|
851
|
+
this.assets = quote.initialState;
|
|
852
|
+
lineItemId && quote.currentState ? this.reConfigure(lineItemId, quote.currentState) : this.configure(productId);
|
|
853
|
+
};
|
|
854
|
+
LegacyProductComponent.prototype.getLineItemId = function (quote, queryParams) {
|
|
855
|
+
if (core.EntityUtil.isPresent(queryParams['lineItemId'])) {
|
|
856
|
+
return queryParams['lineItemId'];
|
|
857
|
+
}
|
|
858
|
+
return quote.currentState
|
|
859
|
+
.filter(function (lineItem) { return lineItem.productId === queryParams['productId']; })
|
|
860
|
+
.map(function (lineItem) { return lineItem.id; })
|
|
861
|
+
.find(function (id) { return id; });
|
|
862
|
+
};
|
|
863
|
+
LegacyProductComponent.prototype.configure = function (productId) {
|
|
864
|
+
var runtimeContext = this.getRuntimeContext(productId, '', i2.RuntimeOperation.INIT);
|
|
865
|
+
this.startRuntime({}, runtimeContext);
|
|
866
|
+
};
|
|
867
|
+
LegacyProductComponent.prototype.reConfigure = function (lineItemId, currentState) {
|
|
868
|
+
var currentStateItem = core.EntityUtil.findById(lineItemId, currentState);
|
|
869
|
+
var runtimeContext = this.getRuntimeContext(currentStateItem.productId, currentStateItem.offeringId, i2.RuntimeOperation.UPDATE);
|
|
870
|
+
var states = {
|
|
871
|
+
configurableRamp: currentStateItem,
|
|
872
|
+
currentState: currentState,
|
|
873
|
+
asset: this.getAsset(currentStateItem),
|
|
741
874
|
};
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
});
|
|
761
|
-
};
|
|
762
|
-
LegacyProductComponent.prototype.init = function (quote, queryParams) {
|
|
763
|
-
var productId = queryParams['productId'];
|
|
764
|
-
var lineItemId = this.getLineItemId(quote, queryParams);
|
|
765
|
-
this.assets = quote.initialState;
|
|
766
|
-
lineItemId && quote.currentState ? this.reConfigure(lineItemId, quote.currentState) : this.configure(productId);
|
|
767
|
-
};
|
|
768
|
-
LegacyProductComponent.prototype.getLineItemId = function (quote, queryParams) {
|
|
769
|
-
if (core.EntityUtil.isPresent(queryParams['lineItemId'])) {
|
|
770
|
-
return queryParams['lineItemId'];
|
|
771
|
-
}
|
|
772
|
-
return quote.currentState
|
|
773
|
-
.filter(function (lineItem) { return lineItem.productId === queryParams['productId']; })
|
|
774
|
-
.map(function (lineItem) { return lineItem.id; })
|
|
775
|
-
.find(function (id) { return id; });
|
|
776
|
-
};
|
|
777
|
-
LegacyProductComponent.prototype.configure = function (productId) {
|
|
778
|
-
var runtimeContext = this.getRuntimeContext(productId, '', i2.RuntimeOperation.INIT);
|
|
779
|
-
this.startRuntime({}, runtimeContext);
|
|
780
|
-
};
|
|
781
|
-
LegacyProductComponent.prototype.reConfigure = function (lineItemId, currentState) {
|
|
782
|
-
var currentStateItem = core.EntityUtil.findById(lineItemId, currentState);
|
|
783
|
-
var runtimeContext = this.getRuntimeContext(currentStateItem.productId, currentStateItem.offeringId, i2.RuntimeOperation.UPDATE);
|
|
784
|
-
var states = {
|
|
785
|
-
configurableRamp: currentStateItem,
|
|
786
|
-
currentState: currentState,
|
|
787
|
-
asset: this.getAsset(currentStateItem),
|
|
788
|
-
};
|
|
789
|
-
this.currentStateService.update(currentState);
|
|
790
|
-
this.startRuntime(states, runtimeContext);
|
|
791
|
-
};
|
|
792
|
-
LegacyProductComponent.prototype.getAsset = function (lineItem) {
|
|
793
|
-
return this.assets && this.assets.find(function (a) { return a.id === lineItem.openOrderLineItemId || a.id === lineItem.assetId; });
|
|
794
|
-
};
|
|
795
|
-
LegacyProductComponent.prototype.startRuntime = function (states, runtimeContext$) {
|
|
796
|
-
var _this = this;
|
|
797
|
-
runtimeContext$
|
|
798
|
-
.pipe(operators.take(1), operators.map(function (runtimeContext) {
|
|
799
|
-
_this.runtimeService.startRuntime(runtimeContext, states);
|
|
800
|
-
}))
|
|
801
|
-
.subscribe();
|
|
802
|
-
};
|
|
803
|
-
LegacyProductComponent.prototype.customizeContext = function (productId, context) {
|
|
804
|
-
var _a;
|
|
805
|
-
if (!((_a = this.customizationService) === null || _a === void 0 ? void 0 : _a.getLegacyUiDefinition)) {
|
|
806
|
-
return rxjs.of(context);
|
|
807
|
-
}
|
|
808
|
-
return this.customizationService.getLegacyUiDefinition(productId).pipe(operators.map(function (uiDef) { return (Object.assign(Object.assign({}, context), { uiDefinition: uiDef !== null && uiDef !== void 0 ? uiDef : context.uiDefinition })); }));
|
|
809
|
-
};
|
|
810
|
-
LegacyProductComponent.prototype.getRuntimeContext = function (productId, offeringId, runtimeOperation) {
|
|
811
|
-
var _this = this;
|
|
812
|
-
return this.runtimeContextService.getRuntimeContext(productId, offeringId).pipe(operators.map(function (runtimeContext) {
|
|
813
|
-
runtimeContext.invocationContext = { runtimeOperation: i2.RuntimeOperation[runtimeOperation] };
|
|
814
|
-
return runtimeContext;
|
|
815
|
-
}), operators.switchMap(function (runtimeContext) { return _this.customizeContext(productId, runtimeContext); }));
|
|
816
|
-
};
|
|
817
|
-
return LegacyProductComponent;
|
|
818
|
-
}());
|
|
819
|
-
LegacyProductComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: LegacyProductComponent, deps: [{ token: i1__namespace.ActivatedRoute }, { token: i2__namespace.QuoteService }, { token: i1__namespace$1.QuoteApiService }, { token: i2__namespace.ContextService }, { token: i2__namespace.RuntimeContextService }, { token: i2__namespace.RuntimeService }, { token: i2__namespace.CurrentStateService }, { token: FLOW_CUSTOMIZATION, optional: true }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
820
|
-
LegacyProductComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: LegacyProductComponent, selector: "ng-component", ngImport: i0__namespace, template: "<vl-runtime #runtimeView (solutionUpdated)=\"onSolutionUpdated($event)\"></vl-runtime>\n", styles: [":host{display:block;height:100%}\n"], components: [{ type: i2__namespace.RuntimeComponent, selector: "vl-runtime", outputs: ["solutionUpdated"] }] });
|
|
821
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: LegacyProductComponent, decorators: [{
|
|
822
|
-
type: i0.Component,
|
|
823
|
-
args: [{
|
|
824
|
-
templateUrl: './legacy-product.component.html',
|
|
825
|
-
styleUrls: ['./legacy-product.component.scss'],
|
|
826
|
-
}]
|
|
827
|
-
}], ctorParameters: function () {
|
|
828
|
-
return [{ type: i1__namespace.ActivatedRoute }, { type: i2__namespace.QuoteService }, { type: i1__namespace$1.QuoteApiService }, { type: i2__namespace.ContextService }, { type: i2__namespace.RuntimeContextService }, { type: i2__namespace.RuntimeService }, { type: i2__namespace.CurrentStateService }, { type: undefined, decorators: [{
|
|
829
|
-
type: i0.Optional
|
|
830
|
-
}, {
|
|
831
|
-
type: i0.Inject,
|
|
832
|
-
args: [FLOW_CUSTOMIZATION]
|
|
833
|
-
}] }];
|
|
834
|
-
} });
|
|
835
|
-
|
|
836
|
-
var LegacyProductModule = /** @class */ (function () {
|
|
837
|
-
function LegacyProductModule() {
|
|
875
|
+
this.currentStateService.update(currentState);
|
|
876
|
+
this.startRuntime(states, runtimeContext);
|
|
877
|
+
};
|
|
878
|
+
LegacyProductComponent.prototype.getAsset = function (lineItem) {
|
|
879
|
+
return this.assets && this.assets.find(function (a) { return a.id === lineItem.openOrderLineItemId || a.id === lineItem.assetId; });
|
|
880
|
+
};
|
|
881
|
+
LegacyProductComponent.prototype.startRuntime = function (states, runtimeContext$) {
|
|
882
|
+
var _this = this;
|
|
883
|
+
runtimeContext$
|
|
884
|
+
.pipe(operators.take(1), operators.map(function (runtimeContext) {
|
|
885
|
+
_this.runtimeService.startRuntime(runtimeContext, states);
|
|
886
|
+
}))
|
|
887
|
+
.subscribe();
|
|
888
|
+
};
|
|
889
|
+
LegacyProductComponent.prototype.customizeContext = function (productId, context) {
|
|
890
|
+
var _a;
|
|
891
|
+
if (!((_a = this.customizationService) === null || _a === void 0 ? void 0 : _a.getLegacyUiDefinition)) {
|
|
892
|
+
return rxjs.of(context);
|
|
838
893
|
}
|
|
839
|
-
return
|
|
840
|
-
}
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
894
|
+
return this.customizationService.getLegacyUiDefinition(productId).pipe(operators.map(function (uiDef) { return (Object.assign(Object.assign({}, context), { uiDefinition: uiDef !== null && uiDef !== void 0 ? uiDef : context.uiDefinition })); }));
|
|
895
|
+
};
|
|
896
|
+
LegacyProductComponent.prototype.getRuntimeContext = function (productId, offeringId, runtimeOperation) {
|
|
897
|
+
var _this = this;
|
|
898
|
+
return this.runtimeContextService.getRuntimeContext(productId, offeringId).pipe(operators.map(function (runtimeContext) {
|
|
899
|
+
runtimeContext.invocationContext = { runtimeOperation: i2.RuntimeOperation[runtimeOperation] };
|
|
900
|
+
return runtimeContext;
|
|
901
|
+
}), operators.switchMap(function (runtimeContext) { return _this.customizeContext(productId, runtimeContext); }));
|
|
902
|
+
};
|
|
903
|
+
return LegacyProductComponent;
|
|
904
|
+
}());
|
|
905
|
+
LegacyProductComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: LegacyProductComponent, deps: [{ token: i1__namespace$1.ActivatedRoute }, { token: i2__namespace.QuoteService }, { token: i1__namespace.QuoteApiService }, { token: i2__namespace.ContextService }, { token: i2__namespace.RuntimeContextService }, { token: i2__namespace.RuntimeService }, { token: i2__namespace.CurrentStateService }, { token: FLOW_CUSTOMIZATION, optional: true }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
906
|
+
LegacyProductComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: LegacyProductComponent, selector: "ng-component", ngImport: i0__namespace, template: "<vl-runtime #runtimeView (solutionUpdated)=\"onSolutionUpdated($event)\"></vl-runtime>\n", styles: [":host{display:block;height:100%}\n"], components: [{ type: i2__namespace.RuntimeComponent, selector: "vl-runtime", outputs: ["solutionUpdated"] }] });
|
|
907
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: LegacyProductComponent, decorators: [{
|
|
908
|
+
type: i0.Component,
|
|
909
|
+
args: [{
|
|
910
|
+
templateUrl: './legacy-product.component.html',
|
|
911
|
+
styleUrls: ['./legacy-product.component.scss'],
|
|
912
|
+
}]
|
|
913
|
+
}], ctorParameters: function () {
|
|
914
|
+
return [{ type: i1__namespace$1.ActivatedRoute }, { type: i2__namespace.QuoteService }, { type: i1__namespace.QuoteApiService }, { type: i2__namespace.ContextService }, { type: i2__namespace.RuntimeContextService }, { type: i2__namespace.RuntimeService }, { type: i2__namespace.CurrentStateService }, { type: undefined, decorators: [{
|
|
915
|
+
type: i0.Optional
|
|
916
|
+
}, {
|
|
917
|
+
type: i0.Inject,
|
|
918
|
+
args: [FLOW_CUSTOMIZATION]
|
|
919
|
+
}] }];
|
|
920
|
+
} });
|
|
852
921
|
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
922
|
+
var LegacyProductModule = /** @class */ (function () {
|
|
923
|
+
function LegacyProductModule() {
|
|
924
|
+
}
|
|
925
|
+
return LegacyProductModule;
|
|
926
|
+
}());
|
|
927
|
+
LegacyProductModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: LegacyProductModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
|
|
928
|
+
LegacyProductModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: LegacyProductModule, declarations: [LegacyProductComponent], imports: [i4.CommonModule, i2.RuntimeModule, i1__namespace$2.TooltipModule], exports: [LegacyProductComponent] });
|
|
929
|
+
LegacyProductModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: LegacyProductModule, imports: [[i4.CommonModule, i2.RuntimeModule, i1$2.TooltipModule.forRoot()]] });
|
|
930
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: LegacyProductModule, decorators: [{
|
|
931
|
+
type: i0.NgModule,
|
|
932
|
+
args: [{
|
|
933
|
+
declarations: [LegacyProductComponent],
|
|
934
|
+
imports: [i4.CommonModule, i2.RuntimeModule, i1$2.TooltipModule.forRoot()],
|
|
935
|
+
exports: [LegacyProductComponent],
|
|
936
|
+
}]
|
|
937
|
+
}] });
|
|
938
|
+
|
|
939
|
+
var ProductComponent = /** @class */ (function () {
|
|
940
|
+
function ProductComponent(runtimeService, conigurationService, quoteService, route, messageService, customizationService) {
|
|
941
|
+
this.runtimeService = runtimeService;
|
|
942
|
+
this.conigurationService = conigurationService;
|
|
943
|
+
this.quoteService = quoteService;
|
|
944
|
+
this.route = route;
|
|
945
|
+
this.messageService = messageService;
|
|
946
|
+
this.customizationService = customizationService;
|
|
947
|
+
this.destroy$ = new rxjs.Subject();
|
|
948
|
+
this.state$ = new rxjs.BehaviorSubject({ loading: true, failure: false });
|
|
949
|
+
}
|
|
950
|
+
ProductComponent.prototype.ngOnInit = function () {
|
|
951
|
+
var _this = this;
|
|
952
|
+
this.quoteService.quote$
|
|
953
|
+
.pipe(rxjs.first(), rxjs.takeUntil(this.destroy$))
|
|
954
|
+
.subscribe(function (quote) { return _this.init(quote, _this.route.snapshot.queryParams); });
|
|
955
|
+
};
|
|
956
|
+
ProductComponent.prototype.ngOnDestroy = function () {
|
|
957
|
+
this.destroy$.next();
|
|
958
|
+
this.destroy$.complete();
|
|
959
|
+
};
|
|
960
|
+
ProductComponent.prototype.customize = function (productId) {
|
|
961
|
+
var _this = this;
|
|
962
|
+
var _a;
|
|
963
|
+
if (!((_a = this.customizationService) === null || _a === void 0 ? void 0 : _a.getUiDefinition)) {
|
|
964
|
+
return rxjs.of(null);
|
|
863
965
|
}
|
|
864
|
-
|
|
865
|
-
var _this = this;
|
|
866
|
-
this.quoteService.quote$
|
|
867
|
-
.pipe(rxjs.first(), rxjs.takeUntil(this.destroy$))
|
|
868
|
-
.subscribe(function (quote) { return _this.init(quote, _this.route.snapshot.queryParams); });
|
|
869
|
-
};
|
|
870
|
-
ProductComponent.prototype.ngOnDestroy = function () {
|
|
871
|
-
this.destroy$.next();
|
|
872
|
-
this.destroy$.complete();
|
|
873
|
-
};
|
|
874
|
-
ProductComponent.prototype.customize = function (productId) {
|
|
875
|
-
var _this = this;
|
|
876
|
-
var _a;
|
|
877
|
-
if (!((_a = this.customizationService) === null || _a === void 0 ? void 0 : _a.getUiDefinition)) {
|
|
878
|
-
return rxjs.of(null);
|
|
879
|
-
}
|
|
880
|
-
return this.customizationService.getUiDefinition(productId).pipe(rxjs.tap(function (uiDef) {
|
|
881
|
-
var _a;
|
|
882
|
-
if (uiDef) {
|
|
883
|
-
_this.uiDefinition = uiDef;
|
|
884
|
-
_this.runtimeService.uiDefinitionProperties = (_a = uiDef.properties) !== null && _a !== void 0 ? _a : {};
|
|
885
|
-
}
|
|
886
|
-
}));
|
|
887
|
-
};
|
|
888
|
-
ProductComponent.prototype.init = function (quote, queryParams) {
|
|
889
|
-
var _this = this;
|
|
966
|
+
return this.customizationService.getUiDefinition(productId).pipe(rxjs.tap(function (uiDef) {
|
|
890
967
|
var _a;
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
var offeringId = (currentStateItem !== null && currentStateItem !== void 0 ? currentStateItem : {}).offeringId;
|
|
895
|
-
if (currentStateItem) {
|
|
896
|
-
this.conigurationService.updateCurrentStates({
|
|
897
|
-
configurableRamp: currentStateItem,
|
|
898
|
-
currentState: quote.currentState,
|
|
899
|
-
});
|
|
900
|
-
}
|
|
901
|
-
this.runtimeService
|
|
902
|
-
.init({ productId: productId, offeringId: offeringId })
|
|
903
|
-
.pipe(rxjs.tap(function (context) { return (_this.uiDefinition = context === null || context === void 0 ? void 0 : context.uiDefinition); }), rxjs.switchMap(function () { return _this.customize(productId); }), rxjs.switchMap(function () { return _this.conigurationService.configure(); }), rxjs.tap(function () { return _this.state$.next({ loading: false, failure: false }); }), rxjs.catchError(function (error) {
|
|
904
|
-
var _a, _b;
|
|
905
|
-
if (!((_b = (_a = _this.uiDefinition) === null || _a === void 0 ? void 0 : _a.properties) === null || _b === void 0 ? void 0 : _b.suppressToastMessages)) {
|
|
906
|
-
_this.messageService.add({ severity: 'error', summary: error });
|
|
907
|
-
}
|
|
908
|
-
_this.state$.next({ loading: false, failure: true });
|
|
909
|
-
return rxjs.of();
|
|
910
|
-
}), rxjs.takeUntil(this.destroy$))
|
|
911
|
-
.subscribe();
|
|
912
|
-
};
|
|
913
|
-
ProductComponent.prototype.getLineItemId = function (quote, queryParams) {
|
|
914
|
-
if (core.EntityUtil.isPresent(queryParams['lineItemId'])) {
|
|
915
|
-
return queryParams['lineItemId'];
|
|
968
|
+
if (uiDef) {
|
|
969
|
+
_this.uiDefinition = uiDef;
|
|
970
|
+
_this.runtimeService.uiDefinitionProperties = (_a = uiDef.properties) !== null && _a !== void 0 ? _a : {};
|
|
916
971
|
}
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
styleUrls: ['./product.component.scss'],
|
|
932
|
-
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
933
|
-
}]
|
|
934
|
-
}], ctorParameters: function () {
|
|
935
|
-
return [{ type: i1__namespace$3.ConfigurationRuntimeService }, { type: i1__namespace$3.ConfigurationService }, { type: i2__namespace.QuoteService }, { type: i1__namespace.ActivatedRoute }, { type: i4__namespace$1.MessageService }, { type: undefined, decorators: [{
|
|
936
|
-
type: i0.Optional
|
|
937
|
-
}, {
|
|
938
|
-
type: i0.Inject,
|
|
939
|
-
args: [FLOW_CUSTOMIZATION]
|
|
940
|
-
}] }];
|
|
941
|
-
} });
|
|
942
|
-
|
|
943
|
-
var ProductModule = /** @class */ (function () {
|
|
944
|
-
function ProductModule() {
|
|
972
|
+
}));
|
|
973
|
+
};
|
|
974
|
+
ProductComponent.prototype.init = function (quote, queryParams) {
|
|
975
|
+
var _this = this;
|
|
976
|
+
var _a;
|
|
977
|
+
var lineItemId = this.getLineItemId(quote, queryParams);
|
|
978
|
+
var currentStateItem = core.EntityUtil.findById(lineItemId, quote.currentState);
|
|
979
|
+
var productId = (_a = currentStateItem === null || currentStateItem === void 0 ? void 0 : currentStateItem.productId) !== null && _a !== void 0 ? _a : queryParams['productId'];
|
|
980
|
+
var offeringId = (currentStateItem !== null && currentStateItem !== void 0 ? currentStateItem : {}).offeringId;
|
|
981
|
+
if (currentStateItem) {
|
|
982
|
+
this.conigurationService.updateCurrentStates({
|
|
983
|
+
configurableRamp: currentStateItem,
|
|
984
|
+
currentState: quote.currentState,
|
|
985
|
+
});
|
|
945
986
|
}
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
type: i0.NgModule,
|
|
953
|
-
args: [{
|
|
954
|
-
declarations: [ProductComponent],
|
|
955
|
-
imports: [i5.CommonModule, i1$3.PreviewModule, i2$1.LoaderModule],
|
|
956
|
-
exports: [ProductComponent],
|
|
957
|
-
}]
|
|
958
|
-
}] });
|
|
959
|
-
|
|
960
|
-
var RecordNotFoundComponent = /** @class */ (function () {
|
|
961
|
-
function RecordNotFoundComponent(router, route) {
|
|
962
|
-
this.router = router;
|
|
963
|
-
this.route = route;
|
|
964
|
-
this.subMessage = '';
|
|
965
|
-
var navigation = this.router.getCurrentNavigation();
|
|
966
|
-
var state = ((navigation === null || navigation === void 0 ? void 0 : navigation.extras) || {}).state;
|
|
967
|
-
this.message = state === null || state === void 0 ? void 0 : state.message;
|
|
968
|
-
if (typeof this.message === 'string') {
|
|
969
|
-
this.subMessage = this.message.includes('/describe') ? 'A potential problem with permissions' : '';
|
|
987
|
+
this.runtimeService
|
|
988
|
+
.init({ productId: productId, offeringId: offeringId })
|
|
989
|
+
.pipe(rxjs.tap(function (context) { return (_this.uiDefinition = context === null || context === void 0 ? void 0 : context.uiDefinition); }), rxjs.switchMap(function () { return _this.customize(productId); }), rxjs.switchMap(function () { return _this.conigurationService.configure(); }), rxjs.tap(function () { return _this.state$.next({ loading: false, failure: false }); }), rxjs.catchError(function (error) {
|
|
990
|
+
var _a, _b;
|
|
991
|
+
if (!((_b = (_a = _this.uiDefinition) === null || _a === void 0 ? void 0 : _a.properties) === null || _b === void 0 ? void 0 : _b.suppressToastMessages)) {
|
|
992
|
+
_this.messageService.add({ severity: 'error', summary: error });
|
|
970
993
|
}
|
|
994
|
+
_this.state$.next({ loading: false, failure: true });
|
|
995
|
+
return rxjs.of();
|
|
996
|
+
}), rxjs.takeUntil(this.destroy$))
|
|
997
|
+
.subscribe();
|
|
998
|
+
};
|
|
999
|
+
ProductComponent.prototype.getLineItemId = function (quote, queryParams) {
|
|
1000
|
+
if (core.EntityUtil.isPresent(queryParams['lineItemId'])) {
|
|
1001
|
+
return queryParams['lineItemId'];
|
|
971
1002
|
}
|
|
972
|
-
return
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
declarations: [RecordNotFoundComponent],
|
|
998
|
-
imports: [i5.CommonModule, i1.RouterModule.forChild(routes)],
|
|
999
|
-
}]
|
|
1000
|
-
}] });
|
|
1003
|
+
return quote.currentState
|
|
1004
|
+
.filter(function (lineItem) { return lineItem.productId === queryParams['productId']; })
|
|
1005
|
+
.map(function (lineItem) { return lineItem.id; })
|
|
1006
|
+
.find(function (id) { return id; });
|
|
1007
|
+
};
|
|
1008
|
+
return ProductComponent;
|
|
1009
|
+
}());
|
|
1010
|
+
ProductComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: ProductComponent, deps: [{ token: i1__namespace$3.ConfigurationRuntimeService }, { token: i1__namespace$3.ConfigurationService }, { token: i2__namespace.QuoteService }, { token: i1__namespace$1.ActivatedRoute }, { token: i4__namespace$1.MessageService }, { token: FLOW_CUSTOMIZATION, optional: true }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
1011
|
+
ProductComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: ProductComponent, selector: "vl-flow-product", ngImport: i0__namespace, 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: i2__namespace$1.LoaderComponent, selector: "vl-loader", inputs: ["label", "overlayVisible"] }, { type: i1__namespace$3.PreviewComponent, selector: "vl-cms-preview", inputs: ["modelId", "uiDefinition", "clearState"] }], directives: [{ type: i4__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "async": i4__namespace.AsyncPipe }, changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
|
|
1012
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: ProductComponent, decorators: [{
|
|
1013
|
+
type: i0.Component,
|
|
1014
|
+
args: [{
|
|
1015
|
+
selector: 'vl-flow-product',
|
|
1016
|
+
templateUrl: './product.component.html',
|
|
1017
|
+
styleUrls: ['./product.component.scss'],
|
|
1018
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
1019
|
+
}]
|
|
1020
|
+
}], ctorParameters: function () {
|
|
1021
|
+
return [{ type: i1__namespace$3.ConfigurationRuntimeService }, { type: i1__namespace$3.ConfigurationService }, { type: i2__namespace.QuoteService }, { type: i1__namespace$1.ActivatedRoute }, { type: i4__namespace$1.MessageService }, { type: undefined, decorators: [{
|
|
1022
|
+
type: i0.Optional
|
|
1023
|
+
}, {
|
|
1024
|
+
type: i0.Inject,
|
|
1025
|
+
args: [FLOW_CUSTOMIZATION]
|
|
1026
|
+
}] }];
|
|
1027
|
+
} });
|
|
1001
1028
|
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
_this.uiDefinition = uiDef;
|
|
1019
|
-
_this.state$.next({ loading: false, failure: false });
|
|
1020
|
-
}), rxjs.catchError(function (err) {
|
|
1021
|
-
_this.uiDefinition = undefined;
|
|
1022
|
-
_this.toastService.add({ severity: i2$1.ToastType.error, summary: 'Failed to resolve Shopping Cart component' });
|
|
1023
|
-
_this.state$.next({ loading: false, failure: true });
|
|
1024
|
-
throw err;
|
|
1025
|
-
}), rxjs.takeUntil(this.destroyed$))
|
|
1026
|
-
.subscribe(function () { return _this.cdr.detectChanges(); });
|
|
1027
|
-
};
|
|
1028
|
-
ShoppingCartComponent.prototype.ngOnDestroy = function () {
|
|
1029
|
-
this.destroyed$.next();
|
|
1030
|
-
this.destroyed$.complete();
|
|
1031
|
-
};
|
|
1032
|
-
ShoppingCartComponent.prototype.getTemplateRootComponent$ = function (template) {
|
|
1033
|
-
return this.templatesApi
|
|
1034
|
-
.fetchComponents$(template.id)
|
|
1035
|
-
.pipe(rxjs.map(function (components) { var _a; return (_a = components.find(function (c) { return c.type === core.UITemplateComponentType.ROOT; })) !== null && _a !== void 0 ? _a : undefined; }));
|
|
1036
|
-
};
|
|
1037
|
-
ShoppingCartComponent.prototype.getShoppingCartComponentMeta$ = function () {
|
|
1038
|
-
var _this = this;
|
|
1039
|
-
return this.templatesApi.fetchTemplates$().pipe(rxjs.map(function (templates) { return templates.filter(function (template) { return template.type === core.UITemplateType.SHOPPING_CART; }).reverse()[0]; }), rxjs.switchMap(function (template) { return (template ? _this.getTemplateRootComponent$(template) : rxjs.of(undefined)); }), rxjs.switchMap(function (component) { return component ? _this.templatesApi.fetchComponentAttachments$(component.uiTemplateId, component) : rxjs.of(undefined); }));
|
|
1040
|
-
};
|
|
1041
|
-
ShoppingCartComponent.prototype.generateUIDefinition$ = function () {
|
|
1042
|
-
return this.getShoppingCartComponentMeta$().pipe(rxjs.map(function (meta) {
|
|
1043
|
-
if (!meta) {
|
|
1044
|
-
return;
|
|
1045
|
-
}
|
|
1046
|
-
var uiDef = {
|
|
1047
|
-
name: '',
|
|
1048
|
-
createdTimestamp: 0,
|
|
1049
|
-
primary: true,
|
|
1050
|
-
type: 'DEFAULT',
|
|
1051
|
-
version: 2,
|
|
1052
|
-
children: [
|
|
1053
|
-
{
|
|
1054
|
-
children: [],
|
|
1055
|
-
template: meta.html && btoa(meta.html),
|
|
1056
|
-
script: meta.js && btoa(meta.js),
|
|
1057
|
-
styles: meta.css && btoa(meta.css),
|
|
1058
|
-
},
|
|
1059
|
-
],
|
|
1060
|
-
};
|
|
1061
|
-
return uiDef;
|
|
1062
|
-
}));
|
|
1063
|
-
};
|
|
1064
|
-
return ShoppingCartComponent;
|
|
1065
|
-
}());
|
|
1066
|
-
ShoppingCartComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: ShoppingCartComponent, deps: [{ token: i1__namespace$1.UITemplatesApiService }, { token: i0__namespace.ChangeDetectorRef }, { token: i2__namespace$1.ToastService }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
1067
|
-
ShoppingCartComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: ShoppingCartComponent, selector: "vl-flow-shopping-cart", ngImport: i0__namespace, 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: i2__namespace$1.LoaderComponent, selector: "vl-loader", inputs: ["label", "overlayVisible"] }, { type: i1__namespace$3.PreviewComponent, selector: "vl-cms-preview", inputs: ["modelId", "uiDefinition", "clearState"] }], directives: [{ type: i5__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "async": i5__namespace.AsyncPipe }, changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
|
|
1068
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: ShoppingCartComponent, decorators: [{
|
|
1069
|
-
type: i0.Component,
|
|
1070
|
-
args: [{
|
|
1071
|
-
selector: 'vl-flow-shopping-cart',
|
|
1072
|
-
templateUrl: './shopping-cart.component.html',
|
|
1073
|
-
styleUrls: ['./shopping-cart.component.scss'],
|
|
1074
|
-
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
1075
|
-
}]
|
|
1076
|
-
}], ctorParameters: function () { return [{ type: i1__namespace$1.UITemplatesApiService }, { type: i0__namespace.ChangeDetectorRef }, { type: i2__namespace$1.ToastService }]; } });
|
|
1029
|
+
var ProductModule = /** @class */ (function () {
|
|
1030
|
+
function ProductModule() {
|
|
1031
|
+
}
|
|
1032
|
+
return ProductModule;
|
|
1033
|
+
}());
|
|
1034
|
+
ProductModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: ProductModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
|
|
1035
|
+
ProductModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: ProductModule, declarations: [ProductComponent], imports: [i4.CommonModule, i1$3.PreviewModule, i2$1.LoaderModule], exports: [ProductComponent] });
|
|
1036
|
+
ProductModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: ProductModule, imports: [[i4.CommonModule, i1$3.PreviewModule, i2$1.LoaderModule]] });
|
|
1037
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: ProductModule, decorators: [{
|
|
1038
|
+
type: i0.NgModule,
|
|
1039
|
+
args: [{
|
|
1040
|
+
declarations: [ProductComponent],
|
|
1041
|
+
imports: [i4.CommonModule, i1$3.PreviewModule, i2$1.LoaderModule],
|
|
1042
|
+
exports: [ProductComponent],
|
|
1043
|
+
}]
|
|
1044
|
+
}] });
|
|
1077
1045
|
|
|
1078
|
-
|
|
1079
|
-
|
|
1046
|
+
var RecordNotFoundComponent = /** @class */ (function () {
|
|
1047
|
+
function RecordNotFoundComponent(router, route) {
|
|
1048
|
+
this.router = router;
|
|
1049
|
+
this.route = route;
|
|
1050
|
+
this.subMessage = '';
|
|
1051
|
+
var navigation = this.router.getCurrentNavigation();
|
|
1052
|
+
var state = ((navigation === null || navigation === void 0 ? void 0 : navigation.extras) || {}).state;
|
|
1053
|
+
this.message = state === null || state === void 0 ? void 0 : state.message;
|
|
1054
|
+
if (typeof this.message === 'string') {
|
|
1055
|
+
this.subMessage = this.message.includes('/describe') ? 'A potential problem with permissions' : '';
|
|
1080
1056
|
}
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1057
|
+
}
|
|
1058
|
+
return RecordNotFoundComponent;
|
|
1059
|
+
}());
|
|
1060
|
+
RecordNotFoundComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: RecordNotFoundComponent, deps: [{ token: i1__namespace$1.Router }, { token: i1__namespace$1.ActivatedRoute }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
1061
|
+
RecordNotFoundComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: RecordNotFoundComponent, selector: "vl-flow-record-not-found", ngImport: i0__namespace, template: "<div class=\"row\">\n <div class=\"col-md-12\">\n <div class=\"message-wrapper\">\n <div class=\"msg\">\n <div *ngIf=\"message; else defaultMessage\" class=\"message-title\">\n <p>{{ message }}</p>\n\n <p *ngIf=\"subMessage\" class=\"message-title\">{{ subMessage }}</p>\n </div>\n\n <ng-template #defaultMessage>Record not found</ng-template>\n </div>\n </div>\n </div>\n</div>\n", directives: [{ type: i4__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
|
|
1062
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: RecordNotFoundComponent, decorators: [{
|
|
1063
|
+
type: i0.Component,
|
|
1064
|
+
args: [{
|
|
1065
|
+
selector: 'vl-flow-record-not-found',
|
|
1066
|
+
templateUrl: './record-not-found.component.html',
|
|
1067
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
1068
|
+
}]
|
|
1069
|
+
}], ctorParameters: function () { return [{ type: i1__namespace$1.Router }, { type: i1__namespace$1.ActivatedRoute }]; } });
|
|
1094
1070
|
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
var currentContext = this.contextService.resolve();
|
|
1112
|
-
if (headerId && (currentContext === null || currentContext === void 0 ? void 0 : currentContext.headerId) === headerId) {
|
|
1113
|
-
return rxjs.of(currentContext);
|
|
1114
|
-
}
|
|
1115
|
-
return this.contextService.create(headerId, mode).pipe(operators.tap(function (context) {
|
|
1116
|
-
_this.contextService.update(Object.assign(Object.assign({}, context), { uiDefinitionId: uiDefinitionId, properties: Object.assign(Object.assign(Object.assign({}, currentContext === null || currentContext === void 0 ? void 0 : currentContext.properties), context.properties), (queryParams !== null && queryParams !== void 0 ? queryParams : {})) }));
|
|
1117
|
-
}), operators.catchError(function (e) {
|
|
1118
|
-
var message = e instanceof http.HttpErrorResponse ? e.error.message : e;
|
|
1119
|
-
_this.handleError(route, message);
|
|
1120
|
-
return rxjs.of(null);
|
|
1121
|
-
}));
|
|
1122
|
-
};
|
|
1123
|
-
return ContextResolver;
|
|
1124
|
-
}());
|
|
1125
|
-
ContextResolver.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: ContextResolver, deps: [{ token: i2__namespace.ContextService }, { token: i1__namespace.Router }, { token: RouterService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
1126
|
-
ContextResolver.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: ContextResolver });
|
|
1127
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: ContextResolver, decorators: [{
|
|
1128
|
-
type: i0.Injectable
|
|
1129
|
-
}], ctorParameters: function () { return [{ type: i2__namespace.ContextService }, { type: i1__namespace.Router }, { type: RouterService }]; } });
|
|
1071
|
+
var routes = [{ path: '', component: RecordNotFoundComponent }];
|
|
1072
|
+
var RecordNotFoundModule = /** @class */ (function () {
|
|
1073
|
+
function RecordNotFoundModule() {
|
|
1074
|
+
}
|
|
1075
|
+
return RecordNotFoundModule;
|
|
1076
|
+
}());
|
|
1077
|
+
RecordNotFoundModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: RecordNotFoundModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
|
|
1078
|
+
RecordNotFoundModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: RecordNotFoundModule, declarations: [RecordNotFoundComponent], imports: [i4.CommonModule, i1__namespace$1.RouterModule] });
|
|
1079
|
+
RecordNotFoundModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: RecordNotFoundModule, imports: [[i4.CommonModule, i1$1.RouterModule.forChild(routes)]] });
|
|
1080
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: RecordNotFoundModule, decorators: [{
|
|
1081
|
+
type: i0.NgModule,
|
|
1082
|
+
args: [{
|
|
1083
|
+
declarations: [RecordNotFoundComponent],
|
|
1084
|
+
imports: [i4.CommonModule, i1$1.RouterModule.forChild(routes)],
|
|
1085
|
+
}]
|
|
1086
|
+
}] });
|
|
1130
1087
|
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
var _this = this;
|
|
1148
|
-
var queryParams = route.queryParams;
|
|
1149
|
-
var flowId = queryParams.flowId;
|
|
1150
|
-
if (!flowId) {
|
|
1151
|
-
return this.handleError(route);
|
|
1088
|
+
var ShoppingCartComponent = /** @class */ (function () {
|
|
1089
|
+
function ShoppingCartComponent(templatesApi, cdr, toastService, customizationService) {
|
|
1090
|
+
this.templatesApi = templatesApi;
|
|
1091
|
+
this.cdr = cdr;
|
|
1092
|
+
this.toastService = toastService;
|
|
1093
|
+
this.customizationService = customizationService;
|
|
1094
|
+
this.uiDefinition = undefined;
|
|
1095
|
+
this.state$ = new rxjs.BehaviorSubject({ loading: true, failure: false });
|
|
1096
|
+
this.destroyed$ = new rxjs.Subject();
|
|
1097
|
+
}
|
|
1098
|
+
ShoppingCartComponent.prototype.ngOnInit = function () {
|
|
1099
|
+
var _this = this;
|
|
1100
|
+
this.generateUIDefinition$()
|
|
1101
|
+
.pipe(rxjs.tap(function (uiDef) {
|
|
1102
|
+
if (!uiDef) {
|
|
1103
|
+
throw 'Not found';
|
|
1152
1104
|
}
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
}], ctorParameters: function () { return [{ type: i1__namespace.Router }, { type: FlowService }, { type: RouterService }]; } });
|
|
1183
|
-
|
|
1184
|
-
var QuoteResolver = /** @class */ (function () {
|
|
1185
|
-
function QuoteResolver(router, quoteService, routerService) {
|
|
1186
|
-
this.router = router;
|
|
1187
|
-
this.quoteService = quoteService;
|
|
1188
|
-
this.routerService = routerService;
|
|
1105
|
+
_this.uiDefinition = uiDef;
|
|
1106
|
+
_this.state$.next({ loading: false, failure: false });
|
|
1107
|
+
}), rxjs.catchError(function (err) {
|
|
1108
|
+
_this.uiDefinition = undefined;
|
|
1109
|
+
_this.toastService.add({ severity: i2$1.ToastType.error, summary: 'Failed to resolve Shopping Cart component' });
|
|
1110
|
+
_this.state$.next({ loading: false, failure: true });
|
|
1111
|
+
throw err;
|
|
1112
|
+
}), rxjs.takeUntil(this.destroyed$))
|
|
1113
|
+
.subscribe(function () { return _this.cdr.detectChanges(); });
|
|
1114
|
+
};
|
|
1115
|
+
ShoppingCartComponent.prototype.ngOnDestroy = function () {
|
|
1116
|
+
this.destroyed$.next();
|
|
1117
|
+
this.destroyed$.complete();
|
|
1118
|
+
};
|
|
1119
|
+
ShoppingCartComponent.prototype.getTemplateRootComponent$ = function (template) {
|
|
1120
|
+
return this.templatesApi
|
|
1121
|
+
.fetchComponents$(template.id)
|
|
1122
|
+
.pipe(rxjs.map(function (components) { var _a; return (_a = components.find(function (c) { return c.type === core.UITemplateComponentType.ROOT; })) !== null && _a !== void 0 ? _a : undefined; }));
|
|
1123
|
+
};
|
|
1124
|
+
ShoppingCartComponent.prototype.getShoppingCartComponentMeta$ = function () {
|
|
1125
|
+
var _this = this;
|
|
1126
|
+
var _a, _b;
|
|
1127
|
+
if ((_a = this.customizationService) === null || _a === void 0 ? void 0 : _a.getShoppingCartComponent) {
|
|
1128
|
+
return (_b = this.customizationService) === null || _b === void 0 ? void 0 : _b.getShoppingCartComponent().pipe(rxjs.map(function (component) { return ({
|
|
1129
|
+
html: component === null || component === void 0 ? void 0 : component.html,
|
|
1130
|
+
css: component === null || component === void 0 ? void 0 : component.css,
|
|
1131
|
+
js: component === null || component === void 0 ? void 0 : component.js,
|
|
1132
|
+
json: component === null || component === void 0 ? void 0 : component.json,
|
|
1133
|
+
}); }));
|
|
1189
1134
|
}
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
var headerId = route.data.headerId;
|
|
1197
|
-
var quote = this.quoteService.getQuote();
|
|
1198
|
-
if (quote && quote.quoteId === headerId) {
|
|
1199
|
-
return rxjs.of(true);
|
|
1135
|
+
return this.templatesApi.fetchTemplates$().pipe(rxjs.map(function (templates) { return templates.filter(function (template) { return template.type === core.UITemplateType.SHOPPING_CART; }).reverse()[0]; }), rxjs.switchMap(function (template) { return (template ? _this.getTemplateRootComponent$(template) : rxjs.of(undefined)); }), rxjs.switchMap(function (component) { return component ? _this.templatesApi.fetchComponentAttachments$(component.uiTemplateId, component) : rxjs.of(undefined); }));
|
|
1136
|
+
};
|
|
1137
|
+
ShoppingCartComponent.prototype.generateUIDefinition$ = function () {
|
|
1138
|
+
return this.getShoppingCartComponentMeta$().pipe(rxjs.map(function (meta) {
|
|
1139
|
+
if (!meta) {
|
|
1140
|
+
return;
|
|
1200
1141
|
}
|
|
1201
|
-
var
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
return QuoteResolver;
|
|
1208
|
-
}());
|
|
1209
|
-
QuoteResolver.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: QuoteResolver, deps: [{ token: i1__namespace.Router }, { token: i2__namespace.QuoteService }, { token: RouterService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
1210
|
-
QuoteResolver.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: QuoteResolver });
|
|
1211
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: QuoteResolver, decorators: [{
|
|
1212
|
-
type: i0.Injectable
|
|
1213
|
-
}], ctorParameters: function () { return [{ type: i1__namespace.Router }, { type: i2__namespace.QuoteService }, { type: RouterService }]; } });
|
|
1214
|
-
|
|
1215
|
-
var rootRoute = {
|
|
1216
|
-
id: VELOCE_FLOW_ROOT_ROUTE,
|
|
1217
|
-
path: '',
|
|
1218
|
-
component: FlowComponent,
|
|
1219
|
-
canActivate: [RootGuard],
|
|
1220
|
-
canDeactivate: [RootGuard],
|
|
1221
|
-
children: [
|
|
1222
|
-
{
|
|
1223
|
-
path: 'flows',
|
|
1224
|
-
runGuardsAndResolvers: 'paramsOrQueryParamsChange',
|
|
1225
|
-
resolve: { quote: FlowResolver },
|
|
1226
|
-
canActivate: [ContextGuard],
|
|
1227
|
-
children: [],
|
|
1228
|
-
},
|
|
1229
|
-
{
|
|
1230
|
-
path: 'legacy',
|
|
1142
|
+
var uiDef = {
|
|
1143
|
+
name: '',
|
|
1144
|
+
createdTimestamp: 0,
|
|
1145
|
+
primary: true,
|
|
1146
|
+
type: 'DEFAULT',
|
|
1147
|
+
version: 2,
|
|
1231
1148
|
children: [
|
|
1232
1149
|
{
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
canActivate: [ContextGuard],
|
|
1150
|
+
children: [],
|
|
1151
|
+
template: meta.html && btoa(meta.html),
|
|
1152
|
+
script: meta.js && btoa(meta.js),
|
|
1153
|
+
styles: meta.css && btoa(meta.css),
|
|
1238
1154
|
},
|
|
1239
1155
|
],
|
|
1156
|
+
};
|
|
1157
|
+
return uiDef;
|
|
1158
|
+
}));
|
|
1159
|
+
};
|
|
1160
|
+
return ShoppingCartComponent;
|
|
1161
|
+
}());
|
|
1162
|
+
ShoppingCartComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: ShoppingCartComponent, deps: [{ token: i1__namespace.UITemplatesApiService }, { token: i0__namespace.ChangeDetectorRef }, { token: i2__namespace$1.ToastService }, { token: FLOW_CUSTOMIZATION, optional: true }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
1163
|
+
ShoppingCartComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: ShoppingCartComponent, selector: "vl-flow-shopping-cart", ngImport: i0__namespace, 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: i2__namespace$1.LoaderComponent, selector: "vl-loader", inputs: ["label", "overlayVisible"] }, { type: i1__namespace$3.PreviewComponent, selector: "vl-cms-preview", inputs: ["modelId", "uiDefinition", "clearState"] }], directives: [{ type: i4__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "async": i4__namespace.AsyncPipe }, changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
|
|
1164
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: ShoppingCartComponent, decorators: [{
|
|
1165
|
+
type: i0.Component,
|
|
1166
|
+
args: [{
|
|
1167
|
+
selector: 'vl-flow-shopping-cart',
|
|
1168
|
+
templateUrl: './shopping-cart.component.html',
|
|
1169
|
+
styleUrls: ['./shopping-cart.component.scss'],
|
|
1170
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
1171
|
+
}]
|
|
1172
|
+
}], ctorParameters: function () {
|
|
1173
|
+
return [{ type: i1__namespace.UITemplatesApiService }, { type: i0__namespace.ChangeDetectorRef }, { type: i2__namespace$1.ToastService }, { type: undefined, decorators: [{
|
|
1174
|
+
type: i0.Optional
|
|
1175
|
+
}, {
|
|
1176
|
+
type: i0.Inject,
|
|
1177
|
+
args: [FLOW_CUSTOMIZATION]
|
|
1178
|
+
}] }];
|
|
1179
|
+
} });
|
|
1180
|
+
|
|
1181
|
+
var ShoppingCartModule = /** @class */ (function () {
|
|
1182
|
+
function ShoppingCartModule() {
|
|
1183
|
+
}
|
|
1184
|
+
return ShoppingCartModule;
|
|
1185
|
+
}());
|
|
1186
|
+
ShoppingCartModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: ShoppingCartModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
|
|
1187
|
+
ShoppingCartModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: ShoppingCartModule, declarations: [ShoppingCartComponent], imports: [i4.CommonModule, i1$3.PreviewModule, i2$1.LoaderModule], exports: [ShoppingCartComponent] });
|
|
1188
|
+
ShoppingCartModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: ShoppingCartModule, imports: [[i4.CommonModule, i1$3.PreviewModule, i2$1.LoaderModule]] });
|
|
1189
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: ShoppingCartModule, decorators: [{
|
|
1190
|
+
type: i0.NgModule,
|
|
1191
|
+
args: [{
|
|
1192
|
+
declarations: [ShoppingCartComponent],
|
|
1193
|
+
imports: [i4.CommonModule, i1$3.PreviewModule, i2$1.LoaderModule],
|
|
1194
|
+
exports: [ShoppingCartComponent],
|
|
1195
|
+
}]
|
|
1196
|
+
}] });
|
|
1197
|
+
|
|
1198
|
+
var ContextResolver = /** @class */ (function () {
|
|
1199
|
+
function ContextResolver(contextService, router, routerService) {
|
|
1200
|
+
this.contextService = contextService;
|
|
1201
|
+
this.router = router;
|
|
1202
|
+
this.routerService = routerService;
|
|
1203
|
+
}
|
|
1204
|
+
ContextResolver.prototype.handleError = function (route, message) {
|
|
1205
|
+
this.contextService.delete();
|
|
1206
|
+
var parentUrl = this.routerService.getFlowRootPath(route);
|
|
1207
|
+
return rxjs.from(this.router.navigate([parentUrl, '404'], { state: { message: message } }));
|
|
1208
|
+
};
|
|
1209
|
+
ContextResolver.prototype.resolve = function (route) {
|
|
1210
|
+
var _this = this;
|
|
1211
|
+
var queryParams = route.queryParams, data = route.data;
|
|
1212
|
+
var uiDefinitionId = queryParams.uiDefinitionId;
|
|
1213
|
+
var _a = data !== null && data !== void 0 ? data : {}, headerId = _a.headerId, mode = _a.mode;
|
|
1214
|
+
var currentContext = this.contextService.resolve();
|
|
1215
|
+
if (headerId && (currentContext === null || currentContext === void 0 ? void 0 : currentContext.headerId) === headerId) {
|
|
1216
|
+
return rxjs.of(currentContext);
|
|
1217
|
+
}
|
|
1218
|
+
return this.contextService.create(headerId, mode).pipe(operators.tap(function (context) {
|
|
1219
|
+
_this.contextService.update(Object.assign(Object.assign({}, context), { uiDefinitionId: uiDefinitionId, properties: Object.assign(Object.assign(Object.assign({}, currentContext === null || currentContext === void 0 ? void 0 : currentContext.properties), context.properties), (queryParams !== null && queryParams !== void 0 ? queryParams : {})) }));
|
|
1220
|
+
}), operators.catchError(function (e) {
|
|
1221
|
+
var message = e instanceof http.HttpErrorResponse ? e.error.message : e;
|
|
1222
|
+
_this.handleError(route, message);
|
|
1223
|
+
return rxjs.of(null);
|
|
1224
|
+
}));
|
|
1225
|
+
};
|
|
1226
|
+
return ContextResolver;
|
|
1227
|
+
}());
|
|
1228
|
+
ContextResolver.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: ContextResolver, deps: [{ token: i2__namespace.ContextService }, { token: i1__namespace$1.Router }, { token: RouterService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
1229
|
+
ContextResolver.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: ContextResolver });
|
|
1230
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: ContextResolver, decorators: [{
|
|
1231
|
+
type: i0.Injectable
|
|
1232
|
+
}], ctorParameters: function () { return [{ type: i2__namespace.ContextService }, { type: i1__namespace$1.Router }, { type: RouterService }]; } });
|
|
1233
|
+
|
|
1234
|
+
var FlowResolver = /** @class */ (function () {
|
|
1235
|
+
function FlowResolver(router, flowService, routerService) {
|
|
1236
|
+
this.router = router;
|
|
1237
|
+
this.flowService = flowService;
|
|
1238
|
+
this.routerService = routerService;
|
|
1239
|
+
}
|
|
1240
|
+
FlowResolver.prototype.handleError = function (route, message, queryParams) {
|
|
1241
|
+
var parentUrl = this.routerService.getFlowRootPath(route);
|
|
1242
|
+
return this.router.navigate([parentUrl, '404'], {
|
|
1243
|
+
queryParams: queryParams,
|
|
1244
|
+
state: {
|
|
1245
|
+
message: message,
|
|
1240
1246
|
},
|
|
1241
|
-
|
|
1242
|
-
path: 'product',
|
|
1243
|
-
component: ProductComponent,
|
|
1244
|
-
runGuardsAndResolvers: 'paramsOrQueryParamsChange',
|
|
1245
|
-
resolve: { context: ContextResolver, quote: QuoteResolver },
|
|
1246
|
-
canActivate: [ContextGuard],
|
|
1247
|
-
data: { showHeader: true },
|
|
1248
|
-
},
|
|
1249
|
-
{
|
|
1250
|
-
path: 'cart',
|
|
1251
|
-
component: ShoppingCartComponent,
|
|
1252
|
-
runGuardsAndResolvers: 'paramsOrQueryParamsChange',
|
|
1253
|
-
resolve: { context: ContextResolver, quote: QuoteResolver },
|
|
1254
|
-
canActivate: [ContextGuard],
|
|
1255
|
-
data: { showHeader: true },
|
|
1256
|
-
},
|
|
1257
|
-
{
|
|
1258
|
-
path: 'debug',
|
|
1259
|
-
loadChildren: function () { return DebugModule; },
|
|
1260
|
-
},
|
|
1261
|
-
{
|
|
1262
|
-
path: '404',
|
|
1263
|
-
loadChildren: function () { return RecordNotFoundModule; },
|
|
1264
|
-
},
|
|
1265
|
-
],
|
|
1247
|
+
});
|
|
1266
1248
|
};
|
|
1267
|
-
|
|
1268
|
-
|
|
1249
|
+
FlowResolver.prototype.resolve = function (route) {
|
|
1250
|
+
var _this = this;
|
|
1251
|
+
var queryParams = route.queryParams;
|
|
1252
|
+
var flowId = queryParams.flowId;
|
|
1253
|
+
if (!flowId) {
|
|
1254
|
+
return this.handleError(route);
|
|
1269
1255
|
}
|
|
1270
|
-
return
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1256
|
+
return this.flowService.getFlow(flowId).pipe(operators.map(function (flow) {
|
|
1257
|
+
if (!flow) {
|
|
1258
|
+
return _this.handleError(route, "Flow with flowId=" + flowId + " is not defined");
|
|
1259
|
+
}
|
|
1260
|
+
var properties = flow.properties;
|
|
1261
|
+
var flowQueryParams = properties.queryParams, entryPath = properties.entryPath;
|
|
1262
|
+
var isProductFlow = entryPath.includes('/product');
|
|
1263
|
+
var mergedParams = Object.assign(Object.assign(Object.assign({}, queryParams), flowQueryParams), Object.assign({}, (isProductFlow && { standalone: true })));
|
|
1264
|
+
var parentUrl = _this.routerService.getFlowRootPath(route);
|
|
1265
|
+
var entryUrl = String(entryPath !== null && entryPath !== void 0 ? entryPath : '')
|
|
1266
|
+
.split('/')
|
|
1267
|
+
.filter(Boolean);
|
|
1268
|
+
return _this.router
|
|
1269
|
+
.navigate(__spreadArray([parentUrl], __read(entryUrl)), {
|
|
1270
|
+
queryParams: mergedParams,
|
|
1271
|
+
replaceUrl: true,
|
|
1272
|
+
})
|
|
1273
|
+
.catch(function (e) {
|
|
1274
|
+
var message = e instanceof http.HttpErrorResponse ? e.error.message : e;
|
|
1275
|
+
return _this.handleError(route, message, mergedParams);
|
|
1276
|
+
});
|
|
1277
|
+
}));
|
|
1278
|
+
};
|
|
1279
|
+
return FlowResolver;
|
|
1280
|
+
}());
|
|
1281
|
+
FlowResolver.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: FlowResolver, deps: [{ token: i1__namespace$1.Router }, { token: FlowService }, { token: RouterService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
1282
|
+
FlowResolver.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: FlowResolver });
|
|
1283
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: FlowResolver, decorators: [{
|
|
1284
|
+
type: i0.Injectable
|
|
1285
|
+
}], ctorParameters: function () { return [{ type: i1__namespace$1.Router }, { type: FlowService }, { type: RouterService }]; } });
|
|
1283
1286
|
|
|
1284
|
-
|
|
1285
|
-
|
|
1287
|
+
var QuoteResolver = /** @class */ (function () {
|
|
1288
|
+
function QuoteResolver(router, quoteService, routerService) {
|
|
1289
|
+
this.router = router;
|
|
1290
|
+
this.quoteService = quoteService;
|
|
1291
|
+
this.routerService = routerService;
|
|
1292
|
+
}
|
|
1293
|
+
QuoteResolver.prototype.handleError = function (route, message) {
|
|
1294
|
+
var parentUrl = this.routerService.getFlowRootPath(route);
|
|
1295
|
+
return rxjs.from(this.router.navigate([parentUrl, '404'], { state: { message: message } }));
|
|
1296
|
+
};
|
|
1297
|
+
QuoteResolver.prototype.resolve = function (route) {
|
|
1298
|
+
var _this = this;
|
|
1299
|
+
var headerId = route.data.headerId;
|
|
1300
|
+
var quote = this.quoteService.getQuote();
|
|
1301
|
+
if (quote && quote.quoteId === headerId) {
|
|
1302
|
+
return rxjs.of(true);
|
|
1286
1303
|
}
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1304
|
+
var queryParams = route.queryParams;
|
|
1305
|
+
return this.quoteService.init(headerId, queryParams).pipe(rxjs.catchError(function (e) {
|
|
1306
|
+
var message = e instanceof http.HttpErrorResponse ? e.error.message : e;
|
|
1307
|
+
return _this.handleError(route, message);
|
|
1308
|
+
}));
|
|
1309
|
+
};
|
|
1310
|
+
return QuoteResolver;
|
|
1311
|
+
}());
|
|
1312
|
+
QuoteResolver.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: QuoteResolver, deps: [{ token: i1__namespace$1.Router }, { token: i2__namespace.QuoteService }, { token: RouterService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
1313
|
+
QuoteResolver.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: QuoteResolver });
|
|
1314
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: QuoteResolver, decorators: [{
|
|
1315
|
+
type: i0.Injectable
|
|
1316
|
+
}], ctorParameters: function () { return [{ type: i1__namespace$1.Router }, { type: i2__namespace.QuoteService }, { type: RouterService }]; } });
|
|
1317
|
+
|
|
1318
|
+
var rootRoute = {
|
|
1319
|
+
id: VELOCE_FLOW_ROOT_ROUTE,
|
|
1320
|
+
path: '',
|
|
1321
|
+
component: FlowComponent,
|
|
1322
|
+
canActivate: [RootGuard],
|
|
1323
|
+
canDeactivate: [RootGuard],
|
|
1324
|
+
children: [
|
|
1325
|
+
{
|
|
1326
|
+
path: 'flows',
|
|
1327
|
+
runGuardsAndResolvers: 'paramsOrQueryParamsChange',
|
|
1328
|
+
resolve: { quote: FlowResolver },
|
|
1329
|
+
canActivate: [ContextGuard],
|
|
1330
|
+
children: [],
|
|
1331
|
+
},
|
|
1332
|
+
{
|
|
1333
|
+
path: 'legacy',
|
|
1334
|
+
children: [
|
|
1335
|
+
{
|
|
1336
|
+
path: 'product',
|
|
1337
|
+
component: LegacyProductComponent,
|
|
1338
|
+
runGuardsAndResolvers: 'paramsOrQueryParamsChange',
|
|
1339
|
+
resolve: { context: ContextResolver, quote: QuoteResolver },
|
|
1340
|
+
canActivate: [ContextGuard],
|
|
1341
|
+
},
|
|
1342
|
+
],
|
|
1343
|
+
},
|
|
1344
|
+
{
|
|
1345
|
+
path: 'product',
|
|
1346
|
+
component: ProductComponent,
|
|
1347
|
+
runGuardsAndResolvers: 'paramsOrQueryParamsChange',
|
|
1348
|
+
resolve: { context: ContextResolver, quote: QuoteResolver },
|
|
1349
|
+
canActivate: [ContextGuard],
|
|
1350
|
+
data: { showHeader: true },
|
|
1351
|
+
},
|
|
1352
|
+
{
|
|
1353
|
+
path: 'cart',
|
|
1354
|
+
component: ShoppingCartComponent,
|
|
1355
|
+
runGuardsAndResolvers: 'paramsOrQueryParamsChange',
|
|
1356
|
+
resolve: { context: ContextResolver, quote: QuoteResolver },
|
|
1357
|
+
canActivate: [ContextGuard],
|
|
1358
|
+
data: { showHeader: true },
|
|
1359
|
+
},
|
|
1360
|
+
{
|
|
1361
|
+
path: 'debug',
|
|
1362
|
+
loadChildren: function () { return DebugModule; },
|
|
1363
|
+
},
|
|
1364
|
+
{
|
|
1365
|
+
path: '404',
|
|
1366
|
+
loadChildren: function () { return RecordNotFoundModule; },
|
|
1367
|
+
},
|
|
1368
|
+
],
|
|
1369
|
+
};
|
|
1370
|
+
var FlowRoutingModule = /** @class */ (function () {
|
|
1371
|
+
function FlowRoutingModule() {
|
|
1372
|
+
}
|
|
1373
|
+
return FlowRoutingModule;
|
|
1374
|
+
}());
|
|
1375
|
+
FlowRoutingModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: FlowRoutingModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
|
|
1376
|
+
FlowRoutingModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: FlowRoutingModule, imports: [i1__namespace$1.RouterModule, ProductModule, LegacyProductModule, ShoppingCartModule], exports: [i1$1.RouterModule] });
|
|
1377
|
+
FlowRoutingModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: FlowRoutingModule, providers: [RouterService, RootGuard, ContextGuard, ContextResolver, FlowResolver, QuoteResolver], imports: [[i1$1.RouterModule.forChild([rootRoute]), ProductModule, LegacyProductModule, ShoppingCartModule], i1$1.RouterModule] });
|
|
1378
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: FlowRoutingModule, decorators: [{
|
|
1379
|
+
type: i0.NgModule,
|
|
1380
|
+
args: [{
|
|
1381
|
+
imports: [i1$1.RouterModule.forChild([rootRoute]), ProductModule, LegacyProductModule, ShoppingCartModule],
|
|
1382
|
+
exports: [i1$1.RouterModule],
|
|
1383
|
+
providers: [RouterService, RootGuard, ContextGuard, ContextResolver, FlowResolver, QuoteResolver],
|
|
1384
|
+
}]
|
|
1385
|
+
}] });
|
|
1386
|
+
|
|
1387
|
+
var FlowModule = /** @class */ (function () {
|
|
1388
|
+
function FlowModule() {
|
|
1389
|
+
}
|
|
1390
|
+
return FlowModule;
|
|
1391
|
+
}());
|
|
1392
|
+
FlowModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: FlowModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
|
|
1393
|
+
FlowModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: FlowModule, declarations: [FlowComponent], imports: [i4.CommonModule, FlowRoutingModule, i1.ApiModule, i1$3.LauncherModule, i2$1.LoaderModule, FlowHeaderModule] });
|
|
1394
|
+
FlowModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: FlowModule, providers: [FlowService, i2.ContextService], imports: [[i4.CommonModule, FlowRoutingModule, i1.ApiModule, i1$3.LauncherModule, i2$1.LoaderModule, FlowHeaderModule]] });
|
|
1395
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: FlowModule, decorators: [{
|
|
1396
|
+
type: i0.NgModule,
|
|
1397
|
+
args: [{
|
|
1398
|
+
declarations: [FlowComponent],
|
|
1399
|
+
imports: [i4.CommonModule, FlowRoutingModule, i1.ApiModule, i1$3.LauncherModule, i2$1.LoaderModule, FlowHeaderModule],
|
|
1400
|
+
providers: [FlowService, i2.ContextService],
|
|
1401
|
+
}]
|
|
1402
|
+
}] });
|
|
1300
1403
|
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1404
|
+
/**
|
|
1405
|
+
* Generated bundle index. Do not edit.
|
|
1406
|
+
*/
|
|
1304
1407
|
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1408
|
+
exports.ContextGuard = ContextGuard;
|
|
1409
|
+
exports.FLOW_CUSTOMIZATION = FLOW_CUSTOMIZATION;
|
|
1410
|
+
exports.FlowModule = FlowModule;
|
|
1411
|
+
exports.FlowService = FlowService;
|
|
1412
|
+
exports.VELOCE_FLOW_ROOT_ROUTE = VELOCE_FLOW_ROOT_ROUTE;
|
|
1413
|
+
exports.getFlowObjectIdPropertyName = getFlowObjectIdPropertyName;
|
|
1310
1414
|
|
|
1311
|
-
|
|
1415
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
1312
1416
|
|
|
1313
1417
|
}));
|
|
1314
1418
|
//# sourceMappingURL=veloce-sdk.umd.js.map
|