@veloceapps/sdk 7.0.2-0 → 7.0.2-10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cms/modules/federated/federated.component.d.ts +1 -0
- package/cms/utils/ui-definition.utils.d.ts +0 -1
- package/cms/vendor-map.d.ts +2 -0
- package/core/utils/line-item.utils.d.ts +2 -0
- package/esm2020/cms/modules/federated/federated.component.mjs +13 -2
- package/esm2020/cms/utils/ui-definition.utils.mjs +3 -17
- package/esm2020/core/utils/line-item.utils.mjs +22 -10
- package/esm2020/src/components/header/header.component.mjs +15 -3
- package/fesm2015/veloceapps-sdk-cms.mjs +15 -19
- package/fesm2015/veloceapps-sdk-cms.mjs.map +1 -1
- package/fesm2015/veloceapps-sdk-core.mjs +24 -10
- package/fesm2015/veloceapps-sdk-core.mjs.map +1 -1
- package/fesm2015/veloceapps-sdk.mjs +15 -2
- package/fesm2015/veloceapps-sdk.mjs.map +1 -1
- package/fesm2020/veloceapps-sdk-cms.mjs +15 -19
- package/fesm2020/veloceapps-sdk-cms.mjs.map +1 -1
- package/fesm2020/veloceapps-sdk-core.mjs +24 -10
- package/fesm2020/veloceapps-sdk-core.mjs.map +1 -1
- package/fesm2020/veloceapps-sdk.mjs +14 -2
- package/fesm2020/veloceapps-sdk.mjs.map +1 -1
- package/package.json +1 -1
@@ -323,19 +323,31 @@ const getRecommendedPrices = (portDomain, type) => {
|
|
323
323
|
const generateModifiedAssetsMap = (lineItems) => {
|
324
324
|
return lineItems.reduce((acc, li) => {
|
325
325
|
var _a;
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
}
|
326
|
+
const isModified = isLineItemModified(li);
|
327
|
+
if (!isModified) {
|
328
|
+
return acc;
|
329
|
+
}
|
330
|
+
const target = getOriginParent(lineItems, li);
|
331
|
+
const id = (_a = target === null || target === void 0 ? void 0 : target.assetId) !== null && _a !== void 0 ? _a : target === null || target === void 0 ? void 0 : target.openOrderLineItemId;
|
332
|
+
if (id) {
|
333
|
+
acc[id] = true;
|
335
334
|
}
|
336
335
|
return acc;
|
337
336
|
}, {});
|
338
337
|
};
|
338
|
+
const getOriginParent = (lineItems, currentLineItem) => {
|
339
|
+
let target = currentLineItem;
|
340
|
+
while (target && target.rampInstanceId) {
|
341
|
+
target = lineItems.find(sub => sub.id === currentLineItem.rampInstanceId);
|
342
|
+
}
|
343
|
+
return target;
|
344
|
+
};
|
345
|
+
const isLineItemModified = (lineItem) => {
|
346
|
+
if (lineItem.status === 'PENDING' && lineItem.actionCode === 'EXIST') {
|
347
|
+
return false;
|
348
|
+
}
|
349
|
+
return lineItem.status !== 'EXIST';
|
350
|
+
};
|
339
351
|
const multiplyLineItems = (lineItem, qty, split) => {
|
340
352
|
if (split) {
|
341
353
|
const unifyIds = (lineItem) => (Object.assign(Object.assign({}, lineItem), { id: UUID.UUID(), lineItems: lineItem.lineItems.map(unifyIds) }));
|
@@ -357,8 +369,10 @@ var lineItem_utils = /*#__PURE__*/Object.freeze({
|
|
357
369
|
generateModifiedAssetsMap: generateModifiedAssetsMap,
|
358
370
|
getAttributeValue: getAttributeValue,
|
359
371
|
getAttributes: getAttributes,
|
372
|
+
getOriginParent: getOriginParent,
|
360
373
|
getRecommendedPrices: getRecommendedPrices,
|
361
374
|
insertLineItem: insertLineItem,
|
375
|
+
isLineItemModified: isLineItemModified,
|
362
376
|
mapAttributes: mapAttributes,
|
363
377
|
multiplyLineItems: multiplyLineItems,
|
364
378
|
patchAttributes: patchAttributes,
|
@@ -1228,5 +1242,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImpor
|
|
1228
1242
|
* Generated bundle index. Do not edit.
|
1229
1243
|
*/
|
1230
1244
|
|
1231
|
-
export { ConfigurationRuntimeService, ConfigurationService, ContextService, FlowConfigurationModule, FlowConfigurationService, FlowUpdateService, LineItemWorker, MetricsCalculationService, ProductImagesService, QuoteDraftService, RuntimeMode, RuntimeOperation, RuntimeStep, SdkCoreModule, UI_DEFINITION_VERSION, calculateCardinalityVariables, extractMetadata, findLineItem, findLineItemWithComparator, generateLineItem, generateModifiedAssetsMap, getAttributeValue, getAttributes, getDefaultLineItem, getRecommendedPrices, insertLineItem, lineItem_utils as lineItemUtils, mapAttributes, multiplyLineItems, patchAttributes, recalculateCardinalityVariables, removeLineItem, replaceLineItem, upsertAttributes };
|
1245
|
+
export { ConfigurationRuntimeService, ConfigurationService, ContextService, FlowConfigurationModule, FlowConfigurationService, FlowUpdateService, LineItemWorker, MetricsCalculationService, ProductImagesService, QuoteDraftService, RuntimeMode, RuntimeOperation, RuntimeStep, SdkCoreModule, UI_DEFINITION_VERSION, calculateCardinalityVariables, extractMetadata, findLineItem, findLineItemWithComparator, generateLineItem, generateModifiedAssetsMap, getAttributeValue, getAttributes, getDefaultLineItem, getOriginParent, getRecommendedPrices, insertLineItem, isLineItemModified, lineItem_utils as lineItemUtils, mapAttributes, multiplyLineItems, patchAttributes, recalculateCardinalityVariables, removeLineItem, replaceLineItem, upsertAttributes };
|
1232
1246
|
//# sourceMappingURL=veloceapps-sdk-core.mjs.map
|