@capillarytech/creatives-library 6.8.1 → 6.8.2
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/package.json +1 -1
- package/v2Components/TemplatePreview/WechatRichmediaTemplatePreview/_wechatRichmediaTemplatePrev.scss +151 -151
- package/v2Components/TemplatePreview/WechatRichmediaTemplatePreview/messages.js +33 -33
- package/v2Components/TemplatePreview/WechatRichmediaTemplatePreview/tests/index.test.js +10 -10
- package/v2Components/TemplatePreview/_templatePreview.scss +380 -380
- package/v2Components/TemplatePreview/assets/images/androidPushMessage.svg +44 -44
- package/v2Components/TemplatePreview/assets/images/home-screen-android.svg +21 -21
- package/v2Components/TemplatePreview/assets/images/home-screen-ios.svg +16 -16
- package/v2Components/TemplatePreview/assets/images/iPhonePushMessage.svg +134 -134
- package/v2Components/TemplatePreview/assets/images/mobile.svg +23 -23
- package/v2Components/TemplatePreview/assets/images/sms_mobile_android.svg +22 -22
- package/v2Components/TemplatePreview/assets/images/user-icon.svg +18 -18
- package/v2Components/TemplatePreview/assets/images/wechat-home-screen-android.svg +21 -21
- package/v2Components/TemplatePreview/assets/images/wechat-mobile.svg +77 -77
- package/v2Components/TemplatePreview/assets/images/wechat_mobile_android.svg +20 -20
- package/v2Components/TemplatePreview/index.js +1 -1
- package/v2Components/TemplatePreview/tests/index.test.js +10 -10
- package/v2Containers/Assets/Gallery/index.js +0 -3
- package/v2Containers/Assets/Gallery/selectors.js +5 -12
- package/v2Containers/CreativesContainer/SlideBoxFooter.js +51 -51
- package/v2Containers/CreativesContainer/actions.js +27 -27
- package/v2Containers/CreativesContainer/constants.js +17 -17
- package/v2Containers/CreativesContainer/index.scss +44 -44
- package/v2Containers/CreativesContainer/messages.js +305 -305
- package/v2Containers/CreativesContainer/reducer.js +29 -29
- package/v2Containers/CreativesContainer/sagas.js +11 -11
- package/v2Containers/CreativesContainer/selectors.js +30 -30
- package/v2Containers/CreativesContainer/tests/actions.test.js +18 -18
- package/v2Containers/CreativesContainer/tests/index.test.js +10 -10
- package/v2Containers/CreativesContainer/tests/reducer.test.js +9 -9
- package/v2Containers/CreativesContainer/tests/sagas.test.js +15 -15
- package/v2Containers/CreativesContainer/tests/selectors.test.js +10 -10
- package/v2Containers/Line/Container/Drawer/index.js +31 -3
- package/v2Containers/Line/Container/Drawer/messages.js +20 -0
- package/v2Containers/Line/Container/Image/index.js +35 -6
- package/v2Containers/Line/Container/ImageMap/constants.js +1 -1
- package/v2Containers/Line/Container/ImageMap/index.js +9 -8
- package/v2Containers/Line/Container/Text/index.js +1 -0
- package/v2Containers/Line/Container/Wrapper/index.js +1 -0
- package/v2Containers/Line/Container/index.js +33 -1
- package/v2Containers/Templates/_templates.scss +405 -405
- package/v2Containers/Templates/actions.js +117 -117
- package/v2Containers/Templates/constants.js +47 -47
- package/v2Containers/Templates/reducer.js +145 -145
- package/v2Containers/Templates/sagas.js +179 -179
- package/v2Containers/Templates/tests/actions.test.js +18 -18
- package/v2Containers/Templates/tests/index.test.js +10 -10
- package/v2Containers/Templates/tests/reducer.test.js +9 -9
- package/v2Containers/Templates/tests/sagas.test.js +15 -15
- package/v2Containers/Templates/tests/selectors.test.js +10 -10
- package/v2Containers/TemplatesV2/TemplatesV2.style.js +29 -29
- package/v2Containers/TemplatesV2/actions.js +16 -16
- package/v2Containers/TemplatesV2/constants.js +10 -10
- package/v2Containers/TemplatesV2/messages.js +61 -61
- package/v2Containers/TemplatesV2/selectors.js +25 -25
- package/v2Containers/TemplatesV2/tests/actions.test.js +18 -18
- package/v2Containers/TemplatesV2/tests/index.test.js +10 -10
- package/v2Containers/TemplatesV2/tests/reducer.test.js +9 -9
- package/v2Containers/TemplatesV2/tests/sagas.test.js +15 -15
- package/v2Containers/TemplatesV2/tests/selectors.test.js +10 -10
|
@@ -1,117 +1,117 @@
|
|
|
1
|
-
/*
|
|
2
|
-
*
|
|
3
|
-
* Templates actions
|
|
4
|
-
*
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import * as types from './constants';
|
|
8
|
-
|
|
9
|
-
export function getAllTemplates(channel, queryParams) {
|
|
10
|
-
console.log('get all templates action trigereed', channel, queryParams);
|
|
11
|
-
return {
|
|
12
|
-
type: types.GET_ALL_TEMPLATES_REQUEST, channel, queryParams,
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export function resetTemplate() {
|
|
17
|
-
return {
|
|
18
|
-
type: types.RESET_TEMPLATE,
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export function resetAccount() {
|
|
23
|
-
return {
|
|
24
|
-
type: types.RESET_ACCOUNT,
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export function deleteTemplate(channel, id) {
|
|
29
|
-
console.log('delete template action trigereed', channel, id);
|
|
30
|
-
return {
|
|
31
|
-
type: types.DELETE_TEMPLATE_REQUEST, channel, id,
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export function getUserList() {
|
|
36
|
-
return {
|
|
37
|
-
type: types.GET_USER_LIST_REQUEST,
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export function getWeCrmAccounts(source) {
|
|
42
|
-
return {
|
|
43
|
-
type: types.GET_WECRM_ACCOUNTS_REQUEST, source,
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
export function setWeChatAccount(weChatAccount) {
|
|
48
|
-
console.log('setting wechat account', weChatAccount);
|
|
49
|
-
return {
|
|
50
|
-
type: types.SET_WECHAT_ACCOUNT,
|
|
51
|
-
weChatAccount,
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
export function setLineAccount(lineAccount) {
|
|
56
|
-
return {
|
|
57
|
-
type: types.SET_LINE_ACCOUNT,
|
|
58
|
-
lineAccount,
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
export function handleHtmlUpload(selectedTemplate) {
|
|
63
|
-
return {
|
|
64
|
-
type: types.SET_SELECTED_LAYOUT,
|
|
65
|
-
selectedTemplate,
|
|
66
|
-
};
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
export function handleZipUpload(selectedFile, successHandler, errorHandler) {
|
|
70
|
-
return {
|
|
71
|
-
type: types.SEND_ZIPPED_FILE_REQUEST,
|
|
72
|
-
selectedFile,
|
|
73
|
-
successHandler,
|
|
74
|
-
errorHandler,
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
export function getEdmDefaultTemplates() {
|
|
79
|
-
return {
|
|
80
|
-
type: types.GET_EDM_DEAFULT_TEMPLATES_REQUEST,
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
export function setEdmTemplate(template) {
|
|
85
|
-
return {
|
|
86
|
-
type: types.SET_EDM_TEMPLATE,
|
|
87
|
-
template,
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
export function getTemplateDetails(id, channel) {
|
|
92
|
-
console.log('getting template', id, channel);
|
|
93
|
-
return {
|
|
94
|
-
type: types.GET_TEMPLATE_DETAILS_REQUEST,
|
|
95
|
-
id,
|
|
96
|
-
channel,
|
|
97
|
-
};
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
export function resetTemplateData() {
|
|
101
|
-
return {
|
|
102
|
-
type: types.RESET_TEMPLATE_DATA,
|
|
103
|
-
};
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
export function resetUploadData() {
|
|
107
|
-
console.log('clearing upload data');
|
|
108
|
-
return {
|
|
109
|
-
type: types.RESET_UPLOAD_DATA,
|
|
110
|
-
};
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
export function resetTemplateStoreData() {
|
|
114
|
-
return {
|
|
115
|
-
type: types.CLEAR_TEMPLATE_STORE_DATA,
|
|
116
|
-
};
|
|
117
|
-
}
|
|
1
|
+
/*
|
|
2
|
+
*
|
|
3
|
+
* Templates actions
|
|
4
|
+
*
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import * as types from './constants';
|
|
8
|
+
|
|
9
|
+
export function getAllTemplates(channel, queryParams) {
|
|
10
|
+
console.log('get all templates action trigereed', channel, queryParams);
|
|
11
|
+
return {
|
|
12
|
+
type: types.GET_ALL_TEMPLATES_REQUEST, channel, queryParams,
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function resetTemplate() {
|
|
17
|
+
return {
|
|
18
|
+
type: types.RESET_TEMPLATE,
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export function resetAccount() {
|
|
23
|
+
return {
|
|
24
|
+
type: types.RESET_ACCOUNT,
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export function deleteTemplate(channel, id) {
|
|
29
|
+
console.log('delete template action trigereed', channel, id);
|
|
30
|
+
return {
|
|
31
|
+
type: types.DELETE_TEMPLATE_REQUEST, channel, id,
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export function getUserList() {
|
|
36
|
+
return {
|
|
37
|
+
type: types.GET_USER_LIST_REQUEST,
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export function getWeCrmAccounts(source) {
|
|
42
|
+
return {
|
|
43
|
+
type: types.GET_WECRM_ACCOUNTS_REQUEST, source,
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export function setWeChatAccount(weChatAccount) {
|
|
48
|
+
console.log('setting wechat account', weChatAccount);
|
|
49
|
+
return {
|
|
50
|
+
type: types.SET_WECHAT_ACCOUNT,
|
|
51
|
+
weChatAccount,
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export function setLineAccount(lineAccount) {
|
|
56
|
+
return {
|
|
57
|
+
type: types.SET_LINE_ACCOUNT,
|
|
58
|
+
lineAccount,
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export function handleHtmlUpload(selectedTemplate) {
|
|
63
|
+
return {
|
|
64
|
+
type: types.SET_SELECTED_LAYOUT,
|
|
65
|
+
selectedTemplate,
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export function handleZipUpload(selectedFile, successHandler, errorHandler) {
|
|
70
|
+
return {
|
|
71
|
+
type: types.SEND_ZIPPED_FILE_REQUEST,
|
|
72
|
+
selectedFile,
|
|
73
|
+
successHandler,
|
|
74
|
+
errorHandler,
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export function getEdmDefaultTemplates() {
|
|
79
|
+
return {
|
|
80
|
+
type: types.GET_EDM_DEAFULT_TEMPLATES_REQUEST,
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export function setEdmTemplate(template) {
|
|
85
|
+
return {
|
|
86
|
+
type: types.SET_EDM_TEMPLATE,
|
|
87
|
+
template,
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export function getTemplateDetails(id, channel) {
|
|
92
|
+
console.log('getting template', id, channel);
|
|
93
|
+
return {
|
|
94
|
+
type: types.GET_TEMPLATE_DETAILS_REQUEST,
|
|
95
|
+
id,
|
|
96
|
+
channel,
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export function resetTemplateData() {
|
|
101
|
+
return {
|
|
102
|
+
type: types.RESET_TEMPLATE_DATA,
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export function resetUploadData() {
|
|
107
|
+
console.log('clearing upload data');
|
|
108
|
+
return {
|
|
109
|
+
type: types.RESET_UPLOAD_DATA,
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export function resetTemplateStoreData() {
|
|
114
|
+
return {
|
|
115
|
+
type: types.CLEAR_TEMPLATE_STORE_DATA,
|
|
116
|
+
};
|
|
117
|
+
}
|
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
/*
|
|
2
|
-
*
|
|
3
|
-
* Templates constants
|
|
4
|
-
*
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
export const DEFAULT_ACTION = 'app/Templates/DEFAULT_ACTION';
|
|
8
|
-
|
|
9
|
-
export const GET_ALL_TEMPLATES_REQUEST = 'app/v2Containers/Templates/GET_ALL_TEMPLATES_REQUEST';
|
|
10
|
-
export const GET_ALL_TEMPLATES_SUCCESS = 'app/v2Containers/Templates/GET_ALL_TEMPLATES_SUCCESS';
|
|
11
|
-
export const GET_ALL_TEMPLATES_FAILURE = 'app/v2Containers/Templates/GET_ALL_TEMPLATES_FAILURE';
|
|
12
|
-
|
|
13
|
-
export const DELETE_TEMPLATE_REQUEST = 'app/v2Containers/Templates/DELETE_TEMPLATE_REQUEST';
|
|
14
|
-
export const DELETE_TEMPLATE_SUCCESS = 'app/v2Containers/Templates/DELETE_TEMPLATE_SUCCESS';
|
|
15
|
-
export const DELETE_TEMPLATE_FAILURE = 'app/v2Containers/Templates/DELETE_TEMPLATE_FAILURE';
|
|
16
|
-
|
|
17
|
-
export const GET_USER_LIST_REQUEST = "app/v2Containers/GET_USER_LIST_REQUEST";
|
|
18
|
-
export const GET_USER_LIST_SUCCESS = "app/v2Containers/GET_USER_LIST_SUCCESS";
|
|
19
|
-
export const GET_USER_LIST_FAILURE = "app/v2Containers/GET_USER_LIST_FAILURE";
|
|
20
|
-
|
|
21
|
-
export const GET_WECRM_ACCOUNTS_REQUEST = "app/v2Containers/Templates/GET_WECRM_ACCOUNTS_REQUEST";
|
|
22
|
-
export const GET_WECRM_ACCOUNTS_SUCCESS = "app/v2Containers/Templates/GET_WECRM_ACCOUNTS_SUCCESS";
|
|
23
|
-
export const GET_WECRM_ACCOUNTS_FAILURE = "app/v2Containers/Templates/GET_WECRM_ACCOUNTS_FAILURE";
|
|
24
|
-
export const SET_WECHAT_ACCOUNT = "app/v2Containers/Templates/SET_WECHAT_ACCOUNT";
|
|
25
|
-
|
|
26
|
-
export const SET_SELECTED_LAYOUT = "app/v2Containers/Templates/SET_SELECTED_LAYOUT";
|
|
27
|
-
export const SEND_ZIPPED_FILE_REQUEST = "app/v2Containers/Templates/SEND_ZIPPED_FILE_REQUEST";
|
|
28
|
-
export const SEND_ZIPPED_FILE_SUCCESS = "app/v2Containers/Templates/SEND_ZIPPED_FILE_SUCCESS";
|
|
29
|
-
export const SEND_ZIPPED_FILE_FAILURE = "app/v2Containers/Templates/SEND_ZIPPED_FILE_FAILURE";
|
|
30
|
-
|
|
31
|
-
export const GET_EDM_DEAFULT_TEMPLATES_REQUEST = 'app/v2Containers/Templates/GET_EDM_DEAFULT_TEMPLATES_REQUEST';
|
|
32
|
-
export const GET_EDM_DEAFULT_TEMPLATES_SUCCESS = 'app/v2Containers/Templates/GET_EDM_DEAFULT_TEMPLATES_SUCCESS';
|
|
33
|
-
export const GET_EDM_DEAFULT_TEMPLATES_FAILURE = 'app/v2Containers/Templates/GET_EDM_DEAFULT_TEMPLATES_FAILURE';
|
|
34
|
-
|
|
35
|
-
export const GET_TEMPLATE_DETAILS_REQUEST = 'app/v2Containers/Templates/GET_TEMPLATE_DETAILS_REQUEST';
|
|
36
|
-
export const GET_TEMPLATE_DETAILS_SUCCESS = 'app/v2Containers/Templates/GET_TEMPLATE_DETAILS_SUCCESS';
|
|
37
|
-
export const GET_TEMPLATE_DETAILS_FAILURE = 'app/v2Containers/Templates/GET_TEMPLATE_DETAILS_FAILURE';
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
export const SET_EDM_TEMPLATE = "app/v2Containers/Templates/SET_EDM_TEMPLATE";
|
|
41
|
-
export const RESET_ACCOUNT = "app/v2Containers/Templates/RESET_ACCOUNT";
|
|
42
|
-
export const RESET_TEMPLATE = "app/v2Containers/Templates/RESET_TEMPLATE";
|
|
43
|
-
export const RESET_TEMPLATE_DATA = "app/v2Containers/Templates/RESET_TEMPLATE_DATA";
|
|
44
|
-
export const RESET_UPLOAD_DATA = "app/v2Containers/Templates/RESET_UPLOAD_DATA";
|
|
45
|
-
export const CLEAR_TEMPLATE_STORE_DATA = "app/v2Containers/Templates/CLEAR_TEMPLATE_STORE_DATA";
|
|
46
|
-
|
|
47
|
-
export const SET_LINE_ACCOUNT = "app/v2Containers/Templates/SET_LINE_ACCOUNT";
|
|
1
|
+
/*
|
|
2
|
+
*
|
|
3
|
+
* Templates constants
|
|
4
|
+
*
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
export const DEFAULT_ACTION = 'app/Templates/DEFAULT_ACTION';
|
|
8
|
+
|
|
9
|
+
export const GET_ALL_TEMPLATES_REQUEST = 'app/v2Containers/Templates/GET_ALL_TEMPLATES_REQUEST';
|
|
10
|
+
export const GET_ALL_TEMPLATES_SUCCESS = 'app/v2Containers/Templates/GET_ALL_TEMPLATES_SUCCESS';
|
|
11
|
+
export const GET_ALL_TEMPLATES_FAILURE = 'app/v2Containers/Templates/GET_ALL_TEMPLATES_FAILURE';
|
|
12
|
+
|
|
13
|
+
export const DELETE_TEMPLATE_REQUEST = 'app/v2Containers/Templates/DELETE_TEMPLATE_REQUEST';
|
|
14
|
+
export const DELETE_TEMPLATE_SUCCESS = 'app/v2Containers/Templates/DELETE_TEMPLATE_SUCCESS';
|
|
15
|
+
export const DELETE_TEMPLATE_FAILURE = 'app/v2Containers/Templates/DELETE_TEMPLATE_FAILURE';
|
|
16
|
+
|
|
17
|
+
export const GET_USER_LIST_REQUEST = "app/v2Containers/GET_USER_LIST_REQUEST";
|
|
18
|
+
export const GET_USER_LIST_SUCCESS = "app/v2Containers/GET_USER_LIST_SUCCESS";
|
|
19
|
+
export const GET_USER_LIST_FAILURE = "app/v2Containers/GET_USER_LIST_FAILURE";
|
|
20
|
+
|
|
21
|
+
export const GET_WECRM_ACCOUNTS_REQUEST = "app/v2Containers/Templates/GET_WECRM_ACCOUNTS_REQUEST";
|
|
22
|
+
export const GET_WECRM_ACCOUNTS_SUCCESS = "app/v2Containers/Templates/GET_WECRM_ACCOUNTS_SUCCESS";
|
|
23
|
+
export const GET_WECRM_ACCOUNTS_FAILURE = "app/v2Containers/Templates/GET_WECRM_ACCOUNTS_FAILURE";
|
|
24
|
+
export const SET_WECHAT_ACCOUNT = "app/v2Containers/Templates/SET_WECHAT_ACCOUNT";
|
|
25
|
+
|
|
26
|
+
export const SET_SELECTED_LAYOUT = "app/v2Containers/Templates/SET_SELECTED_LAYOUT";
|
|
27
|
+
export const SEND_ZIPPED_FILE_REQUEST = "app/v2Containers/Templates/SEND_ZIPPED_FILE_REQUEST";
|
|
28
|
+
export const SEND_ZIPPED_FILE_SUCCESS = "app/v2Containers/Templates/SEND_ZIPPED_FILE_SUCCESS";
|
|
29
|
+
export const SEND_ZIPPED_FILE_FAILURE = "app/v2Containers/Templates/SEND_ZIPPED_FILE_FAILURE";
|
|
30
|
+
|
|
31
|
+
export const GET_EDM_DEAFULT_TEMPLATES_REQUEST = 'app/v2Containers/Templates/GET_EDM_DEAFULT_TEMPLATES_REQUEST';
|
|
32
|
+
export const GET_EDM_DEAFULT_TEMPLATES_SUCCESS = 'app/v2Containers/Templates/GET_EDM_DEAFULT_TEMPLATES_SUCCESS';
|
|
33
|
+
export const GET_EDM_DEAFULT_TEMPLATES_FAILURE = 'app/v2Containers/Templates/GET_EDM_DEAFULT_TEMPLATES_FAILURE';
|
|
34
|
+
|
|
35
|
+
export const GET_TEMPLATE_DETAILS_REQUEST = 'app/v2Containers/Templates/GET_TEMPLATE_DETAILS_REQUEST';
|
|
36
|
+
export const GET_TEMPLATE_DETAILS_SUCCESS = 'app/v2Containers/Templates/GET_TEMPLATE_DETAILS_SUCCESS';
|
|
37
|
+
export const GET_TEMPLATE_DETAILS_FAILURE = 'app/v2Containers/Templates/GET_TEMPLATE_DETAILS_FAILURE';
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
export const SET_EDM_TEMPLATE = "app/v2Containers/Templates/SET_EDM_TEMPLATE";
|
|
41
|
+
export const RESET_ACCOUNT = "app/v2Containers/Templates/RESET_ACCOUNT";
|
|
42
|
+
export const RESET_TEMPLATE = "app/v2Containers/Templates/RESET_TEMPLATE";
|
|
43
|
+
export const RESET_TEMPLATE_DATA = "app/v2Containers/Templates/RESET_TEMPLATE_DATA";
|
|
44
|
+
export const RESET_UPLOAD_DATA = "app/v2Containers/Templates/RESET_UPLOAD_DATA";
|
|
45
|
+
export const CLEAR_TEMPLATE_STORE_DATA = "app/v2Containers/Templates/CLEAR_TEMPLATE_STORE_DATA";
|
|
46
|
+
|
|
47
|
+
export const SET_LINE_ACCOUNT = "app/v2Containers/Templates/SET_LINE_ACCOUNT";
|
|
@@ -1,145 +1,145 @@
|
|
|
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
|
-
getAllTemplatesInProgress: false,
|
|
12
|
-
templates: [],
|
|
13
|
-
deleteResponse: {},
|
|
14
|
-
deleteTemplateInProgress: false,
|
|
15
|
-
templateError: {},
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
function templatesReducer(state = initialState, action) {
|
|
19
|
-
switch (action.type) {
|
|
20
|
-
case types.DEFAULT_ACTION:
|
|
21
|
-
return state;
|
|
22
|
-
case types.GET_ALL_TEMPLATES_REQUEST:
|
|
23
|
-
return state.set('getAllTemplatesInProgress', true).set('templateError', {});
|
|
24
|
-
case types.GET_ALL_TEMPLATES_SUCCESS:
|
|
25
|
-
if (action.isReset) {
|
|
26
|
-
return state.set('getAllTemplatesInProgress', false)
|
|
27
|
-
.set('templates', action.data ? action.data.templates : [])
|
|
28
|
-
.set('isSearch', action.data ? action.data.search : false)
|
|
29
|
-
.set('weCRMtemplates', action.weCRMTemplate ? action.weCRMTemplate : []).set('templateError', {});
|
|
30
|
-
}
|
|
31
|
-
return state.set('getAllTemplatesInProgress', false)
|
|
32
|
-
.set('templates', action.data ? state.get('templates').concat(action.data.templates) : [])
|
|
33
|
-
.set('isSearch', action.data ? action.data.search : false)
|
|
34
|
-
.set('weCRMtemplates', action.weCRMTemplate ? state.get('weCRMtemplates').concat(action.weCRMTemplate) : []);
|
|
35
|
-
case types.GET_ALL_TEMPLATES_FAILURE:
|
|
36
|
-
return state.set('getAllTemplatesInProgress', false).set('templateError', action.error);
|
|
37
|
-
case types.DELETE_TEMPLATE_REQUEST:
|
|
38
|
-
return state.set('deleteTemplateInProgress', true);
|
|
39
|
-
case types.DELETE_TEMPLATE_SUCCESS:
|
|
40
|
-
return state.set('deleteTemplateInProgress', false)
|
|
41
|
-
.set('deleteResponse', action.data);
|
|
42
|
-
case types.DELETE_TEMPLATE_FAILURE:
|
|
43
|
-
return state.set('deleteTemplateInProgress', false);
|
|
44
|
-
case types.GET_USER_LIST_REQUEST:
|
|
45
|
-
return state
|
|
46
|
-
.set('fetchingUserList', true)
|
|
47
|
-
.set('userList', fromJS({}))
|
|
48
|
-
.set('userListFetchError', false);
|
|
49
|
-
case types.GET_USER_LIST_SUCCESS:
|
|
50
|
-
return state
|
|
51
|
-
.set('fetchingUserList', false)
|
|
52
|
-
.set('userList', fromJS(action.data))
|
|
53
|
-
.set('userListFetchError', false);
|
|
54
|
-
case types.GET_USER_LIST_FAILURE:
|
|
55
|
-
return state
|
|
56
|
-
.set('fetchingUserList', false)
|
|
57
|
-
.set('userList', fromJS({}))
|
|
58
|
-
.set('userListFetchError', true);
|
|
59
|
-
case types.GET_WECRM_ACCOUNTS_REQUEST:
|
|
60
|
-
return state
|
|
61
|
-
.set('fetchingWeCrmAccounts', true)
|
|
62
|
-
.set('weCrmAccountFetchingError', false);
|
|
63
|
-
case types.GET_WECRM_ACCOUNTS_SUCCESS:
|
|
64
|
-
return state
|
|
65
|
-
.set('fetchingWeCrmAccounts', false)
|
|
66
|
-
.set('weCrmAccounts', fromJS(action.data));
|
|
67
|
-
case types.GET_WECRM_ACCOUNTS_FAILURE:
|
|
68
|
-
return state
|
|
69
|
-
.set('fetchingWeCrmAccounts', false)
|
|
70
|
-
.set('weCrmAccountFetchingError', true);
|
|
71
|
-
case types.SET_WECHAT_ACCOUNT:
|
|
72
|
-
return state
|
|
73
|
-
.set('selectedWeChatAccount', fromJS(action.weChatAccount));
|
|
74
|
-
case types.SET_LINE_ACCOUNT:
|
|
75
|
-
return state.set('selectedLineAccount', fromJS(action.lineAccount));
|
|
76
|
-
case types.RESET_ACCOUNT:
|
|
77
|
-
return state
|
|
78
|
-
.remove('selectedWeChatAccount')
|
|
79
|
-
.remove('weCrmAccounts');
|
|
80
|
-
case types.RESET_TEMPLATE:
|
|
81
|
-
return state
|
|
82
|
-
.set('weCRMtemplates', fromJS([]))
|
|
83
|
-
.set('weChatDefaultTemplate', fromJS([]))
|
|
84
|
-
.set('templates', []);
|
|
85
|
-
case types.SET_SELECTED_LAYOUT:
|
|
86
|
-
return state
|
|
87
|
-
.set('selectedEmailLayout', fromJS(action.selectedTemplate))
|
|
88
|
-
.set('edmTemplate', fromJS({}));
|
|
89
|
-
case types.RESET_UPLOAD_DATA:
|
|
90
|
-
return state
|
|
91
|
-
.set('selectedEmailLayout', "");
|
|
92
|
-
case types.SEND_ZIPPED_FILE_REQUEST:
|
|
93
|
-
return state
|
|
94
|
-
.set('sendingFile', true)
|
|
95
|
-
.set('errorSendingFile', false)
|
|
96
|
-
.set('selectedEmailLayout', "");
|
|
97
|
-
case types.SEND_ZIPPED_FILE_SUCCESS:
|
|
98
|
-
return state
|
|
99
|
-
.set('sendingFile', false)
|
|
100
|
-
.set('selectedEmailLayout', fromJS(action.selectedTemplate))
|
|
101
|
-
.set('edmTemplate', fromJS({}));
|
|
102
|
-
case types.SEND_ZIPPED_FILE_FAILURE:
|
|
103
|
-
return state
|
|
104
|
-
.set('sendingFile', false)
|
|
105
|
-
.set('errorSendingFile', true)
|
|
106
|
-
.set('errorMessage', action.data)
|
|
107
|
-
.set('selectedEmailLayout', "");
|
|
108
|
-
case types.GET_EDM_DEAFULT_TEMPLATES_REQUEST:
|
|
109
|
-
return state.set('getCmsTemplatesInProgress', true);
|
|
110
|
-
case types.GET_EDM_DEAFULT_TEMPLATES_SUCCESS:
|
|
111
|
-
return state.set('getCmsTemplatesInProgress', false)
|
|
112
|
-
.set('cmsTemplates', action.data ? fromJS(action.data.templates) : []);
|
|
113
|
-
case types.GET_EDM_DEAFULT_TEMPLATES_FAILURE:
|
|
114
|
-
return state.set('getCmsTemplatesInProgress', false);
|
|
115
|
-
case types.SET_EDM_TEMPLATE:
|
|
116
|
-
return state
|
|
117
|
-
.set('edmTemplate', fromJS(action.template))
|
|
118
|
-
.set('selectedEmailLayout', "");
|
|
119
|
-
case types.RESET_TEMPLATE_DATA:
|
|
120
|
-
return state
|
|
121
|
-
.set('edmTemplate', fromJS({}))
|
|
122
|
-
.set('selectedEmailLayout', "")
|
|
123
|
-
.set('templateDetails', fromJS({}));
|
|
124
|
-
case types.GET_TEMPLATE_DETAILS_REQUEST:
|
|
125
|
-
return state
|
|
126
|
-
.set('getTemplateDetailsInProgress', true)
|
|
127
|
-
.set('templateDetails', fromJS({}));
|
|
128
|
-
case types.GET_TEMPLATE_DETAILS_SUCCESS:
|
|
129
|
-
return state
|
|
130
|
-
.set('getTemplateDetailsInProgress', false)
|
|
131
|
-
.set('templateDetails', fromJS(action.data));
|
|
132
|
-
case types.GET_TEMPLATE_DETAILS_FAILURE:
|
|
133
|
-
return state
|
|
134
|
-
.set('getTemplateDetailsInProgress', false)
|
|
135
|
-
.set('templateDetails', fromJS({}));
|
|
136
|
-
case types.CLEAR_TEMPLATE_STORE_DATA:
|
|
137
|
-
return state
|
|
138
|
-
.set('templates', [])
|
|
139
|
-
.set('weCRMtemplates', fromJS({}));
|
|
140
|
-
default:
|
|
141
|
-
return state;
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
export default templatesReducer;
|
|
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
|
+
getAllTemplatesInProgress: false,
|
|
12
|
+
templates: [],
|
|
13
|
+
deleteResponse: {},
|
|
14
|
+
deleteTemplateInProgress: false,
|
|
15
|
+
templateError: {},
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
function templatesReducer(state = initialState, action) {
|
|
19
|
+
switch (action.type) {
|
|
20
|
+
case types.DEFAULT_ACTION:
|
|
21
|
+
return state;
|
|
22
|
+
case types.GET_ALL_TEMPLATES_REQUEST:
|
|
23
|
+
return state.set('getAllTemplatesInProgress', true).set('templateError', {});
|
|
24
|
+
case types.GET_ALL_TEMPLATES_SUCCESS:
|
|
25
|
+
if (action.isReset) {
|
|
26
|
+
return state.set('getAllTemplatesInProgress', false)
|
|
27
|
+
.set('templates', action.data ? action.data.templates : [])
|
|
28
|
+
.set('isSearch', action.data ? action.data.search : false)
|
|
29
|
+
.set('weCRMtemplates', action.weCRMTemplate ? action.weCRMTemplate : []).set('templateError', {});
|
|
30
|
+
}
|
|
31
|
+
return state.set('getAllTemplatesInProgress', false)
|
|
32
|
+
.set('templates', action.data ? state.get('templates').concat(action.data.templates) : [])
|
|
33
|
+
.set('isSearch', action.data ? action.data.search : false)
|
|
34
|
+
.set('weCRMtemplates', action.weCRMTemplate ? state.get('weCRMtemplates').concat(action.weCRMTemplate) : []);
|
|
35
|
+
case types.GET_ALL_TEMPLATES_FAILURE:
|
|
36
|
+
return state.set('getAllTemplatesInProgress', false).set('templateError', action.error);
|
|
37
|
+
case types.DELETE_TEMPLATE_REQUEST:
|
|
38
|
+
return state.set('deleteTemplateInProgress', true);
|
|
39
|
+
case types.DELETE_TEMPLATE_SUCCESS:
|
|
40
|
+
return state.set('deleteTemplateInProgress', false)
|
|
41
|
+
.set('deleteResponse', action.data);
|
|
42
|
+
case types.DELETE_TEMPLATE_FAILURE:
|
|
43
|
+
return state.set('deleteTemplateInProgress', false);
|
|
44
|
+
case types.GET_USER_LIST_REQUEST:
|
|
45
|
+
return state
|
|
46
|
+
.set('fetchingUserList', true)
|
|
47
|
+
.set('userList', fromJS({}))
|
|
48
|
+
.set('userListFetchError', false);
|
|
49
|
+
case types.GET_USER_LIST_SUCCESS:
|
|
50
|
+
return state
|
|
51
|
+
.set('fetchingUserList', false)
|
|
52
|
+
.set('userList', fromJS(action.data))
|
|
53
|
+
.set('userListFetchError', false);
|
|
54
|
+
case types.GET_USER_LIST_FAILURE:
|
|
55
|
+
return state
|
|
56
|
+
.set('fetchingUserList', false)
|
|
57
|
+
.set('userList', fromJS({}))
|
|
58
|
+
.set('userListFetchError', true);
|
|
59
|
+
case types.GET_WECRM_ACCOUNTS_REQUEST:
|
|
60
|
+
return state
|
|
61
|
+
.set('fetchingWeCrmAccounts', true)
|
|
62
|
+
.set('weCrmAccountFetchingError', false);
|
|
63
|
+
case types.GET_WECRM_ACCOUNTS_SUCCESS:
|
|
64
|
+
return state
|
|
65
|
+
.set('fetchingWeCrmAccounts', false)
|
|
66
|
+
.set('weCrmAccounts', fromJS(action.data));
|
|
67
|
+
case types.GET_WECRM_ACCOUNTS_FAILURE:
|
|
68
|
+
return state
|
|
69
|
+
.set('fetchingWeCrmAccounts', false)
|
|
70
|
+
.set('weCrmAccountFetchingError', true);
|
|
71
|
+
case types.SET_WECHAT_ACCOUNT:
|
|
72
|
+
return state
|
|
73
|
+
.set('selectedWeChatAccount', fromJS(action.weChatAccount));
|
|
74
|
+
case types.SET_LINE_ACCOUNT:
|
|
75
|
+
return state.set('selectedLineAccount', fromJS(action.lineAccount));
|
|
76
|
+
case types.RESET_ACCOUNT:
|
|
77
|
+
return state
|
|
78
|
+
.remove('selectedWeChatAccount')
|
|
79
|
+
.remove('weCrmAccounts');
|
|
80
|
+
case types.RESET_TEMPLATE:
|
|
81
|
+
return state
|
|
82
|
+
.set('weCRMtemplates', fromJS([]))
|
|
83
|
+
.set('weChatDefaultTemplate', fromJS([]))
|
|
84
|
+
.set('templates', []);
|
|
85
|
+
case types.SET_SELECTED_LAYOUT:
|
|
86
|
+
return state
|
|
87
|
+
.set('selectedEmailLayout', fromJS(action.selectedTemplate))
|
|
88
|
+
.set('edmTemplate', fromJS({}));
|
|
89
|
+
case types.RESET_UPLOAD_DATA:
|
|
90
|
+
return state
|
|
91
|
+
.set('selectedEmailLayout', "");
|
|
92
|
+
case types.SEND_ZIPPED_FILE_REQUEST:
|
|
93
|
+
return state
|
|
94
|
+
.set('sendingFile', true)
|
|
95
|
+
.set('errorSendingFile', false)
|
|
96
|
+
.set('selectedEmailLayout', "");
|
|
97
|
+
case types.SEND_ZIPPED_FILE_SUCCESS:
|
|
98
|
+
return state
|
|
99
|
+
.set('sendingFile', false)
|
|
100
|
+
.set('selectedEmailLayout', fromJS(action.selectedTemplate))
|
|
101
|
+
.set('edmTemplate', fromJS({}));
|
|
102
|
+
case types.SEND_ZIPPED_FILE_FAILURE:
|
|
103
|
+
return state
|
|
104
|
+
.set('sendingFile', false)
|
|
105
|
+
.set('errorSendingFile', true)
|
|
106
|
+
.set('errorMessage', action.data)
|
|
107
|
+
.set('selectedEmailLayout', "");
|
|
108
|
+
case types.GET_EDM_DEAFULT_TEMPLATES_REQUEST:
|
|
109
|
+
return state.set('getCmsTemplatesInProgress', true);
|
|
110
|
+
case types.GET_EDM_DEAFULT_TEMPLATES_SUCCESS:
|
|
111
|
+
return state.set('getCmsTemplatesInProgress', false)
|
|
112
|
+
.set('cmsTemplates', action.data ? fromJS(action.data.templates) : []);
|
|
113
|
+
case types.GET_EDM_DEAFULT_TEMPLATES_FAILURE:
|
|
114
|
+
return state.set('getCmsTemplatesInProgress', false);
|
|
115
|
+
case types.SET_EDM_TEMPLATE:
|
|
116
|
+
return state
|
|
117
|
+
.set('edmTemplate', fromJS(action.template))
|
|
118
|
+
.set('selectedEmailLayout', "");
|
|
119
|
+
case types.RESET_TEMPLATE_DATA:
|
|
120
|
+
return state
|
|
121
|
+
.set('edmTemplate', fromJS({}))
|
|
122
|
+
.set('selectedEmailLayout', "")
|
|
123
|
+
.set('templateDetails', fromJS({}));
|
|
124
|
+
case types.GET_TEMPLATE_DETAILS_REQUEST:
|
|
125
|
+
return state
|
|
126
|
+
.set('getTemplateDetailsInProgress', true)
|
|
127
|
+
.set('templateDetails', fromJS({}));
|
|
128
|
+
case types.GET_TEMPLATE_DETAILS_SUCCESS:
|
|
129
|
+
return state
|
|
130
|
+
.set('getTemplateDetailsInProgress', false)
|
|
131
|
+
.set('templateDetails', fromJS(action.data));
|
|
132
|
+
case types.GET_TEMPLATE_DETAILS_FAILURE:
|
|
133
|
+
return state
|
|
134
|
+
.set('getTemplateDetailsInProgress', false)
|
|
135
|
+
.set('templateDetails', fromJS({}));
|
|
136
|
+
case types.CLEAR_TEMPLATE_STORE_DATA:
|
|
137
|
+
return state
|
|
138
|
+
.set('templates', [])
|
|
139
|
+
.set('weCRMtemplates', fromJS({}));
|
|
140
|
+
default:
|
|
141
|
+
return state;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
export default templatesReducer;
|