@capillarytech/creatives-library 6.10.1 → 6.10.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/CapTagList/index.js +1 -1
- package/components/Edmeditor/index.js +1 -1
- package/components/FormBuilder/index.js +0 -1
- package/containers/TagList/index.js +3 -3
- package/index.html +3 -0
- package/package.json +2 -1
- package/services/api.js +19 -4
- package/translations/en.json +117 -4
- package/translations/zh.json +113 -0
- package/v2Components/BeeEditor/index.js +263 -0
- package/v2Components/BeeEditor/index.scss +11 -0
- package/v2Components/BeeEditor/messages.js +71 -0
- package/v2Components/BeeEditor/tests/index.test.js +10 -0
- package/v2Components/CapTagList/index.js +55 -26
- package/v2Components/CmsTemplatesComponent/index.js +4 -4
- package/v2Components/Edmeditor/index.js +1 -1
- package/v2Components/EmailPreview/_emailPreview.scss +2 -2
- package/v2Components/FormBuilder/index.js +78 -43
- package/v2Containers/App/constants.js +1 -0
- package/v2Containers/CreativesContainer/SlideBoxFooter.js +51 -51
- package/v2Containers/CreativesContainer/index.js +7 -2
- package/v2Containers/Email/constants.js +1 -0
- package/v2Containers/Email/index.js +170 -116
- package/v2Containers/Email/initialSchema.js +18 -3
- package/v2Containers/Email/sagas.js +2 -2
- package/v2Containers/Email/selectors.js +5 -0
- package/v2Containers/EmailWrapper/index.js +19 -3
- package/v2Containers/Line/Container/Image/index.js +2 -1
- package/v2Containers/Line/Container/ImageCarousel/index.js +1 -1
- package/v2Containers/Line/Container/ImageMap/index.js +20 -5
- package/v2Containers/TagList/index.js +13 -6
- package/v2Containers/Templates/actions.js +122 -117
- package/v2Containers/Templates/constants.js +49 -47
- package/v2Containers/Templates/index.js +36 -20
- package/v2Containers/Templates/messages.js +8 -0
- package/v2Containers/Templates/reducer.js +153 -145
- package/v2Containers/Templates/sagas.js +179 -179
- package/v2Containers/Templates/selectors.js +19 -1
|
@@ -199,9 +199,24 @@ export const response = {
|
|
|
199
199
|
"getEditorInstanse",
|
|
200
200
|
],
|
|
201
201
|
},
|
|
202
|
+
// will remove once bee gets tested end to end
|
|
203
|
+
// {
|
|
204
|
+
// id: "edmeditor",
|
|
205
|
+
// type: "edmeditor",
|
|
206
|
+
// metaType: "text",
|
|
207
|
+
// datatype: "string",
|
|
208
|
+
// required: true,
|
|
209
|
+
// onlyDisplay: true,
|
|
210
|
+
// standalone: false,
|
|
211
|
+
// width: 24,
|
|
212
|
+
// order: 2,
|
|
213
|
+
// customComponent: true,
|
|
214
|
+
// colStyle: { display: "none" },
|
|
215
|
+
// supportedEvents: [],
|
|
216
|
+
// },
|
|
202
217
|
{
|
|
203
|
-
id: "
|
|
204
|
-
type: "
|
|
218
|
+
id: "BEEeditor",
|
|
219
|
+
type: "BEEeditor",
|
|
205
220
|
metaType: "text",
|
|
206
221
|
datatype: "string",
|
|
207
222
|
required: true,
|
|
@@ -365,7 +380,7 @@ export const response = {
|
|
|
365
380
|
styling: "semantic",
|
|
366
381
|
order: 3,
|
|
367
382
|
width: 2,
|
|
368
|
-
offset:
|
|
383
|
+
offset: 4,
|
|
369
384
|
fluid: false,
|
|
370
385
|
onlyDisplay: true,
|
|
371
386
|
submitAction: "onTabOptionSelect",
|
|
@@ -53,7 +53,7 @@ export function* getAllAssets(assetType, queryParams) {
|
|
|
53
53
|
|
|
54
54
|
export function* getCmsSetting({cmsType, projectId, cmsMode, langId, isEdmSupport}) {
|
|
55
55
|
try {
|
|
56
|
-
const result = yield call(Api.
|
|
56
|
+
const result = yield call(Api.getCmsTemplateSettingsV2, cmsType, projectId, cmsMode, langId, isEdmSupport);
|
|
57
57
|
|
|
58
58
|
yield put({ type: types.GET_CMS_EDITOR_DETAILS_SUCCESS, settings: result.data.response.cmsDetails });
|
|
59
59
|
} catch (error) {
|
|
@@ -63,7 +63,7 @@ export function* getCmsSetting({cmsType, projectId, cmsMode, langId, isEdmSuppor
|
|
|
63
63
|
|
|
64
64
|
export function* getCmsData({cmsType, projectId, langId}) {
|
|
65
65
|
try {
|
|
66
|
-
const result = yield call(Api.
|
|
66
|
+
const result = yield call(Api.getCmsTemplateDataV2, cmsType, projectId, langId);
|
|
67
67
|
|
|
68
68
|
yield put({ type: types.GET_CMS_EDITOR_DATA_SUCCESS, data: result.data.response.data, langId: result.data.response.langId });
|
|
69
69
|
} catch (error) {
|
|
@@ -26,9 +26,14 @@ const selectLoadingStatus = () => createSelector(
|
|
|
26
26
|
selectEmailDomain(), (email) => email.createTemplateInProgress || (email.assetUploading !== undefined && email.assetUploading)
|
|
27
27
|
);
|
|
28
28
|
|
|
29
|
+
const makeSelectFetchingCmsData = () => createSelector(
|
|
30
|
+
selectEmailDomain(), (state) => state.get('fetchingCmsData')
|
|
31
|
+
);
|
|
32
|
+
|
|
29
33
|
export default makeSelectEmail;
|
|
30
34
|
export {
|
|
31
35
|
makeSelectEmail,
|
|
32
36
|
makeSelectCreateResponse,
|
|
33
37
|
selectLoadingStatus,
|
|
38
|
+
makeSelectFetchingCmsData,
|
|
34
39
|
};
|
|
@@ -15,7 +15,13 @@ import styled from 'styled-components';
|
|
|
15
15
|
import { CapRadioCard, CapNotification, CapInput, CapUploader, CapSpin, CapButton } from '@capillarytech/cap-ui-library';
|
|
16
16
|
import ComponentWithLabelHOC from '@capillarytech/cap-ui-library/assets/HOCs/ComponentWithLabelHOC';
|
|
17
17
|
import { UserIsAuthenticated } from '../../utils/authWrapper';
|
|
18
|
-
import {
|
|
18
|
+
import {
|
|
19
|
+
selectEmailLayout,
|
|
20
|
+
selectCmsTemplates,
|
|
21
|
+
selectEdmEditor,
|
|
22
|
+
uploadSelector,
|
|
23
|
+
selectCmsTemplatesLoader,
|
|
24
|
+
} from '../Templates/selectors';
|
|
19
25
|
import * as templatesActionsCreators from '../Templates/actions';
|
|
20
26
|
import Email from '../Email';
|
|
21
27
|
import CmsTemplatesComponent from '../../v2Components/CmsTemplatesComponent';
|
|
@@ -76,7 +82,7 @@ export class EmailWrapper extends React.Component { // eslint-disable-line react
|
|
|
76
82
|
//document.getElementById('upload-email-template').click();
|
|
77
83
|
} else if (step === "templateSelection" && !this.state.selectedCreateMode) {
|
|
78
84
|
if (emailCreateMode === "editor" && !CmsTemplates) {
|
|
79
|
-
templatesActions.
|
|
85
|
+
templatesActions.getDefaultBeeTemplates();
|
|
80
86
|
}
|
|
81
87
|
} else if (step === "createTemplateContent" && !this.state.selectedCreateMode) {
|
|
82
88
|
if (emailCreateMode === 'upload' && !_.isEmpty(EmailLayout)) {
|
|
@@ -156,6 +162,7 @@ export class EmailWrapper extends React.Component { // eslint-disable-line react
|
|
|
156
162
|
const data = _.find(CmsTemplates, { _id: id });
|
|
157
163
|
|
|
158
164
|
templatesActions.setEdmTemplate(data);
|
|
165
|
+
templatesActions.setBEETemplate(data);
|
|
159
166
|
this.setState({
|
|
160
167
|
selectedCreateMode: 'editor',
|
|
161
168
|
});
|
|
@@ -188,6 +195,7 @@ export class EmailWrapper extends React.Component { // eslint-disable-line react
|
|
|
188
195
|
selectedOfferDetails,
|
|
189
196
|
onPreviewContentClicked,
|
|
190
197
|
onTestContentClicked,
|
|
198
|
+
cmsTemplatesLoader,
|
|
191
199
|
} = this.props;
|
|
192
200
|
const {
|
|
193
201
|
templateName,
|
|
@@ -206,6 +214,7 @@ export class EmailWrapper extends React.Component { // eslint-disable-line react
|
|
|
206
214
|
value={templateName}
|
|
207
215
|
labelPosition="top"
|
|
208
216
|
size="default"
|
|
217
|
+
style={{ width: '68%'}}
|
|
209
218
|
/>
|
|
210
219
|
}
|
|
211
220
|
<CardContainer>
|
|
@@ -251,7 +260,13 @@ export class EmailWrapper extends React.Component { // eslint-disable-line react
|
|
|
251
260
|
onPreviewContentClicked={onPreviewContentClicked}
|
|
252
261
|
onTestContentClicked={onTestContentClicked}
|
|
253
262
|
/>}
|
|
254
|
-
{
|
|
263
|
+
{!isShowEmailCreate && (
|
|
264
|
+
<CmsTemplatesComponent
|
|
265
|
+
cmsTemplates={CmsTemplates}
|
|
266
|
+
handleEdmDefaultTemplateSelection={this.useEditor}
|
|
267
|
+
cmsTemplatesLoader={cmsTemplatesLoader}
|
|
268
|
+
/>
|
|
269
|
+
)}
|
|
255
270
|
</div>
|
|
256
271
|
}
|
|
257
272
|
</CapSpin>
|
|
@@ -289,6 +304,7 @@ const mapStateToProps = createStructuredSelector({
|
|
|
289
304
|
CmsTemplates: selectCmsTemplates(),
|
|
290
305
|
SelectedEdmDefaultTemplate: selectEdmEditor(),
|
|
291
306
|
isUploading: uploadSelector(),
|
|
307
|
+
cmsTemplatesLoader: selectCmsTemplatesLoader(),
|
|
292
308
|
});
|
|
293
309
|
|
|
294
310
|
function mapDispatchToProps(dispatch) {
|
|
@@ -103,8 +103,9 @@ export const LineImage = ({
|
|
|
103
103
|
useEffect(() => {
|
|
104
104
|
const imgSrc = get(uploadedAssetList[index], 'imgSrc', '');
|
|
105
105
|
const imgPreview = get(uploadedAssetList[index], 'imgPreview', '');
|
|
106
|
+
const { type } = content;
|
|
106
107
|
|
|
107
|
-
if (imgSrc) {
|
|
108
|
+
if (imgSrc && type === 'image') {
|
|
108
109
|
updateImageSrc(imgSrc);
|
|
109
110
|
updateImageStatus(true);
|
|
110
111
|
updateImagePreview(imgPreview);
|
|
@@ -120,7 +120,7 @@ export const LineImageCarousel = (props) => {
|
|
|
120
120
|
actionLabelErrorMessage,
|
|
121
121
|
activeIndex,
|
|
122
122
|
}) => {
|
|
123
|
-
isErrorIndex = (isErrorIndex !== undefined)
|
|
123
|
+
isErrorIndex = (isErrorIndex !== undefined && isErrorIndex !== false)
|
|
124
124
|
? isErrorIndex
|
|
125
125
|
: ((!originalContentUrl || !selectedActionType || actionContentErrorMessage || actionLabelErrorMessage || !actionContent) && activeIndex);
|
|
126
126
|
columns.push({
|
|
@@ -54,7 +54,9 @@ export const LineImageMap = ({
|
|
|
54
54
|
content,
|
|
55
55
|
activeKey,
|
|
56
56
|
Templates,
|
|
57
|
-
getAllTemplates
|
|
57
|
+
getAllTemplates,
|
|
58
|
+
uploadedAssetList,
|
|
59
|
+
updateUploadedAssetList,
|
|
58
60
|
}) => {
|
|
59
61
|
if (activeKey !== IMAGE_MAP) {
|
|
60
62
|
return null;
|
|
@@ -90,7 +92,7 @@ export const LineImageMap = ({
|
|
|
90
92
|
baseSize = {},
|
|
91
93
|
selectedTemplate,
|
|
92
94
|
assetType,
|
|
93
|
-
actionLinks,
|
|
95
|
+
actionLinks = {},
|
|
94
96
|
altText,
|
|
95
97
|
} = content;
|
|
96
98
|
if ( baseUrl && type === IMAGE_MAP) {
|
|
@@ -129,11 +131,24 @@ export const LineImageMap = ({
|
|
|
129
131
|
useEffect(() => {
|
|
130
132
|
const imgSrc = get(Line, 'uploadedAssetData', false);
|
|
131
133
|
if (imgSrc && typeof imgSrc !== 'object') {
|
|
132
|
-
|
|
134
|
+
updateUploadedAssetList({
|
|
135
|
+
...uploadedAssetList,
|
|
136
|
+
[index]: {
|
|
137
|
+
imgSrc: imgSrc.slice(0, -5),
|
|
138
|
+
},
|
|
139
|
+
});
|
|
140
|
+
actions.clearAsset();
|
|
141
|
+
}
|
|
142
|
+
}, [Line.uploadedAssetData]);
|
|
143
|
+
|
|
144
|
+
useEffect(() => {
|
|
145
|
+
const imgSrc = get(uploadedAssetList[index], 'imgSrc', '');
|
|
146
|
+
|
|
147
|
+
if (imgSrc) {
|
|
148
|
+
updateImageSrc(imgSrc);
|
|
133
149
|
updateImageStatus(true);
|
|
134
|
-
actions.clearAsset()
|
|
135
150
|
}
|
|
136
|
-
}, [
|
|
151
|
+
}, [uploadedAssetList]);
|
|
137
152
|
|
|
138
153
|
const getActions = () => {
|
|
139
154
|
const actionsMap = [];
|
|
@@ -66,24 +66,25 @@ export class TagList extends React.Component { // eslint-disable-line react/pref
|
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
populateTags(tagsList) {
|
|
69
|
-
console.log('populating tags', tagsList);
|
|
69
|
+
console.log('populating tags', (tagsList || []).length);
|
|
70
70
|
const mainTags = {};
|
|
71
71
|
|
|
72
72
|
//Form tags object with tag headers
|
|
73
73
|
_.forEach(tagsList, (temp) => {
|
|
74
74
|
const tag = temp.definition;
|
|
75
|
+
const { userLocale } = this.props;
|
|
75
76
|
if (!tag['tag-header']) {
|
|
76
77
|
mainTags[tag.value] = {
|
|
77
|
-
name: tag.label[
|
|
78
|
+
name: tag.label[userLocale] ? tag.label[userLocale] : tag.label.en,
|
|
78
79
|
desc: tag.desc ? tag.desc : tag.label.en,
|
|
79
80
|
};
|
|
80
81
|
} else if (tag['tag-header'] && mainTags[tag.value]) {
|
|
81
82
|
mainTags[tag.value].subtags = _.concat(mainTags[tag.value].subtags, tag.subtags);
|
|
82
83
|
} else if (!mainTags[tag.value]) {
|
|
83
|
-
console.log('Inside ', tag.label);
|
|
84
|
+
// console.log('Inside ', tag.label);
|
|
84
85
|
mainTags[tag.value] = {
|
|
85
86
|
'tag-header': true,
|
|
86
|
-
"name": tag.label[
|
|
87
|
+
"name": tag.label[userLocale] ? tag.label[userLocale] : tag.label.en,
|
|
87
88
|
"desc": tag.desc ? tag.desc : tag.label.en,
|
|
88
89
|
"subtags": tag.subtags,
|
|
89
90
|
};
|
|
@@ -228,13 +229,13 @@ export class TagList extends React.Component { // eslint-disable-line react/pref
|
|
|
228
229
|
}
|
|
229
230
|
if (this.props.tags && this.props.tags.length > 0) {
|
|
230
231
|
tags = this.populateTags(this.props.tags);
|
|
231
|
-
console.log('populating tags', tags);
|
|
232
|
+
console.log('populating tags', Object.keys(tags || {}).length);
|
|
232
233
|
}
|
|
233
234
|
if (this.props.selectedOfferDetails && !_.isEmpty(this.props.selectedOfferDetails) && (tags && tags.coupon)) {
|
|
234
235
|
this.transformCouponTags(this.props.selectedOfferDetails, tags);
|
|
235
236
|
}
|
|
236
237
|
tags = _.merge( {}, tags, injectedTags);
|
|
237
|
-
console.log('merged tags', tags);
|
|
238
|
+
console.log('merged tags', Object.keys(tags || {}).length);
|
|
238
239
|
return (
|
|
239
240
|
<div className={this.props.className ? this.props.className : ''}>
|
|
240
241
|
<CapTagList
|
|
@@ -242,8 +243,11 @@ export class TagList extends React.Component { // eslint-disable-line react/pref
|
|
|
242
243
|
tags={tags}
|
|
243
244
|
onSelect={this.onSelect}
|
|
244
245
|
label={this.props.label}
|
|
246
|
+
visibleTaglist={this.props.visibleTaglist}
|
|
247
|
+
hidePopover={this.props.hidePopover}
|
|
245
248
|
onContextChange={this.getTagsforContext}
|
|
246
249
|
moduleFilterEnabled={this.props.moduleFilterEnabled}
|
|
250
|
+
modalProps={this.props.modalProps}
|
|
247
251
|
/>
|
|
248
252
|
</div>
|
|
249
253
|
);
|
|
@@ -265,6 +269,9 @@ TagList.propTypes = {
|
|
|
265
269
|
className: PropTypes.string,
|
|
266
270
|
userLocale: PropTypes.string,
|
|
267
271
|
selectedOfferDetails: PropTypes.array,
|
|
272
|
+
visibleTaglist: PropTypes.bool,
|
|
273
|
+
hidePopover: PropTypes.bool,
|
|
274
|
+
modalProps: PropTypes.any,
|
|
268
275
|
};
|
|
269
276
|
|
|
270
277
|
const mapStateToProps = createStructuredSelector({
|
|
@@ -1,117 +1,122 @@
|
|
|
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
|
|
79
|
-
return {
|
|
80
|
-
type: types.
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
export function setEdmTemplate(template) {
|
|
85
|
-
return {
|
|
86
|
-
type: types.SET_EDM_TEMPLATE,
|
|
87
|
-
template,
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
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 getDefaultBeeTemplates() {
|
|
79
|
+
return {
|
|
80
|
+
type: types.GET_DEAFULT_BEE_TEMPLATES_REQUEST,
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export function setEdmTemplate(template) {
|
|
85
|
+
return {
|
|
86
|
+
type: types.SET_EDM_TEMPLATE,
|
|
87
|
+
template,
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
export function setBEETemplate(template) {
|
|
91
|
+
return {
|
|
92
|
+
type: types.SET_BEE_TEMPLATE,
|
|
93
|
+
template,
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
export function getTemplateDetails(id, channel) {
|
|
97
|
+
console.log('getting template', id, channel);
|
|
98
|
+
return {
|
|
99
|
+
type: types.GET_TEMPLATE_DETAILS_REQUEST,
|
|
100
|
+
id,
|
|
101
|
+
channel,
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export function resetTemplateData() {
|
|
106
|
+
return {
|
|
107
|
+
type: types.RESET_TEMPLATE_DATA,
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export function resetUploadData() {
|
|
112
|
+
console.log('clearing upload data');
|
|
113
|
+
return {
|
|
114
|
+
type: types.RESET_UPLOAD_DATA,
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
export function resetTemplateStoreData() {
|
|
119
|
+
return {
|
|
120
|
+
type: types.CLEAR_TEMPLATE_STORE_DATA,
|
|
121
|
+
};
|
|
122
|
+
}
|
|
@@ -1,47 +1,49 @@
|
|
|
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
|
|
32
|
-
export const
|
|
33
|
-
export const
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
export const
|
|
37
|
-
export const
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
export const
|
|
41
|
-
export const
|
|
42
|
-
export const
|
|
43
|
-
export const
|
|
44
|
-
|
|
45
|
-
export const
|
|
46
|
-
|
|
47
|
-
export const
|
|
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_TEMPLATE_DETAILS_REQUEST = 'app/v2Containers/Templates/GET_TEMPLATE_DETAILS_REQUEST';
|
|
32
|
+
export const GET_TEMPLATE_DETAILS_SUCCESS = 'app/v2Containers/Templates/GET_TEMPLATE_DETAILS_SUCCESS';
|
|
33
|
+
export const GET_TEMPLATE_DETAILS_FAILURE = 'app/v2Containers/Templates/GET_TEMPLATE_DETAILS_FAILURE';
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
export const SET_EDM_TEMPLATE = "app/v2Containers/Templates/SET_EDM_TEMPLATE";
|
|
37
|
+
export const SET_BEE_TEMPLATE = "app/v2Containers/Templates/SET_BEE_TEMPLATE";
|
|
38
|
+
|
|
39
|
+
export const RESET_ACCOUNT = "app/v2Containers/Templates/RESET_ACCOUNT";
|
|
40
|
+
export const RESET_TEMPLATE = "app/v2Containers/Templates/RESET_TEMPLATE";
|
|
41
|
+
export const RESET_TEMPLATE_DATA = "app/v2Containers/Templates/RESET_TEMPLATE_DATA";
|
|
42
|
+
export const RESET_UPLOAD_DATA = "app/v2Containers/Templates/RESET_UPLOAD_DATA";
|
|
43
|
+
export const CLEAR_TEMPLATE_STORE_DATA = "app/v2Containers/Templates/CLEAR_TEMPLATE_STORE_DATA";
|
|
44
|
+
|
|
45
|
+
export const SET_LINE_ACCOUNT = "app/v2Containers/Templates/SET_LINE_ACCOUNT";
|
|
46
|
+
|
|
47
|
+
export const GET_DEAFULT_BEE_TEMPLATES_REQUEST = 'app/v2Containers/Templates/GET_DEAFULT_BEE_TEMPLATES_REQUEST';
|
|
48
|
+
export const GET_DEAFULT_BEE_TEMPLATES_SUCCESS = 'app/v2Containers/Templates/GET_DEAFULT_BEE_TEMPLATES_SUCCESS';
|
|
49
|
+
export const GET_DEAFULT_BEE_TEMPLATES_FAILURE = 'app/v2Containers/Templates/GET_DEAFULT_BEE_TEMPLATES_FAILURE';
|