@capillarytech/creatives-library 0.0.2 → 0.0.3
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/CapTagList/index.js +2 -2
- package/components/CapTagList/messages.js +4 -0
- package/components/CardGrid/index.js +2 -2
- package/components/Ckeditor/index.js +3 -1
- package/components/Edmeditor/index.js +1 -1
- package/components/FormBuilder/index.js +143 -38
- package/containers/Ebill/index.js +1 -1
- package/containers/Ebill/reducer.js +5 -2
- package/containers/Ebill/sagas.js +6 -2
- package/containers/Email/_email.scss +9 -0
- package/containers/Email/index.js +643 -602
- package/containers/Email/reducer.js +5 -2
- package/containers/Email/sagas.js +6 -2
- package/containers/MobilePush/Create/index.js +23 -1
- package/containers/MobilePush/Create/messages.js +1 -1
- package/containers/MobilePush/Create/reducer.js +6 -3
- package/containers/MobilePush/Create/sagas.js +6 -3
- package/containers/MobilePush/Edit/index.js +22 -1
- package/containers/MobilePush/Edit/messages.js +1 -1
- package/containers/MobilePush/Edit/reducer.js +6 -3
- package/containers/MobilePush/Edit/sagas.js +6 -3
- package/containers/Sms/Create/index.js +18 -11
- package/containers/Sms/Create/messages.js +4 -0
- package/containers/Sms/Create/reducer.js +6 -3
- package/containers/Sms/Create/sagas.js +7 -2
- package/containers/Sms/Edit/index.js +18 -11
- package/containers/Sms/Edit/messages.js +4 -0
- package/containers/Sms/Edit/reducer.js +6 -3
- package/containers/Sms/Edit/sagas.js +7 -2
- package/containers/Templates/index.js +85 -19
- package/containers/Templates/messages.js +28 -0
- package/containers/Templates/reducer.js +3 -2
- package/package.json +1 -1
|
@@ -45,542 +45,544 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
45
45
|
change: this.onChange,
|
|
46
46
|
},
|
|
47
47
|
isEdit: false,
|
|
48
|
-
schema: {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
48
|
+
schema: {},
|
|
49
|
+
// schema: {
|
|
50
|
+
// standalone: {
|
|
51
|
+
// sections: [
|
|
52
|
+
// {
|
|
53
|
+
// type: "col-label",
|
|
54
|
+
// inputFields: [
|
|
55
|
+
// {
|
|
56
|
+
// id: "template-subject",
|
|
57
|
+
// placeholder: "Enter Email Subject",
|
|
58
|
+
// type: "input",
|
|
59
|
+
// metaType: "text",
|
|
60
|
+
// datatype: "string",
|
|
61
|
+
// required: true,
|
|
62
|
+
// label: "Subject",
|
|
63
|
+
// style: {
|
|
64
|
+
// fontSize: "20px",
|
|
65
|
+
// fontFamily: "proxima-nova,sans-serif",
|
|
66
|
+
// fontStyle: "normal",
|
|
67
|
+
// fontWeight: 600,
|
|
68
|
+
// display: (this.props.location.query.type === 'embedded' && (this.props.location.query.module === "loyalty" || this.props.location.query.module === "dvs")) ? "" : "none",
|
|
69
|
+
// },
|
|
70
|
+
// labelStyle: {
|
|
71
|
+
// fontSize: "18px",
|
|
72
|
+
// fontFamily: "proxima-nova,sans-serif",
|
|
73
|
+
// fontStyle: "normal",
|
|
74
|
+
// fontWeight: 600,
|
|
75
|
+
// display: (this.props.location.query.type === 'embedded' && (this.props.location.query.module === "loyalty" || this.props.location.query.module === "dvs")) ? "" : "none",
|
|
76
|
+
// background: "white",
|
|
77
|
+
// },
|
|
78
|
+
// styling: "semantic",
|
|
79
|
+
// order: 1,
|
|
80
|
+
// width: 9,
|
|
81
|
+
// customComponent: false,
|
|
82
|
+
// standalone: true,
|
|
83
|
+
// onlyDisplay: false,
|
|
84
|
+
// errorMessage: "Email Subject cannot be empty.",
|
|
85
|
+
// // supportedEvents: [
|
|
86
|
+
// // "onChange",
|
|
87
|
+
// // ],
|
|
88
|
+
// },
|
|
89
|
+
// ],
|
|
90
|
+
// },
|
|
91
|
+
// {
|
|
92
|
+
// type: "multicols",
|
|
93
|
+
// inputFields: [
|
|
94
|
+
// {
|
|
95
|
+
// cols: [
|
|
96
|
+
// {
|
|
97
|
+
// id: "template-name",
|
|
98
|
+
// placeholder: "Enter template name",
|
|
99
|
+
// type: "input",
|
|
100
|
+
// metaType: "text",
|
|
101
|
+
// datatype: "string",
|
|
102
|
+
// required: true,
|
|
103
|
+
// style: {
|
|
104
|
+
// fontSize: "20px",
|
|
105
|
+
// fontFamily: "proxima-nova,sans-serif",
|
|
106
|
+
// fontStyle: "normal",
|
|
107
|
+
// fontWeight: 600,
|
|
108
|
+
// },
|
|
109
|
+
// styling: "semantic",
|
|
110
|
+
// order: 1,
|
|
111
|
+
// width: 9,
|
|
112
|
+
// customComponent: false,
|
|
113
|
+
// standalone: true,
|
|
114
|
+
// onlyDisplay: false,
|
|
115
|
+
// errorMessage: "Template name cannot be empty.",
|
|
116
|
+
// supportedEvents: [
|
|
117
|
+
// "onChange",
|
|
118
|
+
// ],
|
|
119
|
+
// },
|
|
120
|
+
// {
|
|
121
|
+
// id: "template-version",
|
|
122
|
+
// type: "select", //Resembles component to be used
|
|
123
|
+
// options: [],
|
|
124
|
+
// metaType: "text",
|
|
125
|
+
// datatype: "string",
|
|
126
|
+
// required: true,
|
|
127
|
+
// fluid: true,
|
|
128
|
+
// style: {
|
|
129
|
+
// fontSize: '14px',
|
|
130
|
+
// fontFamily: 'open-sans',
|
|
131
|
+
// fontStyle: 'normal',
|
|
132
|
+
// marginBottom: '16px',
|
|
133
|
+
// },
|
|
134
|
+
// styling: "semantic",
|
|
135
|
+
// order: 1,
|
|
136
|
+
// width: 5,
|
|
137
|
+
// customComponent: false,
|
|
138
|
+
// standalone: true,
|
|
139
|
+
// supportedEvents: [
|
|
140
|
+
// 'onSelect',
|
|
141
|
+
// 'addVersion',
|
|
142
|
+
// ],
|
|
143
|
+
// },
|
|
144
|
+
// {
|
|
145
|
+
// id: "preview-button",
|
|
146
|
+
// width: 3,
|
|
147
|
+
// offset: 3,
|
|
148
|
+
// metaType: "submit-button",
|
|
149
|
+
// colStyle: {
|
|
150
|
+
// textAlign: "right",
|
|
151
|
+
// paddingRight: "12px",
|
|
152
|
+
// },
|
|
153
|
+
// type: "button",
|
|
154
|
+
// buttonType: "cancel",
|
|
155
|
+
// value: "Preview",
|
|
156
|
+
// customComponent: false,
|
|
157
|
+
// standalone: true,
|
|
158
|
+
// styling: "semantic",
|
|
159
|
+
// order: 3,
|
|
160
|
+
// fluid: false,
|
|
161
|
+
// submitAction: "previewTemplate",
|
|
162
|
+
// onlyDisplay: true,
|
|
163
|
+
// supportedEvents: [
|
|
164
|
+
// "previewTemplate",
|
|
165
|
+
// ],
|
|
166
|
+
// },
|
|
167
|
+
// {
|
|
168
|
+
// id: "cancel-button",
|
|
169
|
+
// width: 2,
|
|
170
|
+
// metaType: "submit-button",
|
|
171
|
+
// colStyle: {
|
|
172
|
+
// textAlign: "right",
|
|
173
|
+
// width: "9%",
|
|
174
|
+
// },
|
|
175
|
+
// type: "button",
|
|
176
|
+
// buttonType: "cancel",
|
|
177
|
+
// value: "Cancel",
|
|
178
|
+
// customComponent: false,
|
|
179
|
+
// standalone: true,
|
|
180
|
+
// styling: "semantic",
|
|
181
|
+
// order: 3,
|
|
182
|
+
// fluid: false,
|
|
183
|
+
// onlyDisplay: true,
|
|
184
|
+
// submitAction: "cancelTemplate",
|
|
185
|
+
// supportedEvents: [
|
|
186
|
+
// "cancelTemplate",
|
|
187
|
+
// ],
|
|
188
|
+
// },
|
|
189
|
+
// {
|
|
190
|
+
// id: "save-button",
|
|
191
|
+
// width: 2,
|
|
192
|
+
// metaType: "submit-button",
|
|
193
|
+
// colStyle: {
|
|
194
|
+
// textAlign: "right",
|
|
195
|
+
// width: "7%",
|
|
196
|
+
// },
|
|
197
|
+
// type: "button",
|
|
198
|
+
// buttonType: "primary",
|
|
199
|
+
// value: "Save",
|
|
200
|
+
// customComponent: false,
|
|
201
|
+
// styling: "semantic",
|
|
202
|
+
// order: 3,
|
|
203
|
+
// fluid: false,
|
|
204
|
+
// standalone: true,
|
|
205
|
+
// onlyDisplay: true,
|
|
206
|
+
// submitAction: "saveFormData",
|
|
207
|
+
// supportedEvents: [
|
|
208
|
+
// "saveFormData",
|
|
209
|
+
// ],
|
|
210
|
+
// },
|
|
211
|
+
// ],
|
|
212
|
+
// },
|
|
213
|
+
// ],
|
|
214
|
+
// actionFields: [],
|
|
215
|
+
// },
|
|
216
|
+
// ],
|
|
217
|
+
// },
|
|
218
|
+
// containers: [
|
|
219
|
+
// {
|
|
220
|
+
// panes: [
|
|
221
|
+
// {
|
|
222
|
+
// sections: [
|
|
223
|
+
// {
|
|
224
|
+
// type: "multicols",
|
|
225
|
+
// width: 24,
|
|
226
|
+
// rowStyle: {
|
|
227
|
+
// // height: "calc(100vh - 142px)",
|
|
228
|
+
// },
|
|
229
|
+
// actionFields: [],
|
|
230
|
+
// inputFields: [
|
|
231
|
+
// {
|
|
232
|
+
// cols: [
|
|
233
|
+
// {
|
|
234
|
+
// id: "template-content",
|
|
235
|
+
// type: "ckeditor",
|
|
236
|
+
// metaType: "text",
|
|
237
|
+
// datatype: "string",
|
|
238
|
+
// required: true,
|
|
239
|
+
// onlyDisplay: false,
|
|
240
|
+
// standalone: false,
|
|
241
|
+
// order: 2,
|
|
242
|
+
// width: 24,
|
|
243
|
+
// events: {
|
|
244
|
+
// blur: this.onBlur,
|
|
245
|
+
// afterPaste: this.afterPaste,
|
|
246
|
+
// // change: this.onChange,
|
|
247
|
+
// },
|
|
248
|
+
// colStyle: {
|
|
249
|
+
// display: (!_.isEmpty(this.props.Templates.edmTemplate) && this.props.Templates.edmTemplate.versions.base.drag_drop_id) ? 'none' : '',
|
|
250
|
+
// },
|
|
251
|
+
// customComponent: true,
|
|
252
|
+
// getEditorInstanse: this.getEditorInstanse,
|
|
253
|
+
// supportedEvents: [
|
|
254
|
+
// "onContentChange",
|
|
255
|
+
// ],
|
|
256
|
+
// },
|
|
257
|
+
// {
|
|
258
|
+
// id: "edmeditor",
|
|
259
|
+
// type: "edmeditor",
|
|
260
|
+
// metaType: "text",
|
|
261
|
+
// datatype: "string",
|
|
262
|
+
// required: true,
|
|
263
|
+
// onlyDisplay: true,
|
|
264
|
+
// standalone: false,
|
|
265
|
+
// width: 24,
|
|
266
|
+
// order: 2,
|
|
267
|
+
// customComponent: true,
|
|
268
|
+
// // getEditorInstanse: this.getEditorInstanse,
|
|
269
|
+
// colStyle: {
|
|
270
|
+
// display: (!_.isEmpty(this.props.Templates.edmTemplate) && this.props.Templates.edmTemplate.versions.base.drag_drop_id) ? '' : 'none',
|
|
271
|
+
// },
|
|
272
|
+
// supportedEvents: [
|
|
273
|
+
// // "onContentChange",
|
|
274
|
+
// ],
|
|
275
|
+
// },
|
|
276
|
+
// ],
|
|
277
|
+
// },
|
|
278
|
+
// ],
|
|
279
|
+
// },
|
|
280
|
+
// ],
|
|
281
|
+
// },
|
|
282
|
+
// ],
|
|
283
|
+
// type: "tabs",
|
|
284
|
+
// defaultPanes: 1,
|
|
285
|
+
// additionalPanes: 0,
|
|
286
|
+
// id: "pane",
|
|
287
|
+
// tabBarExtraContent: {
|
|
288
|
+
// sections: [
|
|
289
|
+
// {
|
|
290
|
+
// type: "multicols",
|
|
291
|
+
// actionFields: [],
|
|
292
|
+
// inputFields: [
|
|
293
|
+
// {
|
|
294
|
+
// cols: [
|
|
295
|
+
// {
|
|
296
|
+
// id: "add-language-button",
|
|
297
|
+
// metaType: "submit-button",
|
|
298
|
+
// type: "customPopover",
|
|
299
|
+
// customComponent: true,
|
|
300
|
+
// onlyDisplay: true,
|
|
301
|
+
// styling: "semantic",
|
|
302
|
+
// order: 3,
|
|
303
|
+
// width: 3,
|
|
304
|
+
// colStyle: {
|
|
305
|
+
// color: `rgb(78, 146, 229)`,
|
|
306
|
+
// fontSize: '14px',
|
|
307
|
+
// fontFamily: 'open-sans',
|
|
308
|
+
// lineHeight: '24px',
|
|
309
|
+
// textAlign: 'center',
|
|
310
|
+
// cursor: 'pointer',
|
|
311
|
+
// display: (this.props.location.query.type === 'embedded' && (this.props.location.query.module === "loyalty" || this.props.location.query.module === "timeline" )) ? 'none' : '',
|
|
312
|
+
// },
|
|
313
|
+
// popOverList: this.props.Global.currentOrgDetails && this.props.Global.currentOrgDetails.basic_details.supported_languages ? this.props.Global.currentOrgDetails.basic_details.supported_languages : [],
|
|
314
|
+
// baseLanguage: this.props.Global.currentOrgDetails && this.props.Global.currentOrgDetails.basic_details.base_language ? this.props.Global.currentOrgDetails.basic_details.base_language : 'en',
|
|
315
|
+
// submitAction: "addLanguage",
|
|
316
|
+
// supportedEvents: [
|
|
317
|
+
// "addLanguage",
|
|
318
|
+
// ],
|
|
319
|
+
// },
|
|
320
|
+
// {
|
|
321
|
+
// id: "tagList",
|
|
322
|
+
// label: "Tags",
|
|
323
|
+
// type: "tag-list", //Resembles component to be used
|
|
324
|
+
// metaType: "List",
|
|
325
|
+
// datatype: "select",
|
|
326
|
+
// required: true,
|
|
327
|
+
// fluid: true,
|
|
328
|
+
// onlyDisplay: true,
|
|
329
|
+
// styling: "semantic",
|
|
330
|
+
// order: 1,
|
|
331
|
+
// style: {
|
|
332
|
+
// border: "none",
|
|
333
|
+
// },
|
|
334
|
+
// customComponent: true,
|
|
335
|
+
// width: 3,
|
|
336
|
+
// offset: 11,
|
|
337
|
+
// supportedEvents: [
|
|
338
|
+
// 'onTagSelect',
|
|
339
|
+
// ],
|
|
340
|
+
// },
|
|
341
|
+
// {
|
|
342
|
+
// id: "insert-image",
|
|
343
|
+
// metaType: "label",
|
|
344
|
+
// type: "div", //Resembles component to be used
|
|
345
|
+
// primitive: true,
|
|
346
|
+
// value: "Insert Image",
|
|
347
|
+
// fluid: true,
|
|
348
|
+
// onlyDisplay: false,
|
|
349
|
+
// styling: "semantic",
|
|
350
|
+
// order: 1,
|
|
351
|
+
// customComponent: false,
|
|
352
|
+
// submitAction: "onImageSelect",
|
|
353
|
+
// style: {
|
|
354
|
+
// color: "#4E92E5",
|
|
355
|
+
// fontSize: "14px",
|
|
356
|
+
// fontFamily: "open-sans",
|
|
357
|
+
// lineHeight: "24px",
|
|
358
|
+
// textAlign: "center",
|
|
359
|
+
// cursor: "pointer",
|
|
360
|
+
// },
|
|
361
|
+
// width: 3,
|
|
362
|
+
// supportedEvents: [
|
|
363
|
+
// "onImageSelect",
|
|
364
|
+
// ],
|
|
365
|
+
// },
|
|
366
|
+
// {
|
|
367
|
+
// id: "mark-final-version-label",
|
|
368
|
+
// metaType: "label",
|
|
369
|
+
// type: "div",
|
|
370
|
+
// primitive: true,
|
|
371
|
+
// value: "Mark as Final",
|
|
372
|
+
// onlyDisplay: true,
|
|
373
|
+
// customComponent: false,
|
|
374
|
+
// order: 3,
|
|
375
|
+
// width: 3,
|
|
376
|
+
// fluid: false,
|
|
377
|
+
// style: {
|
|
378
|
+
// color: "#4E92E5",
|
|
379
|
+
// fontSize: "14px",
|
|
380
|
+
// fontFamily: "open-sans",
|
|
381
|
+
// lineHeight: "24px",
|
|
382
|
+
// textAlign: "center",
|
|
383
|
+
// cursor: "pointer",
|
|
384
|
+
// display: (this.props.location.query.type === 'embedded') ? "none" : "",
|
|
385
|
+
// },
|
|
386
|
+
// submitAction: "markFinalVersion",
|
|
387
|
+
// supportedEvents: [
|
|
388
|
+
// "markFinalVersion",
|
|
389
|
+
// ],
|
|
390
|
+
// },
|
|
391
|
+
// {
|
|
392
|
+
// id: "tab-options-popover",
|
|
393
|
+
// metaType: "display",
|
|
394
|
+
// colStyle: {
|
|
395
|
+
// flex: 0,
|
|
396
|
+
// },
|
|
397
|
+
// type: "popover",
|
|
398
|
+
// customComponent: false,
|
|
399
|
+
// styling: "semantic",
|
|
400
|
+
// order: 3,
|
|
401
|
+
// width: 1,
|
|
402
|
+
// fluid: false,
|
|
403
|
+
// onlyDisplay: true,
|
|
404
|
+
// submitAction: "onTabOptionSelect",
|
|
405
|
+
// supportedEvents: [
|
|
406
|
+
// "onTabOptionSelect",
|
|
407
|
+
// ],
|
|
408
|
+
// content: {
|
|
409
|
+
// sections: [
|
|
410
|
+
// {
|
|
411
|
+
// type: "multicols",
|
|
412
|
+
// inputFields: [
|
|
413
|
+
// {
|
|
414
|
+
// cols: [
|
|
415
|
+
// {
|
|
416
|
+
// id: "duplicate-version-label",
|
|
417
|
+
// metaType: "label",
|
|
418
|
+
// type: "div",
|
|
419
|
+
// primitive: true,
|
|
420
|
+
// value: "Duplicate Version",
|
|
421
|
+
// onlyDisplay: true,
|
|
422
|
+
// customComponent: false,
|
|
423
|
+
// order: 3,
|
|
424
|
+
// fluid: false,
|
|
425
|
+
// colStyle: {
|
|
426
|
+
// display: (this.props.location.query.type === 'embedded') ? "none" : "",
|
|
427
|
+
// },
|
|
428
|
+
// className: "version-popover",
|
|
429
|
+
// submitAction: "duplicateVersion",
|
|
430
|
+
// supportedEvents: [
|
|
431
|
+
// "duplicateVersion",
|
|
432
|
+
// ],
|
|
433
|
+
// },
|
|
434
|
+
// ],
|
|
435
|
+
// },
|
|
436
|
+
// {
|
|
437
|
+
// cols: [
|
|
438
|
+
// {
|
|
439
|
+
// id: "delete-version-label",
|
|
440
|
+
// metaType: "label",
|
|
441
|
+
// type: "div",
|
|
442
|
+
// primitive: true,
|
|
443
|
+
// value: "Delete Version",
|
|
444
|
+
// onlyDisplay: true,
|
|
445
|
+
// customComponent: false,
|
|
446
|
+
// order: 3,
|
|
447
|
+
// fluid: false,
|
|
448
|
+
// colStyle: {
|
|
449
|
+
// display: (this.props.location.query.type === 'embedded') ? "none" : "",
|
|
450
|
+
// },
|
|
451
|
+
// className: "version-popover",
|
|
452
|
+
// submitAction: "deleteVersion",
|
|
453
|
+
// supportedEvents: [
|
|
454
|
+
// "deleteVersion",
|
|
455
|
+
// ],
|
|
456
|
+
// },
|
|
457
|
+
// ],
|
|
458
|
+
// },
|
|
459
|
+
// {
|
|
460
|
+
// cols: [
|
|
461
|
+
// {
|
|
462
|
+
// id: "delete-language-label",
|
|
463
|
+
// metaType: "label",
|
|
464
|
+
// type: "div",
|
|
465
|
+
// primitive: true,
|
|
466
|
+
// value: "Delete Language",
|
|
467
|
+
// onlyDisplay: true,
|
|
468
|
+
// customComponent: false,
|
|
469
|
+
// order: 3,
|
|
470
|
+
// fluid: false,
|
|
471
|
+
// className: "version-popover",
|
|
472
|
+
// submitAction: "deleteLanguage",
|
|
473
|
+
// supportedEvents: [
|
|
474
|
+
// "deleteLanguage",
|
|
475
|
+
// ],
|
|
476
|
+
// },
|
|
477
|
+
// ],
|
|
478
|
+
// },
|
|
479
|
+
// {
|
|
480
|
+
// cols: [
|
|
481
|
+
// {
|
|
482
|
+
// id: "switch-editor-label",
|
|
483
|
+
// metaType: "label",
|
|
484
|
+
// type: "div",
|
|
485
|
+
// primitive: true,
|
|
486
|
+
// value: "Switch Editor",
|
|
487
|
+
// onlyDisplay: true,
|
|
488
|
+
// customComponent: false,
|
|
489
|
+
// order: 4,
|
|
490
|
+
// fluid: false,
|
|
491
|
+
// className: "version-popover",
|
|
492
|
+
// submitAction: "switchEditor",
|
|
493
|
+
// supportedEvents: [
|
|
494
|
+
// "switchEditor",
|
|
495
|
+
// ],
|
|
496
|
+
// style: {
|
|
497
|
+
// display: (!_.isEmpty(this.props.Templates.edmTemplate) && this.props.Templates.edmTemplate.versions.base.drag_drop_id) ? '' : 'none',
|
|
498
|
+
// },
|
|
499
|
+
// },
|
|
500
|
+
// ],
|
|
501
|
+
// },
|
|
502
|
+
// ],
|
|
503
|
+
// actionFields: [],
|
|
504
|
+
// },
|
|
505
|
+
// ],
|
|
506
|
+
// },
|
|
507
|
+
// value: {
|
|
508
|
+
// sections: [
|
|
509
|
+
// {
|
|
510
|
+
// type: "multicols",
|
|
511
|
+
// inputFields: [
|
|
512
|
+
// {
|
|
513
|
+
// cols: [
|
|
514
|
+
// {
|
|
515
|
+
// id: "tab-option-icon",
|
|
516
|
+
// metaType: "display",
|
|
517
|
+
// type: "icon",
|
|
518
|
+
// onlyDisplay: true,
|
|
519
|
+
// primitive: false,
|
|
520
|
+
// value: "",
|
|
521
|
+
// customComponent: false,
|
|
522
|
+
// order: 3,
|
|
523
|
+
// fluid: false,
|
|
524
|
+
// },
|
|
525
|
+
// ],
|
|
526
|
+
// },
|
|
527
|
+
// ],
|
|
528
|
+
// actionFields: [],
|
|
529
|
+
// },
|
|
530
|
+
// ],
|
|
531
|
+
// },
|
|
532
|
+
// trigger: "click",
|
|
533
|
+
// placement: "bottomLeft",
|
|
534
|
+
// },
|
|
535
|
+
// ],
|
|
536
|
+
// },
|
|
537
|
+
// ],
|
|
538
|
+
// },
|
|
539
|
+
// ],
|
|
540
|
+
// },
|
|
541
|
+
// tabContent: {
|
|
542
|
+
// sections: [
|
|
543
|
+
// {
|
|
544
|
+
// type: "multicols",
|
|
545
|
+
// inputFields: [
|
|
546
|
+
// {
|
|
547
|
+
// rowStyle: {
|
|
548
|
+
// display: "flex",
|
|
549
|
+
// flex: 1,
|
|
550
|
+
// },
|
|
551
|
+
// cols: [
|
|
552
|
+
// {
|
|
553
|
+
// id: "tab-header",
|
|
554
|
+
// metaType: "label",
|
|
555
|
+
// value: "English",
|
|
556
|
+
// primitive: true,
|
|
557
|
+
// dynamicTab: false,
|
|
558
|
+
// type: "div",
|
|
559
|
+
// width: 5,
|
|
560
|
+
// offset: 0,
|
|
561
|
+
// onlyDisplay: true,
|
|
562
|
+
// colStyle: {
|
|
563
|
+
// flex: 1,
|
|
564
|
+
// },
|
|
565
|
+
// supportedEvents: [
|
|
566
|
+
// "onChange",
|
|
567
|
+
// ],
|
|
568
|
+
// },
|
|
569
|
+
// ],
|
|
570
|
+
// },
|
|
571
|
+
// ],
|
|
572
|
+
// actionFields: [],
|
|
573
|
+
// },
|
|
574
|
+
// ],
|
|
575
|
+
// },
|
|
576
|
+
// label: "Version",
|
|
577
|
+
// onlyDisplay: true,
|
|
578
|
+
// supportedEvents: [
|
|
579
|
+
// "onTabChange",
|
|
580
|
+
// ],
|
|
581
|
+
// isActive: true,
|
|
582
|
+
// },
|
|
583
|
+
// ],
|
|
584
|
+
// channel: "EMAIL",
|
|
585
|
+
// },
|
|
584
586
|
loading: false,
|
|
585
587
|
isFormValid: true,
|
|
586
588
|
injectedTags: {},
|
|
@@ -666,6 +668,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
666
668
|
},
|
|
667
669
|
"template-content": {
|
|
668
670
|
onContentChange: this.onChange,
|
|
671
|
+
getEditorInstanse: this.getEditorInstanse,
|
|
669
672
|
},
|
|
670
673
|
"delete-language-label": {
|
|
671
674
|
deleteLanguage: this.deleteLanguage,
|
|
@@ -696,10 +699,11 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
696
699
|
}
|
|
697
700
|
// const formData = _.cloneDeep(this.state.formData);
|
|
698
701
|
if (this.props.params.id || (this.props.location.query.module === "subscription" && !_.isEmpty(this.props.subscriptionTemplateData))) {
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
702
|
+
this.setState({isEdit: true}, () => {
|
|
703
|
+
if (this.props.params.id) {
|
|
704
|
+
this.props.actions.getTemplateDetails(this.props.params.id, 'email');
|
|
705
|
+
}
|
|
706
|
+
});
|
|
703
707
|
}
|
|
704
708
|
// formData[0] = {
|
|
705
709
|
// "template-content": (this.props.Templates.selectedEmailLayout ? this.props.Templates.selectedEmailLayout : ''),
|
|
@@ -715,7 +719,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
715
719
|
}
|
|
716
720
|
console.log('Form Data ', formData);
|
|
717
721
|
this.setState({ content: (this.props.Templates.selectedEmailLayout ? this.props.Templates.selectedEmailLayout : ''), formData}, () => {
|
|
718
|
-
this.injectEvents(this.state.schema);
|
|
722
|
+
// this.injectEvents(this.state.schema);
|
|
719
723
|
});
|
|
720
724
|
|
|
721
725
|
// setTimeout(() => {
|
|
@@ -727,6 +731,11 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
727
731
|
componentDidMount() {
|
|
728
732
|
console.log('email container mounted');
|
|
729
733
|
const type = this.props.location.query.type;
|
|
734
|
+
const query = {
|
|
735
|
+
layout: 'EMAIL',
|
|
736
|
+
type: 'LAYOUT',
|
|
737
|
+
};
|
|
738
|
+
this.props.globalActions.fetchSchemaForEntity(query);
|
|
730
739
|
window.addEventListener("message", this.handleFrameTasks);
|
|
731
740
|
if (type === 'embedded') {
|
|
732
741
|
const response = {
|
|
@@ -737,29 +746,36 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
737
746
|
if (this.props.location.query.type === 'embedded') {
|
|
738
747
|
this.showNext();
|
|
739
748
|
}
|
|
749
|
+
}
|
|
740
750
|
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
751
|
+
componentWillReceiveProps(nextProps) {
|
|
752
|
+
console.log('setting new language Next Props email', nextProps, this.state);
|
|
753
|
+
// if (this.props.location.query.type === 'embedded') {
|
|
754
|
+
// this.showNext();
|
|
755
|
+
// }
|
|
756
|
+
|
|
757
|
+
if (nextProps.Templates.selectedEmailLayout && nextProps.Templates.selectedEmailLayout !== '' && !_.isEqual(this.props.Templates.selectedEmailLayout, nextProps.Templates.selectedEmailLayout )) {
|
|
758
|
+
console.log('setting new language content props', nextProps.Templates.selectedEmailLayout);
|
|
759
|
+
this.setNewLanguageContent(nextProps.Templates.selectedEmailLayout);
|
|
760
|
+
}
|
|
761
|
+
if (nextProps.metaEntities && nextProps.metaEntities.layouts && nextProps.metaEntities.layouts.length > 0 && _.isEmpty(this.state.schema)) {
|
|
762
|
+
this.injectEvents(nextProps.metaEntities.layouts[0].definition);
|
|
763
|
+
console.log('isTagLoaded didMount', this.isTagLoaded);
|
|
744
764
|
const query = {
|
|
745
765
|
layout: 'EMAIL',
|
|
746
766
|
type: 'TAG',
|
|
747
767
|
context: this.props.location.query.type === 'embedded' ? this.props.location.query.module : 'default',
|
|
748
768
|
embedded: this.props.location.query.type === 'embedded' ? this.props.location.query.type : 'full',
|
|
749
769
|
};
|
|
770
|
+
setTimeout(() => {
|
|
771
|
+
this.hideSubject();
|
|
772
|
+
}, 0);
|
|
750
773
|
this.props.globalActions.fetchSchemaForEntity(query);
|
|
751
774
|
}
|
|
752
|
-
}
|
|
753
|
-
|
|
754
|
-
componentWillReceiveProps(nextProps) {
|
|
755
|
-
console.log('Next Props ', nextProps);
|
|
756
|
-
// if (this.props.location.query.type === 'embedded') {
|
|
757
|
-
// this.showNext();
|
|
758
|
-
// }
|
|
759
775
|
if (nextProps.location.query.module === 'subscription' && nextProps.isGetFormData) {
|
|
760
776
|
nextProps.getFormSubscriptionData(this.getFormData());
|
|
761
777
|
}
|
|
762
|
-
if (nextProps.Global.currentOrgDetails && nextProps.Global.currentOrgDetails.basic_details &&
|
|
778
|
+
if (nextProps.Global.currentOrgDetails && nextProps.Global.currentOrgDetails.basic_details && !_.isEmpty(nextProps.Global.currentOrgDetails.basic_details) && _.isEmpty(this.state.formData)) {
|
|
763
779
|
const formData = this.initFormData(nextProps);
|
|
764
780
|
formData['template-version-options'] = [
|
|
765
781
|
{
|
|
@@ -777,7 +793,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
777
793
|
formData['template-version'] = "version 1";
|
|
778
794
|
this.setState({formData});
|
|
779
795
|
} else if (nextProps.Global.currentOrgDetails && nextProps.Global.currentOrgDetails.basic_details) {
|
|
780
|
-
this.injectEvents(this.state.schema);
|
|
796
|
+
// this.injectEvents(this.state.schema);
|
|
781
797
|
const baseLanguage = nextProps.Global.currentOrgDetails.basic_details.base_language;
|
|
782
798
|
if (this.state.formData[`${this.state.currentTab - 1}`] && _.isEmpty(this.state.formData[`${this.state.currentTab - 1}`].selectedLanguages)) {
|
|
783
799
|
console.log('Language Empty ', this.state.formData);
|
|
@@ -789,20 +805,20 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
789
805
|
this.setState({formData});
|
|
790
806
|
}
|
|
791
807
|
|
|
792
|
-
console.log('isTagLoaded', this.isTagLoaded);
|
|
793
|
-
if (!this.isTagLoaded) {
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
}
|
|
808
|
+
// console.log('isTagLoaded', this.isTagLoaded);
|
|
809
|
+
// if (!this.isTagLoaded) {
|
|
810
|
+
// this.isTagLoaded = true;
|
|
811
|
+
// const query = {
|
|
812
|
+
// layout: 'EMAIL',
|
|
813
|
+
// type: 'TAG',
|
|
814
|
+
// context: this.props.location.query.type === 'embedded' ? this.props.location.query.module : 'default',
|
|
815
|
+
// embedded: this.props.location.query.type === 'embedded' ? this.props.location.query.type : 'full',
|
|
816
|
+
// };
|
|
817
|
+
// this.props.globalActions.fetchSchemaForEntity(query);
|
|
818
|
+
// }
|
|
803
819
|
|
|
804
|
-
if (this.state.isEdit && !this.state.editDataSet && !_.isEmpty(nextProps.Email.templateDetails)) {
|
|
805
|
-
console.log('setting edit data in email');
|
|
820
|
+
if (this.state.isEdit && !this.state.editDataSet && !_.isEmpty(nextProps.Email.templateDetails) && !_.isEmpty(this.state.schema)) {
|
|
821
|
+
console.log('setting edit data in email', nextProps.Email.templateDetails);
|
|
806
822
|
this.setState({editDataSet: true}, () => {
|
|
807
823
|
this.setEditData(nextProps.Email.templateDetails);
|
|
808
824
|
});
|
|
@@ -890,35 +906,27 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
890
906
|
}
|
|
891
907
|
if (!nextProps.Email.fetchingCmsData && !_.isEqual(nextProps.Email.cmsData, this.props.Email.cmsData)) {
|
|
892
908
|
const formData = _.cloneDeep(this.state.formData);
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
formData
|
|
901
|
-
formData.
|
|
902
|
-
|
|
909
|
+
if (this.state.gettingPreviewData) {
|
|
910
|
+
this.setState({gettingPreviewData: false});
|
|
911
|
+
formData[`${this.state.currentTab - 1}`][formData[`${this.state.currentTab - 1}`].activeTab]['template-content'] = decodeURIComponent(nextProps.Email.cmsData);
|
|
912
|
+
if (formData[`${this.state.currentTab - 1}`].base) {
|
|
913
|
+
formData.base[formData.base.activeTab]['template-content'] = decodeURIComponent(nextProps.Email.cmsData);
|
|
914
|
+
}
|
|
915
|
+
} else {
|
|
916
|
+
console.log('email switch data ', this.state.currentTab, formData, formData[`${this.state.currentTab - 1}`].activeTab);
|
|
917
|
+
formData[`${this.state.currentTab - 1}`][formData[`${this.state.currentTab - 1}`].activeTab]['template-content'] = decodeURIComponent(nextProps.Email.cmsData);
|
|
918
|
+
formData[`${this.state.currentTab - 1}`][formData[`${this.state.currentTab - 1}`].activeTab].is_drag_drop = false;
|
|
919
|
+
formData[`${this.state.currentTab - 1}`][formData[`${this.state.currentTab - 1}`].activeTab].drag_drop_id = "";
|
|
920
|
+
delete formData[`${this.state.currentTab - 1}`][formData[`${this.state.currentTab - 1}`].activeTab].edmeditorsrc;
|
|
921
|
+
if (formData[`${this.state.currentTab - 1}`].base) {
|
|
922
|
+
formData.base[formData.base.activeTab]['template-content'] = decodeURIComponent(nextProps.Email.cmsData);
|
|
923
|
+
formData.base[formData.base.activeTab].is_drag_drop = false;
|
|
924
|
+
formData.base[formData.base.activeTab].drag_drop_id = "";
|
|
925
|
+
delete formData.base[formData.base.activeTab].edmeditorsrc;
|
|
926
|
+
}
|
|
927
|
+
console.log('ckeditor trying to set ckeditor data');
|
|
903
928
|
}
|
|
904
|
-
|
|
905
|
-
// if (this.state.editorInstanse) {
|
|
906
|
-
// console.log('ckeditor trying found instance');
|
|
907
|
-
// //let CKEDITOR;
|
|
908
|
-
// //CKEDITOR.instances.editor1.setData(decodeURIComponent(nextProps.Email.cmsData));
|
|
909
|
-
// const schema = _.cloneDeep(this.state.schema);
|
|
910
|
-
// _.forEach(schema.containers, (container) => {
|
|
911
|
-
// const temp = container;
|
|
912
|
-
// _.forEach(temp.panes, (pane, index) => {
|
|
913
|
-
// const tempPane = pane;
|
|
914
|
-
// if (parseInt(index, 10) === (this.state.currentTab - 1) ) {
|
|
915
|
-
// console.log('ckeditor trying setting content', decodeURIComponent(nextProps.Email.cmsData));
|
|
916
|
-
// tempPane.sections[0].inputFields[0].cols[0].content = decodeURIComponent(nextProps.Email.cmsData);
|
|
917
|
-
// }
|
|
918
|
-
// });
|
|
919
|
-
// });
|
|
920
|
-
// // this.state.editorInstanse.setData(decodeURIComponent(nextProps.Email.cmsData));
|
|
921
|
-
// }
|
|
929
|
+
|
|
922
930
|
this.setState({ formData });
|
|
923
931
|
}
|
|
924
932
|
|
|
@@ -1097,8 +1105,11 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
1097
1105
|
};
|
|
1098
1106
|
console.log('Get Data', response);
|
|
1099
1107
|
this.setState({checkValidation: true});
|
|
1100
|
-
e
|
|
1101
|
-
|
|
1108
|
+
if (e) {
|
|
1109
|
+
e.source.postMessage(JSON.stringify(response), e.origin);
|
|
1110
|
+
}
|
|
1111
|
+
return response;
|
|
1112
|
+
};
|
|
1102
1113
|
|
|
1103
1114
|
setFormValidity = (isFormValid) => {
|
|
1104
1115
|
this.setState({isFormValid});
|
|
@@ -1271,6 +1282,26 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
1271
1282
|
this.setState({editorInstanse: instance});
|
|
1272
1283
|
}
|
|
1273
1284
|
|
|
1285
|
+
setModalContent = (type) => {
|
|
1286
|
+
if (type === 'delete-version') {
|
|
1287
|
+
const modalContent = {
|
|
1288
|
+
title: "Alert",
|
|
1289
|
+
body: "Do you really want to delete this version?",
|
|
1290
|
+
type: 'confirm',
|
|
1291
|
+
id: 'email-version-delete-modal',
|
|
1292
|
+
};
|
|
1293
|
+
this.setState({modalContent, showModal: true});
|
|
1294
|
+
} else if (type === 'delete-language') {
|
|
1295
|
+
const modalContent = {
|
|
1296
|
+
title: "Alert",
|
|
1297
|
+
body: "Do you really want to delete this language?",
|
|
1298
|
+
type: 'confirm',
|
|
1299
|
+
id: 'email-language-delete-modal',
|
|
1300
|
+
};
|
|
1301
|
+
this.setState({modalContent, showModal: true});
|
|
1302
|
+
}
|
|
1303
|
+
}
|
|
1304
|
+
|
|
1274
1305
|
uploadImages(e, {files}) {
|
|
1275
1306
|
e.preventDefault();
|
|
1276
1307
|
const _URL = window.URL || window.webkitURL;
|
|
@@ -1338,7 +1369,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
1338
1369
|
console.log('Delete Language ', formData, val);
|
|
1339
1370
|
const schema = _.cloneDeep(this.state.schema);
|
|
1340
1371
|
schema.containers[0].panes.splice(val, 1);
|
|
1341
|
-
this.setState({schema, formData});
|
|
1372
|
+
this.setState({schema, formData, showModal: false});
|
|
1342
1373
|
console.log('Schema ', schema, formData, val);
|
|
1343
1374
|
}
|
|
1344
1375
|
|
|
@@ -1400,7 +1431,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
1400
1431
|
console.log('Tranforming data for embedded mode', tmpData);
|
|
1401
1432
|
}
|
|
1402
1433
|
});
|
|
1403
|
-
if (this.props.location.query.type === 'embedded' && (this.props.location.query.module === "loyalty" || this.props.location.query.module === "dvs")) {
|
|
1434
|
+
if (this.props.location.query.type === 'embedded' && (this.props.location.query.module === "loyalty" || this.props.location.query.module === "dvs" || this.props.location.query.module === "subscription" )) {
|
|
1404
1435
|
newFormData.base.subject = formData['template-subject'];
|
|
1405
1436
|
}
|
|
1406
1437
|
|
|
@@ -1510,6 +1541,15 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
1510
1541
|
this.setState({formData});
|
|
1511
1542
|
}
|
|
1512
1543
|
|
|
1544
|
+
hideSubject = () => {
|
|
1545
|
+
const schema = _.cloneDeep(this.state.schema);
|
|
1546
|
+
if (this.props.location.query.type === 'embedded' && (this.props.location.query.module === "loyalty" || this.props.location.query.module === "dvs" || this.props.location.query.module === "subscription")) {
|
|
1547
|
+
schema.standalone.sections[0].inputFields[0].style.display = "";
|
|
1548
|
+
schema.standalone.sections[0].inputFields[0].labelStyle.display = "";
|
|
1549
|
+
}
|
|
1550
|
+
this.setState({schema});
|
|
1551
|
+
}
|
|
1552
|
+
|
|
1513
1553
|
handleOnHoverItem = (isHovering, id) => {
|
|
1514
1554
|
console.log('Card Howering ', isHovering, id);
|
|
1515
1555
|
if (!isHovering) {
|
|
@@ -1644,7 +1684,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
1644
1684
|
formData['template-version-options'].splice(`${currentTab - 1}`, 1);
|
|
1645
1685
|
formData['template-version'] = formData['template-version-options'][0].value;
|
|
1646
1686
|
console.log('Current formData and Schema after delete', formData, schema);
|
|
1647
|
-
this.setState({schema, tabCount: (this.state.tabCount - 1), currentTab: 1, isSchemaChanged: true});
|
|
1687
|
+
this.setState({schema, tabCount: (this.state.tabCount - 1), currentTab: 1, isSchemaChanged: true, showModal: false});
|
|
1648
1688
|
}
|
|
1649
1689
|
|
|
1650
1690
|
switchEditor = () => {
|
|
@@ -1984,7 +2024,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
1984
2024
|
delete schema.standalone;
|
|
1985
2025
|
schema.standalone = {};
|
|
1986
2026
|
schema.standalone.sections = [];
|
|
1987
|
-
if (this.props.location.query.type === 'embedded' && (this.props.location.query.module === "loyalty" || this.props.location.query.module === "dvs")) {
|
|
2027
|
+
if (this.props.location.query.type === 'embedded' && (this.props.location.query.module === "loyalty" || this.props.location.query.module === "dvs" || this.props.location.query.module === "subscription")) {
|
|
1988
2028
|
schema.standalone.sections.push(_.cloneDeep(this.state.schema.standalone.sections[0]));
|
|
1989
2029
|
}
|
|
1990
2030
|
|
|
@@ -2533,7 +2573,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
2533
2573
|
edmSrc={this.props.Email.CmsSettings.url}
|
|
2534
2574
|
/> : ''
|
|
2535
2575
|
} */}
|
|
2536
|
-
{ this.state.formData[0] || this.state.formData["0"] ?
|
|
2576
|
+
{ !_.isEmpty(schema) && (this.state.formData[0] || this.state.formData["0"]) ?
|
|
2537
2577
|
<FormBuilder
|
|
2538
2578
|
schema={schema}
|
|
2539
2579
|
onSubmit={this.saveFormData}
|
|
@@ -2565,7 +2605,8 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
2565
2605
|
showEdmEmailTemplates={this.state.showEdmEmailTemplates}
|
|
2566
2606
|
toggleEdmEmailTemplateSelection={this.toggleEdmEmailTemplateSelection}
|
|
2567
2607
|
handleEdmDefaultTemplateSelection={this.handleEdmDefaultTemplateSelection}
|
|
2568
|
-
|
|
2608
|
+
setModalContent={this.setModalContent}
|
|
2609
|
+
/> : ''}
|
|
2569
2610
|
</Col>
|
|
2570
2611
|
</Row>
|
|
2571
2612
|
</Spin>
|