@capillarytech/creatives-library 0.0.2 → 0.0.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.
Files changed (33) hide show
  1. package/components/CapTagList/index.js +2 -2
  2. package/components/CapTagList/messages.js +4 -0
  3. package/components/CardGrid/index.js +2 -2
  4. package/components/Ckeditor/index.js +3 -1
  5. package/components/Edmeditor/index.js +1 -1
  6. package/components/FormBuilder/index.js +143 -38
  7. package/containers/Ebill/index.js +1 -1
  8. package/containers/Ebill/reducer.js +5 -2
  9. package/containers/Ebill/sagas.js +6 -2
  10. package/containers/Email/_email.scss +9 -0
  11. package/containers/Email/index.js +643 -602
  12. package/containers/Email/reducer.js +5 -2
  13. package/containers/Email/sagas.js +6 -2
  14. package/containers/MobilePush/Create/index.js +23 -1
  15. package/containers/MobilePush/Create/messages.js +1 -1
  16. package/containers/MobilePush/Create/reducer.js +6 -3
  17. package/containers/MobilePush/Create/sagas.js +6 -3
  18. package/containers/MobilePush/Edit/index.js +22 -1
  19. package/containers/MobilePush/Edit/messages.js +1 -1
  20. package/containers/MobilePush/Edit/reducer.js +6 -3
  21. package/containers/MobilePush/Edit/sagas.js +6 -3
  22. package/containers/Sms/Create/index.js +18 -11
  23. package/containers/Sms/Create/messages.js +4 -0
  24. package/containers/Sms/Create/reducer.js +6 -3
  25. package/containers/Sms/Create/sagas.js +7 -2
  26. package/containers/Sms/Edit/index.js +18 -11
  27. package/containers/Sms/Edit/messages.js +4 -0
  28. package/containers/Sms/Edit/reducer.js +6 -3
  29. package/containers/Sms/Edit/sagas.js +7 -2
  30. package/containers/Templates/index.js +85 -19
  31. package/containers/Templates/messages.js +28 -0
  32. package/containers/Templates/reducer.js +3 -2
  33. 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
