@capillarytech/creatives-library 2.0.44 → 2.0.46
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/CmsTemplatesComponent/index.js +1 -0
- package/components/EmailMobilePreview/index.js +108 -0
- package/components/EmailMobilePreview/index.scss +66 -0
- package/components/FormBuilder/_formBuilder.scss +2 -14
- package/components/FormBuilder/index.js +106 -93
- package/components/Header/index.js +41 -0
- package/components/Header/messages.js +13 -0
- package/components/Header/tests/index.test.js +10 -0
- package/components/PreviewSideBar/index.js +7 -3
- package/components/TemplatePreview/index.js +6 -7
- package/config/app.js +2 -2
- package/containers/Cap/index.js +1 -1
- package/containers/Cap/selectors.js +11 -1
- package/containers/CreativesContainer/SlideBoxContent.js +5 -1
- package/containers/CreativesContainer/SlideBoxFooter.js +5 -9
- package/containers/CreativesContainer/index.js +59 -16
- package/containers/Email/actions.js +2 -3
- package/containers/Email/index.js +32 -26
- package/containers/Email/sagas.js +1 -0
- package/containers/EmailWrapper/index.js +43 -13
- package/containers/EmailWrapper/messages.js +8 -0
- package/containers/MobilePush/Create/index.js +1 -1
- package/containers/Sms/Create/actions.js +4 -4
- package/containers/Sms/Create/index.js +28 -17
- package/containers/Sms/Create/sagas.js +1 -2
- package/containers/Sms/Edit/actions.js +4 -5
- package/containers/Sms/Edit/index.js +31 -5
- package/containers/Sms/Edit/sagas.js +1 -3
- package/containers/Templates/actions.js +3 -1
- package/containers/Templates/index.js +219 -84
- package/containers/Templates/messages.js +8 -0
- package/containers/Templates/sagas.js +16 -4
- package/containers/Templates/selectors.js +2 -0
- package/containers/TemplatesV2/index.js +9 -4
- package/containers/TemplatesV2/reducer.js +34 -0
- package/containers/TemplatesV2/sagas.js +32 -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 +1401 -0
- package/containers/WeChat/MapTemplates/messages.js +73 -0
- package/containers/WeChat/MapTemplates/reducer.js +74 -0
- package/containers/WeChat/MapTemplates/sagas.js +86 -0
- package/containers/WeChat/MapTemplates/selectors.js +25 -0
- package/containers/WeChat/MapTemplates/tests/actions.test.js +18 -0
- package/containers/WeChat/MapTemplates/tests/index.test.js +10 -0
- package/containers/WeChat/MapTemplates/tests/reducer.test.js +9 -0
- package/containers/WeChat/MapTemplates/tests/sagas.test.js +15 -0
- package/containers/WeChat/MapTemplates/tests/selectors.test.js +10 -0
- package/containers/WeChat/RichmediaTemplates/Create/_createRichmedia.scss +13 -0
- package/containers/WeChat/RichmediaTemplates/Create/actions.js +35 -0
- package/containers/WeChat/RichmediaTemplates/Create/constants.js +14 -0
- package/containers/WeChat/RichmediaTemplates/Create/index.js +679 -0
- package/containers/WeChat/RichmediaTemplates/Create/messages.js +13 -0
- package/containers/WeChat/RichmediaTemplates/Create/reducer.js +49 -0
- package/containers/WeChat/RichmediaTemplates/Create/sagas.js +44 -0
- package/containers/WeChat/RichmediaTemplates/Create/selectors.js +32 -0
- package/containers/WeChat/RichmediaTemplates/Create/tests/actions.test.js +18 -0
- package/containers/WeChat/RichmediaTemplates/Create/tests/index.test.js +10 -0
- package/containers/WeChat/RichmediaTemplates/Create/tests/reducer.test.js +9 -0
- package/containers/WeChat/RichmediaTemplates/Create/tests/sagas.test.js +15 -0
- package/containers/WeChat/RichmediaTemplates/Create/tests/selectors.test.js +10 -0
- package/containers/WeChat/RichmediaTemplates/Create/testschema.js +379 -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 +98 -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 +32 -0
- package/containers/WeChat/RichmediaTemplates/Edit/selectors.js +25 -0
- package/containers/WeChat/RichmediaTemplates/Edit/tests/actions.test.js +18 -0
- package/containers/WeChat/RichmediaTemplates/Edit/tests/index.test.js +10 -0
- package/containers/WeChat/RichmediaTemplates/Edit/tests/reducer.test.js +9 -0
- package/containers/WeChat/RichmediaTemplates/Edit/tests/sagas.test.js +15 -0
- package/containers/WeChat/RichmediaTemplates/Edit/tests/selectors.test.js +10 -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 +45 -0
- package/containers/WeChat/RichmediaTemplates/View/messages.js +13 -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/containers/WeChat/RichmediaTemplates/View/tests/actions.test.js +18 -0
- package/containers/WeChat/RichmediaTemplates/View/tests/index.test.js +10 -0
- package/containers/WeChat/RichmediaTemplates/View/tests/reducer.test.js +9 -0
- package/containers/WeChat/RichmediaTemplates/View/tests/sagas.test.js +15 -0
- package/containers/WeChat/RichmediaTemplates/View/tests/selectors.test.js +10 -0
- package/index.js +3 -3
- package/package.json +1 -1
- package/routes.js +53 -13
- package/services/api.js +6 -1
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/*
|
|
2
|
+
*
|
|
3
|
+
* Create reducer
|
|
4
|
+
*
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { fromJS } from 'immutable';
|
|
8
|
+
import * as types from './constants';
|
|
9
|
+
|
|
10
|
+
const initialState = fromJS({});
|
|
11
|
+
|
|
12
|
+
function createReducer(state = initialState, action) {
|
|
13
|
+
switch (action.type) {
|
|
14
|
+
case types.DEFAULT_ACTION:
|
|
15
|
+
return state;
|
|
16
|
+
case types.UPLOAD_ASSET_REQUEST:
|
|
17
|
+
return state
|
|
18
|
+
.set('uploadAssetSuccess', false)
|
|
19
|
+
.set('assetUploading', true);
|
|
20
|
+
case types.UPLOAD_ASSET_SUCCESS:
|
|
21
|
+
return state
|
|
22
|
+
.set('uploadAssetSuccess', (action.statusCode !== undefined && action.statusCode !== '' && action.statusCode < 300))
|
|
23
|
+
.set('assetUploading', false)
|
|
24
|
+
.setIn(['uploadedAssetData', action.contentId], action.data);
|
|
25
|
+
case types.UPLOAD_ASSET_FAILURE:
|
|
26
|
+
return state
|
|
27
|
+
.set('uploadAssetSuccess', false)
|
|
28
|
+
.set('assetUploading', false);
|
|
29
|
+
case types.CLEAR_ASSET:
|
|
30
|
+
return state
|
|
31
|
+
.delete('uploadedAssetData');
|
|
32
|
+
case types.SAVE_TEMPLATE_REQUEST:
|
|
33
|
+
return state
|
|
34
|
+
.set('savingTemplate', true);
|
|
35
|
+
case types.SAVE_TEMPLATE_SUCCESS:
|
|
36
|
+
return state
|
|
37
|
+
.set('saveTemplateSuccess', (action.statusCode !== undefined && action.statusCode !== '' && action.statusCode < 300))
|
|
38
|
+
.set('savingTemplate', false)
|
|
39
|
+
.set('saveTemplateRes', action.data);
|
|
40
|
+
case types.SAVE_TEMPLATE_FAILURE:
|
|
41
|
+
return state
|
|
42
|
+
.set('saveTemplateSuccess', false)
|
|
43
|
+
.set('savingTemplate', false);
|
|
44
|
+
default:
|
|
45
|
+
return state;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export default createReducer;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { take, cancel, call, put, takeLatest } from 'redux-saga/effects';
|
|
2
|
+
import { LOCATION_CHANGE } from 'react-router-redux';
|
|
3
|
+
import * as Api from '../../../../services/api';
|
|
4
|
+
import * as types from './constants';
|
|
5
|
+
// import testschema from './testschema';
|
|
6
|
+
// Individual exports for testing
|
|
7
|
+
export function* defaultSaga() {
|
|
8
|
+
// See example in containers/HomePage/sagas.js
|
|
9
|
+
}
|
|
10
|
+
export function* uploadAsset({file, assetType, fileParams, mode, wechatParams, contentId}) {
|
|
11
|
+
try {
|
|
12
|
+
const params = {
|
|
13
|
+
file, assetType, fileParams, mode, wechatParams,
|
|
14
|
+
};
|
|
15
|
+
const result = yield call(Api.uploadFile, params);
|
|
16
|
+
yield put({ type: types.UPLOAD_ASSET_SUCCESS, data: result.response.asset, statusCode: result.status ? result.status.code : '', contentId});
|
|
17
|
+
} catch (error) {
|
|
18
|
+
yield put({ type: types.UPLOAD_ASSET_FAILURE, error });
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
export function* saveTemplate(template) {
|
|
22
|
+
try {
|
|
23
|
+
const result = yield call(Api.createWeChatTemplate, template);
|
|
24
|
+
yield put({ type: types.SAVE_TEMPLATE_SUCCESS, data: result.response, statusCode: result.status ? result.status.code : ''});
|
|
25
|
+
} catch (error) {
|
|
26
|
+
yield put({ type: types.SAVE_TEMPLATE_FAILURE, error });
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
function* watchUploadAsset() {
|
|
30
|
+
const watcher = yield takeLatest(types.UPLOAD_ASSET_REQUEST, uploadAsset);
|
|
31
|
+
yield take(LOCATION_CHANGE);
|
|
32
|
+
yield cancel(watcher);
|
|
33
|
+
}
|
|
34
|
+
function* watchSaveTemplate() {
|
|
35
|
+
const watcher = yield takeLatest(types.SAVE_TEMPLATE_REQUEST, saveTemplate);
|
|
36
|
+
yield take(LOCATION_CHANGE);
|
|
37
|
+
yield cancel(watcher);
|
|
38
|
+
}
|
|
39
|
+
// All sagas to be loaded
|
|
40
|
+
export default [
|
|
41
|
+
defaultSaga,
|
|
42
|
+
watchUploadAsset,
|
|
43
|
+
watchSaveTemplate,
|
|
44
|
+
];
|
|
@@ -0,0 +1,32 @@
|
|
|
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
|
+
/**
|
|
20
|
+
* Default selector used by Create
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
const makeSelectCreate = () => createSelector(
|
|
24
|
+
selectCreateDomain(),
|
|
25
|
+
(substate) => substate.toJS()
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
export default makeSelectCreate;
|
|
29
|
+
export {
|
|
30
|
+
makeSelectTemplates,
|
|
31
|
+
getAssetDetails,
|
|
32
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
|
|
2
|
+
import {
|
|
3
|
+
defaultAction,
|
|
4
|
+
} from '../actions';
|
|
5
|
+
import {
|
|
6
|
+
DEFAULT_ACTION,
|
|
7
|
+
} from '../constants';
|
|
8
|
+
|
|
9
|
+
describe('Create actions', () => {
|
|
10
|
+
describe('Default Action', () => {
|
|
11
|
+
it('has a type of DEFAULT_ACTION', () => {
|
|
12
|
+
const expected = {
|
|
13
|
+
type: DEFAULT_ACTION,
|
|
14
|
+
};
|
|
15
|
+
expect(defaultAction()).toEqual(expected);
|
|
16
|
+
});
|
|
17
|
+
});
|
|
18
|
+
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Test sagas
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
/* eslint-disable redux-saga/yield-effects */
|
|
6
|
+
// import { take, call, put, select } from 'redux-saga/effects';
|
|
7
|
+
// import { defaultSaga } from '../sagas';
|
|
8
|
+
|
|
9
|
+
// const generator = defaultSaga();
|
|
10
|
+
|
|
11
|
+
describe('defaultSaga Saga', () => {
|
|
12
|
+
it('Expect to have unit tests specified', () => {
|
|
13
|
+
expect(true).toEqual(false);
|
|
14
|
+
});
|
|
15
|
+
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// import { fromJS } from 'immutable';
|
|
2
|
+
// import { makeSelectCreateDomain } from '../selectors';
|
|
3
|
+
|
|
4
|
+
// const selector = makeSelectCreateDomain();
|
|
5
|
+
|
|
6
|
+
describe('makeSelectCreateDomain', () => {
|
|
7
|
+
it('Expect to have unit tests specified', () => {
|
|
8
|
+
expect(true).toEqual(false);
|
|
9
|
+
});
|
|
10
|
+
});
|
|
@@ -0,0 +1,379 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
standalone: {
|
|
3
|
+
sections: [
|
|
4
|
+
{
|
|
5
|
+
type: "multicols",
|
|
6
|
+
inputFields: [
|
|
7
|
+
{
|
|
8
|
+
rowClassName: "wechat-richmedia-row",
|
|
9
|
+
cols: [
|
|
10
|
+
{
|
|
11
|
+
id: "title-label",
|
|
12
|
+
metaType: "label",
|
|
13
|
+
value: "Title",
|
|
14
|
+
primitive: true,
|
|
15
|
+
dynamicTab: false,
|
|
16
|
+
type: "div",
|
|
17
|
+
width: 4,
|
|
18
|
+
style: {
|
|
19
|
+
backgroundColor: "white",
|
|
20
|
+
textAlign: "left",
|
|
21
|
+
color: "#333333",
|
|
22
|
+
lineHeight: "24px",
|
|
23
|
+
fontSize: "14px",
|
|
24
|
+
fontFamily: "open-sans",
|
|
25
|
+
fontStyle: "normal",
|
|
26
|
+
},
|
|
27
|
+
onlyDisplay: true,
|
|
28
|
+
colStyle: {
|
|
29
|
+
flex: 1,
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
id: "title-value",
|
|
34
|
+
label: "Title",
|
|
35
|
+
type: "input",
|
|
36
|
+
metaType: "text",
|
|
37
|
+
datatype: "string",
|
|
38
|
+
required: true,
|
|
39
|
+
width: 16,
|
|
40
|
+
placeholder: "Please input title",
|
|
41
|
+
fluid: true,
|
|
42
|
+
styling: "semantic",
|
|
43
|
+
order: 1,
|
|
44
|
+
disabled: false,
|
|
45
|
+
customComponent: false,
|
|
46
|
+
onlyDisplay: false,
|
|
47
|
+
supportedEvents: [
|
|
48
|
+
"onChange",
|
|
49
|
+
],
|
|
50
|
+
errorMessage: "This field is required!",
|
|
51
|
+
}],
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
rowClassName: "wechat-richmedia-row",
|
|
55
|
+
cols: [
|
|
56
|
+
{
|
|
57
|
+
id: "author-label",
|
|
58
|
+
metaType: "label",
|
|
59
|
+
value: "Author",
|
|
60
|
+
primitive: true,
|
|
61
|
+
dynamicTab: false,
|
|
62
|
+
type: "div",
|
|
63
|
+
width: 4,
|
|
64
|
+
style: {
|
|
65
|
+
backgroundColor: "white",
|
|
66
|
+
textAlign: "left",
|
|
67
|
+
color: "#333333",
|
|
68
|
+
lineHeight: "24px",
|
|
69
|
+
fontSize: "14px",
|
|
70
|
+
fontFamily: "open-sans",
|
|
71
|
+
fontStyle: "normal",
|
|
72
|
+
},
|
|
73
|
+
onlyDisplay: true,
|
|
74
|
+
colStyle: {
|
|
75
|
+
flex: 1,
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
id: "author-value",
|
|
80
|
+
label: "Author",
|
|
81
|
+
type: "input",
|
|
82
|
+
metaType: "text",
|
|
83
|
+
datatype: "string",
|
|
84
|
+
required: true,
|
|
85
|
+
width: 16,
|
|
86
|
+
placeholder: "Please input author",
|
|
87
|
+
fluid: true,
|
|
88
|
+
styling: "semantic",
|
|
89
|
+
order: 1,
|
|
90
|
+
disabled: false,
|
|
91
|
+
customComponent: false,
|
|
92
|
+
supportedEvents: [
|
|
93
|
+
"onChange",
|
|
94
|
+
],
|
|
95
|
+
errorMessage: "This field is required!",
|
|
96
|
+
}],
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
rowClassName: "wechat-richmedia-row",
|
|
100
|
+
cols: [
|
|
101
|
+
{
|
|
102
|
+
id: "image-label",
|
|
103
|
+
metaType: "label",
|
|
104
|
+
value: "Cover image",
|
|
105
|
+
primitive: true,
|
|
106
|
+
dynamicTab: false,
|
|
107
|
+
type: "div",
|
|
108
|
+
width: 4,
|
|
109
|
+
style: {
|
|
110
|
+
backgroundColor: "white",
|
|
111
|
+
textAlign: "left",
|
|
112
|
+
color: "#333333",
|
|
113
|
+
lineHeight: "24px",
|
|
114
|
+
fontSize: "14px",
|
|
115
|
+
fontFamily: "open-sans",
|
|
116
|
+
fontStyle: "normal",
|
|
117
|
+
},
|
|
118
|
+
offset: 0,
|
|
119
|
+
onlyDisplay: true,
|
|
120
|
+
colStyle: {
|
|
121
|
+
flex: 1,
|
|
122
|
+
},
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
id: "image-value",
|
|
126
|
+
label: "Upload Image",
|
|
127
|
+
type: "upload",
|
|
128
|
+
width: 5,
|
|
129
|
+
metaType: "text",
|
|
130
|
+
datatype: "string",
|
|
131
|
+
required: true,
|
|
132
|
+
fluid: true,
|
|
133
|
+
styling: "semantic",
|
|
134
|
+
order: 1,
|
|
135
|
+
disabled: false,
|
|
136
|
+
customComponent: true,
|
|
137
|
+
submitAction: "onUpload",
|
|
138
|
+
supportedEvents: [
|
|
139
|
+
"onUpload",
|
|
140
|
+
],
|
|
141
|
+
}],
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
rowClassName: "wechat-richmedia-row",
|
|
145
|
+
cols: [
|
|
146
|
+
{
|
|
147
|
+
id: "cover-abstract-label",
|
|
148
|
+
metaType: "label",
|
|
149
|
+
value: "Cover abstract",
|
|
150
|
+
primitive: true,
|
|
151
|
+
dynamicTab: false,
|
|
152
|
+
type: "div",
|
|
153
|
+
width: 4,
|
|
154
|
+
style: {
|
|
155
|
+
backgroundColor: "white",
|
|
156
|
+
textAlign: "left",
|
|
157
|
+
color: "#333333",
|
|
158
|
+
lineHeight: "24px",
|
|
159
|
+
fontSize: "14px",
|
|
160
|
+
fontFamily: "open-sans",
|
|
161
|
+
fontStyle: "normal",
|
|
162
|
+
},
|
|
163
|
+
onlyDisplay: true,
|
|
164
|
+
colStyle: {
|
|
165
|
+
flex: 1,
|
|
166
|
+
},
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
id: "cover-abstract-value",
|
|
170
|
+
label: "Cover abstract",
|
|
171
|
+
type: "input",
|
|
172
|
+
metaType: "text",
|
|
173
|
+
datatype: "string",
|
|
174
|
+
required: true,
|
|
175
|
+
width: 16,
|
|
176
|
+
placeholder: "Please input cover abstract",
|
|
177
|
+
fluid: true,
|
|
178
|
+
styling: "semantic",
|
|
179
|
+
order: 1,
|
|
180
|
+
disabled: false,
|
|
181
|
+
customComponent: false,
|
|
182
|
+
supportedEvents: [
|
|
183
|
+
"onChange",
|
|
184
|
+
],
|
|
185
|
+
errorMessage: "This field is required!",
|
|
186
|
+
}],
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
rowClassName: "wechat-richmedia-row",
|
|
190
|
+
cols: [
|
|
191
|
+
{
|
|
192
|
+
id: "source-link-label",
|
|
193
|
+
metaType: "label",
|
|
194
|
+
value: "Source link",
|
|
195
|
+
primitive: true,
|
|
196
|
+
dynamicTab: false,
|
|
197
|
+
type: "div",
|
|
198
|
+
width: 4,
|
|
199
|
+
style: {
|
|
200
|
+
backgroundColor: "white",
|
|
201
|
+
textAlign: "left",
|
|
202
|
+
color: "#333333",
|
|
203
|
+
lineHeight: "24px",
|
|
204
|
+
fontSize: "14px",
|
|
205
|
+
fontFamily: "open-sans",
|
|
206
|
+
fontStyle: "normal",
|
|
207
|
+
},
|
|
208
|
+
onlyDisplay: true,
|
|
209
|
+
colStyle: {
|
|
210
|
+
flex: 1,
|
|
211
|
+
},
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
id: "source-link-value",
|
|
215
|
+
label: "Cover abstract",
|
|
216
|
+
type: "input",
|
|
217
|
+
metaType: "text",
|
|
218
|
+
datatype: "string",
|
|
219
|
+
required: true,
|
|
220
|
+
width: 16,
|
|
221
|
+
placeholder: "Please input source link",
|
|
222
|
+
fluid: true,
|
|
223
|
+
styling: "semantic",
|
|
224
|
+
order: 1,
|
|
225
|
+
disabled: false,
|
|
226
|
+
customComponent: false,
|
|
227
|
+
supportedEvents: [
|
|
228
|
+
"onChange",
|
|
229
|
+
],
|
|
230
|
+
errorMessage: "This field is required!",
|
|
231
|
+
}],
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
rowClassName: "wechat-richmedia-row",
|
|
235
|
+
cols: [
|
|
236
|
+
{
|
|
237
|
+
id: "content-label",
|
|
238
|
+
metaType: "label",
|
|
239
|
+
value: "Content",
|
|
240
|
+
primitive: true,
|
|
241
|
+
dynamicTab: false,
|
|
242
|
+
type: "div",
|
|
243
|
+
width: 4,
|
|
244
|
+
style: {
|
|
245
|
+
backgroundColor: "white",
|
|
246
|
+
textAlign: "left",
|
|
247
|
+
color: "#333333",
|
|
248
|
+
lineHeight: "24px",
|
|
249
|
+
fontSize: "14px",
|
|
250
|
+
fontFamily: "open-sans",
|
|
251
|
+
fontStyle: "normal",
|
|
252
|
+
},
|
|
253
|
+
onlyDisplay: true,
|
|
254
|
+
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
id: "content-value",
|
|
258
|
+
label: "Content",
|
|
259
|
+
type: "textarea",
|
|
260
|
+
metaType: "text",
|
|
261
|
+
datatype: "string",
|
|
262
|
+
required: true,
|
|
263
|
+
errorMessage: "This field is required!",
|
|
264
|
+
placeholder: "Please input content",
|
|
265
|
+
fluid: false,
|
|
266
|
+
styling: "semantic",
|
|
267
|
+
onlyDisplay: false,
|
|
268
|
+
width: 16,
|
|
269
|
+
disabled: false,
|
|
270
|
+
autosize: true,
|
|
271
|
+
autosizeParams: {
|
|
272
|
+
maxRows: 18,
|
|
273
|
+
minRows: 3,
|
|
274
|
+
},
|
|
275
|
+
order: 2,
|
|
276
|
+
customComponent: true,
|
|
277
|
+
supportedEvents: [
|
|
278
|
+
"onChange",
|
|
279
|
+
],
|
|
280
|
+
}],
|
|
281
|
+
},
|
|
282
|
+
{
|
|
283
|
+
rowClassName: "wechat-richmedia-row",
|
|
284
|
+
cols: [
|
|
285
|
+
{
|
|
286
|
+
id: "show-cover-pic-label",
|
|
287
|
+
metaType: "label",
|
|
288
|
+
value: "Show cover picture",
|
|
289
|
+
primitive: true,
|
|
290
|
+
dynamicTab: false,
|
|
291
|
+
type: "div",
|
|
292
|
+
width: 4,
|
|
293
|
+
style: {
|
|
294
|
+
backgroundColor: "white",
|
|
295
|
+
textAlign: "left",
|
|
296
|
+
color: "#333333",
|
|
297
|
+
lineHeight: "24px",
|
|
298
|
+
fontSize: "14px",
|
|
299
|
+
fontFamily: "open-sans",
|
|
300
|
+
fontStyle: "normal",
|
|
301
|
+
},
|
|
302
|
+
offset: 0,
|
|
303
|
+
onlyDisplay: true,
|
|
304
|
+
colStyle: {
|
|
305
|
+
flex: 1,
|
|
306
|
+
},
|
|
307
|
+
},
|
|
308
|
+
{
|
|
309
|
+
id: "show-cover-pic-value",
|
|
310
|
+
supportedEvents: [
|
|
311
|
+
"onChange",
|
|
312
|
+
],
|
|
313
|
+
type: "checkbox",
|
|
314
|
+
metaType: "text",
|
|
315
|
+
datatype: "boolean",
|
|
316
|
+
required: true,
|
|
317
|
+
fluid: true,
|
|
318
|
+
styling: "semantic",
|
|
319
|
+
order: 1,
|
|
320
|
+
width: 10,
|
|
321
|
+
offset: 0,
|
|
322
|
+
value: 0,
|
|
323
|
+
onlyDisplay: false,
|
|
324
|
+
disabled: false,
|
|
325
|
+
errorMessage: "Please check if you intend to use unicode characters.",
|
|
326
|
+
customComponent: false,
|
|
327
|
+
}],
|
|
328
|
+
},
|
|
329
|
+
{
|
|
330
|
+
rowClassName: "wechat-richmedia-row",
|
|
331
|
+
cols: [
|
|
332
|
+
{
|
|
333
|
+
id: "post-comments-label",
|
|
334
|
+
metaType: "label",
|
|
335
|
+
value: "Who can post comments on this content",
|
|
336
|
+
primitive: true,
|
|
337
|
+
dynamicTab: false,
|
|
338
|
+
type: "div",
|
|
339
|
+
width: 4,
|
|
340
|
+
style: {
|
|
341
|
+
backgroundColor: "white",
|
|
342
|
+
textAlign: "left",
|
|
343
|
+
color: "#333333",
|
|
344
|
+
lineHeight: "24px",
|
|
345
|
+
fontSize: "14px",
|
|
346
|
+
fontFamily: "open-sans",
|
|
347
|
+
fontStyle: "normal",
|
|
348
|
+
},
|
|
349
|
+
offset: 0,
|
|
350
|
+
onlyDisplay: true,
|
|
351
|
+
colStyle: {
|
|
352
|
+
flex: 1,
|
|
353
|
+
},
|
|
354
|
+
},
|
|
355
|
+
{
|
|
356
|
+
id: "post-comments-value",
|
|
357
|
+
type: "radioGroup",
|
|
358
|
+
metaType: "text",
|
|
359
|
+
datatype: "string",
|
|
360
|
+
options: ["No one", "Anyone", "Only followers"],
|
|
361
|
+
value: "No one",
|
|
362
|
+
required: true,
|
|
363
|
+
width: 18,
|
|
364
|
+
errorMessage: "Please select",
|
|
365
|
+
fluid: true,
|
|
366
|
+
styling: "semantic",
|
|
367
|
+
order: 1,
|
|
368
|
+
disabled: false,
|
|
369
|
+
customComponent: false,
|
|
370
|
+
supportedEvents: ["onChange"],
|
|
371
|
+
}],
|
|
372
|
+
}],
|
|
373
|
+
actionFields: [],
|
|
374
|
+
}],
|
|
375
|
+
},
|
|
376
|
+
|
|
377
|
+
channel: "WECHAT",
|
|
378
|
+
module: "Campaigns",
|
|
379
|
+
};
|
|
@@ -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
|
+
console.log('getting template', id);
|
|
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';
|