@capillarytech/creatives-library 3.6.10 → 3.8.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/TemplatePreview/WechatRichmediaTemplatePreview/index.js +0 -1
- package/components/TemplatePreview/_templatePreview.scss +1 -1
- package/containers/Cap/index.js +11 -9
- package/containers/Cap/selectors.js +5 -3
- package/package.json +1 -1
- package/translations/en.json +3 -1
- package/translations/zh.json +3 -1
- package/v2Components/CapTagList/index.js +1 -1
- package/v2Containers/Assets/Gallery/index.js +2 -4
- package/v2Containers/CallTask/index.js +0 -1
- package/v2Containers/Cap/index.js +11 -9
- package/v2Containers/Cap/selectors.js +5 -3
- package/v2Containers/Facebook/index.js +1 -2
- package/v2Containers/LanguageProvider/index.js +18 -9
- package/v2Containers/LanguageProvider/sagas.js +0 -2
- package/v2Containers/Templates/index.js +2 -9
|
@@ -13,7 +13,6 @@ import _ from 'lodash';
|
|
|
13
13
|
import SlideBox from '../../SlideBox';
|
|
14
14
|
import './_wechatRichmediaTemplatePrev.scss';
|
|
15
15
|
import messages from './messages';
|
|
16
|
-
|
|
17
16
|
const wechatBody = require('./../assets/images/WECHAT_5x.png');
|
|
18
17
|
|
|
19
18
|
class WechatRichmediaTemplatePreview extends React.PureComponent { // eslint-disable-line react/prefer-stateless-function
|
package/containers/Cap/index.js
CHANGED
|
@@ -21,6 +21,7 @@ import * as appActions from '../App/actions';
|
|
|
21
21
|
import config from '../../config/app';
|
|
22
22
|
import Toastr from '../../components/Toastr';
|
|
23
23
|
import messages from './messages';
|
|
24
|
+
import { makeSelectLocale } from '../../v2Containers/LanguageProvider/selectors';
|
|
24
25
|
const gtm = window.dataLayer || [];
|
|
25
26
|
|
|
26
27
|
const CapWrapper = styled.div`
|
|
@@ -70,7 +71,6 @@ export class Cap extends React.Component { // eslint-disable-line react/prefer-s
|
|
|
70
71
|
}
|
|
71
72
|
locale = this.getMappedLocale(locale);
|
|
72
73
|
//locale = 'zh';
|
|
73
|
-
console.log('Setting final locale as', locale);
|
|
74
74
|
moment.locale(locale);
|
|
75
75
|
this.props.locationActions.changeLocale(locale);
|
|
76
76
|
}
|
|
@@ -273,6 +273,14 @@ export class Cap extends React.Component { // eslint-disable-line react/prefer-s
|
|
|
273
273
|
];
|
|
274
274
|
return (
|
|
275
275
|
<CapWrapper>
|
|
276
|
+
{ this.props.loader.localeLoading || this.props.Global.fetching_userdata ?
|
|
277
|
+
<div className="cap-loader-box">
|
|
278
|
+
<img
|
|
279
|
+
className="loader-image"
|
|
280
|
+
src="https://s3.amazonaws.com/fileservice.in/intouch_creative_assets/88561f46de9407021cad.gif"
|
|
281
|
+
alt="Capillary"/>
|
|
282
|
+
</div> : <>
|
|
283
|
+
|
|
276
284
|
<Helmet
|
|
277
285
|
titleTemplate="Capillary - %s"
|
|
278
286
|
defaultTitle={this.props.intl.formatMessage(messages.appName)}
|
|
@@ -307,14 +315,7 @@ export class Cap extends React.Component { // eslint-disable-line react/prefer-s
|
|
|
307
315
|
{(toastMessages && toastMessages.length > 0) ?
|
|
308
316
|
<Toastr timeout={4000} messagesList={toastMessages} position="top-right" handleRemoveMessage={this.handleRemoveMessage} />
|
|
309
317
|
: ''}
|
|
310
|
-
|
|
311
|
-
<div className="cap-loader-box">
|
|
312
|
-
<img
|
|
313
|
-
className="loader-image"
|
|
314
|
-
src="https://s3.amazonaws.com/fileservice.in/intouch_creative_assets/88561f46de9407021cad.gif"
|
|
315
|
-
alt="Capillary"/>
|
|
316
|
-
</div>
|
|
317
|
-
}
|
|
318
|
+
</> }
|
|
318
319
|
</CapWrapper>
|
|
319
320
|
);
|
|
320
321
|
}
|
|
@@ -334,6 +335,7 @@ Cap.propTypes = {
|
|
|
334
335
|
const mapStateToProps = createStructuredSelector({
|
|
335
336
|
Global: makeSelectAuthenticated(),
|
|
336
337
|
User: makeSelectUser(),
|
|
338
|
+
loader: makeSelectLocale(),
|
|
337
339
|
});
|
|
338
340
|
|
|
339
341
|
function mapDispatchToProps(dispatch) {
|
|
@@ -23,9 +23,11 @@ const setInjectedTags = () => createSelector(
|
|
|
23
23
|
(globalState) => {
|
|
24
24
|
let injectedTags = globalState.get('injectedTags') || {};
|
|
25
25
|
const metaEntities = globalState.get('metaEntities') || {};
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
const { tags } = metaEntities;
|
|
27
|
+
const customTags = tags && (tags.custom || {});
|
|
28
|
+
const extendedTags = tags && (tags.extended || {});
|
|
29
|
+
console.log("selector cap: ", injectedTags, customTags, metaEntities, extendedTags);
|
|
30
|
+
return (injectedTags = _.merge({}, injectedTags, customTags, extendedTags));
|
|
29
31
|
}
|
|
30
32
|
);
|
|
31
33
|
|
package/package.json
CHANGED
package/translations/en.json
CHANGED
|
@@ -1424,6 +1424,7 @@
|
|
|
1424
1424
|
"creatives.containersV2.richMedia.Create.authorCharacterCount": "Author exceeds character count limit by",
|
|
1425
1425
|
"creatives.containersV2.richMedia.Create.authorInductiveText": "Brand/name that your customer will recognise",
|
|
1426
1426
|
"creatives.containersV2.richMedia.Create.contentEmpty": "Cannot leave content field empty",
|
|
1427
|
+
"creatives.containersV2.richMedia.Create.coverAbstract": "Cover abstract",
|
|
1427
1428
|
"creatives.containersV2.richMedia.Create.coverAbstractCharacterCount": "Cover abstract exceeds character count limit by",
|
|
1428
1429
|
"creatives.containersV2.richMedia.Create.coverAbstractInductive": "A short description help customers learn more",
|
|
1429
1430
|
"creatives.containersV2.richMedia.Create.coverImageTitle": "The relevant image that complements title.",
|
|
@@ -1455,6 +1456,7 @@
|
|
|
1455
1456
|
"creatives.containersV2.richMedia.Create.sourceLinkEmpty": "Cannot leave source link field empty",
|
|
1456
1457
|
"creatives.containersV2.richMedia.Create.sufficientParam": "Please provide sufficient params to create richmedia wechat template",
|
|
1457
1458
|
"creatives.containersV2.richMedia.Create.sufficientPayload": "Please provide sufficient parameters to generate richmedia message payload",
|
|
1459
|
+
"creatives.containersV2.richMedia.Create.templateNameAlreadyExists": "Template name already exists",
|
|
1458
1460
|
"creatives.containersV2.richMedia.Create.templateNameBlank": "Template name cannot be blank",
|
|
1459
1461
|
"creatives.containersV2.richMedia.Create.templateNameContainsWS": "Template name contains only whitespaces",
|
|
1460
1462
|
"creatives.containersV2.richMedia.Create.templateNameExists": "Template with the same name exists. Please try another template name.",
|
|
@@ -1465,9 +1467,9 @@
|
|
|
1465
1467
|
"creatives.containersV2.richMedia.Create.uploadFailed": "Upload has failed",
|
|
1466
1468
|
"creatives.containersV2.richMedia.Create.uploadImage": "Upload Image",
|
|
1467
1469
|
"creatives.containersV2.richMedia.Create.visibility": "visibility",
|
|
1470
|
+
"creatives.containersV2.richMedia.Create.wechatTitle": "Title",
|
|
1468
1471
|
"creatives.containersV2.richMedia.Create.wrongFormatFile": "Wrong file upoaded. Please upload image file",
|
|
1469
1472
|
"creatives.containersV2.richMedia.Create.wrongUrl": "Enter correct URL",
|
|
1470
|
-
"creatives.containersV2.richMedia.Create.templateNameAlreadyExists": "Template name already exists",
|
|
1471
1473
|
"customdatepicker.cancel": "Cancel",
|
|
1472
1474
|
"customdatepicker.done": "Done",
|
|
1473
1475
|
"reon.components.Cap.Workbench": "WorkBench",
|
package/translations/zh.json
CHANGED
|
@@ -1424,6 +1424,7 @@
|
|
|
1424
1424
|
"creatives.containersV2.richMedia.Create.authorCharacterCount": "",
|
|
1425
1425
|
"creatives.containersV2.richMedia.Create.authorInductiveText": "",
|
|
1426
1426
|
"creatives.containersV2.richMedia.Create.contentEmpty": "",
|
|
1427
|
+
"creatives.containersV2.richMedia.Create.coverAbstract": "",
|
|
1427
1428
|
"creatives.containersV2.richMedia.Create.coverAbstractCharacterCount": "",
|
|
1428
1429
|
"creatives.containersV2.richMedia.Create.coverAbstractInductive": "",
|
|
1429
1430
|
"creatives.containersV2.richMedia.Create.coverImageTitle": "",
|
|
@@ -1455,6 +1456,7 @@
|
|
|
1455
1456
|
"creatives.containersV2.richMedia.Create.sourceLinkEmpty": "",
|
|
1456
1457
|
"creatives.containersV2.richMedia.Create.sufficientParam": "",
|
|
1457
1458
|
"creatives.containersV2.richMedia.Create.sufficientPayload": "",
|
|
1459
|
+
"creatives.containersV2.richMedia.Create.templateNameAlreadyExists": "",
|
|
1458
1460
|
"creatives.containersV2.richMedia.Create.templateNameBlank": "",
|
|
1459
1461
|
"creatives.containersV2.richMedia.Create.templateNameContainsWS": "",
|
|
1460
1462
|
"creatives.containersV2.richMedia.Create.templateNameExists": "",
|
|
@@ -1465,9 +1467,9 @@
|
|
|
1465
1467
|
"creatives.containersV2.richMedia.Create.uploadFailed": "",
|
|
1466
1468
|
"creatives.containersV2.richMedia.Create.uploadImage": "",
|
|
1467
1469
|
"creatives.containersV2.richMedia.Create.visibility": "",
|
|
1470
|
+
"creatives.containersV2.richMedia.Create.wechatTitle": "",
|
|
1468
1471
|
"creatives.containersV2.richMedia.Create.wrongFormatFile": "",
|
|
1469
1472
|
"creatives.containersV2.richMedia.Create.wrongUrl": "",
|
|
1470
|
-
"creatives.containersV2.richMedia.create.templateNameAlreadyExists": "",
|
|
1471
1473
|
"customdatepicker.cancel": "",
|
|
1472
1474
|
"customdatepicker.done": "",
|
|
1473
1475
|
"reon.components.Cap.Workbench": "",
|
|
@@ -148,7 +148,7 @@ class CapTagList extends React.Component { // eslint-disable-line react/prefer-s
|
|
|
148
148
|
</CapTreeNode>
|
|
149
149
|
));
|
|
150
150
|
} else if (searchString === '' || !searchString || val.name.toLowerCase().indexOf(searchString.toLowerCase()) !== -1) {
|
|
151
|
-
const tempNode = (<CapTreeNode title={val.name} tag={val} isLeaf key={val.couponSeriesId ? `${key}(${val.couponSeriesId})` : `${key}`}></CapTreeNode>);
|
|
151
|
+
const tempNode = (<CapTreeNode title={val.desc || val.name} tag={val} isLeaf key={val.couponSeriesId ? `${key}(${val.couponSeriesId})` : `${key}`}></CapTreeNode>);
|
|
152
152
|
list.push(tempNode);
|
|
153
153
|
}
|
|
154
154
|
});
|
|
@@ -251,7 +251,6 @@ export class Gallery extends React.Component { // eslint-disable-line react/pref
|
|
|
251
251
|
}
|
|
252
252
|
}
|
|
253
253
|
getIllustrationProps={
|
|
254
|
-
buttonClassName: 'upload-image-gallery',
|
|
255
254
|
buttonLabel: <FormattedMessage {...messages.upload} />,
|
|
256
255
|
onClick: (e) => this.openFileDialog(e),
|
|
257
256
|
illustrationImage: imageGalleryIllustration,
|
|
@@ -318,7 +317,6 @@ export class Gallery extends React.Component { // eslint-disable-line react/pref
|
|
|
318
317
|
title: <span title={template.name} >{template.name}</span>,
|
|
319
318
|
extra: [
|
|
320
319
|
<CapIcon
|
|
321
|
-
className="view-gallery"
|
|
322
320
|
style={{marginRight: '16px'}}
|
|
323
321
|
type="eye"
|
|
324
322
|
onClick={() => { this.openPreviewMode(template); }}
|
|
@@ -326,7 +324,7 @@ export class Gallery extends React.Component { // eslint-disable-line react/pref
|
|
|
326
324
|
<CapDropdown
|
|
327
325
|
overlay={
|
|
328
326
|
<CapMenu>
|
|
329
|
-
<CapMenu.Item
|
|
327
|
+
<CapMenu.Item onClick={() => this.deleteAsset(template)}>
|
|
330
328
|
<FormattedMessage {...messages.delete} />
|
|
331
329
|
</CapMenu.Item>
|
|
332
330
|
</CapMenu>
|
|
@@ -431,7 +429,7 @@ export class Gallery extends React.Component { // eslint-disable-line react/pref
|
|
|
431
429
|
<div style={{ textAlign: 'right', marginTop: '16px', width: '50%'}}>
|
|
432
430
|
<form encType="multipart/form-data" id="myForm">
|
|
433
431
|
<input style={{ display: 'none'}} id="fileName" type="file" onChange={(e) => this.uploadImages(e, {files: e.target.files})} accept="image/*" multiple/>
|
|
434
|
-
<CapButton
|
|
432
|
+
<CapButton type={this.props.location.query.type !== 'embedded' ? 'primary' : 'secondary'} onClick={(e) => this.openFileDialog(e)} style={{float: 'right'}}>
|
|
435
433
|
<FormattedMessage {...messages.upload} />
|
|
436
434
|
</CapButton>
|
|
437
435
|
</form>
|
|
@@ -63,7 +63,6 @@ export class CallTask extends React.Component { // eslint-disable-line react/pre
|
|
|
63
63
|
const templateIntlText = formatMessage(messages.template);
|
|
64
64
|
const templateText = isFullMode ? templateIntlText : '';
|
|
65
65
|
return {
|
|
66
|
-
buttonClassName: 'new-call-task-button',
|
|
67
66
|
buttonLabel: formatMessage(messages.newCallTaskTemplate, { templateText }),
|
|
68
67
|
onClick: showContentInSlidebox ? this.showNewCallTask : onCreateNew,
|
|
69
68
|
illustrationImage: calltaskIllustration,
|
|
@@ -20,7 +20,7 @@ import config from '../../config/app';
|
|
|
20
20
|
import NavigationBar from '../../v2Components/NavigationBar';
|
|
21
21
|
import { engagePlusPublicPath } from '../../config/path';
|
|
22
22
|
import { GTM_TRACKING_ID } from '../App/constants';
|
|
23
|
-
|
|
23
|
+
import { makeSelectLocale } from '../../v2Containers/LanguageProvider/selectors';
|
|
24
24
|
import {
|
|
25
25
|
HELP_URL,
|
|
26
26
|
ORG_SETTINGS_URL,
|
|
@@ -178,8 +178,16 @@ export class Cap extends React.Component { // eslint-disable-line react/prefer-s
|
|
|
178
178
|
const topbarMenuDataOptions = topbarMenuData && topbarMenuData.data ? topbarMenuData.data : [];
|
|
179
179
|
const type = this.props.location.query.type;
|
|
180
180
|
const toastMessages = this.props.Global.messages;
|
|
181
|
+
console.log('v2 locale loading', this.props.loader.localeLoading);
|
|
181
182
|
return (
|
|
182
183
|
<CapWrapper>
|
|
184
|
+
{ this.props.loader.localeLoading || this.props.Global.fetching_userdata ?
|
|
185
|
+
<div className="cap-loader-box">
|
|
186
|
+
<img
|
|
187
|
+
className="loader-image"
|
|
188
|
+
src="https://s3.amazonaws.com/fileservice.in/intouch_creative_assets/88561f46de9407021cad.gif"
|
|
189
|
+
alt="Capillary"/>
|
|
190
|
+
</div> : <>
|
|
183
191
|
<Helmet
|
|
184
192
|
titleTemplate="Capillary - %s"
|
|
185
193
|
defaultTitle={<FormattedMessage {...messages.appName} />}
|
|
@@ -216,14 +224,7 @@ export class Cap extends React.Component { // eslint-disable-line react/prefer-s
|
|
|
216
224
|
}
|
|
217
225
|
)
|
|
218
226
|
}
|
|
219
|
-
|
|
220
|
-
<div className="cap-loader-box">
|
|
221
|
-
<img
|
|
222
|
-
className="loader-image"
|
|
223
|
-
src="https://s3.amazonaws.com/fileservice.in/intouch_creative_assets/88561f46de9407021cad.gif"
|
|
224
|
-
alt="Capillary"/>
|
|
225
|
-
</div>
|
|
226
|
-
}
|
|
227
|
+
</> }
|
|
227
228
|
</CapWrapper>
|
|
228
229
|
);
|
|
229
230
|
}
|
|
@@ -242,6 +243,7 @@ Cap.propTypes = {
|
|
|
242
243
|
const mapStateToProps = createStructuredSelector({
|
|
243
244
|
Global: makeSelectAuthenticated(),
|
|
244
245
|
User: makeSelectUser(),
|
|
246
|
+
loader: makeSelectLocale(),
|
|
245
247
|
});
|
|
246
248
|
|
|
247
249
|
function mapDispatchToProps(dispatch) {
|
|
@@ -27,9 +27,11 @@ const setInjectedTags = () => createSelector(
|
|
|
27
27
|
(globalState) => {
|
|
28
28
|
let injectedTags = globalState.get('injectedTags') || {};
|
|
29
29
|
const metaEntities = globalState.get('metaEntities') || {};
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
const { tags } = metaEntities;
|
|
31
|
+
const customTags = tags && (tags.custom || {});
|
|
32
|
+
const extendedTags = tags && (tags.extended || {});
|
|
33
|
+
console.log("selector cap: ", injectedTags, customTags, metaEntities, extendedTags);
|
|
34
|
+
return (injectedTags = _.merge({}, injectedTags, customTags, extendedTags));
|
|
33
35
|
}
|
|
34
36
|
);
|
|
35
37
|
|
|
@@ -251,7 +251,7 @@ const Facebook = (props) => {
|
|
|
251
251
|
{!socialRemoteCampaignId && onChange && (
|
|
252
252
|
<CapButton
|
|
253
253
|
type="flat"
|
|
254
|
-
className="marketingObjective-change-button
|
|
254
|
+
className="marketingObjective-change-button"
|
|
255
255
|
onClick={onChange}
|
|
256
256
|
>
|
|
257
257
|
<FormattedMessage {...messages.fbChange} />
|
|
@@ -321,7 +321,6 @@ const Facebook = (props) => {
|
|
|
321
321
|
</div>
|
|
322
322
|
</div>
|
|
323
323
|
<CapButton
|
|
324
|
-
className="facebook-confirm-button"
|
|
325
324
|
type="primary"
|
|
326
325
|
onClick={() =>
|
|
327
326
|
onFacebookSubmit({ channel: "FACEBOOK", selectedMarketingObjective, accountId })
|
|
@@ -19,18 +19,16 @@ import moment from 'moment';
|
|
|
19
19
|
import { bindActionCreators } from 'redux';
|
|
20
20
|
import * as actions from './actions';
|
|
21
21
|
import { makeSelectLocale } from './selectors';
|
|
22
|
+
import { makeSelectUser } from '../Cap/selectors';
|
|
22
23
|
|
|
23
24
|
|
|
24
25
|
export class LanguageProvider extends React.PureComponent { // eslint-disable-line react/prefer-stateless-function
|
|
25
|
-
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
locale = JSON.parse(user).lang;
|
|
26
|
+
componentDidUpdate(prevProps) {
|
|
27
|
+
const prevUser = prevProps.user;
|
|
28
|
+
const user = this.props.user;
|
|
29
|
+
if (!prevUser && user) {
|
|
30
|
+
this.updateLocale();
|
|
31
31
|
}
|
|
32
|
-
locale = this.getMappedLocale(locale);
|
|
33
|
-
this.props.actions.getLocizMessage(locale);
|
|
34
32
|
}
|
|
35
33
|
/*global getMappedLocale */
|
|
36
34
|
getMappedLocale = (locale) => {
|
|
@@ -42,7 +40,16 @@ export class LanguageProvider extends React.PureComponent { // eslint-disable-li
|
|
|
42
40
|
};
|
|
43
41
|
return map[locale];
|
|
44
42
|
};
|
|
45
|
-
|
|
43
|
+
updateLocale() {
|
|
44
|
+
const user = localStorage.getItem('user');
|
|
45
|
+
let locale = localStorage.getItem('jlocale') || 'en';
|
|
46
|
+
moment.locale(locale);
|
|
47
|
+
if (user) {
|
|
48
|
+
locale = JSON.parse(user).lang;
|
|
49
|
+
}
|
|
50
|
+
locale = this.getMappedLocale(locale);
|
|
51
|
+
this.props.actions.getLocizMessage(locale);
|
|
52
|
+
}
|
|
46
53
|
render() {
|
|
47
54
|
const { locale, messages} = this.props.language;
|
|
48
55
|
const mappedLocale = {
|
|
@@ -67,11 +74,13 @@ LanguageProvider.propTypes = {
|
|
|
67
74
|
language: PropTypes.object,
|
|
68
75
|
actions: PropTypes.object,
|
|
69
76
|
children: PropTypes.element.isRequired,
|
|
77
|
+
user: PropTypes.object,
|
|
70
78
|
};
|
|
71
79
|
|
|
72
80
|
|
|
73
81
|
const mapStateToProps = createStructuredSelector({
|
|
74
82
|
language: makeSelectLocale(),
|
|
83
|
+
user: makeSelectUser(),
|
|
75
84
|
});
|
|
76
85
|
|
|
77
86
|
function mapDispatchToProps(dispatch) {
|
|
@@ -548,8 +548,6 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
548
548
|
}
|
|
549
549
|
getTemplateDataForGrid = ({templates, handlers, filterContent, channel, isLoading, loadingTip}) => {
|
|
550
550
|
const currentChannel = channel.toUpperCase();
|
|
551
|
-
const {channel: stateChannel} = this.state;
|
|
552
|
-
const channelLowerCase = stateChannel.toLowerCase();
|
|
553
551
|
let filteredTemplates = templates;
|
|
554
552
|
if (currentChannel === WECHAT) {
|
|
555
553
|
filteredTemplates = this.filterWechatTemplates(templates);
|
|
@@ -561,23 +559,21 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
561
559
|
title: <span title={template.name} >{template.name}</span>,
|
|
562
560
|
extra: [
|
|
563
561
|
<CapIcon
|
|
564
|
-
className={`view-${channelLowerCase}`}
|
|
565
562
|
style={{marginRight: '16px'}}
|
|
566
563
|
type="eye"
|
|
567
564
|
onClick={() => { if (this.props.isFullMode) { handlers.handlePreviewClick(template); } else { this.props.handlePeviewTemplate(template); } }}
|
|
568
565
|
/>,
|
|
569
566
|
],
|
|
570
|
-
hoverOption: <CapButton
|
|
567
|
+
hoverOption: <CapButton onClick={(e) => handlers.handleEditClick(e, template)}>{this.props.intl.formatMessage(this.props.isFullMode ? messages.creativesTemplatesEdit : messages.selectButton)}</CapButton>,
|
|
571
568
|
};
|
|
572
569
|
if (this.props.isFullMode) {
|
|
573
570
|
templateData.extra.push(<CapDropdown
|
|
574
571
|
overlay={
|
|
575
572
|
<CapMenu>
|
|
576
|
-
{this.state.channel.toUpperCase() !== WECHAT && <CapMenu.Item
|
|
573
|
+
{this.state.channel.toUpperCase() !== WECHAT && <CapMenu.Item onClick={() => this.duplicateTemplate(template)}>
|
|
577
574
|
<FormattedMessage {...messages.duplicateButton} />
|
|
578
575
|
</CapMenu.Item>}
|
|
579
576
|
<CapMenu.Item
|
|
580
|
-
className={this.state.channel.toUpperCase() === WECHAT && !template.definition ? `unmap-${channelLowerCase}` : `delete-${channelLowerCase}`}
|
|
581
577
|
onClick={() => this.deleteTemplate(template)}
|
|
582
578
|
>
|
|
583
579
|
{this.state.channel.toUpperCase() === WECHAT && !template.definition ? <FormattedMessage {...messages.unMapButton} /> : <FormattedMessage {...messages.deleteButton} />}
|
|
@@ -1664,7 +1660,6 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
1664
1660
|
// const isfilterContentVisisble = !isEmpty(this.props.TemplatesList) || !isEmpty(this.state.searchText) || !isEmpty(this.props.Templates.templateError);
|
|
1665
1661
|
const isfilterContentVisisble = true;
|
|
1666
1662
|
const isWechatEmbedded = !this.props.isFullMode && channel.toUpperCase() === WECHAT;
|
|
1667
|
-
const channelLowerCase = channel.toLowerCase();
|
|
1668
1663
|
const filterContent = (( isfilterContentVisisble || [WECHAT, MOBILE_PUSH].includes(this.state.channel.toUpperCase())) && <div className="action-container">
|
|
1669
1664
|
{isfilterContentVisisble && <CapInput.Search
|
|
1670
1665
|
className="search-text"
|
|
@@ -1688,10 +1683,8 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
1688
1683
|
</CapLabel></CapRadio.Button>
|
|
1689
1684
|
</CapRadio.CapRadioGroup>
|
|
1690
1685
|
}
|
|
1691
|
-
|
|
1692
1686
|
<div style={{display: "flex", justifyContent: "space-between", alignItems: 'center'}}>
|
|
1693
1687
|
{isfilterContentVisisble && !isWechatEmbedded && <CapButton
|
|
1694
|
-
className={`create-new-${channelLowerCase}`}
|
|
1695
1688
|
type={"primary"}
|
|
1696
1689
|
disabled={this.isCreateDisabled()}
|
|
1697
1690
|
style={{marginLeft: '8px'}}
|