@capillarytech/creatives-library 8.0.245 → 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 -115
- 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 +28 -217
- 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 -612
- 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
|
@@ -10,7 +10,6 @@ import SmsWrapper from '../SmsWrapper';
|
|
|
10
10
|
import Email from '../Email';
|
|
11
11
|
import EmailWrapper from '../EmailWrapper';
|
|
12
12
|
import MobilepushWrapper from '../MobilepushWrapper';
|
|
13
|
-
import InAppWrapper from '../InAppWrapper';
|
|
14
13
|
import EmailPreviewV2 from '../../v2Components/EmailPreviewV2';
|
|
15
14
|
import MobilePushPreview from '../../v2Components/MobilePushPreviewV2';
|
|
16
15
|
import WechatWrapper from '../WeChat/Wrapper';
|
|
@@ -116,11 +115,7 @@ export function SlideBoxContent(props) {
|
|
|
116
115
|
emailCreateMode,
|
|
117
116
|
onMobilepushModeChange,
|
|
118
117
|
mobilePushCreateMode,
|
|
119
|
-
onInAppEditorTypeChange,
|
|
120
|
-
inAppEditorType,
|
|
121
118
|
templateStep,
|
|
122
|
-
inAppCreateMode,
|
|
123
|
-
onInAppModeChange,
|
|
124
119
|
onEnterTemplateName,
|
|
125
120
|
onRemoveTemplateName,
|
|
126
121
|
onCreateNextStep,
|
|
@@ -169,8 +164,6 @@ export function SlideBoxContent(props) {
|
|
|
169
164
|
handleTestAndPreview,
|
|
170
165
|
handleCloseTestAndPreview,
|
|
171
166
|
isTestAndPreviewMode,
|
|
172
|
-
supportedTags = [],
|
|
173
|
-
onHtmlEditorValidationStateChange,
|
|
174
167
|
} = props;
|
|
175
168
|
const type = (messageDetails.type || '').toLowerCase(); // type is context in get tags values : outbound | dvs | referral | loyalty | coupons
|
|
176
169
|
const query = { type: !isFullMode && 'embedded', module: isFullMode ? 'default' : 'library', isEditFromCampaigns: (templateData || {}).isEditFromCampaigns};
|
|
@@ -636,95 +629,44 @@ export function SlideBoxContent(props) {
|
|
|
636
629
|
handleTestAndPreview={handleTestAndPreview}
|
|
637
630
|
handleCloseTestAndPreview={handleCloseTestAndPreview}
|
|
638
631
|
isTestAndPreviewMode={isTestAndPreviewMode}
|
|
639
|
-
location={location}
|
|
640
|
-
onHtmlEditorValidationStateChange={onHtmlEditorValidationStateChange}
|
|
641
632
|
/>
|
|
642
633
|
)}
|
|
643
634
|
{(isEditEmailWithId || isEmailEditWithContent) && (
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
isTestAndPreviewMode={isTestAndPreviewMode}
|
|
680
|
-
onHtmlEditorValidationStateChange={onHtmlEditorValidationStateChange}
|
|
681
|
-
/>
|
|
682
|
-
);
|
|
683
|
-
}
|
|
684
|
-
// HTML template: Use EmailWrapper component (which uses EmailWithoutSaga)
|
|
685
|
-
return (
|
|
686
|
-
<EmailWrapper
|
|
687
|
-
key="cretives-container-email-edit-wrapper"
|
|
688
|
-
setIsLoadingContent={setIsLoadingContent}
|
|
689
|
-
onEmailModeChange={onEmailModeChange}
|
|
690
|
-
emailCreateMode="editor"
|
|
691
|
-
isGetFormData={isGetFormData}
|
|
692
|
-
getFormdata={getFormData}
|
|
693
|
-
templateData={templateData}
|
|
694
|
-
type={type}
|
|
695
|
-
step="createTemplateContent"
|
|
696
|
-
showNextStep={onCreateNextStep}
|
|
697
|
-
isFullMode={isFullMode}
|
|
698
|
-
editor={editor}
|
|
699
|
-
cap={cap}
|
|
700
|
-
onResetStep={onResetStep}
|
|
701
|
-
showTemplateName={showTemplateName}
|
|
702
|
-
onEnterTemplateName={onEnterTemplateName}
|
|
703
|
-
onRemoveTemplateName={onRemoveTemplateName}
|
|
704
|
-
onValidationFail={onValidationFail}
|
|
705
|
-
forwardedTags={forwardedTags}
|
|
706
|
-
selectedOfferDetails={selectedOfferDetails}
|
|
707
|
-
onPreviewContentClicked={onPreviewContentClicked}
|
|
708
|
-
onTestContentClicked={onTestContentClicked}
|
|
709
|
-
getCmsTemplatesInProgress={getCmsTemplatesInProgress}
|
|
710
|
-
moduleType={moduleType}
|
|
711
|
-
showLiquidErrorInFooter={showLiquidErrorInFooter}
|
|
712
|
-
eventContextTags={eventContextTags}
|
|
713
|
-
isLoyaltyModule={isLoyaltyModule}
|
|
714
|
-
showTestAndPreviewSlidebox={showTestAndPreviewSlidebox}
|
|
715
|
-
handleTestAndPreview={handleTestAndPreview}
|
|
716
|
-
handleCloseTestAndPreview={handleCloseTestAndPreview}
|
|
717
|
-
isTestAndPreviewMode={isTestAndPreviewMode}
|
|
718
|
-
onHtmlEditorValidationStateChange={onHtmlEditorValidationStateChange}
|
|
719
|
-
location={{
|
|
720
|
-
pathname: `/email/edit/${templateData._id}`,
|
|
721
|
-
query: { type: 'embedded', module: 'library', id: templateData._id },
|
|
722
|
-
}}
|
|
723
|
-
params={{ id: templateData._id }}
|
|
724
|
-
/>
|
|
725
|
-
);
|
|
726
|
-
})()
|
|
727
|
-
)}
|
|
635
|
+
<Email
|
|
636
|
+
key="cretives-container-email-edit"
|
|
637
|
+
setIsLoadingContent={setIsLoadingContent}
|
|
638
|
+
location={{
|
|
639
|
+
pathname: `/email/edit`,
|
|
640
|
+
query: { type: 'embedded', module: 'library'},
|
|
641
|
+
}}
|
|
642
|
+
route={{ name: 'email' }}
|
|
643
|
+
isGetFormData={isGetFormData}
|
|
644
|
+
getFormdata={getFormData}
|
|
645
|
+
params={{ id: templateData._id }}
|
|
646
|
+
templateData={templateData}
|
|
647
|
+
getFormSubscriptionData={getFormData}
|
|
648
|
+
getDefaultTags={type}
|
|
649
|
+
isFullMode={isFullMode}
|
|
650
|
+
editor={editor}
|
|
651
|
+
cap={cap}
|
|
652
|
+
showTemplateName={showTemplateName}
|
|
653
|
+
onValidationFail={onValidationFail}
|
|
654
|
+
forwardedTags={forwardedTags}
|
|
655
|
+
selectedOfferDetails={selectedOfferDetails}
|
|
656
|
+
onPreviewContentClicked={onPreviewContentClicked}
|
|
657
|
+
onTestContentClicked={onTestContentClicked}
|
|
658
|
+
moduleType={moduleType}
|
|
659
|
+
showLiquidErrorInFooter={showLiquidErrorInFooter}
|
|
660
|
+
eventContextTags={eventContextTags}
|
|
661
|
+
isLoyaltyModule={isLoyaltyModule}
|
|
662
|
+
showTestAndPreviewSlidebox={showTestAndPreviewSlidebox}
|
|
663
|
+
handleTestAndPreview={handleTestAndPreview}
|
|
664
|
+
handleCloseTestAndPreview={handleCloseTestAndPreview}
|
|
665
|
+
isTestAndPreviewMode={(() => {
|
|
666
|
+
return isTestAndPreviewMode;
|
|
667
|
+
})()}
|
|
668
|
+
/>
|
|
669
|
+
)}
|
|
728
670
|
{isEditMPush && (
|
|
729
671
|
(isFullMode && !commonUtil.hasNewMobilePushFeatureEnabled()) ||
|
|
730
672
|
(!isFullMode && isLoyaltyModule) ||
|
|
@@ -998,39 +940,22 @@ export function SlideBoxContent(props) {
|
|
|
998
940
|
/>
|
|
999
941
|
)}
|
|
1000
942
|
|
|
1001
|
-
{isCreateInApp && (
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
showTemplateName={showTemplateName}
|
|
1018
|
-
onEnterTemplateName={onEnterTemplateName}
|
|
1019
|
-
onRemoveTemplateName={onRemoveTemplateName}
|
|
1020
|
-
onValidationFail={onValidationFail}
|
|
1021
|
-
forwardedTags={forwardedTags}
|
|
1022
|
-
selectedOfferDetails={selectedOfferDetails}
|
|
1023
|
-
onPreviewContentClicked={onPreviewContentClicked}
|
|
1024
|
-
onTestContentClicked={onTestContentClicked}
|
|
1025
|
-
moduleType={moduleType}
|
|
1026
|
-
showLiquidErrorInFooter={showLiquidErrorInFooter}
|
|
1027
|
-
eventContextTags={eventContextTags}
|
|
1028
|
-
onCreateComplete={onCreateComplete}
|
|
1029
|
-
handleClose={handleClose}
|
|
1030
|
-
getDefaultTags={type}
|
|
1031
|
-
onInAppModeChange={onInAppModeChange}
|
|
1032
|
-
inAppCreateMode={inAppCreateMode}
|
|
1033
|
-
/>
|
|
943
|
+
{isCreateInApp && (<InApp
|
|
944
|
+
isFullMode={isFullMode}
|
|
945
|
+
onCreateComplete={onCreateComplete}
|
|
946
|
+
handleClose={handleClose}
|
|
947
|
+
location={{
|
|
948
|
+
pathname: `/inapp/create`,
|
|
949
|
+
query,
|
|
950
|
+
search: '',
|
|
951
|
+
}}
|
|
952
|
+
getFormData={getFormData}
|
|
953
|
+
isGetFormData={isGetFormData}
|
|
954
|
+
templateData={templateData}
|
|
955
|
+
getDefaultTags={type}
|
|
956
|
+
eventContextTags={eventContextTags}
|
|
957
|
+
showLiquidErrorInFooter={showLiquidErrorInFooter}
|
|
958
|
+
/>
|
|
1034
959
|
)}
|
|
1035
960
|
|
|
1036
961
|
{isEditInApp && (<InApp
|
|
@@ -1085,8 +1010,6 @@ SlideBoxContent.propTypes = {
|
|
|
1085
1010
|
onSelectTemplate: PropTypes.func,
|
|
1086
1011
|
onPreviewTemplate: PropTypes.func,
|
|
1087
1012
|
templateData: PropTypes.object,
|
|
1088
|
-
onInAppEditorTypeChange: PropTypes.func,
|
|
1089
|
-
inAppEditorType: PropTypes.object,
|
|
1090
1013
|
location: PropTypes.object,
|
|
1091
1014
|
isGetFormData: PropTypes.bool,
|
|
1092
1015
|
getFormData: PropTypes.func,
|
|
@@ -7,15 +7,12 @@ import PropTypes from 'prop-types';
|
|
|
7
7
|
import messages from './messages';
|
|
8
8
|
import ErrorInfoNote from '../../v2Components/ErrorInfoNote';
|
|
9
9
|
import { PREVIEW } from './constants';
|
|
10
|
-
import { EMAIL_CREATE_MODES } from '../EmailWrapper/constants';
|
|
11
10
|
|
|
12
|
-
function getFullModeSaveBtn(slidBoxContent
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
? <FormattedMessage {...messages.creativesTemplatesUpdate} />
|
|
18
|
-
: <FormattedMessage {...messages.creativesTemplatesSaveFullMode} />;
|
|
11
|
+
function getFullModeSaveBtn(slidBoxContent) {
|
|
12
|
+
return slidBoxContent === "editTemplate" ?
|
|
13
|
+
<FormattedMessage {...messages.creativesTemplatesUpdate}/>
|
|
14
|
+
:
|
|
15
|
+
<FormattedMessage {...messages.creativesTemplatesSaveFullMode}/>;
|
|
19
16
|
}
|
|
20
17
|
function SlideBoxFooter(props) {
|
|
21
18
|
const {
|
|
@@ -34,92 +31,11 @@ function SlideBoxFooter(props) {
|
|
|
34
31
|
showTestAndPreviewButton,
|
|
35
32
|
shouldShowDoneFooter,
|
|
36
33
|
shouldShowContinueFooter,
|
|
37
|
-
isContinueButtonDisabled,
|
|
38
|
-
continueButtonLabel,
|
|
39
|
-
htmlEditorValidationState,
|
|
40
|
-
isCreatingTemplate,
|
|
41
|
-
currentChannel,
|
|
42
|
-
emailCreateMode,
|
|
43
|
-
selectedEmailCreateMode,
|
|
44
34
|
} = props;
|
|
45
35
|
|
|
46
|
-
// Calculate if buttons should be disabled
|
|
47
|
-
// Only apply validation state checks for EMAIL channel in HTML Editor mode (not BEE/DragDrop)
|
|
48
|
-
// For other channels, BEE editor, or when htmlEditorValidationState is not provided, don't disable based on validation
|
|
49
|
-
const isEmailChannel = currentChannel?.toUpperCase() === 'EMAIL';
|
|
50
|
-
const isEditMode = slidBoxContent === 'editTemplate';
|
|
51
|
-
|
|
52
|
-
// Use selectedEmailCreateMode for accurate mode detection in create mode (emailCreateMode is mapped for backwards compatibility)
|
|
53
|
-
// In edit mode: If htmlEditorValidationState is provided, assume HTML Editor mode (since only HTML Editor sends validation state)
|
|
54
|
-
// Upload mode also uses HTML Editor, so include it in HTML Editor mode check
|
|
55
|
-
const isUploadMode = emailCreateMode === EMAIL_CREATE_MODES.UPLOAD;
|
|
56
|
-
const isHTMLEditorModeInCreate = selectedEmailCreateMode === EMAIL_CREATE_MODES.HTML_EDITOR || isUploadMode;
|
|
57
|
-
const isHTMLEditorModeInEdit = isEditMode && htmlEditorValidationState != null;
|
|
58
|
-
const isHTMLEditorMode = isHTMLEditorModeInCreate || isHTMLEditorModeInEdit;
|
|
59
|
-
|
|
60
|
-
const isBEEEditor = selectedEmailCreateMode === EMAIL_CREATE_MODES.DRAG_DROP
|
|
61
|
-
|| (emailCreateMode === EMAIL_CREATE_MODES.EDITOR && !isHTMLEditorMode);
|
|
62
|
-
// Only check validation for HTML Editor mode, not for BEE/DragDrop editor
|
|
63
|
-
const shouldCheckValidation = isEmailChannel && htmlEditorValidationState && isHTMLEditorMode && !isBEEEditor;
|
|
64
|
-
const isContentEmpty = shouldCheckValidation ? (htmlEditorValidationState?.isContentEmpty ?? true) : false;
|
|
65
|
-
const issueCounts = shouldCheckValidation ? (htmlEditorValidationState?.issueCounts ?? {
|
|
66
|
-
html: 0, label: 0, liquid: 0, total: 0,
|
|
67
|
-
}) : {
|
|
68
|
-
html: 0, label: 0, liquid: 0, total: 0,
|
|
69
|
-
};
|
|
70
|
-
// Check if validation has completed
|
|
71
|
-
const validationComplete = shouldCheckValidation ? (htmlEditorValidationState?.validationComplete ?? false) : true;
|
|
72
|
-
const hasValidationErrors = shouldCheckValidation && (issueCounts.html > 0 || issueCounts.label > 0 || issueCounts.liquid > 0);
|
|
73
|
-
const errorsAcknowledged = shouldCheckValidation ? (htmlEditorValidationState?.errorsAcknowledged ?? false) : true;
|
|
74
|
-
|
|
75
|
-
// IMPORTANT: In both modes, if validation finds errors, buttons must stay disabled until user acknowledges by clicking redirection icon
|
|
76
|
-
let shouldDisableButtons = false;
|
|
77
|
-
if (shouldCheckValidation) {
|
|
78
|
-
if (isEditMode) {
|
|
79
|
-
// Edit mode: Disable if validation has completed AND found errors AND errors not acknowledged
|
|
80
|
-
shouldDisableButtons = validationComplete && hasValidationErrors && !errorsAcknowledged;
|
|
81
|
-
} else {
|
|
82
|
-
// Create mode:
|
|
83
|
-
// 1. Disable until validation completes
|
|
84
|
-
// 2. Disable if content is empty
|
|
85
|
-
// 3. Disable if validation finds errors AND errors not acknowledged (user must click redirection icon)
|
|
86
|
-
shouldDisableButtons = !validationComplete || isContentEmpty || (hasValidationErrors && !errorsAcknowledged);
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
// Show ErrorInfoNote for API validation errors (from validateLiquidTemplateContent)
|
|
91
|
-
// For HTML Editor: API validation errors are shown in ValidationErrorDisplay (inside CodeEditorPane), not here
|
|
92
|
-
const hasStandardErrors = errorMessages && errorMessages.STANDARD_ERROR_MSG && errorMessages.STANDARD_ERROR_MSG.length > 0;
|
|
93
|
-
const hasLiquidErrors = errorMessages && errorMessages.LIQUID_ERROR_MSG && errorMessages.LIQUID_ERROR_MSG.length > 0;
|
|
94
|
-
|
|
95
|
-
// Check if htmlEditorValidationState has actual validation errors
|
|
96
|
-
// If htmlEditorValidationState exists but has no errors (total === 0), and we have STANDARD/LIQUID errors,
|
|
97
|
-
// then those errors are from BEE editor (FormBuilder validation), not HTML Editor
|
|
98
|
-
const htmlEditorHasErrors = htmlEditorValidationState && htmlEditorValidationState.issueCounts && htmlEditorValidationState.issueCounts.total > 0;
|
|
99
|
-
|
|
100
|
-
// BEE editor errors: We have STANDARD/LIQUID errors AND either:
|
|
101
|
-
// 1. No htmlEditorValidationState exists, OR
|
|
102
|
-
// 2. htmlEditorValidationState exists but has no actual errors (meaning errors are from FormBuilder/BEE editor)
|
|
103
|
-
// IMPORTANT: Only check for BEE editor errors when NOT in HTML Editor mode (upload or html_editor)
|
|
104
|
-
// Upload mode uses HTML Editor, so BEE editor errors don't apply
|
|
105
|
-
const isBEEEditorMode = !isHTMLEditorMode;
|
|
106
|
-
const hasBEEEditorErrors = isEmailChannel && isBEEEditorMode && (hasStandardErrors || hasLiquidErrors) && (!htmlEditorValidationState || !htmlEditorHasErrors);
|
|
107
|
-
|
|
108
|
-
// Also disable buttons if there are BEE editor errors (only when using BEE Editor, not HTML Editor/upload)
|
|
109
|
-
if (hasBEEEditorErrors) {
|
|
110
|
-
shouldDisableButtons = true;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
const shouldShowErrorInfoNote = hasBEEEditorErrors;
|
|
114
36
|
return (
|
|
115
|
-
<div className=
|
|
116
|
-
{
|
|
117
|
-
<ErrorInfoNote
|
|
118
|
-
errorMessages={errorMessages}
|
|
119
|
-
currentTab={currentTab?.toUpperCase()}
|
|
120
|
-
useLegacyDisplay // Use simple list display for BEE Editor (not tabbed interface)
|
|
121
|
-
/>
|
|
122
|
-
)}
|
|
37
|
+
<div className='template-footer-width'>
|
|
38
|
+
{isLiquidValidationError && (<ErrorInfoNote errorMessages={errorMessages} currentTab={currentTab?.toUpperCase()} />)}
|
|
123
39
|
<div>
|
|
124
40
|
{shouldShowDoneFooter() && (
|
|
125
41
|
<div>
|
|
@@ -131,10 +47,10 @@ function SlideBoxFooter(props) {
|
|
|
131
47
|
<CapRow>
|
|
132
48
|
<CapButton
|
|
133
49
|
onClick={onSave}
|
|
134
|
-
disabled={isTemplateNameEmpty || fetchingCmsData ||
|
|
50
|
+
disabled={isTemplateNameEmpty || fetchingCmsData || false}
|
|
135
51
|
>
|
|
136
52
|
{isFullMode ? (
|
|
137
|
-
getFullModeSaveBtn(slidBoxContent
|
|
53
|
+
getFullModeSaveBtn(slidBoxContent)
|
|
138
54
|
) : (
|
|
139
55
|
<FormattedMessage {...messages.creativesTemplatesSave} />
|
|
140
56
|
)}
|
|
@@ -143,7 +59,7 @@ function SlideBoxFooter(props) {
|
|
|
143
59
|
<CapButton
|
|
144
60
|
type="secondary"
|
|
145
61
|
onClick={onTestAndPreview}
|
|
146
|
-
disabled={
|
|
62
|
+
// disabled={isEmptyContent || false}
|
|
147
63
|
style={{ marginLeft: '8px' }}
|
|
148
64
|
>
|
|
149
65
|
<FormattedMessage {...messages.testAndPreview} />
|
|
@@ -154,11 +70,8 @@ function SlideBoxFooter(props) {
|
|
|
154
70
|
</div>
|
|
155
71
|
)}
|
|
156
72
|
{shouldShowContinueFooter() && (
|
|
157
|
-
<CapButton
|
|
158
|
-
|
|
159
|
-
disabled={isContinueButtonDisabled || false}
|
|
160
|
-
>
|
|
161
|
-
<FormattedMessage {...(continueButtonLabel || messages.continue)} />
|
|
73
|
+
<CapButton onClick={onCreateNextStep}>
|
|
74
|
+
<FormattedMessage {...messages.continue} />
|
|
162
75
|
</CapButton>
|
|
163
76
|
)}
|
|
164
77
|
{slidBoxContent === PREVIEW && (
|
|
@@ -186,21 +99,5 @@ SlideBoxFooter.propTypes = {
|
|
|
186
99
|
onTestAndPreview: PropTypes.func,
|
|
187
100
|
isEmptyContent: PropTypes.bool,
|
|
188
101
|
showTestAndPreviewButton: PropTypes.bool,
|
|
189
|
-
isContinueButtonDisabled: PropTypes.bool,
|
|
190
|
-
continueButtonLabel: PropTypes.object,
|
|
191
|
-
htmlEditorValidationState: PropTypes.shape({
|
|
192
|
-
isContentEmpty: PropTypes.bool,
|
|
193
|
-
issueCounts: PropTypes.shape({
|
|
194
|
-
html: PropTypes.number,
|
|
195
|
-
label: PropTypes.number,
|
|
196
|
-
liquid: PropTypes.number,
|
|
197
|
-
total: PropTypes.number,
|
|
198
|
-
}),
|
|
199
|
-
validationComplete: PropTypes.bool,
|
|
200
|
-
}),
|
|
201
|
-
isCreatingTemplate: PropTypes.bool,
|
|
202
|
-
currentChannel: PropTypes.string,
|
|
203
|
-
emailCreateMode: PropTypes.string,
|
|
204
|
-
selectedEmailCreateMode: PropTypes.string,
|
|
205
102
|
};
|
|
206
103
|
export default SlideBoxFooter;
|
|
@@ -45,7 +45,6 @@ export function SlideBoxHeader(props) {
|
|
|
45
45
|
const isZaloEdit = channel.toLowerCase() === ZALO && slidBoxContent === 'editTemplate';
|
|
46
46
|
const zaloOverview = isZaloEdit && isFullMode;
|
|
47
47
|
const whatsappOverview = isWhatsappEdit && isFullMode;
|
|
48
|
-
const shouldShowInAppEditHeader = isInAppEdit && !isFullMode;
|
|
49
48
|
const headerMessage = whatsappOverview ? messages.whatsappOverview : zaloOverview ? messages.zaloOverview : messages.editMessageContent;
|
|
50
49
|
const {
|
|
51
50
|
whatsappTemplateName,
|
|
@@ -110,7 +109,7 @@ export function SlideBoxHeader(props) {
|
|
|
110
109
|
}
|
|
111
110
|
/>
|
|
112
111
|
)}
|
|
113
|
-
{!showTemplateNameHeader && slidBoxContent === 'editTemplate' && (
|
|
112
|
+
{!showTemplateNameHeader && slidBoxContent === 'editTemplate' && (
|
|
114
113
|
<CapHeader
|
|
115
114
|
className="support-video-elements"
|
|
116
115
|
title={<FormattedMessage {...headerMessage} values={{ channel: getChannelLabel(channel) }} />}
|