- standalone: {
50
- sections: [
51
- {
52
- type: "col-label",
53
- inputFields: [
54
- {
55
- id: "template-subject",
56
- placeholder: "Enter Email Subject",
57
- type: "input",
58
- metaType: "text",
59
- datatype: "string",
60
- required: true,
61
- label: "Subject",
62
- style: {
63
- fontSize: "20px",
64
- fontFamily: "proxima-nova,sans-serif",
65
- fontStyle: "normal",
66
- fontWeight: 600,
67
- display: (this.props.location.query.type === 'embedded' && (this.props.location.query.module === "loyalty" || this.props.location.query.module === "dvs")) ? "" : "none",
68
- },
69
- labelStyle: {
70
- fontSize: "18px",
71
- fontFamily: "proxima-nova,sans-serif",
72
- fontStyle: "normal",
73
- fontWeight: 600,
74
- display: (this.props.location.query.type === 'embedded' && (this.props.location.query.module === "loyalty" || this.props.location.query.module === "dvs")) ? "" : "none",
75
- background: "white",
76
- },
77
- styling: "semantic",
78
- order: 1,
79
- width: 9,
80
- customComponent: false,
81
- standalone: true,
82
- onlyDisplay: false,
83
- errorMessage: "Email Subject cannot be empty.",
84
- // supportedEvents: [
85
- // "onChange",
86
- // ],
87
- },
88
- ],
89
- },
90
- {
91
- type: "multicols",
92
- inputFields: [
93
- {
94
- cols: [
95
- {
96
- id: "template-name",
97
- placeholder: "Enter template name",
98
- type: "input",
99
- metaType: "text",
100
- datatype: "string",
101
- required: true,
102
- style: {
103
- fontSize: "20px",
104
- fontFamily: "proxima-nova,sans-serif",
105
- fontStyle: "normal",
106
- fontWeight: 600,
107
- },
108
- styling: "semantic",
109
- order: 1,
110
- width: 9,
111
- customComponent: false,
112
- standalone: true,
113
- onlyDisplay: false,
114
- errorMessage: "Template name cannot be empty.",
115
- supportedEvents: [
116
- "onChange",
117
- ],
118
- },
119
- {
120
- id: "template-version",
121
- type: "select", //Resembles component to be used
122
- options: [],
123
- metaType: "text",
124
- datatype: "string",
125
- required: true,
126
- fluid: true,
127
- style: {
128
- fontSize: '14px',
129
- fontFamily: 'open-sans',
130
- fontStyle: 'normal',
131
- marginBottom: '16px',
132
- },
133
- styling: "semantic",
134
- order: 1,
135
- width: 5,
136
- customComponent: false,
137
- standalone: true,
138
- supportedEvents: [
139
- 'onSelect',
140
- 'addVersion',
141
- ],
142
- },
143
- {
144
- id: "preview-button",
145
- width: 3,
146
- offset: 3,
147
- metaType: "submit-button",
148
- colStyle: {
149
- textAlign: "right",
150
- paddingRight: "12px",
151
- },
152
- type: "button",
153
- buttonType: "cancel",
154
- value: "Preview",
155
- customComponent: false,
156
- standalone: true,
157
- styling: "semantic",
158
- order: 3,
159
- fluid: false,
160
- submitAction: "previewTemplate",
161
- onlyDisplay: true,
162
- supportedEvents: [
163
- "previewTemplate",
164
- ],
165
- },
166
- {
167
- id: "cancel-button",
168
- width: 2,
169
- metaType: "submit-button",
170
- colStyle: {
171
- textAlign: "right",
172
- width: "9%",
173
- },
174
- type: "button",
175
- buttonType: "cancel",
176
- value: "Cancel",
177
- customComponent: false,
178
- standalone: true,
179
- styling: "semantic",
180
- order: 3,
181
- fluid: false,
182
- onlyDisplay: true,
183
- submitAction: "cancelTemplate",
184
- supportedEvents: [
185
- "cancelTemplate",
186
- ],
187
- },
188
- {
189
- id: "save-button",
190
- width: 2,
191
- metaType: "submit-button",
192
- colStyle: {
193
- textAlign: "right",
194
- width: "7%",
195
- },
196
- type: "button",
197
- buttonType: "primary",
198
- value: "Save",
199
- customComponent: false,
200
- styling: "semantic",
201
- order: 3,
202
- fluid: false,
203
- standalone: true,
204
- onlyDisplay: true,
205
- submitAction: "saveFormData",
206
- supportedEvents: [
207
- "saveFormData",
208
- ],
209
- },
210
- ],
211
- },
212
- ],
213
- actionFields: [],
214
- },
215
- ],
216
- },
217
- containers: [
218
- {
219
- panes: [
220
- {
221
- sections: [
222
- {
223
- type: "multicols",
224
- width: 24,
225
- rowStyle: {
226
- // height: "calc(100vh - 142px)",
227
- },
228
- actionFields: [],
229
- inputFields: [
230
- {
231
- cols: [
232
- {
233
- id: "template-content",
234
- type: "ckeditor",
235
- metaType: "text",
236
- datatype: "string",
237
- required: true,
238
- onlyDisplay: false,
239
- standalone: false,
240
- order: 2,
241
- width: 24,
242
- events: {
243
- blur: this.onBlur,
244
- afterPaste: this.afterPaste,
245
- // change: this.onChange,
246
- },
247
- colStyle: {
248
- display: (!_.isEmpty(this.props.Templates.edmTemplate) && this.props.Templates.edmTemplate.versions.base.drag_drop_id) ? 'none' : '',
249
- },
250
- customComponent: true,
251
- getEditorInstanse: this.getEditorInstanse,
252
- supportedEvents: [
253
- "onContentChange",
254
- ],
255
- },
256
- {
257
- id: "edmeditor",
258
- type: "edmeditor",
259
- metaType: "text",
260
- datatype: "string",
261
- required: true,
262
- onlyDisplay: true,
263
- standalone: false,
264
- width: 24,
265
- order: 2,
266
- customComponent: true,
267
- // getEditorInstanse: this.getEditorInstanse,
268
- colStyle: {
269
- display: (!_.isEmpty(this.props.Templates.edmTemplate) && this.props.Templates.edmTemplate.versions.base.drag_drop_id) ? '' : 'none',
270
- },
271
- supportedEvents: [
272
- // "onContentChange",
273
- ],
274
- },
275
- ],
276
- },
277
- ],
278
- },
279
- ],
280
- },
281
- ],
282
- type: "tabs",
283
- defaultPanes: 1,
284
- additionalPanes: 0,
285
- id: "pane",
286
- tabBarExtraContent: {
287
- sections: [
288
- {
289
- type: "multicols",
290
- actionFields: [],
291
- inputFields: [
292
- {
293
- cols: [
294
- {
295
- id: "add-language-button",
296
- metaType: "submit-button",
297
- type: "customPopover",
298
- customComponent: true,
299
- onlyDisplay: true,
300
- styling: "semantic",
301
- order: 3,
302
- width: 3,
303
- colStyle: {
304
- color: `rgb(78, 146, 229)`,
305
- fontSize: '14px',
306
- fontFamily: 'open-sans',
307
- lineHeight: '24px',
308
- textAlign: 'center',
309
- cursor: 'pointer',
310
- },
311
- popOverList: this.props.Global.currentOrgDetails && this.props.Global.currentOrgDetails.basic_details.supported_languages ? this.props.Global.currentOrgDetails.basic_details.supported_languages : [],
312
- baseLanguage: this.props.Global.currentOrgDetails && this.props.Global.currentOrgDetails.basic_details.base_language ? this.props.Global.currentOrgDetails.basic_details.base_language : 'en',
313
- submitAction: "addLanguage",
314
- supportedEvents: [
315
- "addLanguage",
316
- ],
317
- },
318
- {
319
- id: "tagList",
320
- label: "Tags",
321
- type: "tag-list", //Resembles component to be used
322
- metaType: "List",
323
- datatype: "select",
324
- required: true,
325
- fluid: true,
326
- onlyDisplay: true,
327
- styling: "semantic",
328
- order: 1,
329
- style: {
330
- border: "none",
331
- },
332
- customComponent: true,
333
- width: 3,
334
- offset: 11,
335
- supportedEvents: [
336
- 'onTagSelect',
337
- ],
338
- },
339
- {
340
- id: "insert-image",
341
- metaType: "label",
342
- type: "div", //Resembles component to be used
343
- primitive: true,
344
- value: "Insert Image",
345
- fluid: true,
346
- onlyDisplay: false,
347
- styling: "semantic",
348
- order: 1,
349
- customComponent: false,
350
- submitAction: "onImageSelect",
351
- style: {
352
- color: "#4E92E5",
353
- fontSize: "14px",
354
- fontFamily: "open-sans",
355
- lineHeight: "24px",
356
- textAlign: "center",
357
- cursor: "pointer",
358
- },
359
- width: 3,
360
- supportedEvents: [
361
- "onImageSelect",
362
- ],
363
- },
364
- {
365
- id: "mark-final-version-label",
366
- metaType: "label",
367
- type: "div",
368
- primitive: true,
369
- value: "Mark as Final",
370
- onlyDisplay: true,
371
- customComponent: false,
372
- order: 3,
373
- width: 3,
374
- fluid: false,
375
- style: {
376
- color: "#4E92E5",
377
- fontSize: "14px",
378
- fontFamily: "open-sans",
379
- lineHeight: "24px",
380
- textAlign: "center",
381
- cursor: "pointer",
382
- display: (this.props.location.query.type === 'embedded') ? "none" : "",
383
- },
384
- submitAction: "markFinalVersion",
385
- supportedEvents: [
386
- "markFinalVersion",
387
- ],
388
- },
389
- {
390
- id: "tab-options-popover",
391
- metaType: "display",
392
- colStyle: {
393
- flex: 0,
394
- },
395
- type: "popover",
396
- customComponent: false,
397
- styling: "semantic",
398
- order: 3,
399
- width: 1,
400
- fluid: false,
401
- onlyDisplay: true,
402
- submitAction: "onTabOptionSelect",
403
- supportedEvents: [
404
- "onTabOptionSelect",
405
- ],
406
- content: {
407
- sections: [
408
- {
409
- type: "multicols",
410
- inputFields: [
411
- {
412
- cols: [
413
- {
414
- id: "duplicate-version-label",
415
- metaType: "label",
416
- type: "div",
417
- primitive: true,
418
- value: "Duplicate Version",
419
- onlyDisplay: true,
420
- customComponent: false,
421
- order: 3,
422
- fluid: false,
423
- colStyle: {
424
- display: (this.props.location.query.type === 'embedded') ? "none" : "",
425
- },
426
- className: "version-popover",
427
- submitAction: "duplicateVersion",
428
- supportedEvents: [
429
- "duplicateVersion",
430
- ],
431
- },
432
- ],
433
- },
434
- {
435
- cols: [
436
- {
437
- id: "delete-version-label",
438
- metaType: "label",
439
- type: "div",
440
- primitive: true,
441
- value: "Delete Version",
442
- onlyDisplay: true,
443
- customComponent: false,
444
- order: 3,
445
- fluid: false,
446
- colStyle: {
447
- display: (this.props.location.query.type === 'embedded') ? "none" : "",
448
- },
449
- className: "version-popover",
450
- submitAction: "deleteVersion",
451
- supportedEvents: [
452
- "deleteVersion",
453
- ],
454
- },
455
- ],
456
- },
457
- {
458
- cols: [
459
- {
460
- id: "delete-language-label",
461
- metaType: "label",
462
- type: "div",
463
- primitive: true,
464
- value: "Delete Language",
465
- onlyDisplay: true,
466
- customComponent: false,
467
- order: 3,
468
- fluid: false,
469
- className: "version-popover",
470
- submitAction: "deleteLanguage",
471
- supportedEvents: [
472
- "deleteLanguage",
473
- ],
474
- },
475
- ],
476
- },
477
- {
478
- cols: [
479
- {
480
- id: "switch-editor-label",
481
- metaType: "label",
482
- type: "div",
483
- primitive: true,
484
- value: "Switch Editor",
485
- onlyDisplay: true,
486
- customComponent: false,
487
- order: 4,
488
- fluid: false,
489
- className: "version-popover",
490
- submitAction: "switchEditor",
491
- supportedEvents: [
492
- "switchEditor",
493
- ],
494
- style: {
495
- display: (!_.isEmpty(this.props.Templates.edmTemplate) && this.props.Templates.edmTemplate.versions.base.drag_drop_id) ? '' : 'none',
496
- },
497
- },
498
- ],
499
- },
500
- ],
501
- actionFields: [],
502
- },
503
- ],
504
- },
505
- value: {
506
- sections: [
507
- {
508
- type: "multicols",
509
- inputFields: [
510
- {
511
- cols: [
512
- {
513
- id: "tab-option-icon",
514
- metaType: "display",
515
- type: "icon",
516
- onlyDisplay: true,
517
- primitive: false,
518
- value: "",
519
- customComponent: false,
520
- order: 3,
521
- fluid: false,
522
- },
523
- ],
524
- },
525
- ],
526
- actionFields: [],
527
- },
528
- ],
529
- },
530
- trigger: "click",
531
- placement: "bottomLeft",
532
- },
533
- ],
534
- },
535
- ],
536
- },
537
- ],
538
- },
539
- tabContent: {
540
- sections: [
541
- {
542
- type: "multicols",
543
- inputFields: [
544
- {
545
- rowStyle: {
546
- display: "flex",
547
- flex: 1,
548
- },
549
- cols: [
550
- {
551
- id: "tab-header",
552
- metaType: "label",
553
- value: "English",
554
- primitive: true,
555
- dynamicTab: false,
556
- type: "div",
557
- width: 5,
558
- offset: 0,
559
- onlyDisplay: true,
560
- colStyle: {
561
- flex: 1,
562
- },
563
- supportedEvents: [
564
- "onChange",
565
- ],
566
- },
567
- ],
568
- },
569
- ],
570
- actionFields: [],
571
- },
572
- ],
573
- },
574
- label: "Version",
575
- onlyDisplay: true,
576
- supportedEvents: [
577
- "onTabChange",
578
- ],
579
- isActive: true,
580
- },
581
- ],
582
- channel: "EMAIL",
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
- if (this.props.params.id) {
700
- this.props.actions.getTemplateDetails(this.props.params.id, 'email');
701
- }
702
- this.setState({isEdit: true});
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
- console.log('isTagLoaded didMount', this.isTagLoaded);
742
- if (!this.isTagLoaded) {
743
- this.isTagLoaded = true;
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 && (!(this.props.Global.currentOrgDetails && this.props.Global.currentOrgDetails.basic_details) || !_.isEqual(nextProps.Global.currentOrgDetails.basic_details, this.props.Global.currentOrgDetails.basic_details)) && _.isEmpty(this.state.formData)) {
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
- this.isTagLoaded = true;
795
- const query = {
796
- layout: 'EMAIL',
797
- type: 'TAG',
798
- context: this.props.location.query.type === 'embedded' ? this.props.location.query.module : 'default',
799
- embedded: this.props.location.query.type === 'embedded' ? this.props.location.query.type : 'full',
800
- };
801
- this.props.globalActions.fetchSchemaForEntity(query);
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
- console.log('email switch data ', this.state.currentTab, formData, formData[`${this.state.currentTab - 1}`].activeTab);
894
- formData[`${this.state.currentTab - 1}`][formData[`${this.state.currentTab - 1}`].activeTab]['template-content'] = decodeURIComponent(nextProps.Email.cmsData);
895
- formData[`${this.state.currentTab - 1}`][formData[`${this.state.currentTab - 1}`].activeTab].is_drag_drop = false;
896
- formData[`${this.state.currentTab - 1}`][formData[`${this.state.currentTab - 1}`].activeTab].drag_drop_id = "";
897
- delete formData[`${this.state.currentTab - 1}`][formData[`${this.state.currentTab - 1}`].activeTab].edmeditorsrc;
898
- if (formData[`${this.state.currentTab - 1}`].base) {
899
- formData.base[formData.base.activeTab]['template-content'] = decodeURIComponent(nextProps.Email.cmsData);
900
- formData.base[formData.base.activeTab].is_drag_drop = false;
901
- formData.base[formData.base.activeTab].drag_drop_id = "";
902
- delete formData.base[formData.base.activeTab].edmeditorsrc;
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
- console.log('ckeditor trying to set ckeditor data');
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.source.postMessage(JSON.stringify(response), e.origin);
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
- /> : 'asasas'}
2608
+ setModalContent={this.setModalContent}
2609
+ /> : ''}
2569
2610
  </Col>
2570
2611
  </Row>
2571
2612
  </Spin>