@capillarytech/creatives-library 7.17.66 → 7.17.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/components/FormBuilder/index.js +1 -1
- package/containers/App/constants.js +0 -10
- package/package.json +1 -1
- package/utils/common.js +4 -47
- package/utils/tagValidations.js +1 -1
- package/utils/tests/common.mockdata.js +0 -487
- package/utils/tests/common.test.js +0 -7
- package/v2Components/CapTagList/index.js +3 -3
- package/v2Components/FormBuilder/index.js +2 -1
- package/v2Containers/CreativesContainer/SlideBoxContent.js +2 -0
- package/v2Containers/TagList/index.js +8 -13
- package/v2Containers/Viber/index.js +2 -0
|
@@ -965,7 +965,7 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
965
965
|
}
|
|
966
966
|
|
|
967
967
|
skipTags(tag) {
|
|
968
|
-
const regexGroups = ["dynamic_expiry_date_after_\\d+_days.FORMAT_\\d", "unsubscribe\\(#[a-zA-Z\\d]{6}\\)","Link_to_[a-zA-z]","SURVEY.*.TOKEN"];
|
|
968
|
+
const regexGroups = ["dynamic_expiry_date_after_\\d+_days.FORMAT_\\d", "unsubscribe\\(#[a-zA-Z\\d]{6}\\)","Link_to_[a-zA-z]","SURVEY.*.TOKEN", "^[A-Za-z].*\\([a-zA-Z\\d]*\\)"];
|
|
969
969
|
|
|
970
970
|
//const regexGroups = [];
|
|
971
971
|
let skipped = false;
|
|
@@ -83,17 +83,7 @@ export const BADGES_RELATED_TAGS = [
|
|
|
83
83
|
"badge_expiry_Dd_dot_mm_dot_yy",
|
|
84
84
|
"badge_expiry_dd_space_Mon",
|
|
85
85
|
"Days_until_expiry",
|
|
86
|
-
"badges_enroll_expiry_date.FORMAT_1",
|
|
87
|
-
"badges_enroll_expiry_date.FORMAT_2",
|
|
88
|
-
"badges_enroll_expiry_date.FORMAT_3",
|
|
89
|
-
"badges_enroll_expiry_date.FORMAT_4",
|
|
90
|
-
"badges_enroll_expiry_date.FORMAT_5",
|
|
91
|
-
"badges_enroll_expiry_date.FORMAT_6",
|
|
92
|
-
"badges_enroll_expiry_date.FORMAT_7",
|
|
93
|
-
"badges_enroll_expiry_date.FORMAT_8",
|
|
94
|
-
"badges_enroll_expiring_in_days",
|
|
95
86
|
];
|
|
96
|
-
export const BADGES_ENROLL = 'BADGES_ENROLL';
|
|
97
87
|
|
|
98
88
|
export const CUSTOMER_BARCODE_TAG = "customer_barcode";
|
|
99
89
|
export const COPY_OF = "Copy of";
|
package/package.json
CHANGED
package/utils/common.js
CHANGED
|
@@ -16,7 +16,6 @@ import {
|
|
|
16
16
|
JP_LOCALE_HIDE_FEATURE,
|
|
17
17
|
ENABLE_CUSTOMER_BARCODE_TAG,
|
|
18
18
|
BADGES_UI_ENABLED,
|
|
19
|
-
BADGES_ENROLL,
|
|
20
19
|
} from '../containers/App/constants';
|
|
21
20
|
import { apiMessageFormatHandler } from './commonUtils';
|
|
22
21
|
|
|
@@ -167,12 +166,8 @@ export function getTreeStructuredTags({tagsList, userLocale = 'en', offerDetails
|
|
|
167
166
|
}
|
|
168
167
|
});
|
|
169
168
|
let combinedTags = result;
|
|
170
|
-
if (offerDetails
|
|
171
|
-
|
|
172
|
-
combinedTags = transformBadgeTags(offerDetails, result);
|
|
173
|
-
} else {
|
|
174
|
-
combinedTags = transformCouponTags(offerDetails, result);
|
|
175
|
-
}
|
|
169
|
+
if (offerDetails.length) {
|
|
170
|
+
combinedTags = transformCouponTags(offerDetails, result);
|
|
176
171
|
}
|
|
177
172
|
return getTreeStructureData(combinedTags);
|
|
178
173
|
}
|
|
@@ -198,7 +193,7 @@ function transformCouponTags(offerDetails, allTags) {
|
|
|
198
193
|
return {
|
|
199
194
|
...obj,
|
|
200
195
|
...tempObj,
|
|
201
|
-
|
|
196
|
+
couponSeriesId: id,
|
|
202
197
|
};
|
|
203
198
|
};
|
|
204
199
|
offerDetails.forEach((offer) => {
|
|
@@ -221,7 +216,7 @@ function transformCouponTags(offerDetails, allTags) {
|
|
|
221
216
|
'tag-header': true,
|
|
222
217
|
'name': couponNameFinal || couponId,
|
|
223
218
|
'desc': couponNameFinal || couponId,
|
|
224
|
-
'
|
|
219
|
+
'couponSeriesId': couponId,
|
|
225
220
|
'subtags': couponSubTags,
|
|
226
221
|
'resolved': true,
|
|
227
222
|
'couponTags': true,
|
|
@@ -232,44 +227,6 @@ function transformCouponTags(offerDetails, allTags) {
|
|
|
232
227
|
return allTags;
|
|
233
228
|
}
|
|
234
229
|
|
|
235
|
-
export function transformBadgeTags(badgeDetails = [], allTags) {
|
|
236
|
-
const badgeTags = {};
|
|
237
|
-
const badgeTagsKeys = Object.keys(_.get(allTags, 'Badge.subtags', []));
|
|
238
|
-
const withBadgeId = (obj, id) => {
|
|
239
|
-
const tempObj = {};
|
|
240
|
-
if (obj?.subtags) {
|
|
241
|
-
tempObj.subtags = _.mapValues(obj.subtags, (tag) => ({
|
|
242
|
-
...withBadgeId(tag, id),
|
|
243
|
-
}));
|
|
244
|
-
}
|
|
245
|
-
return {
|
|
246
|
-
...obj,
|
|
247
|
-
...tempObj,
|
|
248
|
-
incentiveSeriesId: id,
|
|
249
|
-
};
|
|
250
|
-
};
|
|
251
|
-
badgeDetails.forEach((offer) => {
|
|
252
|
-
const { badgesMetaId, badgeName } = offer || {};
|
|
253
|
-
const badgeSubTags = {};
|
|
254
|
-
badgeTagsKeys.forEach((badgeTagKey) => {
|
|
255
|
-
const badgeSubTagsObj = withBadgeId(allTags?.Badge?.subtags?.[badgeTagKey], badgesMetaId);
|
|
256
|
-
badgeSubTags[badgeTagKey] = badgeSubTagsObj;
|
|
257
|
-
});
|
|
258
|
-
badgeTags[badgesMetaId] = {
|
|
259
|
-
'tag-header': true,
|
|
260
|
-
'name': badgeName,
|
|
261
|
-
'desc': badgeName,
|
|
262
|
-
'incentiveSeriesId': badgesMetaId,
|
|
263
|
-
'subtags': badgeSubTags,
|
|
264
|
-
'resolved': true,
|
|
265
|
-
'couponTags': true,
|
|
266
|
-
};
|
|
267
|
-
});
|
|
268
|
-
// eslint-disable-next-line no-param-reassign
|
|
269
|
-
allTags.Badge.subtags = badgeTags;
|
|
270
|
-
return allTags;
|
|
271
|
-
}
|
|
272
|
-
|
|
273
230
|
function populateTagForChildren(targetTag, tagsObject, tagValue) {
|
|
274
231
|
const tag = targetTag;
|
|
275
232
|
if (tag && tag['tag-header'] && !tag.resolved) {
|
package/utils/tagValidations.js
CHANGED
|
@@ -105,7 +105,7 @@ const indexOfEnd = (targetString, string) => {
|
|
|
105
105
|
}
|
|
106
106
|
|
|
107
107
|
const skipTags = (tag) => {
|
|
108
|
-
const regexGroups = ["dynamic_expiry_date_after_\\d+_days.FORMAT_\\d", "unsubscribe\\(#[a-zA-Z\\d]{6}\\)","Link_to_[a-zA-z]","SURVEY.*.TOKEN","^[A-Za-z].*\\([\\d]*\\)"];
|
|
108
|
+
const regexGroups = ["dynamic_expiry_date_after_\\d+_days.FORMAT_\\d", "unsubscribe\\(#[a-zA-Z\\d]{6}\\)","Link_to_[a-zA-z]","SURVEY.*.TOKEN", "^[A-Za-z].*\\([a-zA-Z\\d]*\\)"];
|
|
109
109
|
let skipped = false;
|
|
110
110
|
lodashForEach(regexGroups, (group) => {
|
|
111
111
|
const groupRegex = new RegExp(group, "g");
|
|
@@ -102,454 +102,6 @@ export const tagsList = [
|
|
|
102
102
|
updatedAt: "2018-01-22T11:43:05.611Z",
|
|
103
103
|
},
|
|
104
104
|
];
|
|
105
|
-
|
|
106
|
-
export const badgesTags = [
|
|
107
|
-
{
|
|
108
|
-
_id: "655b080695c9df613dbbed4d",
|
|
109
|
-
type: "TAG",
|
|
110
|
-
definition: {
|
|
111
|
-
"label": {
|
|
112
|
-
"en": "Badge",
|
|
113
|
-
"ja-JP": "バッジ",
|
|
114
|
-
},
|
|
115
|
-
"value": "Badge",
|
|
116
|
-
"subtags": [
|
|
117
|
-
"Badge_expiry_date",
|
|
118
|
-
"Days_until_expiry",
|
|
119
|
-
"badges_enroll_expiring_in_days",
|
|
120
|
-
],
|
|
121
|
-
"tag-header": true,
|
|
122
|
-
"supportedModules": [
|
|
123
|
-
{
|
|
124
|
-
context: "loyalty",
|
|
125
|
-
layout: "sms",
|
|
126
|
-
mandatory: false,
|
|
127
|
-
},
|
|
128
|
-
{
|
|
129
|
-
context: "loyalty",
|
|
130
|
-
layout: "email",
|
|
131
|
-
mandatory: false,
|
|
132
|
-
},
|
|
133
|
-
{
|
|
134
|
-
context: "loyalty",
|
|
135
|
-
layout: "mobilepush",
|
|
136
|
-
mandatory: false,
|
|
137
|
-
},
|
|
138
|
-
{
|
|
139
|
-
context: "outbound",
|
|
140
|
-
layout: "sms",
|
|
141
|
-
mandatory: false,
|
|
142
|
-
},
|
|
143
|
-
{
|
|
144
|
-
context: "default",
|
|
145
|
-
layout: "sms",
|
|
146
|
-
mandatory: false,
|
|
147
|
-
},
|
|
148
|
-
{
|
|
149
|
-
context: "outbound",
|
|
150
|
-
layout: "email",
|
|
151
|
-
mandatory: false,
|
|
152
|
-
},
|
|
153
|
-
{
|
|
154
|
-
context: "default",
|
|
155
|
-
layout: "email",
|
|
156
|
-
mandatory: false,
|
|
157
|
-
},
|
|
158
|
-
{
|
|
159
|
-
context: "outbound",
|
|
160
|
-
layout: "mobilepush",
|
|
161
|
-
mandatory: false,
|
|
162
|
-
},
|
|
163
|
-
{
|
|
164
|
-
context: "default",
|
|
165
|
-
layout: "mobilepush",
|
|
166
|
-
mandatory: false,
|
|
167
|
-
},
|
|
168
|
-
{
|
|
169
|
-
context: "outbound",
|
|
170
|
-
layout: "wechat",
|
|
171
|
-
mandatory: false,
|
|
172
|
-
},
|
|
173
|
-
{
|
|
174
|
-
context: "default",
|
|
175
|
-
layout: "wechat",
|
|
176
|
-
mandatory: false,
|
|
177
|
-
},
|
|
178
|
-
{
|
|
179
|
-
context: "outbound",
|
|
180
|
-
layout: "line",
|
|
181
|
-
mandatory: false,
|
|
182
|
-
},
|
|
183
|
-
{
|
|
184
|
-
context: "default",
|
|
185
|
-
layout: "line",
|
|
186
|
-
mandatory: false,
|
|
187
|
-
},
|
|
188
|
-
{
|
|
189
|
-
context: "outbound",
|
|
190
|
-
layout: "ebill",
|
|
191
|
-
mandatory: false,
|
|
192
|
-
},
|
|
193
|
-
{
|
|
194
|
-
context: "default",
|
|
195
|
-
layout: "ebill",
|
|
196
|
-
mandatory: false,
|
|
197
|
-
},
|
|
198
|
-
],
|
|
199
|
-
},
|
|
200
|
-
scope: {
|
|
201
|
-
verticals: [],
|
|
202
|
-
orgId: -1,
|
|
203
|
-
tag: "STANDARD",
|
|
204
|
-
},
|
|
205
|
-
isActive: true,
|
|
206
|
-
createdBy: 15000449,
|
|
207
|
-
updatedBy: 15000449,
|
|
208
|
-
createdAt: "2022-06-24T10:28:45.738Z",
|
|
209
|
-
updatedAt: "2022-06-24T10:28:45.738Z",
|
|
210
|
-
},
|
|
211
|
-
{
|
|
212
|
-
_id: "655b0afec0af192ba585cc98",
|
|
213
|
-
type: "TAG",
|
|
214
|
-
definition: {
|
|
215
|
-
"label": {
|
|
216
|
-
"en": "Badge Expiry Date",
|
|
217
|
-
"ja-JP": "バッジの有効期限",
|
|
218
|
-
},
|
|
219
|
-
"value": "Badge_expiry_date",
|
|
220
|
-
"subtags": [
|
|
221
|
-
"badge_expiry_mm_slash_dd_slash_yyyy",
|
|
222
|
-
"badge_expiry_dd_slash_mm_slash_yyyy",
|
|
223
|
-
"badge_expiry_yyyy_hyphen_mm_hyphen_dd",
|
|
224
|
-
"badge_expiry_mm_slash_dd_slash_yy",
|
|
225
|
-
"badge_expiry_dd_space_Mon_space_yyyy",
|
|
226
|
-
"badge_expiry_Day_comma_space_Mon_space_dd_comma_space_yy",
|
|
227
|
-
"badge_expiry_Dd_dot_mm_dot_yy",
|
|
228
|
-
"badge_expiry_dd_space_Mon",
|
|
229
|
-
"badges_enroll_expiry_date.FORMAT_1",
|
|
230
|
-
"badges_enroll_expiry_date.FORMAT_2",
|
|
231
|
-
"badges_enroll_expiry_date.FORMAT_3",
|
|
232
|
-
"badges_enroll_expiry_date.FORMAT_4",
|
|
233
|
-
"badges_enroll_expiry_date.FORMAT_5",
|
|
234
|
-
"badges_enroll_expiry_date.FORMAT_6",
|
|
235
|
-
"badges_enroll_expiry_date.FORMAT_7",
|
|
236
|
-
"badges_enroll_expiry_date.FORMAT_8",
|
|
237
|
-
],
|
|
238
|
-
"tag-header": true,
|
|
239
|
-
"supportedModules": [
|
|
240
|
-
{
|
|
241
|
-
context: "loyalty",
|
|
242
|
-
layout: "sms",
|
|
243
|
-
mandatory: false,
|
|
244
|
-
},
|
|
245
|
-
{
|
|
246
|
-
context: "loyalty",
|
|
247
|
-
layout: "email",
|
|
248
|
-
mandatory: false,
|
|
249
|
-
},
|
|
250
|
-
{
|
|
251
|
-
context: "loyalty",
|
|
252
|
-
layout: "mobilepush",
|
|
253
|
-
mandatory: false,
|
|
254
|
-
},
|
|
255
|
-
{
|
|
256
|
-
context: "outbound",
|
|
257
|
-
layout: "sms",
|
|
258
|
-
mandatory: false,
|
|
259
|
-
},
|
|
260
|
-
{
|
|
261
|
-
context: "default",
|
|
262
|
-
layout: "sms",
|
|
263
|
-
mandatory: false,
|
|
264
|
-
},
|
|
265
|
-
{
|
|
266
|
-
context: "outbound",
|
|
267
|
-
layout: "email",
|
|
268
|
-
mandatory: false,
|
|
269
|
-
},
|
|
270
|
-
{
|
|
271
|
-
context: "default",
|
|
272
|
-
layout: "email",
|
|
273
|
-
mandatory: false,
|
|
274
|
-
},
|
|
275
|
-
{
|
|
276
|
-
context: "outbound",
|
|
277
|
-
layout: "mobilepush",
|
|
278
|
-
mandatory: false,
|
|
279
|
-
},
|
|
280
|
-
{
|
|
281
|
-
context: "default",
|
|
282
|
-
layout: "mobilepush",
|
|
283
|
-
mandatory: false,
|
|
284
|
-
},
|
|
285
|
-
{
|
|
286
|
-
context: "outbound",
|
|
287
|
-
layout: "wechat",
|
|
288
|
-
mandatory: false,
|
|
289
|
-
},
|
|
290
|
-
{
|
|
291
|
-
context: "default",
|
|
292
|
-
layout: "wechat",
|
|
293
|
-
mandatory: false,
|
|
294
|
-
},
|
|
295
|
-
{
|
|
296
|
-
context: "outbound",
|
|
297
|
-
layout: "line",
|
|
298
|
-
mandatory: false,
|
|
299
|
-
},
|
|
300
|
-
{
|
|
301
|
-
context: "default",
|
|
302
|
-
layout: "line",
|
|
303
|
-
mandatory: false,
|
|
304
|
-
},
|
|
305
|
-
{
|
|
306
|
-
context: "outbound",
|
|
307
|
-
layout: "ebill",
|
|
308
|
-
mandatory: false,
|
|
309
|
-
},
|
|
310
|
-
{
|
|
311
|
-
context: "default",
|
|
312
|
-
layout: "ebill",
|
|
313
|
-
mandatory: false,
|
|
314
|
-
},
|
|
315
|
-
],
|
|
316
|
-
},
|
|
317
|
-
scope: {
|
|
318
|
-
tag: "STANDARD",
|
|
319
|
-
orgId: -1,
|
|
320
|
-
verticals: [],
|
|
321
|
-
},
|
|
322
|
-
isActive: true,
|
|
323
|
-
},
|
|
324
|
-
{
|
|
325
|
-
_id: "655b617e48bc1275ad0c717c",
|
|
326
|
-
type: "TAG",
|
|
327
|
-
definition: {
|
|
328
|
-
"label": {
|
|
329
|
-
"en": "Days_until_expiry",
|
|
330
|
-
"ja-JP": "有効期限までの日数",
|
|
331
|
-
},
|
|
332
|
-
"value": "badges_enroll_expiring_in_days",
|
|
333
|
-
"subtags": [],
|
|
334
|
-
"tag-header": false,
|
|
335
|
-
"supportedModules": [
|
|
336
|
-
{
|
|
337
|
-
context: "outbound",
|
|
338
|
-
layout: "sms",
|
|
339
|
-
mandatory: false,
|
|
340
|
-
},
|
|
341
|
-
{
|
|
342
|
-
context: "default",
|
|
343
|
-
layout: "sms",
|
|
344
|
-
mandatory: false,
|
|
345
|
-
},
|
|
346
|
-
{
|
|
347
|
-
context: "outbound",
|
|
348
|
-
layout: "email",
|
|
349
|
-
mandatory: false,
|
|
350
|
-
},
|
|
351
|
-
{
|
|
352
|
-
context: "default",
|
|
353
|
-
layout: "email",
|
|
354
|
-
mandatory: false,
|
|
355
|
-
},
|
|
356
|
-
{
|
|
357
|
-
context: "outbound",
|
|
358
|
-
layout: "mobilepush",
|
|
359
|
-
mandatory: false,
|
|
360
|
-
},
|
|
361
|
-
{
|
|
362
|
-
context: "default",
|
|
363
|
-
layout: "mobilepush",
|
|
364
|
-
mandatory: false,
|
|
365
|
-
},
|
|
366
|
-
{
|
|
367
|
-
context: "outbound",
|
|
368
|
-
layout: "wechat",
|
|
369
|
-
mandatory: false,
|
|
370
|
-
},
|
|
371
|
-
{
|
|
372
|
-
context: "default",
|
|
373
|
-
layout: "wechat",
|
|
374
|
-
mandatory: false,
|
|
375
|
-
},
|
|
376
|
-
{
|
|
377
|
-
context: "outbound",
|
|
378
|
-
layout: "line",
|
|
379
|
-
mandatory: false,
|
|
380
|
-
},
|
|
381
|
-
{
|
|
382
|
-
context: "default",
|
|
383
|
-
layout: "line",
|
|
384
|
-
mandatory: false,
|
|
385
|
-
},
|
|
386
|
-
{
|
|
387
|
-
context: "outbound",
|
|
388
|
-
layout: "ebill",
|
|
389
|
-
mandatory: false,
|
|
390
|
-
},
|
|
391
|
-
{
|
|
392
|
-
context: "default",
|
|
393
|
-
layout: "ebill",
|
|
394
|
-
mandatory: false,
|
|
395
|
-
},
|
|
396
|
-
],
|
|
397
|
-
},
|
|
398
|
-
scope: {
|
|
399
|
-
verticals: [],
|
|
400
|
-
orgId: -1,
|
|
401
|
-
tag: "STANDARD",
|
|
402
|
-
},
|
|
403
|
-
isActive: true,
|
|
404
|
-
},
|
|
405
|
-
{
|
|
406
|
-
_id: "65818c77915d01082d1d34de",
|
|
407
|
-
type: "TAG",
|
|
408
|
-
definition: {
|
|
409
|
-
"label": {
|
|
410
|
-
en: "mm/dd/yyyy",
|
|
411
|
-
},
|
|
412
|
-
"value": "badges_enroll_expiry_date.FORMAT_1",
|
|
413
|
-
"subtags": [],
|
|
414
|
-
"tag-header": false,
|
|
415
|
-
"supportedModules": [
|
|
416
|
-
{
|
|
417
|
-
context: "outbound",
|
|
418
|
-
layout: "sms",
|
|
419
|
-
mandatory: false,
|
|
420
|
-
},
|
|
421
|
-
{
|
|
422
|
-
context: "default",
|
|
423
|
-
layout: "sms",
|
|
424
|
-
mandatory: false,
|
|
425
|
-
},
|
|
426
|
-
{
|
|
427
|
-
context: "outbound",
|
|
428
|
-
layout: "email",
|
|
429
|
-
mandatory: false,
|
|
430
|
-
},
|
|
431
|
-
{
|
|
432
|
-
context: "default",
|
|
433
|
-
layout: "email",
|
|
434
|
-
mandatory: false,
|
|
435
|
-
},
|
|
436
|
-
{
|
|
437
|
-
context: "outbound",
|
|
438
|
-
layout: "mobilepush",
|
|
439
|
-
mandatory: false,
|
|
440
|
-
},
|
|
441
|
-
{
|
|
442
|
-
context: "default",
|
|
443
|
-
layout: "mobilepush",
|
|
444
|
-
mandatory: false,
|
|
445
|
-
},
|
|
446
|
-
{
|
|
447
|
-
context: "outbound",
|
|
448
|
-
layout: "wechat",
|
|
449
|
-
mandatory: false,
|
|
450
|
-
},
|
|
451
|
-
{
|
|
452
|
-
context: "default",
|
|
453
|
-
layout: "wechat",
|
|
454
|
-
mandatory: false,
|
|
455
|
-
},
|
|
456
|
-
{
|
|
457
|
-
context: "outbound",
|
|
458
|
-
layout: "line",
|
|
459
|
-
mandatory: false,
|
|
460
|
-
},
|
|
461
|
-
{
|
|
462
|
-
context: "default",
|
|
463
|
-
layout: "line",
|
|
464
|
-
mandatory: false,
|
|
465
|
-
},
|
|
466
|
-
{
|
|
467
|
-
context: "outbound",
|
|
468
|
-
layout: "ebill",
|
|
469
|
-
mandatory: false,
|
|
470
|
-
},
|
|
471
|
-
{
|
|
472
|
-
context: "default",
|
|
473
|
-
layout: "ebill",
|
|
474
|
-
mandatory: false,
|
|
475
|
-
},
|
|
476
|
-
],
|
|
477
|
-
},
|
|
478
|
-
scope: {
|
|
479
|
-
tag: "STANDARD",
|
|
480
|
-
orgId: -1,
|
|
481
|
-
verticals: [],
|
|
482
|
-
},
|
|
483
|
-
isActive: true,
|
|
484
|
-
},
|
|
485
|
-
];
|
|
486
|
-
export const OfferTag = [{
|
|
487
|
-
_id: "5aaa0cec7472bc0eab75f55b",
|
|
488
|
-
type: "TAG",
|
|
489
|
-
definition: {
|
|
490
|
-
"supportedModules": [
|
|
491
|
-
{
|
|
492
|
-
context: "journey",
|
|
493
|
-
layout: "sms",
|
|
494
|
-
mandatory: false,
|
|
495
|
-
},
|
|
496
|
-
{
|
|
497
|
-
context: "journey",
|
|
498
|
-
layout: "email",
|
|
499
|
-
mandatory: false,
|
|
500
|
-
},
|
|
501
|
-
{
|
|
502
|
-
context: "journey",
|
|
503
|
-
layout: "mobilepush",
|
|
504
|
-
mandatory: false,
|
|
505
|
-
},
|
|
506
|
-
{
|
|
507
|
-
context: "default",
|
|
508
|
-
layout: "sms",
|
|
509
|
-
mandatory: false,
|
|
510
|
-
},
|
|
511
|
-
{
|
|
512
|
-
context: "outbound",
|
|
513
|
-
layout: "sms",
|
|
514
|
-
mandatory: false,
|
|
515
|
-
},
|
|
516
|
-
{
|
|
517
|
-
context: "outbound",
|
|
518
|
-
layout: "line",
|
|
519
|
-
mandatory: false,
|
|
520
|
-
},
|
|
521
|
-
{
|
|
522
|
-
context: "default",
|
|
523
|
-
layout: "line",
|
|
524
|
-
mandatory: false,
|
|
525
|
-
},
|
|
526
|
-
],
|
|
527
|
-
"tag-header": true,
|
|
528
|
-
"subtags": [
|
|
529
|
-
"voucher",
|
|
530
|
-
"valid_till_date",
|
|
531
|
-
"valid_days_from_create",
|
|
532
|
-
],
|
|
533
|
-
"value": "coupon",
|
|
534
|
-
"label": {
|
|
535
|
-
"en": "Coupons",
|
|
536
|
-
"ja-JP": "クーポン",
|
|
537
|
-
},
|
|
538
|
-
},
|
|
539
|
-
scope: {
|
|
540
|
-
tag: "STANDARD",
|
|
541
|
-
orgId: -1,
|
|
542
|
-
verticals: [],
|
|
543
|
-
},
|
|
544
|
-
isActive: true,
|
|
545
|
-
createdBy: 15000449,
|
|
546
|
-
updatedBy: 15000449,
|
|
547
|
-
createdAt: "2018-03-15T06:04:28.484Z",
|
|
548
|
-
updatedAt: "2018-03-15T06:04:28.484Z",
|
|
549
|
-
},
|
|
550
|
-
];
|
|
551
|
-
export const offerOutput = [{children: [{disabled: undefined, title: "mac", value: "{{undefined}}"}], disabled: false, selectable: false, title: "Coupons", value: "{{coupon}}"}];
|
|
552
|
-
export const badgesOutput = [{children: [{children: [{children: [{disabled: false, title: "mm/dd/yyyy", value: "{{badges_enroll_expiry_date.FORMAT_1}}"}], disabled: false, selectable: false, title: "Badge Expiry Date", value: "{{Badge_expiry_date}}"}, {disabled: false, title: "Days_until_expiry", value: "{{badges_enroll_expiring_in_days}}"}], disabled: undefined, selectable: false, title: "moye_moye", value: "{{undefined}}"}], disabled: false, selectable: false, title: "Badge", value: "{{Badge}}"}];
|
|
553
105
|
export const tagsToFilter = ["timeSpan_Start"];
|
|
554
106
|
|
|
555
107
|
export const output1 = [
|
|
@@ -571,42 +123,3 @@ export const output2 = [
|
|
|
571
123
|
value: "{{optout}}",
|
|
572
124
|
},
|
|
573
125
|
];
|
|
574
|
-
export const offer = [
|
|
575
|
-
{ badgesMetaId: "12", badgeName: "moye_moye", type: "BADGES_ENROLL" },
|
|
576
|
-
];
|
|
577
|
-
export const expectedOffer = [
|
|
578
|
-
{
|
|
579
|
-
children: [
|
|
580
|
-
{
|
|
581
|
-
children: [
|
|
582
|
-
{
|
|
583
|
-
children: [
|
|
584
|
-
{
|
|
585
|
-
disabled: false,
|
|
586
|
-
title: "mm/dd/yyyy",
|
|
587
|
-
value: "{{badges_enroll_expiry_date.FORMAT_1}}",
|
|
588
|
-
},
|
|
589
|
-
],
|
|
590
|
-
disabled: false,
|
|
591
|
-
selectable: false,
|
|
592
|
-
title: "Badge Expiry Date",
|
|
593
|
-
value: "{{Badge_expiry_date}}",
|
|
594
|
-
},
|
|
595
|
-
{
|
|
596
|
-
disabled: false,
|
|
597
|
-
title: "Days_until_expiry",
|
|
598
|
-
value: "{{badges_enroll_expiring_in_days}}",
|
|
599
|
-
},
|
|
600
|
-
],
|
|
601
|
-
disabled: undefined,
|
|
602
|
-
selectable: false,
|
|
603
|
-
title: "moye_moye",
|
|
604
|
-
value: "{{undefined}}",
|
|
605
|
-
},
|
|
606
|
-
],
|
|
607
|
-
disabled: false,
|
|
608
|
-
selectable: false,
|
|
609
|
-
title: "Badge",
|
|
610
|
-
value: "{{Badge}}",
|
|
611
|
-
},
|
|
612
|
-
];
|
|
@@ -11,19 +11,12 @@ describe("getTreeStructuredTags test", () => {
|
|
|
11
11
|
it("test for getTreeStructuredTags when tagsList is empty", () => {
|
|
12
12
|
expect(getTreeStructuredTags({tagsList: []})).toEqual([]);
|
|
13
13
|
});
|
|
14
|
-
|
|
15
|
-
it("test for getTreeStructuredTags when incentive attached is BADGES", () => {
|
|
16
|
-
expect(getTreeStructuredTags({tagsList: mockdata.badgesTags, offerDetails: mockdata.offer})).toEqual(mockdata.expectedOffer);
|
|
17
|
-
});
|
|
18
14
|
it("test for filterTags", () => {
|
|
19
15
|
expect(filterTags(mockdata.tagsToFilter, mockdata.tagsList)).toEqual([mockdata.tagsList[1]]);
|
|
20
16
|
});
|
|
21
17
|
it("test for filterTags when tagsToFilter and tagsList is empty", () => {
|
|
22
18
|
expect(filterTags([], [])).toEqual([]);
|
|
23
19
|
});
|
|
24
|
-
it("test for getTreeStructuredTags when incentive attached is offer", () => {
|
|
25
|
-
expect(getTreeStructuredTags({tagsList: mockdata.OfferTag, offerDetails: [{id: '12', couponName: 'mac'}]})).toEqual(mockdata.offerOutput);
|
|
26
|
-
});
|
|
27
20
|
});
|
|
28
21
|
|
|
29
22
|
describe("getUserNameById test", () => {
|
|
@@ -202,9 +202,9 @@ class CapTagList extends React.Component { // eslint-disable-line react/prefer-s
|
|
|
202
202
|
const temp = this.renderTags(val.subtags, '', disabled);
|
|
203
203
|
const tagValue = (
|
|
204
204
|
<CapTreeNode
|
|
205
|
-
title={disabled ? <CapTooltip title={loyaltyAttrDisableText}>{val
|
|
205
|
+
title={disabled ? <CapTooltip title={loyaltyAttrDisableText}>{val.name}</CapTooltip> : val.name}
|
|
206
206
|
tag={val}
|
|
207
|
-
key={val
|
|
207
|
+
key={val.couponSeriesId ? `${key}(${val.couponSeriesId})` : `${key}`}
|
|
208
208
|
disabled={disabled}
|
|
209
209
|
>
|
|
210
210
|
{temp}
|
|
@@ -223,7 +223,7 @@ class CapTagList extends React.Component { // eslint-disable-line react/prefer-s
|
|
|
223
223
|
title={childDisabled ? <CapTooltip title={key === CUSTOMER_BARCODE_TAG ? customerBarcodeDisableText : loyaltyAttrDisableText}>{val.desc || val.name}</CapTooltip> : (val.desc || val.name)}
|
|
224
224
|
tag={val}
|
|
225
225
|
isLeaf
|
|
226
|
-
key={val
|
|
226
|
+
key={val.couponSeriesId ? `${key}(${val.couponSeriesId})` : `${key}`}
|
|
227
227
|
disabled={childDisabled}
|
|
228
228
|
>
|
|
229
229
|
</CapTreeNode>);
|
|
@@ -1093,7 +1093,8 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
1093
1093
|
}
|
|
1094
1094
|
|
|
1095
1095
|
skipTags(tag) {
|
|
1096
|
-
const regexGroups = ["dynamic_expiry_date_after_\\d+_days.FORMAT_\\d", "unsubscribe\\(#[a-zA-Z\\d]{6}\\)","Link_to_[a-zA-z]","SURVEY.*.TOKEN","^[A-Za-z].*\\([a-zA-Z\\d]*\\)"];
|
|
1096
|
+
const regexGroups = ["dynamic_expiry_date_after_\\d+_days.FORMAT_\\d", "unsubscribe\\(#[a-zA-Z\\d]{6}\\)","Link_to_[a-zA-z]","SURVEY.*.TOKEN", "^[A-Za-z].*\\([a-zA-Z\\d]*\\)"];
|
|
1097
|
+
|
|
1097
1098
|
//const regexGroups = [];
|
|
1098
1099
|
let skipped = false;
|
|
1099
1100
|
_.forEach(regexGroups, (group) => {
|
|
@@ -744,6 +744,7 @@ export function SlideBoxContent(props) {
|
|
|
744
744
|
getFormSubscriptionData={getFormData}
|
|
745
745
|
onShowTemplates={onShowTemplates}
|
|
746
746
|
templateData={templateData}
|
|
747
|
+
selectedOfferDetails={selectedOfferDetails}
|
|
747
748
|
createNew/>
|
|
748
749
|
)}
|
|
749
750
|
|
|
@@ -759,6 +760,7 @@ export function SlideBoxContent(props) {
|
|
|
759
760
|
getFormSubscriptionData={getFormData}
|
|
760
761
|
onShowTemplates={onShowTemplates}
|
|
761
762
|
templateData={templateData}
|
|
763
|
+
selectedOfferDetails={selectedOfferDetails}
|
|
762
764
|
createNew/> }
|
|
763
765
|
|
|
764
766
|
{isCreateWhatsapp && (<Whatsapp
|
|
@@ -22,8 +22,8 @@ import './_tagList.scss';
|
|
|
22
22
|
import { selectCurrentOrgDetails } from '../Cap/selectors';
|
|
23
23
|
import { injectIntl } from 'react-intl';
|
|
24
24
|
import { scope } from './messages';
|
|
25
|
-
import { handleInjectedData, hasGiftVoucherFeature, hasPromoFeature, hasBadgesFeature
|
|
26
|
-
import { GIFT_VOUCHER_RELATED_TAGS, PROMO_ENGINE_RELATED_TAGS, BADGES_RELATED_TAGS
|
|
25
|
+
import { handleInjectedData, hasGiftVoucherFeature, hasPromoFeature, hasBadgesFeature } from '../../utils/common';
|
|
26
|
+
import { GIFT_VOUCHER_RELATED_TAGS, PROMO_ENGINE_RELATED_TAGS, BADGES_RELATED_TAGS } from '../../containers/App/constants';
|
|
27
27
|
|
|
28
28
|
const TreeNode = Tree.TreeNode;
|
|
29
29
|
|
|
@@ -79,7 +79,6 @@ export class TagList extends React.Component { // eslint-disable-line react/pref
|
|
|
79
79
|
generateTags = (props) => {
|
|
80
80
|
let tags = {};
|
|
81
81
|
let injectedTags = {};
|
|
82
|
-
const {selectedOfferDetails } = props;
|
|
83
82
|
if (props.injectedTags && !_.isEmpty(props.injectedTags)) {
|
|
84
83
|
const formattedInjectedTags = handleInjectedData(
|
|
85
84
|
props.injectedTags,
|
|
@@ -90,12 +89,8 @@ export class TagList extends React.Component { // eslint-disable-line react/pref
|
|
|
90
89
|
if (props.tags && props.tags.length > 0) {
|
|
91
90
|
tags = this.populateTags(props.tags);
|
|
92
91
|
}
|
|
93
|
-
if (selectedOfferDetails && !_.isEmpty(selectedOfferDetails) ) {
|
|
94
|
-
|
|
95
|
-
transformBadgeTags(selectedOfferDetails, tags);
|
|
96
|
-
} else if (tags && tags?.coupon) {
|
|
97
|
-
this.transformCouponTags(selectedOfferDetails, tags);
|
|
98
|
-
}
|
|
92
|
+
if (props.selectedOfferDetails && !_.isEmpty(props.selectedOfferDetails) && (tags && tags.coupon)) {
|
|
93
|
+
this.transformCouponTags(props.selectedOfferDetails, tags);
|
|
99
94
|
}
|
|
100
95
|
this.setState({tags: _.merge( {}, tags, injectedTags)});
|
|
101
96
|
}
|
|
@@ -135,7 +130,7 @@ export class TagList extends React.Component { // eslint-disable-line react/pref
|
|
|
135
130
|
'tag-header': true,
|
|
136
131
|
"name": tag?.label[userLocale] ? tag?.label[userLocale] : tag?.label?.en,
|
|
137
132
|
"desc": tag?.label[userLocale] ? tag?.label[userLocale] : tag?.label?.en,
|
|
138
|
-
"subtags": tag
|
|
133
|
+
"subtags": tag.subtags,
|
|
139
134
|
};
|
|
140
135
|
}
|
|
141
136
|
});
|
|
@@ -202,7 +197,7 @@ export class TagList extends React.Component { // eslint-disable-line react/pref
|
|
|
202
197
|
return {
|
|
203
198
|
...obj,
|
|
204
199
|
...tempObj,
|
|
205
|
-
|
|
200
|
+
couponSeriesId: id,
|
|
206
201
|
};
|
|
207
202
|
};
|
|
208
203
|
offerDetails.forEach((offer) => {
|
|
@@ -219,7 +214,7 @@ export class TagList extends React.Component { // eslint-disable-line react/pref
|
|
|
219
214
|
'tag-header': true,
|
|
220
215
|
'name': couponNameFinal || couponId,
|
|
221
216
|
'desc': couponNameFinal || couponId,
|
|
222
|
-
'
|
|
217
|
+
'couponSeriesId': couponId,
|
|
223
218
|
'subtags': couponSubTags,
|
|
224
219
|
'resolved': true,
|
|
225
220
|
'couponTags': true,
|
|
@@ -311,7 +306,7 @@ TagList.propTypes = {
|
|
|
311
306
|
modalProps: PropTypes.any,
|
|
312
307
|
currentOrgDetails: PropTypes.object,
|
|
313
308
|
channel: PropTypes.string,
|
|
314
|
-
disabled: PropTypes.bool
|
|
309
|
+
disabled: PropTypes.bool
|
|
315
310
|
};
|
|
316
311
|
|
|
317
312
|
const mapStateToProps = createStructuredSelector({
|
|
@@ -77,6 +77,7 @@ const Viber = (props) => {
|
|
|
77
77
|
viber = {},
|
|
78
78
|
getFormSubscriptionData,
|
|
79
79
|
viberData = {},
|
|
80
|
+
selectedOfferDetails = [],
|
|
80
81
|
} = props || {};
|
|
81
82
|
|
|
82
83
|
const { formatMessage } = intl;
|
|
@@ -287,6 +288,7 @@ const Viber = (props) => {
|
|
|
287
288
|
injectedTags={injectedTags || {}}
|
|
288
289
|
id={'viber_tags'}
|
|
289
290
|
userLocale={localStorage.getItem('jlocale') || 'en'}
|
|
291
|
+
selectedOfferDetails={selectedOfferDetails}
|
|
290
292
|
/>
|
|
291
293
|
</>);
|
|
292
294
|
|