@capillarytech/creatives-library 8.0.65 → 8.0.67
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/tests/integration/TemplateCreation/TemplateCreation.integration.test.js +7 -3
- package/v2Containers/Assets/images/whatsappOrZaloAccountIllustration.svg +11 -0
- package/v2Containers/CreativesContainer/tests/__snapshots__/SlideBoxContent.test.js.snap +2 -2
- package/v2Containers/Templates/constants.js +5 -0
- package/v2Containers/Templates/index.js +200 -105
- package/v2Containers/Templates/messages.js +12 -0
- package/v2Containers/Templates/reducer.js +7 -2
- package/v2Containers/Templates/sagas.js +6 -1
- package/v2Containers/Templates/tests/__snapshots__/index.test.js.snap +241 -83
- package/v2Containers/Templates/tests/mockData.js +31 -0
- package/v2Containers/Templates/tests/reducer.test.js +60 -0
- package/v2Containers/Whatsapp/constants.js +1 -39
- package/v2Containers/Whatsapp/index.js +13 -50
- package/v2Containers/Whatsapp/index.scss +0 -8
- package/v2Containers/Whatsapp/messages.js +0 -21
- package/v2Containers/Whatsapp/tests/__snapshots__/index.test.js.snap +7738 -2600
- package/v2Containers/Whatsapp/tests/utils.test.js +2 -9
- package/v2Containers/Whatsapp/utils.js +4 -13
- package/v2Containers/Zalo/index.js +2 -1
- package/v2Containers/mockdata.js +133 -36
|
@@ -6,10 +6,9 @@ import {
|
|
|
6
6
|
bytesConversion,
|
|
7
7
|
getWhatsappDocPreview,
|
|
8
8
|
getWhatsappQuickReply,
|
|
9
|
-
getWhatsappAutoFill
|
|
9
|
+
getWhatsappAutoFill
|
|
10
10
|
} from '../utils';
|
|
11
11
|
import mockdata from '../../mockdata';
|
|
12
|
-
import { HOST_ICS } from '../constants';
|
|
13
12
|
|
|
14
13
|
const {
|
|
15
14
|
whatsappPreviewTemplateData,
|
|
@@ -17,7 +16,6 @@ const {
|
|
|
17
16
|
whatsappPreviewTemplateDataVid,
|
|
18
17
|
whatsappPreviewTemplateDataDoc,
|
|
19
18
|
getWhatsappStatusOutput1,
|
|
20
|
-
getWhatsappStatusOutput2,
|
|
21
19
|
getWhatsappCategoryOutput1,
|
|
22
20
|
getWhatsappCategoryOutput2,
|
|
23
21
|
getWhatsappDocPreviewOutput,
|
|
@@ -25,7 +23,7 @@ const {
|
|
|
25
23
|
whatsappPreviewTemplateData3,
|
|
26
24
|
whatsappPreviewTemplateData3Result,
|
|
27
25
|
whatsappPreviewTemplateData3QuickReplyResult,
|
|
28
|
-
getWhatsappAutoFillData
|
|
26
|
+
getWhatsappAutoFillData
|
|
29
27
|
} = mockdata;
|
|
30
28
|
|
|
31
29
|
describe('Test utils', () => {
|
|
@@ -60,8 +58,6 @@ describe('Test utils', () => {
|
|
|
60
58
|
|
|
61
59
|
it('test getWhatsappStatus', () => {
|
|
62
60
|
expect(getWhatsappStatus('approved')).toEqual(getWhatsappStatusOutput1);
|
|
63
|
-
expect(getWhatsappStatus('awaitingApproval')).toEqual(getWhatsappStatusOutput2);
|
|
64
|
-
expect(getWhatsappStatus('pending')).toEqual(getWhatsappStatusOutput2);
|
|
65
61
|
});
|
|
66
62
|
|
|
67
63
|
it('test getWhatsappCategory', () => {
|
|
@@ -71,9 +67,6 @@ describe('Test utils', () => {
|
|
|
71
67
|
expect(getWhatsappCategory('UTILITY', 'karixwhatsappbulk')).toEqual(
|
|
72
68
|
getWhatsappCategoryOutput2,
|
|
73
69
|
);
|
|
74
|
-
expect(getWhatsappCategory('UTILITY', HOST_ICS)).toEqual(
|
|
75
|
-
getWhatsappCategoryOutput2,
|
|
76
|
-
);
|
|
77
70
|
});
|
|
78
71
|
it('test getWhatsappAutoFill', () => {
|
|
79
72
|
expect(getWhatsappAutoFill({versions:{base:{content:{whatsapp:{category: 'AUTHENTICATION'}}}}})).toEqual(
|
|
@@ -12,7 +12,6 @@ import {
|
|
|
12
12
|
TWILIO_CATEGORY_OPTIONS,
|
|
13
13
|
KARIX_GUPSHUP_CATEGORY_OPTIONS,
|
|
14
14
|
KARIX_GUPSHUP_OLDER_CATEGORY_OPTIONS,
|
|
15
|
-
ICS_CATEGORY_OPTIONS,
|
|
16
15
|
WHATSAPP_STATUSES,
|
|
17
16
|
PHONE_NUMBER,
|
|
18
17
|
NONE,
|
|
@@ -20,8 +19,7 @@ import {
|
|
|
20
19
|
WHATSAPP_MEDIA_TYPES,
|
|
21
20
|
HOST_TWILIO,
|
|
22
21
|
SIZE_UNITS,
|
|
23
|
-
QUICK_REPLY
|
|
24
|
-
HOST_ICS,
|
|
22
|
+
QUICK_REPLY
|
|
25
23
|
} from '../Whatsapp/constants';
|
|
26
24
|
import './styles.scss';
|
|
27
25
|
import pdfIcon from "../../assets/pdfIcon.svg";
|
|
@@ -206,16 +204,9 @@ export const getWhatsappAutoFill = (template) => {
|
|
|
206
204
|
return <></>
|
|
207
205
|
}
|
|
208
206
|
|
|
209
|
-
export const getWhatsappCategory = (category, hostName) =>
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
[HOST_ICS]: ICS_CATEGORY_OPTIONS,
|
|
213
|
-
};
|
|
214
|
-
|
|
215
|
-
const categoryOptions = categoryMap[hostName] || [...KARIX_GUPSHUP_CATEGORY_OPTIONS, ...KARIX_GUPSHUP_OLDER_CATEGORY_OPTIONS];
|
|
216
|
-
|
|
217
|
-
return categoryOptions?.find((obj) => obj?.value === category);
|
|
218
|
-
};
|
|
207
|
+
export const getWhatsappCategory = (category, hostName) => (
|
|
208
|
+
hostName === HOST_TWILIO ? TWILIO_CATEGORY_OPTIONS : [...KARIX_GUPSHUP_CATEGORY_OPTIONS, ...KARIX_GUPSHUP_OLDER_CATEGORY_OPTIONS]
|
|
209
|
+
).find((obj) => obj.value === category);
|
|
219
210
|
|
|
220
211
|
export const getWhatsappStatus = (status) => {
|
|
221
212
|
if ([WHATSAPP_STATUSES.pending, WHATSAPP_STATUSES.unsubmitted].includes(status)) {
|
|
@@ -73,7 +73,8 @@ export const Zalo = (props) => {
|
|
|
73
73
|
hostName: zaloHostName = '',
|
|
74
74
|
eventContextTags,
|
|
75
75
|
} = props || {};
|
|
76
|
-
|
|
76
|
+
// Since zalo supports now multiple accounts, we need to get the hostname from the selected account or passed props.
|
|
77
|
+
const hostName = selectedZaloAccount?.hostName || zaloHostName;
|
|
77
78
|
const { formatMessage } = intl;
|
|
78
79
|
const [oa_id, setOaId] = useState('');
|
|
79
80
|
const [token, setToken] = useState('');
|
package/v2Containers/mockdata.js
CHANGED
|
@@ -12,15 +12,15 @@ export default {
|
|
|
12
12
|
isActive: true,
|
|
13
13
|
sourceTypeId: 19,
|
|
14
14
|
configs: {
|
|
15
|
-
accessToken: "Bearer
|
|
15
|
+
accessToken: "Bearer abcd",
|
|
16
16
|
promotionalMessagingSSID: "",
|
|
17
17
|
transactionalMessagingSSID: "",
|
|
18
18
|
},
|
|
19
19
|
hostName: "karixwhatsappbulk",
|
|
20
20
|
toMirror: true,
|
|
21
21
|
id: 12721,
|
|
22
|
-
uuid: "
|
|
23
|
-
sourceAccountIdentifier: "
|
|
22
|
+
uuid: "abc12",
|
|
23
|
+
sourceAccountIdentifier: "12345",
|
|
24
24
|
commChannels: ["whatsapp"],
|
|
25
25
|
},
|
|
26
26
|
getAllTemplatesInProgress: false,
|
|
@@ -28,6 +28,114 @@ export default {
|
|
|
28
28
|
weCRMtemplates: [],
|
|
29
29
|
senderDetails: {
|
|
30
30
|
status: "SUCCESS",
|
|
31
|
+
domainProperties: [
|
|
32
|
+
{
|
|
33
|
+
"id": 249341,
|
|
34
|
+
"orgId": 50074,
|
|
35
|
+
"label": "",
|
|
36
|
+
"domainProperties": {
|
|
37
|
+
"id": 3972,
|
|
38
|
+
"domainName": "whatsapp_mobile_push",
|
|
39
|
+
"description": "whatsapp_mobile_push_karix",
|
|
40
|
+
"contactInfo": [
|
|
41
|
+
{
|
|
42
|
+
"id": 100776,
|
|
43
|
+
"domainPropId": 3972,
|
|
44
|
+
"messageClass": "WHATSAPP",
|
|
45
|
+
"type": "gsm_sender_id",
|
|
46
|
+
"label": "whatsapptesting",
|
|
47
|
+
"value": "919611759663",
|
|
48
|
+
"valid": true,
|
|
49
|
+
"default": true
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"id": 102485,
|
|
53
|
+
"domainPropId": 3972,
|
|
54
|
+
"messageClass": "WHATSAPP",
|
|
55
|
+
"type": "cdma_sender_id",
|
|
56
|
+
"label": "whatsapptesting",
|
|
57
|
+
"value": "919611759663",
|
|
58
|
+
"valid": true,
|
|
59
|
+
"default": true
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"id": 102486,
|
|
63
|
+
"domainPropId": 3972,
|
|
64
|
+
"messageClass": "WHATSAPP",
|
|
65
|
+
"type": "cdma_sender_id",
|
|
66
|
+
"label": "not_working",
|
|
67
|
+
"value": "919876543210",
|
|
68
|
+
"valid": true,
|
|
69
|
+
"default": false
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"id": 102487,
|
|
73
|
+
"domainPropId": 3972,
|
|
74
|
+
"messageClass": "WHATSAPP",
|
|
75
|
+
"type": "gsm_sender_id",
|
|
76
|
+
"label": "not_working",
|
|
77
|
+
"value": "919876543210",
|
|
78
|
+
"valid": true,
|
|
79
|
+
"default": false
|
|
80
|
+
}
|
|
81
|
+
],
|
|
82
|
+
"xengageEnabled": false,
|
|
83
|
+
"connectionProperties": {
|
|
84
|
+
"919611759663_whatsapp_pool_id": "CAP001",
|
|
85
|
+
"authToken": "Bearer abcd",
|
|
86
|
+
"sourceAccountIdentifier": "12345",
|
|
87
|
+
"wabaId": "12345",
|
|
88
|
+
"whatsapp_pool_id": "CAP001"
|
|
89
|
+
},
|
|
90
|
+
"hostName": "karixwhatsappbulk"
|
|
91
|
+
},
|
|
92
|
+
"priority": 1,
|
|
93
|
+
"valid": true
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"id": 276278,
|
|
97
|
+
"orgId": 50074,
|
|
98
|
+
"label": "",
|
|
99
|
+
"domainProperties": {
|
|
100
|
+
"id": 4294,
|
|
101
|
+
"domainName": "gupshup",
|
|
102
|
+
"description": "gupshup whatsapp test",
|
|
103
|
+
"contactInfo": [
|
|
104
|
+
{
|
|
105
|
+
"id": 101616,
|
|
106
|
+
"domainPropId": 4294,
|
|
107
|
+
"messageClass": "WHATSAPP",
|
|
108
|
+
"type": "gsm_sender_id",
|
|
109
|
+
"label": "gupshup test",
|
|
110
|
+
"value": "gupshuptest",
|
|
111
|
+
"description": "",
|
|
112
|
+
"valid": true,
|
|
113
|
+
"default": true
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
"id": 101617,
|
|
117
|
+
"domainPropId": 4294,
|
|
118
|
+
"messageClass": "WHATSAPP",
|
|
119
|
+
"type": "cdma_sender_id",
|
|
120
|
+
"label": "gupshupt est",
|
|
121
|
+
"value": "gupshuptest",
|
|
122
|
+
"description": "",
|
|
123
|
+
"valid": true,
|
|
124
|
+
"default": true
|
|
125
|
+
}
|
|
126
|
+
],
|
|
127
|
+
"xengageEnabled": false,
|
|
128
|
+
"connectionProperties": {
|
|
129
|
+
"password": "qrtCAJCz",
|
|
130
|
+
"sourceAccountIdentifier": "123456",
|
|
131
|
+
"userid": "123456"
|
|
132
|
+
},
|
|
133
|
+
"hostName": "gupshupwhatsappbulk"
|
|
134
|
+
},
|
|
135
|
+
"priority": 1,
|
|
136
|
+
"valid": true
|
|
137
|
+
},
|
|
138
|
+
],
|
|
31
139
|
hostName: "karixwhatsappbulk",
|
|
32
140
|
errors: [],
|
|
33
141
|
},
|
|
@@ -42,14 +150,14 @@ export default {
|
|
|
42
150
|
isActive: true,
|
|
43
151
|
sourceTypeId: 19,
|
|
44
152
|
configs: {
|
|
45
|
-
accessToken: "Bearer
|
|
153
|
+
accessToken: "Bearer abcd",
|
|
46
154
|
promotionalMessagingSSID: "",
|
|
47
155
|
transactionalMessagingSSID: "",
|
|
48
156
|
},
|
|
49
157
|
toMirror: true,
|
|
50
158
|
id: 12721,
|
|
51
|
-
uuid: "
|
|
52
|
-
sourceAccountIdentifier: "
|
|
159
|
+
uuid: "abc12",
|
|
160
|
+
sourceAccountIdentifier: "12345",
|
|
53
161
|
commChannels: ["whatsapp"],
|
|
54
162
|
},
|
|
55
163
|
],
|
|
@@ -68,8 +176,8 @@ export default {
|
|
|
68
176
|
status: "pending",
|
|
69
177
|
templateId: "720951875646523",
|
|
70
178
|
hostName: "karixwhatsappbulk",
|
|
71
|
-
accessToken: "Bearer
|
|
72
|
-
accountId: "
|
|
179
|
+
accessToken: "Bearer abcd",
|
|
180
|
+
accountId: "12345",
|
|
73
181
|
templateEditor: false,
|
|
74
182
|
karixFileHandle:
|
|
75
183
|
"4::aW1hZ2UvanBlZw==:ARZpmm0pMfsBvKepIjR-HG2HIw_78ynisr-riY1s4xpi2noK9QsvtvVfnZb5hUxks5HM5JHG0gCn_ZtPuJzya1SH3eq4Upn3M0eqsDLr4CzdPw:e:1658404714:259409122277300:100066839164237:ARbbCRjU-2ksqoUOp4Y",
|
|
@@ -124,8 +232,8 @@ export default {
|
|
|
124
232
|
status: "pending",
|
|
125
233
|
templateId: "4916570121786087",
|
|
126
234
|
hostName: "karixwhatsappbulk",
|
|
127
|
-
accessToken: "Bearer
|
|
128
|
-
accountId: "
|
|
235
|
+
accessToken: "Bearer abcd",
|
|
236
|
+
accountId: "12345",
|
|
129
237
|
templateEditor: false,
|
|
130
238
|
karixFileHandle:
|
|
131
239
|
"4::aW1hZ2UvanBlZw==:ARY0H4Z85fo_TTfmAYJpqpnSbBlE3VaIYyr9S_Exg7GV_EhOo-30AVAoe35d0ZH8Cx5ZaJ3U2RovzzqVHPUnMK_7wFY7RNngsTwWc4vnZ7bMoA:e:1658404539:259409122277300:100066839164237:ARaPlACD4a5lw9Wp4X4",
|
|
@@ -173,8 +281,8 @@ export default {
|
|
|
173
281
|
status: "pending",
|
|
174
282
|
templateId: "732848961277130",
|
|
175
283
|
hostName: "karixwhatsappbulk",
|
|
176
|
-
accessToken: "Bearer
|
|
177
|
-
accountId: "
|
|
284
|
+
accessToken: "Bearer abcd",
|
|
285
|
+
accountId: "12345",
|
|
178
286
|
templateEditor: false,
|
|
179
287
|
karixFileHandle:
|
|
180
288
|
"4::aW1hZ2UvanBlZw==:ARYfsmvPHCeI0Q3ixfzpZ3gOIoYjrkx6STalsi58_twFIqB5rvPKsKPH7yL_eXMfbmXGq_X0qiLrL7FaSSFq_uzudytfoOj9Oh5ueb1uUV367A:e:1658404470:259409122277300:100066839164237:ARaaojq13hSRpe7h0Tw",
|
|
@@ -223,8 +331,8 @@ export default {
|
|
|
223
331
|
status: "pending",
|
|
224
332
|
templateId: "993272384701160",
|
|
225
333
|
hostName: "karixwhatsappbulk",
|
|
226
|
-
accessToken: "Bearer
|
|
227
|
-
accountId: "
|
|
334
|
+
accessToken: "Bearer abcd",
|
|
335
|
+
accountId: "12345",
|
|
228
336
|
templateEditor: false,
|
|
229
337
|
karixFileHandle:
|
|
230
338
|
"4::aW1hZ2UvanBlZw==:ARa6WKa8LHjcJf2DBWokWtAvxkowam2zBaUJvEwxyWH2EamzQv7-GlX7bsf6IKkdWKLAATpfo_vkAgQ8mWLf2wvVNEVBmPWk3yyrWDnVI44_9A:e:1658404412:259409122277300:100066839164237:ARYyRilqCb6hSKHtjYQ",
|
|
@@ -264,8 +372,8 @@ export default {
|
|
|
264
372
|
status: "pending",
|
|
265
373
|
templateId: "1838206886365227",
|
|
266
374
|
hostName: "karixwhatsappbulk",
|
|
267
|
-
accessToken: "Bearer
|
|
268
|
-
accountId: "
|
|
375
|
+
accessToken: "Bearer abcd",
|
|
376
|
+
accountId: "12345",
|
|
269
377
|
templateEditor: false,
|
|
270
378
|
mediaType: "TEXT",
|
|
271
379
|
languages: [
|
|
@@ -301,8 +409,8 @@ export default {
|
|
|
301
409
|
status: "pending",
|
|
302
410
|
templateId: "412858944197174",
|
|
303
411
|
hostName: "karixwhatsappbulk",
|
|
304
|
-
accessToken: "Bearer
|
|
305
|
-
accountId: "
|
|
412
|
+
accessToken: "Bearer abcd",
|
|
413
|
+
accountId: "12345",
|
|
306
414
|
templateEditor: false,
|
|
307
415
|
mediaType: "TEXT",
|
|
308
416
|
languages: [
|
|
@@ -1150,7 +1258,7 @@ export default {
|
|
|
1150
1258
|
channel: "EMAIL",
|
|
1151
1259
|
validity: true,
|
|
1152
1260
|
},
|
|
1153
|
-
getWhatsappContentOutput: "
|
|
1261
|
+
getWhatsappContentOutput: "123450\nClick {{unsubscribe}} to unsubscribe",
|
|
1154
1262
|
getWhatsappStatusOutput1: {
|
|
1155
1263
|
key: "approved",
|
|
1156
1264
|
label: (
|
|
@@ -1162,17 +1270,6 @@ export default {
|
|
|
1162
1270
|
),
|
|
1163
1271
|
value: "approved",
|
|
1164
1272
|
},
|
|
1165
|
-
getWhatsappStatusOutput2: {
|
|
1166
|
-
key: "awaitingApproval",
|
|
1167
|
-
label: (
|
|
1168
|
-
<FormattedMessage
|
|
1169
|
-
defaultMessage="Awaiting approval"
|
|
1170
|
-
id="creatives.containersV2.Whatsapp.awaitingApproval"
|
|
1171
|
-
values={{}}
|
|
1172
|
-
/>
|
|
1173
|
-
),
|
|
1174
|
-
value: "awaitingApproval",
|
|
1175
|
-
},
|
|
1176
1273
|
getWhatsappCategoryOutput1: {
|
|
1177
1274
|
key: "alertUpdate",
|
|
1178
1275
|
label: (
|
|
@@ -1227,8 +1324,8 @@ export default {
|
|
|
1227
1324
|
status: "approved",
|
|
1228
1325
|
templateId: "720951875646523",
|
|
1229
1326
|
hostName: "karixwhatsappbulk",
|
|
1230
|
-
accessToken: "Bearer
|
|
1231
|
-
accountId: "
|
|
1327
|
+
accessToken: "Bearer abcd",
|
|
1328
|
+
accountId: "12345",
|
|
1232
1329
|
templateEditor: false,
|
|
1233
1330
|
karixFileHandle:
|
|
1234
1331
|
"4::aW1hZ2UvanBlZw==:ARZpmm0pMfsBvKepIjR-HG2HIw_78ynisr-riY1s4xpi2noK9QsvtvVfnZb5hUxks5HM5JHG0gCn_ZtPuJzya1SH3eq4Upn3M0eqsDLr4CzdPw:e:1658404714:259409122277300:100066839164237:ARbbCRjU-2ksqoUOp4Y",
|
|
@@ -1285,8 +1382,8 @@ export default {
|
|
|
1285
1382
|
status: "approved",
|
|
1286
1383
|
templateId: "720951875646523",
|
|
1287
1384
|
hostName: "karixwhatsappbulk",
|
|
1288
|
-
accessToken: "Bearer
|
|
1289
|
-
accountId: "
|
|
1385
|
+
accessToken: "Bearer abcd",
|
|
1386
|
+
accountId: "12345",
|
|
1290
1387
|
templateEditor: false,
|
|
1291
1388
|
karixFileHandle:
|
|
1292
1389
|
"4::aW1hZ2UvanBlZw==:ARZpmm0pMfsBvKepIjR-HG2HIw_78ynisr-riY1s4xpi2noK9QsvtvVfnZb5hUxks5HM5JHG0gCn_ZtPuJzya1SH3eq4Upn3M0eqsDLr4CzdPw:e:1658404714:259409122277300:100066839164237:ARbbCRjU-2ksqoUOp4Y",
|
|
@@ -1345,8 +1442,8 @@ export default {
|
|
|
1345
1442
|
status: "approved",
|
|
1346
1443
|
templateId: "720951875646523",
|
|
1347
1444
|
hostName: "karixwhatsappbulk",
|
|
1348
|
-
accessToken: "Bearer
|
|
1349
|
-
accountId: "
|
|
1445
|
+
accessToken: "Bearer abcd",
|
|
1446
|
+
accountId: "12345",
|
|
1350
1447
|
templateEditor: false,
|
|
1351
1448
|
karixFileHandle:
|
|
1352
1449
|
"4::aW1hZ2UvanBlZw==:ARZpmm0pMfsBvKepIjR-HG2HIw_78ynisr-riY1s4xpi2noK9QsvtvVfnZb5hUxks5HM5JHG0gCn_ZtPuJzya1SH3eq4Upn3M0eqsDLr4CzdPw:e:1658404714:259409122277300:100066839164237:ARbbCRjU-2ksqoUOp4Y",
|