@capillarytech/creatives-library 2.0.66 → 2.0.69

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 (45) hide show
  1. package/components/Ckeditor/index.js +30 -3
  2. package/components/FormBuilder/index.js +50 -27
  3. package/components/FormBuilder/test +1845 -0
  4. package/components/Header/index.js +7 -4
  5. package/components/Header/messages.js +12 -0
  6. package/components/Sidebar/index.js +0 -27
  7. package/components/TemplatePreview/WechatRichmediaTemplatePreview/_wechatRichmediaTemplatePrev.scss +42 -0
  8. package/components/TemplatePreview/WechatRichmediaTemplatePreview/index.js +104 -0
  9. package/components/TemplatePreview/WechatRichmediaTemplatePreview/messages.js +21 -0
  10. package/components/TemplatePreview/WechatRichmediaTemplatePreview/tests/index.test.js +10 -0
  11. package/containers/Cap/actions.js +6 -0
  12. package/containers/Cap/constants.js +2 -0
  13. package/containers/Cap/index.js +1 -22
  14. package/containers/Cap/reducer.js +4 -2
  15. package/containers/Cap/selectors.js +13 -0
  16. package/containers/CreativesContainer/SlideBoxContent.js +2 -1
  17. package/containers/Ebill/index.js +4 -21
  18. package/containers/Email/index.js +9 -24
  19. package/containers/Line/Create/index.js +5 -17
  20. package/containers/Line/Edit/index.js +5 -25
  21. package/containers/MobilePush/Create/index.js +5 -22
  22. package/containers/MobilePush/Create/selectors.js +1 -1
  23. package/containers/MobilePush/Edit/index.js +9 -30
  24. package/containers/MobilePush/Edit/selectors.js +2 -2
  25. package/containers/MobilePush/initialSchema.js +0 -12
  26. package/containers/MobilepushWrapper/index.js +3 -2
  27. package/containers/Sms/Create/index.js +17 -31
  28. package/containers/Sms/Edit/index.js +6 -20
  29. package/containers/Templates/index.js +60 -67
  30. package/containers/Templates/reducer.js +3 -3
  31. package/containers/WeChat/MapTemplates/index.js +6 -22
  32. package/containers/WeChat/RichmediaTemplates/Create/_createRichmedia.scss +46 -2
  33. package/containers/WeChat/RichmediaTemplates/Create/actions.js +4 -3
  34. package/containers/WeChat/RichmediaTemplates/Create/constants.js +1 -0
  35. package/containers/WeChat/RichmediaTemplates/Create/index.js +525 -165
  36. package/containers/WeChat/RichmediaTemplates/Create/messages.js +125 -1
  37. package/containers/WeChat/RichmediaTemplates/Create/reducer.js +15 -4
  38. package/containers/WeChat/RichmediaTemplates/Create/richmediaschema.js +497 -0
  39. package/containers/WeChat/RichmediaTemplates/Create/sagas.js +7 -3
  40. package/containers/WeChat/RichmediaTemplates/Create/selectors.js +5 -0
  41. package/containers/WeChat/RichmediaTemplates/Edit/index.js +24 -8
  42. package/containers/WeChat/RichmediaTemplates/Edit/selectors.js +6 -1
  43. package/initialState.js +1 -0
  44. package/package.json +2 -2
  45. package/routes.js +22 -4
@@ -6,8 +6,132 @@
6
6
  import { defineMessages } from 'react-intl';
7
7
 
