@capillarytech/creatives-library 8.0.136-alpha.4 → 8.0.136-beta.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/BreadCrumbs/index.js +65 -0
- package/components/BreadCrumbs/messages.js +13 -0
- package/components/CapTagList/index.js +235 -0
- package/components/CapTagList/messages.js +45 -0
- package/components/Card/_customCard.scss +40 -0
- package/components/Card/index.js +78 -0
- package/components/Card/tests/__snapshots__/index.test.js.snap +22 -0
- package/components/Card/tests/index.test.js +20 -0
- package/components/CardGrid/index.js +71 -0
- package/components/Ckeditor/index.js +238 -0
- package/components/Ckeditor/messages.js +13 -0
- package/components/Ckeditor/style.scss +3 -0
- package/components/Component/index.js +29 -0
- package/components/CustomPopOver/index.js +81 -0
- package/components/CustomPopOver/messages.js +17 -0
- package/components/DateFilter/index.js +349 -0
- package/components/DateFilter/messages.js +57 -0
- package/components/DateRange/index.js +114 -0
- package/components/DateRange/messages.js +25 -0
- package/components/Edmeditor/index.js +65 -0
- package/components/Edmeditor/messages.js +13 -0
- package/components/EmailPreview/_emailPreview.scss +119 -0
- package/components/EmailPreview/assets/images/iPad.svg +10 -0
- package/components/EmailPreview/assets/images/mobile.png +0 -0
- package/components/EmailPreview/index.js +107 -0
- package/components/EmailPreview/messages.js +33 -0
- package/components/Footer/index.js +27 -0
- package/components/Footer/messages.js +13 -0
- package/components/FormBuilder/_formBuilder.scss +83 -0
- package/components/FormBuilder/index.js +3279 -0
- package/components/FormBuilder/messages.js +61 -0
- package/components/Header/index.js +44 -0
- package/components/Header/messages.js +29 -0
- package/components/ImagePreview/_imagePreview.scss +63 -0
- package/components/ImagePreview/index.js +52 -0
- package/components/ImagePreview/messages.js +17 -0
- package/components/PageHeader/_pageHeader.scss +22 -0
- package/components/PageHeader/index.js +37 -0
- package/components/PageHeader/messages.js +13 -0
- package/components/Pagination/_pagination.scss +5 -0
- package/components/Pagination/index.js +49 -0
- package/components/PreviewSideBar/_previewsidebar.scss +28 -0
- package/components/PreviewSideBar/index.js +152 -0
- package/components/PreviewSideBar/messages.js +41 -0
- package/components/Sidebar/_sidebar.scss +115 -0
- package/components/Sidebar/index.js +214 -0
- package/components/Sidebar/messages.js +21 -0
- package/components/SlideBox/_slideBox.scss +63 -0
- package/components/SlideBox/index.js +47 -0
- package/components/SlideBox/tests/index.test.js +103 -0
- package/components/SmsEditor/index.js +55 -0
- package/components/SmsTest/index.js +117 -0
- package/components/SmsTest/messages.js +21 -0
- package/components/TemplatePreview/WechatRichmediaTemplatePreview/_wechatRichmediaTemplatePrev.scss +42 -0
- package/components/TemplatePreview/WechatRichmediaTemplatePreview/index.js +141 -0
- package/components/TemplatePreview/WechatRichmediaTemplatePreview/messages.js +21 -0
- package/components/TemplatePreview/_templatePreview.scss +642 -0
- package/components/TemplatePreview/assets/images/WECHAT_5x.png +0 -0
- package/components/TemplatePreview/assets/images/androidPushMessage.svg +45 -0
- package/components/TemplatePreview/assets/images/home-screen-android.svg +21 -0
- package/components/TemplatePreview/assets/images/home-screen-ios.svg +16 -0
- package/components/TemplatePreview/assets/images/iPhonePushMessage.svg +135 -0
- package/components/TemplatePreview/assets/images/mobile.svg +24 -0
- package/components/TemplatePreview/assets/images/sms-body.png +0 -0
- package/components/TemplatePreview/assets/images/sms-icon.png +0 -0
- package/components/TemplatePreview/assets/images/sms_mobile.png +0 -0
- package/components/TemplatePreview/assets/images/sms_mobile_android.svg +22 -0
- package/components/TemplatePreview/assets/images/sms_mobile_ios.svg +16 -0
- package/components/TemplatePreview/assets/images/user-icon.svg +19 -0
- package/components/TemplatePreview/assets/images/wechat-mobile.svg +78 -0
- package/components/TemplatePreview/assets/images/wechat_mobile_android.svg +20 -0
- package/components/TemplatePreview/index.js +617 -0
- package/components/TemplatePreview/messages.js +78 -0
- package/components/Toastr/index.js +60 -0
- package/components/Toastr/messages.js +13 -0
- package/components/ToastrMessage/index.js +113 -0
- package/components/ToastrMessage/messages.js +17 -0
- package/components/TopBar/_topbar.scss +46 -0
- package/components/TopBar/assets/images/capillary_logo.png +0 -0
- package/components/TopBar/assets/images/old_capillary_logo.png +0 -0
- package/components/TopBar/index.js +113 -0
- package/components/TopBar/messages.js +29 -0
- package/containers/App/actions.js +7 -0
- package/containers/App/constants.js +114 -0
- package/containers/App/index.js +52 -0
- package/containers/App/reducer.js +19 -0
- package/containers/App/sagas.js +31 -0
- package/containers/App/selectors.js +25 -0
- package/containers/App/test/saga.test.js +11 -0
- package/containers/Assets/Gallery/_gallery.scss +126 -0
- package/containers/Assets/Gallery/actions.js +37 -0
- package/containers/Assets/Gallery/constants.js +23 -0
- package/containers/Assets/Gallery/index.js +473 -0
- package/containers/Assets/Gallery/messages.js +93 -0
- package/containers/Assets/Gallery/reducer.js +81 -0
- package/containers/Assets/Gallery/sagas.js +80 -0
- package/containers/Assets/Gallery/selectors.js +25 -0
- package/containers/Assets/Gallery/tests/__snapshots__/reducer.test.js.snap +9 -0
- package/containers/Assets/Gallery/tests/actions.test.js +25 -0
- package/containers/Assets/Gallery/tests/reducer.test.js +96 -0
- package/containers/Assets/Gallery/tests/saga.test.js +157 -0
- package/containers/Cap/actions.js +66 -0
- package/containers/Cap/constants.js +25 -0
- package/containers/Cap/index.js +402 -0
- package/containers/Cap/messages.js +75 -0
- package/containers/Cap/reducer.js +113 -0
- package/containers/Cap/sagas.js +159 -0
- package/containers/Cap/selectors.js +75 -0
- package/containers/Cap/tests/__snapshots__/index.test.js.snap +2269 -0
- package/containers/Cap/tests/index.test.js +22 -0
- package/containers/Cap/tests/saga.test.js +284 -0
- package/containers/Dashboard/actions.js +15 -0
- package/containers/Dashboard/constants.js +7 -0
- package/containers/Dashboard/index.js +76 -0
- package/containers/Dashboard/messages.js +13 -0
- package/containers/Dashboard/reducer.js +21 -0
- package/containers/Dashboard/sagas.js +17 -0
- package/containers/Dashboard/selectors.js +25 -0
- package/containers/Dashboard/test/saga.test.js +9 -0
- package/containers/Ebill/_ebill.scss +5 -0
- package/containers/Ebill/actions.js +43 -0
- package/containers/Ebill/constants.js +20 -0
- package/containers/Ebill/index.js +1278 -0
- package/containers/Ebill/messages.js +77 -0
- package/containers/Ebill/reducer.js +72 -0
- package/containers/Ebill/sagas.js +74 -0
- package/containers/Ebill/selectors.js +25 -0
- package/containers/Ebill/test/saga.test.js +11 -0
- package/containers/Email/_email.scss +141 -0
- package/containers/Email/actions.js +81 -0
- package/containers/Email/constants.js +36 -0
- package/containers/Email/index.js +3325 -0
- package/containers/Email/messages.js +289 -0
- package/containers/Email/reducer.js +142 -0
- package/containers/Email/sagas.js +135 -0
- package/containers/Email/selectors.js +31 -0
- package/containers/Email/test/saga.test.js +671 -0
- package/containers/LanguageProvider/actions.js +17 -0
- package/containers/LanguageProvider/constants.js +8 -0
- package/containers/LanguageProvider/index.js +80 -0
- package/containers/LanguageProvider/reducer.js +30 -0
- package/containers/LanguageProvider/selectors.js +20 -0
- package/containers/LanguageProvider/tests/actions.test.js +19 -0
- package/containers/LanguageProvider/tests/index.test.js +78 -0
- package/containers/LanguageProvider/tests/reducer.test.js +20 -0
- package/containers/LanguageProvider/tests/selectors.test.js +15 -0
- package/containers/Line/Create/_lineCreate.scss +54 -0
- package/containers/Line/Create/actions.js +90 -0
- package/containers/Line/Create/constants.js +39 -0
- package/containers/Line/Create/index.js +836 -0
- package/containers/Line/Create/messages.js +189 -0
- package/containers/Line/Create/reducer.js +99 -0
- package/containers/Line/Create/sagas.js +121 -0
- package/containers/Line/Create/selectors.js +36 -0
- package/containers/Line/Create/tests/saga.test.js +202 -0
- package/containers/Line/Edit/_lineEdit.scss +35 -0
- package/containers/Line/Edit/actions.js +79 -0
- package/containers/Line/Edit/constants.js +27 -0
- package/containers/Line/Edit/index.js +1050 -0
- package/containers/Line/Edit/messages.js +177 -0
- package/containers/Line/Edit/reducer.js +83 -0
- package/containers/Line/Edit/sagas.js +80 -0
- package/containers/Line/Edit/selectors.js +29 -0
- package/containers/Line/Edit/test/saga.test.js +160 -0
- package/containers/Login/assets/images/capillary_logo.png +0 -0
- package/containers/Login/components/LoginForm/index.js +62 -0
- package/containers/Login/components/LoginForm/messages.js +33 -0
- package/containers/Login/index.js +130 -0
- package/containers/Login/messages.js +25 -0
- package/containers/Login/selectors.js +25 -0
- package/containers/MobilePush/Create/_mobilePushCreate.scss +39 -0
- package/containers/MobilePush/Create/actions.js +46 -0
- package/containers/MobilePush/Create/constants.js +23 -0
- package/containers/MobilePush/Create/index.js +2303 -0
- package/containers/MobilePush/Create/messages.js +269 -0
- package/containers/MobilePush/Create/reducer.js +70 -0
- package/containers/MobilePush/Create/sagas.js +74 -0
- package/containers/MobilePush/Create/selectors.js +28 -0
- package/containers/MobilePush/Create/test/saga.test.js +19 -0
- package/containers/MobilePush/Edit/_mobilePushCreate.scss +39 -0
- package/containers/MobilePush/Edit/actions.js +91 -0
- package/containers/MobilePush/Edit/constants.js +35 -0
- package/containers/MobilePush/Edit/index.js +2601 -0
- package/containers/MobilePush/Edit/messages.js +266 -0
- package/containers/MobilePush/Edit/reducer.js +112 -0
- package/containers/MobilePush/Edit/sagas.js +126 -0
- package/containers/MobilePush/Edit/selectors.js +29 -0
- package/containers/MobilePush/Edit/tests/saga.test.js +255 -0
- package/containers/NotFoundPage/index.js +25 -0
- package/containers/NotFoundPage/messages.js +13 -0
- package/containers/NotFoundPage/tests/index.test.js +17 -0
- package/containers/Sms/Create/_smsCreate.scss +42 -0
- package/containers/Sms/Create/actions.js +27 -0
- package/containers/Sms/Create/constants.js +16 -0
- package/containers/Sms/Create/index.js +1488 -0
- package/containers/Sms/Create/messages.js +109 -0
- package/containers/Sms/Create/reducer.js +41 -0
- package/containers/Sms/Create/sagas.js +40 -0
- package/containers/Sms/Create/selectors.js +28 -0
- package/containers/Sms/Create/test/saga.test.js +11 -0
- package/containers/Sms/Edit/actions.js +40 -0
- package/containers/Sms/Edit/constants.js +17 -0
- package/containers/Sms/Edit/index.js +1472 -0
- package/containers/Sms/Edit/messages.js +105 -0
- package/containers/Sms/Edit/reducer.js +50 -0
- package/containers/Sms/Edit/sagas.js +60 -0
- package/containers/Sms/Edit/selectors.js +32 -0
- package/containers/Sms/Edit/test/saga.test.js +13 -0
- package/containers/TagList/_tagList.scss +8 -0
- package/containers/TagList/actions.js +15 -0
- package/containers/TagList/constants.js +32 -0
- package/containers/TagList/index.js +236 -0
- package/containers/TagList/messages.js +13 -0
- package/containers/TagList/reducer.js +23 -0
- package/containers/TagList/sagas.js +11 -0
- package/containers/TagList/selectors.js +25 -0
- package/containers/Templates/_templates.scss +333 -0
- package/containers/Templates/actions.js +103 -0
- package/containers/Templates/constants.js +60 -0
- package/containers/Templates/index.js +1756 -0
- package/containers/Templates/messages.js +337 -0
- package/containers/Templates/reducer.js +142 -0
- package/containers/Templates/sagas.js +163 -0
- package/containers/Templates/selectors.js +28 -0
- package/containers/Templates/test/saga.test.js +241 -0
- package/containers/WeChat/MapTemplates/_mapTemplates.scss +8 -0
- package/containers/WeChat/MapTemplates/actions.js +52 -0
- package/containers/WeChat/MapTemplates/constants.js +28 -0
- package/containers/WeChat/MapTemplates/index.js +1610 -0
- package/containers/WeChat/MapTemplates/messages.js +157 -0
- package/containers/WeChat/MapTemplates/reducer.js +74 -0
- package/containers/WeChat/MapTemplates/sagas.js +84 -0
- package/containers/WeChat/MapTemplates/selectors.js +25 -0
- package/containers/WeChat/MapTemplates/test/saga.test.js +155 -0
- package/containers/WeChat/RichmediaTemplates/Create/_createRichmedia.scss +57 -0
- package/containers/WeChat/RichmediaTemplates/Create/actions.js +36 -0
- package/containers/WeChat/RichmediaTemplates/Create/constants.js +15 -0
- package/containers/WeChat/RichmediaTemplates/Create/index.js +1071 -0
- package/containers/WeChat/RichmediaTemplates/Create/messages.js +165 -0
- package/containers/WeChat/RichmediaTemplates/Create/reducer.js +60 -0
- package/containers/WeChat/RichmediaTemplates/Create/richmediaschema.js +497 -0
- package/containers/WeChat/RichmediaTemplates/Create/sagas.js +51 -0
- package/containers/WeChat/RichmediaTemplates/Create/selectors.js +37 -0
- package/containers/WeChat/RichmediaTemplates/Create/test/saga.test.js +13 -0
- package/containers/WeChat/RichmediaTemplates/Edit/actions.js +20 -0
- package/containers/WeChat/RichmediaTemplates/Edit/constants.js +10 -0
- package/containers/WeChat/RichmediaTemplates/Edit/index.js +136 -0
- package/containers/WeChat/RichmediaTemplates/Edit/messages.js +13 -0
- package/containers/WeChat/RichmediaTemplates/Edit/reducer.js +28 -0
- package/containers/WeChat/RichmediaTemplates/Edit/sagas.js +36 -0
- package/containers/WeChat/RichmediaTemplates/Edit/selectors.js +30 -0
- package/containers/WeChat/RichmediaTemplates/Edit/test/saga.test.js +12 -0
- package/containers/WeChat/RichmediaTemplates/View/actions.js +15 -0
- package/containers/WeChat/RichmediaTemplates/View/constants.js +7 -0
- package/containers/WeChat/RichmediaTemplates/View/index.js +47 -0
- package/containers/WeChat/RichmediaTemplates/View/messages.js +21 -0
- package/containers/WeChat/RichmediaTemplates/View/reducer.js +23 -0
- package/containers/WeChat/RichmediaTemplates/View/sagas.js +11 -0
- package/containers/WeChat/RichmediaTemplates/View/selectors.js +25 -0
- package/index.js +2 -4
- package/package.json +1 -1
- package/routes.js +202 -136
- package/services/getSchema.js +1 -1
- package/services/localStorageApi.js +0 -1
- package/tests/i18n.test.js +1 -1
- package/utils/asyncInjectors.js +78 -0
- package/utils/authWrapper.js +1 -1
- package/utils/callNativeEvent.js +16 -0
- package/utils/checkStore.js +21 -0
- package/utils/common.js +2 -2
- package/utils/customAuthWrapper.js +62 -0
- package/utils/customConnectedAuthWrapper.js +26 -0
- package/utils/tagValidations.js +1 -1
- package/utils/tests/checkStore.test.js +1 -1
- package/utils/tests/customAuth.test.js +1 -1
- package/utils/transformerUtils.js +195 -1
- package/v2Components/CapTagList/index.js +14 -9
- package/v2Components/Carousel/style.scss +1 -1
- package/v2Components/EmailMobilePreview/index.js +2 -2
- package/v2Components/FormBuilder/index.js +2 -2
- package/v2Components/TemplatePreview/index.js +1 -2
- package/v2Containers/Cap/tests/saga.test.js +1 -1
- package/v2Containers/Email/index.js +1 -1
- package/v2Containers/FTP/index.js +1 -1
- package/v2Containers/Line/Container/Text/index.js +6 -6
- package/v2Containers/Sms/Create/index.js +2 -2
- package/v2Containers/Sms/Edit/index.js +1 -1
- package/v2Containers/TagList/index.js +1 -1
- package/v2Containers/TagList/utils.js +1 -1
- package/v2Containers/Templates/index.js +1 -1
- package/v2Containers/Templates/sagas.js +1 -1
- package/constants/unified.js +0 -189
|
@@ -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
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { call, put, takeLatest, all } from 'redux-saga/effects';
|
|
2
|
+
import * as Api from '../../../../services/api';
|
|
3
|
+
import * as types from './constants';
|
|
4
|
+
// import testschema from './testschema';
|
|
5
|
+
// Individual exports for testing
|
|
6
|
+
export function* defaultSaga() {
|
|
7
|
+
// See example in containers/HomePage/sagas.js
|
|
8
|
+
}
|
|
9
|
+
export function* uploadAsset({file, assetType, fileParams, mode, wechatParams, contentId, uploadId}) {
|
|
10
|
+
try {
|
|
11
|
+
const params = {
|
|
12
|
+
file, assetType, fileParams, mode, wechatParams,
|
|
13
|
+
};
|
|
14
|
+
const result = yield call(Api.uploadFile, params);
|
|
15
|
+
yield put({ type: types.UPLOAD_ASSET_SUCCESS, data: result.response.asset, statusCode: result.status ? result.status.code : '', contentId, uploadId});
|
|
16
|
+
} catch (error) {
|
|
17
|
+
yield put({ type: types.UPLOAD_ASSET_FAILURE, error });
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
export function* saveTemplate(template) {
|
|
21
|
+
try {
|
|
22
|
+
let errorMsg;
|
|
23
|
+
const result = yield call(Api.createWeChatTemplate, template);
|
|
24
|
+
if (!result.success || result.status.code === 500) {
|
|
25
|
+
errorMsg = result.message;
|
|
26
|
+
}
|
|
27
|
+
yield put({ type: types.SAVE_TEMPLATE_SUCCESS, data: result.response, statusCode: result.status ? result.status.code : '', errorMsg});
|
|
28
|
+
} catch (error) {
|
|
29
|
+
yield put({ type: types.SAVE_TEMPLATE_FAILURE, error });
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
function* watchUploadAsset() {
|
|
33
|
+
yield takeLatest(types.UPLOAD_ASSET_REQUEST, uploadAsset);
|
|
34
|
+
}
|
|
35
|
+
function* watchSaveTemplate() {
|
|
36
|
+
yield takeLatest(types.SAVE_TEMPLATE_REQUEST, saveTemplate);
|
|
37
|
+
}
|
|
38
|
+
// All sagas to be loaded
|
|
39
|
+
export default [
|
|
40
|
+
defaultSaga,
|
|
41
|
+
watchUploadAsset,
|
|
42
|
+
watchSaveTemplate,
|
|
43
|
+
];
|
|
44
|
+
|
|
45
|
+
export function* richMediaTemplatesSaga() {
|
|
46
|
+
yield all([
|
|
47
|
+
defaultSaga(),
|
|
48
|
+
watchUploadAsset(),
|
|
49
|
+
watchSaveTemplate(),
|
|
50
|
+
]);
|
|
51
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { createSelector } from 'reselect';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Direct selector to the create state domain
|
|
5
|
+
*/
|
|
6
|
+
const selectCreateDomain = () => (state) => state.get('create');
|
|
7
|
+
const selectTemplatesDomain = (state) => state.get('templates');
|
|
8
|
+
/**
|
|
9
|
+
* Other specific selectors
|
|
10
|
+
*/
|
|
11
|
+
const makeSelectTemplates = () => createSelector(
|
|
12
|
+
selectTemplatesDomain,
|
|
13
|
+
(globalState) => globalState.toJS()
|
|
14
|
+
);
|
|
15
|
+
const getAssetDetails = () => createSelector(
|
|
16
|
+
makeSelectCreate(),
|
|
17
|
+
(substate) => substate.uploadedAssetData || null,
|
|
18
|
+
);
|
|
19
|
+
const getContentAssetDetails = () => createSelector(
|
|
20
|
+
makeSelectCreate(),
|
|
21
|
+
(substate) => substate.uploadedContentAssetData || null,
|
|
22
|
+
);
|
|
23
|
+
/**
|
|
24
|
+
* Default selector used by Create
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
const makeSelectCreate = () => createSelector(
|
|
28
|
+
selectCreateDomain(),
|
|
29
|
+
(substate) => substate.toJS()
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
export default makeSelectCreate;
|
|
33
|
+
export {
|
|
34
|
+
makeSelectTemplates,
|
|
35
|
+
getAssetDetails,
|
|
36
|
+
getContentAssetDetails,
|
|
37
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { expectSaga } from "redux-saga-test-plan";
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
richMediaTemplatesSaga,
|
|
5
|
+
} from "../sagas";
|
|
6
|
+
|
|
7
|
+
describe("RichMedia Template Sagas", () => {
|
|
8
|
+
describe("richMediaTemplatesSaga Combined", () => {
|
|
9
|
+
it.concurrent("should initialize all RichMedia-related watcher sagas without error", () => {
|
|
10
|
+
return expectSaga(richMediaTemplatesSaga).run();
|
|
11
|
+
});
|
|
12
|
+
});
|
|
13
|
+
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/*
|
|
2
|
+
*
|
|
3
|
+
* Edit actions
|
|
4
|
+
*
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import * as types from './constants';
|
|
8
|
+
|
|
9
|
+
export function defaultAction() {
|
|
10
|
+
return {
|
|
11
|
+
type: types.DEFAULT_ACTION,
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function getTemplateDetails(id, channel) {
|
|
16
|
+
|
|
17
|
+
return {
|
|
18
|
+
type: types.GET_TEMPLATE_DETAILS_REQUEST, id, channel,
|
|
19
|
+
};
|
|
20
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/*
|
|
2
|
+
*
|
|
3
|
+
* Edit constants
|
|
4
|
+
*
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
export const DEFAULT_ACTION = 'app/Edit/DEFAULT_ACTION';
|
|
8
|
+
export const GET_TEMPLATE_DETAILS_REQUEST = 'app/containers/WeChat/RichmediaTemplates/Edit/GET_TEMPLATE_DETAILS_REQUEST';
|
|
9
|
+
export const GET_TEMPLATE_DETAILS_SUCCESS = 'app/containers/WeChat/RichmediaTemplates/Edit/GET_TEMPLATE_DETAILS_SUCCESS';
|
|
10
|
+
export const GET_TEMPLATE_DETAILS_FAILURE = 'app/containers/WeChat/RichmediaTemplates/Edit/GET_TEMPLATE_DETAILS_FAILURE';
|