@capillarytech/creatives-library 6.13.8 → 6.14.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/app.js +2 -5
- package/components/FormBuilder/index.js +2 -6
- package/containers/Ebill/index.js +0 -3
- package/containers/Email/index.js +8 -16
- package/containers/Sms/Create/index.js +1 -2
- package/containers/Templates/index.js +3 -0
- package/index.js +1 -8
- package/package.json +2 -2
- package/reducers.js +0 -2
- package/routes.js +1 -7
- package/services/api.js +3 -7
- package/translations/en.json +107 -50
- package/translations/zh.json +107 -50
- package/v2Components/FormBuilder/index.js +11 -5
- package/v2Components/TemplatePreview/_templatePreview.scss +2 -8
- package/v2Components/TemplatePreview/index.js +18 -104
- package/v2Containers/App/constants.js +1 -1
- package/v2Containers/CreativesContainer/SlideBoxContent.js +4 -71
- package/v2Containers/CreativesContainer/constants.js +0 -2
- package/v2Containers/CreativesContainer/index.js +3 -31
- package/v2Containers/Email/actions.js +1 -2
- package/v2Containers/Email/index.js +29 -45
- package/v2Containers/Email/sagas.js +2 -2
- package/v2Containers/EmailWrapper/index.js +0 -2
- package/v2Containers/Templates/_templates.scss +0 -57
- package/v2Containers/Templates/index.js +6 -59
- package/v2Containers/TemplatesV2/index.js +7 -14
- package/v2Containers/TemplatesV2/messages.js +0 -4
- package/v2Containers/WeChat/MapTemplates/index.js +1 -1
- package/assets/viber.png +0 -0
- package/utils/ignoredErrorMessages.js +0 -4
- package/v2Containers/Viber/_viber.scss +0 -3
- package/v2Containers/Viber/actions.js +0 -74
- package/v2Containers/Viber/constants.js +0 -30
- package/v2Containers/Viber/index.js +0 -707
- package/v2Containers/Viber/messages.js +0 -137
- package/v2Containers/Viber/reducer.js +0 -84
- package/v2Containers/Viber/sagas.js +0 -107
- package/v2Containers/Viber/selectors.js +0 -21
|
@@ -2,7 +2,6 @@ import React from 'react';
|
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import styled from 'styled-components';
|
|
4
4
|
import get from 'lodash/get';
|
|
5
|
-
import cloneDeep from 'lodash/cloneDeep';
|
|
6
5
|
import TemplatesV2 from '../TemplatesV2';
|
|
7
6
|
import TemplatePreview from '../../v2Components/TemplatePreview';
|
|
8
7
|
import SmsCreate from '../Sms/Create';
|
|
@@ -19,7 +18,6 @@ import CallTask from '../CallTask';
|
|
|
19
18
|
import MobliPushEdit from '../MobilePush/Edit';
|
|
20
19
|
import * as constants from './constants';
|
|
21
20
|
import LineContainer from '../Line/Container';
|
|
22
|
-
import Viber from '../Viber';
|
|
23
21
|
const CreativesWrapper = styled.div`
|
|
24
22
|
.ant-popover,
|
|
25
23
|
.ant-notification,
|
|
@@ -34,6 +32,7 @@ function getWechatTemplateType(mode, templateData, weChatTemplateType = '') {
|
|
|
34
32
|
}
|
|
35
33
|
return weChatTemplateType;
|
|
36
34
|
}
|
|
35
|
+
|
|
37
36
|
const getLineType = ({
|
|
38
37
|
slidBoxContent,
|
|
39
38
|
channel,
|
|
@@ -70,23 +69,7 @@ const getLineType = ({
|
|
|
70
69
|
}
|
|
71
70
|
}
|
|
72
71
|
return {};
|
|
73
|
-
}
|
|
74
|
-
const getViber = ({
|
|
75
|
-
slidBoxContent,
|
|
76
|
-
channel,
|
|
77
|
-
isFullMode,
|
|
78
|
-
templateData,
|
|
79
|
-
}) => {
|
|
80
|
-
if ((channel === constants.VIBER || (slidBoxContent === 'editTemplate' && templateData && templateData.type === constants.VIBER)) && slidBoxContent !== 'templates') {
|
|
81
|
-
const isCreate = slidBoxContent === 'createTemplate';
|
|
82
|
-
const isEdit = slidBoxContent === 'editTemplate';
|
|
83
|
-
return {
|
|
84
|
-
isCreate,
|
|
85
|
-
isEdit,
|
|
86
|
-
};
|
|
87
|
-
}
|
|
88
|
-
return {};
|
|
89
|
-
};
|
|
72
|
+
}
|
|
90
73
|
|
|
91
74
|
function SlideBoxContent(props) {
|
|
92
75
|
const {
|
|
@@ -113,7 +96,6 @@ function SlideBoxContent(props) {
|
|
|
113
96
|
cap,
|
|
114
97
|
onResetStep,
|
|
115
98
|
isFullMode,
|
|
116
|
-
editor,
|
|
117
99
|
onCallTaskSubmit,
|
|
118
100
|
setIsLoadingContent,
|
|
119
101
|
showTemplateName,
|
|
@@ -152,15 +134,6 @@ function SlideBoxContent(props) {
|
|
|
152
134
|
isFullMode,
|
|
153
135
|
templateData,
|
|
154
136
|
});
|
|
155
|
-
const {isCreate: isCreateViber = false,
|
|
156
|
-
isEdit: isEditViber = false } = getViber({
|
|
157
|
-
slidBoxContent,
|
|
158
|
-
channel,
|
|
159
|
-
isFullMode,
|
|
160
|
-
templateData,
|
|
161
|
-
});
|
|
162
|
-
|
|
163
|
-
|
|
164
137
|
const isCreateSms = slidBoxContent === 'createTemplate' && channel === constants.SMS;
|
|
165
138
|
const isCreateMPush = slidBoxContent === 'createTemplate' && channel === constants.MOBILE_PUSH;
|
|
166
139
|
const isCreateCallTask = slidBoxContent === 'createTemplate' && channel === constants.CALL_TASK;
|
|
@@ -182,7 +155,7 @@ function SlideBoxContent(props) {
|
|
|
182
155
|
isEditEmailWithId = slidBoxContent === 'editTemplate' && channel === constants.EMAIL && templateData._id;
|
|
183
156
|
isEmailEditWithContent = slidBoxContent === 'editTemplate' && channel === constants.EMAIL && !templateData._id;
|
|
184
157
|
isEditFacebook = slidBoxContent === 'editTemplate' && channel === constants.FACEBOOK;
|
|
185
|
-
isPreview = slidBoxContent === 'preview' && (channel === constants.SMS || channel === constants.LINE
|
|
158
|
+
isPreview = slidBoxContent === 'preview' && (channel === constants.SMS || channel === constants.LINE);
|
|
186
159
|
isEmailPreview = slidBoxContent === 'preview' && channel === constants.EMAIL;
|
|
187
160
|
isMpushPreview = slidBoxContent === 'preview' && channel === constants.MOBILE_PUSH;
|
|
188
161
|
}
|
|
@@ -211,7 +184,7 @@ function SlideBoxContent(props) {
|
|
|
211
184
|
} = {},
|
|
212
185
|
template,
|
|
213
186
|
}) => {
|
|
214
|
-
|
|
187
|
+
let previewContent = {};
|
|
215
188
|
previewContent.messageContent = text;
|
|
216
189
|
previewContent.previewImageUrl = previewImageUrl;
|
|
217
190
|
previewContent.selectedSticker = selectedSticker || {
|
|
@@ -249,16 +222,6 @@ function SlideBoxContent(props) {
|
|
|
249
222
|
return previewContent;
|
|
250
223
|
});
|
|
251
224
|
}
|
|
252
|
-
case constants.VIBER: {
|
|
253
|
-
const template = cloneDeep(templateDataObject);
|
|
254
|
-
const { text = "", imageURL = "", buttonText = "" } = get(template, 'versions.base.content.viber', {});
|
|
255
|
-
template.content = {
|
|
256
|
-
messageContent: text,
|
|
257
|
-
imageURL,
|
|
258
|
-
buttonText,
|
|
259
|
-
};
|
|
260
|
-
return template.content;
|
|
261
|
-
}
|
|
262
225
|
default:
|
|
263
226
|
return get(templateDataObject, `versions.base.content`);
|
|
264
227
|
}
|
|
@@ -403,7 +366,6 @@ function SlideBoxContent(props) {
|
|
|
403
366
|
step={templateStep}
|
|
404
367
|
showNextStep={onCreateNextStep}
|
|
405
368
|
isFullMode={isFullMode}
|
|
406
|
-
editor={editor}
|
|
407
369
|
cap={cap}
|
|
408
370
|
onResetStep={onResetStep}
|
|
409
371
|
showTemplateName={showTemplateName}
|
|
@@ -430,7 +392,6 @@ function SlideBoxContent(props) {
|
|
|
430
392
|
getFormSubscriptionData={getFormData}
|
|
431
393
|
getDefaultTags={type}
|
|
432
394
|
isFullMode={isFullMode}
|
|
433
|
-
editor={editor}
|
|
434
395
|
cap={cap}
|
|
435
396
|
showTemplateName={showTemplateName}
|
|
436
397
|
onValidationFail={onValidationFail}
|
|
@@ -495,7 +456,6 @@ function SlideBoxContent(props) {
|
|
|
495
456
|
messageDetails={messageDetails}
|
|
496
457
|
cap={cap}
|
|
497
458
|
onFacebookSubmit={onFacebookSubmit}
|
|
498
|
-
isFullMode={isFullMode}
|
|
499
459
|
/>
|
|
500
460
|
)
|
|
501
461
|
}
|
|
@@ -536,33 +496,6 @@ function SlideBoxContent(props) {
|
|
|
536
496
|
/>
|
|
537
497
|
)
|
|
538
498
|
}
|
|
539
|
-
{isCreateViber && (
|
|
540
|
-
<Viber
|
|
541
|
-
location={creativesLocationProps}
|
|
542
|
-
onCreateComplete={onCreateComplete}
|
|
543
|
-
isFullMode={isFullMode}
|
|
544
|
-
handleClose={handleClose}
|
|
545
|
-
isGetFormData={isGetFormData}
|
|
546
|
-
getFormSubscriptionData={getFormData}
|
|
547
|
-
onShowTemplates={onShowTemplates}
|
|
548
|
-
templateData={templateData}
|
|
549
|
-
createNew/>
|
|
550
|
-
)}
|
|
551
|
-
|
|
552
|
-
{isEditViber && <Viber
|
|
553
|
-
location={creativesLocationProps}
|
|
554
|
-
params={{
|
|
555
|
-
id: templateData._id,
|
|
556
|
-
}}
|
|
557
|
-
onCreateComplete={onCreateComplete}
|
|
558
|
-
isFullMode={isFullMode}
|
|
559
|
-
handleClose={handleClose}
|
|
560
|
-
isGetFormData={isGetFormData}
|
|
561
|
-
getFormSubscriptionData={getFormData}
|
|
562
|
-
onShowTemplates={onShowTemplates}
|
|
563
|
-
templateData={templateData}
|
|
564
|
-
createNew/> }
|
|
565
|
-
|
|
566
499
|
</CreativesWrapper>
|
|
567
500
|
);
|
|
568
501
|
}
|
|
@@ -13,7 +13,5 @@ export const CALL_TASK = "CALL_TASK";
|
|
|
13
13
|
export const MOBILE_PUSH = "MOBILEPUSH";
|
|
14
14
|
export const WECHAT = "WECHAT";
|
|
15
15
|
export const FACEBOOK = "FACEBOOK";
|
|
16
|
-
export const VIBER = "VIBER";
|
|
17
|
-
|
|
18
16
|
export const SHOW_CONTANER_LOADER = "app/CreativesContainer/SHOW_CONTANER_LOADER";
|
|
19
17
|
export const HIDE_CONTAINER_LOADER = "app/CreativesContainer/HIDE_CONTAINER_LOADER";
|
|
@@ -247,24 +247,6 @@ class Creatives extends React.Component {
|
|
|
247
247
|
};
|
|
248
248
|
break;
|
|
249
249
|
}
|
|
250
|
-
case constants.VIBER: {
|
|
251
|
-
const { messageBody, isDefault } = templateData;
|
|
252
|
-
const viberContent = JSON.parse(messageBody || '{}').messages || [{}];
|
|
253
|
-
creativesTemplateData = {
|
|
254
|
-
type: constants.VIBER,
|
|
255
|
-
isDefault,
|
|
256
|
-
edit: true,
|
|
257
|
-
name: "",
|
|
258
|
-
versions: {
|
|
259
|
-
base: {
|
|
260
|
-
content: {
|
|
261
|
-
viber: viberContent,
|
|
262
|
-
},
|
|
263
|
-
},
|
|
264
|
-
},
|
|
265
|
-
};
|
|
266
|
-
break;
|
|
267
|
-
}
|
|
268
250
|
default:
|
|
269
251
|
break;
|
|
270
252
|
}
|
|
@@ -350,15 +332,6 @@ class Creatives extends React.Component {
|
|
|
350
332
|
};
|
|
351
333
|
}
|
|
352
334
|
break;
|
|
353
|
-
case constants.VIBER:
|
|
354
|
-
if (template.value) {
|
|
355
|
-
const { versions } = template.value;
|
|
356
|
-
templateData = {
|
|
357
|
-
channel,
|
|
358
|
-
messageBody: JSON.stringify(versions.base.content),
|
|
359
|
-
};
|
|
360
|
-
}
|
|
361
|
-
break;
|
|
362
335
|
default:
|
|
363
336
|
break;
|
|
364
337
|
}
|
|
@@ -473,8 +446,8 @@ class Creatives extends React.Component {
|
|
|
473
446
|
}
|
|
474
447
|
}
|
|
475
448
|
|
|
476
|
-
const
|
|
477
|
-
if (
|
|
449
|
+
const isLineChannel = templateData && templateData.type === constants.LINE;
|
|
450
|
+
if (channel === constants.LINE || isLineChannel) {
|
|
478
451
|
showFooter = false;
|
|
479
452
|
}
|
|
480
453
|
|
|
@@ -560,7 +533,7 @@ class Creatives extends React.Component {
|
|
|
560
533
|
}
|
|
561
534
|
render() {
|
|
562
535
|
const {slidBoxContent, isGetFormData, showSlideBox, templateData, currentChannel, emailCreateMode, templateStep, isLoadingContent, mobilePushCreateMode, isDiscardMessage, weChatTemplateType, weChatMaptemplateStep} = this.state;
|
|
563
|
-
const {isFullMode, creativesMode, cap, isUploading, channelsToHide, selectedWeChatAccount, forwardedTags, channelsToDisable, selectedOfferDetails, onTestContentClicked, onPreviewContentClicked, getCreativesData, fetchingCmsData
|
|
536
|
+
const {isFullMode, creativesMode, cap, isUploading, channelsToHide, selectedWeChatAccount, forwardedTags, channelsToDisable, selectedOfferDetails, onTestContentClicked, onPreviewContentClicked, getCreativesData, fetchingCmsData} = this.props;
|
|
564
537
|
const mapTemplateCreate = slidBoxContent === 'createTemplate' && weChatTemplateType === MAP_TEMPLATE && templateStep !== 'modeSelection';
|
|
565
538
|
/* TODO: Instead of passing down same props separately to each component down, write common function to these props and pass it accordingly */
|
|
566
539
|
return (
|
|
@@ -633,7 +606,6 @@ class Creatives extends React.Component {
|
|
|
633
606
|
selectedAccount={this.props.selectedAccount}
|
|
634
607
|
onShowTemplates={this.onShowTemplates}
|
|
635
608
|
handleClose={this.handleCloseSlideBox}
|
|
636
|
-
editor={editor}
|
|
637
609
|
/>
|
|
638
610
|
}
|
|
639
611
|
footer={this.shouldShowFooter() &&
|
|
@@ -38,7 +38,7 @@ export function getAllAssets(assetType, queryParams) {
|
|
|
38
38
|
};
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
export function getCmsSetting(cmsType, projectId, cmsMode, langId, isEdmSupport
|
|
41
|
+
export function getCmsSetting(cmsType, projectId, cmsMode, langId, isEdmSupport) {
|
|
42
42
|
return {
|
|
43
43
|
type: types.GET_CMS_EDITOR_DETAILS_REQUEST,
|
|
44
44
|
cmsType,
|
|
@@ -46,7 +46,6 @@ export function getCmsSetting(cmsType, projectId, cmsMode, langId, isEdmSupport,
|
|
|
46
46
|
cmsMode,
|
|
47
47
|
langId,
|
|
48
48
|
isEdmSupport,
|
|
49
|
-
isBEEAppEnable,
|
|
50
49
|
};
|
|
51
50
|
}
|
|
52
51
|
|
|
@@ -183,15 +183,15 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
183
183
|
this.props.templatesActions.resetTemplateData();
|
|
184
184
|
}
|
|
185
185
|
const isBEESupport = (this.props.location.query.isBEESupport !== "false") || false;
|
|
186
|
-
|
|
187
|
-
if (!_.isEmpty(this.props.Templates.BEETemplate)) {
|
|
188
|
-
if (this.props.Templates.BEETemplate.versions.base.is_drag_drop
|
|
186
|
+
|
|
187
|
+
if (!_.isEmpty(this.props.Templates.BEETemplate) ) {
|
|
188
|
+
if (this.props.Templates.BEETemplate.versions.base.is_drag_drop) {
|
|
189
189
|
this.setState({isDragDrop: true});
|
|
190
190
|
}
|
|
191
191
|
if (this.props.params.id) {
|
|
192
|
-
this.props.actions.getCmsSetting(BEE_PLUGIN, this.props.Templates.BEETemplate._id, 'open', undefined, isBEESupport
|
|
192
|
+
this.props.actions.getCmsSetting(BEE_PLUGIN, this.props.Templates.BEETemplate._id, 'open', undefined, isBEESupport);
|
|
193
193
|
} else if (this.props.location.query.module !== "library" || (this.props.location.query.module === "library" && !this.props.templateData)) {
|
|
194
|
-
this.props.actions.getCmsSetting(BEE_PLUGIN, this.props.Templates.BEETemplate._id, 'create', undefined, isBEESupport
|
|
194
|
+
this.props.actions.getCmsSetting(BEE_PLUGIN, this.props.Templates.BEETemplate._id, 'create', undefined, isBEESupport);
|
|
195
195
|
}
|
|
196
196
|
}
|
|
197
197
|
this.setState({ content: (this.props.Templates.selectedEmailLayout ? this.props.Templates.selectedEmailLayout : ''), formData});
|
|
@@ -214,15 +214,6 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
214
214
|
this.showNext();
|
|
215
215
|
}
|
|
216
216
|
}
|
|
217
|
-
|
|
218
|
-
checkBeeEditorAllowedForLibrary = () => {
|
|
219
|
-
const { isFullMode = false, editor } = this.props || {};
|
|
220
|
-
if (editor === "BEE" && !isFullMode) {
|
|
221
|
-
return true;
|
|
222
|
-
}
|
|
223
|
-
return false;
|
|
224
|
-
}
|
|
225
|
-
|
|
226
217
|
componentWillReceiveProps(nextProps) {
|
|
227
218
|
// if (this.props.location.query.type === 'embedded') {
|
|
228
219
|
// this.showNext();
|
|
@@ -324,9 +315,8 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
324
315
|
if (nextProps.location.query.module === 'library' && nextProps.isGetFormData) {
|
|
325
316
|
const formData = this.state.formData;
|
|
326
317
|
let isBeeEditor = false;
|
|
327
|
-
const isBEEEnable = this.checkBeeEditorAllowedForLibrary();
|
|
328
318
|
_.forEach(formData[0].selectedLanguages, (language) => {
|
|
329
|
-
if (formData[0][language].is_drag_drop
|
|
319
|
+
if (formData[0][language].is_drag_drop) {
|
|
330
320
|
isBeeEditor = true;
|
|
331
321
|
}
|
|
332
322
|
});
|
|
@@ -359,7 +349,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
359
349
|
const temp = (schema.containers || {})[this.state.currentTab - 1];
|
|
360
350
|
|
|
361
351
|
const { currentTab } = this.state;
|
|
362
|
-
if (nextProps.Email.CmsSettings.isDragDrop
|
|
352
|
+
if (nextProps.Email.CmsSettings.isDragDrop) {
|
|
363
353
|
const beeJson = `BEEeditor${currentTab > 1 ? currentTab : ''}json`;
|
|
364
354
|
const beeToken = `BEEeditor${currentTab > 1 ? currentTab : ''}token`;
|
|
365
355
|
let beeJsonValue = _.get(nextProps, 'Templates.BEETemplate.versions.base.json-content', '');
|
|
@@ -419,8 +409,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
419
409
|
}
|
|
420
410
|
|
|
421
411
|
this.setState({ formData }, () => {
|
|
422
|
-
|
|
423
|
-
this.hideEdmOptions(isDragDrop);
|
|
412
|
+
this.hideEdmOptions(nextProps.Email.CmsSettings.isDragDrop);
|
|
424
413
|
});
|
|
425
414
|
}
|
|
426
415
|
if (nextProps.Email.createTemplateError && !_.isEqual(nextProps.Email.createTemplateError, this.props.Email.createTemplateError)) {
|
|
@@ -480,7 +469,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
480
469
|
if ( !_.isEqual(nextProps.Email.uploadAssetSuccess, this.props.Email.uploadAssetSuccess) && nextProps.Email.uploadAssetSuccess) {
|
|
481
470
|
const isDragDrop = this.state.formData[`${this.state.currentTab - 1}`][this.state.formData[`${this.state.currentTab - 1}`].activeTab].is_drag_drop;
|
|
482
471
|
const isBEESupport = (this.props.location.query.isBEESupport !== "false") || false;
|
|
483
|
-
if (isDragDrop && isBEESupport
|
|
472
|
+
if (isDragDrop && isBEESupport) {
|
|
484
473
|
const evtData = JSON.parse(this.edmEvent.data);
|
|
485
474
|
if (evtData.action === 'editBackground') {
|
|
486
475
|
this.edmEvent.source.postMessage(JSON.stringify({
|
|
@@ -526,8 +515,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
526
515
|
}
|
|
527
516
|
if (!_.isEmpty(nextProps.Email.templateDetails) && _.isEmpty(this.props.Email.templateDetails) ) {
|
|
528
517
|
const base = nextProps.Email.templateDetails.versions.base;
|
|
529
|
-
|
|
530
|
-
if (activeBase && activeBase.is_drag_drop && this.checkBeeEditorAllowedForLibrary()) {
|
|
518
|
+
if (nextProps.Email.templateDetails.versions.base[base.activeTab].is_drag_drop) {
|
|
531
519
|
this.setState({isDragDrop: true});
|
|
532
520
|
}
|
|
533
521
|
}
|
|
@@ -592,7 +580,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
592
580
|
//this.resetCkEditorInstance(data, formData);
|
|
593
581
|
const schema = _.cloneDeep(this.state.schema);
|
|
594
582
|
const container = schema.containers[`${data - 1}`];
|
|
595
|
-
if (formData[`${data - 1}`][formData[`${data - 1}`].activeTab].is_drag_drop
|
|
583
|
+
if (formData[`${data - 1}`][formData[`${data - 1}`].activeTab].is_drag_drop) {
|
|
596
584
|
container.tabBarExtraContent.sections[0].inputFields[0].cols[4].content.sections[0].inputFields[3].cols[0].style = {display: ""};
|
|
597
585
|
container.tabBarExtraContent.sections[0].inputFields[0].cols[2].style.display = "none";
|
|
598
586
|
} else {
|
|
@@ -617,7 +605,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
617
605
|
const formData = _.cloneDeep(this.state.formData);
|
|
618
606
|
const isBEESupport = (this.props.location.query.isBEESupport !== "false") || false;
|
|
619
607
|
|
|
620
|
-
if (isDragDrop && isBEESupport
|
|
608
|
+
if (isDragDrop && isBEESupport) {
|
|
621
609
|
let msg = {};
|
|
622
610
|
if (data === "unsubscribe") {
|
|
623
611
|
const anchor = `<a href='{{${data}}}'>${data}</a>`;
|
|
@@ -660,9 +648,9 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
660
648
|
const base = formData.base || {};
|
|
661
649
|
const isDragDrop = _.get(base[base.activeTab], 'is_drag_drop');
|
|
662
650
|
let editorType = '';
|
|
663
|
-
if ( isDragDrop === true
|
|
651
|
+
if ( isDragDrop === true) {
|
|
664
652
|
editorType = 'edmEditor';
|
|
665
|
-
} else if (isDragDrop === false
|
|
653
|
+
} else if (isDragDrop === false) {
|
|
666
654
|
editorType = 'ckEditor';
|
|
667
655
|
}
|
|
668
656
|
GA.timeTracker.stopTimer(isEdit ? TRACK_EDIT_EMAIL : TRACK_CREATE_EMAIL, {
|
|
@@ -717,7 +705,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
717
705
|
_.forEach(formData, (val, index) => {
|
|
718
706
|
if (!isNaN(index)) {
|
|
719
707
|
_.forEach(val.selectedLanguages, (language) => {
|
|
720
|
-
if (val[language].is_drag_drop
|
|
708
|
+
if (val[language].is_drag_drop) {
|
|
721
709
|
that.props.actions.getCmsData(BEE_PLUGIN, id, language);
|
|
722
710
|
}
|
|
723
711
|
});
|
|
@@ -918,7 +906,6 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
918
906
|
if (this.props.isFullMode) {
|
|
919
907
|
this.props.showTemplateName({formData, onFormDataChange: this.onFormDataChange});
|
|
920
908
|
}
|
|
921
|
-
const isBEEAppEnable = this.checkBeeEditorAllowedForLibrary();
|
|
922
909
|
_.forEach((editData.versions.base.selectedLanguages), (language) => {
|
|
923
910
|
// if (formData[this.state.currentTab - 1].tabKey === formData[this.state.currentTab - 1][language].tabKey) {
|
|
924
911
|
// formData[this.state.currentTab - 1].activeTab = language;
|
|
@@ -926,8 +913,8 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
926
913
|
// if (formData.base.tabKey === formData.base[language].tabKey) {
|
|
927
914
|
// formData.base.activeTab = language;
|
|
928
915
|
// }
|
|
929
|
-
if (language && editData.versions.base[language].is_drag_drop
|
|
930
|
-
this.props.actions.getCmsSetting(BEE_PLUGIN, editData._id, 'open', language, isBEESupport
|
|
916
|
+
if (language && editData.versions.base[language].is_drag_drop) {
|
|
917
|
+
this.props.actions.getCmsSetting(BEE_PLUGIN, editData._id, 'open', language, isBEESupport);
|
|
931
918
|
}
|
|
932
919
|
});
|
|
933
920
|
|
|
@@ -1010,12 +997,11 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
1010
997
|
}
|
|
1011
998
|
saveValidationData = () => {
|
|
1012
999
|
let saveCount = 0;
|
|
1013
|
-
const isBeeEnable = this.checkBeeEditorAllowedForLibrary();
|
|
1014
1000
|
this.setState({saveEdmDataMode: 'validation', saveCount: 0, cmsDataCount: 0}, () => {
|
|
1015
1001
|
_.forEach(this.state.formData, (newdata, index) => {
|
|
1016
1002
|
if (!isNaN(index)) {
|
|
1017
1003
|
_.forEach(newdata.selectedLanguages, (language) => {
|
|
1018
|
-
if (newdata[language].is_drag_drop &&
|
|
1004
|
+
if (newdata[language].is_drag_drop && ((parseInt(index, 10) + 1) === this.state.currentTab)) {
|
|
1019
1005
|
saveCount += 1;
|
|
1020
1006
|
}
|
|
1021
1007
|
});
|
|
@@ -1132,14 +1118,14 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
1132
1118
|
|
|
1133
1119
|
copyPrimaryLanguage = () => {
|
|
1134
1120
|
const isEdmSupport = (this.props.location.query.isEdmSupport !== "false") || false;
|
|
1135
|
-
|
|
1121
|
+
|
|
1136
1122
|
this.setState({addLanguageType: "copyPrimaryLanguage"}, () => {
|
|
1137
1123
|
this.setState({showModal: false});
|
|
1138
1124
|
const formData = _.cloneDeep(this.state.formData);
|
|
1139
1125
|
const currentTab = this.state.currentTab - 1;
|
|
1140
1126
|
const baseLanguage = this.props.currentOrgDetails.basic_details.base_language ? this.props.currentOrgDetails.basic_details.base_language : 'en';
|
|
1141
|
-
if (formData[currentTab][baseLanguage].is_drag_drop
|
|
1142
|
-
this.props.actions.getCmsSetting(BEE_PLUGIN, formData[currentTab][baseLanguage].drag_drop_id, 'duplicate', baseLanguage, isEdmSupport
|
|
1127
|
+
if (formData[currentTab][baseLanguage].is_drag_drop) {
|
|
1128
|
+
this.props.actions.getCmsSetting(BEE_PLUGIN, formData[currentTab][baseLanguage].drag_drop_id, 'duplicate', baseLanguage, isEdmSupport);
|
|
1143
1129
|
}
|
|
1144
1130
|
});
|
|
1145
1131
|
}
|
|
@@ -1517,7 +1503,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
1517
1503
|
const data = _.find(this.props.Email.assetList, {_id: id});
|
|
1518
1504
|
|
|
1519
1505
|
if (data) {
|
|
1520
|
-
if (isDragDrop && isEdmSupport
|
|
1506
|
+
if (isDragDrop && isEdmSupport) {
|
|
1521
1507
|
const evtData = JSON.parse(this.edmEvent.data);
|
|
1522
1508
|
if (evtData.action === 'editBackground') {
|
|
1523
1509
|
this.edmEvent.source.postMessage(JSON.stringify({
|
|
@@ -1552,7 +1538,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
1552
1538
|
|
|
1553
1539
|
toggleEmailPreview = () => {
|
|
1554
1540
|
const isDragDrop = this.state.formData[`${this.state.currentTab - 1}`][this.state.formData[`${this.state.currentTab - 1}`].activeTab].is_drag_drop;
|
|
1555
|
-
if (isDragDrop && !this.state.showEmailPreview
|
|
1541
|
+
if (isDragDrop && !this.state.showEmailPreview) {
|
|
1556
1542
|
this.handleEdmSave();
|
|
1557
1543
|
this.setState({mode: "preview", gettingPreviewData: true});
|
|
1558
1544
|
} else if (this.state.showEmailPreview) {
|
|
@@ -2131,10 +2117,9 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
2131
2117
|
"language": this.supportedLanguages[languageIndex].language,
|
|
2132
2118
|
"template-content": templates.html_content,
|
|
2133
2119
|
};
|
|
2134
|
-
|
|
2135
|
-
if (templates.drag_drop_id && isBEEAppEnable) {
|
|
2120
|
+
if (templates.drag_drop_id) {
|
|
2136
2121
|
tempData.drag_drop_id = templates.drag_drop_id;
|
|
2137
|
-
this.props.actions.getCmsSetting(BEE_PLUGIN, tempData._id, 'open', tempData.iso_code, isEdmSupport
|
|
2122
|
+
this.props.actions.getCmsSetting(BEE_PLUGIN, tempData._id, 'open', tempData.iso_code, isEdmSupport);
|
|
2138
2123
|
}
|
|
2139
2124
|
// formData.usingTabContainer = true;
|
|
2140
2125
|
// formData.tabCount = 1;
|
|
@@ -2158,10 +2143,9 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
2158
2143
|
|
|
2159
2144
|
this.setState({formData, loading: false, injectedTags: data.tags, tabKey, isDragDrop: (data.base.is_drag_drop !== 0 )}, () => {
|
|
2160
2145
|
// this.setState({tabKey: ''});
|
|
2161
|
-
const isBEEEnable = this.checkBeeEditorAllowedForLibrary();
|
|
2162
2146
|
_.forEach(formData[0].selectedLanguages, (language) => {
|
|
2163
|
-
if (formData[0][language].is_drag_drop
|
|
2164
|
-
this.props.actions.getCmsSetting(BEE_PLUGIN, formData[0][language].drag_drop_id, 'open', language, isEdmSupport
|
|
2147
|
+
if (formData[0][language].is_drag_drop) {
|
|
2148
|
+
this.props.actions.getCmsSetting(BEE_PLUGIN, formData[0][language].drag_drop_id, 'open', language, isEdmSupport);
|
|
2165
2149
|
}
|
|
2166
2150
|
});
|
|
2167
2151
|
});
|
|
@@ -2498,8 +2482,8 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
2498
2482
|
// const isEdmSupport = (this.props.location.query.isEdmSupport) ? this.props.location.query.isEdmSupport : true;
|
|
2499
2483
|
// let getQuery = '';
|
|
2500
2484
|
const isEdmSupport = (this.props.location.query.isEdmSupport !== "false") || false;
|
|
2501
|
-
|
|
2502
|
-
this.props.actions.getCmsSetting(BEE_PLUGIN, data._id, 'create', this.state.formData[this.state.currentTab - 1].activeTab, isEdmSupport
|
|
2485
|
+
|
|
2486
|
+
this.props.actions.getCmsSetting(BEE_PLUGIN, data._id, 'create', this.state.formData[this.state.currentTab - 1].activeTab, isEdmSupport);
|
|
2503
2487
|
// this.props.templatesActions.setEdmTemplate(data);
|
|
2504
2488
|
this.toggleEdmEmailTemplateSelection();
|
|
2505
2489
|
// if (type && type.toLowerCase() === 'email') {
|
|
@@ -51,9 +51,9 @@ export function* getAllAssets(assetType, queryParams) {
|
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
export function* getCmsSetting({cmsType, projectId, cmsMode, langId, isEdmSupport
|
|
54
|
+
export function* getCmsSetting({cmsType, projectId, cmsMode, langId, isEdmSupport}) {
|
|
55
55
|
try {
|
|
56
|
-
const result = yield call(Api.getCmsTemplateSettingsV2, cmsType, projectId, cmsMode, langId, isEdmSupport
|
|
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) {
|
|
@@ -196,7 +196,6 @@ export class EmailWrapper extends React.Component { // eslint-disable-line react
|
|
|
196
196
|
onPreviewContentClicked,
|
|
197
197
|
onTestContentClicked,
|
|
198
198
|
cmsTemplatesLoader,
|
|
199
|
-
editor,
|
|
200
199
|
} = this.props;
|
|
201
200
|
const {
|
|
202
201
|
templateName,
|
|
@@ -260,7 +259,6 @@ export class EmailWrapper extends React.Component { // eslint-disable-line react
|
|
|
260
259
|
selectedOfferDetails={selectedOfferDetails}
|
|
261
260
|
onPreviewContentClicked={onPreviewContentClicked}
|
|
262
261
|
onTestContentClicked={onTestContentClicked}
|
|
263
|
-
editor={editor}
|
|
264
262
|
/>}
|
|
265
263
|
{!isShowEmailCreate && (
|
|
266
264
|
<CmsTemplatesComponent
|
|
@@ -46,63 +46,6 @@
|
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
|
-
.VIBER {
|
|
50
|
-
&.cap-custom-card{
|
|
51
|
-
height: 241px;
|
|
52
|
-
.ant-card-body {
|
|
53
|
-
padding:0px 24px 0px;
|
|
54
|
-
.button-content {
|
|
55
|
-
.ant-card-meta-description {
|
|
56
|
-
min-width: 108px;
|
|
57
|
-
max-width: 160px;
|
|
58
|
-
height: 24px;
|
|
59
|
-
padding: 1px 23px 2px 22px;
|
|
60
|
-
border-radius: 16px;
|
|
61
|
-
font-size: 14px;
|
|
62
|
-
font-weight: 500;
|
|
63
|
-
background-color:$CAP_PURPLE01;
|
|
64
|
-
color:$CAP_WHITE;
|
|
65
|
-
text-align:center;
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
.truncate-text-viber{
|
|
69
|
-
.ant-card-meta-description{
|
|
70
|
-
display: -webkit-box;
|
|
71
|
-
-webkit-line-clamp: 9;
|
|
72
|
-
-webkit-box-orient: vertical;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
.truncate-text-with-button{
|
|
76
|
-
.ant-card-meta-description{
|
|
77
|
-
-webkit-line-clamp: 8;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
.truncate-text-with-image{
|
|
81
|
-
.ant-card-meta-description{
|
|
82
|
-
-webkit-line-clamp: 2;
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
&.no-image .ant-card-meta {
|
|
89
|
-
.ant-card-meta-description {
|
|
90
|
-
word-wrap: break-word;
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
&.carousel-img-section {
|
|
96
|
-
.ant-card-body {
|
|
97
|
-
padding: $CAP_SPACE_24 0;
|
|
98
|
-
}
|
|
99
|
-
.ant-card-meta {
|
|
100
|
-
padding: 0;
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
}
|
|
106
49
|
}
|
|
107
50
|
}
|
|
108
51
|
|