8
8
  export default defineMessages({
9
- header: {
9
+ "header": {
10
10
  id: 'app.containers.Create.header',
11
11
  defaultMessage: 'This is Create container !',
12
12
  },
13
+ "titleCharacterCount": {
14
+ id: 'app.containers.Create.titleCharacterCount',
15
+ defaultMessage: 'Title exceeds character count limit by',
16
+ },
17
+ "authorCharacterCount": {
18
+ id: 'app.containers.Create.authorCharacterCount',
19
+ defaultMessage: 'Author exceeds character count limit by',
20
+ },
21
+ "coverAbstractCharacterCount": {
22
+ id: 'app.containers.Create.coverAbstractCharacterCount',
23
+ defaultMessage: 'Cover abstract exceeds character count limit by',
24
+ },
25
+ "saveSuccess": {
26
+ id: 'app.containers.Create.saveSuccess',
27
+ defaultMessage: 'Template saved successfully',
28
+ },
29
+ "modalTitle": {
30
+ id: 'app.containers.Create.modalTitle',
31
+ defaultMessage: 'Alert',
32
+ },
33
+ "modalBody": {
34
+ id: 'app.containers.Create.modalBody',
35
+ defaultMessage: 'Do you really want to go back? All your temporary changes will be lost!',
36
+ },
37
+ "emptyTemplateName": {
38
+ id: 'app.containers.Create.emptyTemplateName',
39
+ defaultMessage: 'Cannot leave template name empty',
40
+ },
41
+ "wrongFormatFile": {
42
+ id: 'app.containers.Create.wrongFormatFile',
43
+ defaultMessage: 'Wrong file upoaded. Please upload image file',
44
+ },
45
+ "formEmpty": {
46
+ id: 'app.containers.Create.formEmpty',
47
+ defaultMessage: 'Cannot leave form empty',
48
+ },
49
+ "titleEmpty": {
50
+ id: 'app.containers.Create.titleEmpty',
51
+ defaultMessage: 'Cannot leave title field empty',
52
+ },
53
+ "noImage": {
54
+ id: 'app.containers.Create.noImage',
55
+ defaultMessage: 'Please upload an image',
56
+ },
57
+ "sourceLinkEmpty": {
58
+ id: 'app.containers.Create.sourceLinkEmpty',
59
+ defaultMessage: 'Cannot leave source link field empty',
60
+ },
61
+ "contentEmpty": {
62
+ id: 'app.containers.Create.contentEmpty',
63
+ defaultMessage: 'Cannot leave content field empty',
64
+ },
65
+ "titleNameRepeated": {
66
+ id: 'app.containers.Create.titleNameRepeated',
67
+ defaultMessage: 'Title name cannot be repeated',
68
+ },
69
+ "wrongUrl": {
70
+ id: 'app.containers.Create.wrongUrl',
71
+ defaultMessage: 'Enter correct URL',
72
+ },
73
+ "maxContentCount": {
74
+ id: 'app.containers.Create.maxContentCount',
75
+ defaultMessage: 'You have reached the maximum template size',
76
+ },
77
+ "addNewRichmedia": {
78
+ id: 'app.containers.Create.addNewRichmedia',
79
+ defaultMessage: 'Add Richmedia content',
80
+ },
81
+ 'Title*': {
82
+ id: 'app.containers.Create.Title*',
83
+ defaultMessage: 'Title*',
84
+ },
85
+ 'Please input title': {
86
+ id: 'app.containers.Create.Please_input_title',
87
+ defaultMessage: 'Please input title',
88
+ },
89
+ 'Author': {
90
+ id: 'app.containers.Create.Author',
91
+ defaultMessage: 'Author',
92
+ },
93
+ 'Please input author': {
94
+ id: 'app.containers.Create.Please_input_author',
95
+ defaultMessage: 'Please input author',
96
+ },
97
+ 'Cover image*': {
98
+ id: 'app.containers.Create.Cover_image*',
99
+ defaultMessage: 'Cover image*',
100
+ },
101
+ 'Cover abstract': {
102
+ id: 'app.containers.Create.Cover_abstract',
103
+ defaultMessage: 'Cover abstract',
104
+ },
105
+ 'Please input cover abstract': {
106
+ id: 'app.containers.Create.Please_input_cover_abstract',
107
+ defaultMessage: 'Please input cover abstract',
108
+ },
109
+ 'Content*': {
110
+ id: 'app.containers.Create.Content*',
111
+ defaultMessage: 'Content*',
112
+ },
113
+ 'Please input content': {
114
+ id: 'app.containers.Create.Please_input_content',
115
+ defaultMessage: 'Please input content',
116
+ },
117
+ 'Show cover picture': {
118
+ id: 'app.containers.Create.Show_cover_picture',
119
+ defaultMessage: 'Show cover picture',
120
+ },
121
+ 'Who can post comments on this content': {
122
+ id: 'app.containers.Create.Who_can_post_comments_on_this_content',
123
+ defaultMessage: 'Who can post comments on this content',
124
+ },
125
+ 'No one': {
126
+ id: 'app.containers.Create.No_one',
127
+ defaultMessage: 'No one',
128
+ },
129
+ 'Anyone': {
130
+ id: 'app.containers.Create.Anyone',
131
+ defaultMessage: 'Anyone',
132
+ },
133
+ 'Only followers': {
134
+ id: 'app.containers.Create.Only_followers',
135
+ defaultMessage: 'Only followers',
136
+ },
13
137
  });
@@ -18,25 +18,35 @@ function createReducer(state = initialState, action) {
18
18
  .set('uploadAssetSuccess', false)
19
19
  .set('assetUploading', true);
20
20
  case types.UPLOAD_ASSET_SUCCESS:
21
- return state
21
+ if (action.uploadId === 'image-value') {
22
+ return state
22
23
  .set('uploadAssetSuccess', (action.statusCode !== undefined && action.statusCode !== '' && action.statusCode < 300))
23
24
  .set('assetUploading', false)
24
25
  .setIn(['uploadedAssetData', action.contentId], action.data);
26
+ } else if (action.uploadId === 'content-image-value') {
27
+ return state
28
+ .set('uploadContentAssetSuccess', (action.statusCode !== undefined && action.statusCode !== '' && action.statusCode < 300))
29
+ .set('assetUploading', false)
30
+ .set('uploadedContentAssetData', action.data);
31
+ }
32
+ break;
25
33
  case types.UPLOAD_ASSET_FAILURE:
26
34
  return state
27
35
  .set('uploadAssetSuccess', false)
28
36
  .set('assetUploading', false);
29
- case types.CLEAR_ASSET:
37
+ case types.CLEAR_CONTENT_ASSET:
30
38
  return state
31
- .delete('uploadedAssetData');
39
+ .delete('uploadedContentAssetData');
32
40
  case types.SAVE_TEMPLATE_REQUEST:
33
41
  return state
42
+ .set('saveTemplateErrorMessage', undefined)
34
43
  .set('savingTemplate', true);
35
44
  case types.SAVE_TEMPLATE_SUCCESS:
36
45
  return state
37
46
  .set('saveTemplateSuccess', (action.statusCode !== undefined && action.statusCode !== '' && action.statusCode < 300))
38
47
  .set('savingTemplate', false)
39
- .set('saveTemplateRes', action.data);
48
+ .set('saveTemplateRes', action.data)
49
+ .set('saveTemplateErrorMessage', action.errorMsg);
40
50
  case types.SAVE_TEMPLATE_FAILURE:
41
51
  return state
42
52
  .set('saveTemplateSuccess', false)
@@ -44,6 +54,7 @@ function createReducer(state = initialState, action) {
44
54
  default:
45
55
  return state;
46
56
  }
57
+ return state;
47
58
  }
48
59
 
49
60
  export default createReducer;
@@ -0,0 +1,497 @@
1
+ export default {
2
+ standalone: {
3
+ sections: [
4
+ {
5
+ type: "parent",
6
+ childSections: [
7
+ {
8
+ type: "multicols",
9
+ inputFields: [
10
+ {
11
+ rowClassName: "wechat-richmedia-row",
12
+ cols: [
13
+ {
14
+ id: "title-label",
15
+ metaType: "label",
16
+ value: "Title*",
17
+ primitive: true,
18
+ dynamicTab: false,
19
+ type: "div",
20
+ width: 4,
21
+ style: {
22
+ backgroundColor: "white",
23
+ textAlign: "left",
24
+ color: "#333333",
25
+ lineHeight: "24px",
26
+ fontSize: "14px",
27
+ fontFamily: "open-sans",
28
+ fontStyle: "normal",
29
+ },
30
+ onlyDisplay: true,
31
+ colStyle: {
32
+ flex: 1,
33
+ },
34
+ },
35
+ {
36
+ id: "title-value",
37
+ label: "Title",
38
+ type: "input",
39
+ metaType: "text",
40
+ datatype: "string",
41
+ required: true,
42
+ width: 16,
43
+ placeholder: "Please input title",
44
+ fluid: true,
45
+ styling: "semantic",
46
+ order: 1,
47
+ disabled: false,
48
+ customComponent: false,
49
+ onlyDisplay: false,
50
+ supportedEvents: [
51
+ "onChange",
52
+ ],
53
+ errorMessage: "This field is required!",
54
+ }],
55
+ },
56
+ {
57
+ rowClassName: "wechat-richmedia-row",
58
+ cols: [
59
+ {
60
+ id: "author-label",
61
+ metaType: "label",
62
+ value: "Author",
63
+ primitive: true,
64
+ dynamicTab: false,
65
+ type: "div",
66
+ width: 4,
67
+ style: {
68
+ backgroundColor: "white",
69
+ textAlign: "left",
70
+ color: "#333333",
71
+ lineHeight: "24px",
72
+ fontSize: "14px",
73
+ fontFamily: "open-sans",
74
+ fontStyle: "normal",
75
+ },
76
+ onlyDisplay: true,
77
+ colStyle: {
78
+ flex: 1,
79
+ },
80
+ },
81
+ {
82
+ id: "author-value",
83
+ label: "Author",
84
+ type: "input",
85
+ metaType: "text",
86
+ datatype: "string",
87
+ required: true,
88
+ width: 16,
89
+ placeholder: "Please input author",
90
+ fluid: true,
91
+ styling: "semantic",
92
+ order: 1,
93
+ disabled: false,
94
+ customComponent: false,
95
+ supportedEvents: [
96
+ "onChange",
97
+ ],
98
+ errorMessage: "This field is required!",
99
+ }],
100
+ },
101
+ {
102
+ rowClassName: "wechat-richmedia-row",
103
+ cols: [
104
+ {
105
+ id: "image-label",
106
+ metaType: "label",
107
+ value: "Cover image*",
108
+ primitive: true,
109
+ dynamicTab: false,
110
+ type: "div",
111
+ width: 4,
112
+ style: {
113
+ backgroundColor: "white",
114
+ textAlign: "left",
115
+ color: "#333333",
116
+ lineHeight: "24px",
117
+ fontSize: "14px",
118
+ fontFamily: "open-sans",
119
+ fontStyle: "normal",
120
+ },
121
+ offset: 0,
122
+ onlyDisplay: true,
123
+ colStyle: {
124
+ flex: 1,
125
+ },
126
+ },
127
+ {
128
+ id: "image-value",
129
+ label: "Upload Image",
130
+ type: "upload",
131
+ width: 4,
132
+ supportedExtensions: ".bmp, .png, .jpeg, .gif .jpg",
133
+ metaType: "text",
134
+ datatype: "string",
135
+ required: true,
136
+ fluid: true,
137
+ styling: "semantic",
138
+ order: 1,
139
+ disabled: false,
140
+ customComponent: true,
141
+ submitAction: "onUpload",
142
+ supportedEvents: [
143
+ "onUpload",
144
+ ],
145
+ }],
146
+ },
147
+ {
148
+ rowClassName: "wechat-richmedia-row",
149
+ rowStyle: {
150
+ 'margin-bottom': "0",
151
+ },
152
+ cols: [
153
+ {
154
+ id: "cover-abstract-label",
155
+ metaType: "label",
156
+ value: "Cover abstract",
157
+ primitive: true,
158
+ dynamicTab: false,
159
+ type: "div",
160
+ width: 4,
161
+ style: {
162
+ backgroundColor: "white",
163
+ textAlign: "left",
164
+ color: "#333333",
165
+ lineHeight: "24px",
166
+ fontSize: "14px",
167
+ fontFamily: "open-sans",
168
+ fontStyle: "normal",
169
+ },
170
+ onlyDisplay: true,
171
+ colStyle: {
172
+ flex: 1,
173
+ },
174
+ },
175
+ {
176
+ id: "cover-abstract-value",
177
+ label: "Cover abstract",
178
+ type: "textarea",
179
+ metaType: "text",
180
+ datatype: "string",
181
+ required: true,
182
+ width: 16,
183
+ placeholder: "Please input cover abstract",
184
+ fluid: false,
185
+ styling: "semantic",
186
+ order: 2,
187
+ disabled: false,
188
+ customComponent: false,
189
+ supportedEvents: [
190
+ "onChange",
191
+ ],
192
+ errorMessage: "This field is required!",
193
+ autosize: true,
194
+ autosizeParams: {
195
+ maxRows: 18,
196
+ minRows: 3,
197
+ },
198
+ style: {
199
+ backgroundColor: "white",
200
+ textAlign: "left",
201
+ color: "#333333",
202
+ lineHeight: "24px",
203
+ fontSize: "14px",
204
+ fontFamily: "proxima-nova",
205
+ fontStyle: "normal",
206
+ },
207
+ }],
208
+ },
209
+ {
210
+ rowClassName: "wechat-richmedia-row",
211
+ rowStyle: {
212
+ display: "inline-flex",
213
+ },
214
+ cols: [
215
+ {
216
+ id: "show-cover-pic-value",
217
+ supportedEvents: [
218
+ "onChange",
219
+ ],
220
+ type: "checkbox",
221
+ metaType: "text",
222
+ datatype: "boolean",
223
+ required: true,
224
+ fluid: true,
225
+ styling: "semantic",
226
+ order: 1,
227
+ offset: 4,
228
+ value: 0,
229
+ onlyDisplay: false,
230
+ disabled: false,
231
+ errorMessage: "Please check if you intend to use unicode characters.",
232
+ customComponent: false,
233
+ },
234
+ {
235
+ id: "show-cover-pic-label",
236
+ metaType: "label",
237
+ value: "Whether to display the graphic cover on the graphic details page",
238
+ primitive: true,
239
+ dynamicTab: false,
240
+ type: "div",
241
+ style: {
242
+ backgroundColor: "white",
243
+ textAlign: "left",
244
+ color: "#333333",
245
+ lineHeight: "24px",
246
+ fontSize: "14px",
247
+ fontFamily: "open-sans",
248
+ fontStyle: "normal",
249
+ },
250
+ offset: 0,
251
+ onlyDisplay: true,
252
+ colStyle: {
253
+ flex: 1,
254
+ },
255
+ },
256
+ ],
257
+ },
258
+ {
259
+ rowClassName: "wechat-richmedia-row",
260
+ cols: [
261
+ {
262
+ id: "source-link-label",
263
+ metaType: "label",
264
+ value: "Source link*",
265
+ primitive: true,
266
+ dynamicTab: false,
267
+ type: "div",
268
+ width: 4,
269
+ style: {
270
+ backgroundColor: "white",
271
+ textAlign: "left",
272
+ color: "#333333",
273
+ lineHeight: "24px",
274
+ fontSize: "14px",
275
+ fontFamily: "open-sans",
276
+ fontStyle: "normal",
277
+ },
278
+ onlyDisplay: true,
279
+ colStyle: {
280
+ flex: 1,
281
+ },
282
+ },
283
+ {
284
+ id: "source-link-value",
285
+ label: "Cover abstract",
286
+ type: "input",
287
+ metaType: "text",
288
+ datatype: "string",
289
+ required: true,
290
+ width: 16,
291
+ placeholder: "Example: http://example.com",
292
+ fluid: true,
293
+ styling: "semantic",
294
+ order: 1,
295
+ disabled: false,
296
+ customComponent: false,
297
+ supportedEvents: [
298
+ "onChange",
299
+ ],
300
+ errorMessage: "This field is required!",
301
+ }],
302
+ }],
303
+ },
304
+ {
305
+ type: "parent",
306
+ rowStyle: {
307
+ display: "inline-flex",
308
+ },
309
+ childSections: [
310
+ {
311
+ type: "multicols",
312
+ inputFields: [
313
+ {
314
+ cols: [
315
+ {
316
+ id: "content-label",
317
+ metaType: "label",
318
+ value: "Content*",
319
+ primitive: true,
320
+ dynamicTab: false,
321
+ type: "div",
322
+ width: 4,
323
+ style: {
324
+ backgroundColor: "white",
325
+ textAlign: "left",
326
+ color: "#333333",
327
+ lineHeight: "24px",
328
+ fontSize: "14px",
329
+ fontFamily: "open-sans",
330
+ fontStyle: "normal",
331
+ width: "8.3rem",
332
+ },
333
+ onlyDisplay: true,
334
+ },
335
+ ],
336
+ },
337
+ ],
338
+ },
339
+ {
340
+ type: "parent",
341
+ childSections: [
342
+ {
343
+ type: "multicols",
344
+ inputFields: [
345
+ {
346
+ cols: [
347
+ {
348
+ id: "content-label-2",
349
+ metaType: "label",
350
+ value: "to be displayed on the graphic details page",
351
+ primitive: true,
352
+ dynamicTab: false,
353
+ type: "div",
354
+ width: 11,
355
+ style: {
356
+ backgroundColor: "white",
357
+ textAlign: "left",
358
+ color: "#333333",
359
+ lineHeight: "24px",
360
+ fontSize: "14px",
361
+ fontFamily: "open-sans",
362
+ fontStyle: "normal",
363
+ },
364
+ onlyDisplay: true,
365
+ },
366
+ {
367
+ id: "content-image-value",
368
+ label: "Insert Image",
369
+ type: "upload",
370
+ width: 11,
371
+ supportedExtensions: ".bmp, .png, .jpeg, .gif .jpg",
372
+ metaType: "text",
373
+ datatype: "string",
374
+ required: true,
375
+ fluid: true,
376
+ styling: "semantic",
377
+ order: 1,
378
+ disabled: true,
379
+ customComponent: true,
380
+ submitAction: "onUpload",
381
+ supportedEvents: [
382
+ "onUpload",
383
+ ],
384
+ style: {
385
+ "margin-bottom": "5px",
386
+ },
387
+ },
388
+ ],
389
+ },
390
+ ],
391
+ },
392
+ {
393
+ type: "multicols",
394
+ inputFields: [
395
+ {
396
+ rowClassName: "wechat-richmedia-row",
397
+ cols: [
398
+ {
399
+ id: "content-value",
400
+ label: "Content",
401
+ type: "ckeditor",
402
+ metaType: "text",
403
+ datatype: "string",
404
+ required: true,
405
+ errorMessage: "This field is required!",
406
+ placeholder: "Please input content",
407
+ fluid: false,
408
+ styling: "semantic",
409
+ onlyDisplay: false,
410
+ disabled: false,
411
+ autosize: true,
412
+ autosizeParams: {
413
+ maxRows: 18,
414
+ minRows: 3,
415
+ },
416
+ style: {
417
+ "backgroundColor": "white",
418
+ "textAlign": "left",
419
+ "color": "#333333",
420
+ "lineHeight": "24px",
421
+ "fontSize": "14px",
422
+ "fontFamily": "proxima-nova",
423
+ "fontStyle": "normal",
424
+ "max-width": "670px",
425
+ },
426
+ order: 2,
427
+ customComponent: true,
428
+ supportedEvents: [
429
+ "onContentChange",
430
+ "getEditorInstanse",
431
+ "onFocusOut",
432
+ "onFocusIn",
433
+ ],
434
+ },
435
+ ],
436
+ },
437
+ ],
438
+ },
439
+ ],
440
+ },
441
+ ],
442
+ },
443
+ {
444
+ type: "multicols",
445
+ inputFields: [
446
+ {
447
+ rowClassName: "wechat-richmedia-row",
448
+ cols: [
449
+ {
450
+ id: "post-comments-label",
451
+ metaType: "label",
452
+ value: "Who can post comments on this content",
453
+ primitive: true,
454
+ dynamicTab: false,
455
+ type: "div",
456
+ width: 4,
457
+ style: {
458
+ backgroundColor: "white",
459
+ textAlign: "left",
460
+ color: "#333333",
461
+ lineHeight: "24px",
462
+ fontSize: "14px",
463
+ fontFamily: "open-sans",
464
+ fontStyle: "normal",
465
+ },
466
+ offset: 0,
467
+ onlyDisplay: true,
468
+ colStyle: {
469
+ flex: 1,
470
+ },
471
+ },
472
+ {
473
+ id: "post-comments-value",
474
+ type: "radioGroup",
475
+ metaType: "text",
476
+ datatype: "string",
477
+ options: ["No one", "Anyone", "Only followers"],
478
+ value: "No one",
479
+ required: true,
480
+ width: 18,
481
+ errorMessage: "Please select",
482
+ fluid: true,
483
+ styling: "semantic",
484
+ order: 1,
485
+ disabled: false,
486
+ customComponent: false,
487
+ supportedEvents: ["onChange"],
488
+ }],
489
+ }],
490
+ },
491
+ ],
492
+ }],
493
+ },
494
+
495
+ channel: "WECHAT",
496
+ module: "Campaigns",
497
+ };