@capillarytech/creatives-library 6.8.7 → 6.9.0
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/config/app.js +1 -1
- package/containers/TagList/index.js +3 -3
- package/index.html +5 -0
- package/package.json +2 -1
- package/services/api.js +16 -1
- package/v2Components/BeeEditor/index.js +272 -0
- package/v2Components/BeeEditor/messages.js +47 -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/FormBuilder/index.js +117 -43
- 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/tests/index.test.js +10 -10
- 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.js +7 -2
- 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/Email/constants.js +1 -0
- package/v2Containers/Email/index.js +209 -107
- package/v2Containers/Email/initialSchema.js +17 -2
- package/v2Containers/Email/sagas.js +2 -2
- package/v2Containers/Email/selectors.js +5 -0
- package/v2Containers/EmailWrapper/index.js +18 -3
- package/v2Containers/TagList/index.js +6 -0
- package/v2Containers/Templates/_templates.scss +405 -405
- package/v2Containers/Templates/actions.js +122 -117
- package/v2Containers/Templates/constants.js +49 -47
- package/v2Containers/Templates/index.js +2 -6
- package/v2Containers/Templates/reducer.js +153 -145
- package/v2Containers/Templates/sagas.js +179 -179
- package/v2Containers/Templates/selectors.js +19 -1
- 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
|
@@ -187,7 +187,7 @@ class CapTagList extends React.Component { // eslint-disable-line react/prefer-s
|
|
|
187
187
|
{this.props.moduleFilterEnabled ? <CapSelect getPopupContainer={(triggerNode) => triggerNode.parentNode} style={{width: '250px', marginBottom: '16px', minWidth: 'initial', display: 'inherit'}} onChange={this.props.onContextChange} defaultValue="All" options={options}>
|
|
188
188
|
</CapSelect> : ''}
|
|
189
189
|
<Tree
|
|
190
|
-
styling={{
|
|
190
|
+
styling={{height: '350px', overflow: 'auto'}}
|
|
191
191
|
onSelect={this.handleOnSelect}
|
|
192
192
|
selectedKeys={this.state.tagValue}
|
|
193
193
|
expandedKeys={this.state.expandedKeys}
|
|
@@ -44,7 +44,7 @@ class Edmeditor extends React.Component { // eslint-disable-line react/prefer-st
|
|
|
44
44
|
console.log('current language edm editor loading', this.props.id, this.props.edmSrc);
|
|
45
45
|
return (
|
|
46
46
|
this.props.edmSrc ?
|
|
47
|
-
(<iframe id={this.props.id} className={this.props.activeClass} src={this.props.edmSrc} height="460" width="100%" style={{
|
|
47
|
+
(<iframe id={this.props.id} className={this.props.activeClass} src={this.props.edmSrc} height="460" width="100%" style={{height: "calc(100vh - 180px)"}}></iframe>)
|
|
48
48
|
: 'aaasass'
|
|
49
49
|
);
|
|
50
50
|
}
|
package/config/app.js
CHANGED
|
@@ -14,7 +14,7 @@ const config = {
|
|
|
14
14
|
accountConfig: (strs, accountId) => `${window.location.origin}/org/config/AccountAdd?q=a&channelId=2&accountId=${accountId}&edit=1`,
|
|
15
15
|
},
|
|
16
16
|
development: {
|
|
17
|
-
api_endpoint: '
|
|
17
|
+
api_endpoint: 'http://localhost:2022/arya/api/v1/creatives',
|
|
18
18
|
campaigns_api_endpoint: 'https://crm-nightly-new.cc.capillarytech.com/iris/v2/campaigns',
|
|
19
19
|
auth_endpoint: 'https://crm-nightly-new.cc.capillarytech.com/arya/api/v1/auth',
|
|
20
20
|
arya_endpoint: 'https://crm-nightly-new.cc.capillarytech.com/arya/api/v1',
|
|
@@ -82,9 +82,9 @@ export class TagList extends React.Component { // eslint-disable-line react/pref
|
|
|
82
82
|
console.log('Inside ', tag.label);
|
|
83
83
|
mainTags[tag.value] = {
|
|
84
84
|
'tag-header': true,
|
|
85
|
-
name: tag.label[this.props.userLocale] ? tag.label[this.props.userLocale] : tag.label.en,
|
|
86
|
-
desc: tag.desc ? tag.desc : tag.label.en,
|
|
87
|
-
subtags: tag.subtags,
|
|
85
|
+
"name": tag.label[this.props.userLocale] ? tag.label[this.props.userLocale] : tag.label.en,
|
|
86
|
+
"desc": tag.desc ? tag.desc : tag.label.en,
|
|
87
|
+
"subtags": tag.subtags,
|
|
88
88
|
};
|
|
89
89
|
}
|
|
90
90
|
});
|
package/index.html
CHANGED
|
@@ -11,6 +11,11 @@
|
|
|
11
11
|
<meta http-equiv="Pragma" content="no-cache" />
|
|
12
12
|
<meta http-equiv="Expires" content="0" />
|
|
13
13
|
<script src="https://use.typekit.net/ifw1ntv.js"></script>
|
|
14
|
+
|
|
15
|
+
<script src="https://app-rsrc.getbee.io/plugin/BeePlugin.js" type="text/javascript"></script>
|
|
16
|
+
<!-- Roboto Font -->
|
|
17
|
+
<link href="https://fonts.googleapis.com/css?family=Roboto:400,500" rel="stylesheet">
|
|
18
|
+
|
|
14
19
|
<!-- Google Tag Manager -->
|
|
15
20
|
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
|
|
16
21
|
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capillarytech/creatives-library",
|
|
3
3
|
"author": "meharaj",
|
|
4
|
-
"version": "6.
|
|
4
|
+
"version": "6.9.0",
|
|
5
5
|
"description": "Capillary creatives ui",
|
|
6
6
|
"main": "./index.js",
|
|
7
7
|
"module": "./index.es.js",
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
"@bugsnag/js": "^7.2.1",
|
|
17
17
|
"@bugsnag/plugin-react": "^7.2.1",
|
|
18
18
|
"@capillarytech/cap-ui-utils": "1.2.6",
|
|
19
|
+
"@mailupinc/bee-plugin": "^1.2.0",
|
|
19
20
|
"babel-cli": "^6.26.0",
|
|
20
21
|
"chalk": "1.1.3",
|
|
21
22
|
"jquery": "^3.3.1",
|
package/services/api.js
CHANGED
|
@@ -319,23 +319,38 @@ export const getCmsTemplateSettings = (cmsType, projectId, cmsMode, langId, isEd
|
|
|
319
319
|
return API.get(url);
|
|
320
320
|
};
|
|
321
321
|
|
|
322
|
+
export const getCmsTemplateSettingsV2 = (cmsType, projectId, cmsMode, langId, isEdmSupport) => {
|
|
323
|
+
const url = `${API_ENDPOINT}/cms/v2/getDetails/?type=${cmsType}&projectId=${projectId}&cmsMode=${cmsMode}&langId=${langId}&isEdmSupport=${isEdmSupport ? 1 : 0}`;
|
|
324
|
+
return API.get(url);
|
|
325
|
+
};
|
|
326
|
+
|
|
327
|
+
|
|
322
328
|
export const getCmsTemplateData = (cmsType, projectId, langId) => {
|
|
323
329
|
const url = `${API_ENDPOINT}/cms/getContent?type=${cmsType}&projectId=${projectId}&langId=${langId}`;
|
|
324
330
|
return API.get(url);
|
|
325
331
|
};
|
|
326
332
|
|
|
333
|
+
export const getCmsTemplateDataV2 = (cmsType, projectId, langId) => {
|
|
334
|
+
const url = `${API_ENDPOINT}/cms/v2/getContent?type=${cmsType}&projectId=${projectId}&langId=${langId}`;
|
|
335
|
+
return API.get(url);
|
|
336
|
+
};
|
|
337
|
+
|
|
327
338
|
export const getCmsData = (cmsType, projectId, langId) => {
|
|
328
339
|
const url = `${API_ENDPOINT}/cms/getCmsData?type=${cmsType}&projectId=${projectId}&langId=${langId}`;
|
|
329
340
|
return API.get(url);
|
|
330
341
|
};
|
|
331
342
|
|
|
332
|
-
|
|
333
343
|
export const getEdmTemplates = () => {
|
|
334
344
|
console.log('in api.js');
|
|
335
345
|
const url = `${API_ENDPOINT}/templates/email/default`;
|
|
336
346
|
return request(url, getAPICallObject('GET'));
|
|
337
347
|
};
|
|
338
348
|
|
|
349
|
+
export const getDefaultBeeTemplates = () => {
|
|
350
|
+
const url = `${API_ENDPOINT}/templates/v2/email/default`;
|
|
351
|
+
return request(url, getAPICallObject('GET'));
|
|
352
|
+
}
|
|
353
|
+
|
|
339
354
|
// All about line
|
|
340
355
|
|
|
341
356
|
export const createLineTemplate = ({template}) => {
|
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* Beeeditor
|
|
4
|
+
*
|
|
5
|
+
*/
|
|
6
|
+
import React, { useEffect, useState, useRef, useCallback } from 'react';
|
|
7
|
+
import PropTypes from 'prop-types';
|
|
8
|
+
import get from 'lodash/get';
|
|
9
|
+
import { injectIntl, intlShape, FormattedMessage } from 'react-intl';
|
|
10
|
+
import TagList from '../../v2Containers/TagList';
|
|
11
|
+
import
|
|
12
|
+
{
|
|
13
|
+
CapModal,
|
|
14
|
+
CapButton,
|
|
15
|
+
CapInput,
|
|
16
|
+
CapSelect,
|
|
17
|
+
}
|
|
18
|
+
from '@capillarytech/cap-ui-library';
|
|
19
|
+
import messages from './messages';
|
|
20
|
+
|
|
21
|
+
function BeeEditor(props) {
|
|
22
|
+
const {
|
|
23
|
+
uid,
|
|
24
|
+
beeJson,
|
|
25
|
+
tokenData,
|
|
26
|
+
id,
|
|
27
|
+
location = {},
|
|
28
|
+
moduleFilterEnabled,
|
|
29
|
+
label,
|
|
30
|
+
className,
|
|
31
|
+
userLocale,
|
|
32
|
+
selectedOfferDetails,
|
|
33
|
+
tags,
|
|
34
|
+
injectedTags,
|
|
35
|
+
saveBeeInstance,
|
|
36
|
+
saveBeeData,
|
|
37
|
+
intl,
|
|
38
|
+
onContextChange,
|
|
39
|
+
} = props;
|
|
40
|
+
const {formatMessage} = intl;
|
|
41
|
+
const UNSUBSCRIBE = 'unsubscribe';
|
|
42
|
+
let beePluginInstance = null;
|
|
43
|
+
const categoryOptions = [];
|
|
44
|
+
const [visibleTaglist, setVisibleTaglist] = useState(false);
|
|
45
|
+
const [showRowMetaModal, setRowMetaModal] = useState(false);
|
|
46
|
+
const [selectedTag, setSelectedTag] = useState({});
|
|
47
|
+
const [rowMetaInfo, setRowMetaInfo] = useState({});
|
|
48
|
+
const [rowName, setRowName] = useState('');
|
|
49
|
+
const [rowTags, setRowTags] = useState('');
|
|
50
|
+
const [rowCategory, setRowCategory] = useState('');
|
|
51
|
+
|
|
52
|
+
const savedCallback = useRef();
|
|
53
|
+
const filteredTags = (tags || []).filter((obj) => obj.definition.value !== UNSUBSCRIBE);
|
|
54
|
+
let intervalTimer;
|
|
55
|
+
|
|
56
|
+
useEffect(() => {
|
|
57
|
+
savedCallback.current = Object.keys(selectedTag).length > 0 ? selectedTag : rowMetaInfo;
|
|
58
|
+
}, [selectedTag, rowMetaInfo]);
|
|
59
|
+
|
|
60
|
+
useEffect(() => {
|
|
61
|
+
const beeConfig = {
|
|
62
|
+
uid,
|
|
63
|
+
container: 'bee-plugin-container',
|
|
64
|
+
rowsConfiguration: {
|
|
65
|
+
emptyRows: true,
|
|
66
|
+
defaultRows: true,
|
|
67
|
+
},
|
|
68
|
+
contentDialog: {
|
|
69
|
+
specialLinks: {
|
|
70
|
+
label: UNSUBSCRIBE,
|
|
71
|
+
handler(resolve) {
|
|
72
|
+
resolve({
|
|
73
|
+
type: 'custom',
|
|
74
|
+
label: UNSUBSCRIBE,
|
|
75
|
+
link: `<a href='{{${UNSUBSCRIBE}}}'>unsubscribe</a>`,
|
|
76
|
+
});
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
mergeTags: {
|
|
80
|
+
label: 'search',
|
|
81
|
+
handler: async (resolve, reject) => {
|
|
82
|
+
await setVisibleTaglist(true);
|
|
83
|
+
const promise = new Promise((resolveP) => {
|
|
84
|
+
intervalTimer = setInterval(() => {
|
|
85
|
+
if ((savedCallback.current || {}).close === true) {
|
|
86
|
+
reject();
|
|
87
|
+
clearInterval(intervalTimer);
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
if (Object.keys(savedCallback.current || {}).length > 0) {
|
|
91
|
+
resolveP(savedCallback.current);
|
|
92
|
+
setSelectedTag({});
|
|
93
|
+
clearInterval(intervalTimer);
|
|
94
|
+
}
|
|
95
|
+
}, 2000);
|
|
96
|
+
});
|
|
97
|
+
const result = await promise;
|
|
98
|
+
resolve(result); // "done!"
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
saveRow: {
|
|
102
|
+
handler: async (resolve, reject, args) => {
|
|
103
|
+
await setRowMetaModal(true);
|
|
104
|
+
const promise = new Promise((resolveP) => {
|
|
105
|
+
intervalTimer = setInterval(() => {
|
|
106
|
+
if ((savedCallback.current || {}).close === true) {
|
|
107
|
+
reject();
|
|
108
|
+
clearInterval(intervalTimer);
|
|
109
|
+
setRowMetaInfo({});
|
|
110
|
+
setRowName('');
|
|
111
|
+
setRowTags('');
|
|
112
|
+
setRowCategory('');
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
if (Object.keys(savedCallback.current || {}).length > 0) {
|
|
116
|
+
const data = {...args, ...savedCallback.current};
|
|
117
|
+
resolveP(data);
|
|
118
|
+
}
|
|
119
|
+
}, 2000);
|
|
120
|
+
});
|
|
121
|
+
const result = await promise;
|
|
122
|
+
resolve(result); // "done!"
|
|
123
|
+
setRowMetaInfo({});
|
|
124
|
+
setRowName('');
|
|
125
|
+
setRowTags('');
|
|
126
|
+
setRowCategory('');
|
|
127
|
+
clearInterval(intervalTimer);
|
|
128
|
+
},
|
|
129
|
+
},
|
|
130
|
+
},
|
|
131
|
+
onSave: (jsonFile, htmlFile) => {
|
|
132
|
+
saveBeeData(jsonFile, htmlFile);
|
|
133
|
+
},
|
|
134
|
+
onSaveRows: (jsonFile, htmlFile) => {
|
|
135
|
+
console.log('bee-plugin-container onSaveRows', jsonFile, htmlFile);
|
|
136
|
+
},
|
|
137
|
+
};
|
|
138
|
+
window.BeePlugin.create(tokenData, beeConfig, (instance) => {
|
|
139
|
+
beePluginInstance = instance;
|
|
140
|
+
console.log('bee instance', beePluginInstance);
|
|
141
|
+
const parseJson = JSON.parse(beeJson);
|
|
142
|
+
beePluginInstance.start(parseJson);
|
|
143
|
+
saveBeeInstance(beePluginInstance);
|
|
144
|
+
});
|
|
145
|
+
return () => clearInterval(intervalTimer);
|
|
146
|
+
}, []);
|
|
147
|
+
|
|
148
|
+
const onTagSelect = (result) => {
|
|
149
|
+
const msg = {
|
|
150
|
+
name: result,
|
|
151
|
+
value: `{{${result}}}`,
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
setSelectedTag(msg);
|
|
155
|
+
setVisibleTaglist(false);
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
const onCancelTagList = () => {
|
|
159
|
+
setVisibleTaglist(false);
|
|
160
|
+
setSelectedTag({close: true});
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
const handleCancel = () => {
|
|
164
|
+
setRowMetaModal(false);
|
|
165
|
+
setRowMetaInfo({close: true});
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
const handleOk = () => {
|
|
169
|
+
console.log('handleOk');
|
|
170
|
+
const rowInfo = {};
|
|
171
|
+
if (rowTags !== '') {
|
|
172
|
+
rowInfo.tags = rowTags;
|
|
173
|
+
}
|
|
174
|
+
if (rowCategory !== '') {
|
|
175
|
+
rowInfo.category = rowCategory;
|
|
176
|
+
}
|
|
177
|
+
setRowMetaInfo({
|
|
178
|
+
name: rowName,
|
|
179
|
+
...rowInfo,
|
|
180
|
+
});
|
|
181
|
+
setRowMetaModal(false);
|
|
182
|
+
// set rowMetaInfo
|
|
183
|
+
};
|
|
184
|
+
const isDisableSave = () => rowName === '';
|
|
185
|
+
|
|
186
|
+
const onRowChange = useCallback((e) => {
|
|
187
|
+
setRowName(e.target.value);
|
|
188
|
+
});
|
|
189
|
+
|
|
190
|
+
const onChangeCategoy = (e) => {
|
|
191
|
+
console.log('onChangeCategoy', e);
|
|
192
|
+
};
|
|
193
|
+
|
|
194
|
+
const onTagChange = (e) => {
|
|
195
|
+
setRowTags(e.target.value);
|
|
196
|
+
};
|
|
197
|
+
|
|
198
|
+
const contentSection = <>
|
|
199
|
+
<CapInput
|
|
200
|
+
label={<FormattedMessage {...messages.rowName} />}
|
|
201
|
+
placeholder={formatMessage(messages.rowPlaceHolder)}
|
|
202
|
+
onChange={onRowChange}
|
|
203
|
+
value={rowName}
|
|
204
|
+
maxLength={50}
|
|
205
|
+
style={{ width: '324px', paddingBottom: '16px' }}
|
|
206
|
+
/>
|
|
207
|
+
<CapSelect
|
|
208
|
+
label="Category"
|
|
209
|
+
style={{ width: 250, paddingBottom: '16px'}}
|
|
210
|
+
options={categoryOptions}
|
|
211
|
+
selectPlaceholder={formatMessage(messages.select)}
|
|
212
|
+
placeholder={
|
|
213
|
+
<FormattedMessage {...messages.selectCategoyPlaceholder} />
|
|
214
|
+
}
|
|
215
|
+
onChange={onChangeCategoy}
|
|
216
|
+
/>
|
|
217
|
+
<CapInput
|
|
218
|
+
label={<FormattedMessage {...messages.tags} />}
|
|
219
|
+
placeholder={formatMessage(messages.tagPlaceHolder)}
|
|
220
|
+
onChange={onTagChange}
|
|
221
|
+
value={rowTags}
|
|
222
|
+
maxLength={50}
|
|
223
|
+
style={{ width: '324px', paddingBottom: '16px'}}
|
|
224
|
+
/>
|
|
225
|
+
</>;
|
|
226
|
+
return (
|
|
227
|
+
<>
|
|
228
|
+
<div id="bee-plugin-container" style={{ height: '500px'}}>
|
|
229
|
+
|
|
230
|
+
</div>
|
|
231
|
+
<TagList
|
|
232
|
+
moduleFilterEnabled={moduleFilterEnabled}
|
|
233
|
+
label={label}
|
|
234
|
+
onTagSelect={onTagSelect}
|
|
235
|
+
location={location}
|
|
236
|
+
tags={filteredTags}
|
|
237
|
+
injectedTags={injectedTags}
|
|
238
|
+
className={className}
|
|
239
|
+
id={id}
|
|
240
|
+
userLocale={userLocale}
|
|
241
|
+
selectedOfferDetails={selectedOfferDetails}
|
|
242
|
+
visibleTaglist={visibleTaglist}
|
|
243
|
+
hidePopover
|
|
244
|
+
modalProps={{onCancel: onCancelTagList, style: { left: 200, top: 250 }}}
|
|
245
|
+
onContextChange={onContextChange}
|
|
246
|
+
/>
|
|
247
|
+
<CapModal
|
|
248
|
+
visible={showRowMetaModal}
|
|
249
|
+
onCancel={handleCancel}
|
|
250
|
+
title={formatMessage(messages.customRows)}
|
|
251
|
+
footer={[
|
|
252
|
+
<CapButton key="back" onClick={handleCancel}>{formatMessage(messages.cancel)}</CapButton>,
|
|
253
|
+
<CapButton key="submit" type="primary" id="delete-version" onClick={handleOk} disabled={isDisableSave()}>
|
|
254
|
+
{formatMessage(messages.save)}
|
|
255
|
+
</CapButton>,
|
|
256
|
+
]}
|
|
257
|
+
>
|
|
258
|
+
{contentSection}
|
|
259
|
+
</CapModal>
|
|
260
|
+
</>
|
|
261
|
+
);
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
BeeEditor.propTypes = {
|
|
265
|
+
beeJson: PropTypes.object.isRequired,
|
|
266
|
+
tokenData: PropTypes.object.isRequired,
|
|
267
|
+
uid: PropTypes.string.isRequired,
|
|
268
|
+
showTagsPopover: PropTypes.func.isRequired,
|
|
269
|
+
intl: intlShape.isRequired,
|
|
270
|
+
};
|
|
271
|
+
|
|
272
|
+
export default injectIntl(BeeEditor);
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* BeeEditor Messages
|
|
3
|
+
*
|
|
4
|
+
* This contains all the text for the BeeEditor component.
|
|
5
|
+
*/
|
|
6
|
+
import { defineMessages } from 'react-intl';
|
|
7
|
+
|
|
8
|
+
const prefix = 'creatives.componentsV2.BeeEditor';
|
|
9
|
+
|
|
10
|
+
export default defineMessages({
|
|
11
|
+
cancel: {
|
|
12
|
+
id: `${prefix}.cancel`,
|
|
13
|
+
defaultMessage: 'Cancel',
|
|
14
|
+
},
|
|
15
|
+
save: {
|
|
16
|
+
id: `${prefix}.save`,
|
|
17
|
+
defaultMessage: 'Save',
|
|
18
|
+
},
|
|
19
|
+
rowPlaceHolder: {
|
|
20
|
+
id: `${prefix}.rowPlaceHolder`,
|
|
21
|
+
defaultMessage: 'Enter Row name',
|
|
22
|
+
},
|
|
23
|
+
rowName: {
|
|
24
|
+
id: `${prefix}.rowName`,
|
|
25
|
+
defaultMessage: 'Row name',
|
|
26
|
+
},
|
|
27
|
+
select: {
|
|
28
|
+
id: `${prefix}.select`,
|
|
29
|
+
defaultMessage: 'Select',
|
|
30
|
+
},
|
|
31
|
+
customRows: {
|
|
32
|
+
id: `${prefix}.customRows`,
|
|
33
|
+
defaultMessage: 'Custom rows',
|
|
34
|
+
},
|
|
35
|
+
selectCategoyPlaceholder: {
|
|
36
|
+
id: `${prefix}.selectCategoyPlaceholder`,
|
|
37
|
+
defaultMessage: 'Select category',
|
|
38
|
+
},
|
|
39
|
+
tags: {
|
|
40
|
+
id: `${prefix}.tags`,
|
|
41
|
+
defaultMessage: 'Tags (optional)',
|
|
42
|
+
},
|
|
43
|
+
tagPlaceHolder: {
|
|
44
|
+
id: `${prefix}.tagPlaceHolder`,
|
|
45
|
+
defaultMessage: 'Enter tags',
|
|
46
|
+
},
|
|
47
|
+
});
|
|
@@ -156,50 +156,72 @@ class CapTagList extends React.Component { // eslint-disable-line react/prefer-s
|
|
|
156
156
|
}
|
|
157
157
|
|
|
158
158
|
render() {
|
|
159
|
-
const
|
|
159
|
+
const { hidePopover = false, tags = {}, intl = {}, moduleFilterEnabled, label, modalProps } = this.props;
|
|
160
|
+
const tg = tags;
|
|
161
|
+
const {formatMessage} = intl;
|
|
162
|
+
const { tagValue, expandedKeys, autoExpandParent, searchValue, visible } = this.state;
|
|
160
163
|
const options = [
|
|
161
164
|
{
|
|
162
165
|
value: "All",
|
|
163
|
-
label:
|
|
166
|
+
label: formatMessage(messages.all),
|
|
164
167
|
key: 'all',
|
|
165
168
|
},
|
|
166
169
|
{
|
|
167
170
|
value: "Outbound",
|
|
168
|
-
label:
|
|
171
|
+
label: formatMessage(messages.outbound),
|
|
169
172
|
key: 'outbound',
|
|
170
173
|
},
|
|
171
174
|
{
|
|
172
175
|
value: "Loyalty",
|
|
173
|
-
label:
|
|
176
|
+
label: formatMessage(messages.loyalty),
|
|
174
177
|
key: 'loyalty',
|
|
175
178
|
},
|
|
176
179
|
];
|
|
180
|
+
const contentSection = (<div>
|
|
181
|
+
<CapSpin tip={formatMessage(messages.gettingTags)} spinning={this.props.loading}>
|
|
182
|
+
<Search
|
|
183
|
+
style={{ marginBottom: 8, width: '250px'}}
|
|
184
|
+
placeholder={formatMessage(messages.search)}
|
|
185
|
+
onChange={this.onChange} />
|
|
186
|
+
{moduleFilterEnabled ?
|
|
187
|
+
<CapSelect
|
|
188
|
+
getPopupContainer={(triggerNode) => triggerNode.parentNode}
|
|
189
|
+
style={{width: '250px', marginBottom: '16px', minWidth: 'initial', display: 'inherit'}}
|
|
190
|
+
onChange={this.props.onContextChange}
|
|
191
|
+
defaultValue={formatMessage(messages.all)}
|
|
192
|
+
options={options}>
|
|
193
|
+
</CapSelect> : ''}
|
|
194
|
+
<CapTree
|
|
195
|
+
styling={{height: '350px', overflow: 'auto'}}
|
|
196
|
+
onSelect={this.handleOnSelect}
|
|
197
|
+
selectedKeys={tagValue}
|
|
198
|
+
expandedKeys={expandedKeys}
|
|
199
|
+
autoExpandParent={autoExpandParent}
|
|
200
|
+
onExpand={this.onExpand}
|
|
201
|
+
>
|
|
202
|
+
{this.renderTags(tg, searchValue)}
|
|
203
|
+
</CapTree>
|
|
204
|
+
</CapSpin>
|
|
205
|
+
</div>);
|
|
177
206
|
return (
|
|
178
|
-
|
|
207
|
+
<>
|
|
208
|
+
{hidePopover ? <CapModal
|
|
209
|
+
visible={this.props.visibleTaglist}
|
|
210
|
+
footer={[]}
|
|
211
|
+
{...modalProps}
|
|
212
|
+
>
|
|
213
|
+
{contentSection}
|
|
214
|
+
</CapModal> :
|
|
179
215
|
<CapPopover
|
|
180
|
-
visible={
|
|
216
|
+
visible={visible}
|
|
181
217
|
onVisibleChange={this.togglePopoverVisibility}
|
|
182
|
-
content={
|
|
183
|
-
<CapSpin tip={this.props.intl.formatMessage(messages.gettingTags)} spinning={this.props.loading}>
|
|
184
|
-
<Search style={{ marginBottom: 8, width: '250px'}} placeholder={this.props.intl.formatMessage(messages.search)} onChange={this.onChange} />
|
|
185
|
-
{this.props.moduleFilterEnabled ? <CapSelect getPopupContainer={(triggerNode) => triggerNode.parentNode} style={{width: '250px', marginBottom: '16px', minWidth: 'initial', display: 'inherit'}} onChange={this.props.onContextChange} defaultValue={this.props.intl.formatMessage(messages.all)} options={options}>
|
|
186
|
-
</CapSelect> : ''}
|
|
187
|
-
<CapTree
|
|
188
|
-
styling={{height: '350px', overflow: 'auto'}}
|
|
189
|
-
onSelect={this.handleOnSelect}
|
|
190
|
-
selectedKeys={this.state.tagValue}
|
|
191
|
-
expandedKeys={this.state.expandedKeys}
|
|
192
|
-
autoExpandParent={this.state.autoExpandParent}
|
|
193
|
-
onExpand={this.onExpand}
|
|
194
|
-
>
|
|
195
|
-
{this.renderTags(tg, this.state.searchValue)}
|
|
196
|
-
</CapTree>
|
|
197
|
-
</CapSpin>
|
|
198
|
-
</div>}
|
|
218
|
+
content={contentSection}
|
|
199
219
|
trigger="click"
|
|
200
|
-
placement="
|
|
201
|
-
|
|
220
|
+
placement="topLeft"
|
|
221
|
+
>
|
|
222
|
+
<CapButton isAddBtn type="flat">{label || ''}</CapButton>
|
|
202
223
|
</CapPopover>
|
|
224
|
+
}
|
|
203
225
|
<CapModal
|
|
204
226
|
visible={this.state.showModal}
|
|
205
227
|
title={this.props.intl.formatMessage(messages["Dynamic Days before Expiry"])}
|
|
@@ -215,7 +237,7 @@ class CapTagList extends React.Component { // eslint-disable-line react/prefer-s
|
|
|
215
237
|
<p>{this.props.intl.formatMessage(messages.numberOfDaysBeforeExpiry)}</p>
|
|
216
238
|
<CapInput onChange={this.handleDynamicDateChange} value={this.state.dynamicDateValue} size="default"></CapInput>
|
|
217
239
|
</CapModal>
|
|
218
|
-
|
|
240
|
+
</>
|
|
219
241
|
);
|
|
220
242
|
}
|
|
221
243
|
}
|
|
@@ -228,6 +250,13 @@ CapTagList.propTypes = {
|
|
|
228
250
|
loading: PropTypes.bool,
|
|
229
251
|
moduleFilterEnabled: PropTypes.bool,
|
|
230
252
|
intl: intlShape.isRequired,
|
|
253
|
+
visibleTaglist: PropTypes.bool,
|
|
254
|
+
hidePopover: PropTypes.bool,
|
|
255
|
+
modalProps: PropTypes.any,
|
|
256
|
+
};
|
|
257
|
+
|
|
258
|
+
CapTagList.defaultValue = {
|
|
259
|
+
hidePopover: false,
|
|
231
260
|
};
|
|
232
261
|
|
|
233
262
|
export default injectIntl(CapTagList);
|
|
@@ -7,23 +7,23 @@
|
|
|
7
7
|
import React from 'react';
|
|
8
8
|
import PropTypes from 'prop-types';
|
|
9
9
|
// import styled from 'styled-components';
|
|
10
|
-
import {CapButton, CapCustomCard} from '@capillarytech/cap-ui-library';
|
|
10
|
+
import {CapButton, CapCustomCard, CapSpin} from '@capillarytech/cap-ui-library';
|
|
11
11
|
import { FormattedMessage } from 'react-intl';
|
|
12
12
|
import messages from './messages';
|
|
13
13
|
const {CapCustomCardList} = CapCustomCard;
|
|
14
14
|
function CmsTemplatesComponent(props) {
|
|
15
|
-
const cardDataList = props.cmsTemplates.map((template) => (
|
|
15
|
+
const cardDataList = (props.cmsTemplates || []).map((template) => (
|
|
16
16
|
{
|
|
17
17
|
key: template.name,
|
|
18
18
|
title: template.name,
|
|
19
19
|
url: template.versions.base.preview_http_url,
|
|
20
20
|
hoverOption: <CapButton onClick={() => props.handleEdmDefaultTemplateSelection(template._id)}><FormattedMessage {...messages.select}/></CapButton>,
|
|
21
21
|
}));
|
|
22
|
-
return (<
|
|
22
|
+
return (<CapSpin spinning={props.cmsTemplatesLoader}>
|
|
23
23
|
<div className="pagination-container">
|
|
24
24
|
<CapCustomCardList cardList={cardDataList} type="Email" />
|
|
25
25
|
</div>
|
|
26
|
-
</
|
|
26
|
+
</CapSpin>);
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
CmsTemplatesComponent.propTypes = {
|
|
@@ -44,7 +44,7 @@ class Edmeditor extends React.Component { // eslint-disable-line react/prefer-st
|
|
|
44
44
|
console.log('current language edm editor loading', this.props.id, this.props.edmSrc);
|
|
45
45
|
return (
|
|
46
46
|
this.props.edmSrc ?
|
|
47
|
-
(<iframe id={this.props.id} className={this.props.activeClass} src={this.props.edmSrc} height="460" width="100%" style={{
|
|
47
|
+
(<iframe id={this.props.id} className={this.props.activeClass} src={this.props.edmSrc} height="460" width="100%" style={{height: "calc(100vh - 180px)"}}></iframe>)
|
|
48
48
|
: 'aaasass'
|
|
49
49
|
);
|
|
50
50
|
}
|