@capillarytech/creatives-library 6.10.0 → 6.10.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/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 +2 -2
- 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 +1 -1
- package/v2Containers/TagList/index.js +13 -6
- package/v2Containers/Templates/actions.js +8 -3
- package/v2Containers/Templates/constants.js +6 -4
- package/v2Containers/Templates/index.js +36 -20
- package/v2Containers/Templates/messages.js +8 -0
- package/v2Containers/Templates/reducer.js +13 -5
- package/v2Containers/Templates/sagas.js +7 -7
- package/v2Containers/Templates/selectors.js +19 -1
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* Beeeditor
|
|
4
|
+
*
|
|
5
|
+
*/
|
|
6
|
+
import React, { useEffect, useState, useRef, useCallback } from 'react';
|
|
7
|
+
import PropTypes from 'prop-types';
|
|
8
|
+
import { injectIntl, intlShape, FormattedMessage } from 'react-intl';
|
|
9
|
+
import TagList from '../../v2Containers/TagList';
|
|
10
|
+
import
|
|
11
|
+
{
|
|
12
|
+
CapModal,
|
|
13
|
+
CapButton,
|
|
14
|
+
CapInput,
|
|
15
|
+
CapSelect,
|
|
16
|
+
}
|
|
17
|
+
from '@capillarytech/cap-ui-library';
|
|
18
|
+
import messages from './messages';
|
|
19
|
+
import './index.scss';
|
|
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 = [{key: 'cta', value: 'cta', label: formatMessage(messages.cta)},
|
|
44
|
+
{key: 'footer', value: 'footer', label: formatMessage(messages.footer)},
|
|
45
|
+
{key: 'header', value: 'header', label: formatMessage(messages.header)},
|
|
46
|
+
{key: 'sp', value: 'sp', label: formatMessage(messages.socialPlatform)},
|
|
47
|
+
{key: 'others', value: 'others', label: formatMessage(messages.others)},
|
|
48
|
+
];
|
|
49
|
+
const [visibleTaglist, setVisibleTaglist] = useState(false);
|
|
50
|
+
const [showRowMetaModal, setRowMetaModal] = useState(false);
|
|
51
|
+
const [selectedTag, setSelectedTag] = useState({});
|
|
52
|
+
const [rowMetaInfo, setRowMetaInfo] = useState({});
|
|
53
|
+
const [rowName, setRowName] = useState('');
|
|
54
|
+
const [rowCategory, setRowCategory] = useState('');
|
|
55
|
+
|
|
56
|
+
const savedCallback = useRef();
|
|
57
|
+
const filteredTags = (tags || []).filter((obj) => obj.definition.value !== UNSUBSCRIBE);
|
|
58
|
+
let intervalTimer;
|
|
59
|
+
|
|
60
|
+
useEffect(() => {
|
|
61
|
+
savedCallback.current = Object.keys(selectedTag).length > 0 ? selectedTag : rowMetaInfo;
|
|
62
|
+
}, [selectedTag, rowMetaInfo]);
|
|
63
|
+
|
|
64
|
+
useEffect(() => {
|
|
65
|
+
const beeConfig = {
|
|
66
|
+
uid,
|
|
67
|
+
container: 'bee-plugin-container',
|
|
68
|
+
rowsConfiguration: {
|
|
69
|
+
emptyRows: true,
|
|
70
|
+
defaultRows: true,
|
|
71
|
+
},
|
|
72
|
+
contentDialog: {
|
|
73
|
+
specialLinks: {
|
|
74
|
+
label: UNSUBSCRIBE,
|
|
75
|
+
handler(resolve) {
|
|
76
|
+
resolve({
|
|
77
|
+
type: 'custom',
|
|
78
|
+
label: UNSUBSCRIBE,
|
|
79
|
+
link: `{{${UNSUBSCRIBE}}}`,
|
|
80
|
+
});
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
mergeTags: {
|
|
84
|
+
label: formatMessage(messages.addLabel),
|
|
85
|
+
handler: async (resolve, reject) => {
|
|
86
|
+
// this will open tag modal
|
|
87
|
+
await setVisibleTaglist(true);
|
|
88
|
+
// until tag modal will not open promise will not execute
|
|
89
|
+
// once tag modal is opened it will start 2 sec interval to wait use has selected any tag or cancel the tag selection
|
|
90
|
+
const promise = new Promise((resolveP) => {
|
|
91
|
+
intervalTimer = setInterval(() => {
|
|
92
|
+
// this will execute, if user cancel the tag selection
|
|
93
|
+
if ((savedCallback.current || {}).close === true) {
|
|
94
|
+
reject();
|
|
95
|
+
clearInterval(intervalTimer);
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
// this block is checking use has selected any tag or not
|
|
99
|
+
if (Object.keys(savedCallback.current || {}).length > 0) {
|
|
100
|
+
resolveP(savedCallback.current);
|
|
101
|
+
setSelectedTag({});
|
|
102
|
+
clearInterval(intervalTimer);
|
|
103
|
+
}
|
|
104
|
+
}, 2000);
|
|
105
|
+
});
|
|
106
|
+
// once prmise will resolve , pass the resolve data to handler to show tags in bee edior
|
|
107
|
+
const result = await promise;
|
|
108
|
+
resolve(result);
|
|
109
|
+
},
|
|
110
|
+
},
|
|
111
|
+
saveRow: {
|
|
112
|
+
handler: async (resolve, reject) => {
|
|
113
|
+
await setRowMetaModal(true);
|
|
114
|
+
const promise = new Promise((resolveP) => {
|
|
115
|
+
intervalTimer = setInterval(() => {
|
|
116
|
+
if ((savedCallback.current || {}).close === true) {
|
|
117
|
+
reject();
|
|
118
|
+
clearInterval(intervalTimer);
|
|
119
|
+
setRowMetaInfo({});
|
|
120
|
+
setRowName('');
|
|
121
|
+
setRowCategory('');
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
if (Object.keys(savedCallback.current || {}).length > 0) {
|
|
125
|
+
resolveP(savedCallback.current);
|
|
126
|
+
}
|
|
127
|
+
}, 2000);
|
|
128
|
+
});
|
|
129
|
+
const result = await promise;
|
|
130
|
+
resolve(result); // "done!"
|
|
131
|
+
setRowMetaInfo({});
|
|
132
|
+
setRowName('');
|
|
133
|
+
setRowCategory('');
|
|
134
|
+
clearInterval(intervalTimer);
|
|
135
|
+
},
|
|
136
|
+
},
|
|
137
|
+
},
|
|
138
|
+
onSave: (jsonFile, htmlFile) => {
|
|
139
|
+
saveBeeData(jsonFile, htmlFile);
|
|
140
|
+
},
|
|
141
|
+
// will use this function on save row feature
|
|
142
|
+
onSaveRow: (rowJSON) => {
|
|
143
|
+
console.log('bee-plugin-container onSaveRows', rowJSON);
|
|
144
|
+
},
|
|
145
|
+
};
|
|
146
|
+
window.BeePlugin.create(tokenData, beeConfig, (instance) => {
|
|
147
|
+
beePluginInstance = instance;
|
|
148
|
+
const parseJson = JSON.parse(beeJson);
|
|
149
|
+
beePluginInstance.start(parseJson);
|
|
150
|
+
saveBeeInstance(beePluginInstance);
|
|
151
|
+
});
|
|
152
|
+
return () => clearInterval(intervalTimer);
|
|
153
|
+
}, []);
|
|
154
|
+
|
|
155
|
+
const onTagSelect = (result) => {
|
|
156
|
+
const msg = {
|
|
157
|
+
name: result,
|
|
158
|
+
value: `{{${result}}}`,
|
|
159
|
+
};
|
|
160
|
+
setSelectedTag(msg);
|
|
161
|
+
setVisibleTaglist(false);
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
const onCancelTagList = () => {
|
|
165
|
+
setVisibleTaglist(false);
|
|
166
|
+
setSelectedTag({close: true});
|
|
167
|
+
};
|
|
168
|
+
|
|
169
|
+
const handleCancel = () => {
|
|
170
|
+
setRowMetaModal(false);
|
|
171
|
+
setRowMetaInfo({close: true});
|
|
172
|
+
};
|
|
173
|
+
|
|
174
|
+
const handleOk = () => {
|
|
175
|
+
const rowInfo = {};
|
|
176
|
+
if (rowCategory !== '') {
|
|
177
|
+
rowInfo.category = rowCategory;
|
|
178
|
+
}
|
|
179
|
+
setRowMetaInfo({
|
|
180
|
+
name: rowName,
|
|
181
|
+
...rowInfo,
|
|
182
|
+
});
|
|
183
|
+
setRowMetaModal(false);
|
|
184
|
+
};
|
|
185
|
+
const isDisableSave = () => rowName === '';
|
|
186
|
+
|
|
187
|
+
const onRowChange = useCallback((e) => {
|
|
188
|
+
setRowName(e.target.value);
|
|
189
|
+
});
|
|
190
|
+
const onChangeCategoy = (e) => {
|
|
191
|
+
setRowCategory(e);
|
|
192
|
+
};
|
|
193
|
+
const contentSection = <>
|
|
194
|
+
<CapInput
|
|
195
|
+
label={<FormattedMessage {...messages.rowName} />}
|
|
196
|
+
placeholder={formatMessage(messages.rowPlaceHolder)}
|
|
197
|
+
onChange={onRowChange}
|
|
198
|
+
value={rowName}
|
|
199
|
+
maxLength={50}
|
|
200
|
+
style={{ width: '324px', paddingBottom: '16px' }}
|
|
201
|
+
/>
|
|
202
|
+
<CapSelect
|
|
203
|
+
label="Category"
|
|
204
|
+
style={{ width: 250, paddingBottom: '16px'}}
|
|
205
|
+
options={categoryOptions}
|
|
206
|
+
selectPlaceholder={formatMessage(messages.select)}
|
|
207
|
+
placeholder={
|
|
208
|
+
<FormattedMessage {...messages.selectCategoyPlaceholder} />
|
|
209
|
+
}
|
|
210
|
+
onChange={onChangeCategoy}
|
|
211
|
+
/>
|
|
212
|
+
|
|
213
|
+
</>;
|
|
214
|
+
return (
|
|
215
|
+
<>
|
|
216
|
+
<div id="bee-plugin-container" style={{ height: '500px'}}>
|
|
217
|
+
</div>
|
|
218
|
+
<TagList
|
|
219
|
+
moduleFilterEnabled={moduleFilterEnabled}
|
|
220
|
+
label={label}
|
|
221
|
+
onTagSelect={onTagSelect}
|
|
222
|
+
location={location}
|
|
223
|
+
tags={filteredTags}
|
|
224
|
+
injectedTags={injectedTags}
|
|
225
|
+
className={className}
|
|
226
|
+
id={id}
|
|
227
|
+
userLocale={userLocale}
|
|
228
|
+
selectedOfferDetails={selectedOfferDetails}
|
|
229
|
+
visibleTaglist={visibleTaglist}
|
|
230
|
+
hidePopover
|
|
231
|
+
modalProps={{
|
|
232
|
+
onCancel: onCancelTagList,
|
|
233
|
+
style: { left: 135, top: 250 },
|
|
234
|
+
className: "bee-editor-tag-list",
|
|
235
|
+
}}
|
|
236
|
+
onContextChange={onContextChange}
|
|
237
|
+
/>
|
|
238
|
+
<CapModal
|
|
239
|
+
visible={showRowMetaModal}
|
|
240
|
+
onCancel={handleCancel}
|
|
241
|
+
title={formatMessage(messages.customRows)}
|
|
242
|
+
footer={[
|
|
243
|
+
<CapButton key="back" onClick={handleCancel}>{formatMessage(messages.cancel)}</CapButton>,
|
|
244
|
+
<CapButton key="submit" type="primary" id="delete-version" onClick={handleOk} disabled={isDisableSave()}>
|
|
245
|
+
{formatMessage(messages.save)}
|
|
246
|
+
</CapButton>,
|
|
247
|
+
]}
|
|
248
|
+
>
|
|
249
|
+
{contentSection}
|
|
250
|
+
</CapModal>
|
|
251
|
+
</>
|
|
252
|
+
);
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
BeeEditor.propTypes = {
|
|
256
|
+
beeJson: PropTypes.object.isRequired,
|
|
257
|
+
tokenData: PropTypes.object.isRequired,
|
|
258
|
+
uid: PropTypes.string.isRequired,
|
|
259
|
+
showTagsPopover: PropTypes.func.isRequired,
|
|
260
|
+
intl: intlShape.isRequired,
|
|
261
|
+
};
|
|
262
|
+
|
|
263
|
+
export default injectIntl(BeeEditor);
|
|
@@ -0,0 +1,71 @@
|
|
|
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
|
+
addLabel: {
|
|
48
|
+
id: `${prefix}.addLabel`,
|
|
49
|
+
defaultMessage: 'Add label',
|
|
50
|
+
},
|
|
51
|
+
cta: {
|
|
52
|
+
id: `${prefix}.cta`,
|
|
53
|
+
defaultMessage: 'CTA',
|
|
54
|
+
},
|
|
55
|
+
header: {
|
|
56
|
+
id: `${prefix}.header`,
|
|
57
|
+
defaultMessage: 'Header',
|
|
58
|
+
},
|
|
59
|
+
footer: {
|
|
60
|
+
id: `${prefix}.footer`,
|
|
61
|
+
defaultMessage: 'Footer',
|
|
62
|
+
},
|
|
63
|
+
others: {
|
|
64
|
+
id: `${prefix}.others`,
|
|
65
|
+
defaultMessage: 'Others',
|
|
66
|
+
},
|
|
67
|
+
socialPlatform: {
|
|
68
|
+
id: `${prefix}.socialPlatform`,
|
|
69
|
+
defaultMessage: 'Social platform',
|
|
70
|
+
},
|
|
71
|
+
});
|
|
@@ -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
|
}
|