@capillarytech/creatives-library 7.12.46 → 7.12.48
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/v2Containers/Line/Container/ImageCarousel/index.js +6 -7
- package/v2Containers/Line/Container/index.js +3 -1
- package/v2Containers/Templates/constants.js +1 -1
- package/v2Containers/Templates/tests/__snapshots__/index.test.js.snap +2 -2
- package/v2Containers/Templates/tests/index.test.js +1 -1
package/package.json
CHANGED
|
@@ -72,21 +72,20 @@ export const LineImageCarousel = (props) => {
|
|
|
72
72
|
const [errorTitle, updateErrorTitle] = useState(false);
|
|
73
73
|
|
|
74
74
|
useEffect(() => {
|
|
75
|
-
const { messageTitle = '', type, template, altText } = content;
|
|
75
|
+
const { messageTitle = '', type, template, altText, contents } = content;
|
|
76
76
|
if ([TEMPLATE, FLEX].includes(type)) {
|
|
77
|
-
updateCreateNew(!isFullMode ? !!template : true);
|
|
77
|
+
updateCreateNew(!isFullMode ? !!(template || contents) : true);
|
|
78
78
|
if (messageTitle) {
|
|
79
79
|
updateTextMessageTitle(messageTitle);
|
|
80
80
|
}
|
|
81
81
|
if (altText) {
|
|
82
82
|
updateTitle(altText);
|
|
83
83
|
}
|
|
84
|
-
if (template) {
|
|
84
|
+
if (template || contents) {
|
|
85
85
|
const validCarouselImages = [];
|
|
86
|
-
if (template?.type === CAROUSEL) {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
const {
|
|
86
|
+
if (template?.type === CAROUSEL || contents?.type === CAROUSEL ) {
|
|
87
|
+
const { contents: innerContents = [] } = contents || template || [];
|
|
88
|
+
innerContents.forEach((content = {}, index) => { const {
|
|
90
89
|
footer: {
|
|
91
90
|
contents: [{
|
|
92
91
|
action: {
|
|
@@ -172,6 +172,7 @@ export const LineContainer = ({
|
|
|
172
172
|
assetType,
|
|
173
173
|
selectedTemplate,
|
|
174
174
|
template,
|
|
175
|
+
contents,
|
|
175
176
|
altText,
|
|
176
177
|
video,
|
|
177
178
|
videoName,
|
|
@@ -189,6 +190,7 @@ export const LineContainer = ({
|
|
|
189
190
|
assetType,
|
|
190
191
|
selectedTemplate,
|
|
191
192
|
template,
|
|
193
|
+
contents,
|
|
192
194
|
altText,
|
|
193
195
|
video,
|
|
194
196
|
videoName,
|
|
@@ -573,7 +575,7 @@ export const LineContainer = ({
|
|
|
573
575
|
});
|
|
574
576
|
contentsLocal.contents = imageContents;
|
|
575
577
|
contentsLocal.type = "carousel";
|
|
576
|
-
messageData.
|
|
578
|
+
messageData.contents = contentsLocal;
|
|
577
579
|
messageData.altText = altText;
|
|
578
580
|
}
|
|
579
581
|
if (videoSrc) {
|
|
@@ -59,4 +59,4 @@ export const GET_ORG_LEVEL_CAMPAIGN_SETTINGS_SUCCESS =
|
|
|
59
59
|
export const GET_ORG_LEVEL_CAMPAIGN_SETTINGS_FAILURE =
|
|
60
60
|
'app/v2Containers/Templates/GET_ORG_LEVEL_CAMPAIGN_SETTINGS_FAILURE';
|
|
61
61
|
|
|
62
|
-
export const MAX_WHATSAPP_TEMPLATES =
|
|
62
|
+
export const MAX_WHATSAPP_TEMPLATES = 1500;
|
|
@@ -2630,7 +2630,7 @@ exports[`Test Templates container Test max templates exceeded 1`] = `
|
|
|
2630
2630
|
id="creatives.containersV2.Templates.whatsappMaxTemplates"
|
|
2631
2631
|
values={
|
|
2632
2632
|
Object {
|
|
2633
|
-
"maxCount":
|
|
2633
|
+
"maxCount": 1500,
|
|
2634
2634
|
}
|
|
2635
2635
|
}
|
|
2636
2636
|
/>
|
|
@@ -2722,7 +2722,7 @@ Click {{unsubscribe}} to unsubscribe'
|
|
|
2722
2722
|
"isActive": true,
|
|
2723
2723
|
"name": "saad",
|
|
2724
2724
|
"orgId": 50146,
|
|
2725
|
-
"totalCount":
|
|
2725
|
+
"totalCount": 1510,
|
|
2726
2726
|
"type": "WHATSAPP",
|
|
2727
2727
|
"updatedAt": "2022-02-15T11:02:11.190Z",
|
|
2728
2728
|
"updatedBy": "15000449",
|
|
@@ -123,7 +123,7 @@ describe('Test Templates container', () => {
|
|
|
123
123
|
|
|
124
124
|
it('Test max templates exceeded', () => {
|
|
125
125
|
renderFunction(true);
|
|
126
|
-
renderedComponent.setProps({TemplatesList: [{ ...TemplatesProp.templates[0], totalCount:
|
|
126
|
+
renderedComponent.setProps({TemplatesList: [{ ...TemplatesProp.templates[0], totalCount: 1510 }]});
|
|
127
127
|
expect(renderedComponent).toMatchSnapshot();
|
|
128
128
|
});
|
|
129
129
|
|