@capillarytech/creatives-library 8.0.142-alpha.0 → 8.0.142
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/components/BreadCrumbs/index.js +65 -0
- package/components/BreadCrumbs/messages.js +13 -0
- package/components/CapTagList/index.js +235 -0
- package/components/CapTagList/messages.js +45 -0
- package/components/Card/_customCard.scss +40 -0
- package/components/Card/index.js +78 -0
- package/components/Card/tests/__snapshots__/index.test.js.snap +22 -0
- package/components/Card/tests/index.test.js +20 -0
- package/components/CardGrid/index.js +71 -0
- package/components/Ckeditor/index.js +238 -0
- package/components/Ckeditor/messages.js +13 -0
- package/components/Ckeditor/style.scss +3 -0
- package/components/Component/index.js +29 -0
- package/components/CustomPopOver/index.js +81 -0
- package/components/CustomPopOver/messages.js +17 -0
- package/components/DateFilter/index.js +349 -0
- package/components/DateFilter/messages.js +57 -0
- package/components/DateRange/index.js +114 -0
- package/components/DateRange/messages.js +25 -0
- package/components/Edmeditor/index.js +65 -0
- package/components/Edmeditor/messages.js +13 -0
- package/components/EmailPreview/_emailPreview.scss +119 -0
- package/components/EmailPreview/assets/images/iPad.svg +10 -0
- package/components/EmailPreview/assets/images/mobile.png +0 -0
- package/components/EmailPreview/index.js +107 -0
- package/components/EmailPreview/messages.js +33 -0
- package/components/Footer/index.js +27 -0
- package/components/Footer/messages.js +13 -0
- package/components/FormBuilder/_formBuilder.scss +83 -0
- package/components/FormBuilder/index.js +3279 -0
- package/components/FormBuilder/messages.js +61 -0
- package/components/Header/index.js +44 -0
- package/components/Header/messages.js +29 -0
- package/components/ImagePreview/_imagePreview.scss +63 -0
- package/components/ImagePreview/index.js +52 -0
- package/components/ImagePreview/messages.js +17 -0
- package/components/PageHeader/_pageHeader.scss +22 -0
- package/components/PageHeader/index.js +37 -0
- package/components/PageHeader/messages.js +13 -0
- package/components/Pagination/_pagination.scss +5 -0
- package/components/Pagination/index.js +49 -0
- package/components/PreviewSideBar/_previewsidebar.scss +28 -0
- package/components/PreviewSideBar/index.js +152 -0
- package/components/PreviewSideBar/messages.js +41 -0
- package/components/Sidebar/_sidebar.scss +115 -0
- package/components/Sidebar/index.js +214 -0
- package/components/Sidebar/messages.js +21 -0
- package/components/SlideBox/_slideBox.scss +63 -0
- package/components/SlideBox/index.js +47 -0
- package/components/SlideBox/tests/index.test.js +103 -0
- package/components/SmsEditor/index.js +55 -0
- package/components/SmsTest/index.js +117 -0
- package/components/SmsTest/messages.js +21 -0
- package/components/TemplatePreview/WechatRichmediaTemplatePreview/_wechatRichmediaTemplatePrev.scss +42 -0
- package/components/TemplatePreview/WechatRichmediaTemplatePreview/index.js +141 -0
- package/components/TemplatePreview/WechatRichmediaTemplatePreview/messages.js +21 -0
- package/components/TemplatePreview/_templatePreview.scss +642 -0
- package/components/TemplatePreview/assets/images/WECHAT_5x.png +0 -0
- package/components/TemplatePreview/assets/images/androidPushMessage.svg +45 -0
- package/components/TemplatePreview/assets/images/home-screen-android.svg +21 -0
- package/components/TemplatePreview/assets/images/home-screen-ios.svg +16 -0
- package/components/TemplatePreview/assets/images/iPhonePushMessage.svg +135 -0
- package/components/TemplatePreview/assets/images/mobile.svg +24 -0
- package/components/TemplatePreview/assets/images/sms-body.png +0 -0
- package/components/TemplatePreview/assets/images/sms-icon.png +0 -0
- package/components/TemplatePreview/assets/images/sms_mobile.png +0 -0
- package/components/TemplatePreview/assets/images/sms_mobile_android.svg +22 -0
- package/components/TemplatePreview/assets/images/sms_mobile_ios.svg +16 -0
- package/components/TemplatePreview/assets/images/user-icon.svg +19 -0
- package/components/TemplatePreview/assets/images/wechat-mobile.svg +78 -0
- package/components/TemplatePreview/assets/images/wechat_mobile_android.svg +20 -0
- package/components/TemplatePreview/index.js +617 -0
- package/components/TemplatePreview/messages.js +78 -0
- package/components/Toastr/index.js +60 -0
- package/components/Toastr/messages.js +13 -0
- package/components/ToastrMessage/index.js +113 -0
- package/components/ToastrMessage/messages.js +17 -0
- package/components/TopBar/_topbar.scss +46 -0
- package/components/TopBar/assets/images/capillary_logo.png +0 -0
- package/components/TopBar/assets/images/old_capillary_logo.png +0 -0
- package/components/TopBar/index.js +113 -0
- package/components/TopBar/messages.js +29 -0
- package/containers/App/actions.js +7 -0
- package/containers/App/constants.js +114 -0
- package/containers/App/index.js +52 -0
- package/containers/App/reducer.js +19 -0
- package/containers/App/sagas.js +31 -0
- package/containers/App/selectors.js +25 -0
- package/containers/App/test/saga.test.js +11 -0
- package/containers/Assets/Gallery/_gallery.scss +126 -0
- package/containers/Assets/Gallery/actions.js +37 -0
- package/containers/Assets/Gallery/constants.js +23 -0
- package/containers/Assets/Gallery/index.js +473 -0
- package/containers/Assets/Gallery/messages.js +93 -0
- package/containers/Assets/Gallery/reducer.js +81 -0
- package/containers/Assets/Gallery/sagas.js +80 -0
- package/containers/Assets/Gallery/selectors.js +25 -0
- package/containers/Assets/Gallery/tests/__snapshots__/reducer.test.js.snap +9 -0
- package/containers/Assets/Gallery/tests/actions.test.js +25 -0
- package/containers/Assets/Gallery/tests/reducer.test.js +96 -0
- package/containers/Assets/Gallery/tests/saga.test.js +157 -0
- package/containers/Cap/actions.js +66 -0
- package/containers/Cap/constants.js +25 -0
- package/containers/Cap/index.js +402 -0
- package/containers/Cap/messages.js +75 -0
- package/containers/Cap/reducer.js +113 -0
- package/containers/Cap/sagas.js +159 -0
- package/containers/Cap/selectors.js +75 -0
- package/containers/Cap/tests/__snapshots__/index.test.js.snap +2270 -0
- package/containers/Cap/tests/index.test.js +22 -0
- package/containers/Cap/tests/saga.test.js +284 -0
- package/containers/Dashboard/actions.js +15 -0
- package/containers/Dashboard/constants.js +7 -0
- package/containers/Dashboard/index.js +76 -0
- package/containers/Dashboard/messages.js +13 -0
- package/containers/Dashboard/reducer.js +21 -0
- package/containers/Dashboard/sagas.js +17 -0
- package/containers/Dashboard/selectors.js +25 -0
- package/containers/Dashboard/test/saga.test.js +9 -0
- package/containers/Ebill/_ebill.scss +5 -0
- package/containers/Ebill/actions.js +43 -0
- package/containers/Ebill/constants.js +20 -0
- package/containers/Ebill/index.js +1278 -0
- package/containers/Ebill/messages.js +77 -0
- package/containers/Ebill/reducer.js +72 -0
- package/containers/Ebill/sagas.js +74 -0
- package/containers/Ebill/selectors.js +25 -0
- package/containers/Ebill/test/saga.test.js +11 -0
- package/containers/Email/_email.scss +141 -0
- package/containers/Email/actions.js +81 -0
- package/containers/Email/constants.js +36 -0
- package/containers/Email/index.js +3325 -0
- package/containers/Email/messages.js +289 -0
- package/containers/Email/reducer.js +142 -0
- package/containers/Email/sagas.js +135 -0
- package/containers/Email/selectors.js +31 -0
- package/containers/Email/test/saga.test.js +671 -0
- package/containers/LanguageProvider/actions.js +17 -0
- package/containers/LanguageProvider/constants.js +8 -0
- package/containers/LanguageProvider/index.js +80 -0
- package/containers/LanguageProvider/reducer.js +30 -0
- package/containers/LanguageProvider/selectors.js +20 -0
- package/containers/LanguageProvider/tests/actions.test.js +19 -0
- package/containers/LanguageProvider/tests/index.test.js +78 -0
- package/containers/LanguageProvider/tests/reducer.test.js +20 -0
- package/containers/LanguageProvider/tests/selectors.test.js +15 -0
- package/containers/Line/Create/_lineCreate.scss +54 -0
- package/containers/Line/Create/actions.js +90 -0
- package/containers/Line/Create/constants.js +39 -0
- package/containers/Line/Create/index.js +836 -0
- package/containers/Line/Create/messages.js +189 -0
- package/containers/Line/Create/reducer.js +99 -0
- package/containers/Line/Create/sagas.js +121 -0
- package/containers/Line/Create/selectors.js +36 -0
- package/containers/Line/Create/tests/saga.test.js +202 -0
- package/containers/Line/Edit/_lineEdit.scss +35 -0
- package/containers/Line/Edit/actions.js +79 -0
- package/containers/Line/Edit/constants.js +27 -0
- package/containers/Line/Edit/index.js +1050 -0
- package/containers/Line/Edit/messages.js +177 -0
- package/containers/Line/Edit/reducer.js +83 -0
- package/containers/Line/Edit/sagas.js +80 -0
- package/containers/Line/Edit/selectors.js +29 -0
- package/containers/Line/Edit/test/saga.test.js +160 -0
- package/containers/Login/assets/images/capillary_logo.png +0 -0
- package/containers/Login/components/LoginForm/index.js +62 -0
- package/containers/Login/components/LoginForm/messages.js +33 -0
- package/containers/Login/index.js +130 -0
- package/containers/Login/messages.js +25 -0
- package/containers/Login/selectors.js +25 -0
- package/containers/MobilePush/Create/_mobilePushCreate.scss +39 -0
- package/containers/MobilePush/Create/actions.js +46 -0
- package/containers/MobilePush/Create/constants.js +23 -0
- package/containers/MobilePush/Create/index.js +2303 -0
- package/containers/MobilePush/Create/messages.js +269 -0
- package/containers/MobilePush/Create/reducer.js +70 -0
- package/containers/MobilePush/Create/sagas.js +74 -0
- package/containers/MobilePush/Create/selectors.js +28 -0
- package/containers/MobilePush/Create/test/saga.test.js +19 -0
- package/containers/MobilePush/Edit/_mobilePushCreate.scss +39 -0
- package/containers/MobilePush/Edit/actions.js +91 -0
- package/containers/MobilePush/Edit/constants.js +35 -0
- package/containers/MobilePush/Edit/index.js +2601 -0
- package/containers/MobilePush/Edit/messages.js +266 -0
- package/containers/MobilePush/Edit/reducer.js +112 -0
- package/containers/MobilePush/Edit/sagas.js +126 -0
- package/containers/MobilePush/Edit/selectors.js +29 -0
- package/containers/MobilePush/Edit/tests/saga.test.js +255 -0
- package/containers/NotFoundPage/index.js +25 -0
- package/containers/NotFoundPage/messages.js +13 -0
- package/containers/NotFoundPage/tests/index.test.js +17 -0
- package/containers/Sms/Create/_smsCreate.scss +42 -0
- package/containers/Sms/Create/actions.js +27 -0
- package/containers/Sms/Create/constants.js +16 -0
- package/containers/Sms/Create/index.js +1488 -0
- package/containers/Sms/Create/messages.js +109 -0
- package/containers/Sms/Create/reducer.js +41 -0
- package/containers/Sms/Create/sagas.js +40 -0
- package/containers/Sms/Create/selectors.js +28 -0
- package/containers/Sms/Create/test/saga.test.js +11 -0
- package/containers/Sms/Edit/actions.js +40 -0
- package/containers/Sms/Edit/constants.js +17 -0
- package/containers/Sms/Edit/index.js +1472 -0
- package/containers/Sms/Edit/messages.js +105 -0
- package/containers/Sms/Edit/reducer.js +50 -0
- package/containers/Sms/Edit/sagas.js +60 -0
- package/containers/Sms/Edit/selectors.js +32 -0
- package/containers/Sms/Edit/test/saga.test.js +13 -0
- package/containers/TagList/_tagList.scss +8 -0
- package/containers/TagList/actions.js +15 -0
- package/containers/TagList/constants.js +32 -0
- package/containers/TagList/index.js +236 -0
- package/containers/TagList/messages.js +13 -0
- package/containers/TagList/reducer.js +23 -0
- package/containers/TagList/sagas.js +11 -0
- package/containers/TagList/selectors.js +25 -0
- package/containers/Templates/_templates.scss +333 -0
- package/containers/Templates/actions.js +103 -0
- package/containers/Templates/constants.js +60 -0
- package/containers/Templates/index.js +1756 -0
- package/containers/Templates/messages.js +337 -0
- package/containers/Templates/reducer.js +142 -0
- package/containers/Templates/sagas.js +163 -0
- package/containers/Templates/selectors.js +28 -0
- package/containers/Templates/test/saga.test.js +241 -0
- package/containers/WeChat/MapTemplates/_mapTemplates.scss +8 -0
- package/containers/WeChat/MapTemplates/actions.js +52 -0
- package/containers/WeChat/MapTemplates/constants.js +28 -0
- package/containers/WeChat/MapTemplates/index.js +1610 -0
- package/containers/WeChat/MapTemplates/messages.js +157 -0
- package/containers/WeChat/MapTemplates/reducer.js +74 -0
- package/containers/WeChat/MapTemplates/sagas.js +84 -0
- package/containers/WeChat/MapTemplates/selectors.js +25 -0
- package/containers/WeChat/MapTemplates/test/saga.test.js +155 -0
- package/containers/WeChat/RichmediaTemplates/Create/_createRichmedia.scss +57 -0
- package/containers/WeChat/RichmediaTemplates/Create/actions.js +36 -0
- package/containers/WeChat/RichmediaTemplates/Create/constants.js +15 -0
- package/containers/WeChat/RichmediaTemplates/Create/index.js +1071 -0
- package/containers/WeChat/RichmediaTemplates/Create/messages.js +165 -0
- package/containers/WeChat/RichmediaTemplates/Create/reducer.js +60 -0
- package/containers/WeChat/RichmediaTemplates/Create/richmediaschema.js +497 -0
- package/containers/WeChat/RichmediaTemplates/Create/sagas.js +51 -0
- package/containers/WeChat/RichmediaTemplates/Create/selectors.js +37 -0
- package/containers/WeChat/RichmediaTemplates/Create/test/saga.test.js +13 -0
- package/containers/WeChat/RichmediaTemplates/Edit/actions.js +20 -0
- package/containers/WeChat/RichmediaTemplates/Edit/constants.js +10 -0
- package/containers/WeChat/RichmediaTemplates/Edit/index.js +136 -0
- package/containers/WeChat/RichmediaTemplates/Edit/messages.js +13 -0
- package/containers/WeChat/RichmediaTemplates/Edit/reducer.js +28 -0
- package/containers/WeChat/RichmediaTemplates/Edit/sagas.js +36 -0
- package/containers/WeChat/RichmediaTemplates/Edit/selectors.js +30 -0
- package/containers/WeChat/RichmediaTemplates/Edit/test/saga.test.js +12 -0
- package/containers/WeChat/RichmediaTemplates/View/actions.js +15 -0
- package/containers/WeChat/RichmediaTemplates/View/constants.js +7 -0
- package/containers/WeChat/RichmediaTemplates/View/index.js +47 -0
- package/containers/WeChat/RichmediaTemplates/View/messages.js +21 -0
- package/containers/WeChat/RichmediaTemplates/View/reducer.js +23 -0
- package/containers/WeChat/RichmediaTemplates/View/sagas.js +11 -0
- package/containers/WeChat/RichmediaTemplates/View/selectors.js +25 -0
- package/index.js +2 -4
- package/initialReducer.js +2 -0
- package/package.json +1 -1
- package/routes.js +202 -136
- package/services/api.js +5 -0
- package/services/getSchema.js +1 -1
- package/services/localStorageApi.js +0 -1
- package/services/tests/api.test.js +17 -0
- package/tests/i18n.test.js +1 -1
- package/utils/asyncInjectors.js +78 -0
- package/utils/authWrapper.js +1 -1
- package/utils/callNativeEvent.js +16 -0
- package/utils/checkStore.js +21 -0
- package/utils/common.js +2 -2
- package/utils/customAuthWrapper.js +62 -0
- package/utils/customConnectedAuthWrapper.js +26 -0
- package/utils/tagValidations.js +1 -1
- package/utils/tests/authWrapper.test.js +1 -1
- package/utils/tests/checkStore.test.js +1 -1
- package/utils/tests/customAuth.test.js +1 -1
- package/utils/transformerUtils.js +1 -1
- package/v2Components/CapTagList/index.js +14 -9
- package/v2Components/Carousel/style.scss +1 -1
- package/v2Components/EmailMobilePreview/index.js +2 -2
- package/v2Components/FormBuilder/index.js +2 -2
- package/v2Components/MobilePushPreviewV2/index.js +8 -0
- package/v2Components/NavigationBar/saga.js +1 -1
- package/v2Components/NavigationBar/tests/saga.test.js +2 -2
- package/v2Components/TemplatePreview/assets/images/empty_android.svg +8 -0
- package/v2Components/TemplatePreview/assets/images/empty_ios.svg +5 -0
- package/v2Components/TemplatePreview/index.js +29 -4
- package/v2Containers/BeePopupEditor/constants.js +10 -0
- package/v2Containers/BeePopupEditor/index.js +169 -0
- package/v2Containers/BeePopupEditor/tests/index.test.js +628 -0
- package/v2Containers/Cap/tests/saga.test.js +1 -1
- package/v2Containers/CreativesContainer/SlideBoxContent.js +26 -8
- package/v2Containers/CreativesContainer/index.js +12 -2
- package/v2Containers/CreativesContainer/tests/__snapshots__/index.test.js.snap +5 -0
- package/v2Containers/Email/index.js +1 -1
- package/v2Containers/FTP/index.js +1 -1
- package/v2Containers/InApp/actions.js +7 -0
- package/v2Containers/InApp/constants.js +5 -1
- package/v2Containers/InApp/index.js +76 -53
- package/v2Containers/InApp/reducer.js +17 -0
- package/v2Containers/InApp/sagas.js +27 -0
- package/v2Containers/InApp/selectors.js +23 -1
- package/v2Containers/InApp/tests/index.test.js +0 -9
- package/v2Containers/InApp/tests/reducer.test.js +33 -0
- package/v2Containers/InApp/tests/sagas.test.js +57 -1
- package/v2Containers/InApp/tests/selector.test.js +612 -0
- package/v2Containers/InappAdvanced/index.js +459 -0
- package/v2Containers/InappAdvanced/index.scss +11 -0
- package/v2Containers/InappAdvanced/tests/index.test.js +442 -0
- package/v2Containers/InappWrapper/_inappWrapper.scss +19 -0
- package/v2Containers/InappWrapper/index.js +194 -0
- package/v2Containers/InappWrapper/messages.js +38 -0
- package/v2Containers/InappWrapper/tests/index.test.js +247 -0
- package/v2Containers/Line/Container/ImageCarousel/tests/__snapshots__/content.test.js.snap +3 -0
- package/v2Containers/Line/Container/ImageCarousel/tests/__snapshots__/index.test.js.snap +2 -0
- package/v2Containers/Line/Container/Text/index.js +1 -1
- package/v2Containers/Line/Container/Wrapper/tests/__snapshots__/index.test.js.snap +2 -0
- package/v2Containers/Line/Container/tests/__snapshots__/index.test.js.snap +9 -0
- package/v2Containers/Rcs/tests/__snapshots__/index.test.js.snap +18 -0
- package/v2Containers/Sms/Create/index.js +2 -2
- package/v2Containers/Sms/Edit/index.js +1 -1
- package/v2Containers/SmsTrai/Edit/tests/__snapshots__/index.test.js.snap +4 -0
- package/v2Containers/TagList/index.js +1 -1
- package/v2Containers/TagList/utils.js +1 -1
- package/v2Containers/Templates/index.js +1 -1
- package/v2Containers/Templates/sagas.js +1 -1
- package/v2Containers/Whatsapp/tests/__snapshots__/index.test.js.snap +35 -0
- package/constants/unified.js +0 -189
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { render } from '@testing-library/react';
|
|
3
|
-
import UserAuthWrapper from '
|
|
3
|
+
import UserAuthWrapper from '../customAuthWrapper';
|
|
4
4
|
|
|
5
5
|
const MockComponent = React.forwardRef((props, ref) => <div ref={ref} {...props}>Mock Component</div>);
|
|
6
6
|
|
|
@@ -30,8 +30,15 @@ import { FormattedMessage, injectIntl, intlShape } from 'react-intl';
|
|
|
30
30
|
import { createStructuredSelector } from 'reselect';
|
|
31
31
|
import messages from './messages';
|
|
32
32
|
import { makeSelectLoyaltyPromotionDisplay } from '../../v2Containers/Cap/selectors';
|
|
33
|
-
import { CARD_RELATED_TAGS, HOSPITALITY_RELATED_TAGS, CUSTOMER_BARCODE_TAG
|
|
33
|
+
import { CARD_RELATED_TAGS, HOSPITALITY_RELATED_TAGS, CUSTOMER_BARCODE_TAG } from '../../containers/App/constants';
|
|
34
34
|
import { hasCardBasedScope, hasCustomerBarcodeFeatureEnabled, hasHospitalityBasedScope } from '../../utils/common';
|
|
35
|
+
|
|
36
|
+
import {
|
|
37
|
+
GET_TRANSLATION_MAPPED,
|
|
38
|
+
JAPANESE_HELP_TEXT,
|
|
39
|
+
TAG_TRANSLATION_DOC,
|
|
40
|
+
STRING,
|
|
41
|
+
} from "../../containers/TagList/constants";
|
|
35
42
|
import { EMAIL, JP_LOCALE_HIDE_FEATURE, LOYALTY } from '../../v2Containers/App/constants';
|
|
36
43
|
import { hidingDateTagsForJpLocale } from '../../v2Containers/TagList/utils';
|
|
37
44
|
|
|
@@ -125,10 +132,9 @@ class CapTagList extends React.Component { // eslint-disable-line react/prefer-s
|
|
|
125
132
|
getSearchedExpandedKeys(tags, value = '') {
|
|
126
133
|
let list = [];
|
|
127
134
|
_.forEach(tags, (val = {}, key) => {
|
|
128
|
-
const tagName =
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
: _.toLower(_.get(val, "name.props.defaultMessage", ""));
|
|
135
|
+
const tagName = typeof val?.name === STRING
|
|
136
|
+
? _.toLower(_.get(val, "name", ""))
|
|
137
|
+
: _.toLower(_.get(val, "name.props.defaultMessage", ""));
|
|
132
138
|
const tagNameWithoutUnderscore = tagName.replace(/_/g, " ");
|
|
133
139
|
const searchStringLower = _.toLower(value);
|
|
134
140
|
if (_.has(val, "subtags")) {
|
|
@@ -261,10 +267,9 @@ class CapTagList extends React.Component { // eslint-disable-line react/prefer-s
|
|
|
261
267
|
supportedTagsString += `${supportedTag} ,`;
|
|
262
268
|
});
|
|
263
269
|
supportedTagsString = supportedTagsString.replace(/,\s*$/, "");
|
|
264
|
-
const tagName =
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
: _.toLower(_.get(val, "name.props.defaultMessage", ""));
|
|
270
|
+
const tagName = typeof val?.name === STRING
|
|
271
|
+
? _.toLower(_.get(val, "name", ""))
|
|
272
|
+
: _.toLower(_.get(val, "name.props.defaultMessage", ""));
|
|
268
273
|
const tagNameWithoutUnderscore = tagName.replace(/_/g, " ");
|
|
269
274
|
const searchStringLower = _.toLower(searchString);
|
|
270
275
|
const tagContainsSearchedString = searchStringLower
|
|
@@ -19,8 +19,8 @@ import messages from '../EmailPreviewV2/messages';
|
|
|
19
19
|
import './index.scss';
|
|
20
20
|
import mobileBody from '../../assets/DeviceForEmail.png';
|
|
21
21
|
import { iframePreviewAdjustWidth, removeLinksFromHtmlContent } from './../../utils/common';
|
|
22
|
-
import {selectTemplateContent} from '../../
|
|
23
|
-
import * as templateActions from '../../
|
|
22
|
+
import {selectTemplateContent} from '../../containers/Templates/selectors';
|
|
23
|
+
import * as templateActions from '../../containers/Templates/actions';
|
|
24
24
|
|
|
25
25
|
const deviceAspectRatio = {
|
|
26
26
|
mobile: {
|
|
@@ -54,9 +54,9 @@ import { SMS, MOBILE_PUSH, LINE, ENABLE_AI_SUGGESTIONS,AI_CONTENT_BOT_DISABLED,
|
|
|
54
54
|
import globalMessages from '../../v2Containers/Cap/messages';
|
|
55
55
|
import { convert } from 'html-to-text';
|
|
56
56
|
import { OUTBOUND } from './constants';
|
|
57
|
-
import { GET_TRANSLATION_MAPPED } from '../../constants
|
|
57
|
+
import { GET_TRANSLATION_MAPPED } from '../../containers/TagList/constants';
|
|
58
58
|
import moment from 'moment';
|
|
59
|
-
import { CUSTOMER_BARCODE_TAG , COPY_OF, ENTRY_TRIGGER_TAG_REGEX} from '../../constants
|
|
59
|
+
import { CUSTOMER_BARCODE_TAG , COPY_OF, ENTRY_TRIGGER_TAG_REGEX} from '../../containers/App/constants';
|
|
60
60
|
import { REQUEST } from '../../v2Containers/Cap/constants'
|
|
61
61
|
import { hasLiquidSupportFeature, isEmailUnsubscribeTagMandatory } from '../../utils/common';
|
|
62
62
|
import { isUrl } from '../../v2Containers/Line/Container/Wrapper/utils';
|
|
@@ -45,6 +45,14 @@ class MobilePushPreviewV2 extends React.Component { // eslint-disable-line react
|
|
|
45
45
|
if (channel === INAPP.toUpperCase()) {
|
|
46
46
|
const androidContent = get(templateData, 'versions.base.content.ANDROID') || get(templateData, 'androidContent');
|
|
47
47
|
const iosContent = get(templateData, 'versions.base.content.IOS') || get(templateData, 'iosContent');
|
|
48
|
+
const isBeeFreeTemplate = get(androidContent, 'isBEEeditor') || get(iosContent, 'isBEEeditor');
|
|
49
|
+
if (isBeeFreeTemplate) {
|
|
50
|
+
content = {
|
|
51
|
+
inAppPreviewContent: device === ANDROID.toLowerCase() ? androidContent?.beeHtml : iosContent?.beeHtml,
|
|
52
|
+
isBeeFreeTemplate: true,
|
|
53
|
+
};
|
|
54
|
+
return content;
|
|
55
|
+
}
|
|
48
56
|
const androidPreviewContent = {
|
|
49
57
|
templateTitle: androidContent?.title,
|
|
50
58
|
templateMsg: androidContent?.message,
|
|
@@ -11,8 +11,8 @@ describe("analyticsBotSagaFn", () => {
|
|
|
11
11
|
);
|
|
12
12
|
return expectSaga(analyticsBotSagaFn)
|
|
13
13
|
.provide([
|
|
14
|
-
[matchers.call.fn(analyticsBotSaga[0]), undefined],
|
|
15
|
-
[matchers.call.fn(analyticsBotSaga[1]), undefined]
|
|
14
|
+
[matchers.call.fn(analyticsBotSaga?.[0]), undefined],
|
|
15
|
+
[matchers.call.fn(analyticsBotSaga?.[1]), undefined]
|
|
16
16
|
])
|
|
17
17
|
.run();
|
|
18
18
|
});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<svg width="220" height="472" viewBox="0 0 220 472" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<rect width="220" height="472" rx="26" fill="#101211"/>
|
|
3
|
+
<rect x="9" y="36" width="202" height="404" rx="9" fill="#343434"/>
|
|
4
|
+
<rect x="84" y="14" width="52" height="5" rx="2.5" fill="#2E2E2E"/>
|
|
5
|
+
<rect x="84" y="455" width="52" height="5" rx="2.5" fill="#2E2E2E"/>
|
|
6
|
+
<circle cx="45.5" cy="19.5" r="5.5" fill="#2E2E2E"/>
|
|
7
|
+
<circle cx="65.5" cy="19.5" r="3.5" fill="#2E2E2E"/>
|
|
8
|
+
</svg>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
<svg width="228" height="472" viewBox="0 0 228 472" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<rect width="228" height="472" rx="32" fill="#101211"/>
|
|
3
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M58 11H33C20.2975 11 10 21.2975 10 34V439C10 451.703 20.2975 462 33 462H195C207.703 462 218 451.703 218 439V34C218 21.2975 207.703 11 195 11H170V14C170 21.1797 164.18 27 157 27H71C63.8203 27 58 21.1797 58 14V11Z" fill="#343434"/>
|
|
4
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M58 11H33C20.2975 11 10 21.2975 10 34V439C10 451.703 20.2975 462 33 462H195C207.703 462 218 451.703 218 439V34C218 21.2975 207.703 11 195 11H170V14C170 21.1797 164.18 27 157 27H71C63.8203 27 58 21.1797 58 14V11Z" fill="#343434"/>
|
|
5
|
+
</svg>
|
|
@@ -32,11 +32,10 @@ import {
|
|
|
32
32
|
RCS,
|
|
33
33
|
ZALO,
|
|
34
34
|
INAPP,
|
|
35
|
-
VIBER,
|
|
36
|
-
FACEBOOK,
|
|
37
35
|
MOBILE_PUSH
|
|
38
36
|
} from '../../v2Containers/CreativesContainer/constants';
|
|
39
37
|
import Carousel from '../Carousel';
|
|
38
|
+
import { VIBER, FACEBOOK } from '../../v2Containers/App/constants';
|
|
40
39
|
import whatsappMobileAndroid from './assets/images/whatsapp_mobile_android.svg';
|
|
41
40
|
import inAppMobileAndroidModal from './assets/images/inapp_mobile_android_modal.svg';
|
|
42
41
|
import inAppMobileAndroidTop from './assets/images/inapp_mobile_android_top.svg';
|
|
@@ -237,7 +236,7 @@ export class TemplatePreview extends React.Component { // eslint-disable-line re
|
|
|
237
236
|
} = this.props;
|
|
238
237
|
let content = channel && channel.toLowerCase() === 'sms' ? [this.props.content] : this.props.content;
|
|
239
238
|
const { formatMessage } = intl;
|
|
240
|
-
const { rcsPreviewContent, inAppPreviewContent, viberPreviewContent } = content || {};
|
|
239
|
+
const { rcsPreviewContent, inAppPreviewContent, viberPreviewContent, isBeeFreeTemplate } = content || {};
|
|
241
240
|
const { rcsImageSrc, rcsTitle, rcsDesc, buttonText: rcsButtonText } = rcsPreviewContent || {};
|
|
242
241
|
const {
|
|
243
242
|
videoParams,
|
|
@@ -1327,6 +1326,31 @@ export class TemplatePreview extends React.Component { // eslint-disable-line re
|
|
|
1327
1326
|
</div>
|
|
1328
1327
|
)}
|
|
1329
1328
|
{channel?.toUpperCase() === INAPP && (
|
|
1329
|
+
isBeeFreeTemplate ? (
|
|
1330
|
+
<div className="shell-v2 align-center">
|
|
1331
|
+
<div style={{ position: 'relative', display: 'inline-block', width: '100%', height: '100%' }}>
|
|
1332
|
+
<CapImage
|
|
1333
|
+
className="preview-image"
|
|
1334
|
+
src={this.props.device === ANDROID ? inAppMobileAndroidFull : inAppMobileIOSFull}
|
|
1335
|
+
alt={formatMessage(messages.previewGenerated)}
|
|
1336
|
+
/>
|
|
1337
|
+
<iframe
|
|
1338
|
+
srcDoc={inAppPreviewContent?.value}
|
|
1339
|
+
title="Inapp Preview"
|
|
1340
|
+
style={{
|
|
1341
|
+
position: 'absolute',
|
|
1342
|
+
top: '3rem',
|
|
1343
|
+
left: '5rem',
|
|
1344
|
+
width: '60%',
|
|
1345
|
+
height: '100%',
|
|
1346
|
+
zIndex: 1,
|
|
1347
|
+
pointerEvents: 'none'
|
|
1348
|
+
}}
|
|
1349
|
+
frameBorder="0"
|
|
1350
|
+
/>
|
|
1351
|
+
</div>
|
|
1352
|
+
</div>
|
|
1353
|
+
) : (
|
|
1330
1354
|
<div className="shell-v2 align-center">
|
|
1331
1355
|
<CapImage
|
|
1332
1356
|
className="preview-image"
|
|
@@ -1403,8 +1427,9 @@ export class TemplatePreview extends React.Component { // eslint-disable-line re
|
|
|
1403
1427
|
)}
|
|
1404
1428
|
</div>
|
|
1405
1429
|
</div>
|
|
1430
|
+
</div>
|
|
1406
1431
|
</div>
|
|
1407
|
-
|
|
1432
|
+
)
|
|
1408
1433
|
)}
|
|
1409
1434
|
</CapRow>
|
|
1410
1435
|
</CapColumn>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export const BEE_LAYOUT_OPTIONS = {
|
|
2
|
+
POPUP: "classic-center",
|
|
3
|
+
HEADER: "bar-top",
|
|
4
|
+
FOOTER: "bar-bottom",
|
|
5
|
+
FULLSCREEN: "classic-center",
|
|
6
|
+
};
|
|
7
|
+
export const MOBILE = "mobile";
|
|
8
|
+
export const UNSUBSCRIBE = 'unsubscribe';
|
|
9
|
+
export const ANDROID = 'ANDROID';
|
|
10
|
+
export const IOS = 'IOS';
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import React, { useEffect, useRef, useState } from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { injectIntl } from 'react-intl';
|
|
4
|
+
import { connect } from 'react-redux';
|
|
5
|
+
// import { bindActionCreators } from 'redux';
|
|
6
|
+
import { createStructuredSelector } from 'reselect';
|
|
7
|
+
import { UserIsAuthenticated } from '../../utils/authWrapper';
|
|
8
|
+
import TagList from '../TagList';
|
|
9
|
+
import { ANDROID, BEE_LAYOUT_OPTIONS, MOBILE, UNSUBSCRIBE } from './constants';
|
|
10
|
+
import emptyAndroidSvg from '../../v2Components/TemplatePreview/assets/images/empty_android.svg';
|
|
11
|
+
import emptyIosSvg from '../../v2Components/TemplatePreview/assets/images/empty_ios.svg';
|
|
12
|
+
function BeePopupEditor(props) {
|
|
13
|
+
const {
|
|
14
|
+
uid,
|
|
15
|
+
id,
|
|
16
|
+
tokenData,
|
|
17
|
+
saveBeeInstance,
|
|
18
|
+
saveBeeData,
|
|
19
|
+
beeJson,
|
|
20
|
+
templateLayoutType,
|
|
21
|
+
moduleFilterEnabled,
|
|
22
|
+
label,
|
|
23
|
+
location,
|
|
24
|
+
injectedTags,
|
|
25
|
+
className,
|
|
26
|
+
userLocale,
|
|
27
|
+
selectedOfferDetails,
|
|
28
|
+
tags,
|
|
29
|
+
onContextChange,
|
|
30
|
+
device,
|
|
31
|
+
} = props;
|
|
32
|
+
|
|
33
|
+
let beePluginInstance = null;
|
|
34
|
+
let intervalTimer;
|
|
35
|
+
const savedCallback = useRef();
|
|
36
|
+
|
|
37
|
+
const [visibleTaglist, setVisibleTaglist] = useState(false);
|
|
38
|
+
const [selectedTag, setSelectedTag] = useState({});
|
|
39
|
+
const filteredTags = (tags || []).filter((obj) => obj.definition.value !== UNSUBSCRIBE);
|
|
40
|
+
|
|
41
|
+
useEffect(() => {
|
|
42
|
+
const beeConfig = {
|
|
43
|
+
uid,
|
|
44
|
+
trackChanges: true,
|
|
45
|
+
container: 'bee-plugin-container',
|
|
46
|
+
workspace: {
|
|
47
|
+
popup: {
|
|
48
|
+
backgroundImageMobile: device === ANDROID ? emptyAndroidSvg : emptyIosSvg,
|
|
49
|
+
layout: BEE_LAYOUT_OPTIONS[templateLayoutType],
|
|
50
|
+
customStyles: {
|
|
51
|
+
container: {
|
|
52
|
+
width: "90%",
|
|
53
|
+
margin: "1.5rem",
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
stage: MOBILE,
|
|
58
|
+
hideStageToggle: true,
|
|
59
|
+
},
|
|
60
|
+
contentDialog: {
|
|
61
|
+
mergeTags: {
|
|
62
|
+
label: 'Add Label',
|
|
63
|
+
handler: async (resolve, reject) => {
|
|
64
|
+
// this will open tag modal
|
|
65
|
+
await setVisibleTaglist(true);
|
|
66
|
+
// until tag modal will not open promise will not execute
|
|
67
|
+
// once tag modal is opened it will start 2 sec interval to wait use has selected any tag or cancel the tag selection
|
|
68
|
+
const promise = new Promise((resolveP) => {
|
|
69
|
+
intervalTimer = setInterval(() => {
|
|
70
|
+
// this will execute, if user cancel the tag selection
|
|
71
|
+
if ((savedCallback.current || {}).close === true) {
|
|
72
|
+
reject();
|
|
73
|
+
clearInterval(intervalTimer);
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
// this block is checking use has selected any tag or not
|
|
77
|
+
if (Object.keys(savedCallback.current || {}).length > 0) {
|
|
78
|
+
resolveP(savedCallback.current);
|
|
79
|
+
setSelectedTag({});
|
|
80
|
+
clearInterval(intervalTimer);
|
|
81
|
+
}
|
|
82
|
+
}, 2000);
|
|
83
|
+
});
|
|
84
|
+
// once prmise will resolve , pass the resolve data to handler to show tags in bee edior
|
|
85
|
+
const result = await promise;
|
|
86
|
+
resolve(result);
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
onChange: (jsonFile, htmlFile) => {
|
|
91
|
+
saveBeeData(jsonFile, htmlFile, device);
|
|
92
|
+
},
|
|
93
|
+
};
|
|
94
|
+
window.BeePlugin.create(tokenData, beeConfig, (instance) => {
|
|
95
|
+
beePluginInstance = instance;
|
|
96
|
+
const parseJson = JSON.parse(beeJson);
|
|
97
|
+
beePluginInstance.start(parseJson);
|
|
98
|
+
saveBeeInstance(beePluginInstance);
|
|
99
|
+
});
|
|
100
|
+
return () => clearInterval(intervalTimer);
|
|
101
|
+
}, [templateLayoutType]);
|
|
102
|
+
|
|
103
|
+
useEffect(() => {
|
|
104
|
+
savedCallback.current = Object.keys(selectedTag).length > 0 && selectedTag;
|
|
105
|
+
}, [selectedTag]);
|
|
106
|
+
|
|
107
|
+
const onTagSelect = (result) => {
|
|
108
|
+
const msg = {
|
|
109
|
+
name: result,
|
|
110
|
+
value: `{{${result}}}`,
|
|
111
|
+
};
|
|
112
|
+
setSelectedTag(msg);
|
|
113
|
+
setVisibleTaglist(false);
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
const onCancelTagList = () => {
|
|
117
|
+
setVisibleTaglist(false);
|
|
118
|
+
setSelectedTag({close: true});
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
return (
|
|
122
|
+
<>
|
|
123
|
+
<div id="bee-plugin-container" style={{ height: "650px" }}></div>
|
|
124
|
+
<TagList
|
|
125
|
+
moduleFilterEnabled={moduleFilterEnabled}
|
|
126
|
+
label={label}
|
|
127
|
+
onTagSelect={onTagSelect}
|
|
128
|
+
location={location}
|
|
129
|
+
tags={filteredTags}
|
|
130
|
+
injectedTags={injectedTags}
|
|
131
|
+
className={className}
|
|
132
|
+
id={id}
|
|
133
|
+
userLocale={userLocale}
|
|
134
|
+
selectedOfferDetails={selectedOfferDetails}
|
|
135
|
+
visibleTaglist={visibleTaglist}
|
|
136
|
+
hidePopover
|
|
137
|
+
modalProps={{
|
|
138
|
+
onCancel: onCancelTagList,
|
|
139
|
+
style: { left: 135, top: 250 },
|
|
140
|
+
className: "bee-editor-tag-list",
|
|
141
|
+
}}
|
|
142
|
+
onContextChange={onContextChange}
|
|
143
|
+
/>
|
|
144
|
+
</>
|
|
145
|
+
);
|
|
146
|
+
}
|
|
147
|
+
BeePopupEditor.propTypes = {
|
|
148
|
+
saveBeeData: PropTypes.func.isRequired,
|
|
149
|
+
saveBeeInstance: PropTypes.func.isRequired,
|
|
150
|
+
beeJson: PropTypes.object.isRequired,
|
|
151
|
+
tokenData: PropTypes.object.isRequired,
|
|
152
|
+
uid: PropTypes.string.isRequired,
|
|
153
|
+
templateLayoutType: PropTypes.string.isRequired,
|
|
154
|
+
id: PropTypes.string.isRequired,
|
|
155
|
+
moduleFilterEnabled: PropTypes.bool.isRequired,
|
|
156
|
+
label: PropTypes.string.isRequired,
|
|
157
|
+
location: PropTypes.object.isRequired,
|
|
158
|
+
injectedTags: PropTypes.array.isRequired,
|
|
159
|
+
className: PropTypes.string.isRequired,
|
|
160
|
+
userLocale: PropTypes.string.isRequired,
|
|
161
|
+
selectedOfferDetails: PropTypes.object.isRequired,
|
|
162
|
+
tags: PropTypes.array.isRequired,
|
|
163
|
+
onContextChange: PropTypes.func.isRequired,
|
|
164
|
+
device: PropTypes.string.isRequired,
|
|
165
|
+
};
|
|
166
|
+
const mapStateToProps = () => createStructuredSelector({});
|
|
167
|
+
|
|
168
|
+
function mapDispatchToProps() {}
|
|
169
|
+
export default UserIsAuthenticated(connect(mapStateToProps, mapDispatchToProps)(injectIntl(BeePopupEditor)));
|