@capillarytech/creatives-library 7.18.0-beta.0 → 8.0.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/app.js +27 -54
- package/assets/Line_Preview_English.svg +24 -0
- package/assets/Line_Preview_Japanese.svg +24 -0
- package/components/CapTagList/index.js +2 -2
- package/components/CapTagList/messages.js +8 -0
- package/components/Ckeditor/index.js +4 -2
- package/components/Ckeditor/style.scss +3 -0
- package/components/FormBuilder/_formBuilder.scss +4 -16
- package/components/FormBuilder/index.js +4 -3
- package/components/FormBuilder/messages.js +4 -0
- package/components/Sidebar/index.js +4 -4
- package/config/path.js +1 -1
- package/containers/App/constants.js +95 -0
- package/containers/App/index.js +52 -0
- package/containers/App/sagas.js +8 -3
- package/containers/Assets/Gallery/index.js +17 -3
- package/containers/Assets/Gallery/messages.js +4 -0
- package/containers/Assets/Gallery/sagas.js +14 -14
- package/containers/Cap/index.js +84 -50
- package/containers/Cap/sagas.js +20 -12
- package/containers/Cap/selectors.js +13 -13
- package/containers/Cap/tests/__snapshots__/index.test.js.snap +1 -1
- package/containers/Cap/tests/saga.test.js +81 -1
- package/containers/Dashboard/index.js +34 -17
- package/containers/Dashboard/sagas.js +7 -1
- package/containers/Ebill/index.js +16 -3
- package/containers/Ebill/sagas.js +18 -11
- package/containers/Email/index.js +20 -3
- package/containers/Email/sagas.js +34 -23
- package/containers/LanguageProvider/index.js +49 -31
- package/containers/LanguageProvider/tests/index.test.js +5 -3
- package/containers/Line/Create/index.js +15 -2
- package/containers/Line/Create/sagas.js +26 -17
- package/containers/Line/Edit/sagas.js +12 -13
- package/containers/Login/index.js +36 -11
- package/containers/MobilePush/Create/index.js +17 -2
- package/containers/MobilePush/Create/sagas.js +18 -12
- package/containers/MobilePush/Edit/index.js +20 -3
- package/containers/MobilePush/Edit/sagas.js +30 -20
- package/containers/Sms/Create/index.js +15 -2
- package/containers/Sms/Create/sagas.js +8 -6
- package/containers/Sms/Edit/index.js +15 -3
- package/containers/Sms/Edit/sagas.js +14 -8
- package/containers/TagList/constants.js +23 -0
- package/containers/Templates/actions.js +0 -5
- package/containers/Templates/index.js +47 -14
- package/containers/Templates/sagas.js +20 -23
- package/containers/WeChat/MapTemplates/index.js +19 -2
- package/containers/WeChat/MapTemplates/sagas.js +17 -17
- package/containers/WeChat/RichmediaTemplates/Create/index.js +18 -2
- package/containers/WeChat/RichmediaTemplates/Create/sagas.js +11 -8
- package/containers/WeChat/RichmediaTemplates/Edit/index.js +21 -2
- package/containers/WeChat/RichmediaTemplates/Edit/sagas.js +9 -5
- package/entry.js +2 -0
- package/global-styles.js +2 -2
- package/gtm/eventDefinitionsMap.js +1 -1
- package/helpers/intl-enzym-test-helpers.js +1 -1
- package/hoc/withReactRouterV3Compatibility.js +66 -0
- package/index.js +12 -0
- package/initialReducer.js +32 -0
- package/initialState.js +1 -0
- package/mfe-exposed-components.js +8 -0
- package/package.json +16 -11
- package/routes.js +206 -749
- package/services/api.js +62 -17
- package/services/tests/api.test.js +248 -1
- package/styles/components/navigation/_leftnav.scss +13 -0
- package/styles/containers/layout/_layoutPage.scss +14 -0
- package/tests/integration/TemplateCreation/TemplateCreation.integration.test.js +21 -16
- package/tests/store.test.js +5 -3
- package/translations/en.json +1 -9
- package/translations/ja-JP.json +0 -8
- package/translations/zh.json +0 -8
- package/utils/authWrapper.js +43 -17
- package/utils/cdnTransformation.js +73 -44
- package/utils/checkStore.js +21 -0
- package/utils/common.js +198 -8
- package/utils/commonUtils.js +17 -1
- package/utils/customAuthWrapper.js +62 -0
- package/utils/customConnectedAuthWrapper.js +26 -0
- package/utils/history.js +8 -0
- package/utils/injectReducer.js +2 -0
- package/utils/injectSaga.js +2 -0
- package/utils/tagValidations.js +2 -2
- package/utils/tests/cdnTransformation.test.js +6 -4
- package/utils/tests/common.mockdata.js +623 -0
- package/utils/tests/common.test.js +273 -0
- package/utils/tests/commonUtil.test.js +79 -0
- package/v2Components/CapDeviceContent/index.js +330 -0
- package/v2Components/CapDeviceContent/index.scss +115 -0
- package/v2Components/CapDeviceContent/messages.js +94 -0
- package/v2Components/CapDeviceContent/tests/index.test.js +89 -0
- package/v2Components/CapImageUpload/constants.js +6 -0
- package/v2Components/CapImageUpload/index.js +23 -15
- package/v2Components/CapImageUpload/index.scss +6 -0
- package/v2Components/CapImageUpload/messages.js +7 -7
- package/v2Components/CapInAppCTA/constants.js +25 -0
- package/v2Components/CapInAppCTA/index.js +279 -0
- package/v2Components/CapInAppCTA/index.scss +99 -0
- package/v2Components/CapInAppCTA/messages.js +85 -0
- package/v2Components/CapTagList/index.js +149 -26
- package/v2Components/CapTagList/messages.js +12 -0
- package/v2Components/CapTagList/style.scss +26 -0
- package/v2Components/CapVideoUpload/constants.js +6 -0
- package/v2Components/CapVideoUpload/index.js +48 -22
- package/v2Components/CapVideoUpload/index.scss +4 -2
- package/v2Components/CapVideoUpload/messages.js +10 -6
- package/v2Components/CapWhatsappQuickReply/index.js +255 -0
- package/v2Components/CapWhatsappQuickReply/index.scss +54 -0
- package/v2Components/CapWhatsappQuickReply/messages.js +32 -0
- package/v2Components/Ckeditor/index.js +56 -22
- package/v2Components/Ckeditor/style.scss +3 -0
- package/v2Components/Ckeditor/tests/index.test.js +44 -0
- package/v2Components/CmsTemplatesComponent/index.js +1 -0
- package/v2Components/CmsTemplatesComponent/messages.js +4 -0
- package/v2Components/EmailMobilePreview/index.js +4 -2
- package/v2Components/EmailPreviewV2/index.js +6 -4
- package/v2Components/EmailPreviewV2/tests/__snapshots__/index.test.js.snap +0 -3
- package/v2Components/FormBuilder/_formBuilder.scss +1 -0
- package/v2Components/FormBuilder/constants.js +1 -1
- package/v2Components/FormBuilder/index.js +111 -29
- package/v2Components/FormBuilder/messages.js +4 -0
- package/v2Components/FormBuilder/tests/index.test.js +5 -2
- package/v2Components/MobilePushPreviewV2/index.js +57 -22
- package/v2Components/NavigationBar/constants.js +1 -0
- package/v2Components/NavigationBar/index.js +84 -113
- package/v2Components/NavigationBar/messages.js +8 -0
- package/v2Components/NavigationBar/style.js +9 -0
- package/v2Components/NavigationBar/tests/index.test.js +32 -9
- package/v2Components/NavigationBar/tests/mockData.js +1 -0
- package/v2Components/NewCallTask/tests/index.test.js +5 -3
- package/v2Components/Pagination/index.js +2 -1
- package/v2Components/RenderRoute/RenderRoute.js +11 -0
- package/v2Components/RenderRoute/index.js +1 -0
- package/v2Components/TemplatePreview/_templatePreview.scss +535 -0
- package/v2Components/TemplatePreview/assets/images/inapp_mobile_android_bottom.svg +11 -0
- package/v2Components/TemplatePreview/assets/images/inapp_mobile_android_full.svg +11 -0
- package/v2Components/TemplatePreview/assets/images/inapp_mobile_android_modal.svg +11 -0
- package/v2Components/TemplatePreview/assets/images/inapp_mobile_android_top.svg +11 -0
- package/v2Components/TemplatePreview/assets/images/inapp_mobile_ios_bottom.svg +6 -0
- package/v2Components/TemplatePreview/assets/images/inapp_mobile_ios_full.svg +18 -0
- package/v2Components/TemplatePreview/assets/images/inapp_mobile_ios_modal.svg +7 -0
- package/v2Components/TemplatePreview/assets/images/inapp_mobile_ios_top.svg +13 -0
- package/v2Components/TemplatePreview/index.js +745 -362
- package/v2Components/TemplatePreview/messages.js +8 -0
- package/v2Components/TemplatePreview/tests/__snapshots__/index.test.js.snap +47 -14
- package/v2Components/TemplatePreview/tests/index.test.js +9 -0
- package/v2Components/WhatsappStatusContainer/_whatsappStatusContainer.scss +8 -1
- package/v2Containers/App/constants.js +12 -6
- package/v2Containers/App/sagas.js +0 -1
- package/v2Containers/Assets/Gallery/index.js +1 -0
- package/v2Containers/Assets/Gallery/sagas.js +15 -14
- package/v2Containers/BeeEditor/index.js +3 -1
- package/v2Containers/BeeEditor/sagas.js +8 -5
- package/v2Containers/CallTask/sagas.js +7 -1
- package/v2Containers/Cap/actions.js +4 -0
- package/v2Containers/Cap/constants.js +20 -1
- package/v2Containers/Cap/index.js +116 -17
- package/v2Containers/Cap/messages.js +8 -0
- package/v2Containers/Cap/reducer.js +18 -3
- package/v2Containers/Cap/sagas.js +64 -9
- package/v2Containers/Cap/selectors.js +27 -13
- package/v2Containers/Cap/tests/Cap.test.js +164 -0
- package/v2Containers/Cap/tests/__snapshots__/index.test.js.snap +2 -1
- package/v2Containers/Cap/tests/actions.test.js +11 -0
- package/v2Containers/Cap/tests/reducer.test.js +59 -0
- package/v2Containers/Cap/tests/saga.test.js +181 -2
- package/v2Containers/Cap/tests/selectors.test.js +42 -18
- package/v2Containers/CapFacebookPreview/sagas.js +7 -5
- package/v2Containers/CreativesContainer/SlideBoxContent.js +86 -4
- package/v2Containers/CreativesContainer/SlideBoxFooter.js +4 -3
- package/v2Containers/CreativesContainer/SlideBoxHeader.js +30 -14
- package/v2Containers/CreativesContainer/constants.js +5 -0
- package/v2Containers/CreativesContainer/index.js +157 -38
- package/v2Containers/CreativesContainer/index.scss +12 -0
- package/v2Containers/CreativesContainer/messages.js +33 -1
- package/v2Containers/CreativesContainer/tests/SlideBoxContent.test.js +11 -0
- package/v2Containers/CreativesContainer/tests/SlideBoxFooter.test.js +5 -2
- package/v2Containers/CreativesContainer/tests/SlideBoxHeader.test.js +7 -1
- package/v2Containers/CreativesContainer/tests/__snapshots__/SlideBoxContent.test.js.snap +227 -0
- package/v2Containers/CreativesContainer/tests/__snapshots__/SlideBoxHeader.test.js.snap +73 -0
- package/v2Containers/CreativesContainer/tests/__snapshots__/index.test.js.snap +80 -0
- package/v2Containers/CreativesContainer/tests/index.test.js +16 -0
- package/v2Containers/Ebill/sagas.js +3 -10
- package/v2Containers/Email/index.js +38 -19
- package/v2Containers/Email/initialSchema.js +1 -1
- package/v2Containers/Email/sagas.js +22 -26
- package/v2Containers/EmailWrapper/index.js +18 -8
- package/v2Containers/FTP/index.js +2 -2
- package/v2Containers/FTP/sagas.js +3 -4
- package/v2Containers/Facebook/sagas.js +26 -17
- package/v2Containers/InApp/actions.js +64 -0
- package/v2Containers/InApp/constants.js +160 -0
- package/v2Containers/InApp/index.js +792 -0
- package/v2Containers/InApp/index.scss +50 -0
- package/v2Containers/InApp/messages.js +114 -0
- package/v2Containers/InApp/reducer.js +109 -0
- package/v2Containers/InApp/sagas.js +151 -0
- package/v2Containers/InApp/selectors.js +12 -0
- package/v2Containers/InApp/tests/action.test.js +53 -0
- package/v2Containers/InApp/tests/index.test.js +165 -0
- package/v2Containers/InApp/tests/mockData.js +898 -0
- package/v2Containers/InApp/tests/reducer.test.js +177 -0
- package/v2Containers/InApp/tests/sagas.test.js +391 -0
- package/v2Containers/InApp/utils.js +12 -0
- package/v2Containers/LanguageProvider/index.js +17 -5
- package/v2Containers/LanguageProvider/reducer.js +3 -2
- package/v2Containers/LanguageProvider/sagas.js +7 -8
- package/v2Containers/LanguageProvider/selectors.js +2 -1
- package/v2Containers/LanguageProvider/tests/index.test.js +5 -2
- package/v2Containers/LanguageProvider/tests/reducer.test.js +6 -3
- package/v2Containers/Line/Container/ImageCarousel/tests/__snapshots__/content.test.js.snap +28 -16
- package/v2Containers/Line/Container/ImageCarousel/tests/__snapshots__/index.test.js.snap +2 -2
- package/v2Containers/Line/Container/ImageCarousel/tests/content.test.js +5 -3
- package/v2Containers/Line/Container/ImageCarousel/tests/index.test.js +5 -3
- package/v2Containers/Line/Container/ImageMap/index.js +1 -1
- package/v2Containers/Line/Container/Text/index.js +16 -1
- package/v2Containers/Line/Container/Video/index.js +2 -1
- package/v2Containers/Line/Container/Wrapper/tests/__snapshots__/index.test.js.snap +18134 -107
- package/v2Containers/Line/Container/Wrapper/tests/index.test.js +5 -3
- package/v2Containers/Line/Container/Wrapper/utils.js +1 -1
- package/v2Containers/Line/Container/index.js +4 -0
- package/v2Containers/Line/Container/sagas.js +30 -20
- package/v2Containers/Line/Container/tests/__snapshots__/index.test.js.snap +123 -81
- package/v2Containers/Line/Container/tests/index.test.js +5 -2
- package/v2Containers/Login/index.js +1 -2
- package/v2Containers/MobilePush/Create/index.js +40 -17
- package/v2Containers/MobilePush/Create/sagas.js +18 -12
- package/v2Containers/MobilePush/Edit/index.js +16 -7
- package/v2Containers/MobilePush/Edit/sagas.js +30 -20
- package/v2Containers/MobilepushWrapper/index.js +3 -0
- package/v2Containers/Rcs/sagas.js +14 -14
- package/v2Containers/Rcs/tests/__snapshots__/index.test.js.snap +123 -87
- package/v2Containers/Rcs/tests/index.test.js +5 -3
- package/v2Containers/Sms/Create/sagas.js +10 -6
- package/v2Containers/Sms/Edit/sagas.js +14 -8
- package/v2Containers/SmsTrai/Create/sagas.js +9 -10
- package/v2Containers/SmsTrai/Create/tests/__snapshots__/index.test.js.snap +4 -4
- package/v2Containers/SmsTrai/Edit/tests/__snapshots__/index.test.js.snap +12 -8
- package/v2Containers/SmsTrai/Edit/tests/index.test.js +5 -3
- package/v2Containers/TagList/_tagList.scss +18 -0
- package/v2Containers/TagList/index.js +81 -42
- package/v2Containers/TagList/tests/TagList.test.js +6 -7
- package/v2Containers/TagList/tests/mockdata.js +10 -166
- package/v2Containers/TagList/tests/utils.test.js +17 -0
- package/v2Containers/TagList/utils.js +15 -0
- package/v2Containers/Templates/_templates.scss +60 -5
- package/v2Containers/Templates/actions.js +6 -5
- package/v2Containers/Templates/constants.js +2 -1
- package/v2Containers/Templates/index.js +576 -181
- package/v2Containers/Templates/messages.js +52 -8
- package/v2Containers/Templates/reducer.js +3 -1
- package/v2Containers/Templates/sagas.js +54 -38
- package/v2Containers/Templates/tests/__snapshots__/index.test.js.snap +669 -43
- package/v2Containers/Templates/tests/actions.test.js +19 -0
- package/v2Containers/Templates/tests/index.test.js +53 -1
- package/v2Containers/Templates/tests/mockData.js +45 -1
- package/v2Containers/Templates/tests/reducer.test.js +50 -0
- package/v2Containers/Templates/tests/sagas.test.js +116 -3
- package/v2Containers/Templates/tests/selector.test.js +17 -0
- package/v2Containers/TemplatesV2/index.js +180 -8
- package/v2Containers/TemplatesV2/messages.js +8 -0
- package/v2Containers/TemplatesV2/tests/index.test.js +104 -0
- package/v2Containers/TemplatesV2/tests/mockData.js +685 -0
- package/v2Containers/Viber/constants.js +58 -0
- package/v2Containers/Viber/index.js +404 -421
- package/v2Containers/Viber/index.scss +107 -0
- package/v2Containers/Viber/messages.js +70 -2
- package/v2Containers/Viber/sagas.js +22 -14
- package/v2Containers/Viber/style.js +20 -0
- package/v2Containers/Viber/tests/index.test.js +299 -0
- package/v2Containers/Viber/tests/mockData.js +134 -0
- package/v2Containers/WeChat/MapTemplates/sagas.js +22 -14
- package/v2Containers/WeChat/RichmediaTemplates/Create/sagas.js +12 -11
- package/v2Containers/WeChat/RichmediaTemplates/Edit/sagas.js +9 -5
- package/v2Containers/Whatsapp/actions.js +16 -0
- package/v2Containers/Whatsapp/constants.js +24 -0
- package/v2Containers/Whatsapp/index.js +892 -222
- package/v2Containers/Whatsapp/index.scss +91 -1
- package/v2Containers/Whatsapp/messages.js +98 -1
- package/v2Containers/Whatsapp/reducer.js +19 -0
- package/v2Containers/Whatsapp/sagas.js +67 -12
- package/v2Containers/Whatsapp/styles.scss +35 -0
- package/v2Containers/Whatsapp/tests/__snapshots__/index.test.js.snap +34983 -24886
- package/v2Containers/Whatsapp/tests/__snapshots__/utils.test.js.snap +12 -0
- package/v2Containers/Whatsapp/tests/actions.test.js +21 -0
- package/v2Containers/Whatsapp/tests/index.test.js +17 -4
- package/v2Containers/Whatsapp/tests/mockData.js +77 -0
- package/v2Containers/Whatsapp/tests/reducer.test.js +67 -0
- package/v2Containers/Whatsapp/tests/saga.test.js +201 -0
- package/v2Containers/Whatsapp/tests/utils.test.js +18 -0
- package/v2Containers/Whatsapp/utils.js +65 -4
- package/v2Containers/Zalo/actions.js +24 -0
- package/v2Containers/Zalo/constants.js +59 -0
- package/v2Containers/Zalo/index.js +548 -0
- package/v2Containers/Zalo/index.scss +75 -0
- package/v2Containers/Zalo/messages.js +86 -0
- package/v2Containers/Zalo/reducer.js +63 -0
- package/v2Containers/Zalo/saga.js +45 -0
- package/v2Containers/Zalo/selectors.js +19 -0
- package/v2Containers/Zalo/tests/actions.test.js +26 -0
- package/v2Containers/Zalo/tests/index.test.js +149 -0
- package/v2Containers/Zalo/tests/mockData.js +11527 -0
- package/v2Containers/Zalo/tests/reducer.test.js +96 -0
- package/v2Containers/Zalo/tests/saga.test.js +118 -0
- package/v2Containers/Zalo/tests/selector.test.js +51 -0
- package/v2Containers/mockdata.js +1531 -680
- package/containers/TestPage/constants.js +0 -7
- package/containers/TestPage/index.js +0 -31
- package/containers/TestPage/messages.js +0 -13
- package/containers/TestPage/reducer.js +0 -21
- package/containers/TestPage/sagas.js +0 -11
- package/containers/Testv2/actions.js +0 -15
- package/containers/Testv2/constants.js +0 -7
- package/containers/Testv2/index.js +0 -47
- package/containers/Testv2/messages.js +0 -21
- package/containers/Testv2/reducer.js +0 -23
- package/containers/Testv2/sagas.js +0 -11
- package/containers/Testv2/selectors.js +0 -25
- package/reducers.js +0 -73
- package/store.js +0 -61
- package/utils/tests/asyncInjectors.test.js +0 -173
- package/v2Containers/TestPage/constants.js +0 -7
- package/v2Containers/TestPage/index.js +0 -31
- package/v2Containers/TestPage/messages.js +0 -13
- package/v2Containers/TestPage/reducer.js +0 -21
- package/v2Containers/TestPage/sagas.js +0 -11
- package/v2Containers/Testv2/actions.js +0 -15
- package/v2Containers/Testv2/constants.js +0 -7
- package/v2Containers/Testv2/index.js +0 -47
- package/v2Containers/Testv2/messages.js +0 -21
- package/v2Containers/Testv2/reducer.js +0 -23
- package/v2Containers/Testv2/sagas.js +0 -11
- package/v2Containers/Testv2/selectors.js +0 -25
|
@@ -25,6 +25,7 @@ import messages from './messages';
|
|
|
25
25
|
import './_email.scss';
|
|
26
26
|
import {getMessageObject} from '../../utils/messageUtils';
|
|
27
27
|
import EmailPreview from '../../v2Components/EmailPreview';
|
|
28
|
+
import { getDecodedFileName } from '../../utils/common';
|
|
28
29
|
|
|
29
30
|
import Pagination from '../../v2Components/Pagination';
|
|
30
31
|
import * as creativesContainerActions from '../CreativesContainer/actions';
|
|
@@ -36,6 +37,7 @@ import { FONT_COLOR_05 } from '@capillarytech/cap-ui-library/styled/variables';
|
|
|
36
37
|
import { gtmPush } from '../../utils/gtmTrackers';
|
|
37
38
|
const {CapCustomCardList} = CapCustomCard;
|
|
38
39
|
import {transformEmailTemplates, storeS3FileSizeDetails, CREATIVES_S3_ASSET_FILESIZES} from '../../utils/cdnTransformation';
|
|
40
|
+
import { CUSTOMER_BARCODE_TAG } from '../../containers/App/constants';
|
|
39
41
|
|
|
40
42
|
export class Email extends React.Component { // eslint-disable-line react/prefer-stateless-function
|
|
41
43
|
constructor(props) {
|
|
@@ -218,6 +220,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
218
220
|
}
|
|
219
221
|
}
|
|
220
222
|
|
|
223
|
+
|
|
221
224
|
checkBeeEditorAllowedForLibrary = () => {
|
|
222
225
|
const { isFullMode = false, editor } = this.props || {};
|
|
223
226
|
if ((editor === "BEE" && !isFullMode) || isFullMode) {
|
|
@@ -544,18 +547,27 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
544
547
|
window.removeEventListener("message", this.handleFrameTasks);
|
|
545
548
|
this.props.actions.clearStoreValues();
|
|
546
549
|
this.props.actions.clearCRUDResponse();
|
|
547
|
-
delete window?.[CREATIVES_S3_ASSET_FILESIZES]
|
|
550
|
+
delete window?.[CREATIVES_S3_ASSET_FILESIZES];
|
|
548
551
|
}
|
|
549
552
|
|
|
550
553
|
onFormDataChange = (updatedFormData, tabCount, currentTab) => {
|
|
551
554
|
// this.transformFormData(formData);
|
|
552
555
|
const formData = {...updatedFormData};
|
|
553
|
-
|
|
554
|
-
|
|
556
|
+
const {defaultData = {}, isFullMode, showTemplateName} = this.props;
|
|
557
|
+
const templateName = formData['template-name'];
|
|
558
|
+
const defaultTemplateName = _.get(defaultData, 'template-name', "");
|
|
559
|
+
|
|
560
|
+
|
|
561
|
+
if (defaultData && _.isEmpty(templateName) && isFullMode && !updatedFormData?.isTemplateNameEdited) {
|
|
562
|
+
formData['template-name'] = defaultTemplateName;
|
|
563
|
+
} else {
|
|
564
|
+
formData['template-name'] = templateName;
|
|
555
565
|
}
|
|
566
|
+
|
|
567
|
+
|
|
556
568
|
this.setState({formData, tabCount, isSchemaChanged: false}, () => {
|
|
557
|
-
if (this.props.isFullMode) {
|
|
558
|
-
|
|
569
|
+
if (this.props.isFullMode && showTemplateName) {
|
|
570
|
+
showTemplateName({formData, onFormDataChange: this.onFormDataChange});
|
|
559
571
|
}
|
|
560
572
|
});
|
|
561
573
|
if (currentTab) {
|
|
@@ -643,6 +655,8 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
643
655
|
} else if (data === "unsubscribe" && this.state.editorInstanse) {
|
|
644
656
|
const anchor = `<a href='{{${data}}}'>${data}</a>`;
|
|
645
657
|
this.state.editorInstanse.insertHtml(`${anchor}`);
|
|
658
|
+
} else if (data === CUSTOMER_BARCODE_TAG && this.state.editorInstanse) {
|
|
659
|
+
this.state.editorInstanse.insertHtml(`<img src="https://crm-nightly-new-fileservice.s3.amazonaws.com/intouch_creative_assets/8ebc8301-e262-45a6-bdab-ff0de91a.png?code={{${data}}}" />`);
|
|
646
660
|
} else if (this.state.editorInstanse) {
|
|
647
661
|
this.state.editorInstanse.insertHtml(`{{${data}}}`);
|
|
648
662
|
}
|
|
@@ -2066,7 +2080,8 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
2066
2080
|
formData[0].selectedLanguages = [];
|
|
2067
2081
|
let tabKey;
|
|
2068
2082
|
if ((this.props.location.query.isLanguageSupport === undefined || this.props.location.query.isLanguageSupport === 'false')) {
|
|
2069
|
-
formData['template-subject']
|
|
2083
|
+
// If formData['template-subject'] is empty, assign an empty string; otherwise, retain its current value or use data.base.subject.
|
|
2084
|
+
formData['template-subject'] = formData?.['template-subject'] === '' ? '' : (data?.base?.subject || '');
|
|
2070
2085
|
const baseLanguage = this.props.currentOrgDetails.basic_details.base_language;
|
|
2071
2086
|
let languageIndex = _.findIndex(this.supportedLanguages, {iso_code: baseLanguage});
|
|
2072
2087
|
|
|
@@ -2131,16 +2146,17 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
2131
2146
|
this.addLanguage(false, formData, false, additionalLanguages);
|
|
2132
2147
|
}
|
|
2133
2148
|
formData.base = _.cloneDeep(formData[0]);
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2149
|
+
if (formData?.['template-subject'] !== '') {
|
|
2150
|
+
this.setState({formData, loading: false, injectedTags: data.tags, tabKey, isDragDrop: (data.base.is_drag_drop !== 0 )}, () => {
|
|
2151
|
+
// this.setState({tabKey: ''});
|
|
2152
|
+
const isBEEEnable = this.checkBeeEditorAllowedForLibrary();
|
|
2153
|
+
_.forEach(formData[0].selectedLanguages, (language) => {
|
|
2154
|
+
if (formData[0][language].is_drag_drop && isBEEEnable) {
|
|
2155
|
+
this.props.actions.getCmsSetting(BEE_PLUGIN, formData[0][language].drag_drop_id, 'open', language, isEdmSupport, isBEEEnable);
|
|
2156
|
+
}
|
|
2157
|
+
});
|
|
2142
2158
|
});
|
|
2143
|
-
}
|
|
2159
|
+
}
|
|
2144
2160
|
} else {
|
|
2145
2161
|
this.setState({injectedTags: data.tags});
|
|
2146
2162
|
}
|
|
@@ -2359,7 +2375,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
2359
2375
|
history: [],
|
|
2360
2376
|
};
|
|
2361
2377
|
if (this.state.isEdit) {
|
|
2362
|
-
obj._id = this.props.Email.templateDetails
|
|
2378
|
+
obj._id = this.props.Email.templateDetails?._id || '';
|
|
2363
2379
|
}
|
|
2364
2380
|
obj.type = 'EMAIL';
|
|
2365
2381
|
const baseLanguage = this.props.currentOrgDetails.basic_details.base_language;
|
|
@@ -2403,7 +2419,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
2403
2419
|
|
|
2404
2420
|
// if (saveCount === 0) {
|
|
2405
2421
|
|
|
2406
|
-
this.props.actions.transformEmailTemplate(obj, (newEmail)=>{
|
|
2422
|
+
this.props.actions.transformEmailTemplate(obj, (newEmail) => {
|
|
2407
2423
|
this.props.actions.createTemplate(newEmail, this.onUpdateTemplateComplete);
|
|
2408
2424
|
});
|
|
2409
2425
|
// } else {
|
|
@@ -2443,6 +2459,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
2443
2459
|
getTemplateDataForGrid = ({templates, handlers, isLoading, loadingTip}) => {
|
|
2444
2460
|
const currentChannel = 'gallery';
|
|
2445
2461
|
const cardDataList = templates.length ? _.map(templates, (template) => {
|
|
2462
|
+
template.name = getDecodedFileName(template?.name);
|
|
2446
2463
|
const templateData =
|
|
2447
2464
|
{
|
|
2448
2465
|
key: `${currentChannel}-card-${template.name}`,
|
|
@@ -2551,7 +2568,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
2551
2568
|
<CapInput
|
|
2552
2569
|
className="search-text"
|
|
2553
2570
|
style={{width: '210px'}}
|
|
2554
|
-
placeholder=
|
|
2571
|
+
placeholder={`${this.props.intl.formatMessage(messages.searchText)}`}
|
|
2555
2572
|
prefix={<i className="material-icons" style={{color: '#707070', fontSize: '16px'}}>search</i>}
|
|
2556
2573
|
value={this.state.searchText}
|
|
2557
2574
|
onChange={(e) => this.searchAsset(e.target.value)}
|
|
@@ -2646,7 +2663,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
2646
2663
|
const previewHeader = (<h3>{this.props.intl.formatMessage(messages.h3emailPreview)}</h3>);
|
|
2647
2664
|
const imagePreviewHeader = (<h3>{this.props.intl.formatMessage(messages.h3imageSelection)}</h3>);
|
|
2648
2665
|
const imagePreviewContent = this.getImagePreviewContent();
|
|
2649
|
-
const { selectedOfferDetails, getDefaultTags, Email: { CmsSettings = {} } = {} } = this.props;
|
|
2666
|
+
const { selectedOfferDetails, getDefaultTags, Email: { CmsSettings = {} } = {}, moduleType = '' } = this.props;
|
|
2650
2667
|
if (!this.props.currentOrgDetails || !this.props.currentOrgDetails.basic_details) {
|
|
2651
2668
|
return (<div>Loading...</div>);
|
|
2652
2669
|
}
|
|
@@ -2714,6 +2731,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
2714
2731
|
uuid={CmsSettings.uuid}
|
|
2715
2732
|
type={CmsSettings.type}
|
|
2716
2733
|
isEmailLoading={isLoading}
|
|
2734
|
+
moduleType={moduleType}
|
|
2717
2735
|
/> : ''}
|
|
2718
2736
|
</Col>
|
|
2719
2737
|
</Row>
|
|
@@ -2769,6 +2787,7 @@ Email.propTypes = {
|
|
|
2769
2787
|
selectedOfferDetails: PropTypes.array,
|
|
2770
2788
|
onPreviewContentClicked: PropTypes.func,
|
|
2771
2789
|
onTestContentClicked: PropTypes.func,
|
|
2790
|
+
moduleType: PropTypes.string,
|
|
2772
2791
|
};
|
|
2773
2792
|
|
|
2774
2793
|
const mapStateToProps = (state, props) => createStructuredSelector({
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { take, cancel, call, put, takeLatest, takeEvery } from 'redux-saga/effects';
|
|
2
|
-
import { LOCATION_CHANGE } from 'react-router-redux';
|
|
1
|
+
import { take, cancel, call, put, takeLatest, takeEvery, all } from 'redux-saga/effects';
|
|
3
2
|
import * as Api from '../../services/api';
|
|
4
3
|
import * as types from './constants';
|
|
5
4
|
import { transformEmailTemplates, storeS3FileSizeDetails } from '../../utils/cdnTransformation';
|
|
@@ -93,52 +92,36 @@ export function* uploadAsset(file, assetType, fileParams) {
|
|
|
93
92
|
}
|
|
94
93
|
|
|
95
94
|
function* watchCreateTemplate() {
|
|
96
|
-
|
|
97
|
-
yield take(LOCATION_CHANGE);
|
|
98
|
-
yield cancel(watcher);
|
|
95
|
+
yield takeLatest(types.CREATE_TEMPLATE_REQUEST, createTemplate);
|
|
99
96
|
}
|
|
100
97
|
|
|
101
98
|
export function* watchTransformEmailTemplate() {
|
|
102
|
-
|
|
103
|
-
yield take(LOCATION_CHANGE);
|
|
104
|
-
yield cancel(watcher);
|
|
99
|
+
yield takeLatest(types.TRANSFORM_EMAIL_TEMPLATE_REQUEST, transformEmailTemplate);
|
|
105
100
|
}
|
|
106
101
|
|
|
107
102
|
|
|
108
103
|
function* watchGetTemplateDetails() {
|
|
109
|
-
|
|
110
|
-
yield take(LOCATION_CHANGE);
|
|
111
|
-
yield cancel(watcher);
|
|
104
|
+
yield takeLatest(types.GET_TEMPLATE_DETAILS_REQUEST, getTemplateDetails);
|
|
112
105
|
}
|
|
113
106
|
|
|
114
107
|
function* watchGetAllAssets() {
|
|
115
|
-
|
|
116
|
-
yield take(LOCATION_CHANGE);
|
|
117
|
-
yield cancel(watcher);
|
|
108
|
+
yield takeLatest(types.GET_ALL_ASSETS_REQUEST, getAllAssets);
|
|
118
109
|
}
|
|
119
110
|
|
|
120
111
|
function* watchGetCmsSetting() {
|
|
121
|
-
|
|
122
|
-
yield take(LOCATION_CHANGE);
|
|
123
|
-
yield cancel(watcher);
|
|
112
|
+
yield takeEvery(types.GET_CMS_EDITOR_DETAILS_REQUEST, getCmsSetting);
|
|
124
113
|
}
|
|
125
114
|
|
|
126
115
|
function* watchGetCmsData() {
|
|
127
|
-
|
|
128
|
-
yield take(LOCATION_CHANGE);
|
|
129
|
-
yield cancel(watcher);
|
|
116
|
+
yield takeEvery(types.GET_CMS_EDITOR_DATA_REQUEST, getCmsData);
|
|
130
117
|
}
|
|
131
118
|
|
|
132
119
|
function* watchUploadAsset() {
|
|
133
|
-
|
|
134
|
-
yield take(LOCATION_CHANGE);
|
|
135
|
-
yield cancel(watcher);
|
|
120
|
+
yield takeLatest(types.UPLOAD_ASSET_REQUEST, uploadAsset);
|
|
136
121
|
}
|
|
137
122
|
|
|
138
123
|
function* watchDuplicateTemplate() {
|
|
139
|
-
|
|
140
|
-
yield take(LOCATION_CHANGE);
|
|
141
|
-
yield cancel(watcher);
|
|
124
|
+
yield takeLatest(types.DUPLICATE_TEMPLATE_REQUEST, duplicateTemplate);
|
|
142
125
|
}
|
|
143
126
|
|
|
144
127
|
// All sagas to be loaded
|
|
@@ -152,3 +135,16 @@ export default [
|
|
|
152
135
|
watchUploadAsset,
|
|
153
136
|
watchDuplicateTemplate,
|
|
154
137
|
];
|
|
138
|
+
|
|
139
|
+
export function* v2EmailSagas() {
|
|
140
|
+
yield all([
|
|
141
|
+
watchCreateTemplate(),
|
|
142
|
+
watchTransformEmailTemplate(),
|
|
143
|
+
watchGetTemplateDetails(),
|
|
144
|
+
watchGetAllAssets(),
|
|
145
|
+
watchGetCmsSetting(),
|
|
146
|
+
watchGetCmsData(),
|
|
147
|
+
watchUploadAsset(),
|
|
148
|
+
watchDuplicateTemplate(),
|
|
149
|
+
]);
|
|
150
|
+
}
|
|
@@ -101,10 +101,15 @@ export class EmailWrapper extends React.Component { // eslint-disable-line react
|
|
|
101
101
|
this.props.onResetStep();
|
|
102
102
|
this.props.templatesActions.resetTemplateData();
|
|
103
103
|
}
|
|
104
|
-
onTemplateNameChange = ({target:{value}}) => {
|
|
105
|
-
|
|
106
|
-
const isEmptyTemplateName = value
|
|
107
|
-
this.setState({isTemplateNameEmpty
|
|
104
|
+
onTemplateNameChange = ({target: {value}}) => {
|
|
105
|
+
const {onEnterTemplateName, onRemoveTemplateName} = this.props;
|
|
106
|
+
const isEmptyTemplateName = !value?.trim();
|
|
107
|
+
this.setState({templateName: value, isTemplateNameEmpty: isEmptyTemplateName});
|
|
108
|
+
if (value && onEnterTemplateName) {
|
|
109
|
+
onEnterTemplateName();
|
|
110
|
+
} else if (onRemoveTemplateName) {
|
|
111
|
+
onRemoveTemplateName();
|
|
112
|
+
}
|
|
108
113
|
}
|
|
109
114
|
onChange = (e) => {
|
|
110
115
|
this.props.onEmailModeChange(e.target.value);
|
|
@@ -131,8 +136,8 @@ export class EmailWrapper extends React.Component { // eslint-disable-line react
|
|
|
131
136
|
gtmPush('creativeDetails', {
|
|
132
137
|
channel: EMAIL,
|
|
133
138
|
timeTaken,
|
|
134
|
-
mode: 'uploadZip'
|
|
135
|
-
});
|
|
139
|
+
mode: 'uploadZip',
|
|
140
|
+
});
|
|
136
141
|
}
|
|
137
142
|
handleFileUpload = (file = {}) => {
|
|
138
143
|
const { templatesActions, intl, showNextStep, isUploading } = this.props;
|
|
@@ -208,6 +213,7 @@ export class EmailWrapper extends React.Component { // eslint-disable-line react
|
|
|
208
213
|
cmsTemplatesLoader,
|
|
209
214
|
editor,
|
|
210
215
|
currentOrgDetails,
|
|
216
|
+
moduleType,
|
|
211
217
|
} = this.props;
|
|
212
218
|
const {
|
|
213
219
|
templateName,
|
|
@@ -242,10 +248,10 @@ export class EmailWrapper extends React.Component { // eslint-disable-line react
|
|
|
242
248
|
{emailCreateMode === "upload" &&
|
|
243
249
|
<div style={{ marginLeft: '8px' }}>
|
|
244
250
|
<CapUploader onChange={this.useFileUpload} accept=".zip, .html, .htm" showUploadList={false}>
|
|
245
|
-
{ (isFullMode && isTemplateNameEmpty) &&
|
|
251
|
+
{ (isFullMode && isTemplateNameEmpty) &&
|
|
246
252
|
<CapError type="error">
|
|
247
253
|
< FormattedMessage {...messages.emptyTemplateName} />
|
|
248
|
-
</CapError>
|
|
254
|
+
</CapError>
|
|
249
255
|
}
|
|
250
256
|
<CapButton disabled={isFullMode && isTemplateNameEmpty}>{this.props.intl.formatMessage(messages.upload)}</CapButton>
|
|
251
257
|
</CapUploader>
|
|
@@ -278,6 +284,7 @@ export class EmailWrapper extends React.Component { // eslint-disable-line react
|
|
|
278
284
|
onPreviewContentClicked={onPreviewContentClicked}
|
|
279
285
|
onTestContentClicked={onTestContentClicked}
|
|
280
286
|
editor={editor}
|
|
287
|
+
moduleType={moduleType}
|
|
281
288
|
/>}
|
|
282
289
|
{!isShowEmailCreate && (
|
|
283
290
|
<CmsTemplatesComponent
|
|
@@ -319,6 +326,9 @@ EmailWrapper.propTypes = {
|
|
|
319
326
|
selectedOfferDetails: PropTypes.array,
|
|
320
327
|
getCmsTemplatesInProgress: PropTypes.bool,
|
|
321
328
|
currentOrgDetails: PropTypes.object,
|
|
329
|
+
moduleType: PropTypes.string,
|
|
330
|
+
onEnterTemplateName: PropTypes.func,
|
|
331
|
+
onRemoveTemplateName: PropTypes.func,
|
|
322
332
|
};
|
|
323
333
|
|
|
324
334
|
const mapStateToProps = createStructuredSelector({
|
|
@@ -33,7 +33,7 @@ import * as globalActions from '../../containers/Cap/actions';
|
|
|
33
33
|
import { TagList } from '../TagList';
|
|
34
34
|
import { NO_COMMUNICATION, CREATE, EDIT, PREVIEW } from '../App/constants';
|
|
35
35
|
import { getTreeStructuredTags } from '../../utils/common';
|
|
36
|
-
import { transformInjectedTags, checkIfSupportedTag } from '../../utils/tagValidations';
|
|
36
|
+
import { transformInjectedTags, checkIfSupportedTag, skipTags } from '../../utils/tagValidations';
|
|
37
37
|
|
|
38
38
|
const UIView = {
|
|
39
39
|
serverSelection: 'serverSelection',
|
|
@@ -257,7 +257,7 @@ export class FTP extends React.Component {
|
|
|
257
257
|
matchedTags.forEach((tag) => {
|
|
258
258
|
let ifSupported = !!flatTags.find((t) => t === tag[0]);
|
|
259
259
|
const tagValue = tag[0].substring(this.indexOfEnd(tag[0], '{{'), tag[0].indexOf('}}'));
|
|
260
|
-
ifSupported = ifSupported || checkIfSupportedTag(tagValue, injectedTags);
|
|
260
|
+
ifSupported = ifSupported || checkIfSupportedTag(tagValue, injectedTags) || skipTags(tagValue);
|
|
261
261
|
if (!ifSupported) {
|
|
262
262
|
response.unsupportedTags.push(tagValue);
|
|
263
263
|
response.valid = false;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { take, cancel, call, put, takeLatest } from 'redux-saga/effects';
|
|
2
|
-
import { LOCATION_CHANGE } from 'react-router-redux';
|
|
3
2
|
import * as Api from '../../services/api';
|
|
4
3
|
import * as types from './constants';
|
|
5
4
|
|
|
@@ -15,9 +14,9 @@ export function* getFTPServers() {
|
|
|
15
14
|
|
|
16
15
|
|
|
17
16
|
function* watchGetFTPServers() {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
yield takeLatest(types.GET_FTP_SERVERS_REQUEST, getFTPServers);
|
|
18
|
+
|
|
19
|
+
|
|
21
20
|
}
|
|
22
21
|
|
|
23
22
|
// All sagas to be loaded
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { take, call, put, takeLatest, cancel } from 'redux-saga/effects';
|
|
2
|
-
import { LOCATION_CHANGE } from 'react-router-redux';
|
|
1
|
+
import { take, call, put, takeLatest, cancel, all } from 'redux-saga/effects';
|
|
3
2
|
import * as Api from '../../services/api';
|
|
4
3
|
import {
|
|
5
4
|
GET_MARKETING_OBJECTIVES,
|
|
@@ -145,33 +144,33 @@ export function* getTemplateDetails({id, callback}) {
|
|
|
145
144
|
|
|
146
145
|
|
|
147
146
|
function* watchCreateTemplate() {
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
147
|
+
yield takeLatest(CREATE_FACEBOOK_AD_TEMPLATE_REQUEST, createFacebookADTemplate);
|
|
148
|
+
|
|
149
|
+
|
|
151
150
|
}
|
|
152
151
|
|
|
153
152
|
function* watchGetTemplateDetails() {
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
153
|
+
yield takeLatest(GET_FACEBOOK_AD_TEMPLATE_DETAILS_REQUEST, getTemplateDetails);
|
|
154
|
+
|
|
155
|
+
|
|
157
156
|
}
|
|
158
157
|
|
|
159
158
|
function* watchEditTemplate() {
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
159
|
+
yield takeLatest(EDIT_FACEBOOK_AD_TEMPLATE_REQUEST, editTemplate);
|
|
160
|
+
|
|
161
|
+
|
|
163
162
|
}
|
|
164
163
|
|
|
165
164
|
|
|
166
165
|
function* watchFetchMarketingObjective() {
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
166
|
+
yield takeLatest(GET_MARKETING_OBJECTIVES, fetchMarketingObjectives);
|
|
167
|
+
|
|
168
|
+
|
|
170
169
|
}
|
|
171
170
|
function* watchUploadFbADAsset() {
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
171
|
+
yield takeLatest(UPLOAD_FB_AD_ASSET_REQUEST, uploadFbAdAsset);
|
|
172
|
+
|
|
173
|
+
|
|
175
174
|
}
|
|
176
175
|
export function* watchGetOrgOUs() {
|
|
177
176
|
yield takeLatest(GET_ORG_OU_LIST_REQUEST, getOrgOUs);
|
|
@@ -186,3 +185,13 @@ export default [
|
|
|
186
185
|
watchGetOrgOUs,
|
|
187
186
|
];
|
|
188
187
|
|
|
188
|
+
export function* v2FacebookSagas() {
|
|
189
|
+
yield all([
|
|
190
|
+
watchFetchMarketingObjective(),
|
|
191
|
+
watchUploadFbADAsset(),
|
|
192
|
+
watchEditTemplate(),
|
|
193
|
+
watchGetTemplateDetails(),
|
|
194
|
+
watchCreateTemplate(),
|
|
195
|
+
watchGetOrgOUs(),
|
|
196
|
+
]);
|
|
197
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { INAPP } from "../CreativesContainer/constants";
|
|
2
|
+
import {
|
|
3
|
+
INAPP_TEMPLATE_CREATE_REQUEST,
|
|
4
|
+
CLEAR_CREATE_RESPONSE_REQUEST,
|
|
5
|
+
GET_INAPP_TEMPLATE_DETAILS_REQUEST,
|
|
6
|
+
RESET_EDIT_TEMPLATE,
|
|
7
|
+
UPLOAD_INAPP_ASSET_REQUEST,
|
|
8
|
+
CLEAR_INAPP_ASSET,
|
|
9
|
+
INAPP_EDIT_TEMPLATE_REQUEST,
|
|
10
|
+
} from "./constants";
|
|
11
|
+
|
|
12
|
+
export function createInAppTemplate(payload, callback) {
|
|
13
|
+
return {
|
|
14
|
+
type: INAPP_TEMPLATE_CREATE_REQUEST,
|
|
15
|
+
payload,
|
|
16
|
+
callback,
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
export function clearCreateResponse() {
|
|
20
|
+
return {
|
|
21
|
+
type: CLEAR_CREATE_RESPONSE_REQUEST,
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
// FOR EDIT
|
|
25
|
+
export function getTemplateDetails(id, callback) {
|
|
26
|
+
return {
|
|
27
|
+
type: GET_INAPP_TEMPLATE_DETAILS_REQUEST,
|
|
28
|
+
id,
|
|
29
|
+
channel: INAPP,
|
|
30
|
+
callback,
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export function editTemplate(template, callback) {
|
|
35
|
+
return {
|
|
36
|
+
type: INAPP_EDIT_TEMPLATE_REQUEST,
|
|
37
|
+
payload: template,
|
|
38
|
+
callback,
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export function resetEditTemplate() {
|
|
43
|
+
return {
|
|
44
|
+
type: RESET_EDIT_TEMPLATE,
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export const uploadInAppAsset = (
|
|
49
|
+
file,
|
|
50
|
+
assetType,
|
|
51
|
+
fileParams,
|
|
52
|
+
templateType,
|
|
53
|
+
) => ({
|
|
54
|
+
type: UPLOAD_INAPP_ASSET_REQUEST,
|
|
55
|
+
file,
|
|
56
|
+
assetType,
|
|
57
|
+
fileParams,
|
|
58
|
+
templateType,
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
export const clearInAppAsset = (templateType) => ({
|
|
62
|
+
type: CLEAR_INAPP_ASSET,
|
|
63
|
+
templateType,
|
|
64
|
+
});
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { FormattedMessage } from "react-intl";
|
|
3
|
+
import {
|
|
4
|
+
CAP_ORANGE,
|
|
5
|
+
CAP_PURPLE02,
|
|
6
|
+
CAP_PURPLE03,
|
|
7
|
+
CAP_ORANGE01,
|
|
8
|
+
CAP_GREEN01,
|
|
9
|
+
CAP_GREEN02,
|
|
10
|
+
CAP_PALE_GREY,
|
|
11
|
+
FONT_COLOR_05,
|
|
12
|
+
} from '@capillarytech/cap-ui-library/styled/variables';
|
|
13
|
+
import CapHeading from "@capillarytech/cap-ui-library/CapHeading";
|
|
14
|
+
import CapLabel from "@capillarytech/cap-ui-library/CapLabel";
|
|
15
|
+
import { WEBSITE } from "../../v2Components/CapInAppCTA/constants";
|
|
16
|
+
import messages from "./messages";
|
|
17
|
+
|
|
18
|
+
const prefix = "app/v2Containers/InApp";
|
|
19
|
+
export const INAPP_TEMPLATE_CREATE_REQUEST = `${prefix}/INAPP_TEMPLATE_CREATE_REQUEST`;
|
|
20
|
+
export const INAPP_TEMPLATE_CREATE_SUCCESS = `${prefix}/INAPP_TEMPLATE_CREATE_SUCCESS`;
|
|
21
|
+
export const INAPP_TEMPLATE_CREATE_FAILURE = `${prefix}/INAPP_TEMPLATE_CREATE_FAILURE`;
|
|
22
|
+
export const INAPP_EDIT_TEMPLATE_REQUEST = `${prefix}/INAPP_EDIT_TEMPLATE_REQUEST`;
|
|
23
|
+
export const INAPP_EDIT_TEMPLATE_SUCCESS = `${prefix}/INAPP_EDIT_TEMPLATE_SUCCESS`;
|
|
24
|
+
export const INAPP_EDIT_TEMPLATE_FAILURE = `${prefix}/INAPP_EDIT_TEMPLATE_FAILURE`;
|
|
25
|
+
export const CLEAR_CREATE_RESPONSE_REQUEST = `${prefix}/CLEAR_CREATE_RESPONSE_REQUEST`;
|
|
26
|
+
// FOR EDIT
|
|
27
|
+
export const GET_INAPP_TEMPLATE_DETAILS_REQUEST = `${prefix}/Edit/GET_INAPP_TEMPLATE_DETAILS_REQUEST`;
|
|
28
|
+
export const GET_INAPP_TEMPLATE_DETAILS_SUCCESS = `${prefix}/Edit/GET_INAPP_TEMPLATE_DETAILS_SUCCESS`;
|
|
29
|
+
export const GET_INAPP_TEMPLATE_DETAILS_FAILURE = `${prefix}/Edit/GET_INAPP_TEMPLATE_DETAILS_FAILURE`;
|
|
30
|
+
export const RESET_EDIT_TEMPLATE = `${prefix}/Edit/RESET_EDIT_TEMPLATE`;
|
|
31
|
+
|
|
32
|
+
export const UPLOAD_INAPP_ASSET_REQUEST = `${prefix}/UPLOAD_INAPP_ASSET_REQUEST`;
|
|
33
|
+
export const UPLOAD_INAPP_ASSET_SUCCESS = `${prefix}/UPLOAD_INAPP_ASSET_SUCCESS`;
|
|
34
|
+
export const UPLOAD_INAPP_ASSET_FAILURE = `${prefix}/UPLOAD_INAPP_ASSET_FAILURE`;
|
|
35
|
+
export const CLEAR_INAPP_ASSET = `${prefix}/CLEAR_INAPP_ASSET`;
|
|
36
|
+
|
|
37
|
+
export const INAPP_MEDIA_TYPES = {
|
|
38
|
+
TEXT: "TEXT",
|
|
39
|
+
IMAGE: "IMAGE",
|
|
40
|
+
};
|
|
41
|
+
export const BIG_TEXT = 'BIG_TEXT';
|
|
42
|
+
export const BIG_PICTURE = 'BIG_PICTURE';
|
|
43
|
+
export const NONE = "NONE";
|
|
44
|
+
export const CTA = "CTA";
|
|
45
|
+
export const MAPP_SDK = "MAPP_SDK";
|
|
46
|
+
export const INAPP_BUTTON_TYPES = {
|
|
47
|
+
NONE,
|
|
48
|
+
CTA,
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export const DEEP_LINK = 'DEEP_LINK';
|
|
52
|
+
|
|
53
|
+
export const INITIAL_CTA_DATA = [
|
|
54
|
+
{
|
|
55
|
+
index: 0,
|
|
56
|
+
ctaType: WEBSITE,
|
|
57
|
+
text: "",
|
|
58
|
+
urlType: DEEP_LINK,
|
|
59
|
+
url: "",
|
|
60
|
+
isSaved: false,
|
|
61
|
+
},
|
|
62
|
+
];
|
|
63
|
+
|
|
64
|
+
export const URL_MAX_LENGTH = 2000;
|
|
65
|
+
|
|
66
|
+
export const ALLOWED_IMAGE_EXTENSIONS_REGEX = /\.(jpe?g|png)$/i;
|
|
67
|
+
export const INAPP_IMG_SIZE = 5000000; // 5MB
|
|
68
|
+
|
|
69
|
+
export const TEMPLATE_MESSAGE_MAX_LENGTH = 1024;
|
|
70
|
+
|
|
71
|
+
export const INAPP_MESSAGE_LAYOUT_TYPES = {
|
|
72
|
+
MODAL: "POPUP",
|
|
73
|
+
TOPBANNER: "HEADER",
|
|
74
|
+
BOTTOMBANNER: "FOOTER",
|
|
75
|
+
FULLSCREEN: "FULLSCREEN",
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
export const ANDROID = "ANDROID";
|
|
79
|
+
export const IOS = "iOS";
|
|
80
|
+
export const LAYOUT_RADIO_OPTIONS = [
|
|
81
|
+
{
|
|
82
|
+
value: INAPP_MESSAGE_LAYOUT_TYPES.MODAL,
|
|
83
|
+
label: <FormattedMessage {...messages.layoutModal} />,
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
value: INAPP_MESSAGE_LAYOUT_TYPES.TOPBANNER,
|
|
87
|
+
label: <FormattedMessage {...messages.layoutTopBanner} />,
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
value: INAPP_MESSAGE_LAYOUT_TYPES.BOTTOMBANNER,
|
|
91
|
+
label: <FormattedMessage {...messages.layoutBottomBanner} />,
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
value: INAPP_MESSAGE_LAYOUT_TYPES.FULLSCREEN,
|
|
95
|
+
label: <FormattedMessage {...messages.layoutFullScreen} />,
|
|
96
|
+
},
|
|
97
|
+
];
|
|
98
|
+
export const MEDIA_RADIO_OPTIONS = [
|
|
99
|
+
{
|
|
100
|
+
value: INAPP_MEDIA_TYPES.TEXT,
|
|
101
|
+
label: <FormattedMessage {...messages.mediaText} />,
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
value: INAPP_MEDIA_TYPES.IMAGE,
|
|
105
|
+
label: <FormattedMessage {...messages.mediaImage} />,
|
|
106
|
+
},
|
|
107
|
+
];
|
|
108
|
+
export const BUTTON_RADIO_OPTIONS = [
|
|
109
|
+
{
|
|
110
|
+
value: INAPP_BUTTON_TYPES.NONE,
|
|
111
|
+
label: (
|
|
112
|
+
<CapHeading
|
|
113
|
+
type="h4"
|
|
114
|
+
className="inapp-button-none"
|
|
115
|
+
>
|
|
116
|
+
<FormattedMessage {...messages.btnTypeNone} />
|
|
117
|
+
</CapHeading>
|
|
118
|
+
),
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
value: INAPP_BUTTON_TYPES.CTA,
|
|
122
|
+
label: (
|
|
123
|
+
<>
|
|
124
|
+
<div
|
|
125
|
+
className="inapp-button-cta"
|
|
126
|
+
>
|
|
127
|
+
<CapHeading type="h4">
|
|
128
|
+
<FormattedMessage {...messages.btnTypeCTA} />
|
|
129
|
+
</CapHeading>
|
|
130
|
+
<CapLabel><FormattedMessage {...messages.ctaDescription} /></CapLabel>
|
|
131
|
+
</div>
|
|
132
|
+
</>
|
|
133
|
+
),
|
|
134
|
+
},
|
|
135
|
+
];
|
|
136
|
+
|
|
137
|
+
export const INAPP_LAYOUT_DETAILS = {
|
|
138
|
+
POPUP: {
|
|
139
|
+
tagColor: CAP_ORANGE01,
|
|
140
|
+
tagTextColor: CAP_ORANGE,
|
|
141
|
+
text: <FormattedMessage {...messages.popup} />,
|
|
142
|
+
},
|
|
143
|
+
HEADER: {
|
|
144
|
+
tagColor: CAP_PURPLE03,
|
|
145
|
+
tagTextColor: CAP_PURPLE02,
|
|
146
|
+
text: <FormattedMessage {...messages.header} />,
|
|
147
|
+
},
|
|
148
|
+
FOOTER: {
|
|
149
|
+
tagColor: CAP_PALE_GREY,
|
|
150
|
+
tagTextColor: FONT_COLOR_05,
|
|
151
|
+
text: <FormattedMessage {...messages.footer} />,
|
|
152
|
+
},
|
|
153
|
+
FULLSCREEN: {
|
|
154
|
+
tagColor: CAP_GREEN02,
|
|
155
|
+
tagTextColor: CAP_GREEN01,
|
|
156
|
+
text: <FormattedMessage {...messages.layoutFullScreen} />,
|
|
157
|
+
},
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
export const DEVICE_SUPPORTED = '1';
|