@capillarytech/creatives-library 7.17.92 → 7.17.93
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/containers/Ebill/index.js +0 -1
- package/containers/MobilePush/Edit/index.js +0 -1
- package/index.js +0 -6
- package/package.json +1 -1
- package/routes.js +0 -5
- package/services/api.js +0 -5
- package/v2Components/CapImageUpload/index.js +3 -10
- package/v2Components/CapImageUpload/messages.js +0 -4
- package/v2Components/FormBuilder/index.js +4 -3
- package/v2Components/MobilePushPreviewV2/index.js +23 -81
- package/v2Components/TemplatePreview/_templatePreview.scss +0 -448
- package/v2Components/TemplatePreview/index.js +375 -660
- package/v2Components/TemplatePreview/messages.js +0 -4
- package/v2Containers/App/constants.js +0 -1
- package/v2Containers/CreativesContainer/SlideBoxContent.js +0 -43
- package/v2Containers/CreativesContainer/SlideBoxHeader.js +1 -4
- package/v2Containers/CreativesContainer/constants.js +0 -1
- package/v2Containers/CreativesContainer/index.js +27 -94
- package/v2Containers/CreativesContainer/messages.js +0 -4
- package/v2Containers/MobilePush/Edit/index.js +1 -3
- package/v2Containers/Templates/_templates.scss +0 -10
- package/v2Containers/Templates/index.js +23 -103
- package/v2Containers/Templates/messages.js +0 -20
- package/v2Containers/TemplatesV2/index.js +2 -8
- package/v2Containers/TemplatesV2/messages.js +0 -4
- package/v2Components/CapDeviceContent/index.js +0 -338
- package/v2Components/CapDeviceContent/index.scss +0 -115
- package/v2Components/CapDeviceContent/messages.js +0 -107
- package/v2Components/CapDeviceContent/tests/index.test.js +0 -75
- package/v2Components/CapInAppCTA/constants.js +0 -25
- package/v2Components/CapInAppCTA/index.js +0 -281
- package/v2Components/CapInAppCTA/index.scss +0 -93
- package/v2Components/CapInAppCTA/messages.js +0 -85
- package/v2Components/TemplatePreview/assets/images/inapp_mobile_android_bottom.svg +0 -11
- package/v2Components/TemplatePreview/assets/images/inapp_mobile_android_full.svg +0 -11
- package/v2Components/TemplatePreview/assets/images/inapp_mobile_android_modal.svg +0 -11
- package/v2Components/TemplatePreview/assets/images/inapp_mobile_android_top.svg +0 -11
- package/v2Components/TemplatePreview/assets/images/inapp_mobile_ios_bottom.svg +0 -6
- package/v2Components/TemplatePreview/assets/images/inapp_mobile_ios_full.svg +0 -18
- package/v2Components/TemplatePreview/assets/images/inapp_mobile_ios_modal.svg +0 -7
- package/v2Components/TemplatePreview/assets/images/inapp_mobile_ios_top.svg +0 -13
- package/v2Containers/InApp/actions.js +0 -64
- package/v2Containers/InApp/constants.js +0 -95
- package/v2Containers/InApp/index.js +0 -745
- package/v2Containers/InApp/index.scss +0 -47
- package/v2Containers/InApp/messages.js +0 -86
- package/v2Containers/InApp/reducer.js +0 -109
- package/v2Containers/InApp/sagas.js +0 -143
- package/v2Containers/InApp/selectors.js +0 -12
- package/v2Containers/InApp/tests/action.test.js +0 -53
- package/v2Containers/InApp/tests/index.test.js +0 -152
- package/v2Containers/InApp/tests/mockData.js +0 -897
- package/v2Containers/InApp/tests/reducer.test.js +0 -177
- package/v2Containers/InApp/tests/sagas.test.js +0 -391
|
@@ -86,8 +86,4 @@ export default defineMessages({
|
|
|
86
86
|
id: 'creatives.componentsV2.TemplatePreview.previewUrlMetaImage',
|
|
87
87
|
defaultMessage: 'Preview url meta image',
|
|
88
88
|
},
|
|
89
|
-
addToCart: {
|
|
90
|
-
id: `creatives.componentsV2.TemplatePreview.addToCart`,
|
|
91
|
-
defaultMessage: 'Add to cart',
|
|
92
|
-
},
|
|
93
89
|
});
|
|
@@ -22,7 +22,6 @@ import LineContainer from '../Line/Container';
|
|
|
22
22
|
import FTP from '../FTP';
|
|
23
23
|
import Viber from '../Viber';
|
|
24
24
|
import Whatsapp from '../Whatsapp';
|
|
25
|
-
import InApp from '../InApp';
|
|
26
25
|
import Rcs from '../Rcs';
|
|
27
26
|
import { getWhatsappContent } from '../Whatsapp/utils';
|
|
28
27
|
import * as commonUtil from '../../utils/common';
|
|
@@ -183,7 +182,6 @@ export function SlideBoxContent(props) {
|
|
|
183
182
|
const isCreateSms = isCreate && channel === constants.SMS;
|
|
184
183
|
const isCreateFacebook = isCreate && channel === constants.FACEBOOK;
|
|
185
184
|
const isCreateWhatsapp = isCreate && channel === constants.WHATSAPP;
|
|
186
|
-
const isCreateInApp = isCreate && channel === constants.INAPP;
|
|
187
185
|
const isCreateRcs = isCreate && channel === constants.RCS;
|
|
188
186
|
const isCreateMPush = isCreate && channel === constants.MOBILE_PUSH;
|
|
189
187
|
const isCreateCallTask = isCreate && channel === constants.CALL_TASK;
|
|
@@ -193,13 +191,11 @@ export function SlideBoxContent(props) {
|
|
|
193
191
|
let isPreview = false;
|
|
194
192
|
let isEmailPreview = false;
|
|
195
193
|
let isMpushPreview = false;
|
|
196
|
-
let isInappPreview = false;
|
|
197
194
|
let isEditCallTask = false;
|
|
198
195
|
let isEditMPush = false;
|
|
199
196
|
let isEditFacebook = false;
|
|
200
197
|
let isEditFTP = false;
|
|
201
198
|
let isEditWhatsapp = false;
|
|
202
|
-
let isEditInApp = false;
|
|
203
199
|
let isEditRcs = false;
|
|
204
200
|
let isEditZalo = false;
|
|
205
201
|
const isEmailCreate = isCreate && channel === constants.EMAIL;
|
|
@@ -216,10 +212,8 @@ export function SlideBoxContent(props) {
|
|
|
216
212
|
isPreview = slidBoxContent === 'preview' && [constants.SMS, constants.LINE, constants.WHATSAPP, constants.FACEBOOK, constants.VIBER, constants.RCS].includes(channel);
|
|
217
213
|
isEmailPreview = slidBoxContent === 'preview' && channel === constants.EMAIL;
|
|
218
214
|
isMpushPreview = slidBoxContent === 'preview' && channel === constants.MOBILE_PUSH;
|
|
219
|
-
isInappPreview = slidBoxContent === 'preview' && channel === constants.INAPP;
|
|
220
215
|
isEditFTP = isEdit && [constants.NO_COMMUNICATION, constants.FTP].includes(channel);
|
|
221
216
|
isEditZalo = isEdit && channel?.toUpperCase() === constants.ZALO;
|
|
222
|
-
isEditInApp = isEdit && channel === constants.INAPP;
|
|
223
217
|
}
|
|
224
218
|
const isDltEnabled = commonUtil.isTraiDLTEnable(isFullMode, smsRegister);
|
|
225
219
|
const hasJPLocaleHideFeatureEnabled = commonUtil?.hasJPLocaleHideFeatureEnabled();
|
|
@@ -444,13 +438,6 @@ export function SlideBoxContent(props) {
|
|
|
444
438
|
/>
|
|
445
439
|
)
|
|
446
440
|
}
|
|
447
|
-
{isInappPreview && (
|
|
448
|
-
<MobilePushPreview
|
|
449
|
-
templateData={templateData}
|
|
450
|
-
channel={channel}
|
|
451
|
-
forwardedTags={forwardedTags}
|
|
452
|
-
/>
|
|
453
|
-
)}
|
|
454
441
|
{isMpushPreview && (
|
|
455
442
|
<MobilePushPreview
|
|
456
443
|
templateData={templateData}
|
|
@@ -799,36 +786,6 @@ export function SlideBoxContent(props) {
|
|
|
799
786
|
}}/>
|
|
800
787
|
)}
|
|
801
788
|
|
|
802
|
-
{isCreateInApp && (<InApp
|
|
803
|
-
isFullMode={isFullMode}
|
|
804
|
-
onCreateComplete={onCreateComplete}
|
|
805
|
-
handleClose={handleClose}
|
|
806
|
-
location={{
|
|
807
|
-
pathname: `/inapp/create`,
|
|
808
|
-
query,
|
|
809
|
-
search: '',
|
|
810
|
-
}}
|
|
811
|
-
/>
|
|
812
|
-
)}
|
|
813
|
-
|
|
814
|
-
{isEditInApp && (<InApp
|
|
815
|
-
isFullMode={isFullMode}
|
|
816
|
-
templateData={templateData}
|
|
817
|
-
getFormData={getFormData}
|
|
818
|
-
getDefaultTags={type}
|
|
819
|
-
forwardedTags={forwardedTags}
|
|
820
|
-
onCreateComplete={onCreateComplete}
|
|
821
|
-
selectedOfferDetails={selectedOfferDetails}
|
|
822
|
-
params={{
|
|
823
|
-
id: templateData._id,
|
|
824
|
-
}}
|
|
825
|
-
location={{
|
|
826
|
-
pathname: `/inapp/edit`,
|
|
827
|
-
query,
|
|
828
|
-
search: '',
|
|
829
|
-
}} />
|
|
830
|
-
)}
|
|
831
|
-
|
|
832
789
|
{isCreateRcs && (<Rcs
|
|
833
790
|
{...rcsCommonProps}
|
|
834
791
|
location={{
|
|
@@ -11,7 +11,7 @@ import whatsppMsg from '../Whatsapp/messages';
|
|
|
11
11
|
import { LANGUAGE_OPTIONS } from '../Whatsapp/constants';
|
|
12
12
|
import globalMessages from '../Cap/messages';
|
|
13
13
|
import { MAP_TEMPLATE } from '../WeChat/Wrapper/constants';
|
|
14
|
-
import { NO_COMMUNICATION, FTP, WHATSAPP, RCS, ZALO
|
|
14
|
+
import { NO_COMMUNICATION, FTP, WHATSAPP, RCS, ZALO } from '../App/constants';
|
|
15
15
|
import { isTraiDLTEnable } from '../../utils/common';
|
|
16
16
|
import { formatString } from '../../utils/Formatter';
|
|
17
17
|
import {
|
|
@@ -39,9 +39,7 @@ export function SlideBoxHeader(props) {
|
|
|
39
39
|
const isTraiDlt = isTraiDLTEnable(isFullMode, smsRegister);
|
|
40
40
|
const showCreateTraiSMSHeader = isTraiDlt && channel.toLowerCase() === "sms";
|
|
41
41
|
const isWhatsappEdit = channel.toLowerCase() === WHATSAPP && slidBoxContent === 'editTemplate';
|
|
42
|
-
const isInAppEdit = channel.toLowerCase() === INAPP && slidBoxContent === 'editTemplate';
|
|
43
42
|
const isWhatsappCreate = channel.toLowerCase() === WHATSAPP && slidBoxContent === 'createTemplate';
|
|
44
|
-
const isInAppCreate = channel.toLowerCase() === INAPP && slidBoxContent === 'createTemplate';
|
|
45
43
|
const isZaloEdit = channel.toLowerCase() === ZALO && slidBoxContent === 'editTemplate';
|
|
46
44
|
const zaloOverview = isZaloEdit && isFullMode;
|
|
47
45
|
const whatsappOverview = isWhatsappEdit && isFullMode;
|
|
@@ -62,7 +60,6 @@ export function SlideBoxHeader(props) {
|
|
|
62
60
|
sms: <FormattedMessage {...messages.smsHeader} />,
|
|
63
61
|
email: <FormattedMessage {...messages.emailHeader} />,
|
|
64
62
|
mobilepush: <FormattedMessage {...messages.pushNotificationHeader} />,
|
|
65
|
-
inapp: <FormattedMessage {...messages.inAppHeader} />,
|
|
66
63
|
wechat: <FormattedMessage {...messages.wechat} />,
|
|
67
64
|
line: <FormattedMessage {...messages.lineHeader} />,
|
|
68
65
|
no_communication: <FormattedMessage {...messages.noCommunication} />,
|
|
@@ -40,7 +40,6 @@ import { LOYALTY } from '../App/constants';
|
|
|
40
40
|
import { WHATSAPP_STATUSES, WHATSAPP_MEDIA_TYPES } from '../Whatsapp/constants';
|
|
41
41
|
|
|
42
42
|
import { updateImagesInHtml } from '../../utils/cdnTransformation';
|
|
43
|
-
import { IOS } from '../InApp/constants';
|
|
44
43
|
|
|
45
44
|
const classPrefix = 'add-creatives-section';
|
|
46
45
|
const CREATIVES_CONTAINER = 'creativesContainer';
|
|
@@ -84,7 +83,7 @@ export class Creatives extends React.Component {
|
|
|
84
83
|
|
|
85
84
|
componentDidMount() {
|
|
86
85
|
GA.timeTracker.startTimer(CREATIVES_CONTAINER);
|
|
87
|
-
if
|
|
86
|
+
if(!this.props?.isFullMode){
|
|
88
87
|
this.props?.templateActions.getCdnTransformationConfig();
|
|
89
88
|
}
|
|
90
89
|
}
|
|
@@ -156,7 +155,7 @@ export class Creatives extends React.Component {
|
|
|
156
155
|
this.setState((prevState) => {
|
|
157
156
|
let templateStep = prevState.templateStep + 1;
|
|
158
157
|
const {emailCreateMode, currentChannel} = prevState;
|
|
159
|
-
if ((currentChannel.toUpperCase() === constants.EMAIL && emailCreateMode === "upload") || currentChannel.toUpperCase() === constants.MOBILE_PUSH || currentChannel.toUpperCase() === constants.WECHAT
|
|
158
|
+
if ((currentChannel.toUpperCase() === constants.EMAIL && emailCreateMode === "upload") || currentChannel.toUpperCase() === constants.MOBILE_PUSH || currentChannel.toUpperCase() === constants.WECHAT) {
|
|
160
159
|
templateStep = prevState.templateStep + 2;
|
|
161
160
|
}
|
|
162
161
|
return {
|
|
@@ -169,9 +168,6 @@ export class Creatives extends React.Component {
|
|
|
169
168
|
this.setState({ emailCreateMode: mode});
|
|
170
169
|
}
|
|
171
170
|
|
|
172
|
-
onInAppModeChange = (mode) => {
|
|
173
|
-
this.setState({ inAppCreateMode: mode});
|
|
174
|
-
}
|
|
175
171
|
|
|
176
172
|
onMobilepushModeChange = (mode) => {
|
|
177
173
|
this.setState({ mobilePushCreateMode: mode});
|
|
@@ -195,7 +191,6 @@ export class Creatives extends React.Component {
|
|
|
195
191
|
this.setState({ isGetFormData: false });
|
|
196
192
|
};
|
|
197
193
|
getTemplateData = (templateData) => { //from consumers to creatives
|
|
198
|
-
console.log('in getTemplateData', templateData, this.props);
|
|
199
194
|
const { isFullMode, messageDetails = {}, smsRegister } = this.props;
|
|
200
195
|
const { additionalProperties = {} } = messageDetails;
|
|
201
196
|
if (!isFullMode && templateData) { // for component mode
|
|
@@ -271,23 +266,21 @@ export class Creatives extends React.Component {
|
|
|
271
266
|
};
|
|
272
267
|
break;
|
|
273
268
|
}
|
|
274
|
-
case constants.MOBILE_PUSH:
|
|
275
|
-
|
|
276
|
-
{
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
ANDROID: templateData.androidContent,
|
|
284
|
-
IOS: templateData.iosContent,
|
|
285
|
-
},
|
|
269
|
+
case constants.MOBILE_PUSH: {
|
|
270
|
+
const mode = get(templateData, 'androidContent.type') || get(templateData, 'iosContent.type') || '';
|
|
271
|
+
creativesTemplateData = {
|
|
272
|
+
type: channel,
|
|
273
|
+
name: templateData.messageSubject,
|
|
274
|
+
versions: {
|
|
275
|
+
base: {
|
|
276
|
+
ANDROID: templateData.androidContent,
|
|
277
|
+
IOS: templateData.iosContent,
|
|
286
278
|
},
|
|
287
|
-
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
|
|
279
|
+
},
|
|
280
|
+
definition: {accountId: templateData.accountId, mode: mode.toLowerCase()},
|
|
281
|
+
};
|
|
282
|
+
break;
|
|
283
|
+
}
|
|
291
284
|
case constants.WECHAT: {
|
|
292
285
|
const messageBody = JSON.parse(templateData.messageBody);
|
|
293
286
|
creativesTemplateData = {
|
|
@@ -533,7 +526,6 @@ export class Creatives extends React.Component {
|
|
|
533
526
|
|
|
534
527
|
getCreativesData = async (channel, template, templateRecords) => { //from creatives to consumers
|
|
535
528
|
let templateData = { channel };
|
|
536
|
-
console.log('in getCreativesData', channel, template);
|
|
537
529
|
switch (channel) {
|
|
538
530
|
case constants.SMS:
|
|
539
531
|
if (template?.value?.base) {
|
|
@@ -621,50 +613,6 @@ export class Creatives extends React.Component {
|
|
|
621
613
|
templateData.messageSubject = mobilpushTemplate.name ? mobilpushTemplate.name : "messageSubject";
|
|
622
614
|
}
|
|
623
615
|
break;
|
|
624
|
-
case constants.INAPP:
|
|
625
|
-
if (get(template, "value.versions.base")) {
|
|
626
|
-
const inAppTemplate = template.value;
|
|
627
|
-
templateData.accountId = get(inAppTemplate, 'definition.accountId');
|
|
628
|
-
const type = (get(this.props, "messageDetails.type") || '').toLowerCase();
|
|
629
|
-
if (type === LOYALTY) {
|
|
630
|
-
templateData.licenseCode = get(inAppTemplate, 'definition.licenseCode');
|
|
631
|
-
templateData.templateId = get(inAppTemplate, '_id');
|
|
632
|
-
}
|
|
633
|
-
const androidContent = get(inAppTemplate, 'versions.base.ANDROID');
|
|
634
|
-
if (!isEmpty(androidContent)) {
|
|
635
|
-
if (type !== LOYALTY) {
|
|
636
|
-
delete androidContent.cuid;
|
|
637
|
-
delete androidContent.luid;
|
|
638
|
-
delete androidContent.communicationId;
|
|
639
|
-
}
|
|
640
|
-
const custom = {};
|
|
641
|
-
forEach(androidContent.custom, (customKeyValue) => {
|
|
642
|
-
custom[customKeyValue.key] = customKeyValue.value;
|
|
643
|
-
});
|
|
644
|
-
androidContent.custom = custom;
|
|
645
|
-
templateData.androidContent = androidContent;
|
|
646
|
-
templateData.androidContent.type = get(inAppTemplate, 'definition.mode', '').toUpperCase();
|
|
647
|
-
templateData.androidContent.deviceType = 'ANDROID';
|
|
648
|
-
}
|
|
649
|
-
const iosContent = get(inAppTemplate, 'versions.base.IOS');
|
|
650
|
-
if (!isEmpty(iosContent)) {
|
|
651
|
-
if (type !== LOYALTY) {
|
|
652
|
-
delete iosContent.cuid;
|
|
653
|
-
delete iosContent.luid;
|
|
654
|
-
delete iosContent.communicationId;
|
|
655
|
-
}
|
|
656
|
-
const custom = {};
|
|
657
|
-
forEach(iosContent.custom, (customKeyValue) => {
|
|
658
|
-
custom[customKeyValue.key] = customKeyValue.value;
|
|
659
|
-
});
|
|
660
|
-
iosContent.custom = custom;
|
|
661
|
-
templateData.iosContent = iosContent;
|
|
662
|
-
templateData.iosContent.type = get(inAppTemplate, 'definition.mode').toUpperCase();
|
|
663
|
-
templateData.iosContent.deviceType = IOS.toUpperCase();
|
|
664
|
-
}
|
|
665
|
-
templateData.messageSubject = inAppTemplate?.name ? inAppTemplate?.name : "messageSubject";
|
|
666
|
-
}
|
|
667
|
-
break;
|
|
668
616
|
case constants.WECHAT:
|
|
669
617
|
if (template.value) {
|
|
670
618
|
const { accountId, previewContent, ...messageBody } = template.value;
|
|
@@ -761,10 +709,10 @@ export class Creatives extends React.Component {
|
|
|
761
709
|
header,
|
|
762
710
|
footer,
|
|
763
711
|
headerVarMapped,
|
|
764
|
-
headerTemplate
|
|
712
|
+
headerTemplate
|
|
765
713
|
};
|
|
766
714
|
const {
|
|
767
|
-
whatsappDocName = '', whatsappDocSize, whatsappDocPages, whatsappDocImg = ''
|
|
715
|
+
whatsappDocName = '', whatsappDocSize, whatsappDocPages, whatsappDocImg = ''
|
|
768
716
|
} = whatsappDocParams;
|
|
769
717
|
switch (mediaType) {
|
|
770
718
|
case (WHATSAPP_MEDIA_TYPES.IMAGE):
|
|
@@ -894,7 +842,6 @@ export class Creatives extends React.Component {
|
|
|
894
842
|
default:
|
|
895
843
|
break;
|
|
896
844
|
}
|
|
897
|
-
console.log('in getCreativesData templateData', templateData);
|
|
898
845
|
return templateData;
|
|
899
846
|
};
|
|
900
847
|
getSlideBoxContent({mode, templateData, isFullMode}) {
|
|
@@ -957,13 +904,6 @@ export class Creatives extends React.Component {
|
|
|
957
904
|
imageAdded: androidType === 'IMAGE' || iosType === 'IMAGE',
|
|
958
905
|
};
|
|
959
906
|
break;
|
|
960
|
-
case constants.INAPP:
|
|
961
|
-
gtmDetails = {
|
|
962
|
-
...gtmDetails,
|
|
963
|
-
content: `${androidTitle} ${androidMessage} ${iosTitle} ${iosMessage}`,
|
|
964
|
-
imageAdded: androidType === IMAGE || iosType === IMAGE,
|
|
965
|
-
};
|
|
966
|
-
break;
|
|
967
907
|
case constants.LINE:
|
|
968
908
|
gtmDetails = Object.assign({
|
|
969
909
|
...gtmDetails,
|
|
@@ -997,10 +937,10 @@ export class Creatives extends React.Component {
|
|
|
997
937
|
const templateData = this.state.templateData ? this.state.templateData : template; //select existing or create new content
|
|
998
938
|
const channel = templateData.type;
|
|
999
939
|
const creativesData = this.getCreativesData(channel, template, templateData );// convers data to consumer understandable format
|
|
1000
|
-
creativesData.then(
|
|
940
|
+
creativesData.then(data=>{
|
|
1001
941
|
this.logGTMEvent(channel, data);
|
|
1002
942
|
this.props.getCreativesData(data);// send data to consumer
|
|
1003
|
-
})
|
|
943
|
+
})
|
|
1004
944
|
},
|
|
1005
945
|
);
|
|
1006
946
|
}
|
|
@@ -1041,13 +981,12 @@ export class Creatives extends React.Component {
|
|
|
1041
981
|
}
|
|
1042
982
|
shouldShowFooter = () => {
|
|
1043
983
|
const {isFullMode } = this.props;
|
|
1044
|
-
const {slidBoxContent, currentChannel, emailCreateMode, templateNameExists, templateStep, mobilePushCreateMode,
|
|
984
|
+
const {slidBoxContent, currentChannel, emailCreateMode, templateNameExists, templateStep, mobilePushCreateMode, weChatTemplateType, templateData} = this.state;
|
|
1045
985
|
const channel = currentChannel.toUpperCase();
|
|
1046
986
|
const currentStep = this.creativesTemplateSteps[templateStep];
|
|
1047
987
|
let showFooter = false;
|
|
1048
988
|
showFooter = isFullMode && slidBoxContent === "preview";
|
|
1049
989
|
const isMobilepush = channel === constants.MOBILE_PUSH;
|
|
1050
|
-
const isInApp = channel === constants.INAPP;
|
|
1051
990
|
if (!isFullMode ) {
|
|
1052
991
|
const isEmailCreate = slidBoxContent === 'createTemplate' && channel === constants.EMAIL && currentStep !== 'createTemplateContent';
|
|
1053
992
|
const isCreate = (slidBoxContent === 'editTemplate' || slidBoxContent === 'createTemplate') && !isEmailCreate;
|
|
@@ -1056,9 +995,6 @@ export class Creatives extends React.Component {
|
|
|
1056
995
|
if (isMobilepush) {
|
|
1057
996
|
showFooter = currentStep === "modeSelection" || (currentStep === 'createTemplateContent' && !isEmpty(mobilePushCreateMode));
|
|
1058
997
|
}
|
|
1059
|
-
if (isInApp) {
|
|
1060
|
-
showFooter = currentStep === "modeSelection" || (currentStep === 'createTemplateContent' && !isEmpty(inAppCreateMode));
|
|
1061
|
-
}
|
|
1062
998
|
} else if (channel === constants.EMAIL && isFullMode) {
|
|
1063
999
|
const isEmailCreate = slidBoxContent === 'createTemplate' && channel === constants.EMAIL && currentStep !== 'createTemplateContent';
|
|
1064
1000
|
showFooter = isEmailCreate && emailCreateMode;
|
|
@@ -1113,7 +1049,7 @@ export class Creatives extends React.Component {
|
|
|
1113
1049
|
if (channel === constants.EMAIL || channel === constants.SMS) {
|
|
1114
1050
|
const isEmailCreate = slidBoxContent === 'createTemplate' && channel === constants.EMAIL && currentStep !== 'createTemplateContent';
|
|
1115
1051
|
showDone = (slidBoxContent === 'editTemplate' || slidBoxContent === 'createTemplate') && !isEmailCreate;
|
|
1116
|
-
} else if (
|
|
1052
|
+
} else if (channel === constants.MOBILE_PUSH || channel === constants.WECHAT) {
|
|
1117
1053
|
showDone = currentStep === "createTemplateContent" || slidBoxContent === "editTemplate";
|
|
1118
1054
|
}
|
|
1119
1055
|
|
|
@@ -1136,7 +1072,7 @@ export class Creatives extends React.Component {
|
|
|
1136
1072
|
onChange={(ev) => {
|
|
1137
1073
|
const value = ev.currentTarget.value;
|
|
1138
1074
|
const isEmptyTemplateName = value.trim() ? false : true;
|
|
1139
|
-
this.setState({isTemplateNameEmpty: isEmptyTemplateName});
|
|
1075
|
+
this.setState({isTemplateNameEmpty : isEmptyTemplateName});
|
|
1140
1076
|
const newFormData = {...formData, 'template-name': value};
|
|
1141
1077
|
onFormDataChange(newFormData);
|
|
1142
1078
|
}}
|
|
@@ -1144,10 +1080,10 @@ export class Creatives extends React.Component {
|
|
|
1144
1080
|
showTemplateName = ({formData, onFormDataChange}) => { //gets called from email/index after template data is fetched
|
|
1145
1081
|
const {slidBoxContent, currentChannel, isEditName} = this.state;
|
|
1146
1082
|
const channel = currentChannel.toUpperCase();
|
|
1147
|
-
if (
|
|
1083
|
+
if ((channel === constants.EMAIL || channel === constants.MOBILE_PUSH) && (slidBoxContent === 'editTemplate' || slidBoxContent === 'createTemplate')) {
|
|
1148
1084
|
const name = get(formData, 'template-name');
|
|
1149
1085
|
if (channel === constants.EMAIL && !name && slidBoxContent === 'createTemplate') {
|
|
1150
|
-
this.setState({isTemplateNameEmpty:
|
|
1086
|
+
this.setState({isTemplateNameEmpty:true});
|
|
1151
1087
|
}
|
|
1152
1088
|
this.templateContainerDetails = {formData, onFormDataChange};
|
|
1153
1089
|
if (name && !isEditName) {
|
|
@@ -1158,7 +1094,7 @@ export class Creatives extends React.Component {
|
|
|
1158
1094
|
}
|
|
1159
1095
|
}
|
|
1160
1096
|
shouldShowContinueFooter = () => { // only for email for now, has to be modified according to channel
|
|
1161
|
-
const {slidBoxContent, templateStep, currentChannel, emailCreateMode, mobilePushCreateMode,
|
|
1097
|
+
const {slidBoxContent, templateStep, currentChannel, emailCreateMode, mobilePushCreateMode, weChatTemplateType} = this.state;
|
|
1162
1098
|
let isShowContinueFooter = false;
|
|
1163
1099
|
const currentStep = this.creativesTemplateSteps[templateStep];
|
|
1164
1100
|
const channel = currentChannel.toUpperCase();
|
|
@@ -1172,8 +1108,6 @@ export class Creatives extends React.Component {
|
|
|
1172
1108
|
isShowContinueFooter = !isEmpty(mobilePushCreateMode) && currentStep === "modeSelection";
|
|
1173
1109
|
} else if (currentChannel.toUpperCase() === constants.WECHAT) {
|
|
1174
1110
|
isShowContinueFooter = !isEmpty(weChatTemplateType) && currentStep === "modeSelection";
|
|
1175
|
-
} else if (currentChannel.toUpperCase() === constants.INAPP) {
|
|
1176
|
-
isShowContinueFooter = !isEmpty(inAppCreateMode) && currentChannel === "modeSelection";
|
|
1177
1111
|
}
|
|
1178
1112
|
|
|
1179
1113
|
return isShowContinueFooter;
|
|
@@ -1183,7 +1117,7 @@ export class Creatives extends React.Component {
|
|
|
1183
1117
|
const {templateContainerDetails} = this;
|
|
1184
1118
|
const {formData, onFormDataChange} = templateContainerDetails;
|
|
1185
1119
|
const channel = currentChannel.toUpperCase();
|
|
1186
|
-
if (
|
|
1120
|
+
if ((channel === constants.EMAIL || channel === constants.MOBILE_PUSH) && (slidBoxContent === 'editTemplate' || slidBoxContent === 'createTemplate')) {
|
|
1187
1121
|
const name = get(formData, 'template-name');
|
|
1188
1122
|
return showTemplateNameComponentEdit ? this.templateNameComponentInput({formData, onFormDataChange, name}) : this.templateNameComponentHeader({formData, onFormDataChange, name});
|
|
1189
1123
|
}
|
|
@@ -1216,7 +1150,6 @@ export class Creatives extends React.Component {
|
|
|
1216
1150
|
smsRegister,
|
|
1217
1151
|
enableNewChannels,
|
|
1218
1152
|
} = this.props;
|
|
1219
|
-
console.log('this.props', this.props);
|
|
1220
1153
|
const mapTemplateCreate = slidBoxContent === 'createTemplate' && weChatTemplateType === MAP_TEMPLATE && templateStep !== 'modeSelection';
|
|
1221
1154
|
/* TODO: Instead of passing down same props separately to each component down, write common function to these props and pass it accordingly */
|
|
1222
1155
|
return (
|
|
@@ -338,10 +338,6 @@ export default defineMessages({
|
|
|
338
338
|
id: `${scope}.pushNotificationHeader`,
|
|
339
339
|
defaultMessage: `Push notification`,
|
|
340
340
|
},
|
|
341
|
-
"inAppHeader": {
|
|
342
|
-
id: `${scope}.inAppHeader`,
|
|
343
|
-
defaultMessage: `In App Message`,
|
|
344
|
-
},
|
|
345
341
|
"wechat": {
|
|
346
342
|
id: `${scope}.wechat`,
|
|
347
343
|
defaultMessage: `Wechat`,
|
|
@@ -768,10 +768,9 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
768
768
|
formData[0].base = true;
|
|
769
769
|
// formData[0].tabKey = '1';
|
|
770
770
|
// formData[1].tabKey = '2';
|
|
771
|
-
|
|
772
771
|
this.setState({templateCta}, () => {
|
|
773
772
|
this.getSchemaForFormData(formData, schema);
|
|
774
|
-
this.setState({tabCount, formData, editData: data
|
|
773
|
+
this.setState({tabCount, formData, editData: data}, () => {
|
|
775
774
|
this.props.showTemplateName({formData, onFormDataChange: this.onFormDataChange});
|
|
776
775
|
});
|
|
777
776
|
});
|
|
@@ -1469,7 +1468,6 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
1469
1468
|
temp.content.appName = this.props.Templates.selectedWeChatAccount.name;
|
|
1470
1469
|
}
|
|
1471
1470
|
_.forEach(col.supportedEvents, (event) => {
|
|
1472
|
-
console.log('injected event for ', col, event, this.getMappedEvent(col.id, event));
|
|
1473
1471
|
temp.injectedEvents[event] = this.getMappedEvent(col.id, event);
|
|
1474
1472
|
});
|
|
1475
1473
|
return true;
|
|
@@ -523,9 +523,6 @@
|
|
|
523
523
|
.message-container{
|
|
524
524
|
border-bottom: solid 0.5px #D6D6D6;
|
|
525
525
|
}
|
|
526
|
-
.main-content{
|
|
527
|
-
overflow: hidden;
|
|
528
|
-
}
|
|
529
526
|
|
|
530
527
|
.wechat-filters,
|
|
531
528
|
.line-filters {
|
|
@@ -598,13 +595,6 @@
|
|
|
598
595
|
width: 50%;
|
|
599
596
|
text-align: center;
|
|
600
597
|
}
|
|
601
|
-
.inapp-illustration {
|
|
602
|
-
width: 50%;
|
|
603
|
-
text-align: center;
|
|
604
|
-
}
|
|
605
|
-
.inapp-illustration-button {
|
|
606
|
-
display: none;
|
|
607
|
-
}
|
|
608
598
|
.channel-specific-illustration-text{
|
|
609
599
|
text-align: center;
|
|
610
600
|
margin-top: $CAP_SPACE_44;
|