@capillarytech/creatives-library 8.0.246-alpha.0 → 8.0.246
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/assets/Android.png +0 -0
- package/assets/iOS.png +0 -0
- package/constants/unified.js +1 -2
- package/initialReducer.js +0 -2
- package/package.json +1 -1
- package/services/api.js +0 -10
- package/services/tests/api.test.js +0 -18
- package/utils/common.js +0 -5
- package/utils/commonUtils.js +5 -28
- package/utils/tests/commonUtil.test.js +0 -224
- package/utils/transformTemplateConfig.js +10 -0
- package/v2Components/CapDeviceContent/index.js +56 -61
- package/v2Components/CapTagList/index.js +1 -6
- package/v2Components/CapTagListWithInput/index.js +1 -5
- package/v2Components/CapTagListWithInput/messages.js +1 -1
- package/v2Components/CapWhatsappCTA/tests/index.test.js +0 -5
- package/v2Components/ErrorInfoNote/index.js +72 -447
- package/v2Components/ErrorInfoNote/messages.js +0 -22
- package/v2Components/ErrorInfoNote/style.scss +4 -280
- package/v2Components/FormBuilder/tests/index.test.js +4 -13
- package/v2Components/HtmlEditor/HTMLEditor.js +94 -642
- package/v2Components/HtmlEditor/__tests__/HTMLEditor.test.js +133 -1135
- package/v2Components/HtmlEditor/__tests__/index.lazy.test.js +16 -27
- package/v2Components/HtmlEditor/_htmlEditor.scss +45 -108
- package/v2Components/HtmlEditor/_index.lazy.scss +1 -1
- package/v2Components/HtmlEditor/components/CodeEditorPane/_codeEditorPane.scss +101 -13
- package/v2Components/HtmlEditor/components/CodeEditorPane/index.js +139 -148
- package/v2Components/HtmlEditor/components/DeviceToggle/_deviceToggle.scss +1 -2
- package/v2Components/HtmlEditor/components/DeviceToggle/index.js +3 -3
- package/v2Components/HtmlEditor/components/EditorToolbar/_editorToolbar.scss +0 -9
- package/v2Components/HtmlEditor/components/EditorToolbar/index.js +1 -1
- package/v2Components/HtmlEditor/components/FullscreenModal/_fullscreenModal.scss +0 -22
- package/v2Components/HtmlEditor/components/InAppPreviewPane/DeviceFrame.js +7 -4
- package/v2Components/HtmlEditor/components/InAppPreviewPane/__tests__/DeviceFrame.test.js +45 -35
- package/v2Components/HtmlEditor/components/InAppPreviewPane/_inAppPreviewPane.scss +3 -1
- package/v2Components/HtmlEditor/components/InAppPreviewPane/constants.js +33 -33
- package/v2Components/HtmlEditor/components/InAppPreviewPane/index.js +6 -7
- package/v2Components/HtmlEditor/components/PreviewPane/_previewPane.scss +6 -3
- package/v2Components/HtmlEditor/components/PreviewPane/index.js +13 -11
- package/v2Components/HtmlEditor/components/SplitContainer/_splitContainer.scss +1 -1
- package/v2Components/HtmlEditor/components/ValidationErrorDisplay/__tests__/index.test.js +152 -0
- package/v2Components/HtmlEditor/components/ValidationErrorDisplay/index.js +31 -49
- package/v2Components/HtmlEditor/constants.js +20 -29
- package/v2Components/HtmlEditor/hooks/__tests__/useInAppContent.test.js +16 -373
- package/v2Components/HtmlEditor/hooks/useEditorContent.js +2 -5
- package/v2Components/HtmlEditor/hooks/useInAppContent.js +146 -88
- package/v2Components/HtmlEditor/hooks/useValidation.js +45 -150
- package/v2Components/HtmlEditor/index.js +1 -1
- package/v2Components/HtmlEditor/messages.js +85 -95
- package/v2Components/HtmlEditor/utils/liquidTemplateSupport.js +102 -134
- package/v2Components/HtmlEditor/utils/properSyntaxHighlighting.js +25 -23
- package/v2Components/HtmlEditor/utils/validationAdapter.js +41 -66
- package/v2Components/MobilePushPreviewV2/index.js +7 -32
- package/v2Components/TemplatePreview/_templatePreview.scss +24 -44
- package/v2Components/TemplatePreview/index.js +32 -47
- package/v2Components/TemplatePreview/messages.js +0 -4
- package/v2Components/TestAndPreviewSlidebox/_testAndPreviewSlidebox.scss +0 -1
- package/v2Components/TestAndPreviewSlidebox/index.js +25 -31
- package/v2Containers/BeeEditor/index.js +90 -172
- package/v2Containers/CreativesContainer/SlideBoxContent.js +51 -128
- package/v2Containers/CreativesContainer/SlideBoxFooter.js +12 -113
- package/v2Containers/CreativesContainer/SlideBoxHeader.js +1 -2
- package/v2Containers/CreativesContainer/constants.js +0 -1
- package/v2Containers/CreativesContainer/index.js +46 -238
- package/v2Containers/CreativesContainer/messages.js +0 -8
- package/v2Containers/CreativesContainer/tests/SlideBoxFooter.test.js +2 -11
- package/v2Containers/CreativesContainer/tests/__snapshots__/SlideBoxContent.test.js.snap +50 -38
- package/v2Containers/CreativesContainer/tests/__snapshots__/index.test.js.snap +0 -91
- package/v2Containers/Email/actions.js +0 -7
- package/v2Containers/Email/constants.js +1 -5
- package/v2Containers/Email/index.js +30 -229
- package/v2Containers/Email/messages.js +0 -32
- package/v2Containers/Email/reducer.js +1 -12
- package/v2Containers/Email/sagas.js +7 -61
- package/v2Containers/Email/tests/__snapshots__/reducer.test.js.snap +0 -2
- package/v2Containers/Email/tests/sagas.test.js +1 -1
- package/v2Containers/EmailWrapper/components/EmailWrapperView.js +15 -210
- package/v2Containers/EmailWrapper/components/HTMLEditorTesting.js +74 -40
- package/v2Containers/EmailWrapper/components/__tests__/HTMLEditorTesting.test.js +67 -2
- package/v2Containers/EmailWrapper/constants.js +0 -2
- package/v2Containers/EmailWrapper/hooks/useEmailWrapper.js +77 -629
- package/v2Containers/EmailWrapper/index.js +23 -103
- package/v2Containers/EmailWrapper/messages.js +1 -61
- package/v2Containers/EmailWrapper/tests/EmailWrapperView.test.js +214 -0
- package/v2Containers/EmailWrapper/tests/useEmailWrapper.test.js +77 -509
- package/v2Containers/InApp/actions.js +0 -7
- package/v2Containers/InApp/constants.js +4 -20
- package/v2Containers/InApp/index.js +357 -801
- package/v2Containers/InApp/index.scss +3 -4
- package/v2Containers/InApp/messages.js +3 -7
- package/v2Containers/InApp/reducer.js +3 -21
- package/v2Containers/InApp/sagas.js +9 -29
- package/v2Containers/InApp/selectors.js +5 -25
- package/v2Containers/InApp/tests/index.test.js +50 -154
- package/v2Containers/InApp/tests/reducer.test.js +0 -34
- package/v2Containers/InApp/tests/sagas.test.js +9 -61
- package/v2Containers/Line/Container/ImageCarousel/tests/__snapshots__/content.test.js.snap +0 -3
- package/v2Containers/Line/Container/ImageCarousel/tests/__snapshots__/index.test.js.snap +0 -2
- package/v2Containers/Line/Container/Wrapper/tests/__snapshots__/index.test.js.snap +0 -2
- package/v2Containers/Line/Container/tests/__snapshots__/index.test.js.snap +0 -9
- package/v2Containers/Rcs/tests/__snapshots__/index.test.js.snap +0 -12
- package/v2Containers/SmsTrai/Edit/tests/__snapshots__/index.test.js.snap +0 -4
- package/v2Containers/TagList/index.js +19 -62
- package/v2Containers/Templates/_templates.scss +1 -60
- package/v2Containers/Templates/index.js +4 -89
- package/v2Containers/Templates/messages.js +0 -4
- package/v2Containers/Whatsapp/tests/__snapshots__/index.test.js.snap +0 -35
- package/v2Components/HtmlEditor/__tests__/HTMLEditor.apiErrors.test.js +0 -874
- package/v2Components/HtmlEditor/components/ValidationTabs/_validationTabs.scss +0 -254
- package/v2Components/HtmlEditor/components/ValidationTabs/index.js +0 -363
- package/v2Components/HtmlEditor/components/ValidationTabs/messages.js +0 -51
- package/v2Components/HtmlEditor/hooks/__tests__/useValidation.apiErrors.test.js +0 -630
- package/v2Containers/BeePopupEditor/constants.js +0 -10
- package/v2Containers/BeePopupEditor/index.js +0 -193
- package/v2Containers/BeePopupEditor/tests/index.test.js +0 -627
- package/v2Containers/EmailWrapper/components/EmailHTMLEditor.js +0 -1317
- package/v2Containers/EmailWrapper/components/__tests__/EmailHTMLEditor.test.js +0 -1605
- package/v2Containers/EmailWrapper/components/__tests__/EmailWrapperView.test.js +0 -520
- package/v2Containers/EmailWrapper/tests/useEmailWrapper.edgeCases.test.js +0 -643
- package/v2Containers/InApp/__tests__/InAppHTMLEditor.test.js +0 -376
- package/v2Containers/InApp/__tests__/sagas.test.js +0 -363
- package/v2Containers/InApp/tests/selectors.test.js +0 -612
- package/v2Containers/InAppWrapper/components/InAppWrapperView.js +0 -162
- package/v2Containers/InAppWrapper/components/__tests__/InAppWrapperView.test.js +0 -267
- package/v2Containers/InAppWrapper/components/inAppWrapperView.scss +0 -9
- package/v2Containers/InAppWrapper/constants.js +0 -16
- package/v2Containers/InAppWrapper/hooks/__tests__/useInAppWrapper.test.js +0 -473
- package/v2Containers/InAppWrapper/hooks/useInAppWrapper.js +0 -198
- package/v2Containers/InAppWrapper/index.js +0 -148
- package/v2Containers/InAppWrapper/messages.js +0 -49
- package/v2Containers/InappAdvance/index.js +0 -1099
- package/v2Containers/InappAdvance/index.scss +0 -10
- package/v2Containers/InappAdvance/tests/index.test.js +0 -448
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import {
|
|
4
|
-
CAP_SPACE_16, CAP_SPACE_32, CAP_SPACE_56, CAP_SPACE_64,
|
|
5
|
-
} from '@capillarytech/cap-ui-library/styled/variables';
|
|
3
|
+
import { CAP_SPACE_32, CAP_SPACE_56, CAP_SPACE_64 } from '@capillarytech/cap-ui-library/styled/variables';
|
|
6
4
|
|
|
7
5
|
import CapSlideBox from '@capillarytech/cap-ui-library/CapSlideBox';
|
|
8
6
|
import CapHeader from '@capillarytech/cap-ui-library/CapHeader';
|
|
@@ -45,7 +43,7 @@ import {
|
|
|
45
43
|
IMAGE as LINE_IMAGE, IMAGE_MAP, IMAGE_CAROUSEL, VIDEO as LINE_VIDEO, TEMPLATE, STICKER,
|
|
46
44
|
} from '../Line/Container/constants';
|
|
47
45
|
import { IMAGE, VIDEO } from '../Facebook/Advertisement/constant';
|
|
48
|
-
import {
|
|
46
|
+
import {RCS_STATUSES} from '../Rcs/constants';
|
|
49
47
|
import { CREATIVE } from '../Facebook/constants';
|
|
50
48
|
import { LOYALTY } from '../App/constants';
|
|
51
49
|
import {
|
|
@@ -66,29 +64,19 @@ import {
|
|
|
66
64
|
// getTemplateDiffState
|
|
67
65
|
} from "../../utils/transformerUtils";
|
|
68
66
|
import { MANUAL_CAROUSEL } from '../MobilePushNew/constants';
|
|
69
|
-
import { BIG_HTML } from '../InApp/constants';
|
|
70
67
|
|
|
71
68
|
const classPrefix = 'add-creatives-section';
|
|
72
69
|
const CREATIVES_CONTAINER = 'creativesContainer';
|
|
73
70
|
|
|
74
71
|
const SlideBoxWrapper = styled.div`
|
|
75
72
|
.cap-slide-box-v2-container{
|
|
76
|
-
.slidebox-header, .slidebox-content-container{
|
|
73
|
+
.slidebox-header, .slidebox-content-container, .slidebox-footer{
|
|
77
74
|
margin-bottom: ${({ slideBoxWrapperMargin }) => `${slideBoxWrapperMargin}`};
|
|
78
75
|
padding: 0 rem;
|
|
79
76
|
&.has-footer{
|
|
80
77
|
overflow-x: hidden;
|
|
81
78
|
}
|
|
82
79
|
}
|
|
83
|
-
.slidebox-footer{
|
|
84
|
-
/* Only apply margin-bottom to footer when ErrorInfoNote is shown in footer (BEE editor) */
|
|
85
|
-
/* For HTML Editor, errors are shown in ValidationErrorDisplay (inside content area), so no footer margin needed */
|
|
86
|
-
margin-bottom: ${({ shouldApplyFooterMargin }) => (shouldApplyFooterMargin ? `${CAP_SPACE_16}` : '0')};
|
|
87
|
-
padding: 0 rem;
|
|
88
|
-
&.has-footer{
|
|
89
|
-
overflow-x: hidden;
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
80
|
}
|
|
93
81
|
`;
|
|
94
82
|
export class Creatives extends React.Component {
|
|
@@ -107,7 +95,6 @@ export class Creatives extends React.Component {
|
|
|
107
95
|
currentChannel: this.props.channel || 'sms',
|
|
108
96
|
weChatTemplateType: '',
|
|
109
97
|
weChatMaptemplateStep: 0,
|
|
110
|
-
inAppEditorType: null,
|
|
111
98
|
isLiquidValidationError: false,
|
|
112
99
|
errorMessages: [],
|
|
113
100
|
liquidErrorMessage: {
|
|
@@ -120,17 +107,6 @@ export class Creatives extends React.Component {
|
|
|
120
107
|
isTestAndPreviewMode: false, // Add flag to track Test & Preview mode
|
|
121
108
|
// Performance optimization: Local template name for immediate UI feedback
|
|
122
109
|
localTemplateName: '',
|
|
123
|
-
// Track selected email create mode for new flow (HTML Editor vs Drag & Drop)
|
|
124
|
-
selectedEmailCreateMode: null,
|
|
125
|
-
// HTML Editor validation state (for email channel)
|
|
126
|
-
htmlEditorValidationState: {
|
|
127
|
-
isContentEmpty: true,
|
|
128
|
-
issueCounts: {
|
|
129
|
-
html: 0, label: 0, liquid: 0, total: 0,
|
|
130
|
-
},
|
|
131
|
-
validationComplete: false, // Flag to track if validation has completed
|
|
132
|
-
errorsAcknowledged: false, // Flag to track if user has acknowledged errors by clicking redirection icon
|
|
133
|
-
},
|
|
134
110
|
};
|
|
135
111
|
this.liquidFlow = Boolean(commonUtil.hasLiquidSupportFeature());
|
|
136
112
|
this.creativesTemplateSteps = {
|
|
@@ -160,7 +136,7 @@ export class Creatives extends React.Component {
|
|
|
160
136
|
if (!this.props?.isFullMode) {
|
|
161
137
|
this.props?.templateActions.getCdnTransformationConfig();
|
|
162
138
|
}
|
|
163
|
-
|
|
139
|
+
|
|
164
140
|
// Store loyalty tag props if loyaltyTagFetchingDependencies is provided
|
|
165
141
|
const { loyaltyTagFetchingDependencies } = this.props;
|
|
166
142
|
if (loyaltyTagFetchingDependencies) {
|
|
@@ -186,9 +162,9 @@ export class Creatives extends React.Component {
|
|
|
186
162
|
const isEmptyTemplateName = !value.trim();
|
|
187
163
|
|
|
188
164
|
// 1. IMMEDIATE: Update local state for instant UI feedback
|
|
189
|
-
this.setState({
|
|
165
|
+
this.setState({
|
|
190
166
|
isTemplateNameEmpty: isEmptyTemplateName,
|
|
191
|
-
localTemplateName: value
|
|
167
|
+
localTemplateName: value
|
|
192
168
|
});
|
|
193
169
|
|
|
194
170
|
// 2. DEBOUNCED: Only debounce the expensive onFormDataChange call
|
|
@@ -267,19 +243,8 @@ export class Creatives extends React.Component {
|
|
|
267
243
|
onCreateNextStep = () => {
|
|
268
244
|
this.setState((prevState) => {
|
|
269
245
|
let templateStep = prevState.templateStep + 1;
|
|
270
|
-
const { emailCreateMode, currentChannel
|
|
271
|
-
|
|
272
|
-
// Check if we should skip template selection for HTML Editor
|
|
273
|
-
const supportCKEditor = commonUtil.hasSupportCKEditor();
|
|
274
|
-
const shouldSkipTemplateSelection = !supportCKEditor
|
|
275
|
-
&& selectedEmailCreateMode === 'html_editor'
|
|
276
|
-
&& currentChannel.toUpperCase() === constants.EMAIL
|
|
277
|
-
&& prevState.templateStep === 1; // Only skip if we're at modeSelection step
|
|
278
|
-
|
|
279
|
-
if (shouldSkipTemplateSelection) {
|
|
280
|
-
// Skip template selection (step 2), go directly to createTemplateContent (step 3)
|
|
281
|
-
templateStep = prevState.templateStep + 2;
|
|
282
|
-
} else if ((currentChannel.toUpperCase() === constants.EMAIL && emailCreateMode === "upload") || [constants.MOBILE_PUSH, constants.WECHAT, constants.INAPP].includes(currentChannel.toUpperCase())) {
|
|
246
|
+
const { emailCreateMode, currentChannel } = prevState;
|
|
247
|
+
if ((currentChannel.toUpperCase() === constants.EMAIL && emailCreateMode === "upload") || [constants.MOBILE_PUSH, constants.WECHAT, constants.INAPP].includes(currentChannel.toUpperCase())) {
|
|
283
248
|
templateStep = prevState.templateStep + 2;
|
|
284
249
|
}
|
|
285
250
|
return {
|
|
@@ -288,21 +253,14 @@ export class Creatives extends React.Component {
|
|
|
288
253
|
});
|
|
289
254
|
}
|
|
290
255
|
|
|
291
|
-
onEmailModeChange = (mode
|
|
292
|
-
this.setState({
|
|
293
|
-
emailCreateMode: mode,
|
|
294
|
-
selectedEmailCreateMode: selectedMode || mode, // Store the selected mode for new flow
|
|
295
|
-
});
|
|
256
|
+
onEmailModeChange = (mode) => {
|
|
257
|
+
this.setState({ emailCreateMode: mode });
|
|
296
258
|
}
|
|
297
259
|
|
|
298
260
|
onInAppModeChange = (mode) => {
|
|
299
261
|
this.setState({ inAppCreateMode: mode });
|
|
300
262
|
}
|
|
301
263
|
|
|
302
|
-
onInAppEditorTypeChange = (editorType) => {
|
|
303
|
-
this.setState({ inAppEditorType: editorType });
|
|
304
|
-
}
|
|
305
|
-
|
|
306
264
|
onMobilepushModeChange = (mode) => {
|
|
307
265
|
this.setState({ mobilePushCreateMode: mode });
|
|
308
266
|
}
|
|
@@ -346,7 +304,7 @@ export class Creatives extends React.Component {
|
|
|
346
304
|
}
|
|
347
305
|
return buttonObj;
|
|
348
306
|
});
|
|
349
|
-
const {
|
|
307
|
+
const {url, previewUrl} = media || {};
|
|
350
308
|
return {
|
|
351
309
|
bodyText: bodyTemplate,
|
|
352
310
|
varMap: cardVarMapped,
|
|
@@ -475,35 +433,14 @@ export class Creatives extends React.Component {
|
|
|
475
433
|
}
|
|
476
434
|
case constants.INAPP: {
|
|
477
435
|
const mode = get(templateData, 'androidContent.type') || get(templateData, 'iosContent.type') || '';
|
|
478
|
-
|
|
479
|
-
// Check if this is a BEE editor template (identified by special title 'bee free template')
|
|
480
|
-
const isAndroidBeeEditor = templateData?.androidContent?.type === constants.HTML
|
|
481
|
-
&& templateData?.androidContent?.title?.toLowerCase() === 'bee free template';
|
|
482
|
-
const isIosBeeEditor = templateData?.iosContent?.type === constants.HTML
|
|
483
|
-
&& templateData?.iosContent?.title?.toLowerCase() === 'bee free template';
|
|
484
|
-
|
|
485
436
|
creativesTemplateData = {
|
|
486
437
|
type: channel,
|
|
487
438
|
name: templateData.messageSubject,
|
|
488
439
|
versions: {
|
|
489
440
|
base: {
|
|
490
441
|
content: {
|
|
491
|
-
ANDROID:
|
|
492
|
-
|
|
493
|
-
bodyType: templateData?.androidContent?.bodyType,
|
|
494
|
-
deviceType: constants.ANDROID,
|
|
495
|
-
beeHtml: { value: templateData?.androidContent?.message },
|
|
496
|
-
beeJson: templateData?.androidContent?.expandableDetails?.message,
|
|
497
|
-
isBEEeditor: true,
|
|
498
|
-
} : templateData?.androidContent,
|
|
499
|
-
IOS: isIosBeeEditor ? {
|
|
500
|
-
type: templateData?.iosContent?.type,
|
|
501
|
-
bodyType: templateData?.iosContent?.bodyType,
|
|
502
|
-
deviceType: constants.IOS,
|
|
503
|
-
beeHtml: { value: templateData?.iosContent?.message },
|
|
504
|
-
beeJson: templateData?.iosContent?.expandableDetails?.message,
|
|
505
|
-
isBEEeditor: true,
|
|
506
|
-
} : templateData?.iosContent,
|
|
442
|
+
ANDROID: templateData?.androidContent,
|
|
443
|
+
IOS: templateData?.iosContent,
|
|
507
444
|
},
|
|
508
445
|
},
|
|
509
446
|
},
|
|
@@ -738,7 +675,7 @@ export class Creatives extends React.Component {
|
|
|
738
675
|
} = templateData || {};
|
|
739
676
|
const cardContent = (rcsContent.cardContent && rcsContent.cardContent[0]) || {};
|
|
740
677
|
const Status = RCS_STATUSES.approved || '';
|
|
741
|
-
|
|
678
|
+
|
|
742
679
|
creativesTemplateData = {
|
|
743
680
|
type: channel,
|
|
744
681
|
edit: true,
|
|
@@ -823,7 +760,7 @@ export class Creatives extends React.Component {
|
|
|
823
760
|
});
|
|
824
761
|
|
|
825
762
|
getMobilePushCarouselData = (expandableDetails = []) => {
|
|
826
|
-
const newExpandableDetails = {
|
|
763
|
+
const newExpandableDetails = {...expandableDetails};
|
|
827
764
|
newExpandableDetails.style = expandableDetails.style || MANUAL_CAROUSEL;
|
|
828
765
|
newExpandableDetails.message = expandableDetails.message || '';
|
|
829
766
|
newExpandableDetails.ctas = expandableDetails.ctas || [];
|
|
@@ -918,24 +855,11 @@ export class Creatives extends React.Component {
|
|
|
918
855
|
androidContent.custom = custom;
|
|
919
856
|
}
|
|
920
857
|
if (channel === constants.MOBILE_PUSH && androidContent?.expandableDetails?.carouselData?.length) {
|
|
921
|
-
androidContent.expandableDetails = this.getMobilePushCarouselData({
|
|
922
|
-
}
|
|
923
|
-
if (androidContent?.isBEEeditor && androidContent?.beeHtml?.value) {
|
|
924
|
-
templateData.androidContent = {};
|
|
925
|
-
templateData.androidContent.type = constants.HTML;
|
|
926
|
-
templateData.androidContent.message = androidContent?.beeHtml?.value || '';
|
|
927
|
-
templateData.androidContent.title = 'bee free template';
|
|
928
|
-
templateData.androidContent.bodyType = androidContent?.bodyType;
|
|
929
|
-
templateData.androidContent.deviceType = constants.ANDROID;
|
|
930
|
-
templateData.androidContent.expandableDetails = {
|
|
931
|
-
style: BIG_HTML,
|
|
932
|
-
message: androidContent?.beeJson || '',
|
|
933
|
-
};
|
|
934
|
-
} else if (!androidContent?.isBEEeditor) {
|
|
935
|
-
templateData.androidContent = androidContent;
|
|
936
|
-
templateData.androidContent.type = androidContent?.type || get(channelTemplate, 'definition.mode', '')?.toUpperCase() || constants.TEXT;
|
|
937
|
-
templateData.androidContent.deviceType = constants.ANDROID;
|
|
858
|
+
androidContent.expandableDetails = this.getMobilePushCarouselData({...androidContent?.expandableDetails});
|
|
938
859
|
}
|
|
860
|
+
templateData.androidContent = androidContent;
|
|
861
|
+
templateData.androidContent.type = androidContent?.type || get(channelTemplate, 'definition.mode', '')?.toUpperCase() || constants.TEXT;
|
|
862
|
+
templateData.androidContent.deviceType = constants.ANDROID;
|
|
939
863
|
}
|
|
940
864
|
const iosContent = channel === constants.INAPP ? get(channelTemplate, 'versions.base.content.IOS') : get(channelTemplate, 'versions.base.IOS');
|
|
941
865
|
if (!isEmpty(iosContent)) {
|
|
@@ -953,24 +877,11 @@ export class Creatives extends React.Component {
|
|
|
953
877
|
iosContent.custom = custom;
|
|
954
878
|
}
|
|
955
879
|
if (channel === constants.MOBILE_PUSH && iosContent?.expandableDetails?.carouselData?.length) {
|
|
956
|
-
iosContent.expandableDetails = this.getMobilePushCarouselData({
|
|
957
|
-
}
|
|
958
|
-
if (iosContent?.isBEEeditor && iosContent?.beeHtml?.value) {
|
|
959
|
-
templateData.iosContent = {};
|
|
960
|
-
templateData.iosContent.type = constants.HTML;
|
|
961
|
-
templateData.iosContent.message = iosContent?.beeHtml?.value || '';
|
|
962
|
-
templateData.iosContent.title = 'bee free template';
|
|
963
|
-
templateData.iosContent.bodyType = iosContent?.bodyType;
|
|
964
|
-
templateData.iosContent.deviceType = constants.IOS;
|
|
965
|
-
templateData.iosContent.expandableDetails = {
|
|
966
|
-
style: BIG_HTML,
|
|
967
|
-
message: iosContent?.beeJson || '',
|
|
968
|
-
};
|
|
969
|
-
} else if (!iosContent?.isBEEeditor) {
|
|
970
|
-
templateData.iosContent = iosContent;
|
|
971
|
-
templateData.iosContent.type = iosContent?.type || get(channelTemplate, 'definition.mode', '')?.toUpperCase() || 'TEXT';
|
|
972
|
-
templateData.iosContent.deviceType = constants.IOS;
|
|
880
|
+
iosContent.expandableDetails = this.getMobilePushCarouselData({...iosContent?.expandableDetails});
|
|
973
881
|
}
|
|
882
|
+
templateData.iosContent = iosContent;
|
|
883
|
+
templateData.iosContent.type = iosContent?.type || get(channelTemplate, 'definition.mode', '')?.toUpperCase() || 'TEXT';
|
|
884
|
+
templateData.iosContent.deviceType = constants.IOS;
|
|
974
885
|
}
|
|
975
886
|
templateData.messageSubject = channelTemplate?.name ? channelTemplate?.name : "messageSubject";
|
|
976
887
|
}
|
|
@@ -1185,7 +1096,7 @@ export class Creatives extends React.Component {
|
|
|
1185
1096
|
contentType = "",
|
|
1186
1097
|
cardType = "",
|
|
1187
1098
|
cardSettings = {},
|
|
1188
|
-
} = get(versions, 'base.content.RCS.rcsContent',
|
|
1099
|
+
} = get(versions, 'base.content.RCS.rcsContent',{});
|
|
1189
1100
|
const rcsContent = {
|
|
1190
1101
|
contentType,
|
|
1191
1102
|
cardType,
|
|
@@ -1323,7 +1234,7 @@ export class Creatives extends React.Component {
|
|
|
1323
1234
|
processCentralCommsMetaId = (channel, creativesData) => {
|
|
1324
1235
|
// Create the payload for the centralcommnsmetaId API call
|
|
1325
1236
|
const { isLoyaltyModule = false, loyaltyMetaData = {} } = this.props;
|
|
1326
|
-
const { actionName, setMetaData = () => {
|
|
1237
|
+
const { actionName, setMetaData = () => {} } = loyaltyMetaData;
|
|
1327
1238
|
|
|
1328
1239
|
// const isTemplateModified = getTemplateDiffState(
|
|
1329
1240
|
// channel,
|
|
@@ -1373,9 +1284,6 @@ export class Creatives extends React.Component {
|
|
|
1373
1284
|
if (prevState.currentChannel.toUpperCase() === constants.EMAIL) {
|
|
1374
1285
|
newState = { ...newState, emailCreateMode: null };
|
|
1375
1286
|
}
|
|
1376
|
-
if (prevState.currentChannel.toUpperCase() === constants.INAPP) {
|
|
1377
|
-
newState = { ...newState, inAppEditorType: null };
|
|
1378
|
-
}
|
|
1379
1287
|
return newState;
|
|
1380
1288
|
});
|
|
1381
1289
|
}
|
|
@@ -1421,7 +1329,7 @@ export class Creatives extends React.Component {
|
|
|
1421
1329
|
shouldShowFooter = () => {
|
|
1422
1330
|
const { isFullMode } = this.props;
|
|
1423
1331
|
const {
|
|
1424
|
-
slidBoxContent, currentChannel, emailCreateMode, templateNameExists, templateStep, mobilePushCreateMode, weChatTemplateType, templateData,
|
|
1332
|
+
slidBoxContent, currentChannel, emailCreateMode, templateNameExists, templateStep, mobilePushCreateMode, weChatTemplateType, templateData,
|
|
1425
1333
|
} = this.state;
|
|
1426
1334
|
const channel = currentChannel.toUpperCase();
|
|
1427
1335
|
const currentStep = this.creativesTemplateSteps[templateStep];
|
|
@@ -1429,13 +1337,6 @@ export class Creatives extends React.Component {
|
|
|
1429
1337
|
showFooter = isFullMode && slidBoxContent === "preview";
|
|
1430
1338
|
const isMobilepush = channel === constants.MOBILE_PUSH;
|
|
1431
1339
|
|
|
1432
|
-
const supportCKEditor = commonUtil.hasSupportCKEditor();
|
|
1433
|
-
if (!supportCKEditor && channel === constants.EMAIL && currentStep === 'modeSelection' && slidBoxContent === 'createTemplate') {
|
|
1434
|
-
return true;
|
|
1435
|
-
}
|
|
1436
|
-
if (!supportCKEditor && channel === constants.EMAIL && currentStep === 'createTemplateContent' && slidBoxContent === 'createTemplate') {
|
|
1437
|
-
showFooter = true;
|
|
1438
|
-
}
|
|
1439
1340
|
|
|
1440
1341
|
if (!isFullMode) {
|
|
1441
1342
|
const isEmailCreate = slidBoxContent === 'createTemplate' && channel === constants.EMAIL && currentStep !== 'createTemplateContent';
|
|
@@ -1471,7 +1372,6 @@ export class Creatives extends React.Component {
|
|
|
1471
1372
|
showFooter = true;
|
|
1472
1373
|
}
|
|
1473
1374
|
|
|
1474
|
-
|
|
1475
1375
|
if (showFooter) {
|
|
1476
1376
|
if (slidBoxContent === "createTemplate" && ((channel === constants.EMAIL && currentStep === 'createTemplateContent')
|
|
1477
1377
|
|| ([constants.SMS, constants.WECHAT].includes(channel) && currentStep === 'modeSelection'))) {
|
|
@@ -1494,7 +1394,7 @@ export class Creatives extends React.Component {
|
|
|
1494
1394
|
|
|
1495
1395
|
shouldShowDoneFooter = () => {
|
|
1496
1396
|
const {
|
|
1497
|
-
slidBoxContent, templateStep, currentChannel, templateData,
|
|
1397
|
+
slidBoxContent, templateStep, currentChannel, templateData,
|
|
1498
1398
|
} = this.state;
|
|
1499
1399
|
const { isFullMode } = this.props;
|
|
1500
1400
|
const currentStep = this.creativesTemplateSteps[templateStep];
|
|
@@ -1502,17 +1402,10 @@ export class Creatives extends React.Component {
|
|
|
1502
1402
|
const channelName = !isFullMode && templateData ? templateData.type : currentChannel;
|
|
1503
1403
|
const channel = channelName?.toUpperCase();
|
|
1504
1404
|
|
|
1505
|
-
|
|
1506
|
-
const supportCKEditor = commonUtil.hasSupportCKEditor();
|
|
1405
|
+
|
|
1507
1406
|
if (channel === constants.EMAIL || channel === constants.SMS) {
|
|
1508
1407
|
const isEmailCreate = slidBoxContent === 'createTemplate' && channel === constants.EMAIL && currentStep !== 'createTemplateContent';
|
|
1509
|
-
|
|
1510
|
-
// For new HTML editor flow (when supportCKEditor is false), show Done footer when in createTemplateContent step
|
|
1511
|
-
if (!supportCKEditor && channel === constants.EMAIL && slidBoxContent === 'createTemplate' && currentStep === 'createTemplateContent') {
|
|
1512
|
-
showDone = true;
|
|
1513
|
-
} else {
|
|
1514
|
-
showDone = (slidBoxContent === 'editTemplate' || slidBoxContent === 'createTemplate') && !isEmailCreate;
|
|
1515
|
-
}
|
|
1408
|
+
showDone = (slidBoxContent === 'editTemplate' || slidBoxContent === 'createTemplate') && !isEmailCreate;
|
|
1516
1409
|
} else if ([constants.WECHAT, constants.MOBILE_PUSH].includes(channel)) {
|
|
1517
1410
|
showDone = currentStep === "createTemplateContent" || slidBoxContent === "editTemplate";
|
|
1518
1411
|
|
|
@@ -1522,6 +1415,7 @@ export class Creatives extends React.Component {
|
|
|
1522
1415
|
}
|
|
1523
1416
|
}
|
|
1524
1417
|
|
|
1418
|
+
|
|
1525
1419
|
return showDone;
|
|
1526
1420
|
}
|
|
1527
1421
|
|
|
@@ -1541,18 +1435,18 @@ export class Creatives extends React.Component {
|
|
|
1541
1435
|
templateNameComponentInput = ({ formData, onFormDataChange, name }) => {
|
|
1542
1436
|
// Use local state for immediate UI feedback, fallback to prop value
|
|
1543
1437
|
const displayValue = this.state.localTemplateName !== '' ? this.state.localTemplateName : name;
|
|
1544
|
-
|
|
1438
|
+
|
|
1545
1439
|
return (
|
|
1546
1440
|
<CapInput
|
|
1547
1441
|
value={displayValue}
|
|
1548
1442
|
suffix={<span />}
|
|
1549
|
-
onBlur={() => {
|
|
1550
|
-
this.setState({
|
|
1443
|
+
onBlur={() => {
|
|
1444
|
+
this.setState({
|
|
1551
1445
|
isEditName: false,
|
|
1552
|
-
localTemplateName: ''
|
|
1553
|
-
}, () => {
|
|
1554
|
-
this.showTemplateName({ formData, onFormDataChange });
|
|
1555
|
-
});
|
|
1446
|
+
localTemplateName: '' // Clear local state on blur
|
|
1447
|
+
}, () => {
|
|
1448
|
+
this.showTemplateName({ formData, onFormDataChange });
|
|
1449
|
+
});
|
|
1556
1450
|
}}
|
|
1557
1451
|
onChange={(ev) => {
|
|
1558
1452
|
const { value } = ev.currentTarget;
|
|
@@ -1564,18 +1458,10 @@ export class Creatives extends React.Component {
|
|
|
1564
1458
|
}
|
|
1565
1459
|
|
|
1566
1460
|
showTemplateName = ({ formData, onFormDataChange }) => { //gets called from email/index after template data is fetched
|
|
1567
|
-
const {
|
|
1568
|
-
slidBoxContent, currentChannel, isEditName, templateStep,
|
|
1569
|
-
} = this.state;
|
|
1461
|
+
const { slidBoxContent, currentChannel, isEditName } = this.state;
|
|
1570
1462
|
const channel = currentChannel.toUpperCase();
|
|
1571
1463
|
if ([constants.EMAIL, constants.MOBILE_PUSH, constants.INAPP].includes(channel) && (slidBoxContent === 'editTemplate' || slidBoxContent === 'createTemplate')) {
|
|
1572
1464
|
const name = get(formData, 'template-name');
|
|
1573
|
-
|
|
1574
|
-
const isModeSelectionStep = templateStep === 'modeSelection' || this.creativesTemplateSteps[templateStep] === 'modeSelection';
|
|
1575
|
-
const isCreateMode = slidBoxContent === 'createTemplate';
|
|
1576
|
-
if (isCreateMode && isModeSelectionStep) {
|
|
1577
|
-
return;
|
|
1578
|
-
}
|
|
1579
1465
|
if (channel === constants.EMAIL && !name && slidBoxContent === 'createTemplate') {
|
|
1580
1466
|
this.setState({ isTemplateNameEmpty: true });
|
|
1581
1467
|
}
|
|
@@ -1583,9 +1469,9 @@ export class Creatives extends React.Component {
|
|
|
1583
1469
|
if (name && !isEditName) {
|
|
1584
1470
|
this.setState({ showTemplateNameComponentEdit: false });
|
|
1585
1471
|
} else if (isEditName) {
|
|
1586
|
-
this.setState({
|
|
1472
|
+
this.setState({
|
|
1587
1473
|
showTemplateNameComponentEdit: true,
|
|
1588
|
-
localTemplateName: name || ''
|
|
1474
|
+
localTemplateName: name || '' // Initialize local state with current value
|
|
1589
1475
|
});
|
|
1590
1476
|
}
|
|
1591
1477
|
}
|
|
@@ -1599,31 +1485,15 @@ export class Creatives extends React.Component {
|
|
|
1599
1485
|
});
|
|
1600
1486
|
}
|
|
1601
1487
|
|
|
1602
|
-
// Callback to update HTML Editor validation state (called from EmailWrapper)
|
|
1603
|
-
updateHtmlEditorValidationState = (validationState) => {
|
|
1604
|
-
this.setState({
|
|
1605
|
-
htmlEditorValidationState: validationState,
|
|
1606
|
-
});
|
|
1607
|
-
}
|
|
1608
|
-
|
|
1609
1488
|
shouldShowContinueFooter = () => { // only for email for now, has to be modified according to channel
|
|
1610
1489
|
const {
|
|
1611
|
-
slidBoxContent, templateStep, currentChannel, emailCreateMode, mobilePushCreateMode,
|
|
1490
|
+
slidBoxContent, templateStep, currentChannel, emailCreateMode, mobilePushCreateMode, inAppCreateMode, weChatTemplateType,
|
|
1612
1491
|
} = this.state;
|
|
1613
1492
|
let isShowContinueFooter = false;
|
|
1614
1493
|
const currentStep = this.creativesTemplateSteps[templateStep];
|
|
1615
1494
|
const channel = currentChannel.toUpperCase();
|
|
1616
|
-
// Check if supportCKEditor is false (new flow)
|
|
1617
|
-
const supportCKEditor = commonUtil.hasSupportCKEditor(); // Default to legacy flow
|
|
1618
1495
|
if (channel === constants.EMAIL || channel === constants.SMS) {
|
|
1619
|
-
|
|
1620
|
-
// Always show it (even if disabled) - visibility is separate from enabled state
|
|
1621
|
-
if (!supportCKEditor && currentStep === 'modeSelection' && slidBoxContent === 'createTemplate') {
|
|
1622
|
-
return true; // Return early to ensure visibility
|
|
1623
|
-
}
|
|
1624
|
-
|
|
1625
|
-
// Legacy flow: Original logic (only when supportCKEditor is true)
|
|
1626
|
-
if (supportCKEditor && ((emailCreateMode === "upload" && !isEmpty(this.props.EmailLayout)) || emailCreateMode === "editor")) {
|
|
1496
|
+
if ((emailCreateMode === "upload" && !isEmpty(this.props.EmailLayout)) || emailCreateMode === "editor") {
|
|
1627
1497
|
let isEmailCreate = slidBoxContent === 'createTemplate';
|
|
1628
1498
|
isEmailCreate = currentChannel.toUpperCase() === constants.EMAIL && ((emailCreateMode === "upload" && currentStep !== 'createTemplateContent') || (emailCreateMode === "editor" && currentStep !== 'createTemplateContent' && currentStep !== "templateSelection"));
|
|
1629
1499
|
isShowContinueFooter = isEmailCreate && emailCreateMode;
|
|
@@ -1632,6 +1502,8 @@ export class Creatives extends React.Component {
|
|
|
1632
1502
|
isShowContinueFooter = !isEmpty(mobilePushCreateMode) && currentStep === "modeSelection";
|
|
1633
1503
|
} else if (currentChannel.toUpperCase() === constants.WECHAT) {
|
|
1634
1504
|
isShowContinueFooter = !isEmpty(weChatTemplateType) && currentStep === "modeSelection";
|
|
1505
|
+
} else if (currentChannel.toUpperCase() === constants.INAPP) {
|
|
1506
|
+
isShowContinueFooter = !isEmpty(inAppCreateMode) && currentChannel === "modeSelection";
|
|
1635
1507
|
}
|
|
1636
1508
|
|
|
1637
1509
|
return isShowContinueFooter;
|
|
@@ -1657,28 +1529,6 @@ export class Creatives extends React.Component {
|
|
|
1657
1529
|
return true;
|
|
1658
1530
|
}
|
|
1659
1531
|
|
|
1660
|
-
// Check if Continue button should be disabled (for new flow only)
|
|
1661
|
-
isContinueButtonDisabled = () => {
|
|
1662
|
-
const { currentChannel, emailCreateMode, templateNameExists } = this.state;
|
|
1663
|
-
const { isFullMode } = this.props;
|
|
1664
|
-
const supportCKEditor = commonUtil.hasSupportCKEditor();
|
|
1665
|
-
if (supportCKEditor) {
|
|
1666
|
-
return false;
|
|
1667
|
-
}
|
|
1668
|
-
if (currentChannel.toUpperCase() === constants.EMAIL) {
|
|
1669
|
-
const isEditorSelected = !!emailCreateMode && emailCreateMode !== 'upload';
|
|
1670
|
-
// In full mode: require both template name AND editor selection
|
|
1671
|
-
// In library mode: require only editor selection (template name not needed)
|
|
1672
|
-
if (isFullMode) {
|
|
1673
|
-
const isTemplateNameValid = templateNameExists;
|
|
1674
|
-
return !(isTemplateNameValid && isEditorSelected);
|
|
1675
|
-
}
|
|
1676
|
-
// Library mode: only editor selection is required
|
|
1677
|
-
return !isEditorSelected;
|
|
1678
|
-
}
|
|
1679
|
-
return true;
|
|
1680
|
-
}
|
|
1681
|
-
|
|
1682
1532
|
render() {
|
|
1683
1533
|
const {
|
|
1684
1534
|
slidBoxContent,
|
|
@@ -1687,7 +1537,6 @@ export class Creatives extends React.Component {
|
|
|
1687
1537
|
templateData,
|
|
1688
1538
|
currentChannel,
|
|
1689
1539
|
emailCreateMode,
|
|
1690
|
-
selectedEmailCreateMode,
|
|
1691
1540
|
templateStep,
|
|
1692
1541
|
isLoadingContent,
|
|
1693
1542
|
mobilePushCreateMode,
|
|
@@ -1700,8 +1549,6 @@ export class Creatives extends React.Component {
|
|
|
1700
1549
|
activeFormBuilderTab,
|
|
1701
1550
|
showTestAndPreviewSlidebox,
|
|
1702
1551
|
isTestAndPreviewMode,
|
|
1703
|
-
inAppEditorType,
|
|
1704
|
-
htmlEditorValidationState,
|
|
1705
1552
|
} = this.state;
|
|
1706
1553
|
const {
|
|
1707
1554
|
isFullMode,
|
|
@@ -1724,34 +1571,9 @@ export class Creatives extends React.Component {
|
|
|
1724
1571
|
isLoyaltyModule,
|
|
1725
1572
|
loyaltyMetaData = {},
|
|
1726
1573
|
} = this.props;
|
|
1727
|
-
// Compute Continue button label
|
|
1728
|
-
const supportCKEditor = commonUtil.hasSupportCKEditor();
|
|
1729
|
-
const continueButtonLabel = supportCKEditor ? messages.continue : messages.next;
|
|
1730
|
-
|
|
1731
1574
|
const mapTemplateCreate = slidBoxContent === "createTemplate"
|
|
1732
1575
|
&& weChatTemplateType === MAP_TEMPLATE
|
|
1733
1576
|
&& templateStep !== "modeSelection";
|
|
1734
|
-
|
|
1735
|
-
// Determine if we're in HTML Editor mode (where errors are shown in ValidationErrorDisplay, not ErrorInfoNote in footer)
|
|
1736
|
-
const isEmailChannel = currentChannel?.toUpperCase() === constants.EMAIL;
|
|
1737
|
-
const isEditMode = slidBoxContent === 'editTemplate';
|
|
1738
|
-
const isHTMLEditorModeInCreate = selectedEmailCreateMode === 'html_editor';
|
|
1739
|
-
const isHTMLEditorModeInEdit = isEditMode && htmlEditorValidationState != null;
|
|
1740
|
-
const isHTMLEditorMode = isEmailChannel && (isHTMLEditorModeInCreate || isHTMLEditorModeInEdit);
|
|
1741
|
-
const isBEEEditor = selectedEmailCreateMode === 'drag_drop'
|
|
1742
|
-
|| (emailCreateMode === 'editor' && !isHTMLEditorMode);
|
|
1743
|
-
|
|
1744
|
-
// Check for BEE editor errors (same logic as SlideBoxFooter)
|
|
1745
|
-
const hasStandardErrors = liquidErrorMessage && liquidErrorMessage.STANDARD_ERROR_MSG && liquidErrorMessage.STANDARD_ERROR_MSG.length > 0;
|
|
1746
|
-
const hasLiquidErrors = liquidErrorMessage && liquidErrorMessage.LIQUID_ERROR_MSG && liquidErrorMessage.LIQUID_ERROR_MSG.length > 0;
|
|
1747
|
-
const htmlEditorHasErrors = htmlEditorValidationState && htmlEditorValidationState.issueCounts && htmlEditorValidationState.issueCounts.total > 0;
|
|
1748
|
-
const hasBEEEditorErrors = isEmailChannel && (hasStandardErrors || hasLiquidErrors) && (!htmlEditorValidationState || !htmlEditorHasErrors);
|
|
1749
|
-
|
|
1750
|
-
// Only apply margin to footer when ErrorInfoNote is shown in footer (BEE editor)
|
|
1751
|
-
// For HTML Editor, errors are shown in ValidationErrorDisplay (inside content area), so no footer margin needed
|
|
1752
|
-
const shouldShowErrorInfoNoteInFooter = hasBEEEditorErrors;
|
|
1753
|
-
|
|
1754
|
-
// Calculate margin for header/content (always apply if there are errors, regardless of editor type)
|
|
1755
1577
|
const slideBoxWrapperMargin = (get(liquidErrorMessage, 'STANDARD_ERROR_MSG.length', 0) > 0 && get(liquidErrorMessage, 'LIQUID_ERROR_MSG.length', 0) > 0)
|
|
1756
1578
|
? CAP_SPACE_64
|
|
1757
1579
|
: get(liquidErrorMessage, 'LIQUID_ERROR_MSG.length', 0) > 0
|
|
@@ -1761,11 +1583,7 @@ export class Creatives extends React.Component {
|
|
|
1761
1583
|
: 0;
|
|
1762
1584
|
/* TODO: Instead of passing down same props separately to each component down, write common function to these props and pass it accordingly */
|
|
1763
1585
|
return (
|
|
1764
|
-
<SlideBoxWrapper
|
|
1765
|
-
slideBoxWrapperMargin={slideBoxWrapperMargin}
|
|
1766
|
-
shouldApplyFooterMargin={shouldShowErrorInfoNoteInFooter}
|
|
1767
|
-
className={classnames(`${classPrefix} ${isFullMode ? 'creatives-full-mode' : 'creatives-library-mode'} ${mapTemplateCreate ? 'map-template-create' : ''}`)}
|
|
1768
|
-
>
|
|
1586
|
+
<SlideBoxWrapper slideBoxWrapperMargin={slideBoxWrapperMargin} className={classnames(`${classPrefix} ${isFullMode ? 'creatives-full-mode' : 'creatives-library-mode'} ${mapTemplateCreate ? 'map-template-create' : ''}`)}>
|
|
1769
1587
|
<CapSlideBox
|
|
1770
1588
|
header={
|
|
1771
1589
|
this.shouldShowHeader() && (
|
|
@@ -1814,8 +1632,6 @@ export class Creatives extends React.Component {
|
|
|
1814
1632
|
onChannelChange={this.onChannelChange}
|
|
1815
1633
|
onEmailModeChange={this.onEmailModeChange}//used when create is clicked in email
|
|
1816
1634
|
emailCreateMode={emailCreateMode}// upload zip || use editor are values
|
|
1817
|
-
onInAppEditorTypeChange={this.onInAppEditorTypeChange}//used when create is clicked in inapp
|
|
1818
|
-
inAppEditorType={inAppEditorType}// htmlEditor || dragDropEditor are values
|
|
1819
1635
|
templateStep={this.creativesTemplateSteps[templateStep]}
|
|
1820
1636
|
onCreateNextStep={this.onCreateNextStep}
|
|
1821
1637
|
onEnterTemplateName={this.onEnterTemplateName}
|
|
@@ -1825,8 +1641,6 @@ export class Creatives extends React.Component {
|
|
|
1825
1641
|
cap={cap}
|
|
1826
1642
|
setIsLoadingContent={this.setIsLoadingContent}
|
|
1827
1643
|
onMobilepushModeChange={this.onMobilepushModeChange}
|
|
1828
|
-
inAppCreateMode={this.state.inAppCreateMode}
|
|
1829
|
-
onInAppModeChange={this.onInAppModeChange}
|
|
1830
1644
|
mobilePushCreateMode={mobilePushCreateMode}
|
|
1831
1645
|
showTemplateName={this.showTemplateName}
|
|
1832
1646
|
onValidationFail={this.onValidationFail}
|
|
@@ -1865,7 +1679,6 @@ export class Creatives extends React.Component {
|
|
|
1865
1679
|
handleTestAndPreview={this.handleTestAndPreview}
|
|
1866
1680
|
handleCloseTestAndPreview={this.handleCloseTestAndPreview}
|
|
1867
1681
|
isTestAndPreviewMode={(() => this.state.isTestAndPreviewMode)()}
|
|
1868
|
-
onHtmlEditorValidationStateChange={this.updateHtmlEditorValidationState}
|
|
1869
1682
|
/>
|
|
1870
1683
|
)}
|
|
1871
1684
|
footer={this.shouldShowFooter() ? (
|
|
@@ -1880,7 +1693,6 @@ export class Creatives extends React.Component {
|
|
|
1880
1693
|
currentChannel={currentChannel.toUpperCase()}
|
|
1881
1694
|
templateStep={this.creativesTemplateSteps[templateStep]}
|
|
1882
1695
|
emailCreateMode={emailCreateMode}
|
|
1883
|
-
selectedEmailCreateMode={selectedEmailCreateMode}
|
|
1884
1696
|
shouldShowContinueFooter={this.shouldShowContinueFooter}
|
|
1885
1697
|
shouldShowDoneFooter={this.shouldShowDoneFooter}
|
|
1886
1698
|
fetchingCmsData={fetchingCmsData}
|
|
@@ -1889,21 +1701,17 @@ export class Creatives extends React.Component {
|
|
|
1889
1701
|
errorMessages={liquidErrorMessage}
|
|
1890
1702
|
currentTab={activeFormBuilderTab}
|
|
1891
1703
|
onTestAndPreview={this.handleTestAndPreview}
|
|
1892
|
-
isContinueButtonDisabled={this.isContinueButtonDisabled()}
|
|
1893
|
-
continueButtonLabel={continueButtonLabel}
|
|
1894
1704
|
showTestAndPreviewButton={(() => {
|
|
1895
1705
|
const showButton = currentChannel.toUpperCase() === constants.EMAIL && (slidBoxContent === 'editTemplate' || slidBoxContent === 'createTemplate');
|
|
1896
1706
|
return showButton;
|
|
1897
1707
|
})()}
|
|
1898
|
-
htmlEditorValidationState={htmlEditorValidationState}
|
|
1899
|
-
isCreatingTemplate={slidBoxContent === 'createTemplate' && currentChannel.toUpperCase() === constants.EMAIL}
|
|
1900
1708
|
/>
|
|
1901
1709
|
) : isLiquidValidationError && (
|
|
1902
1710
|
<CapRow className="template-footer-width">
|
|
1903
1711
|
{(() => {
|
|
1904
1712
|
const errorsToShow = get(liquidErrorMessage, constants.LIQUID_ERROR_MSG, []);
|
|
1905
1713
|
const standardErrorsToShow = get(liquidErrorMessage, constants.STANDARD_ERROR_MSG, []);
|
|
1906
|
-
return <ErrorInfoNote currentTab={activeFormBuilderTab?.toUpperCase()} errorMessages={{
|
|
1714
|
+
return <ErrorInfoNote currentTab={activeFormBuilderTab?.toUpperCase()} errorMessages={{LIQUID_ERROR_MSG: errorsToShow, STANDARD_ERROR_MSG: standardErrorsToShow}} />;
|
|
1907
1715
|
})()}
|
|
1908
1716
|
</CapRow>
|
|
1909
1717
|
)}
|
|
@@ -282,10 +282,6 @@ export default defineMessages({
|
|
|
282
282
|
id: `${scope}.creativesTemplatesUpdate`,
|
|
283
283
|
defaultMessage: `Update`,
|
|
284
284
|
},
|
|
285
|
-
"creativesTemplatesDone": {
|
|
286
|
-
id: `${scope}.creativesTemplatesDone`,
|
|
287
|
-
defaultMessage: `Done`,
|
|
288
|
-
},
|
|
289
285
|
"creativesTemplatesDiscard": {
|
|
290
286
|
id: `${scope}.creativesTemplatesDiscard`,
|
|
291
287
|
defaultMessage: `Discard`,
|
|
@@ -370,8 +366,4 @@ export default defineMessages({
|
|
|
370
366
|
id: `${scope}.testAndPreview`,
|
|
371
367
|
defaultMessage: `Preview and Test`,
|
|
372
368
|
},
|
|
373
|
-
"next": {
|
|
374
|
-
id: `${scope}.next`,
|
|
375
|
-
defaultMessage: `Next`,
|
|
376
|
-
},
|
|
377
369
|
});
|
|
@@ -43,12 +43,7 @@ describe("test for empty email empty template name", () => {
|
|
|
43
43
|
slidBoxContent: "editTemplate",
|
|
44
44
|
currentChannel: "EMAIL",
|
|
45
45
|
templateStep: "modeSelection",
|
|
46
|
-
isTemplateNameEmpty: true
|
|
47
|
-
htmlEditorValidationState: {
|
|
48
|
-
isContentEmpty: false,
|
|
49
|
-
issueCounts: { html: 0, label: 0, liquid: 0, total: 0 },
|
|
50
|
-
},
|
|
51
|
-
isCreatingTemplate: false,
|
|
46
|
+
isTemplateNameEmpty: true
|
|
52
47
|
}
|
|
53
48
|
renderComponent(props);
|
|
54
49
|
const errorMessage = await screen.findByText(/template name cannot be empty/i);
|
|
@@ -57,11 +52,7 @@ describe("test for empty email empty template name", () => {
|
|
|
57
52
|
expect(updateBtn).toBeDisabled();
|
|
58
53
|
renderComponent({
|
|
59
54
|
...props,
|
|
60
|
-
isTemplateNameEmpty: false
|
|
61
|
-
htmlEditorValidationState: {
|
|
62
|
-
isContentEmpty: false,
|
|
63
|
-
issueCounts: { html: 0, label: 0, liquid: 0, total: 0 },
|
|
64
|
-
},
|
|
55
|
+
isTemplateNameEmpty: false
|
|
65
56
|
})
|
|
66
57
|
const updateBtns = screen.getAllByRole('button',{name:/update/i});
|
|
67
58
|
expect(updateBtns[1]).toBeEnabled();
|