@veloceapps/sdk 8.0.0-102 → 8.0.0-103
Sign up to get free protection for your applications and to get access to all the features.
- package/cms/utils/index.d.ts +1 -0
- package/core/services/flow-info.service.d.ts +4 -2
- package/core/services/flow-state.service.d.ts +6 -3
- package/core/types/flow-customization.types.d.ts +22 -0
- package/core/types/index.d.ts +1 -0
- package/esm2020/cms/utils/index.mjs +2 -1
- package/esm2020/core/services/flow-info.service.mjs +20 -8
- package/esm2020/core/services/flow-state.service.mjs +32 -11
- package/esm2020/core/types/flow-customization.types.mjs +3 -0
- package/esm2020/core/types/index.mjs +2 -1
- package/esm2020/src/components/doc-gen/doc-gen.component.mjs +14 -25
- package/esm2020/src/components/flow-header/flow-header.component.mjs +16 -26
- package/esm2020/src/components/guided-selling/guided-selling.component.mjs +16 -26
- package/esm2020/src/pages/assets/assets.component.mjs +20 -29
- package/esm2020/src/pages/catalog/catalog.component.mjs +20 -28
- package/esm2020/src/pages/product/product.component.mjs +2 -3
- package/esm2020/src/pages/shopping-cart/shopping-cart.component.mjs +21 -29
- package/esm2020/src/types/index.mjs +1 -2
- package/fesm2015/veloceapps-sdk-cms.mjs +1 -1
- package/fesm2015/veloceapps-sdk-core.mjs +60 -20
- package/fesm2015/veloceapps-sdk-core.mjs.map +1 -1
- package/fesm2015/veloceapps-sdk.mjs +92 -171
- package/fesm2015/veloceapps-sdk.mjs.map +1 -1
- package/fesm2020/veloceapps-sdk-cms.mjs +1 -1
- package/fesm2020/veloceapps-sdk-core.mjs +69 -37
- package/fesm2020/veloceapps-sdk-core.mjs.map +1 -1
- package/fesm2020/veloceapps-sdk.mjs +92 -171
- package/fesm2020/veloceapps-sdk.mjs.map +1 -1
- package/package.json +1 -1
- package/src/components/doc-gen/doc-gen.component.d.ts +3 -5
- package/src/components/flow-header/flow-header.component.d.ts +3 -5
- package/src/components/guided-selling/guided-selling.component.d.ts +3 -5
- package/src/pages/assets/assets.component.d.ts +3 -5
- package/src/pages/catalog/catalog.component.d.ts +3 -5
- package/src/pages/product/product.component.d.ts +1 -2
- package/src/pages/shopping-cart/shopping-cart.component.d.ts +3 -5
- package/src/types/index.d.ts +0 -1
- package/esm2020/src/types/flow-customization.types.mjs +0 -3
- package/src/types/flow-customization.types.d.ts +0 -12
@@ -1,22 +1,22 @@
|
|
1
1
|
import * as i4 from '@angular/common';
|
2
2
|
import { CommonModule } from '@angular/common';
|
3
3
|
import * as i0 from '@angular/core';
|
4
|
-
import { Component, ChangeDetectionStrategy, NgModule,
|
4
|
+
import { Component, ChangeDetectionStrategy, NgModule, Optional, Inject, Injectable, inject } from '@angular/core';
|
5
5
|
import * as i1$1 from '@veloceapps/api';
|
6
6
|
import { ApiModule } from '@veloceapps/api';
|
7
7
|
import * as i2$1 from '@veloceapps/components';
|
8
8
|
import { ToastType, LoaderModule, EmptyStateModule, LetDirectiveModule } from '@veloceapps/components';
|
9
9
|
import * as i5 from '@veloceapps/sdk/cms';
|
10
|
-
import { extractElementMetadata, extendElementMetadata, PreviewModule, FlowAction, LauncherModule } from '@veloceapps/sdk/cms';
|
10
|
+
import { extractElementMetadata, extendElementMetadata, btoaSafe, PreviewModule, FlowAction, LauncherModule } from '@veloceapps/sdk/cms';
|
11
11
|
import * as i2 from '@veloceapps/sdk/core';
|
12
|
-
import { ContextService, FlowStateService, FlowInfoService, QuoteDraftService, ConfigurationService, IntegrationState, SdkCoreModule } from '@veloceapps/sdk/core';
|
12
|
+
import { FLOW_CUSTOMIZATION, ContextService, FlowStateService, FlowInfoService, QuoteDraftService, ConfigurationService, IntegrationState, SdkCoreModule } from '@veloceapps/sdk/core';
|
13
13
|
import * as i3 from 'primeng/button';
|
14
14
|
import { ButtonModule } from 'primeng/button';
|
15
15
|
import * as i1 from 'primeng/dynamicdialog';
|
16
|
-
import { BehaviorSubject, Subject, filter, first, tap, takeUntil, catchError, of, map, switchMap,
|
16
|
+
import { BehaviorSubject, Subject, filter, first, tap, takeUntil, catchError, of, map, switchMap, shareReplay, startWith, distinctUntilChanged, from, take, combineLatest, forkJoin, throwError } from 'rxjs';
|
17
17
|
import * as i1$2 from '@angular/router';
|
18
18
|
import { NavigationEnd, NavigationStart, NavigationCancel, NavigationError, RouterModule } from '@angular/router';
|
19
|
-
import { SalesforceIdUtils, ConfigurationContextMode,
|
19
|
+
import { SalesforceIdUtils, ConfigurationContextMode, UUID } from '@veloceapps/core';
|
20
20
|
import { HttpErrorResponse, HttpParams } from '@angular/common/http';
|
21
21
|
import * as i5$1 from '@angular/forms';
|
22
22
|
import { FormGroup, FormControl, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
@@ -75,36 +75,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
|
|
75
75
|
}]
|
76
76
|
}] });
|
77
77
|
|
78
|
-
function btoaSafe(str) {
|
79
|
-
if (!str) {
|
80
|
-
return '';
|
81
|
-
}
|
82
|
-
try {
|
83
|
-
const encoder = new TextEncoder();
|
84
|
-
const charCodes = encoder.encode(str);
|
85
|
-
return window.btoa(String.fromCharCode(...charCodes)) || '';
|
86
|
-
}
|
87
|
-
catch (e) {
|
88
|
-
return '';
|
89
|
-
}
|
90
|
-
}
|
91
|
-
function atobSafe(str) {
|
92
|
-
if (!str) {
|
93
|
-
return '';
|
94
|
-
}
|
95
|
-
try {
|
96
|
-
const binary = window.atob(str);
|
97
|
-
const bytes = Uint8Array.from({ length: binary.length }, (_, index) => binary.charCodeAt(index));
|
98
|
-
const decoder = new TextDecoder('utf-8');
|
99
|
-
return decoder.decode(bytes);
|
100
|
-
}
|
101
|
-
catch (e) {
|
102
|
-
return '';
|
103
|
-
}
|
104
|
-
}
|
105
|
-
|
106
|
-
const FLOW_CUSTOMIZATION = new InjectionToken('FLOW_CUSTOMIZATION');
|
107
|
-
|
108
78
|
class DocGenComponent {
|
109
79
|
constructor(templatesApi, contextService, flowStateService, flowInfo, toastService, customizationService) {
|
110
80
|
this.templatesApi = templatesApi;
|
@@ -143,15 +113,12 @@ class DocGenComponent {
|
|
143
113
|
}), takeUntil(this.destroy$))
|
144
114
|
.subscribe();
|
145
115
|
}
|
146
|
-
|
147
|
-
return this.templatesApi.fetchComponents$(template.id);
|
148
|
-
}
|
149
|
-
getLocalTemplateComponentMeta$() {
|
116
|
+
getLocalMeta$() {
|
150
117
|
var _a, _b;
|
151
|
-
if (!((_a = this.customizationService) === null || _a === void 0 ? void 0 : _a.
|
118
|
+
if (!((_a = this.customizationService) === null || _a === void 0 ? void 0 : _a.getTemplateComponents)) {
|
152
119
|
return of(undefined);
|
153
120
|
}
|
154
|
-
return (_b = this.customizationService) === null || _b === void 0 ? void 0 : _b.
|
121
|
+
return (_b = this.customizationService) === null || _b === void 0 ? void 0 : _b.getTemplateComponents(this.templateApiName).pipe(map(components => {
|
155
122
|
if (!components) {
|
156
123
|
return;
|
157
124
|
}
|
@@ -163,30 +130,24 @@ class DocGenComponent {
|
|
163
130
|
}));
|
164
131
|
}));
|
165
132
|
}
|
166
|
-
|
133
|
+
getOrgMeta$() {
|
167
134
|
const template = this.flowInfo.templates.DOCGEN;
|
168
135
|
if (!template) {
|
169
136
|
return of(undefined);
|
170
137
|
}
|
171
|
-
return this.
|
172
|
-
? forkJoin([
|
173
|
-
...components.map(component => {
|
174
|
-
return this.templatesApi.fetchComponentAttachments$(component.uiTemplateId, component);
|
175
|
-
}),
|
176
|
-
])
|
177
|
-
: of(undefined)));
|
138
|
+
return this.templatesApi.fetchComponentsAttachments$(template.id);
|
178
139
|
}
|
179
140
|
generateUIDefinition$() {
|
180
141
|
return of(undefined).pipe(tap(() => {
|
181
142
|
if (!this.templateApiName) {
|
182
|
-
throw new Error("Flow
|
143
|
+
throw new Error("Flow 'docGen' template is not defined.");
|
183
144
|
}
|
184
|
-
}), switchMap(() => this.
|
145
|
+
}), switchMap(() => this.getLocalMeta$()), switchMap(metaList => (metaList ? of(metaList) : this.getOrgMeta$())), map(metaList => {
|
185
146
|
var _a, _b;
|
186
|
-
if (!
|
147
|
+
if (!metaList) {
|
187
148
|
return;
|
188
149
|
}
|
189
|
-
const meta = (_a =
|
150
|
+
const meta = (_a = metaList === null || metaList === void 0 ? void 0 : metaList[0]) !== null && _a !== void 0 ? _a : metaList;
|
190
151
|
const headerId = (_b = this.contextService.resolve().properties.Id) !== null && _b !== void 0 ? _b : null;
|
191
152
|
let script = meta.js;
|
192
153
|
if (script) {
|
@@ -201,7 +162,7 @@ class DocGenComponent {
|
|
201
162
|
primary: true,
|
202
163
|
type: 'DEFAULT',
|
203
164
|
version: 2,
|
204
|
-
children:
|
165
|
+
children: metaList.map(child => ({
|
205
166
|
children: [],
|
206
167
|
template: child.html && btoaSafe(child.html),
|
207
168
|
script: child.js && btoaSafe(child.js),
|
@@ -277,15 +238,12 @@ class GuidedSellingComponent {
|
|
277
238
|
}), takeUntil(this.destroy$))
|
278
239
|
.subscribe();
|
279
240
|
}
|
280
|
-
|
281
|
-
return this.templatesApi.fetchComponents$(template.id);
|
282
|
-
}
|
283
|
-
getLocalTemplateComponentMeta$() {
|
241
|
+
getLocalMeta$() {
|
284
242
|
var _a, _b;
|
285
|
-
if (!((_a = this.customizationService) === null || _a === void 0 ? void 0 : _a.
|
243
|
+
if (!((_a = this.customizationService) === null || _a === void 0 ? void 0 : _a.getTemplateComponents)) {
|
286
244
|
return of(undefined);
|
287
245
|
}
|
288
|
-
return (_b = this.customizationService) === null || _b === void 0 ? void 0 : _b.
|
246
|
+
return (_b = this.customizationService) === null || _b === void 0 ? void 0 : _b.getTemplateComponents(this.templateApiName).pipe(map(components => {
|
289
247
|
if (!components) {
|
290
248
|
return;
|
291
249
|
}
|
@@ -297,26 +255,20 @@ class GuidedSellingComponent {
|
|
297
255
|
}));
|
298
256
|
}));
|
299
257
|
}
|
300
|
-
|
258
|
+
getOrgMeta$() {
|
301
259
|
const template = this.flowInfo.templates.GUIDED_SELLING;
|
302
260
|
if (!template) {
|
303
261
|
return of(undefined);
|
304
262
|
}
|
305
|
-
return this.
|
306
|
-
? forkJoin([
|
307
|
-
...components.map(component => {
|
308
|
-
return this.templatesApi.fetchComponentAttachments$(component.uiTemplateId, component);
|
309
|
-
}),
|
310
|
-
])
|
311
|
-
: of(undefined)));
|
263
|
+
return this.templatesApi.fetchComponentsAttachments$(template.id);
|
312
264
|
}
|
313
265
|
generateUIDefinition$() {
|
314
266
|
return of(undefined).pipe(tap(() => {
|
315
267
|
if (!this.templateApiName) {
|
316
|
-
throw new Error("Flow
|
268
|
+
throw new Error("Flow 'guidedSelling' template is not defined.");
|
317
269
|
}
|
318
|
-
}), switchMap(() => this.
|
319
|
-
if (!
|
270
|
+
}), switchMap(() => this.getLocalMeta$()), switchMap(metaList => (metaList ? of(metaList) : this.getOrgMeta$())), map(metaList => {
|
271
|
+
if (!metaList) {
|
320
272
|
return;
|
321
273
|
}
|
322
274
|
const uiDef = {
|
@@ -325,11 +277,11 @@ class GuidedSellingComponent {
|
|
325
277
|
primary: true,
|
326
278
|
type: 'DEFAULT',
|
327
279
|
version: 2,
|
328
|
-
children:
|
280
|
+
children: metaList.map(meta => ({
|
329
281
|
children: [],
|
330
|
-
template:
|
331
|
-
script:
|
332
|
-
styles:
|
282
|
+
template: meta.html && btoaSafe(meta.html),
|
283
|
+
script: meta.js && btoaSafe(meta.js),
|
284
|
+
styles: meta.css && btoaSafe(meta.css),
|
333
285
|
})),
|
334
286
|
};
|
335
287
|
return uiDef;
|
@@ -401,15 +353,12 @@ class FlowHeaderComponent {
|
|
401
353
|
}), takeUntil(this.destroy$))
|
402
354
|
.subscribe();
|
403
355
|
}
|
404
|
-
|
405
|
-
return this.templatesApi.fetchComponents$(template.id);
|
406
|
-
}
|
407
|
-
getLocalTemplateComponentMeta$() {
|
356
|
+
getLocalMeta$() {
|
408
357
|
var _a, _b;
|
409
|
-
if (!((_a = this.customizationService) === null || _a === void 0 ? void 0 : _a.
|
358
|
+
if (!((_a = this.customizationService) === null || _a === void 0 ? void 0 : _a.getTemplateComponents)) {
|
410
359
|
return of(undefined);
|
411
360
|
}
|
412
|
-
return (_b = this.customizationService) === null || _b === void 0 ? void 0 : _b.
|
361
|
+
return (_b = this.customizationService) === null || _b === void 0 ? void 0 : _b.getTemplateComponents(this.templateApiName).pipe(map(components => {
|
413
362
|
if (!components) {
|
414
363
|
return;
|
415
364
|
}
|
@@ -421,26 +370,20 @@ class FlowHeaderComponent {
|
|
421
370
|
}));
|
422
371
|
}));
|
423
372
|
}
|
424
|
-
|
373
|
+
getOrgMeta$() {
|
425
374
|
const template = this.flowInfo.templates.FLOW_HEADER;
|
426
375
|
if (!template) {
|
427
376
|
return of(undefined);
|
428
377
|
}
|
429
|
-
return this.
|
430
|
-
? forkJoin([
|
431
|
-
...components.map(component => {
|
432
|
-
return this.templatesApi.fetchComponentAttachments$(component.uiTemplateId, component);
|
433
|
-
}),
|
434
|
-
])
|
435
|
-
: of(undefined)));
|
378
|
+
return this.templatesApi.fetchComponentsAttachments$(template.id);
|
436
379
|
}
|
437
380
|
generateUIDefinition$() {
|
438
381
|
return of(undefined).pipe(tap(() => {
|
439
382
|
if (!this.templateApiName) {
|
440
|
-
throw new Error("Flow
|
383
|
+
throw new Error("Flow 'flowHeader' template is not defined.");
|
441
384
|
}
|
442
|
-
}), switchMap(() => this.
|
443
|
-
if (!
|
385
|
+
}), switchMap(() => this.getLocalMeta$()), switchMap(metaList => (metaList ? of(metaList) : this.getOrgMeta$())), map(metaList => {
|
386
|
+
if (!metaList) {
|
444
387
|
return;
|
445
388
|
}
|
446
389
|
const uiDef = {
|
@@ -449,11 +392,11 @@ class FlowHeaderComponent {
|
|
449
392
|
primary: true,
|
450
393
|
type: 'DEFAULT',
|
451
394
|
version: 2,
|
452
|
-
children:
|
395
|
+
children: metaList.map(meta => ({
|
453
396
|
children: [],
|
454
|
-
template:
|
455
|
-
script:
|
456
|
-
styles:
|
397
|
+
template: meta.html && btoaSafe(meta.html),
|
398
|
+
script: meta.js && btoaSafe(meta.js),
|
399
|
+
styles: meta.css && btoaSafe(meta.css),
|
457
400
|
})),
|
458
401
|
};
|
459
402
|
return uiDef;
|
@@ -1163,43 +1106,37 @@ class AssetsComponent {
|
|
1163
1106
|
this.destroyed$.next();
|
1164
1107
|
this.destroyed$.complete();
|
1165
1108
|
}
|
1166
|
-
|
1167
|
-
return this.templatesApi
|
1168
|
-
.fetchComponents$(template.id)
|
1169
|
-
.pipe(map(components => { var _a; return (_a = components.find(c => c.type === UITemplateComponentType.ROOT)) !== null && _a !== void 0 ? _a : undefined; }));
|
1170
|
-
}
|
1171
|
-
getLocalAssetsComponentMeta$() {
|
1109
|
+
getLocalMeta$() {
|
1172
1110
|
var _a, _b;
|
1173
|
-
if (!((_a = this.customizationService) === null || _a === void 0 ? void 0 : _a.
|
1111
|
+
if (!((_a = this.customizationService) === null || _a === void 0 ? void 0 : _a.getTemplateComponents)) {
|
1174
1112
|
return of(undefined);
|
1175
1113
|
}
|
1176
|
-
return (_b = this.customizationService) === null || _b === void 0 ? void 0 : _b.
|
1177
|
-
if (!
|
1114
|
+
return (_b = this.customizationService) === null || _b === void 0 ? void 0 : _b.getTemplateComponents(this.templateApiName).pipe(map(components => {
|
1115
|
+
if (!components) {
|
1178
1116
|
return;
|
1179
1117
|
}
|
1180
|
-
return {
|
1118
|
+
return components.map(component => ({
|
1181
1119
|
html: component.html,
|
1182
1120
|
css: component.css,
|
1183
1121
|
js: component.js,
|
1184
1122
|
json: component.json,
|
1185
|
-
};
|
1123
|
+
}));
|
1186
1124
|
}));
|
1187
1125
|
}
|
1188
|
-
|
1189
|
-
// No Assets template at the moment
|
1126
|
+
getOrgMeta$() {
|
1190
1127
|
const template = this.flowInfo.templates.SHOPPING_CART;
|
1191
1128
|
if (!template) {
|
1192
1129
|
return of(undefined);
|
1193
1130
|
}
|
1194
|
-
return this.
|
1131
|
+
return this.templatesApi.fetchComponentsAttachments$(template.id);
|
1195
1132
|
}
|
1196
1133
|
generateUIDefinition$() {
|
1197
1134
|
return of(undefined).pipe(tap(() => {
|
1198
1135
|
if (!this.templateApiName) {
|
1199
|
-
throw new Error("Flow
|
1136
|
+
throw new Error("Flow 'assets' template is not defined.");
|
1200
1137
|
}
|
1201
|
-
}), switchMap(() => this.
|
1202
|
-
if (!
|
1138
|
+
}), switchMap(() => this.getLocalMeta$()), switchMap(metaList => (metaList ? of(metaList) : this.getOrgMeta$())), map(metaList => {
|
1139
|
+
if (!metaList) {
|
1203
1140
|
return;
|
1204
1141
|
}
|
1205
1142
|
const uiDef = {
|
@@ -1208,14 +1145,12 @@ class AssetsComponent {
|
|
1208
1145
|
primary: true,
|
1209
1146
|
type: 'DEFAULT',
|
1210
1147
|
version: 2,
|
1211
|
-
children:
|
1212
|
-
|
1213
|
-
|
1214
|
-
|
1215
|
-
|
1216
|
-
|
1217
|
-
},
|
1218
|
-
],
|
1148
|
+
children: metaList.map(meta => ({
|
1149
|
+
children: [],
|
1150
|
+
template: meta.html && btoaSafe(meta.html),
|
1151
|
+
script: meta.js && btoaSafe(meta.js),
|
1152
|
+
styles: meta.css && btoaSafe(meta.css),
|
1153
|
+
})),
|
1219
1154
|
};
|
1220
1155
|
return uiDef;
|
1221
1156
|
}));
|
@@ -1285,42 +1220,37 @@ class CatalogComponent {
|
|
1285
1220
|
this.destroyed$.next();
|
1286
1221
|
this.destroyed$.complete();
|
1287
1222
|
}
|
1288
|
-
|
1289
|
-
return this.templatesApi
|
1290
|
-
.fetchComponents$(template.id)
|
1291
|
-
.pipe(map(components => { var _a; return (_a = components.find(c => c.type === UITemplateComponentType.ROOT)) !== null && _a !== void 0 ? _a : undefined; }));
|
1292
|
-
}
|
1293
|
-
getLocalCatalogComponentMeta$() {
|
1223
|
+
getLocalMeta$() {
|
1294
1224
|
var _a, _b;
|
1295
|
-
if (!((_a = this.customizationService) === null || _a === void 0 ? void 0 : _a.
|
1225
|
+
if (!((_a = this.customizationService) === null || _a === void 0 ? void 0 : _a.getTemplateComponents)) {
|
1296
1226
|
return of(undefined);
|
1297
1227
|
}
|
1298
|
-
return (_b = this.customizationService) === null || _b === void 0 ? void 0 : _b.
|
1299
|
-
if (!
|
1228
|
+
return (_b = this.customizationService) === null || _b === void 0 ? void 0 : _b.getTemplateComponents(this.templateApiName).pipe(map(components => {
|
1229
|
+
if (!components) {
|
1300
1230
|
return;
|
1301
1231
|
}
|
1302
|
-
return {
|
1232
|
+
return components.map(component => ({
|
1303
1233
|
html: component.html,
|
1304
1234
|
css: component.css,
|
1305
1235
|
js: component.js,
|
1306
1236
|
json: component.json,
|
1307
|
-
};
|
1237
|
+
}));
|
1308
1238
|
}));
|
1309
1239
|
}
|
1310
|
-
|
1240
|
+
getOrgMeta$() {
|
1311
1241
|
const template = this.flowInfo.templates.CATALOG;
|
1312
1242
|
if (!template) {
|
1313
1243
|
return of(undefined);
|
1314
1244
|
}
|
1315
|
-
return this.
|
1245
|
+
return this.templatesApi.fetchComponentsAttachments$(template.id);
|
1316
1246
|
}
|
1317
1247
|
generateUIDefinition$() {
|
1318
1248
|
return of(undefined).pipe(tap(() => {
|
1319
1249
|
if (!this.templateApiName) {
|
1320
|
-
throw new Error("Flow
|
1250
|
+
throw new Error("Flow 'catalog' template is not defined.");
|
1321
1251
|
}
|
1322
|
-
}), switchMap(() => this.
|
1323
|
-
if (!
|
1252
|
+
}), switchMap(() => this.getLocalMeta$()), switchMap(metaList => (metaList ? of(metaList) : this.getOrgMeta$())), map(metaList => {
|
1253
|
+
if (!metaList) {
|
1324
1254
|
return;
|
1325
1255
|
}
|
1326
1256
|
const uiDef = {
|
@@ -1329,14 +1259,12 @@ class CatalogComponent {
|
|
1329
1259
|
primary: true,
|
1330
1260
|
type: 'DEFAULT',
|
1331
1261
|
version: 2,
|
1332
|
-
children:
|
1333
|
-
|
1334
|
-
|
1335
|
-
|
1336
|
-
|
1337
|
-
|
1338
|
-
},
|
1339
|
-
],
|
1262
|
+
children: metaList.map(meta => ({
|
1263
|
+
children: [],
|
1264
|
+
template: meta.html && btoaSafe(meta.html),
|
1265
|
+
script: meta.js && btoaSafe(meta.js),
|
1266
|
+
styles: meta.css && btoaSafe(meta.css),
|
1267
|
+
})),
|
1340
1268
|
};
|
1341
1269
|
return uiDef;
|
1342
1270
|
}));
|
@@ -1966,7 +1894,7 @@ class ShoppingCartComponent {
|
|
1966
1894
|
this.state$.next({ loading: false, failure: false });
|
1967
1895
|
}), catchError(err => {
|
1968
1896
|
var _a;
|
1969
|
-
const message = 'Failed to resolve Shopping
|
1897
|
+
const message = 'Failed to resolve Shopping Cart component. ' + ((_a = err.message) !== null && _a !== void 0 ? _a : '');
|
1970
1898
|
this.toastService.add({ severity: ToastType.error, summary: message, sticky: true });
|
1971
1899
|
this.uiDefinition = undefined;
|
1972
1900
|
this.state$.next({ loading: false, failure: true });
|
@@ -1978,42 +1906,37 @@ class ShoppingCartComponent {
|
|
1978
1906
|
this.destroyed$.next();
|
1979
1907
|
this.destroyed$.complete();
|
1980
1908
|
}
|
1981
|
-
|
1982
|
-
return this.templatesApi
|
1983
|
-
.fetchComponents$(template.id)
|
1984
|
-
.pipe(map(components => { var _a; return (_a = components.find(c => c.type === UITemplateComponentType.ROOT)) !== null && _a !== void 0 ? _a : undefined; }));
|
1985
|
-
}
|
1986
|
-
getLocalShoppingCartComponentMeta$() {
|
1909
|
+
getLocalMeta$() {
|
1987
1910
|
var _a, _b;
|
1988
|
-
if (!((_a = this.customizationService) === null || _a === void 0 ? void 0 : _a.
|
1911
|
+
if (!((_a = this.customizationService) === null || _a === void 0 ? void 0 : _a.getTemplateComponents)) {
|
1989
1912
|
return of(undefined);
|
1990
1913
|
}
|
1991
|
-
return (_b = this.customizationService) === null || _b === void 0 ? void 0 : _b.
|
1992
|
-
if (!
|
1914
|
+
return (_b = this.customizationService) === null || _b === void 0 ? void 0 : _b.getTemplateComponents(this.templateApiName).pipe(map(components => {
|
1915
|
+
if (!components) {
|
1993
1916
|
return;
|
1994
1917
|
}
|
1995
|
-
return {
|
1918
|
+
return components.map(component => ({
|
1996
1919
|
html: component.html,
|
1997
1920
|
css: component.css,
|
1998
1921
|
js: component.js,
|
1999
1922
|
json: component.json,
|
2000
|
-
};
|
1923
|
+
}));
|
2001
1924
|
}));
|
2002
1925
|
}
|
2003
|
-
|
1926
|
+
getOrgMeta$() {
|
2004
1927
|
const template = this.flowInfo.templates.SHOPPING_CART;
|
2005
1928
|
if (!template) {
|
2006
1929
|
return of(undefined);
|
2007
1930
|
}
|
2008
|
-
return this.
|
1931
|
+
return this.templatesApi.fetchComponentsAttachments$(template.id);
|
2009
1932
|
}
|
2010
1933
|
generateUIDefinition$() {
|
2011
1934
|
return of(undefined).pipe(tap(() => {
|
2012
1935
|
if (!this.templateApiName) {
|
2013
|
-
throw new Error("Flow
|
1936
|
+
throw new Error("Flow 'shoppingCart' template is not defined.");
|
2014
1937
|
}
|
2015
|
-
}), switchMap(() => this.
|
2016
|
-
if (!
|
1938
|
+
}), switchMap(() => this.getLocalMeta$()), switchMap(metaList => (metaList ? of(metaList) : this.getOrgMeta$())), map(metaList => {
|
1939
|
+
if (!metaList) {
|
2017
1940
|
return;
|
2018
1941
|
}
|
2019
1942
|
const uiDef = {
|
@@ -2022,14 +1945,12 @@ class ShoppingCartComponent {
|
|
2022
1945
|
primary: true,
|
2023
1946
|
type: 'DEFAULT',
|
2024
1947
|
version: 2,
|
2025
|
-
children:
|
2026
|
-
|
2027
|
-
|
2028
|
-
|
2029
|
-
|
2030
|
-
|
2031
|
-
},
|
2032
|
-
],
|
1948
|
+
children: metaList.map(meta => ({
|
1949
|
+
children: [],
|
1950
|
+
template: meta.html && btoaSafe(meta.html),
|
1951
|
+
script: meta.js && btoaSafe(meta.js),
|
1952
|
+
styles: meta.css && btoaSafe(meta.css),
|
1953
|
+
})),
|
2033
1954
|
};
|
2034
1955
|
return uiDef;
|
2035
1956
|
}));
|
@@ -2378,5 +2299,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
|
|
2378
2299
|
* Generated bundle index. Do not edit.
|
2379
2300
|
*/
|
2380
2301
|
|
2381
|
-
export { ContextGuard,
|
2302
|
+
export { ContextGuard, FlowDialogService, FlowModule, FlowRouterService, FlowService, VELOCE_FLOW_ROOT_ROUTE, getDefaultProperties, getFlowObjectIdPropertyName };
|
2382
2303
|
//# sourceMappingURL=veloceapps-sdk.mjs.map
|