@capillarytech/creatives-library 7.11.5 → 7.11.7
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 +1 -1
- package/v2Components/TemplatePreview/_templatePreview.scss +1 -0
- package/v2Components/TemplatePreview/index.js +1 -1
- package/v2Containers/Assets/images/rcsIllustration.png +0 -0
- package/v2Containers/CreativesContainer/index.js +11 -6
- package/v2Containers/Whatsapp/index.js +6 -18
- package/v2Containers/Whatsapp/tests/__snapshots__/index.test.js.snap +272 -292
package/package.json
CHANGED
|
@@ -447,7 +447,7 @@ export class TemplatePreview extends React.Component { // eslint-disable-line re
|
|
|
447
447
|
className="msg-container line-preview"
|
|
448
448
|
style={{
|
|
449
449
|
maxHeight: 330,
|
|
450
|
-
overflow: '
|
|
450
|
+
overflow: 'auto',
|
|
451
451
|
flexDirection: 'column',
|
|
452
452
|
marginLeft: 40,
|
|
453
453
|
}}
|
|
Binary file
|
|
@@ -462,12 +462,15 @@ export class Creatives extends React.Component {
|
|
|
462
462
|
const type = (get(this.props, "messageDetails.type") || '').toLowerCase();
|
|
463
463
|
if (type === LOYALTY) {
|
|
464
464
|
templateData.licenseCode = get(mobilpushTemplate, 'definition.licenseCode');
|
|
465
|
+
templateData.templateId = get(mobilpushTemplate, '_id');
|
|
465
466
|
}
|
|
466
467
|
const androidContent = get(mobilpushTemplate, 'versions.base.ANDROID');
|
|
467
468
|
if (!isEmpty(androidContent)) {
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
469
|
+
if (type !== LOYALTY) {
|
|
470
|
+
delete androidContent.cuid;
|
|
471
|
+
delete androidContent.luid;
|
|
472
|
+
delete androidContent.communicationId;
|
|
473
|
+
}
|
|
471
474
|
const custom = {};
|
|
472
475
|
forEach(androidContent.custom, (customKeyValue) => {
|
|
473
476
|
custom[customKeyValue.key] = customKeyValue.value;
|
|
@@ -479,9 +482,11 @@ export class Creatives extends React.Component {
|
|
|
479
482
|
}
|
|
480
483
|
const iosContent = get(mobilpushTemplate, 'versions.base.IOS');
|
|
481
484
|
if (!isEmpty(iosContent)) {
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
+
if (type !== LOYALTY) {
|
|
486
|
+
delete iosContent.cuid;
|
|
487
|
+
delete iosContent.luid;
|
|
488
|
+
delete iosContent.communicationId;
|
|
489
|
+
}
|
|
485
490
|
const custom = {};
|
|
486
491
|
forEach(iosContent.custom, (customKeyValue) => {
|
|
487
492
|
custom[customKeyValue.key] = customKeyValue.value;
|
|
@@ -438,30 +438,18 @@ export const Whatsapp = (props) => {
|
|
|
438
438
|
setTemplateCategory(value);
|
|
439
439
|
};
|
|
440
440
|
|
|
441
|
-
const onAddVar = (
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
//if autocomplete feature, first remove the trailing bracket and then add variable
|
|
445
|
-
if (isAutoComplete) {
|
|
446
|
-
tempMessage = tempMessage.slice(0, templateMessage.length - 1);
|
|
447
|
-
}
|
|
448
|
-
const validVarArr = tempMessage.match(validVarRegex) || [];
|
|
449
|
-
const tempMsg = `${tempMessage}{{${validVarArr.length + 1}}}`;
|
|
441
|
+
const onAddVar = () => {
|
|
442
|
+
const validVarArr = templateMessage.match(validVarRegex) || [];
|
|
443
|
+
const tempMsg = `${templateMessage}{{${validVarArr.length + 1}}}`;
|
|
450
444
|
const error = templateMessageErrorHandler(tempMsg);
|
|
451
445
|
setTemplateMessage(tempMsg);
|
|
452
446
|
setTemplateMessageError(error);
|
|
453
447
|
};
|
|
454
448
|
|
|
455
449
|
const onTemplateMessageChange = ({ target: { value } }) => {
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
}
|
|
460
|
-
else {
|
|
461
|
-
const error = templateMessageErrorHandler(value);
|
|
462
|
-
setTemplateMessage(value);
|
|
463
|
-
setTemplateMessageError(error);
|
|
464
|
-
}
|
|
450
|
+
const error = templateMessageErrorHandler(value);
|
|
451
|
+
setTemplateMessage(value);
|
|
452
|
+
setTemplateMessageError(error);
|
|
465
453
|
};
|
|
466
454
|
|
|
467
455
|
const templateMessageErrorHandler = (value) => {
|