@capillarytech/creatives-library 8.0.259 → 8.0.260-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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 -34
- package/translations/en.json +3 -4
- package/utils/common.js +0 -12
- 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 -457
- package/v2Components/ErrorInfoNote/messages.js +6 -36
- package/v2Components/ErrorInfoNote/style.scss +6 -282
- package/v2Components/FormBuilder/index.js +4 -4
- package/v2Components/FormBuilder/tests/index.test.js +4 -13
- package/v2Components/HtmlEditor/HTMLEditor.js +94 -547
- package/v2Components/HtmlEditor/__tests__/HTMLEditor.test.js +133 -1441
- package/v2Components/HtmlEditor/__tests__/index.lazy.test.js +16 -27
- package/v2Components/HtmlEditor/_htmlEditor.scss +45 -108
- package/v2Components/HtmlEditor/_index.lazy.scss +1 -0
- package/v2Components/HtmlEditor/components/CodeEditorPane/_codeEditorPane.scss +102 -23
- package/v2Components/HtmlEditor/components/CodeEditorPane/index.js +140 -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 +4 -4
- 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 +43 -22
- 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/_validationErrorDisplay.scss +0 -1
- package/v2Components/HtmlEditor/components/ValidationErrorDisplay/index.js +31 -49
- package/v2Components/HtmlEditor/components/ValidationPanel/_validationPanel.scss +34 -50
- package/v2Components/HtmlEditor/components/ValidationPanel/index.js +41 -70
- package/v2Components/HtmlEditor/constants.js +20 -42
- package/v2Components/HtmlEditor/hooks/__tests__/useInAppContent.test.js +16 -373
- package/v2Components/HtmlEditor/hooks/__tests__/useValidation.test.js +16 -120
- package/v2Components/HtmlEditor/hooks/useEditorContent.js +2 -5
- package/v2Components/HtmlEditor/hooks/useInAppContent.js +146 -88
- package/v2Components/HtmlEditor/hooks/useValidation.js +53 -189
- package/v2Components/HtmlEditor/index.js +1 -1
- package/v2Components/HtmlEditor/messages.js +94 -92
- package/v2Components/HtmlEditor/utils/__tests__/htmlValidator.enhanced.test.js +45 -94
- package/v2Components/HtmlEditor/utils/__tests__/validationAdapter.test.js +0 -134
- package/v2Components/HtmlEditor/utils/contentSanitizer.js +41 -40
- package/v2Components/HtmlEditor/utils/htmlValidator.js +72 -71
- 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 -55
- package/v2Components/TemplatePreview/index.js +32 -47
- package/v2Components/TemplatePreview/messages.js +0 -4
- package/v2Components/TestAndPreviewSlidebox/_testAndPreviewSlidebox.scss +0 -1
- package/v2Containers/BeeEditor/index.js +90 -172
- package/v2Containers/Cap/tests/__snapshots__/index.test.js.snap +3 -4
- package/v2Containers/CreativesContainer/SlideBoxContent.js +52 -128
- package/v2Containers/CreativesContainer/SlideBoxFooter.js +13 -163
- package/v2Containers/CreativesContainer/SlideBoxHeader.js +1 -2
- package/v2Containers/CreativesContainer/constants.js +0 -1
- package/v2Containers/CreativesContainer/index.js +46 -240
- 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 -106
- package/v2Containers/Email/actions.js +0 -7
- package/v2Containers/Email/constants.js +1 -5
- package/v2Containers/Email/index.js +30 -239
- 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/reducer.test.js +0 -46
- package/v2Containers/Email/tests/sagas.test.js +29 -320
- package/v2Containers/EmailWrapper/components/EmailWrapperView.js +21 -211
- 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 -65
- package/v2Containers/EmailWrapper/tests/EmailWrapperView.test.js +214 -0
- package/v2Containers/EmailWrapper/tests/useEmailWrapper.test.js +77 -594
- package/v2Containers/InApp/actions.js +0 -7
- package/v2Containers/InApp/constants.js +4 -20
- package/v2Containers/InApp/index.js +360 -804
- 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 +71 -152
- 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 +12 -39
- package/v2Containers/Line/Container/ImageCarousel/tests/__snapshots__/index.test.js.snap +6 -10
- package/v2Containers/Line/Container/Wrapper/tests/__snapshots__/index.test.js.snap +75 -102
- package/v2Containers/Line/Container/tests/__snapshots__/index.test.js.snap +54 -81
- package/v2Containers/MobilePushNew/index.js +2 -3
- package/v2Containers/Rcs/tests/__snapshots__/index.test.js.snap +178 -262
- package/v2Containers/SmsTrai/Create/tests/__snapshots__/index.test.js.snap +12 -16
- package/v2Containers/SmsTrai/Edit/index.js +1 -2
- package/v2Containers/SmsTrai/Edit/tests/__snapshots__/index.test.js.snap +111 -468
- 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/WebPush/Create/messages.js +8 -0
- package/v2Containers/WebPush/Create/preview/PreviewControls.js +2 -2
- package/v2Containers/WebPush/Create/preview/PreviewDisclaimer.js +3 -1
- package/v2Containers/WebPush/Create/preview/components/AndroidMobileChromeHeader.js +5 -1
- package/v2Containers/WebPush/Create/preview/components/AndroidMobileExpanded.js +5 -1
- package/v2Containers/WebPush/Create/preview/components/tests/__snapshots__/AndroidMobileExpanded.test.js.snap +5 -1
- package/v2Containers/WebPush/Create/preview/preview.scss +7 -0
- package/v2Containers/Whatsapp/tests/__snapshots__/index.test.js.snap +734 -1306
- package/v2Components/ErrorInfoNote/constants.js +0 -1
- package/v2Components/HtmlEditor/__tests__/HTMLEditor.apiErrors.test.js +0 -874
- package/v2Components/HtmlEditor/components/ValidationPanel/constants.js +0 -6
- package/v2Components/HtmlEditor/components/ValidationTabs/_validationTabs.scss +0 -255
- package/v2Components/HtmlEditor/components/ValidationTabs/index.js +0 -364
- package/v2Components/HtmlEditor/components/ValidationTabs/messages.js +0 -51
- package/v2Components/HtmlEditor/utils/validationConstants.js +0 -40
- package/v2Containers/BeePopupEditor/_beePopupEditor.scss +0 -14
- package/v2Containers/BeePopupEditor/constants.js +0 -10
- package/v2Containers/BeePopupEditor/index.js +0 -194
- package/v2Containers/BeePopupEditor/tests/index.test.js +0 -627
- package/v2Containers/EmailWrapper/components/EmailHTMLEditor.js +0 -1285
- package/v2Containers/EmailWrapper/components/__tests__/EmailHTMLEditor.test.js +0 -1880
- 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 -151
- package/v2Containers/InAppWrapper/components/__tests__/InAppWrapperView.test.js +0 -267
- package/v2Containers/InAppWrapper/components/inAppWrapperView.scss +0 -23
- 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
|
@@ -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 {
|
|
@@ -27,119 +24,18 @@ function SlideBoxFooter(props) {
|
|
|
27
24
|
fetchingCmsData,
|
|
28
25
|
isTemplateNameEmpty,
|
|
29
26
|
errorMessages,
|
|
30
|
-
|
|
31
|
-
isLiquidValidationError, // Legacy prop, kept for PropTypes compatibility
|
|
27
|
+
isLiquidValidationError,
|
|
32
28
|
currentTab,
|
|
33
29
|
onTestAndPreview,
|
|
34
30
|
// isEmptyContent,
|
|
35
31
|
showTestAndPreviewButton,
|
|
36
32
|
shouldShowDoneFooter,
|
|
37
33
|
shouldShowContinueFooter,
|
|
38
|
-
isContinueButtonDisabled,
|
|
39
|
-
continueButtonLabel,
|
|
40
|
-
htmlEditorValidationState,
|
|
41
|
-
isCreatingTemplate,
|
|
42
|
-
currentChannel,
|
|
43
|
-
emailCreateMode,
|
|
44
|
-
selectedEmailCreateMode,
|
|
45
34
|
} = props;
|
|
46
35
|
|
|
47
|
-
// Calculate if buttons should be disabled
|
|
48
|
-
// Only apply validation state checks for EMAIL channel in HTML Editor mode (not BEE/DragDrop)
|
|
49
|
-
// For other channels, BEE editor, or when htmlEditorValidationState is not provided, don't disable based on validation
|
|
50
|
-
const isEmailChannel = currentChannel?.toUpperCase() === 'EMAIL';
|
|
51
|
-
const isEditMode = slidBoxContent === 'editTemplate';
|
|
52
|
-
|
|
53
|
-
// Use selectedEmailCreateMode for accurate mode detection in create mode (emailCreateMode is mapped for backwards compatibility)
|
|
54
|
-
// In edit mode: htmlEditorValidationState is initialized as {} but only updated by HTML Editor
|
|
55
|
-
// If it's still in initial state (validationComplete === false, issueCounts.total === 0), it's BEE editor
|
|
56
|
-
// Upload mode also uses HTML Editor, so include it in HTML Editor mode check
|
|
57
|
-
const isUploadMode = emailCreateMode === EMAIL_CREATE_MODES.UPLOAD;
|
|
58
|
-
const isHTMLEditorModeInCreate = selectedEmailCreateMode === EMAIL_CREATE_MODES.HTML_EDITOR || isUploadMode;
|
|
59
|
-
// In edit mode: Check if htmlEditorValidationState has been updated by HTML Editor
|
|
60
|
-
// HTML Editor will call updateHtmlEditorValidationState, setting validationComplete to true at some point
|
|
61
|
-
// If validationComplete is false and issueCounts.total === 0, it's likely still in initial state (BEE editor)
|
|
62
|
-
const isHtmlEditorValidationStateActive = htmlEditorValidationState && (
|
|
63
|
-
htmlEditorValidationState.validationComplete === true
|
|
64
|
-
|| (htmlEditorValidationState.issueCounts && htmlEditorValidationState.issueCounts.total > 0)
|
|
65
|
-
|| htmlEditorValidationState.hasErrors === true
|
|
66
|
-
);
|
|
67
|
-
const isHTMLEditorModeInEdit = isEditMode && isHtmlEditorValidationStateActive;
|
|
68
|
-
const isHTMLEditorMode = isHTMLEditorModeInCreate || isHTMLEditorModeInEdit;
|
|
69
|
-
console.log('***isHTMLEditorMode', isHTMLEditorMode, 'isHTMLEditorModeInCreate', isHTMLEditorModeInCreate, 'isHTMLEditorModeInEdit', isHTMLEditorModeInEdit, 'isHtmlEditorValidationStateActive', isHtmlEditorValidationStateActive);
|
|
70
|
-
|
|
71
|
-
// BEE editor detection: drag_drop mode OR (editor mode AND not HTML Editor)
|
|
72
|
-
// In edit mode: if htmlEditorValidationState is in initial state (not updated by HTML Editor), it's BEE editor
|
|
73
|
-
const isBEEEditor = selectedEmailCreateMode === EMAIL_CREATE_MODES.DRAG_DROP
|
|
74
|
-
|| (emailCreateMode === EMAIL_CREATE_MODES.EDITOR && !isHTMLEditorMode)
|
|
75
|
-
|| (isEditMode && !isHtmlEditorValidationStateActive);
|
|
76
|
-
// Only check validation for HTML Editor mode, not for BEE/DragDrop editor
|
|
77
|
-
const shouldCheckValidation = isEmailChannel && htmlEditorValidationState && isHTMLEditorMode && !isBEEEditor;
|
|
78
|
-
const isContentEmpty = shouldCheckValidation ? (htmlEditorValidationState?.isContentEmpty ?? true) : false;
|
|
79
|
-
// Check if validation has completed
|
|
80
|
-
const validationComplete = shouldCheckValidation ? (htmlEditorValidationState?.validationComplete ?? false) : true;
|
|
81
|
-
// Only Rule Group #1 (Input & Sanitization) blocks; hasErrors is set by HTMLEditor from hasBlockingErrors.
|
|
82
|
-
// hasErrors should always be set (defaults to false), so we only check for explicit true value.
|
|
83
|
-
// Warnings (label issues, HTML/CSS compatibility) do NOT block buttons.
|
|
84
|
-
const hasValidationErrors = shouldCheckValidation && htmlEditorValidationState?.hasErrors === true;
|
|
85
|
-
console.log('***hasValidationErrors', hasValidationErrors);
|
|
86
|
-
const errorsAcknowledged = shouldCheckValidation ? (htmlEditorValidationState?.errorsAcknowledged ?? false) : true;
|
|
87
|
-
console.log('***errorsAcknowledged', errorsAcknowledged);
|
|
88
|
-
|
|
89
|
-
// IMPORTANT: In both modes, if validation finds errors, buttons must stay disabled until user acknowledges by clicking redirection icon
|
|
90
|
-
let shouldDisableButtons = false;
|
|
91
|
-
if (shouldCheckValidation) {
|
|
92
|
-
if (isEditMode) {
|
|
93
|
-
// Edit mode: Disable if validation has completed AND found errors AND errors not acknowledged
|
|
94
|
-
shouldDisableButtons = validationComplete && hasValidationErrors && !errorsAcknowledged;
|
|
95
|
-
} else {
|
|
96
|
-
// Create mode:
|
|
97
|
-
// 1. Disable until validation completes
|
|
98
|
-
// 2. Disable if content is empty
|
|
99
|
-
// 3. Disable if validation finds errors AND errors not acknowledged (user must click redirection icon)
|
|
100
|
-
shouldDisableButtons = !validationComplete || isContentEmpty || (hasValidationErrors && !errorsAcknowledged);
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
// Show ErrorInfoNote for API validation errors (from validateLiquidTemplateContent)
|
|
105
|
-
// For HTML Editor: API validation errors are shown in ValidationErrorDisplay (inside CodeEditorPane), not here
|
|
106
|
-
const hasStandardErrors = errorMessages && errorMessages.STANDARD_ERROR_MSG && errorMessages.STANDARD_ERROR_MSG.length > 0;
|
|
107
|
-
const hasLiquidErrors = errorMessages && errorMessages.LIQUID_ERROR_MSG && errorMessages.LIQUID_ERROR_MSG.length > 0;
|
|
108
|
-
|
|
109
|
-
// Check if htmlEditorValidationState has actual validation errors
|
|
110
|
-
// If htmlEditorValidationState exists but has no errors (total === 0), and we have STANDARD/LIQUID errors,
|
|
111
|
-
// then those errors are from BEE editor (FormBuilder validation), not HTML Editor
|
|
112
|
-
const htmlEditorHasErrors = htmlEditorValidationState && htmlEditorValidationState.issueCounts && htmlEditorValidationState.issueCounts.total > 0;
|
|
113
|
-
|
|
114
|
-
// BEE editor errors: We have STANDARD/LIQUID errors AND either:
|
|
115
|
-
// 1. No htmlEditorValidationState exists, OR
|
|
116
|
-
// 2. htmlEditorValidationState exists but has no actual errors (meaning errors are from FormBuilder/BEE editor)
|
|
117
|
-
// IMPORTANT: Only check for BEE editor errors when NOT in HTML Editor mode (upload or html_editor)
|
|
118
|
-
// Upload mode uses HTML Editor, so BEE editor errors don't apply
|
|
119
|
-
// IMPORTANT: BEE editor doesn't have real-time content updates,
|
|
120
|
-
// so we should NOT disable buttons based on validation errors
|
|
121
|
-
// In edit mode: Check if htmlEditorValidationState is in initial state (not updated by HTML Editor)
|
|
122
|
-
// In edit mode with BEE editor, htmlEditorValidationState will remain in initial state
|
|
123
|
-
// In create mode, check selectedEmailCreateMode or emailCreateMode
|
|
124
|
-
const isBEEEditorModeInEdit = isEditMode && !isHtmlEditorValidationStateActive;
|
|
125
|
-
console.log('***isBEEEditorModeInEdit', isBEEEditorModeInEdit, 'isHtmlEditorValidationStateActive', isHtmlEditorValidationStateActive);
|
|
126
|
-
const isBEEEditorModeInCreate = !isHTMLEditorMode && !isEditMode;
|
|
127
|
-
console.log('***isBEEEditorModeInCreate', isBEEEditorModeInCreate);
|
|
128
|
-
const isBEEEditorMode = isBEEEditorModeInEdit || isBEEEditorModeInCreate;
|
|
129
|
-
console.log('***isBEEEditorMode', isBEEEditorMode);
|
|
130
|
-
const hasBEEEditorErrors = isEmailChannel && isBEEEditorMode && (hasStandardErrors || hasLiquidErrors) && (!htmlEditorValidationState || !htmlEditorHasErrors);
|
|
131
|
-
console.log('***hasBEEEditorErrors', hasBEEEditorErrors);
|
|
132
|
-
|
|
133
|
-
const shouldShowErrorInfoNote = hasBEEEditorErrors;
|
|
134
36
|
return (
|
|
135
|
-
<div className=
|
|
136
|
-
{
|
|
137
|
-
<ErrorInfoNote
|
|
138
|
-
errorMessages={errorMessages}
|
|
139
|
-
currentTab={currentTab?.toUpperCase()}
|
|
140
|
-
useLegacyDisplay // Use simple list display for BEE Editor (not tabbed interface)
|
|
141
|
-
/>
|
|
142
|
-
)}
|
|
37
|
+
<div className='template-footer-width'>
|
|
38
|
+
{isLiquidValidationError && (<ErrorInfoNote errorMessages={errorMessages} currentTab={currentTab?.toUpperCase()} />)}
|
|
143
39
|
<div>
|
|
144
40
|
{shouldShowDoneFooter() && (
|
|
145
41
|
<div>
|
|
@@ -151,10 +47,10 @@ function SlideBoxFooter(props) {
|
|
|
151
47
|
<CapRow>
|
|
152
48
|
<CapButton
|
|
153
49
|
onClick={onSave}
|
|
154
|
-
disabled={isTemplateNameEmpty || fetchingCmsData ||
|
|
50
|
+
disabled={isTemplateNameEmpty || fetchingCmsData || false}
|
|
155
51
|
>
|
|
156
52
|
{isFullMode ? (
|
|
157
|
-
getFullModeSaveBtn(slidBoxContent
|
|
53
|
+
getFullModeSaveBtn(slidBoxContent)
|
|
158
54
|
) : (
|
|
159
55
|
<FormattedMessage {...messages.creativesTemplatesSave} />
|
|
160
56
|
)}
|
|
@@ -163,7 +59,7 @@ function SlideBoxFooter(props) {
|
|
|
163
59
|
<CapButton
|
|
164
60
|
type="secondary"
|
|
165
61
|
onClick={onTestAndPreview}
|
|
166
|
-
disabled={
|
|
62
|
+
// disabled={isEmptyContent || false}
|
|
167
63
|
style={{ marginLeft: '8px' }}
|
|
168
64
|
>
|
|
169
65
|
<FormattedMessage {...messages.testAndPreview} />
|
|
@@ -174,11 +70,8 @@ function SlideBoxFooter(props) {
|
|
|
174
70
|
</div>
|
|
175
71
|
)}
|
|
176
72
|
{shouldShowContinueFooter() && (
|
|
177
|
-
<CapButton
|
|
178
|
-
|
|
179
|
-
disabled={isContinueButtonDisabled || false}
|
|
180
|
-
>
|
|
181
|
-
<FormattedMessage {...(continueButtonLabel || messages.continue)} />
|
|
73
|
+
<CapButton onClick={onCreateNextStep}>
|
|
74
|
+
<FormattedMessage {...messages.continue} />
|
|
182
75
|
</CapButton>
|
|
183
76
|
)}
|
|
184
77
|
{slidBoxContent === PREVIEW && (
|
|
@@ -206,48 +99,5 @@ SlideBoxFooter.propTypes = {
|
|
|
206
99
|
onTestAndPreview: PropTypes.func,
|
|
207
100
|
isEmptyContent: PropTypes.bool,
|
|
208
101
|
showTestAndPreviewButton: PropTypes.bool,
|
|
209
|
-
isContinueButtonDisabled: PropTypes.bool,
|
|
210
|
-
continueButtonLabel: PropTypes.object,
|
|
211
|
-
htmlEditorValidationState: PropTypes.shape({
|
|
212
|
-
isContentEmpty: PropTypes.bool,
|
|
213
|
-
issueCounts: PropTypes.shape({
|
|
214
|
-
html: PropTypes.number,
|
|
215
|
-
label: PropTypes.number,
|
|
216
|
-
liquid: PropTypes.number,
|
|
217
|
-
total: PropTypes.number,
|
|
218
|
-
}),
|
|
219
|
-
validationComplete: PropTypes.bool,
|
|
220
|
-
/** Only Rule Group #1 (Input & Sanitization) blocks; warnings do not block */
|
|
221
|
-
hasErrors: PropTypes.bool,
|
|
222
|
-
}),
|
|
223
|
-
isCreatingTemplate: PropTypes.bool,
|
|
224
|
-
currentChannel: PropTypes.string,
|
|
225
|
-
emailCreateMode: PropTypes.string,
|
|
226
|
-
selectedEmailCreateMode: PropTypes.string,
|
|
227
|
-
};
|
|
228
|
-
|
|
229
|
-
SlideBoxFooter.defaultProps = {
|
|
230
|
-
slidBoxContent: '',
|
|
231
|
-
onSave: () => {},
|
|
232
|
-
onEditTemplate: () => {},
|
|
233
|
-
onCreateNextStep: () => {},
|
|
234
|
-
shouldShowContinueFooter: () => {},
|
|
235
|
-
shouldShowDoneFooter: () => {},
|
|
236
|
-
isFullMode: false,
|
|
237
|
-
fetchingCmsData: false,
|
|
238
|
-
isTemplateNameEmpty: false,
|
|
239
|
-
errorMessages: [],
|
|
240
|
-
isLiquidValidationError: false,
|
|
241
|
-
currentTab: '',
|
|
242
|
-
onTestAndPreview: () => {},
|
|
243
|
-
isEmptyContent: false,
|
|
244
|
-
showTestAndPreviewButton: false,
|
|
245
|
-
isContinueButtonDisabled: false,
|
|
246
|
-
continueButtonLabel: {},
|
|
247
|
-
htmlEditorValidationState: {},
|
|
248
|
-
isCreatingTemplate: false,
|
|
249
|
-
currentChannel: '',
|
|
250
|
-
emailCreateMode: '',
|
|
251
|
-
selectedEmailCreateMode: '',
|
|
252
102
|
};
|
|
253
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,
|
|
@@ -111,7 +110,7 @@ export function SlideBoxHeader(props) {
|
|
|
111
110
|
}
|
|
112
111
|
/>
|
|
113
112
|
)}
|
|
114
|
-
{!showTemplateNameHeader && slidBoxContent === 'editTemplate' && (
|
|
113
|
+
{!showTemplateNameHeader && slidBoxContent === 'editTemplate' && (
|
|
115
114
|
<CapHeader
|
|
116
115
|
className="support-video-elements"
|
|
117
116
|
title={<FormattedMessage {...headerMessage} values={{ channel: getChannelLabel(channel) }} />}
|
|
@@ -26,7 +26,6 @@ export const WEBPUSH_BRAND_ICON = "WEBPUSH_BRAND_ICON";
|
|
|
26
26
|
export const PREVIEW = "preview";
|
|
27
27
|
export const EDIT_TEMPLATE = "editTemplate";
|
|
28
28
|
export const JOURNEY = "journey";
|
|
29
|
-
export const HTML = "HTML";
|
|
30
29
|
|
|
31
30
|
export const LOYALTY_SUPPORTED_ACTION = "SEND_COMMUNICATION_ACTION";
|
|
32
31
|
|