@capillarytech/creatives-library 8.0.242-alpha.0 → 8.0.242-alpha.2
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 +2 -1
- package/initialReducer.js +2 -0
- package/package.json +1 -1
- package/sagas/__tests__/assetPolling.test.js +74 -3
- package/sagas/assetPolling.js +8 -1
- package/services/api.js +10 -5
- package/services/tests/api.test.js +18 -0
- package/translations/en.json +0 -1
- package/utils/common.js +5 -0
- package/utils/commonUtils.js +14 -1
- package/utils/tests/commonUtil.test.js +224 -0
- package/utils/transformTemplateConfig.js +0 -10
- package/utils/transformerUtils.js +0 -42
- package/v2Components/CapDeviceContent/index.js +61 -56
- package/v2Components/CapImageUpload/constants.js +0 -2
- package/v2Components/CapImageUpload/index.js +14 -54
- package/v2Components/CapImageUpload/index.scss +1 -4
- package/v2Components/CapImageUpload/messages.js +0 -4
- package/v2Components/CapTagList/index.js +6 -1
- package/v2Components/CapTagListWithInput/index.js +5 -1
- package/v2Components/CapTagListWithInput/messages.js +1 -1
- package/v2Components/CapWhatsappCTA/tests/index.test.js +5 -0
- package/v2Components/ErrorInfoNote/index.js +412 -72
- package/v2Components/ErrorInfoNote/messages.js +22 -0
- package/v2Components/ErrorInfoNote/style.scss +279 -2
- package/v2Components/HtmlEditor/HTMLEditor.js +217 -90
- package/v2Components/HtmlEditor/__tests__/HTMLEditor.test.js +1132 -133
- package/v2Components/HtmlEditor/__tests__/index.lazy.test.js +17 -12
- package/v2Components/HtmlEditor/_htmlEditor.scss +15 -23
- package/v2Components/HtmlEditor/_index.lazy.scss +1 -1
- package/v2Components/HtmlEditor/components/CodeEditorPane/_codeEditorPane.scss +13 -101
- package/v2Components/HtmlEditor/components/CodeEditorPane/index.js +148 -139
- package/v2Components/HtmlEditor/components/DeviceToggle/_deviceToggle.scss +2 -1
- package/v2Components/HtmlEditor/components/DeviceToggle/index.js +3 -3
- package/v2Components/HtmlEditor/components/EditorToolbar/_editorToolbar.scss +1 -0
- package/v2Components/HtmlEditor/components/EditorToolbar/index.js +1 -1
- package/v2Components/HtmlEditor/components/FullscreenModal/_fullscreenModal.scss +1 -0
- package/v2Components/HtmlEditor/components/InAppPreviewPane/DeviceFrame.js +4 -7
- package/v2Components/HtmlEditor/components/InAppPreviewPane/__tests__/DeviceFrame.test.js +35 -45
- package/v2Components/HtmlEditor/components/InAppPreviewPane/_inAppPreviewPane.scss +1 -3
- package/v2Components/HtmlEditor/components/InAppPreviewPane/constants.js +33 -33
- package/v2Components/HtmlEditor/components/InAppPreviewPane/index.js +7 -6
- package/v2Components/HtmlEditor/components/PreviewPane/_previewPane.scss +3 -6
- package/v2Components/HtmlEditor/components/PreviewPane/index.js +10 -11
- package/v2Components/HtmlEditor/components/SplitContainer/_splitContainer.scss +1 -1
- package/v2Components/HtmlEditor/components/ValidationErrorDisplay/__tests__/index.test.js +87 -62
- package/v2Components/HtmlEditor/components/ValidationErrorDisplay/index.js +49 -31
- package/v2Components/HtmlEditor/components/ValidationTabs/_validationTabs.scss +254 -0
- package/v2Components/HtmlEditor/components/ValidationTabs/index.js +362 -0
- package/v2Components/HtmlEditor/components/ValidationTabs/messages.js +51 -0
- package/v2Components/HtmlEditor/constants.js +29 -20
- package/v2Components/HtmlEditor/hooks/__tests__/useInAppContent.test.js +373 -16
- package/v2Components/HtmlEditor/hooks/useEditorContent.js +5 -2
- package/v2Components/HtmlEditor/hooks/useInAppContent.js +88 -146
- package/v2Components/HtmlEditor/index.js +1 -1
- package/v2Components/HtmlEditor/messages.js +95 -85
- package/v2Components/HtmlEditor/utils/liquidTemplateSupport.js +99 -101
- package/v2Components/HtmlEditor/utils/properSyntaxHighlighting.js +23 -25
- package/v2Components/HtmlEditor/utils/validationAdapter.js +34 -41
- package/v2Components/MobilePushPreviewV2/index.js +32 -7
- package/v2Components/TemplatePreview/_templatePreview.scss +44 -24
- package/v2Components/TemplatePreview/index.js +47 -32
- package/v2Components/TemplatePreview/messages.js +4 -0
- package/v2Components/TestAndPreviewSlidebox/index.js +31 -25
- package/v2Containers/App/constants.js +0 -5
- package/v2Containers/BeeEditor/index.js +82 -80
- package/v2Containers/BeePopupEditor/constants.js +10 -0
- package/v2Containers/BeePopupEditor/index.js +193 -0
- package/v2Containers/BeePopupEditor/tests/index.test.js +627 -0
- package/v2Containers/Cap/tests/__snapshots__/index.test.js.snap +0 -1
- package/v2Containers/CreativesContainer/SlideBoxContent.js +148 -120
- package/v2Containers/CreativesContainer/SlideBoxFooter.js +9 -3
- package/v2Containers/CreativesContainer/SlideBoxHeader.js +2 -2
- package/v2Containers/CreativesContainer/constants.js +1 -2
- package/v2Containers/CreativesContainer/index.js +173 -193
- package/v2Containers/CreativesContainer/messages.js +4 -4
- package/v2Containers/CreativesContainer/tests/__snapshots__/SlideBoxContent.test.js.snap +38 -50
- package/v2Containers/CreativesContainer/tests/__snapshots__/index.test.js.snap +36 -0
- package/v2Containers/Email/actions.js +7 -0
- package/v2Containers/Email/constants.js +5 -1
- package/v2Containers/Email/index.js +13 -0
- package/v2Containers/Email/messages.js +32 -0
- package/v2Containers/Email/reducer.js +12 -1
- package/v2Containers/Email/sagas.js +41 -6
- package/v2Containers/Email/tests/__snapshots__/reducer.test.js.snap +2 -0
- package/v2Containers/EmailWrapper/components/EmailHTMLEditor.js +1046 -0
- package/v2Containers/EmailWrapper/components/EmailWrapperView.js +193 -7
- package/v2Containers/EmailWrapper/components/HTMLEditorTesting.js +40 -74
- package/v2Containers/EmailWrapper/components/__tests__/HTMLEditorTesting.test.js +2 -67
- package/v2Containers/EmailWrapper/constants.js +2 -0
- package/v2Containers/EmailWrapper/hooks/useEmailWrapper.js +436 -67
- package/v2Containers/EmailWrapper/index.js +99 -23
- package/v2Containers/EmailWrapper/messages.js +61 -1
- package/v2Containers/EmailWrapper/tests/EmailWrapperView.test.js +26 -1
- package/v2Containers/EmailWrapper/tests/useEmailWrapper.test.js +111 -77
- package/v2Containers/InApp/__tests__/InAppHTMLEditor.test.js +376 -0
- package/v2Containers/InApp/__tests__/sagas.test.js +363 -0
- package/v2Containers/InApp/actions.js +7 -0
- package/v2Containers/InApp/constants.js +20 -4
- package/v2Containers/InApp/index.js +800 -357
- package/v2Containers/InApp/index.scss +4 -3
- package/v2Containers/InApp/messages.js +7 -3
- package/v2Containers/InApp/reducer.js +21 -3
- package/v2Containers/InApp/sagas.js +29 -9
- package/v2Containers/InApp/selectors.js +25 -5
- package/v2Containers/InApp/tests/index.test.js +154 -50
- package/v2Containers/InApp/tests/reducer.test.js +34 -0
- package/v2Containers/InApp/tests/sagas.test.js +61 -9
- package/v2Containers/InApp/tests/selectors.test.js +612 -0
- package/v2Containers/InAppWrapper/components/InAppWrapperView.js +162 -0
- package/v2Containers/InAppWrapper/components/__tests__/InAppWrapperView.test.js +267 -0
- package/v2Containers/InAppWrapper/components/inAppWrapperView.scss +9 -0
- package/v2Containers/InAppWrapper/constants.js +16 -0
- package/v2Containers/InAppWrapper/hooks/__tests__/useInAppWrapper.test.js +473 -0
- package/v2Containers/InAppWrapper/hooks/useInAppWrapper.js +198 -0
- package/v2Containers/InAppWrapper/index.js +148 -0
- package/v2Containers/InAppWrapper/messages.js +49 -0
- package/v2Containers/InappAdvance/index.js +1099 -0
- package/v2Containers/InappAdvance/index.scss +10 -0
- package/v2Containers/InappAdvance/tests/index.test.js +448 -0
- package/v2Containers/Line/Container/ImageCarousel/tests/__snapshots__/content.test.js.snap +3 -3
- package/v2Containers/Line/Container/ImageCarousel/tests/__snapshots__/index.test.js.snap +2 -2
- package/v2Containers/Line/Container/Wrapper/tests/__snapshots__/index.test.js.snap +2 -25
- package/v2Containers/Line/Container/tests/__snapshots__/index.test.js.snap +9 -18
- package/v2Containers/Rcs/tests/__snapshots__/index.test.js.snap +12 -46
- package/v2Containers/SmsTrai/Create/tests/__snapshots__/index.test.js.snap +0 -4
- package/v2Containers/SmsTrai/Edit/tests/__snapshots__/index.test.js.snap +4 -8
- package/v2Containers/TagList/index.js +67 -1
- package/v2Containers/Templates/ChannelTypeIllustration.js +1 -13
- package/v2Containers/Templates/_templates.scss +56 -200
- package/v2Containers/Templates/actions.js +1 -2
- package/v2Containers/Templates/constants.js +0 -1
- package/v2Containers/Templates/index.js +124 -277
- package/v2Containers/Templates/messages.js +4 -24
- package/v2Containers/Templates/reducer.js +0 -2
- package/v2Containers/Templates/tests/index.test.js +0 -10
- package/v2Containers/TemplatesV2/index.js +2 -3
- package/v2Containers/TemplatesV2/messages.js +0 -4
- package/v2Containers/Whatsapp/tests/__snapshots__/index.test.js.snap +35 -132
- package/v2Components/CapImageUrlUpload/constants.js +0 -19
- package/v2Components/CapImageUrlUpload/index.js +0 -455
- package/v2Components/CapImageUrlUpload/index.scss +0 -35
- package/v2Components/CapImageUrlUpload/messages.js +0 -47
- package/v2Containers/WebPush/Create/components/ButtonForm.js +0 -175
- package/v2Containers/WebPush/Create/components/ButtonItem.js +0 -101
- package/v2Containers/WebPush/Create/components/ButtonList.js +0 -144
- package/v2Containers/WebPush/Create/components/_buttons.scss +0 -246
- package/v2Containers/WebPush/Create/components/tests/ButtonForm.test.js +0 -554
- package/v2Containers/WebPush/Create/components/tests/ButtonItem.test.js +0 -607
- package/v2Containers/WebPush/Create/components/tests/ButtonList.test.js +0 -633
- package/v2Containers/WebPush/Create/components/tests/__snapshots__/ButtonForm.test.js.snap +0 -666
- package/v2Containers/WebPush/Create/components/tests/__snapshots__/ButtonItem.test.js.snap +0 -74
- package/v2Containers/WebPush/Create/components/tests/__snapshots__/ButtonList.test.js.snap +0 -80
- package/v2Containers/WebPush/Create/index.js +0 -1755
- package/v2Containers/WebPush/Create/index.scss +0 -123
- package/v2Containers/WebPush/Create/messages.js +0 -199
- package/v2Containers/WebPush/Create/preview/DevicePreviewContent.js +0 -241
- package/v2Containers/WebPush/Create/preview/NotificationContainer.js +0 -290
- package/v2Containers/WebPush/Create/preview/PreviewContent.js +0 -81
- package/v2Containers/WebPush/Create/preview/PreviewControls.js +0 -240
- package/v2Containers/WebPush/Create/preview/PreviewDisclaimer.js +0 -23
- package/v2Containers/WebPush/Create/preview/WebPushPreview.js +0 -144
- package/v2Containers/WebPush/Create/preview/assets/Light.svg +0 -53
- package/v2Containers/WebPush/Create/preview/assets/Top.svg +0 -5
- package/v2Containers/WebPush/Create/preview/assets/chrome-icon.png +0 -0
- package/v2Containers/WebPush/Create/preview/assets/edge-icon.png +0 -0
- package/v2Containers/WebPush/Create/preview/assets/firefox-icon.svg +0 -106
- package/v2Containers/WebPush/Create/preview/assets/iOS.svg +0 -26
- package/v2Containers/WebPush/Create/preview/assets/opera-icon.svg +0 -18
- package/v2Containers/WebPush/Create/preview/assets/safari-icon.svg +0 -29
- package/v2Containers/WebPush/Create/preview/components/AndroidMobileChromeHeader.js +0 -44
- package/v2Containers/WebPush/Create/preview/components/AndroidMobileExpanded.js +0 -110
- package/v2Containers/WebPush/Create/preview/components/IOSHeader.js +0 -45
- package/v2Containers/WebPush/Create/preview/components/NotificationExpandedContent.js +0 -72
- package/v2Containers/WebPush/Create/preview/components/NotificationHeader.js +0 -55
- package/v2Containers/WebPush/Create/preview/components/WindowsChromeExpanded.js +0 -70
- package/v2Containers/WebPush/Create/preview/components/tests/AndroidMobileExpanded.test.js +0 -512
- package/v2Containers/WebPush/Create/preview/components/tests/__snapshots__/AndroidMobileExpanded.test.js.snap +0 -77
- package/v2Containers/WebPush/Create/preview/config/notificationMappings.js +0 -527
- package/v2Containers/WebPush/Create/preview/constants.js +0 -162
- package/v2Containers/WebPush/Create/preview/notification-container.scss +0 -104
- package/v2Containers/WebPush/Create/preview/preview.scss +0 -409
- package/v2Containers/WebPush/Create/preview/styles/_android-mobile-chrome.scss +0 -300
- package/v2Containers/WebPush/Create/preview/styles/_android-mobile-edge.scss +0 -12
- package/v2Containers/WebPush/Create/preview/styles/_android-mobile-firefox.scss +0 -12
- package/v2Containers/WebPush/Create/preview/styles/_android-mobile-opera.scss +0 -12
- package/v2Containers/WebPush/Create/preview/styles/_android-tablet-chrome.scss +0 -303
- package/v2Containers/WebPush/Create/preview/styles/_android-tablet-edge.scss +0 -11
- package/v2Containers/WebPush/Create/preview/styles/_android-tablet-firefox.scss +0 -11
- package/v2Containers/WebPush/Create/preview/styles/_android-tablet-opera.scss +0 -11
- package/v2Containers/WebPush/Create/preview/styles/_base.scss +0 -188
- package/v2Containers/WebPush/Create/preview/styles/_ios.scss +0 -106
- package/v2Containers/WebPush/Create/preview/styles/_ipados.scss +0 -107
- package/v2Containers/WebPush/Create/preview/styles/_macos-chrome.scss +0 -75
- package/v2Containers/WebPush/Create/preview/styles/_windows-chrome.scss +0 -174
- package/v2Containers/WebPush/Create/preview/tests/DevicePreviewContent.test.js +0 -909
- package/v2Containers/WebPush/Create/preview/tests/NotificationContainer.test.js +0 -1077
- package/v2Containers/WebPush/Create/preview/tests/PreviewControls.test.js +0 -723
- package/v2Containers/WebPush/Create/preview/tests/WebPushPreview.test.js +0 -943
- package/v2Containers/WebPush/Create/preview/tests/__snapshots__/DevicePreviewContent.test.js.snap +0 -128
- package/v2Containers/WebPush/Create/preview/tests/__snapshots__/NotificationContainer.test.js.snap +0 -121
- package/v2Containers/WebPush/Create/preview/tests/__snapshots__/PreviewControls.test.js.snap +0 -144
- package/v2Containers/WebPush/Create/preview/tests/__snapshots__/WebPushPreview.test.js.snap +0 -127
- package/v2Containers/WebPush/Create/utils/urlValidation.js +0 -116
- package/v2Containers/WebPush/Create/utils/urlValidation.test.js +0 -449
- package/v2Containers/WebPush/actions.js +0 -60
- package/v2Containers/WebPush/constants.js +0 -108
- package/v2Containers/WebPush/index.js +0 -2
- package/v2Containers/WebPush/reducer.js +0 -104
- package/v2Containers/WebPush/sagas.js +0 -119
- package/v2Containers/WebPush/selectors.js +0 -65
- package/v2Containers/WebPush/tests/reducer.test.js +0 -863
- package/v2Containers/WebPush/tests/sagas.test.js +0 -566
- package/v2Containers/WebPush/tests/selectors.test.js +0 -960
|
@@ -10,6 +10,7 @@ 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';
|
|
13
14
|
import EmailPreviewV2 from '../../v2Components/EmailPreviewV2';
|
|
14
15
|
import MobilePushPreview from '../../v2Components/MobilePushPreviewV2';
|
|
15
16
|
import WechatWrapper from '../WeChat/Wrapper';
|
|
@@ -28,10 +29,6 @@ import { getWhatsappContent } from '../Whatsapp/utils';
|
|
|
28
29
|
import * as commonUtil from '../../utils/common';
|
|
29
30
|
import Zalo from '../Zalo';
|
|
30
31
|
import MobilePushNew from '../MobilePushNew';
|
|
31
|
-
import WebPush from '../WebPush';
|
|
32
|
-
import DevicePreviewContent from '../WebPush/Create/preview/DevicePreviewContent';
|
|
33
|
-
import { LAYOUT_MODE } from '../WebPush/Create/preview/constants';
|
|
34
|
-
import { WEBPUSH_CONTENT_FIELDS, WEBPUSH_TEMPLATE_PATHS } from '../WebPush/constants';
|
|
35
32
|
const CreativesWrapper = styled.div`
|
|
36
33
|
.ant-popover,
|
|
37
34
|
.ant-notification,
|
|
@@ -119,7 +116,11 @@ export function SlideBoxContent(props) {
|
|
|
119
116
|
emailCreateMode,
|
|
120
117
|
onMobilepushModeChange,
|
|
121
118
|
mobilePushCreateMode,
|
|
119
|
+
onInAppEditorTypeChange,
|
|
120
|
+
inAppEditorType,
|
|
122
121
|
templateStep,
|
|
122
|
+
inAppCreateMode,
|
|
123
|
+
onInAppModeChange,
|
|
123
124
|
onEnterTemplateName,
|
|
124
125
|
onRemoveTemplateName,
|
|
125
126
|
onCreateNextStep,
|
|
@@ -168,7 +169,6 @@ export function SlideBoxContent(props) {
|
|
|
168
169
|
handleTestAndPreview,
|
|
169
170
|
handleCloseTestAndPreview,
|
|
170
171
|
isTestAndPreviewMode,
|
|
171
|
-
supportedTags = [],
|
|
172
172
|
} = props;
|
|
173
173
|
const type = (messageDetails.type || '').toLowerCase(); // type is context in get tags values : outbound | dvs | referral | loyalty | coupons
|
|
174
174
|
const query = { type: !isFullMode && 'embedded', module: isFullMode ? 'default' : 'library', isEditFromCampaigns: (templateData || {}).isEditFromCampaigns};
|
|
@@ -205,7 +205,6 @@ export function SlideBoxContent(props) {
|
|
|
205
205
|
const isCreateRcs = isCreate && channel === constants.RCS;
|
|
206
206
|
const isCreateMPush = isCreate && channel === constants.MOBILE_PUSH;
|
|
207
207
|
const isCreateCallTask = isCreate && channel === constants.CALL_TASK;
|
|
208
|
-
const isCreateWebPush = isCreate && channel === constants.WEBPUSH;
|
|
209
208
|
let isEditSms = false;
|
|
210
209
|
let isEditEmailWithId = false;
|
|
211
210
|
let isEmailEditWithContent = false;
|
|
@@ -213,14 +212,12 @@ export function SlideBoxContent(props) {
|
|
|
213
212
|
let isEmailPreview = false;
|
|
214
213
|
let isMpushPreview = false;
|
|
215
214
|
let isInappPreview = false;
|
|
216
|
-
let isWebPushPreview = false;
|
|
217
215
|
let isEditCallTask = false;
|
|
218
216
|
let isEditMPush = false;
|
|
219
217
|
let isEditFacebook = false;
|
|
220
218
|
let isEditFTP = false;
|
|
221
219
|
let isEditWhatsapp = false;
|
|
222
220
|
let isEditInApp = false;
|
|
223
|
-
let isEditWebPush = false;
|
|
224
221
|
let isEditRcs = false;
|
|
225
222
|
let isEditZalo = false;
|
|
226
223
|
const isEmailCreate = isCreate && channel === constants.EMAIL;
|
|
@@ -234,12 +231,10 @@ export function SlideBoxContent(props) {
|
|
|
234
231
|
isEditFacebook = isEdit && channel === constants.FACEBOOK;
|
|
235
232
|
isEditWhatsapp = isEdit && channel === constants.WHATSAPP;
|
|
236
233
|
isEditRcs = isEdit && channel === constants.RCS;
|
|
237
|
-
isEditWebPush = isEdit && channel === constants.WEBPUSH;
|
|
238
234
|
isPreview = slidBoxContent === 'preview' && [constants.SMS, constants.LINE, constants.WHATSAPP, constants.FACEBOOK, constants.VIBER, constants.RCS].includes(channel);
|
|
239
235
|
isEmailPreview = slidBoxContent === 'preview' && channel === constants.EMAIL;
|
|
240
236
|
isMpushPreview = slidBoxContent === 'preview' && channel === constants.MOBILE_PUSH;
|
|
241
237
|
isInappPreview = slidBoxContent === 'preview' && channel === constants.INAPP;
|
|
242
|
-
isWebPushPreview = slidBoxContent === 'preview' && channel === constants.WEBPUSH;
|
|
243
238
|
isEditFTP = isEdit && [constants.NO_COMMUNICATION, constants.FTP].includes(channel);
|
|
244
239
|
isEditZalo = isEdit && channel?.toUpperCase() === constants.ZALO;
|
|
245
240
|
isEditInApp = isEdit && channel === constants.INAPP;
|
|
@@ -487,30 +482,8 @@ export function SlideBoxContent(props) {
|
|
|
487
482
|
templateData={templateData}
|
|
488
483
|
channel={channel}
|
|
489
484
|
forwardedTags={forwardedTags}
|
|
490
|
-
|
|
485
|
+
/>
|
|
491
486
|
)}
|
|
492
|
-
{isWebPushPreview && (() => {
|
|
493
|
-
const webpushContent = get(templateData, WEBPUSH_TEMPLATE_PATHS.CONTENT, {});
|
|
494
|
-
const notificationTitle = webpushContent?.[WEBPUSH_CONTENT_FIELDS.TITLE] || '';
|
|
495
|
-
const notificationBody = webpushContent?.[WEBPUSH_CONTENT_FIELDS.MESSAGE] || '';
|
|
496
|
-
const imageSrc = webpushContent?.[WEBPUSH_CONTENT_FIELDS.IMAGE] || '';
|
|
497
|
-
const brandIconSrc = webpushContent?.[WEBPUSH_CONTENT_FIELDS.BRAND_ICON] || '';
|
|
498
|
-
// Extract URL from onClickAction or use empty string
|
|
499
|
-
const url = webpushContent?.[WEBPUSH_CONTENT_FIELDS.ON_CLICK_ACTION]?.url || '';
|
|
500
|
-
|
|
501
|
-
return (
|
|
502
|
-
<div className="webpush-preview-container">
|
|
503
|
-
<DevicePreviewContent
|
|
504
|
-
notificationTitle={notificationTitle}
|
|
505
|
-
notificationBody={notificationBody}
|
|
506
|
-
url={url}
|
|
507
|
-
imageSrc={imageSrc}
|
|
508
|
-
brandIconSrc={brandIconSrc}
|
|
509
|
-
layoutMode={LAYOUT_MODE.COMPACT}
|
|
510
|
-
/>
|
|
511
|
-
</div>
|
|
512
|
-
);
|
|
513
|
-
})()}
|
|
514
487
|
|
|
515
488
|
{
|
|
516
489
|
(currentChannel === constants.WECHAT && !!slidBoxContent) && <WechatWrapper
|
|
@@ -661,44 +634,92 @@ export function SlideBoxContent(props) {
|
|
|
661
634
|
handleTestAndPreview={handleTestAndPreview}
|
|
662
635
|
handleCloseTestAndPreview={handleCloseTestAndPreview}
|
|
663
636
|
isTestAndPreviewMode={isTestAndPreviewMode}
|
|
637
|
+
location={location}
|
|
664
638
|
/>
|
|
665
639
|
)}
|
|
666
640
|
{(isEditEmailWithId || isEmailEditWithContent) && (
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
641
|
+
(() => {
|
|
642
|
+
const supportCKEditor = commonUtil.hasSupportCKEditor();
|
|
643
|
+
// When supportCKEditor is true: Always use Email component (legacy flow)
|
|
644
|
+
if (supportCKEditor || templateData?.is_drag_drop) {
|
|
645
|
+
return (
|
|
646
|
+
<Email
|
|
647
|
+
key="cretives-container-email-edit"
|
|
648
|
+
setIsLoadingContent={setIsLoadingContent}
|
|
649
|
+
location={{
|
|
650
|
+
pathname: `/email/edit`,
|
|
651
|
+
query: { type: 'embedded', module: 'library'},
|
|
652
|
+
}}
|
|
653
|
+
route={{ name: 'email' }}
|
|
654
|
+
isGetFormData={isGetFormData}
|
|
655
|
+
getFormdata={getFormData}
|
|
656
|
+
params={{ id: templateData._id }}
|
|
657
|
+
templateData={templateData}
|
|
658
|
+
getFormSubscriptionData={getFormData}
|
|
659
|
+
getDefaultTags={type}
|
|
660
|
+
isFullMode={isFullMode}
|
|
661
|
+
editor={editor}
|
|
662
|
+
cap={cap}
|
|
663
|
+
showTemplateName={showTemplateName}
|
|
664
|
+
onValidationFail={onValidationFail}
|
|
665
|
+
forwardedTags={forwardedTags}
|
|
666
|
+
selectedOfferDetails={selectedOfferDetails}
|
|
667
|
+
onPreviewContentClicked={onPreviewContentClicked}
|
|
668
|
+
onTestContentClicked={onTestContentClicked}
|
|
669
|
+
moduleType={moduleType}
|
|
670
|
+
showLiquidErrorInFooter={showLiquidErrorInFooter}
|
|
671
|
+
eventContextTags={eventContextTags}
|
|
672
|
+
isLoyaltyModule={isLoyaltyModule}
|
|
673
|
+
showTestAndPreviewSlidebox={showTestAndPreviewSlidebox}
|
|
674
|
+
handleTestAndPreview={handleTestAndPreview}
|
|
675
|
+
handleCloseTestAndPreview={handleCloseTestAndPreview}
|
|
676
|
+
isTestAndPreviewMode={isTestAndPreviewMode}
|
|
677
|
+
/>
|
|
678
|
+
);
|
|
679
|
+
}
|
|
680
|
+
// HTML template: Use EmailWrapper component (which uses EmailWithoutSaga)
|
|
681
|
+
return (
|
|
682
|
+
<EmailWrapper
|
|
683
|
+
key="cretives-container-email-edit-wrapper"
|
|
684
|
+
setIsLoadingContent={setIsLoadingContent}
|
|
685
|
+
onEmailModeChange={onEmailModeChange}
|
|
686
|
+
emailCreateMode="editor"
|
|
687
|
+
isGetFormData={isGetFormData}
|
|
688
|
+
getFormdata={getFormData}
|
|
689
|
+
templateData={templateData}
|
|
690
|
+
type={type}
|
|
691
|
+
step="createTemplateContent"
|
|
692
|
+
showNextStep={onCreateNextStep}
|
|
693
|
+
isFullMode={isFullMode}
|
|
694
|
+
editor={editor}
|
|
695
|
+
cap={cap}
|
|
696
|
+
onResetStep={onResetStep}
|
|
697
|
+
showTemplateName={showTemplateName}
|
|
698
|
+
onEnterTemplateName={onEnterTemplateName}
|
|
699
|
+
onRemoveTemplateName={onRemoveTemplateName}
|
|
700
|
+
onValidationFail={onValidationFail}
|
|
701
|
+
forwardedTags={forwardedTags}
|
|
702
|
+
selectedOfferDetails={selectedOfferDetails}
|
|
703
|
+
onPreviewContentClicked={onPreviewContentClicked}
|
|
704
|
+
onTestContentClicked={onTestContentClicked}
|
|
705
|
+
getCmsTemplatesInProgress={getCmsTemplatesInProgress}
|
|
706
|
+
moduleType={moduleType}
|
|
707
|
+
showLiquidErrorInFooter={showLiquidErrorInFooter}
|
|
708
|
+
eventContextTags={eventContextTags}
|
|
709
|
+
isLoyaltyModule={isLoyaltyModule}
|
|
710
|
+
showTestAndPreviewSlidebox={showTestAndPreviewSlidebox}
|
|
711
|
+
handleTestAndPreview={handleTestAndPreview}
|
|
712
|
+
handleCloseTestAndPreview={handleCloseTestAndPreview}
|
|
713
|
+
isTestAndPreviewMode={isTestAndPreviewMode}
|
|
714
|
+
location={{
|
|
715
|
+
pathname: `/email/edit/${templateData._id}`,
|
|
716
|
+
query: { type: 'embedded', module: 'library', id: templateData._id },
|
|
717
|
+
}}
|
|
718
|
+
params={{ id: templateData._id }}
|
|
719
|
+
/>
|
|
720
|
+
);
|
|
721
|
+
})()
|
|
722
|
+
)}
|
|
702
723
|
{isEditMPush && (
|
|
703
724
|
(isFullMode && !commonUtil.hasNewMobilePushFeatureEnabled()) ||
|
|
704
725
|
(!isFullMode && isLoyaltyModule) ||
|
|
@@ -972,67 +993,73 @@ export function SlideBoxContent(props) {
|
|
|
972
993
|
/>
|
|
973
994
|
)}
|
|
974
995
|
|
|
975
|
-
{isCreateInApp && (
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
query,
|
|
1008
|
-
search: '',
|
|
1009
|
-
}}
|
|
1010
|
-
showLiquidErrorInFooter={showLiquidErrorInFooter}
|
|
996
|
+
{isCreateInApp && (
|
|
997
|
+
<InAppWrapper
|
|
998
|
+
key="creatives-inapp-wrapper"
|
|
999
|
+
date={new Date().getMilliseconds()}
|
|
1000
|
+
setIsLoadingContent={setIsLoadingContent}
|
|
1001
|
+
onInAppEditorTypeChange={onInAppEditorTypeChange}
|
|
1002
|
+
inAppEditorType={inAppEditorType}
|
|
1003
|
+
isGetFormData={isGetFormData}
|
|
1004
|
+
getFormdata={getFormData}
|
|
1005
|
+
templateData={templateData}
|
|
1006
|
+
type={type}
|
|
1007
|
+
step={templateStep}
|
|
1008
|
+
showNextStep={onCreateNextStep}
|
|
1009
|
+
isFullMode={isFullMode}
|
|
1010
|
+
cap={cap}
|
|
1011
|
+
onResetStep={onResetStep}
|
|
1012
|
+
showTemplateName={showTemplateName}
|
|
1013
|
+
onEnterTemplateName={onEnterTemplateName}
|
|
1014
|
+
onRemoveTemplateName={onRemoveTemplateName}
|
|
1015
|
+
onValidationFail={onValidationFail}
|
|
1016
|
+
forwardedTags={forwardedTags}
|
|
1017
|
+
selectedOfferDetails={selectedOfferDetails}
|
|
1018
|
+
onPreviewContentClicked={onPreviewContentClicked}
|
|
1019
|
+
onTestContentClicked={onTestContentClicked}
|
|
1020
|
+
moduleType={moduleType}
|
|
1021
|
+
showLiquidErrorInFooter={showLiquidErrorInFooter}
|
|
1022
|
+
eventContextTags={eventContextTags}
|
|
1023
|
+
onCreateComplete={onCreateComplete}
|
|
1024
|
+
handleClose={handleClose}
|
|
1025
|
+
getDefaultTags={type}
|
|
1026
|
+
onInAppModeChange={onInAppModeChange}
|
|
1027
|
+
inAppCreateMode={inAppCreateMode}
|
|
1011
1028
|
/>
|
|
1012
1029
|
)}
|
|
1013
1030
|
|
|
1014
|
-
{
|
|
1015
|
-
<
|
|
1031
|
+
{isEditInApp && (
|
|
1032
|
+
<InApp
|
|
1033
|
+
key={`creatives-inapp-edit-${templateData._id || 'new'}`}
|
|
1034
|
+
isEditInApp={true}
|
|
1016
1035
|
isFullMode={isFullMode}
|
|
1017
|
-
|
|
1018
|
-
onCreateComplete={onCreateComplete}
|
|
1036
|
+
templateData={templateData}
|
|
1019
1037
|
getFormData={getFormData}
|
|
1020
|
-
isGetFormData={isGetFormData}
|
|
1021
|
-
templateData={isEditWebPush ? templateData : undefined}
|
|
1022
|
-
creativesMode={creativesMode}
|
|
1023
|
-
params={isEditWebPush && templateData ? { id: templateData._id } : undefined}
|
|
1024
|
-
location={{
|
|
1025
|
-
pathname: isEditWebPush ? '/webpush/edit' : '/webpush/create',
|
|
1026
|
-
query,
|
|
1027
|
-
search: '',
|
|
1028
|
-
}}
|
|
1029
1038
|
getDefaultTags={type}
|
|
1030
1039
|
forwardedTags={forwardedTags}
|
|
1031
|
-
|
|
1040
|
+
onCreateComplete={onCreateComplete}
|
|
1032
1041
|
selectedOfferDetails={selectedOfferDetails}
|
|
1033
1042
|
eventContextTags={eventContextTags}
|
|
1043
|
+
params={{
|
|
1044
|
+
id: templateData._id,
|
|
1045
|
+
}}
|
|
1046
|
+
location={{
|
|
1047
|
+
pathname: `/inapp/edit`,
|
|
1048
|
+
query,
|
|
1049
|
+
search: '',
|
|
1050
|
+
}}
|
|
1051
|
+
showLiquidErrorInFooter={showLiquidErrorInFooter}
|
|
1052
|
+
setIsLoadingContent={setIsLoadingContent}
|
|
1053
|
+
onInAppModeChange={onInAppModeChange}
|
|
1054
|
+
inAppCreateMode={inAppCreateMode}
|
|
1055
|
+
isGetFormData={isGetFormData}
|
|
1056
|
+
showTemplateName={showTemplateName}
|
|
1057
|
+
onValidationFail={onValidationFail}
|
|
1058
|
+
type={type}
|
|
1059
|
+
query={query}
|
|
1034
1060
|
/>
|
|
1035
1061
|
)}
|
|
1062
|
+
|
|
1036
1063
|
{isCreateRcs && (<Rcs
|
|
1037
1064
|
{...rcsCommonProps}
|
|
1038
1065
|
showLiquidErrorInFooter={showLiquidErrorInFooter}
|
|
@@ -1064,6 +1091,8 @@ SlideBoxContent.propTypes = {
|
|
|
1064
1091
|
onSelectTemplate: PropTypes.func,
|
|
1065
1092
|
onPreviewTemplate: PropTypes.func,
|
|
1066
1093
|
templateData: PropTypes.object,
|
|
1094
|
+
onInAppEditorTypeChange: PropTypes.func,
|
|
1095
|
+
inAppEditorType: PropTypes.object,
|
|
1067
1096
|
location: PropTypes.object,
|
|
1068
1097
|
isGetFormData: PropTypes.bool,
|
|
1069
1098
|
getFormData: PropTypes.func,
|
|
@@ -1089,7 +1118,6 @@ SlideBoxContent.propTypes = {
|
|
|
1089
1118
|
onValidationFail: PropTypes.func,
|
|
1090
1119
|
channelsToHide: PropTypes.array,
|
|
1091
1120
|
forwardedTags: PropTypes.object,
|
|
1092
|
-
supportedTags: PropTypes.array,
|
|
1093
1121
|
selectedOfferDetails: PropTypes.array,
|
|
1094
1122
|
channelsToDisable: PropTypes.array,
|
|
1095
1123
|
weChatTemplateType: PropTypes.string,
|
|
@@ -1105,7 +1133,7 @@ SlideBoxContent.propTypes = {
|
|
|
1105
1133
|
onFTPSubmit: PropTypes.func,
|
|
1106
1134
|
messageStrategy: PropTypes.string,
|
|
1107
1135
|
fbAdManager: PropTypes.string,
|
|
1108
|
-
showDisabledFBInfo: PropTypes.
|
|
1136
|
+
showDisabledFBInfo: PropTypes.boolean,
|
|
1109
1137
|
orgUnitId: PropTypes.any,
|
|
1110
1138
|
smsRegister: PropTypes.any,
|
|
1111
1139
|
getCmsTemplatesInProgress: PropTypes.bool,
|
|
@@ -31,8 +31,9 @@ function SlideBoxFooter(props) {
|
|
|
31
31
|
showTestAndPreviewButton,
|
|
32
32
|
shouldShowDoneFooter,
|
|
33
33
|
shouldShowContinueFooter,
|
|
34
|
+
isContinueButtonDisabled,
|
|
35
|
+
continueButtonLabel,
|
|
34
36
|
} = props;
|
|
35
|
-
|
|
36
37
|
return (
|
|
37
38
|
<div className='template-footer-width'>
|
|
38
39
|
{isLiquidValidationError && (<ErrorInfoNote errorMessages={errorMessages} currentTab={currentTab?.toUpperCase()} />)}
|
|
@@ -70,8 +71,11 @@ function SlideBoxFooter(props) {
|
|
|
70
71
|
</div>
|
|
71
72
|
)}
|
|
72
73
|
{shouldShowContinueFooter() && (
|
|
73
|
-
<CapButton
|
|
74
|
-
|
|
74
|
+
<CapButton
|
|
75
|
+
onClick={onCreateNextStep}
|
|
76
|
+
disabled={isContinueButtonDisabled || false}
|
|
77
|
+
>
|
|
78
|
+
<FormattedMessage {...(continueButtonLabel || messages.continue)} />
|
|
75
79
|
</CapButton>
|
|
76
80
|
)}
|
|
77
81
|
{slidBoxContent === PREVIEW && (
|
|
@@ -99,5 +103,7 @@ SlideBoxFooter.propTypes = {
|
|
|
99
103
|
onTestAndPreview: PropTypes.func,
|
|
100
104
|
isEmptyContent: PropTypes.bool,
|
|
101
105
|
showTestAndPreviewButton: PropTypes.bool,
|
|
106
|
+
isContinueButtonDisabled: PropTypes.bool,
|
|
107
|
+
continueButtonLabel: PropTypes.object,
|
|
102
108
|
};
|
|
103
109
|
export default SlideBoxFooter;
|
|
@@ -45,6 +45,7 @@ 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;
|
|
48
49
|
const headerMessage = whatsappOverview ? messages.whatsappOverview : zaloOverview ? messages.zaloOverview : messages.editMessageContent;
|
|
49
50
|
const {
|
|
50
51
|
whatsappTemplateName,
|
|
@@ -71,7 +72,6 @@ export function SlideBoxHeader(props) {
|
|
|
71
72
|
rcs: <FormattedMessage {...messages.rcsCreative} />,
|
|
72
73
|
zalo: <FormattedMessage {...messages.zaloTemplate} />,
|
|
73
74
|
viber: <FormattedMessage {...messages.viberTemplate} />,
|
|
74
|
-
webpush: <FormattedMessage {...messages.webPushTemplate} />,
|
|
75
75
|
};
|
|
76
76
|
return labels[currentChannel.toLowerCase()];
|
|
77
77
|
};
|
|
@@ -110,7 +110,7 @@ export function SlideBoxHeader(props) {
|
|
|
110
110
|
}
|
|
111
111
|
/>
|
|
112
112
|
)}
|
|
113
|
-
{!showTemplateNameHeader && slidBoxContent === 'editTemplate' && (
|
|
113
|
+
{!showTemplateNameHeader && slidBoxContent === 'editTemplate' && (shouldShowInAppEditHeader || !isInAppCreate) && (
|
|
114
114
|
<CapHeader
|
|
115
115
|
className="support-video-elements"
|
|
116
116
|
title={<FormattedMessage {...headerMessage} values={{ channel: getChannelLabel(channel) }} />}
|
|
@@ -21,11 +21,10 @@ export const PUSH = "PUSH";
|
|
|
21
21
|
export const RCS = "RCS";
|
|
22
22
|
export const ZALO = "ZALO";
|
|
23
23
|
export const INAPP = "INAPP";
|
|
24
|
-
export const WEBPUSH = "WEBPUSH";
|
|
25
|
-
export const WEBPUSH_BRAND_ICON = "WEBPUSH_BRAND_ICON";
|
|
26
24
|
export const PREVIEW = "preview";
|
|
27
25
|
export const EDIT_TEMPLATE = "editTemplate";
|
|
28
26
|
export const JOURNEY = "journey";
|
|
27
|
+
export const HTML = "HTML";
|
|
29
28
|
|
|
30
29
|
export const LOYALTY_SUPPORTED_ACTION = "SEND_COMMUNICATION_ACTION";
|
|
31
30
|
|