@capillarytech/creatives-library 7.17.66-alpha.2 → 7.17.66-alpha.4

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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@capillarytech/creatives-library",
3
3
  "author": "meharaj",
4
- "version": "7.17.66-alpha.2",
4
+ "version": "7.17.66-alpha.4",
5
5
  "description": "Capillary creatives ui",
6
6
  "main": "./index.js",
7
7
  "module": "./index.es.js",
package/utils/common.js CHANGED
@@ -248,7 +248,7 @@ export function transformBadgeTags(badgeDetails, allTags) {
248
248
  };
249
249
  };
250
250
  badgeDetails.forEach((offer) => {
251
- const { badgeId, badgeName } = offer;
251
+ const { badgeId, badgeName } = offer || {};
252
252
  const badgeSubTags = {};
253
253
  badgeTagsKeys.forEach((badgeTagKey) => {
254
254
  const badgeSubTagsObj = withBadgeId(allTags?.Badge?.subtags[badgeTagKey], badgeId);
@@ -116,27 +116,53 @@ export const badgesTags = [
116
116
  "subtags": [
117
117
  "Badge_expiry_date",
118
118
  "Days_until_expiry",
119
+ "badges_enroll_expiring_in_days",
119
120
  ],
120
121
  "tag-header": true,
121
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
+ },
122
138
  {
123
139
  context: "outbound",
124
140
  layout: "sms",
125
141
  mandatory: false,
126
142
  },
143
+ {
144
+ context: "default",
145
+ layout: "sms",
146
+ mandatory: false,
147
+ },
127
148
  {
128
149
  context: "outbound",
129
150
  layout: "email",
130
151
  mandatory: false,
131
152
  },
153
+ {
154
+ context: "default",
155
+ layout: "email",
156
+ mandatory: false,
157
+ },
132
158
  {
133
159
  context: "outbound",
134
160
  layout: "mobilepush",
135
161
  mandatory: false,
136
162
  },
137
163
  {
138
- context: "outbound",
139
- layout: "line",
164
+ context: "default",
165
+ layout: "mobilepush",
140
166
  mandatory: false,
141
167
  },
142
168
  {
@@ -150,20 +176,67 @@ export const badgesTags = [
150
176
  mandatory: false,
151
177
  },
152
178
  {
153
- context: "journey",
154
- layout: "sms",
179
+ context: "outbound",
180
+ layout: "line",
155
181
  mandatory: false,
156
182
  },
157
183
  {
158
- context: "journey",
159
- layout: "email",
184
+ context: "default",
185
+ layout: "line",
160
186
  mandatory: false,
161
187
  },
162
188
  {
163
- context: "journey",
164
- layout: "mobilepush",
189
+ context: "outbound",
190
+ layout: "ebill",
165
191
  mandatory: false,
166
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": [
167
240
  {
168
241
  context: "loyalty",
169
242
  layout: "sms",
@@ -179,28 +252,84 @@ export const badgesTags = [
179
252
  layout: "mobilepush",
180
253
  mandatory: false,
181
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
+ },
182
315
  ],
183
316
  },
184
317
  scope: {
185
- verticals: [],
186
- orgId: -1,
187
318
  tag: "STANDARD",
319
+ orgId: -1,
320
+ verticals: [],
188
321
  },
189
322
  isActive: true,
190
- createdBy: 15000449,
191
- updatedBy: 15000449,
192
- createdAt: "2022-06-24T10:28:45.738Z",
193
- updatedAt: "2022-06-24T10:28:45.738Z",
194
323
  },
195
324
  {
196
325
  _id: "655b617e48bc1275ad0c717c",
197
326
  type: "TAG",
198
327
  definition: {
199
328
  "label": {
200
- "en": "Days Until Expiry",
329
+ "en": "Days_until_expiry",
201
330
  "ja-JP": "有効期限までの日数",
202
331
  },
203
- "value": "Days_until_expiry",
332
+ "value": "badges_enroll_expiring_in_days",
204
333
  "subtags": [],
205
334
  "tag-header": false,
206
335
  "supportedModules": [
@@ -209,19 +338,29 @@ export const badgesTags = [
209
338
  layout: "sms",
210
339
  mandatory: false,
211
340
  },
341
+ {
342
+ context: "default",
343
+ layout: "sms",
344
+ mandatory: false,
345
+ },
212
346
  {
213
347
  context: "outbound",
214
348
  layout: "email",
215
349
  mandatory: false,
216
350
  },
351
+ {
352
+ context: "default",
353
+ layout: "email",
354
+ mandatory: false,
355
+ },
217
356
  {
218
357
  context: "outbound",
219
358
  layout: "mobilepush",
220
359
  mandatory: false,
221
360
  },
222
361
  {
223
- context: "outbound",
224
- layout: "line",
362
+ context: "default",
363
+ layout: "mobilepush",
225
364
  mandatory: false,
226
365
  },
227
366
  {
@@ -235,41 +374,111 @@ export const badgesTags = [
235
374
  mandatory: false,
236
375
  },
237
376
  {
238
- context: "journey",
239
- layout: "sms",
377
+ context: "outbound",
378
+ layout: "line",
240
379
  mandatory: false,
241
380
  },
242
381
  {
243
- context: "journey",
244
- layout: "email",
382
+ context: "default",
383
+ layout: "line",
245
384
  mandatory: false,
246
385
  },
247
386
  {
248
- context: "journey",
249
- layout: "mobilepush",
387
+ context: "outbound",
388
+ layout: "ebill",
250
389
  mandatory: false,
251
390
  },
252
391
  {
253
- context: "loyalty",
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",
254
418
  layout: "sms",
255
419
  mandatory: false,
256
420
  },
257
421
  {
258
- context: "loyalty",
422
+ context: "default",
423
+ layout: "sms",
424
+ mandatory: false,
425
+ },
426
+ {
427
+ context: "outbound",
259
428
  layout: "email",
260
429
  mandatory: false,
261
430
  },
262
431
  {
263
- context: "loyalty",
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",
264
443
  layout: "mobilepush",
265
444
  mandatory: false,
266
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
+ },
267
476
  ],
268
477
  },
269
478
  scope: {
270
- verticals: [],
271
- orgId: -1,
272
479
  tag: "STANDARD",
480
+ orgId: -1,
481
+ verticals: [],
273
482
  },
274
483
  isActive: true,
275
484
  },
@@ -339,28 +548,8 @@ export const OfferTag = [{
339
548
  updatedAt: "2018-03-15T06:04:28.484Z",
340
549
  },
341
550
  ];
342
- export const offerOutput = [{"children": [{"disabled": undefined, "title": "mac", "value": "{{undefined}}"}], "disabled": false, "selectable": false, "title": "Coupons", "value": "{{coupon}}"}];
343
- export const badgesOutput = [{
344
- children: [
345
- {
346
- children: [
347
- {
348
- disabled: false,
349
- title: "Days Until Expiry",
350
- value: "{{Days_until_expiry}}",
351
- },
352
- ],
353
- disabled: undefined,
354
- selectable: false,
355
- title: "moye_moye",
356
- value: "{{undefined}}",
357
- },
358
- ],
359
- disabled: false,
360
- selectable: false,
361
- title: "Badge",
362
- value: "{{Badge}}",
363
- }];
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}}"}];
364
553
  export const tagsToFilter = ["timeSpan_Start"];
365
554
 
366
555
  export const output1 = [
@@ -13,7 +13,7 @@ describe("getTreeStructuredTags test", () => {
13
13
  });
14
14
 
15
15
  it("test for getTreeStructuredTags when incentive attached is BADGES", () => {
16
- expect(getTreeStructuredTags({tagsList: mockdata.badgesTags, offerDetails: [{badgeId: '12', badgeName: 'moye_moye', type: "BADGES"}]})).toEqual(mockdata.badgesOutput);
16
+ expect(getTreeStructuredTags({tagsList: mockdata.badgesTags, offerDetails: [{badgeId: '12', badgeName: 'moye_moye', type: "BADGES"}]})).toEqual([{"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}}"}]);
17
17
  });
18
18
  it("test for filterTags", () => {
19
19
  expect(filterTags(mockdata.tagsToFilter, mockdata.tagsList)).toEqual([mockdata.tagsList[1]]);
@@ -1093,8 +1093,7 @@ 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].*\\([\\d]*\\)"];
1097
-
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]*\\)"];
1098
1097
  //const regexGroups = [];
1099
1098
  let skipped = false;
1100
1099
  _.forEach(regexGroups, (group) => {
@@ -89,10 +89,8 @@ export class TagList extends React.Component { // eslint-disable-line react/pref
89
89
  if (props.tags && props.tags.length > 0) {
90
90
  tags = this.populateTags(props.tags);
91
91
  }
92
- console.log(`selected Badges: ${props.selectedOfferDetails}, ${JSON.stringify(tags)}`);
93
92
  if (props.selectedOfferDetails && !_.isEmpty(props.selectedOfferDetails) ) {
94
- console.log(`selected offers: ${JSON.stringify(props.selectedOfferDetails)}`);
95
- if ((props?.selectedOfferDetails[0]?.type === 'BADGES') && (tags && tags?.badge) ) {
93
+ if ((props?.selectedOfferDetails[0]?.type === 'BADGES') && (tags && tags?.Badge) ) {
96
94
  transformBadgeTags(props.selectedOfferDetails, tags);
97
95
  } else if (tags && tags?.coupon) {
98
96
  this.transformCouponTags(props.selectedOfferDetails, tags);