@capillarytech/creatives-library 8.0.163 → 8.0.164
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/constants/unified.js +189 -0
- package/index.js +4 -2
- package/package.json +1 -1
- package/routes.js +136 -202
- package/services/getSchema.js +1 -1
- package/services/localStorageApi.js +1 -0
- package/tests/i18n.test.js +1 -1
- package/utils/authWrapper.js +1 -1
- package/utils/common.js +2 -2
- 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 +9 -14
- package/v2Components/Carousel/style.scss +1 -1
- package/v2Components/EmailMobilePreview/index.js +2 -2
- package/v2Components/FormBuilder/index.js +2 -2
- package/v2Components/TemplatePreview/index.js +2 -1
- package/v2Components/TestAndPreviewSlidebox/index.js +109 -178
- package/v2Containers/Cap/tests/saga.test.js +1 -1
- package/v2Containers/CreativesContainer/index.js +2 -0
- package/v2Containers/Email/index.js +1 -1
- package/v2Containers/FTP/index.js +1 -1
- package/v2Containers/Line/Container/Text/index.js +1 -1
- package/v2Containers/Sms/Create/index.js +1 -1
- package/v2Containers/Sms/Edit/index.js +1 -1
- 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/constants.js +1 -1
- package/v2Containers/Whatsapp/tests/index.test.js +1 -1
- package/components/BreadCrumbs/index.js +0 -65
- package/components/BreadCrumbs/messages.js +0 -13
- package/components/CapTagList/index.js +0 -235
- package/components/CapTagList/messages.js +0 -45
- package/components/Card/_customCard.scss +0 -40
- package/components/Card/index.js +0 -78
- package/components/Card/tests/__snapshots__/index.test.js.snap +0 -22
- package/components/Card/tests/index.test.js +0 -20
- package/components/CardGrid/index.js +0 -71
- package/components/Ckeditor/index.js +0 -238
- package/components/Ckeditor/messages.js +0 -13
- package/components/Ckeditor/style.scss +0 -3
- package/components/Component/index.js +0 -29
- package/components/CustomPopOver/index.js +0 -81
- package/components/CustomPopOver/messages.js +0 -17
- package/components/DateFilter/index.js +0 -349
- package/components/DateFilter/messages.js +0 -57
- package/components/DateRange/index.js +0 -114
- package/components/DateRange/messages.js +0 -25
- package/components/Edmeditor/index.js +0 -65
- package/components/Edmeditor/messages.js +0 -13
- package/components/EmailPreview/_emailPreview.scss +0 -119
- package/components/EmailPreview/assets/images/iPad.svg +0 -10
- package/components/EmailPreview/assets/images/mobile.png +0 -0
- package/components/EmailPreview/index.js +0 -107
- package/components/EmailPreview/messages.js +0 -33
- package/components/Footer/index.js +0 -27
- package/components/Footer/messages.js +0 -13
- package/components/FormBuilder/_formBuilder.scss +0 -83
- package/components/FormBuilder/index.js +0 -3279
- package/components/FormBuilder/messages.js +0 -61
- package/components/Header/index.js +0 -44
- package/components/Header/messages.js +0 -29
- package/components/ImagePreview/_imagePreview.scss +0 -63
- package/components/ImagePreview/index.js +0 -52
- package/components/ImagePreview/messages.js +0 -17
- package/components/PageHeader/_pageHeader.scss +0 -22
- package/components/PageHeader/index.js +0 -37
- package/components/PageHeader/messages.js +0 -13
- package/components/Pagination/_pagination.scss +0 -5
- package/components/Pagination/index.js +0 -49
- package/components/PreviewSideBar/_previewsidebar.scss +0 -28
- package/components/PreviewSideBar/index.js +0 -152
- package/components/PreviewSideBar/messages.js +0 -41
- package/components/Sidebar/_sidebar.scss +0 -115
- package/components/Sidebar/index.js +0 -214
- package/components/Sidebar/messages.js +0 -21
- package/components/SlideBox/_slideBox.scss +0 -63
- package/components/SlideBox/index.js +0 -47
- package/components/SlideBox/tests/index.test.js +0 -103
- package/components/SmsEditor/index.js +0 -55
- package/components/SmsTest/index.js +0 -117
- package/components/SmsTest/messages.js +0 -21
- package/components/TemplatePreview/WechatRichmediaTemplatePreview/_wechatRichmediaTemplatePrev.scss +0 -42
- package/components/TemplatePreview/WechatRichmediaTemplatePreview/index.js +0 -141
- package/components/TemplatePreview/WechatRichmediaTemplatePreview/messages.js +0 -21
- package/components/TemplatePreview/_templatePreview.scss +0 -642
- package/components/TemplatePreview/assets/images/WECHAT_5x.png +0 -0
- package/components/TemplatePreview/assets/images/androidPushMessage.svg +0 -45
- package/components/TemplatePreview/assets/images/home-screen-android.svg +0 -21
- package/components/TemplatePreview/assets/images/home-screen-ios.svg +0 -16
- package/components/TemplatePreview/assets/images/iPhonePushMessage.svg +0 -135
- package/components/TemplatePreview/assets/images/mobile.svg +0 -24
- 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 +0 -22
- package/components/TemplatePreview/assets/images/sms_mobile_ios.svg +0 -16
- package/components/TemplatePreview/assets/images/user-icon.svg +0 -19
- package/components/TemplatePreview/assets/images/wechat-mobile.svg +0 -78
- package/components/TemplatePreview/assets/images/wechat_mobile_android.svg +0 -20
- package/components/TemplatePreview/index.js +0 -617
- package/components/TemplatePreview/messages.js +0 -78
- package/components/Toastr/index.js +0 -60
- package/components/Toastr/messages.js +0 -13
- package/components/ToastrMessage/index.js +0 -113
- package/components/ToastrMessage/messages.js +0 -17
- package/components/TopBar/_topbar.scss +0 -46
- 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 +0 -113
- package/components/TopBar/messages.js +0 -29
- package/containers/App/actions.js +0 -7
- package/containers/App/constants.js +0 -114
- package/containers/App/index.js +0 -52
- package/containers/App/reducer.js +0 -19
- package/containers/App/sagas.js +0 -31
- package/containers/App/selectors.js +0 -25
- package/containers/App/test/saga.test.js +0 -11
- package/containers/Assets/Gallery/_gallery.scss +0 -126
- package/containers/Assets/Gallery/actions.js +0 -37
- package/containers/Assets/Gallery/constants.js +0 -23
- package/containers/Assets/Gallery/index.js +0 -473
- package/containers/Assets/Gallery/messages.js +0 -93
- package/containers/Assets/Gallery/reducer.js +0 -81
- package/containers/Assets/Gallery/sagas.js +0 -80
- package/containers/Assets/Gallery/selectors.js +0 -25
- package/containers/Assets/Gallery/tests/__snapshots__/reducer.test.js.snap +0 -9
- package/containers/Assets/Gallery/tests/actions.test.js +0 -25
- package/containers/Assets/Gallery/tests/reducer.test.js +0 -96
- package/containers/Assets/Gallery/tests/saga.test.js +0 -157
- package/containers/Cap/actions.js +0 -66
- package/containers/Cap/constants.js +0 -25
- package/containers/Cap/index.js +0 -402
- package/containers/Cap/messages.js +0 -75
- package/containers/Cap/reducer.js +0 -113
- package/containers/Cap/sagas.js +0 -159
- package/containers/Cap/selectors.js +0 -75
- package/containers/Cap/tests/__snapshots__/index.test.js.snap +0 -2270
- package/containers/Cap/tests/index.test.js +0 -22
- package/containers/Cap/tests/saga.test.js +0 -284
- package/containers/Dashboard/actions.js +0 -15
- package/containers/Dashboard/constants.js +0 -7
- package/containers/Dashboard/index.js +0 -76
- package/containers/Dashboard/messages.js +0 -13
- package/containers/Dashboard/reducer.js +0 -21
- package/containers/Dashboard/sagas.js +0 -17
- package/containers/Dashboard/selectors.js +0 -25
- package/containers/Dashboard/test/saga.test.js +0 -9
- package/containers/Ebill/_ebill.scss +0 -5
- package/containers/Ebill/actions.js +0 -43
- package/containers/Ebill/constants.js +0 -20
- package/containers/Ebill/index.js +0 -1278
- package/containers/Ebill/messages.js +0 -77
- package/containers/Ebill/reducer.js +0 -72
- package/containers/Ebill/sagas.js +0 -74
- package/containers/Ebill/selectors.js +0 -25
- package/containers/Ebill/test/saga.test.js +0 -11
- package/containers/Email/_email.scss +0 -141
- package/containers/Email/actions.js +0 -81
- package/containers/Email/constants.js +0 -36
- package/containers/Email/index.js +0 -3325
- package/containers/Email/messages.js +0 -289
- package/containers/Email/reducer.js +0 -142
- package/containers/Email/sagas.js +0 -135
- package/containers/Email/selectors.js +0 -31
- package/containers/Email/test/saga.test.js +0 -671
- package/containers/LanguageProvider/actions.js +0 -17
- package/containers/LanguageProvider/constants.js +0 -8
- package/containers/LanguageProvider/index.js +0 -80
- package/containers/LanguageProvider/reducer.js +0 -30
- package/containers/LanguageProvider/selectors.js +0 -20
- package/containers/LanguageProvider/tests/actions.test.js +0 -19
- package/containers/LanguageProvider/tests/index.test.js +0 -78
- package/containers/LanguageProvider/tests/reducer.test.js +0 -20
- package/containers/LanguageProvider/tests/selectors.test.js +0 -15
- package/containers/Line/Create/_lineCreate.scss +0 -54
- package/containers/Line/Create/actions.js +0 -90
- package/containers/Line/Create/constants.js +0 -39
- package/containers/Line/Create/index.js +0 -836
- package/containers/Line/Create/messages.js +0 -189
- package/containers/Line/Create/reducer.js +0 -99
- package/containers/Line/Create/sagas.js +0 -121
- package/containers/Line/Create/selectors.js +0 -36
- package/containers/Line/Create/tests/saga.test.js +0 -202
- package/containers/Line/Edit/_lineEdit.scss +0 -35
- package/containers/Line/Edit/actions.js +0 -79
- package/containers/Line/Edit/constants.js +0 -27
- package/containers/Line/Edit/index.js +0 -1050
- package/containers/Line/Edit/messages.js +0 -177
- package/containers/Line/Edit/reducer.js +0 -83
- package/containers/Line/Edit/sagas.js +0 -80
- package/containers/Line/Edit/selectors.js +0 -29
- package/containers/Line/Edit/test/saga.test.js +0 -160
- package/containers/Login/assets/images/capillary_logo.png +0 -0
- package/containers/Login/components/LoginForm/index.js +0 -62
- package/containers/Login/components/LoginForm/messages.js +0 -33
- package/containers/Login/index.js +0 -130
- package/containers/Login/messages.js +0 -25
- package/containers/Login/selectors.js +0 -25
- package/containers/MobilePush/Create/_mobilePushCreate.scss +0 -39
- package/containers/MobilePush/Create/actions.js +0 -46
- package/containers/MobilePush/Create/constants.js +0 -23
- package/containers/MobilePush/Create/index.js +0 -2303
- package/containers/MobilePush/Create/messages.js +0 -269
- package/containers/MobilePush/Create/reducer.js +0 -70
- package/containers/MobilePush/Create/sagas.js +0 -74
- package/containers/MobilePush/Create/selectors.js +0 -28
- package/containers/MobilePush/Create/test/saga.test.js +0 -19
- package/containers/MobilePush/Edit/_mobilePushCreate.scss +0 -39
- package/containers/MobilePush/Edit/actions.js +0 -91
- package/containers/MobilePush/Edit/constants.js +0 -35
- package/containers/MobilePush/Edit/index.js +0 -2601
- package/containers/MobilePush/Edit/messages.js +0 -266
- package/containers/MobilePush/Edit/reducer.js +0 -112
- package/containers/MobilePush/Edit/sagas.js +0 -126
- package/containers/MobilePush/Edit/selectors.js +0 -29
- package/containers/MobilePush/Edit/tests/saga.test.js +0 -255
- package/containers/NotFoundPage/index.js +0 -25
- package/containers/NotFoundPage/messages.js +0 -13
- package/containers/NotFoundPage/tests/index.test.js +0 -17
- package/containers/Sms/Create/_smsCreate.scss +0 -42
- package/containers/Sms/Create/actions.js +0 -27
- package/containers/Sms/Create/constants.js +0 -16
- package/containers/Sms/Create/index.js +0 -1488
- package/containers/Sms/Create/messages.js +0 -109
- package/containers/Sms/Create/reducer.js +0 -41
- package/containers/Sms/Create/sagas.js +0 -40
- package/containers/Sms/Create/selectors.js +0 -28
- package/containers/Sms/Create/test/saga.test.js +0 -11
- package/containers/Sms/Edit/actions.js +0 -40
- package/containers/Sms/Edit/constants.js +0 -17
- package/containers/Sms/Edit/index.js +0 -1472
- package/containers/Sms/Edit/messages.js +0 -105
- package/containers/Sms/Edit/reducer.js +0 -50
- package/containers/Sms/Edit/sagas.js +0 -60
- package/containers/Sms/Edit/selectors.js +0 -32
- package/containers/Sms/Edit/test/saga.test.js +0 -13
- package/containers/TagList/_tagList.scss +0 -8
- package/containers/TagList/actions.js +0 -15
- package/containers/TagList/constants.js +0 -32
- package/containers/TagList/index.js +0 -236
- package/containers/TagList/messages.js +0 -13
- package/containers/TagList/reducer.js +0 -23
- package/containers/TagList/sagas.js +0 -11
- package/containers/TagList/selectors.js +0 -25
- package/containers/Templates/_templates.scss +0 -333
- package/containers/Templates/actions.js +0 -103
- package/containers/Templates/constants.js +0 -60
- package/containers/Templates/index.js +0 -1756
- package/containers/Templates/messages.js +0 -337
- package/containers/Templates/reducer.js +0 -142
- package/containers/Templates/sagas.js +0 -163
- package/containers/Templates/selectors.js +0 -28
- package/containers/Templates/test/saga.test.js +0 -241
- package/containers/WeChat/MapTemplates/_mapTemplates.scss +0 -8
- package/containers/WeChat/MapTemplates/actions.js +0 -52
- package/containers/WeChat/MapTemplates/constants.js +0 -28
- package/containers/WeChat/MapTemplates/index.js +0 -1610
- package/containers/WeChat/MapTemplates/messages.js +0 -157
- package/containers/WeChat/MapTemplates/reducer.js +0 -74
- package/containers/WeChat/MapTemplates/sagas.js +0 -84
- package/containers/WeChat/MapTemplates/selectors.js +0 -25
- package/containers/WeChat/MapTemplates/test/saga.test.js +0 -155
- package/containers/WeChat/RichmediaTemplates/Create/_createRichmedia.scss +0 -57
- package/containers/WeChat/RichmediaTemplates/Create/actions.js +0 -36
- package/containers/WeChat/RichmediaTemplates/Create/constants.js +0 -15
- package/containers/WeChat/RichmediaTemplates/Create/index.js +0 -1071
- package/containers/WeChat/RichmediaTemplates/Create/messages.js +0 -165
- package/containers/WeChat/RichmediaTemplates/Create/reducer.js +0 -60
- package/containers/WeChat/RichmediaTemplates/Create/richmediaschema.js +0 -497
- package/containers/WeChat/RichmediaTemplates/Create/sagas.js +0 -51
- package/containers/WeChat/RichmediaTemplates/Create/selectors.js +0 -37
- package/containers/WeChat/RichmediaTemplates/Create/test/saga.test.js +0 -13
- package/containers/WeChat/RichmediaTemplates/Edit/actions.js +0 -20
- package/containers/WeChat/RichmediaTemplates/Edit/constants.js +0 -10
- package/containers/WeChat/RichmediaTemplates/Edit/index.js +0 -136
- package/containers/WeChat/RichmediaTemplates/Edit/messages.js +0 -13
- package/containers/WeChat/RichmediaTemplates/Edit/reducer.js +0 -28
- package/containers/WeChat/RichmediaTemplates/Edit/sagas.js +0 -36
- package/containers/WeChat/RichmediaTemplates/Edit/selectors.js +0 -30
- package/containers/WeChat/RichmediaTemplates/Edit/test/saga.test.js +0 -12
- package/containers/WeChat/RichmediaTemplates/View/actions.js +0 -15
- package/containers/WeChat/RichmediaTemplates/View/constants.js +0 -7
- package/containers/WeChat/RichmediaTemplates/View/index.js +0 -47
- package/containers/WeChat/RichmediaTemplates/View/messages.js +0 -21
- package/containers/WeChat/RichmediaTemplates/View/reducer.js +0 -23
- package/containers/WeChat/RichmediaTemplates/View/sagas.js +0 -11
- package/containers/WeChat/RichmediaTemplates/View/selectors.js +0 -25
- package/utils/asyncInjectors.js +0 -78
- package/utils/callNativeEvent.js +0 -16
- package/utils/checkStore.js +0 -21
- package/utils/customAuthWrapper.js +0 -62
- package/utils/customConnectedAuthWrapper.js +0 -26
|
@@ -30,15 +30,8 @@ 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 } from '../../
|
|
33
|
+
import { CARD_RELATED_TAGS, HOSPITALITY_RELATED_TAGS, CUSTOMER_BARCODE_TAG, GET_TRANSLATION_MAPPED ,JAPANESE_HELP_TEXT, TAG_TRANSLATION_DOC} from '../../constants/unified';
|
|
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";
|
|
42
35
|
import { EMAIL, JP_LOCALE_HIDE_FEATURE, LOYALTY } from '../../v2Containers/App/constants';
|
|
43
36
|
import { hidingDateTagsForJpLocale } from '../../v2Containers/TagList/utils';
|
|
44
37
|
|
|
@@ -132,9 +125,10 @@ class CapTagList extends React.Component { // eslint-disable-line react/prefer-s
|
|
|
132
125
|
getSearchedExpandedKeys(tags, value = '') {
|
|
133
126
|
let list = [];
|
|
134
127
|
_.forEach(tags, (val = {}, key) => {
|
|
135
|
-
const tagName =
|
|
136
|
-
|
|
137
|
-
|
|
128
|
+
const tagName =
|
|
129
|
+
typeof val?.name === 'string'
|
|
130
|
+
? _.toLower(_.get(val, "name", ""))
|
|
131
|
+
: _.toLower(_.get(val, "name.props.defaultMessage", ""));
|
|
138
132
|
const tagNameWithoutUnderscore = tagName.replace(/_/g, " ");
|
|
139
133
|
const searchStringLower = _.toLower(value);
|
|
140
134
|
if (_.has(val, "subtags")) {
|
|
@@ -267,9 +261,10 @@ class CapTagList extends React.Component { // eslint-disable-line react/prefer-s
|
|
|
267
261
|
supportedTagsString += `${supportedTag} ,`;
|
|
268
262
|
});
|
|
269
263
|
supportedTagsString = supportedTagsString.replace(/,\s*$/, "");
|
|
270
|
-
const tagName =
|
|
271
|
-
|
|
272
|
-
|
|
264
|
+
const tagName =
|
|
265
|
+
typeof val?.name === 'string'
|
|
266
|
+
? _.toLower(_.get(val, "name", ""))
|
|
267
|
+
: _.toLower(_.get(val, "name.props.defaultMessage", ""));
|
|
273
268
|
const tagNameWithoutUnderscore = tagName.replace(/_/g, " ");
|
|
274
269
|
const searchStringLower = _.toLower(searchString);
|
|
275
270
|
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 '../../v2Containers/Templates/selectors';
|
|
23
|
+
import * as templateActions from '../../v2Containers/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 '../../
|
|
57
|
+
import { GET_TRANSLATION_MAPPED } from '../../constants/unified';
|
|
58
58
|
import moment from 'moment';
|
|
59
|
-
import { CUSTOMER_BARCODE_TAG , COPY_OF, ENTRY_TRIGGER_TAG_REGEX} from '../../
|
|
59
|
+
import { CUSTOMER_BARCODE_TAG , COPY_OF, ENTRY_TRIGGER_TAG_REGEX} from '../../constants/unified';
|
|
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';
|
|
@@ -32,10 +32,11 @@ import {
|
|
|
32
32
|
RCS,
|
|
33
33
|
ZALO,
|
|
34
34
|
INAPP,
|
|
35
|
+
VIBER,
|
|
36
|
+
FACEBOOK,
|
|
35
37
|
MOBILE_PUSH
|
|
36
38
|
} from '../../v2Containers/CreativesContainer/constants';
|
|
37
39
|
import Carousel from '../Carousel';
|
|
38
|
-
import { VIBER, FACEBOOK } from '../../v2Containers/App/constants';
|
|
39
40
|
import whatsappMobileAndroid from './assets/images/whatsapp_mobile_android.svg';
|
|
40
41
|
import inAppMobileAndroidModal from './assets/images/inapp_mobile_android_modal.svg';
|
|
41
42
|
import inAppMobileAndroidTop from './assets/images/inapp_mobile_android_top.svg';
|
|
@@ -179,7 +179,7 @@ const TestAndPreviewSlidebox = (props) => {
|
|
|
179
179
|
resolvedTitle: formData['template-subject'] || ''
|
|
180
180
|
});
|
|
181
181
|
|
|
182
|
-
//
|
|
182
|
+
// Extract tags with latest content
|
|
183
183
|
const payloadContent = convert(htmlFile, GLOBAL_CONVERT_OPTIONS);
|
|
184
184
|
actions.extractTagsRequested(formData['template-subject'] || '', payloadContent);
|
|
185
185
|
}
|
|
@@ -202,7 +202,7 @@ const TestAndPreviewSlidebox = (props) => {
|
|
|
202
202
|
resolvedTitle: formData['template-subject'] || ''
|
|
203
203
|
});
|
|
204
204
|
|
|
205
|
-
//
|
|
205
|
+
// Extract tags with initial content
|
|
206
206
|
const payloadContent = convert(templateContent, GLOBAL_CONVERT_OPTIONS);
|
|
207
207
|
actions.extractTagsRequested(formData['template-subject'] || '', payloadContent);
|
|
208
208
|
} else {
|
|
@@ -211,7 +211,6 @@ const TestAndPreviewSlidebox = (props) => {
|
|
|
211
211
|
getCurrentContent,
|
|
212
212
|
GLOBAL_CONVERT_OPTIONS
|
|
213
213
|
);
|
|
214
|
-
// Always extract tags when showing
|
|
215
214
|
actions.extractTagsRequested(formData['template-subject'] || '', payloadContent);
|
|
216
215
|
}
|
|
217
216
|
}
|
|
@@ -229,30 +228,31 @@ const TestAndPreviewSlidebox = (props) => {
|
|
|
229
228
|
const templateContent = currentTabData?.[activeTab]?.['template-content'];
|
|
230
229
|
|
|
231
230
|
if (templateContent && templateContent.trim() !== '') {
|
|
232
|
-
// Common function to handle content update
|
|
233
|
-
const handleContentUpdate = (content) => {
|
|
234
|
-
setPreviewDataHtml({
|
|
235
|
-
resolvedBody: content,
|
|
236
|
-
resolvedTitle: formData['template-subject'] || ''
|
|
237
|
-
});
|
|
238
|
-
|
|
239
|
-
// Extract tags from content
|
|
240
|
-
const payloadContent = convert(content, GLOBAL_CONVERT_OPTIONS);
|
|
241
|
-
actions.extractTagsRequested(formData['template-subject'] || '', payloadContent);
|
|
242
|
-
};
|
|
243
|
-
|
|
244
231
|
if (isDragDrop) {
|
|
245
|
-
// For Bee editor, update preview
|
|
232
|
+
// For Bee editor, update both preview and extract tags
|
|
246
233
|
if (templateContent !== previousBeeContentRef.current) {
|
|
234
|
+
|
|
247
235
|
previousBeeContentRef.current = templateContent;
|
|
248
236
|
setBeeContent(templateContent);
|
|
249
|
-
|
|
237
|
+
setPreviewDataHtml({
|
|
238
|
+
resolvedBody: templateContent,
|
|
239
|
+
resolvedTitle: formData['template-subject'] || ''
|
|
240
|
+
});
|
|
241
|
+
|
|
242
|
+
// Extract tags with latest content
|
|
243
|
+
const payloadContent = convert(templateContent, GLOBAL_CONVERT_OPTIONS);
|
|
244
|
+
actions.extractTagsRequested(formData['template-subject'] || '', payloadContent);
|
|
250
245
|
}
|
|
251
246
|
} else {
|
|
252
|
-
// For CKEditor,
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
247
|
+
// For CKEditor, always update preview and extract tags with latest content
|
|
248
|
+
setPreviewDataHtml({
|
|
249
|
+
resolvedBody: templateContent,
|
|
250
|
+
resolvedTitle: formData['template-subject'] || ''
|
|
251
|
+
});
|
|
252
|
+
|
|
253
|
+
// Extract tags with latest content
|
|
254
|
+
const payloadContent = convert(templateContent, GLOBAL_CONVERT_OPTIONS);
|
|
255
|
+
actions.extractTagsRequested(formData['template-subject'] || '', payloadContent);
|
|
256
256
|
}
|
|
257
257
|
}
|
|
258
258
|
}, [formData, currentTab]);
|
|
@@ -260,19 +260,9 @@ const TestAndPreviewSlidebox = (props) => {
|
|
|
260
260
|
// Cleanup effect to reset ref when slidebox closes
|
|
261
261
|
useEffect(() => {
|
|
262
262
|
if (!show) {
|
|
263
|
-
// Reset all state
|
|
264
263
|
previousBeeContentRef.current = '';
|
|
265
264
|
setBeeContent('');
|
|
266
265
|
setPreviewDataHtml('');
|
|
267
|
-
setSelectedCustomer(null);
|
|
268
|
-
setRequiredTags([]);
|
|
269
|
-
setOptionalTags([]);
|
|
270
|
-
setCustomValues({});
|
|
271
|
-
setShowJSON(false);
|
|
272
|
-
setTagsExtracted(false);
|
|
273
|
-
setPreviewDevice('desktop');
|
|
274
|
-
setSelectedTestEntities([]);
|
|
275
|
-
actions.clearPrefilledValues();
|
|
276
266
|
}
|
|
277
267
|
}, [show]);
|
|
278
268
|
|
|
@@ -284,22 +274,14 @@ const TestAndPreviewSlidebox = (props) => {
|
|
|
284
274
|
|
|
285
275
|
// Listen for extract tags API result
|
|
286
276
|
useEffect(() => {
|
|
287
|
-
// Categorize tags into required and optional
|
|
288
|
-
const required = [];
|
|
289
|
-
const optional = [];
|
|
290
|
-
let hasPersonalizationTags = false;
|
|
291
|
-
|
|
292
277
|
if (extractedTags?.length > 0) {
|
|
278
|
+
// Categorize tags into required and optional
|
|
279
|
+
const required = [];
|
|
280
|
+
const optional = [];
|
|
281
|
+
|
|
293
282
|
const processTag = (tag, parentPath = '') => {
|
|
294
283
|
const currentPath = parentPath ? `${parentPath}.${tag.name}` : tag.name;
|
|
295
284
|
|
|
296
|
-
// Skip unsubscribe tag for input fields
|
|
297
|
-
if (tag.name === 'unsubscribe') {
|
|
298
|
-
return;
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
hasPersonalizationTags = true;
|
|
302
|
-
|
|
303
285
|
if (tag?.metaData?.userDriven === false) {
|
|
304
286
|
required.push({
|
|
305
287
|
...tag,
|
|
@@ -319,75 +301,43 @@ const TestAndPreviewSlidebox = (props) => {
|
|
|
319
301
|
|
|
320
302
|
extractedTags.forEach((tag) => processTag(tag));
|
|
321
303
|
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
setOptionalTags(optional);
|
|
304
|
+
setRequiredTags(required);
|
|
305
|
+
setOptionalTags(optional);
|
|
325
306
|
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
} else {
|
|
336
|
-
// Reset all tag-related state if no personalization tags
|
|
337
|
-
setRequiredTags([]);
|
|
338
|
-
setOptionalTags([]);
|
|
339
|
-
setCustomValues({});
|
|
340
|
-
setTagsExtracted(false);
|
|
341
|
-
}
|
|
342
|
-
} else {
|
|
343
|
-
// Reset all tag-related state if no tags
|
|
344
|
-
setRequiredTags([]);
|
|
345
|
-
setOptionalTags([]);
|
|
346
|
-
setCustomValues({});
|
|
347
|
-
setTagsExtracted(false);
|
|
307
|
+
// Initialize custom values for required tags
|
|
308
|
+
const initialValues = {};
|
|
309
|
+
required.forEach((tag) => {
|
|
310
|
+
initialValues[tag.fullPath] = '';
|
|
311
|
+
});
|
|
312
|
+
optional.forEach((tag) => {
|
|
313
|
+
initialValues[tag.fullPath] = '';
|
|
314
|
+
});
|
|
315
|
+
setCustomValues(initialValues);
|
|
348
316
|
}
|
|
349
317
|
}, [extractedTags]);
|
|
350
318
|
|
|
351
319
|
useEffect(() => {
|
|
352
|
-
if (selectedCustomer) {
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
// Get all available tags
|
|
356
|
-
const allTags = [...requiredTags, ...optionalTags];
|
|
357
|
-
|
|
358
|
-
if (allTags.length > 0) {
|
|
320
|
+
if (tagsExtracted && selectedCustomer) {
|
|
321
|
+
const userDrivenTags = optionalTags?.map((tag) => tag.name);
|
|
322
|
+
if (userDrivenTags?.length > 0) {
|
|
359
323
|
const payload = {
|
|
360
324
|
channel: EMAIL,
|
|
361
325
|
messageTitle: formData['template-subject'],
|
|
362
|
-
messageBody:
|
|
363
|
-
resolvedTags:
|
|
326
|
+
messageBody: content,
|
|
327
|
+
resolvedTags: customValues,
|
|
364
328
|
userId: selectedCustomer?.customerId,
|
|
365
329
|
};
|
|
366
330
|
actions.getPrefilledValuesRequested(payload);
|
|
367
331
|
}
|
|
368
332
|
}
|
|
369
|
-
}, [selectedCustomer]);
|
|
333
|
+
}, [selectedCustomer, tagsExtracted]);
|
|
370
334
|
|
|
371
335
|
useEffect(() => {
|
|
372
|
-
if (prefilledValues) {
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
});
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
setCustomValues(updatedValues);
|
|
381
|
-
|
|
382
|
-
// Update preview with prefilled values
|
|
383
|
-
const payload = {
|
|
384
|
-
channel: EMAIL,
|
|
385
|
-
messageTitle: formData['template-subject'],
|
|
386
|
-
messageBody: getCurrentContent,
|
|
387
|
-
resolvedTags: updatedValues,
|
|
388
|
-
userId: selectedCustomer?.customerId,
|
|
389
|
-
};
|
|
390
|
-
actions.updatePreviewRequested(payload);
|
|
336
|
+
if (prefilledValues && !isEmpty(prefilledValues)) {
|
|
337
|
+
setCustomValues((prev) => ({
|
|
338
|
+
...prev,
|
|
339
|
+
...prefilledValues,
|
|
340
|
+
}));
|
|
391
341
|
}
|
|
392
342
|
}, [JSON.stringify(prefilledValues)]);
|
|
393
343
|
|
|
@@ -421,13 +371,7 @@ const TestAndPreviewSlidebox = (props) => {
|
|
|
421
371
|
setPreviewDevice('desktop');
|
|
422
372
|
setPreviewDataHtml('');
|
|
423
373
|
setSelectedTestEntities([]);
|
|
424
|
-
setBeeContent('');
|
|
425
|
-
previousBeeContentRef.current = '';
|
|
426
|
-
|
|
427
|
-
// Clear any pending actions
|
|
428
374
|
actions.clearPrefilledValues();
|
|
429
|
-
|
|
430
|
-
// Call parent's onClose if provided
|
|
431
375
|
if (onClose) {
|
|
432
376
|
onClose();
|
|
433
377
|
}
|
|
@@ -440,35 +384,24 @@ const TestAndPreviewSlidebox = (props) => {
|
|
|
440
384
|
// Handle customer selection from CustomerSearchSection
|
|
441
385
|
const handleCustomerSelect = (customer) => {
|
|
442
386
|
setSelectedCustomer(customer);
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
387
|
+
setCustomValues((prev) => {
|
|
388
|
+
const newValues = { ...prev };
|
|
389
|
+
optionalTags.forEach((tag) => {
|
|
390
|
+
delete newValues[tag.fullPath];
|
|
391
|
+
});
|
|
392
|
+
return newValues;
|
|
449
393
|
});
|
|
450
|
-
setCustomValues(emptyValues);
|
|
451
394
|
};
|
|
452
395
|
|
|
453
396
|
const handleClearSelection = () => {
|
|
454
397
|
setSelectedCustomer(null);
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
398
|
+
setCustomValues((prev) => {
|
|
399
|
+
const newValues = { ...prev };
|
|
400
|
+
optionalTags.forEach((tag) => {
|
|
401
|
+
delete newValues[tag.fullPath];
|
|
402
|
+
});
|
|
403
|
+
return newValues;
|
|
460
404
|
});
|
|
461
|
-
setCustomValues(emptyValues);
|
|
462
|
-
|
|
463
|
-
// Update preview with empty values
|
|
464
|
-
const payload = {
|
|
465
|
-
channel: EMAIL,
|
|
466
|
-
messageTitle: formData['template-subject'],
|
|
467
|
-
messageBody: getCurrentContent,
|
|
468
|
-
resolvedTags: emptyValues,
|
|
469
|
-
userId: null,
|
|
470
|
-
};
|
|
471
|
-
actions.updatePreviewRequested(payload);
|
|
472
405
|
};
|
|
473
406
|
|
|
474
407
|
// Handle custom value changes
|
|
@@ -493,38 +426,63 @@ const TestAndPreviewSlidebox = (props) => {
|
|
|
493
426
|
|
|
494
427
|
// Handle discard custom values
|
|
495
428
|
const handleDiscardCustomValues = () => {
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
emptyValues[tag.fullPath] = '';
|
|
429
|
+
const resetValues = {};
|
|
430
|
+
requiredTags.forEach((tag) => {
|
|
431
|
+
resetValues[tag?.fullPath] = '';
|
|
500
432
|
});
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
channel: EMAIL,
|
|
506
|
-
messageTitle: formData['template-subject'],
|
|
507
|
-
messageBody: getCurrentContent,
|
|
508
|
-
resolvedTags: emptyValues,
|
|
509
|
-
userId: selectedCustomer?.customerId,
|
|
510
|
-
};
|
|
511
|
-
actions.updatePreviewRequested(payload);
|
|
433
|
+
optionalTags.forEach((tag) => {
|
|
434
|
+
resetValues[tag?.fullPath] = '';
|
|
435
|
+
});
|
|
436
|
+
setCustomValues(resetValues);
|
|
512
437
|
};
|
|
513
438
|
|
|
514
439
|
// Handle update preview
|
|
515
440
|
const handleUpdatePreview = async () => {
|
|
516
441
|
try {
|
|
517
|
-
//
|
|
518
|
-
const
|
|
442
|
+
// Store current values to prevent loss during update
|
|
443
|
+
const currentCustomValues = { ...customValues };
|
|
444
|
+
|
|
445
|
+
const currentTabData = formData[currentTab - 1];
|
|
446
|
+
const activeTab = currentTabData?.activeTab;
|
|
447
|
+
const isDragDrop = currentTabData?.[activeTab]?.is_drag_drop;
|
|
519
448
|
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
449
|
+
// For BEE editor, ensure content is saved first
|
|
450
|
+
if (isDragDrop && beeInstance) {
|
|
451
|
+
// Trigger save to ensure latest content
|
|
452
|
+
beeInstance.save();
|
|
453
|
+
|
|
454
|
+
// Wait a bit for save to complete and formData to update
|
|
455
|
+
await new Promise((resolve) => setTimeout(resolve, 500));
|
|
456
|
+
|
|
457
|
+
// Get latest content from formData
|
|
458
|
+
const updatedContent = formData[currentTab - 1]?.[activeTab]?.['template-content'];
|
|
459
|
+
const payload = {
|
|
460
|
+
channel: EMAIL,
|
|
461
|
+
messageTitle: formData['template-subject'],
|
|
462
|
+
messageBody: updatedContent || getCurrentContent,
|
|
463
|
+
resolvedTags: currentCustomValues, // Use stored values
|
|
464
|
+
userId: selectedCustomer?.customerId,
|
|
465
|
+
};
|
|
466
|
+
|
|
467
|
+
await actions.updatePreviewRequested(payload);
|
|
468
|
+
return;
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
// For CKEditor, get latest content directly from formData
|
|
472
|
+
const templateContent = currentTabData?.[activeTab]?.['template-content'];
|
|
473
|
+
if (templateContent) {
|
|
474
|
+
// Create payload for CKEditor preview update
|
|
475
|
+
const payload = {
|
|
476
|
+
channel: EMAIL,
|
|
477
|
+
messageTitle: formData['template-subject'],
|
|
478
|
+
messageBody: templateContent,
|
|
479
|
+
resolvedTags: currentCustomValues,
|
|
480
|
+
userId: selectedCustomer?.customerId,
|
|
481
|
+
};
|
|
482
|
+
|
|
483
|
+
// Use the same update preview action for both editors
|
|
484
|
+
await actions.updatePreviewRequested(payload);
|
|
485
|
+
}
|
|
528
486
|
} catch (error) {
|
|
529
487
|
console.error('Error updating preview:', error);
|
|
530
488
|
CapNotification.error({
|
|
@@ -535,34 +493,7 @@ const TestAndPreviewSlidebox = (props) => {
|
|
|
535
493
|
|
|
536
494
|
// Handle extract tags button click
|
|
537
495
|
const handleExtractTags = () => {
|
|
538
|
-
// Extract tags from current content
|
|
539
|
-
const currentTabData = formData[currentTab - 1];
|
|
540
|
-
const activeTab = currentTabData?.activeTab;
|
|
541
|
-
const templateContent = currentTabData?.[activeTab]?.['template-content'];
|
|
542
|
-
|
|
543
|
-
// Check for personalization tags (excluding unsubscribe)
|
|
544
|
-
const content = templateContent || getCurrentContent;
|
|
545
|
-
const tags = content.match(/{{[^}]+}}/g) || [];
|
|
546
|
-
const hasPersonalizationTags = tags.some(tag => !tag.includes('unsubscribe'));
|
|
547
|
-
|
|
548
|
-
if (!hasPersonalizationTags && tags.length === 1 && tags[0].includes('unsubscribe')) {
|
|
549
|
-
// If only unsubscribe tag is present, show noTagsExtracted message
|
|
550
|
-
setTagsExtracted(false);
|
|
551
|
-
setRequiredTags([]);
|
|
552
|
-
setOptionalTags([]);
|
|
553
|
-
setCustomValues({});
|
|
554
|
-
return;
|
|
555
|
-
}
|
|
556
|
-
|
|
557
|
-
// Extract tags
|
|
558
496
|
setTagsExtracted(true);
|
|
559
|
-
if (templateContent) {
|
|
560
|
-
const payloadContent = convert(templateContent, GLOBAL_CONVERT_OPTIONS);
|
|
561
|
-
actions.extractTagsRequested(formData['template-subject'] || '', payloadContent);
|
|
562
|
-
} else {
|
|
563
|
-
const payloadContent = convert(getCurrentContent, GLOBAL_CONVERT_OPTIONS);
|
|
564
|
-
actions.extractTagsRequested(formData['template-subject'] || '', payloadContent);
|
|
565
|
-
}
|
|
566
497
|
};
|
|
567
498
|
|
|
568
499
|
const handleTestEntitiesChange = (value) => {
|
|
@@ -36,7 +36,7 @@ import {
|
|
|
36
36
|
CREATE_CENTRAL_COMMS_META_ID_REQUEST,
|
|
37
37
|
} from '../constants';
|
|
38
38
|
import { callback, error, error2, videoConfigData } from '../../mockdata';
|
|
39
|
-
import { LOGOUT_FAILURE,
|
|
39
|
+
import { LOGOUT_FAILURE, LOGOUT_SUCCESS } from '../../../constants/unified';
|
|
40
40
|
|
|
41
41
|
|
|
42
42
|
|
|
@@ -543,6 +543,7 @@ export class Creatives extends React.Component {
|
|
|
543
543
|
whatsappMedia = {},
|
|
544
544
|
isPreviewUrl = false,
|
|
545
545
|
cards = [],
|
|
546
|
+
id = '',
|
|
546
547
|
} = {},
|
|
547
548
|
} = templateData;
|
|
548
549
|
const mediaParams = {};
|
|
@@ -582,6 +583,7 @@ export class Creatives extends React.Component {
|
|
|
582
583
|
}
|
|
583
584
|
const unsubscribeRegex = /Click {{unsubscribe}} to unsubscribe/g;
|
|
584
585
|
creativesTemplateData = {
|
|
586
|
+
_id: id,
|
|
585
587
|
type: constants.WHATSAPP,
|
|
586
588
|
edit: true,
|
|
587
589
|
name,
|
|
@@ -37,9 +37,9 @@ import { FONT_COLOR_05 } from '@capillarytech/cap-ui-library/styled/variables';
|
|
|
37
37
|
import { gtmPush } from '../../utils/gtmTrackers';
|
|
38
38
|
const {CapCustomCardList} = CapCustomCard;
|
|
39
39
|
import {storeS3FileSizeDetails, CREATIVES_S3_ASSET_FILESIZES} from '../../utils/cdnTransformation';
|
|
40
|
+
import { CUSTOMER_BARCODE_TAG } from '../../constants/unified';
|
|
40
41
|
|
|
41
42
|
import { containsBase64Images } from '../../utils/content';
|
|
42
|
-
import { CUSTOMER_BARCODE_TAG } from '../../containers/App/constants';
|
|
43
43
|
import injectReducer from '../../utils/injectReducer';
|
|
44
44
|
import v2EmailReducer from './reducer';
|
|
45
45
|
import { v2EmailSagas } from './sagas';
|
|
@@ -29,7 +29,7 @@ import { makeSelectLoyaltyPromotionDisplay, setInjectedTags } from '../Cap/selec
|
|
|
29
29
|
import withCreatives from '../../hoc/withCreatives';
|
|
30
30
|
import messages from './messages';
|
|
31
31
|
import './_FTP.scss';
|
|
32
|
-
import * as globalActions from '
|
|
32
|
+
import * as globalActions from '../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';
|
|
@@ -17,7 +17,7 @@ import withStyles from '../../../../hoc/withStyles';
|
|
|
17
17
|
import globalMessages from '../../../Cap/messages';
|
|
18
18
|
import { validateTags } from '../../../../utils/tagValidations';
|
|
19
19
|
import moment from 'moment';
|
|
20
|
-
import { GET_TRANSLATION_MAPPED } from '../../../../
|
|
20
|
+
import { GET_TRANSLATION_MAPPED } from '../../../../constants/unified';
|
|
21
21
|
|
|
22
22
|
const { TextArea } = CapInput;
|
|
23
23
|
const {CapCustomCardList} = CapCustomCard;
|
|
@@ -24,7 +24,7 @@ import {getMessageObject} from '../../../utils/messageUtils';
|
|
|
24
24
|
import { gtmPush } from '../../../utils/gtmTrackers';
|
|
25
25
|
import * as creativesContainerActions from '../../CreativesContainer/actions';
|
|
26
26
|
import {SMS} from '../../CreativesContainer/constants';
|
|
27
|
-
// import callNativeEvent from '../../../
|
|
27
|
+
// import callNativeEvent from '../../../legacy/callNativeEvent';
|
|
28
28
|
import {showError} from '../commonMethods';
|
|
29
29
|
import withCreatives from '../../../hoc/withCreatives';
|
|
30
30
|
import { GA } from '@capillarytech/cap-ui-utils';
|
|
@@ -24,7 +24,7 @@ import messages from './messages';
|
|
|
24
24
|
import {getMessageObject} from '../../../utils/messageUtils';
|
|
25
25
|
import { gtmPush } from '../../../utils/gtmTrackers';
|
|
26
26
|
import * as creativesContainerActions from '../../CreativesContainer/actions';
|
|
27
|
-
// import callNativeEvent from '../../../
|
|
27
|
+
// import callNativeEvent from '../../../legacy/callNativeEvent';
|
|
28
28
|
import {showError} from '../commonMethods';
|
|
29
29
|
import withCreatives from '../../../hoc/withCreatives';
|
|
30
30
|
import { EDIT, TRACK_EDIT_SMS } from '../../App/constants';
|
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
} from '../../utils/common';
|
|
29
29
|
import {
|
|
30
30
|
GIFT_VOUCHER_RELATED_TAGS, PROMO_ENGINE_RELATED_TAGS, BADGES_RELATED_TAGS, BADGES_ENROLL, BADGES_ISSUE,
|
|
31
|
-
} from '../../
|
|
31
|
+
} from '../../constants/unified';
|
|
32
32
|
|
|
33
33
|
const {TreeNode} = Tree;
|
|
34
34
|
|
|
@@ -105,7 +105,7 @@ import {
|
|
|
105
105
|
CREATE,
|
|
106
106
|
} from '../App/constants';
|
|
107
107
|
import {MAX_WHATSAPP_TEMPLATES, WARNING_WHATSAPP_TEMPLATES , ACCOUNT_MAPPING_ON_CHANNEL} from './constants';
|
|
108
|
-
import { COPY_OF } from '../../
|
|
108
|
+
import { COPY_OF } from '../../constants/unified';
|
|
109
109
|
import {
|
|
110
110
|
STATUS_OPTIONS,
|
|
111
111
|
CATEGORY,
|
|
@@ -6,7 +6,7 @@ import get from 'lodash/get';
|
|
|
6
6
|
import * as Api from '../../services/api';
|
|
7
7
|
import * as types from './constants';
|
|
8
8
|
import { saveCdnConfigs, removeAllCdnLocalStorageItems } from '../../utils/cdnTransformation';
|
|
9
|
-
import { COPY_OF } from '../../
|
|
9
|
+
import { COPY_OF } from '../../constants/unified';
|
|
10
10
|
import { ZALO_TEMPLATE_INFO_REQUEST } from '../Zalo/constants';
|
|
11
11
|
import { getTemplateInfoById } from '../Zalo/saga';
|
|
12
12
|
import { watchCreateTemplate } from '../MobilePushNew/sagas';
|
|
@@ -80,7 +80,7 @@ export const mediaTypeOptions = ({host, templateCategory}) => {
|
|
|
80
80
|
tagColor: CAP_GREEN02,
|
|
81
81
|
tagTextColor: CAP_GREEN01,
|
|
82
82
|
},
|
|
83
|
-
...(templateCategory === WHATSAPP_CATEGORIES.marketing && host === HOST_GUPSHUP
|
|
83
|
+
...(templateCategory === WHATSAPP_CATEGORIES.marketing && (host === HOST_GUPSHUP || host === HOST_KARIX)
|
|
84
84
|
? [
|
|
85
85
|
{
|
|
86
86
|
key: 'CAROUSEL',
|
|
@@ -577,7 +577,7 @@ describe('mediaTypeOptions', () => {
|
|
|
577
577
|
? opt.some((o) => o.key === 'CAROUSEL')
|
|
578
578
|
: opt.key === 'CAROUSEL'
|
|
579
579
|
) || options.flat().some((o) => o.key === 'CAROUSEL');
|
|
580
|
-
expect(hasCarousel).toBe(
|
|
580
|
+
expect(hasCarousel).toBe(true);
|
|
581
581
|
});
|
|
582
582
|
|
|
583
583
|
it('should NOT include CAROUSEL when category is NOT MARKETING and host is HOST_GUPSHUP', () => {
|