@capillarytech/creatives-library 8.0.77 → 8.0.79
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/package.json
CHANGED
package/utils/tagValidations.js
CHANGED
|
@@ -315,7 +315,7 @@ export const getTagMapValue = (object = {}) => {
|
|
|
315
315
|
return Object.values(
|
|
316
316
|
object
|
|
317
317
|
).reduce((acc, current) => {
|
|
318
|
-
return { ...acc
|
|
318
|
+
return { ...acc, ...current?.subtags ?? {} };
|
|
319
319
|
}, {});
|
|
320
320
|
};
|
|
321
321
|
|
|
@@ -498,6 +498,27 @@ describe("getTagMapValue", () => {
|
|
|
498
498
|
name: "233",
|
|
499
499
|
},
|
|
500
500
|
},
|
|
501
|
+
"key 2": {
|
|
502
|
+
name: "24",
|
|
503
|
+
subtags: {
|
|
504
|
+
tagName: "234",
|
|
505
|
+
},
|
|
506
|
+
},
|
|
507
|
+
};
|
|
508
|
+
const result = getTagMapValue(object);
|
|
509
|
+
expect(result).toEqual({ name: "233", tagName: "234", });
|
|
510
|
+
});
|
|
511
|
+
it("should return the tag map value when an object is provided but subtag is not present in one of the obj", () => {
|
|
512
|
+
const object = {
|
|
513
|
+
"key 1": {
|
|
514
|
+
name: "23",
|
|
515
|
+
subtags: {
|
|
516
|
+
name: "233",
|
|
517
|
+
},
|
|
518
|
+
},
|
|
519
|
+
"key 2": {
|
|
520
|
+
name: "24",
|
|
521
|
+
},
|
|
501
522
|
};
|
|
502
523
|
const result = getTagMapValue(object);
|
|
503
524
|
expect(result).toEqual({ name: "233" });
|
|
@@ -227,6 +227,8 @@ export class EmailWrapper extends React.Component { // eslint-disable-line react
|
|
|
227
227
|
moduleType,
|
|
228
228
|
showLiquidErrorInFooter,
|
|
229
229
|
eventContextTags,
|
|
230
|
+
// Flag to enable loyalty module specific features in the email editor
|
|
231
|
+
isLoyaltyModule,
|
|
230
232
|
} = this.props;
|
|
231
233
|
const {
|
|
232
234
|
templateName,
|
|
@@ -300,6 +302,7 @@ export class EmailWrapper extends React.Component { // eslint-disable-line react
|
|
|
300
302
|
editor={editor}
|
|
301
303
|
moduleType={moduleType}
|
|
302
304
|
eventContextTags={eventContextTags}
|
|
305
|
+
isLoyaltyModule={isLoyaltyModule}
|
|
303
306
|
/>}
|
|
304
307
|
{!isShowEmailCreate && (
|
|
305
308
|
<CmsTemplatesComponent
|
|
@@ -346,6 +349,7 @@ EmailWrapper.propTypes = {
|
|
|
346
349
|
onEnterTemplateName: PropTypes.func,
|
|
347
350
|
onRemoveTemplateName: PropTypes.func,
|
|
348
351
|
eventContextTags: PropTypes.array,
|
|
352
|
+
isLoyaltyModule: PropTypes.bool,
|
|
349
353
|
};
|
|
350
354
|
|
|
351
355
|
const mapStateToProps = createStructuredSelector({
|