@capillarytech/creatives-library 8.0.159-alpha.1 → 8.0.159
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/CustomerSearchSection/index.js +79 -83
- package/v2Components/EmailMobilePreview/index.js +2 -2
- package/v2Components/EmailPreview/_emailPreview.scss +0 -1
- package/v2Components/EmailPreviewV2/_emailPreviewV2.scss +0 -1
- package/v2Components/FormBuilder/index.js +55 -80
- package/v2Components/TemplatePreview/index.js +2 -1
- package/v2Components/TestAndPreviewSlidebox/PreviewSection.js +1 -1
- package/v2Components/TestAndPreviewSlidebox/_testAndPreviewSlidebox.scss +1 -2
- package/v2Components/TestAndPreviewSlidebox/index.js +14 -187
- package/v2Components/TestAndPreviewSlidebox/tests/PreviewSection.test.js +1 -1
- package/v2Containers/Cap/tests/saga.test.js +1 -1
- package/v2Containers/CreativesContainer/SlideBoxContent.js +3 -11
- package/v2Containers/CreativesContainer/index.js +15 -30
- package/v2Containers/CreativesContainer/tests/__snapshots__/index.test.js.snap +0 -5
- package/v2Containers/Email/index.js +29 -151
- package/v2Containers/EmailWrapper/hooks/useEmailWrapper.js +0 -3
- package/v2Containers/EmailWrapper/index.js +0 -6
- 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/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
|
@@ -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';
|
|
@@ -89,8 +89,6 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
89
89
|
addLanguageType: '',
|
|
90
90
|
startValidation: false,
|
|
91
91
|
saveForm: false,
|
|
92
|
-
showTestAndPreviewSlidebox: false,
|
|
93
|
-
isTestAndPreviewMode: false, // Add flag to prevent validation during Test & Preview
|
|
94
92
|
};
|
|
95
93
|
|
|
96
94
|
this.isTagLoaded = false;
|
|
@@ -241,9 +239,6 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
241
239
|
}
|
|
242
240
|
|
|
243
241
|
componentWillReceiveProps(nextProps) {
|
|
244
|
-
console.log('🔄 componentWillReceiveProps called - isTestAndPreviewMode:', this.state.isTestAndPreviewMode);
|
|
245
|
-
console.log('📥 Email received isTestAndPreviewMode prop:', nextProps.isTestAndPreviewMode);
|
|
246
|
-
|
|
247
242
|
// if (this.props.location.query.type === 'embedded') {
|
|
248
243
|
// this.showNext();
|
|
249
244
|
// }
|
|
@@ -251,13 +246,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
251
246
|
if (isFullMode && isGetFormData && !_.isEqual(isGetFormData, this.props.isGetFormData) && !this.state.isDragDrop) {
|
|
252
247
|
//only for ck editor
|
|
253
248
|
//when create button is clicked in full mode
|
|
254
|
-
// Don't start validation if we're in Test & Preview mode
|
|
255
|
-
if (!nextProps.isTestAndPreviewMode) {
|
|
256
|
-
console.log('✅ componentWillReceiveProps calling startValidation - isTestAndPreviewMode:', nextProps.isTestAndPreviewMode);
|
|
257
249
|
this.startValidation(true);
|
|
258
|
-
} else {
|
|
259
|
-
console.log('🚫 componentWillReceiveProps blocked startValidation - Test & Preview mode active');
|
|
260
|
-
}
|
|
261
250
|
}
|
|
262
251
|
if (this.state.languageDataSet && nextProps.Templates.selectedEmailLayout && nextProps.Templates.selectedEmailLayout !== '' && !_.isEqual(this.props.Templates.selectedEmailLayout, nextProps.Templates.selectedEmailLayout )) {
|
|
263
252
|
this.setNewLanguageContent(nextProps.Templates.selectedEmailLayout);
|
|
@@ -603,24 +592,27 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
603
592
|
onChange = (evt) => {
|
|
604
593
|
const {isFullMode, showTemplateName} = this.props;
|
|
605
594
|
const formData = _.cloneDeep(this.state.formData);
|
|
606
|
-
const currentTabData = formData[this.state.currentTab - 1];
|
|
607
|
-
const activeTab = currentTabData?.activeTab;
|
|
608
595
|
|
|
609
|
-
//
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
596
|
+
//if (evt.editor.name.indexOf('editor') === -1) {
|
|
597
|
+
// _.forEach(window.CKEDITOR.instances, (winInstance) => {
|
|
598
|
+
// const temp = winInstance;
|
|
599
|
+
// if (winInstance.name === evt.editor.name) {
|
|
600
|
+
//
|
|
601
|
+
// setTimeout(() => {
|
|
602
|
+
// //temp.name = id;
|
|
603
|
+
// }, 1000);
|
|
604
|
+
// //temp.name = id;
|
|
605
|
+
//
|
|
606
|
+
// }
|
|
607
|
+
// });
|
|
608
|
+
//}
|
|
609
|
+
if (!formData[this.state.currentTab - 1][formData[`${this.state.currentTab - 1}`].activeTab].is_drag_drop) {
|
|
610
|
+
formData[`${this.state.currentTab - 1}`][formData[`${this.state.currentTab - 1}`].activeTab][`template-content`] = _.cloneDeep(evt.editor.getData());
|
|
611
|
+
if (formData[`${this.state.currentTab - 1}`].tabKey === formData.base.tabKey) {
|
|
612
|
+
formData.base[formData[`${this.state.currentTab - 1}`].activeTab][`template-content`] = _.cloneDeep(evt.editor.getData());
|
|
617
613
|
}
|
|
618
614
|
|
|
619
|
-
|
|
620
|
-
this.setState({
|
|
621
|
-
formData,
|
|
622
|
-
content: newContent // Keep latest content in state
|
|
623
|
-
}, () => {
|
|
615
|
+
this.setState({formData, content: evt.editor.getData()}, () => {
|
|
624
616
|
if (isFullMode && showTemplateName) {
|
|
625
617
|
showTemplateName({formData, onFormDataChange: this.onFormDataChange});
|
|
626
618
|
}
|
|
@@ -812,14 +804,6 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
812
804
|
}
|
|
813
805
|
|
|
814
806
|
getFormData = (e, value) => {
|
|
815
|
-
// Don't run validation if we're in Test & Preview mode
|
|
816
|
-
if (this.props.isTestAndPreviewMode) {
|
|
817
|
-
console.log('🚫 getFormData blocked - Test & Preview mode active');
|
|
818
|
-
return;
|
|
819
|
-
}
|
|
820
|
-
|
|
821
|
-
console.log('✅ getFormData called - isTestAndPreviewMode:', this.props.isTestAndPreviewMode);
|
|
822
|
-
|
|
823
807
|
this.setState({getFormDataValue: value, gettingFormData: true}, () => {
|
|
824
808
|
this.saveValidationData();
|
|
825
809
|
});
|
|
@@ -843,11 +827,8 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
843
827
|
const currentTabData = formData[currentTab - 1];
|
|
844
828
|
const activeTab = currentTabData?.activeTab;
|
|
845
829
|
|
|
846
|
-
// Get content from formData
|
|
847
830
|
if (currentTabData && activeTab && currentTabData[activeTab]) {
|
|
848
|
-
|
|
849
|
-
const templateContent = currentTabData[activeTab]['template-content'];
|
|
850
|
-
return templateContent || '';
|
|
831
|
+
return currentTabData[activeTab]['template-content'] || '';
|
|
851
832
|
}
|
|
852
833
|
|
|
853
834
|
return '';
|
|
@@ -1036,14 +1017,6 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
1036
1017
|
});
|
|
1037
1018
|
}
|
|
1038
1019
|
startValidation = (shouldSave) => {
|
|
1039
|
-
// Don't start validation if we're in Test & Preview mode
|
|
1040
|
-
if (this.props.isTestAndPreviewMode) {
|
|
1041
|
-
console.log('🚫 startValidation blocked - Test & Preview mode active');
|
|
1042
|
-
return;
|
|
1043
|
-
}
|
|
1044
|
-
|
|
1045
|
-
console.log('✅ startValidation called - shouldSave:', shouldSave, 'isTestAndPreviewMode:', this.props.isTestAndPreviewMode);
|
|
1046
|
-
|
|
1047
1020
|
if (!this.state.startValidation && shouldSave) {
|
|
1048
1021
|
this.setState({startValidation: true});
|
|
1049
1022
|
}
|
|
@@ -1052,14 +1025,6 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
1052
1025
|
this.setState({startValidation: false}, this.props.onValidationFail);
|
|
1053
1026
|
}
|
|
1054
1027
|
saveValidationData = () => {
|
|
1055
|
-
// Don't run validation if we're in Test & Preview mode
|
|
1056
|
-
if (this.props.isTestAndPreviewMode) {
|
|
1057
|
-
console.log('🚫 saveValidationData blocked - Test & Preview mode active');
|
|
1058
|
-
return;
|
|
1059
|
-
}
|
|
1060
|
-
|
|
1061
|
-
console.log('✅ saveValidationData called - isTestAndPreviewMode:', this.props.isTestAndPreviewMode);
|
|
1062
|
-
|
|
1063
1028
|
let saveCount = 0;
|
|
1064
1029
|
const isBeeEnable = this.checkBeeEditorAllowedForLibrary();
|
|
1065
1030
|
this.setState({saveEdmDataMode: 'validation', saveCount: 0, cmsDataCount: 0}, () => {
|
|
@@ -2142,7 +2107,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
2142
2107
|
const isEdmSupport = (this.props.location.query.isEdmSupport !== "false") || false;
|
|
2143
2108
|
|
|
2144
2109
|
//const data = {"base":{"subject":"deded","html_content":"<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\"> <html> <head> \t<title>Scheduled Report</title> \t<meta http-equiv=\"Content-Type\" content=\"text/html charset=UTF-8\"/> \t<style type=\"text/css\">.container-main p{line-height: 1.6;}@media screen and (max-width: 480px){a.brand{font-size: 35px;}}@media screen and (max-width: 480px){.container-main a{text-align: center;}a.brand{text-align: center;}}a.brand img{vertical-align: middle; padding: 0 8px 0 0; width: 250px;}@media screen and (max-width: 480px){a.brand img{width: 220px !important;}}@media screen and (max-width: 480px){.container-content{padding: 15px 20px; font-size: 12px !important;} .email-footer{font-size: 12px !important;}}.container-content table{border-collapse: collapse;}.container-content table tr td p{margin: 5px;}.container-content table tr td p span{font-weight: bold; padding: 0 3px 0 0;}@media screen and (max-width: 480px){a.btn-view-reports{margin: 25px auto 10px;}}a.btn-view-reports:hover{background: grey; color: #fff;}.email-footer p{text-align: center; font-size: 12px; color: grey;}.email-footer p a{color: blue; cursor: pointer;}.email-footer p a:hover{color: grey;} \t</style> </head> <body><center>\n\t\t\t\t\t\t\t\t\t\tIf you have difficulties viewing this mail, click\n\t\t\t\t\t\t\t\t\t\t<a href=\"https://nightly.capillary.in/business_controller/campaigns/emails/links/view.php?utrack={{user_id_b64}}&mtrack={{outbox_id_b64}}\" style = \"text-decoration: underline;color: #369;\" target=\"_blank\">here</a><br/>\n\t\t\t\t\t\t\t\t\t</center> <table class=\"container-main\" style=\"background:#eeeeee; color:#000000; font-family:'Open Sans',sans-serif; font-size:16px; font-weight:400; margin:0 auto; max-width:978px; padding:15px; width:100%\"> \t<tbody> \t\t<tr> \t\t\t<td> \t\t\t<table class=\"email-header\" style=\"background:#ffffff; margin:0 0 5px; padding:17px 0; width:100%\"> \t\t\t\t<tbody> \t\t\t\t\t<tr> \t\t\t\t\t\t<td style=\"width:100%\"><a class=\"brand\" href=\"#\" style=\"display: table; margin: 0 auto; text-decoration: none; font-size: 37px; color: grey;\"><CapImage alt=\"Capillary Technologies\" src=\"https://s3.amazonaws.com/fileservice.in/intouch_creative_assets/60221e2020ba572f6787.png\" /> </a></td> \t\t\t\t\t</tr> \t\t\t\t</tbody> \t\t\t</table> \t\t\t<div class=\"container-content\" style=\"background:#ffffff; padding:20px 35px\"> \t\t\t<p>Hi Ashish Karan,</p> \t\t\t<p>You've received a new scheduled report. {{unsubscribe}}</p> \t\t\t<table> \t\t\t\t<tbody> \t\t\t\t\t<tr> \t\t\t\t\t\t<td><strong>Org Name: </strong></td> \t\t\t\t\t\t<td> \t\t\t\t\t\t<p>autotest1</p> \t\t\t\t\t\t</td> \t\t\t\t\t</tr> \t\t\t\t\t<tr> \t\t\t\t\t\t<td><strong>Scheduled Name: </strong></td> \t\t\t\t\t\t<td> \t\t\t\t\t\t<p>Schedule Test</p> \t\t\t\t\t\t</td> \t\t\t\t\t</tr> \t\t\t\t\t<tr> \t\t\t\t\t\t<td><strong>Time Period: </strong></td> \t\t\t\t\t\t<td> \t\t\t\t\t\t<p>1st Jan, 2017 to 24th Sep, 2017</p> \t\t\t\t\t\t</td> \t\t\t\t\t</tr> \t\t\t\t\t<tr> \t\t\t\t\t\t<td><strong>Report Name: </strong></td> \t\t\t\t\t\t<td> \t\t\t\t\t\t<p>redDart Report</p> \t\t\t\t\t\t</td> \t\t\t\t\t</tr> \t\t\t\t</tbody> \t\t\t</table> \t\t\t<p style=\"font-size:15px; margin-top:25px\">By clicking "View Report" you will be redirected to Capillary Analytics to view the automated report.</p> \t\t\t<a href=\"https://nightly.capillary.in/analytics/v2/report/59c37820e626a10df78c8d91?snapshot=59c8bce750f4e75ec8b0d24c\" style=\"background: #009e0f; text-align: center; color: #fff; font-size: 16px; padding: 10px 25px; cursor: pointer; text-decoration: none; display: block; width: 120px; margin: 25px auto 15px;\" target=\"_blank\">View Report</a></div> \t\t\t<div class=\"email-footer\"> \t\t\t<p style=\"color:grey; font-size:12px; text-align:center\">You've received this mail because you subscribed to Schedule Test schedule of redDart Report. <a href=\"https://nightly.capillary.in/analytics/v2/report/59c37820e626a10df78c8d91/schedule/59c8bce750f4e75ec8b0d24c/unsubscribeSchedule\" style=\"color: blue; cursor: pointer;\" target=\"_blank\">Unsubscribe</a></p> \t\t\t<p><a href=\"http://capillarytech.com/privacy-policy/\" target=\"_blank\">Privacy Policy</a> | <a href=\"http://capillarytech.com/about-us/\" target=\"_blank\">About Capillary</a></p> \t\t\t</div> \t\t\t</td> \t\t</tr> \t</tbody> </table> </body> </html> ","is_drag_drop":false,"drag_drop_id":null},"secondary_templates":[{"is_preview_generated":null,"preview_url":null,"is_favourite":null,"is_drag_drop":false,"drag_drop_id":null,"scope":null,"tag":null,"is_default":null,"html_content":"<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\"> <html> <head> \t<title>Scheduled Report</title> \t<meta http-equiv=\"Content-Type\" content=\"text/html charset=UTF-8\"/> \t<style type=\"text/css\">.container-main p{line-height: 1.6;}@media screen and (max-width: 480px){a.brand{font-size: 35px;}}@media screen and (max-width: 480px){.container-main a{text-align: center;}a.brand{text-align: center;}}a.brand img{vertical-align: middle; padding: 0 8px 0 0; width: 250px;}@media screen and (max-width: 480px){a.brand img{width: 220px !important;}}@media screen and (max-width: 480px){.container-content{padding: 15px 20px; font-size: 12px !important;} .email-footer{font-size: 12px !important;}}.container-content table{border-collapse: collapse;}.container-content table tr td p{margin: 5px;}.container-content table tr td p span{font-weight: bold; padding: 0 3px 0 0;}@media screen and (max-width: 480px){a.btn-view-reports{margin: 25px auto 10px;}}a.btn-view-reports:hover{background: grey; color: #fff;}.email-footer p{text-align: center; font-size: 12px; color: grey;}.email-footer p a{color: blue; cursor: pointer;}.email-footer p a:hover{color: grey;} \t</style> </head> <body><center>\n\t\t\t\t\t\t\t\t\t\tIf you have difficulties viewing this mail, click\n\t\t\t\t\t\t\t\t\t\t<a href=\"https://nightly.capillary.in/business_controller/campaigns/emails/links/view.php?utrack={{user_id_b64}}&mtrack={{outbox_id_b64}}\" style = \"text-decoration: underline;color: #369;\" target=\"_blank\">here</a><br/>\n\t\t\t\t\t\t\t\t\t</center> <table class=\"container-main\" style=\"background:#eeeeee; color:#000000; font-family:'Open Sans',sans-serif; font-size:16px; font-weight:400; margin:0 auto; max-width:978px; padding:15px; width:100%\"> \t<tbody> \t\t<tr> \t\t\t<td> \t\t\t<table class=\"email-header\" style=\"background:#ffffff; margin:0 0 5px; padding:17px 0; width:100%\"> \t\t\t\t<tbody> \t\t\t\t\t<tr> \t\t\t\t\t\t<td style=\"width:100%\"><a class=\"brand\" href=\"#\" style=\"display: table; margin: 0 auto; text-decoration: none; font-size: 37px; color: grey;\"><CapImage alt=\"Capillary Technologies\" src=\"https://s3.amazonaws.com/fileservice.in/intouch_creative_assets/60221e2020ba572f6787.png\" /> </a></td> \t\t\t\t\t</tr> \t\t\t\t</tbody> \t\t\t</table> \t\t\t<div class=\"container-content\" style=\"background:#ffffff; padding:20px 35px\"> \t\t\t<p>Hi Ashish Karan,</p> \t\t\t<p>You've received a new scheduled report. {{unsubscribe}}</p> \t\t\t<table> \t\t\t\t<tbody> \t\t\t\t\t<tr> \t\t\t\t\t\t<td><strong>Org Name: </strong></td> \t\t\t\t\t\t<td> \t\t\t\t\t\t<p>autotest1</p> \t\t\t\t\t\t</td> \t\t\t\t\t</tr> \t\t\t\t\t<tr> \t\t\t\t\t\t<td><strong>Scheduled Name: </strong></td> \t\t\t\t\t\t<td> \t\t\t\t\t\t<p>Schedule Test</p> \t\t\t\t\t\t</td> \t\t\t\t\t</tr> \t\t\t\t\t<tr> \t\t\t\t\t\t<td><strong>Time Period: </strong></td> \t\t\t\t\t\t<td> \t\t\t\t\t\t<p>1st Jan, 2017 to 24th Sep, 2017</p> \t\t\t\t\t\t</td> \t\t\t\t\t</tr> \t\t\t\t\t<tr> \t\t\t\t\t\t<td><strong>Report Name: </strong></td> \t\t\t\t\t\t<td> \t\t\t\t\t\t<p>redDart Report</p> \t\t\t\t\t\t</td> \t\t\t\t\t</tr> \t\t\t\t</tbody> \t\t\t</table> \t\t\t<p style=\"font-size:15px; margin-top:25px\">By clicking "View Report" you will be redirected to Capillary Analytics to view the automated report.</p> \t\t\t<a href=\"https://nightly.capillary.in/analytics/v2/report/59c37820e626a10df78c8d91?snapshot=59c8bce750f4e75ec8b0d24c\" style=\"background: #009e0f; text-align: center; color: #fff; font-size: 16px; padding: 10px 25px; cursor: pointer; text-decoration: none; display: block; width: 120px; margin: 25px auto 15px;\" target=\"_blank\">View Report</a></div> \t\t\t<div class=\"email-footer\"> \t\t\t<p style=\"color:grey; font-size:12px; text-align:center\">You've received this mail because you subscribed to Schedule Test schedule of redDart Report. <a href=\"https://nightly.capillary.in/analytics/v2/report/59c37820e626a10df78c8d91/schedule/59c8bce750f4e75ec8b0d24c/unsubscribeSchedule\" style=\"color: blue; cursor: pointer;\" target=\"_blank\">Unsubscribe</a></p> \t\t\t<p><a href=\"http://capillarytech.com/privacy-policy/\" target=\"_blank\">Privacy Policy</a> | <a href=\"http://capillarytech.com/about-us/\" target=\"_blank\">About Capillary</a></p> \t\t\t</div> \t\t\t</td> \t\t</tr> \t</tbody> </table> </body> </html> ","secondary_template_id":"9500","is_base_template":1,"language_name":"English","language":"English","lang_id":"69"}],"edit":true,"tags":[]};
|
|
2145
|
-
// const data = {edit: true, "base":{"subject":"testsubject","html_content":"<html> <head> \t<meta charset=\"utf-8\" /> \t<title>Aster Secure</title> \t<style type=\"text/css\">#outlook a { padding: 0; } body { width: 100% !important; -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; margin: 0; padding: 0;} .ExternalClass { width: 100%; } .ExternalClass, .ExternalClass p, .ExternalClass span, .ExternalClass font, .ExternalClass td, .ExternalClass div { line-height: 100%; } #backgroundTable { margin: 0; padding: 0; width: 100% !important; line-height: 100% !important; } img { outline: none; text-decoration: none; border: none; -ms-interpolation-mode: bicubic; } a img { border: none; } .image_fix { display: block; } p { margin: 0px 0px !important; } table td { border-collapse: collapse; } table { border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt; } table[class=full] { width: 100%; clear: both; } table[class=spacetable] { height: 176px; } table[class=spacetable1] { height: 431px; } table[class=spacetable2] { height: 50px; } table[class=spacetable3] { height: 55px; } \t @media only screen and (min-width: 320px) and (max-width: 540px) { a[href^=\"tel\"], a[href^=\"sms\"] { text-decoration: none; color: #ffffff; pointer-events: none; cursor: default; } .mobile_link a[href^=\"tel\"], .mobile_link a[href^=\"sms\"] { text-decoration: default; color: #ffffff !important; pointer-events: auto; cursor: default; } img[class=logo] { width: 132px!important; } img[class=shop] { width:53px!important; text-align: center!important; } table[class=innerlayer] { width: 300px !important; text-align: center; } img[class=spot] { width: 65px!important; } img[class=banner] { width: 290px !important; text-align: center; } img[class=banner1] { width: 229px!important; } img[class=click] { width:55px!important; } img[class=border] { width: 290px!important; } td[class=txtfont] { font-size:11px!important; height:50px!important; line-height: 15px!important; } \t span[class=txtfont] { font-size:9px!important; height:98px!important; line-height:23px!important; } \t td[class=txtfont1] { font-size:11px!important; height:40px!important; line-height: 14px!important; } img[class=left] { width:195px!important; } img[class=right] { width:46px!important; } \t \t td[class=txtfont3] { font-size:8px!important;} \ttd[class=txtfont2] { font-size:6px!important; line-height:9px!important; } td[class=txtbold] { font-size: 21px!important; } img[class=gap] { width:92px!important; } img[class=gap1] { width: 20px!important; } table[class=social] { width: 99% !important; } img[class=fb] { width:20px!important; } img[class=in] { width:21px!important; } img[class=tw] { width:20px!important; } img[class=pin] { width:41px!important; } \t img[class=and] { width:81px!important; } img[class=my] { width: 44px!important; } \t img[class=you] { width:21px!important; } img[class=store] { width:65px!important; } \t \t img[class=snap] { width:24px!important; } td[class=textlen] { height:52px!important; } \ttd[class=tdlen] \t{ \theight:35px!important;font-size: 10px !important; \t} \t\t\timg[class=a] { width: 42px!important; } \t\t\timg[class=b] { width: 22px!important; } \t\t\timg[class=c] { width: 72px!important; } \t\t\timg[class=d] { width: 50px!important; } \t\t\timg[class=e] { width: 56px!important; } \t\t\timg[class=f] { width: 56px!important; } \t\t\t} \t</style> </head> <body><center>\n\t\t\t\t\t\t\t\t\t\tIf you have difficulties viewing this mail, click\n\t\t\t\t\t\t\t\t\t\t<a href=\"https://nightly.capillary.in/business_controller/campaigns/emails/links/view.php?utrack={{user_id_b64}}&mtrack={{outbox_id_b64}}\" style = \"text-decoration: underline;color: #369;\" target=\"_blank\">here</a><br/>\n\t\t\t\t\t\t\t\t\t</center> <table align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"outerlayer\" style=\"width:650px\"> \t<tbody> \t\t<tr> \t\t\t<td> \t\t\t<table align=\"center\" bgcolor=\"#fff\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"outerlayer\" style=\"width:650px\"> \t\t\t\t<tbody> \t\t\t\t\t<tr> \t\t\t\t\t\t<td class=\"txtfont2\" height=\"40\" style=\"font-family: Verdana, Geneva, sans-serif; text-align:center; font-size:11px; color:gray; line-height:13px;\" width=\"600\">Shop at Aster Pharmacy this month and You could be the next lucky winner!</td> \t\t\t\t\t</tr> \t\t\t\t\t<tr> \t\t\t\t\t\t<td><a href=\"#\" style=\"pointer-events:none;\"><CapImage class=\"banner\" src=\"https://s3-eu-west-1.amazonaws.com/fs.capillary.eu/intouch_creative_assets/890bdffee3b2322d8ec7.jpg\" style=\"border:none; display:block\" /></a></td> \t\t\t\t\t</tr> \t\t\t\t\t<tr> \t\t\t\t\t\t<td class=\"txtfont2\" height=\"40\" style=\"font-family: Verdana, Geneva, sans-serif; text-align:center; font-size:11px; color:gray; line-height:13px;\" width=\"600\">To remove your email address from our mailing list , please click on {{unsubscribe}}</td> \t\t\t\t\t</tr> \t\t\t\t</tbody> \t\t\t</table> \t\t\t</td> \t\t</tr> \t</tbody> </table> </body> </html> ","is_drag_drop":0,"drag_drop_id":null},"secondary_templates":[{"is_preview_generated":null,"preview_url":null,"is_favourite":null,"is_drag_drop":false,"drag_drop_id":null,"scope":null,"tag":null,"is_default":null,"html_content":"<html>\r\n<head>\r\n\t<meta charset=\"utf-8\" />\r\n\t<title>Aster Secure</title>\r\n\t<style type=\"text/css\">#outlook a { padding: 0; } body { width: 100% !important; -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; margin: 0; padding: 0;} .ExternalClass { width: 100%; } .ExternalClass, .ExternalClass p, .ExternalClass span, .ExternalClass font, .ExternalClass td, .ExternalClass div { line-height: 100%; } #backgroundTable { margin: 0; padding: 0; width: 100% !important; line-height: 100% !important; } img { outline: none; text-decoration: none; border: none; -ms-interpolation-mode: bicubic; } a img { border: none; } .image_fix { display: block; } p { margin: 0px 0px !important; } table td { border-collapse: collapse; } table { border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt; } table[class=full] { width: 100%; clear: both; } table[class=spacetable] { height: 176px; } table[class=spacetable1] { height: 431px; } table[class=spacetable2] { height: 50px; } table[class=spacetable3] { height: 55px; } \t @media only screen and (min-width: 320px) and (max-width: 540px) { a[href^=\"tel\"], a[href^=\"sms\"] { text-decoration: none; color: #ffffff; pointer-events: none; cursor: default; } .mobile_link a[href^=\"tel\"], .mobile_link a[href^=\"sms\"] { text-decoration: default; color: #ffffff !important; pointer-events: auto; cursor: default; } img[class=logo] { width: 132px!important; } img[class=shop] { width:53px!important; text-align: center!important; } table[class=innerlayer] { width: 300px !important; text-align: center; } img[class=spot] { width: 65px!important; } img[class=banner] { width: 290px !important; text-align: center; } img[class=banner1] { width: 229px!important; } img[class=click] { width:55px!important; } img[class=border] { width: 290px!important; } td[class=txtfont] { font-size:11px!important; height:50px!important; line-height: 15px!important; } \t span[class=txtfont] { font-size:9px!important; height:98px!important; line-height:23px!important; } \t td[class=txtfont1] { font-size:11px!important; height:40px!important; line-height: 14px!important; } img[class=left] { width:195px!important; } img[class=right] { width:46px!important; } \t \t td[class=txtfont3] { font-size:8px!important;} \ttd[class=txtfont2] { font-size:6px!important; line-height:9px!important; } td[class=txtbold] { font-size: 21px!important; } img[class=gap] { width:92px!important; } img[class=gap1] { width: 20px!important; } table[class=social] { width: 99% !important; } img[class=fb] { width:20px!important; } img[class=in] { width:21px!important; } img[class=tw] { width:20px!important; } img[class=pin] { width:41px!important; } \t img[class=and] { width:81px!important; } img[class=my] { width: 44px!important; } \t img[class=you] { width:21px!important; } img[class=store] { width:65px!important; } \t \t img[class=snap] { width:24px!important; } td[class=textlen] { height:52px!important; } \ttd[class=tdlen] \t{ \theight:35px!important;font-size: 10px !important; \t} \t\t\timg[class=a] { width: 42px!important; } \t\t\timg[class=b] { width: 22px!important; } \t\t\timg[class=c] { width: 72px!important; } \t\t\timg[class=d] { width: 50px!important; } \t\t\timg[class=e] { width: 56px!important; } \t\t\timg[class=f] { width: 56px!important; } \t\t\t}\r\n\t</style>\r\n</head>\r\n<body>\r\n<table align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"outerlayer\" style=\"width:650px\">\r\n\t<tbody>\r\n\t\t<tr>\r\n\t\t\t<td>\r\n\t\t\t<table align=\"center\" bgcolor=\"#fff\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"outerlayer\" style=\"width:650px\">\r\n\t\t\t\t<tbody>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<td class=\"txtfont2\" height=\"40\" style=\"font-family: Verdana, Geneva, sans-serif; text-align:center; font-size:11px; color:gray; line-height:13px;\" width=\"600\">Shop at Aster Pharmacy this month and You could be the next lucky winner!</td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<td><a href=\"#\" style=\"pointer-events:none;\"><CapImage class=\"banner\" src=\"https://s3-eu-west-1.amazonaws.com/fs.capillary.eu/intouch_creative_assets/890bdffee3b2322d8ec7.jpg\" style=\"border:none; display:block\" /></a></td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<td class=\"txtfont2\" height=\"40\" style=\"font-family: Verdana, Geneva, sans-serif; text-align:center; font-size:11px; color:gray; line-height:13px;\" width=\"600\">To remove your email address from our mailing list , please click on {{unsubscribe}}</td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t</tbody>\r\n\t\t\t</table>\r\n\t\t\t</td>\r\n\t\t</tr>\r\n\t</tbody>\r\n</table>\r\n</body>\r\n</html>\r\n","secondary_template_id":"9584","is_base_template":1,"language_name":"English","language":"English","lang_id":"69"}, {"is_preview_generated":null,"preview_url":null,"is_favourite":null,"is_drag_drop":1,"drag_drop_id":"55acf47048a85bbf7681a35a","scope":null,"tag":null,"is_default":null,"html_content":"","secondary_template_id":"9500","is_base_template":0,"language_name":"Japanese","language":"Japanese","lang_id":"100"}]};
|
|
2110
|
+
// const data = {edit: true, "base":{"subject":"testsubject","html_content":"<html> <head> \t<meta charset=\"utf-8\" /> \t<title>Aster Secure</title> \t<style type=\"text/css\">#outlook a { padding: 0; } body { width: 100% !important; -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; margin: 0; padding: 0;} .ExternalClass { width: 100%; } .ExternalClass, .ExternalClass p, .ExternalClass span, .ExternalClass font, .ExternalClass td, .ExternalClass div { line-height: 100%; } #backgroundTable { margin: 0; padding: 0; width: 100% !important; line-height: 100% !important; } img { outline: none; text-decoration: none; border: none; -ms-interpolation-mode: bicubic; } a img { border: none; } .image_fix { display: block; } p { margin: 0px 0px !important; } table td { border-collapse: collapse; } table { border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt; } table[class=full] { width: 100%; clear: both; } table[class=spacetable] { height: 176px; } table[class=spacetable1] { height: 431px; } table[class=spacetable2] { height: 50px; } table[class=spacetable3] { height: 55px; } \t @media only screen and (min-width: 320px) and (max-width: 540px) { a[href^=\"tel\"], a[href^=\"sms\"] { text-decoration: none; color: #ffffff; pointer-events: none; cursor: default; } .mobile_link a[href^=\"tel\"], .mobile_link a[href^=\"sms\"] { text-decoration: default; color: #ffffff !important; pointer-events: auto; cursor: default; } img[class=logo] { width: 132px!important; } img[class=shop] { width:53px!important; text-align: center!important; } table[class=innerlayer] { width: 300px !important; text-align: center; } img[class=spot] { width: 65px!important; } img[class=banner] { width: 290px !important; text-align: center; } img[class=banner1] { width: 229px!important; } img[class=click] { width:55px!important; } img[class=border] { width: 290px!important; } td[class=txtfont] { font-size:11px!important; height:50px!important; line-height: 15px!important; } \t span[class=txtfont] { font-size:9px!important; height:98px!important; line-height:23px!important; } \t td[class=txtfont1] { font-size:11px!important; height:40px!important; line-height: 14px!important; } img[class=left] { width:195px!important; } img[class=right] { width:46px!important; } \t \t td[class=txtfont3] { font-size:8px!important;} \ttd[class=txtfont2] { font-size:6px!important; line-height:9px!important; } td[class=txtbold] { font-size: 21px!important; } img[class=gap] { width:92px!important; } img[class=gap1] { width: 20px!important; } table[class=social] { width: 99% !important; } img[class=fb] { width:20px!important; } img[class=in] { width:21px!important; } img[class=tw] { width:20px!important; } img[class=pin] { width:41px!important; } \t img[class=and] { width:81px!important; } img[class=my] { width: 44px!important; } \t img[class=you] { width:21px!important; } img[class=store] { width:65px!important; } \t \t img[class=snap] { width:24px!important; } td[class=textlen] { height:52px!important; } \ttd[class=tdlen] \t{ \theight:35px!important;font-size: 10px !important; \t} \t\t\timg[class=a] { width: 42px!important; } \t\t\timg[class=b] { width: 22px!important; } \t\t\timg[class=c] { width: 72px!important; } \t\t\timg[class=d] { width: 50px!important; } \t\t\timg[class=e] { width: 56px!important; } \t\t\timg[class=f] { width: 56px!important; } \t\t\t} \t</style> </head> <body><center>\n\t\t\t\t\t\t\t\t\t\tIf you have difficulties viewing this mail, click\n\t\t\t\t\t\t\t\t\t\t<a href=\"https://nightly.capillary.in/business_controller/campaigns/emails/links/view.php?utrack={{user_id_b64}}&mtrack={{outbox_id_b64}}\" style = \"text-decoration: underline;color: #369;\" target=\"_blank\">here</a><br/>\n\t\t\t\t\t\t\t\t\t</center> <table align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"outerlayer\" style=\"width:650px\"> \t<tbody> \t\t<tr> \t\t\t<td> \t\t\t<table align=\"center\" bgcolor=\"#fff\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"outerlayer\" style=\"width:650px\"> \t\t\t\t<tbody> \t\t\t\t\t<tr> \t\t\t\t\t\t<td class=\"txtfont2\" height=\"40\" style=\"font-family: Verdana, Geneva, sans-serif; text-align:center; font-size:11px; color:gray; line-height:13px;\" width=\"600\">Shop at Aster Pharmacy this month and You could be the next lucky winner!</td> \t\t\t\t\t</tr> \t\t\t\t\t<tr> \t\t\t\t\t\t<td><a href=\"#\" style=\"pointer-events:none;\"><CapImage class=\"banner\" src=\"https://s3-eu-west-1.amazonaws.com/fs.capillary.eu/intouch_creative_assets/890bdffee3b2322d8ec7.jpg\" style=\"border:none; display:block\" /></a></td> \t\t\t\t\t</tr> \t\t\t\t\t<tr> \t\t\t\t\t\t<td class=\"txtfont2\" height=\"40\" style=\"font-family: Verdana, Geneva, sans-serif; text-align:center; font-size:11px; color:gray; line-height:13px;\" width=\"600\">To remove your email address from our mailing list , please click on {{unsubscribe}}</td> \t\t\t\t\t</tr> \t\t\t\t</tbody> \t\t\t</table> \t\t\t</td> \t\t</tr> \t</tbody> </table> </body> </html> ","is_drag_drop":0,"drag_drop_id":null},"secondary_templates":[{"is_preview_generated":null,"preview_url":null,"is_favourite":null,"is_drag_drop":false,"drag_drop_id":null,"scope":null,"tag":null,"is_default":null,"html_content":"<html>\r\n<head>\r\n\t<meta charset=\"utf-8\" />\r\n\t<title>Aster Secure</title>\r\n\t<style type=\"text/css\">#outlook a { padding: 0; } body { width: 100% !important; -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; margin: 0; padding: 0;} .ExternalClass { width: 100%; } .ExternalClass, .ExternalClass p, .ExternalClass span, .ExternalClass font, .ExternalClass td, .ExternalClass div { line-height: 100%; } #backgroundTable { margin: 0; padding: 0; width: 100% !important; line-height: 100% !important; } img { outline: none; text-decoration: none; border: none; -ms-interpolation-mode: bicubic; } a img { border: none; } .image_fix { display: block; } p { margin: 0px 0px !important; } table td { border-collapse: collapse; } table { border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt; } table[class=full] { width: 100%; clear: both; } table[class=spacetable] { height: 176px; } table[class=spacetable1] { height: 431px; } table[class=spacetable2] { height: 50px; } table[class=spacetable3] { height: 55px; } \t @media only screen and (min-width: 320px) and (max-width: 540px) { a[href^=\"tel\"], a[href^=\"sms\"] { text-decoration: none; color: #ffffff; pointer-events: none; cursor: default; } .mobile_link a[href^=\"tel\"], .mobile_link a[href^=\"sms\"] { text-decoration: default; color: #ffffff !important; pointer-events: auto; cursor: default; } img[class=logo] { width: 132px!important; } img[class=shop] { width:53px!important; text-align: center!important; } table[class=innerlayer] { width: 300px !important; text-align: center; } img[class=spot] { width: 65px!important; } img[class=banner] { width: 290px !important; text-align: center; } img[class=banner1] { width: 229px!important; } img[class=click] { width:55px!important; } img[class=border] { width: 290px!important; } td[class=txtfont] { font-size:11px!important; height:50px!important; line-height: 15px!important; } \t span[class=txtfont] { font-size:9px!important; height:98px!important; line-height:23px!important; } \t td[class=txtfont1] { font-size:11px!important; height:40px!important; line-height: 14px!important; } img[class=left] { width:195px!important; } img[class=right] { width:46px!important; } \t \t td[class=txtfont3] { font-size:8px!important;} \ttd[class=txtfont2] { font-size:6px!important; line-height:9px!important; } td[class=txtbold] { font-size: 21px!important; } img[class=gap] { width:92px!important; } img[class=gap1] { width: 20px!important; } table[class=social] { width: 99% !important; } img[class=fb] { width:20px!important; } img[class=in] { width:21px!important; } img[class=tw] { width:20px!important; } img[class=pin] { width:41px!important; } \t img[class=and] { width:81px!important; } img[class=my] { width: 44px!important; } \t img[class=you] { width:21px!important; } img[class=store] { width:65px!important; } \t \t img[class=snap] { width:24px!important; } td[class=textlen] { height:52px!important; } \ttd[class=tdlen] \t{ \theight:35px!important;font-size: 10px !important; \t} \t\t\timg[class=a] { width: 42px!important; } \t\t\timg[class=b] { width: 22px!important; } \t\t\timg[class=c] { width: 72px!important; } \t\t\timg[class=d] { width: 50px!important; } \t\t\timg[class=e] { width: 56px!important; } \t\t\timg[class=f] { width: 56px!important; } \t\t\t}\r\n\t</style>\r\n</head>\r\n<body>\r\n<table align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"outerlayer\" style=\"width:650px\">\r\n\t<tbody>\r\n\t\t<tr>\r\n\t\t\t<td>\r\n\t\t\t<table align=\"center\" bgcolor=\"#fff\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"outerlayer\" style=\"width:650px\">\r\n\t\t\t\t<tbody>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<td class=\"txtfont2\" height=\"40\" style=\"font-family: Verdana, Geneva, sans-serif; text-align:center; font-size:11px; color:gray; line-height:13px;\" width=\"600\">Shop at Aster Pharmacy this month and You could be the next lucky winner!</td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<td><a href=\"#\" style=\"pointer-events:none;\"><CapImage class=\"banner\" src=\"https://s3-eu-west-1.amazonaws.com/fs.capillary.eu/intouch_creative_assets/890bdffee3b2322d8ec7.jpg\" style=\"border:none; display:block\" /></a></td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<td class=\"txtfont2\" height=\"40\" style=\"font-family: Verdana, Geneva, sans-serif; text-align:center; font-size:11px; color:gray; line-height:13px;\" width=\"600\">To remove your email address from our mailing list , please click on {{unsubscribe}}</td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t</tbody>\r\n\t\t\t</table>\r\n\t\t\t</td>\r\n\t\t</tr>\r\n\t</tbody>\r\n</table>\r\n</body>\r\n</html>\r\n","secondary_template_id":"9584","is_base_template":1,"language_name":"English","language":"English","lang_id":"69"}, {"is_preview_generated":null,"preview_url":null,"is_favourite":null,"is_drag_drop":false,"drag_drop_id":null,"scope":null,"tag":null,"is_default":null,"html_content":"<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\"> <html> <head> \t<title>Scheduled Report</title> \t<meta http-equiv=\"Content-Type\" content=\"text/html charset=UTF-8\"/> \t<style type=\"text/css\">.container-main p{line-height: 1.6;}@media screen and (max-width: 480px){a.brand{font-size: 35px;}}@media screen and (max-width: 480px){.container-main a{text-align: center;}a.brand{text-align: center;}}a.brand img{vertical-align: middle; padding: 0 8px 0 0; width: 250px;}@media screen and (max-width: 480px){a.brand img{width: 220px !important;}}@media screen and (max-width: 480px){.container-content{padding: 15px 20px; font-size: 12px !important;} .email-footer{font-size: 12px !important;}}.container-content table{border-collapse: collapse;}.container-content table tr td p{margin: 5px;}.container-content table tr td p span{font-weight: bold; padding: 0 3px 0 0;}@media screen and (max-width: 480px){a.btn-view-reports{margin: 25px auto 10px;}}a.btn-view-reports:hover{background: grey; color: #fff;}.email-footer p{text-align: center; font-size: 12px; color: grey;}.email-footer p a{color: blue; cursor: pointer;}.email-footer p a:hover{color: grey;} \t</style> </head> <body><center>\n\t\t\t\t\t\t\t\t\t\tIf you have difficulties viewing this mail, click\n\t\t\t\t\t\t\t\t\t\t<a href=\"https://nightly.capillary.in/business_controller/campaigns/emails/links/view.php?utrack={{user_id_b64}}&mtrack={{outbox_id_b64}}\" style = \"text-decoration: underline;color: #369;\" target=\"_blank\">here</a><br/>\n\t\t\t\t\t\t\t\t\t</center> <table class=\"container-main\" style=\"background:#eeeeee; color:#000000; font-family:'Open Sans',sans-serif; font-size:16px; font-weight:400; margin:0 auto; max-width:978px; padding:15px; width:100%\"> \t<tbody> \t\t<tr> \t\t\t<td> \t\t\t<table class=\"email-header\" style=\"background:#ffffff; margin:0 0 5px; padding:17px 0; width:100%\"> \t\t\t\t<tbody> \t\t\t\t\t<tr> \t\t\t\t\t\t<td style=\"width:100%\"><a class=\"brand\" href=\"#\" style=\"display: table; margin: 0 auto; text-decoration: none; font-size: 37px; color: grey;\"><CapImage alt=\"Capillary Technologies\" src=\"https://s3.amazonaws.com/fileservice.in/intouch_creative_assets/60221e2020ba572f6787.png\" /> </a></td> \t\t\t\t\t</tr> \t\t\t\t</tbody> \t\t\t</table> \t\t\t<div class=\"container-content\" style=\"background:#ffffff; padding:20px 35px\"> \t\t\t<p>Hi Ashish Karan,</p> \t\t\t<p>You've received a new scheduled report. {{unsubscribe}}</p> \t\t\t<table> \t\t\t\t<tbody> \t\t\t\t\t<tr> \t\t\t\t\t\t<td><strong>Org Name: </strong></td> \t\t\t\t\t\t<td> \t\t\t\t\t\t<p>autotest1</p> \t\t\t\t\t\t</td> \t\t\t\t\t</tr> \t\t\t\t\t<tr> \t\t\t\t\t\t<td><strong>Scheduled Name: </strong></td> \t\t\t\t\t\t<td> \t\t\t\t\t\t<p>Schedule Test</p> \t\t\t\t\t\t</td> \t\t\t\t\t</tr> \t\t\t\t\t<tr> \t\t\t\t\t\t<td><strong>Time Period: </strong></td> \t\t\t\t\t\t<td> \t\t\t\t\t\t<p>1st Jan, 2017 to 24th Sep, 2017</p> \t\t\t\t\t\t</td> \t\t\t\t\t</tr> \t\t\t\t\t<tr> \t\t\t\t\t\t<td><strong>Report Name: </strong></td> \t\t\t\t\t\t<td> \t\t\t\t\t\t<p>redDart Report</p> \t\t\t\t\t\t</td> \t\t\t\t\t</tr> \t\t\t\t</tbody> \t\t\t</table> \t\t\t<p style=\"font-size:15px; margin-top:25px\">By clicking "View Report" you will be redirected to Capillary Analytics to view the automated report.</p> \t\t\t<a href=\"https://nightly.capillary.in/analytics/v2/report/59c37820e626a10df78c8d91?snapshot=59c8bce750f4e75ec8b0d24c\" style=\"background: #009e0f; text-align: center; color: #fff; font-size: 16px; padding: 10px 25px; cursor: pointer; text-decoration: none; display: block; width: 120px; margin: 25px auto 15px;\" target=\"_blank\">View Report</a></div> \t\t\t<div class=\"email-footer\"> \t\t\t<p style=\"color:grey; font-size:12px; text-align:center\">You've received this mail because you subscribed to Schedule Test schedule of redDart Report. <a href=\"https://nightly.capillary.in/analytics/v2/report/59c37820e626a10df78c8d91/schedule/59c8bce750f4e75ec8b0d24c/unsubscribeSchedule\" style=\"color: blue; cursor: pointer;\" target=\"_blank\">Unsubscribe</a></p> \t\t\t<p><a href=\"http://capillarytech.com/privacy-policy/\" target=\"_blank\">Privacy Policy</a> | <a href=\"http://capillarytech.com/about-us/\" target=\"_blank\">About Capillary</a></p> \t\t\t</div> \t\t\t</td> \t\t</tr> \t</tbody> </table> </body> </html> ","secondary_template_id":"9500","is_base_template":false,"language_name":"Hindi","language":"Hindi","lang_id":"151"},{"is_preview_generated":null,"preview_url":null,"is_favourite":null,"is_drag_drop":1,"drag_drop_id":"55acf47048a85bbf7681a35a","scope":null,"tag":null,"is_default":null,"html_content":"","secondary_template_id":"9500","is_base_template":0,"language_name":"Japanese","language":"Japanese","lang_id":"100"}]};
|
|
2146
2111
|
|
|
2147
2112
|
if (data && data.edit) {
|
|
2148
2113
|
// const formData = {'0': {}};
|
|
@@ -2506,39 +2471,9 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
2506
2471
|
const formData = _.cloneDeep(this.state.formData);
|
|
2507
2472
|
const activeLangTab = formData[`${this.state.currentTab - 1}`].activeTab;
|
|
2508
2473
|
const langIndex = formData[`${this.state.currentTab - 1}`].selectedLanguages.indexOf(activeLangTab);
|
|
2509
|
-
|
|
2510
|
-
// Store current content before switching
|
|
2511
|
-
const currentContent = formData[`${this.state.currentTab - 1}`][activeLangTab]['template-content'];
|
|
2512
|
-
|
|
2513
|
-
// Update formData to mark as not drag-drop
|
|
2514
|
-
formData[`${this.state.currentTab - 1}`][activeLangTab].is_drag_drop = false;
|
|
2515
|
-
if (formData[`${this.state.currentTab - 1}`].base) {
|
|
2516
|
-
formData.base[activeLangTab].is_drag_drop = false;
|
|
2517
|
-
}
|
|
2518
|
-
|
|
2519
|
-
this.setState({
|
|
2520
|
-
mode: "switchEditor",
|
|
2521
|
-
formData
|
|
2522
|
-
}, () => {
|
|
2523
|
-
// No need to call handleEdmSave as we're switching to CKEditor
|
|
2524
|
-
let schema = _.cloneDeep(this.state.schema);
|
|
2525
|
-
_.forEach(schema.containers, (container, index) => {
|
|
2526
|
-
if (parseInt(index, 10) === (this.state.currentTab - 1)) {
|
|
2527
|
-
const temp = container;
|
|
2528
|
-
const langTab = formData[`${this.state.currentTab - 1}`].selectedLanguages.indexOf(activeLangTab);
|
|
2529
|
-
|
|
2530
|
-
temp.panes[langTab].sections[0].inputFields[0].cols[0].colStyle = {display: ""};
|
|
2531
|
-
temp.panes[langTab].sections[0].inputFields[0].cols[1].colStyle = {display: "none"};
|
|
2532
|
-
temp.tabBarExtraContent.sections[0].inputFields[0].cols[4].colStyle.display = "none";
|
|
2533
|
-
}
|
|
2534
|
-
});
|
|
2535
|
-
schema = this.showInsertImageButton(schema);
|
|
2536
2474
|
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
showConfirmationModal: false,
|
|
2540
|
-
isSchemaChanged: true
|
|
2541
|
-
});
|
|
2475
|
+
this.setState({mode: "switchEditor"}, () => {
|
|
2476
|
+
this.handleEdmSave();
|
|
2542
2477
|
});
|
|
2543
2478
|
}
|
|
2544
2479
|
|
|
@@ -2713,24 +2648,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
2713
2648
|
formData[0][selectedLanguages[0]]['template-content'];
|
|
2714
2649
|
const previewSubject = formData['template-subject'];
|
|
2715
2650
|
const testOrPreviewProps = {channel: EMAIL, content: previewContent, subject: previewSubject};
|
|
2716
|
-
|
|
2717
|
-
// Call our handler instead of the props methods to set the flag
|
|
2718
|
-
const handleClick = () => {
|
|
2719
|
-
console.log('🖱️ Button clicked - action:', action);
|
|
2720
|
-
if (action === 'TEST') {
|
|
2721
|
-
console.log('🔓 TEST button clicked - calling handleTestAndPreview');
|
|
2722
|
-
// For test action, open our Test & Preview slidebox
|
|
2723
|
-
this.handleTestAndPreview();
|
|
2724
|
-
} else {
|
|
2725
|
-
console.log('👁️ PREVIEW button clicked - calling onPreviewContentClicked');
|
|
2726
|
-
// For preview action, call the original method
|
|
2727
|
-
const { onPreviewContentClicked } = this.props;
|
|
2728
|
-
if (onPreviewContentClicked) {
|
|
2729
|
-
onPreviewContentClicked(testOrPreviewProps);
|
|
2730
|
-
}
|
|
2731
|
-
}
|
|
2732
|
-
};
|
|
2733
|
-
|
|
2651
|
+
const { onPreviewContentClicked, onTestContentClicked } = this.props;
|
|
2734
2652
|
return (
|
|
2735
2653
|
<CapButton
|
|
2736
2654
|
style={{
|
|
@@ -2739,7 +2657,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
2739
2657
|
padding: '0 6px',
|
|
2740
2658
|
}}
|
|
2741
2659
|
type="flat"
|
|
2742
|
-
onClick={
|
|
2660
|
+
onClick={() => action === 'PREVIEW' ? onPreviewContentClicked(testOrPreviewProps) : onTestContentClicked(testOrPreviewProps)}
|
|
2743
2661
|
>
|
|
2744
2662
|
<CapIcon type={action === 'PREVIEW' ? "eye" : "lab"}/>
|
|
2745
2663
|
{action === 'PREVIEW' ? <FormattedMessage {...messages.preview} /> : <FormattedMessage {...messages.testMessage} />}
|
|
@@ -2750,29 +2668,23 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
2750
2668
|
this.beeInstance = instance;
|
|
2751
2669
|
}
|
|
2752
2670
|
saveBeeData = (json, html) => {
|
|
2753
|
-
// Update state with new content
|
|
2754
2671
|
this.setState((prevState) => {
|
|
2755
2672
|
const { currentTab, formData } = _.cloneDeep(prevState);
|
|
2756
2673
|
const activeTab = formData[currentTab - 1].activeTab;
|
|
2757
|
-
|
|
2758
|
-
// Update content in both formData and base
|
|
2759
2674
|
formData[currentTab - 1][activeTab]['template-content'] = html;
|
|
2760
2675
|
formData[currentTab - 1][activeTab]['json-content'] = json;
|
|
2676
|
+
|
|
2761
2677
|
formData.base[activeTab]['template-content'] = html;
|
|
2762
2678
|
formData.base[activeTab]['json-content'] = json;
|
|
2763
2679
|
|
|
2764
2680
|
return {
|
|
2765
2681
|
...prevState,
|
|
2766
2682
|
formData,
|
|
2767
|
-
content: html // Keep latest content in state
|
|
2768
2683
|
};
|
|
2769
2684
|
}, () => {
|
|
2770
|
-
|
|
2771
|
-
|
|
2772
|
-
this.setState({
|
|
2773
|
-
startValidation: true
|
|
2685
|
+
!this.props.showTestAndPreviewSlidebox && this.setState({
|
|
2686
|
+
startValidation: true,
|
|
2774
2687
|
});
|
|
2775
|
-
}
|
|
2776
2688
|
});
|
|
2777
2689
|
}
|
|
2778
2690
|
|
|
@@ -2785,7 +2697,6 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
2785
2697
|
const imagePreviewHeader = (<h3>{this.props.intl.formatMessage(messages.h3imageSelection)}</h3>);
|
|
2786
2698
|
const imagePreviewContent = this.getImagePreviewContent();
|
|
2787
2699
|
const { selectedOfferDetails, getDefaultTags, Email: { CmsSettings = {} } = {}, moduleType = '', showTestAndPreviewSlidebox, handleTestAndPreview, handleCloseTestAndPreview } = this.props;
|
|
2788
|
-
const testAndPreviewContent = this.getTemplateContent();
|
|
2789
2700
|
if (!this.props.currentOrgDetails || !this.props.currentOrgDetails.basic_details) {
|
|
2790
2701
|
return (<div>Loading...</div>);
|
|
2791
2702
|
}
|
|
@@ -2795,11 +2706,6 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
2795
2706
|
}
|
|
2796
2707
|
const { showImageSelectionBox = false } = this.state;
|
|
2797
2708
|
const showTestAndPreview = !showImageSelectionBox && getDefaultTags === 'outbound';
|
|
2798
|
-
console.log('🔍 showTestAndPreview conditions:', {
|
|
2799
|
-
showImageSelectionBox,
|
|
2800
|
-
getDefaultTags,
|
|
2801
|
-
showTestAndPreview
|
|
2802
|
-
});
|
|
2803
2709
|
return (
|
|
2804
2710
|
<div className="email-container">
|
|
2805
2711
|
<CapSpin spinning={isLoading}>
|
|
@@ -2863,7 +2769,6 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
2863
2769
|
eventContextTags={this.props?.eventContextTags}
|
|
2864
2770
|
forwardedTags={this.props?.forwardedTags}
|
|
2865
2771
|
isLoyaltyModule={this.props?.isLoyaltyModule}
|
|
2866
|
-
isTestAndPreviewMode={this.state.isTestAndPreviewMode} // Add flag to prevent validation
|
|
2867
2772
|
/> : ''}
|
|
2868
2773
|
</Col>
|
|
2869
2774
|
</Row>
|
|
@@ -2891,39 +2796,12 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
2891
2796
|
onClose={handleCloseTestAndPreview}
|
|
2892
2797
|
formData={this.state.formData}
|
|
2893
2798
|
beeInstance={this.beeInstance}
|
|
2894
|
-
content={
|
|
2799
|
+
content={this.getTemplateContent()}
|
|
2895
2800
|
currentChannel={EMAIL}
|
|
2896
|
-
currentTab={this.state.currentTab}
|
|
2897
2801
|
/>
|
|
2898
2802
|
</div>
|
|
2899
2803
|
);
|
|
2900
2804
|
}
|
|
2901
|
-
|
|
2902
|
-
handleCloseTestAndPreview = () => {
|
|
2903
|
-
console.log('🔒 Closing Test & Preview - setting isTestAndPreviewMode to false');
|
|
2904
|
-
this.setState({
|
|
2905
|
-
showTestAndPreviewSlidebox: false,
|
|
2906
|
-
isTestAndPreviewMode: false // Reset flag when closing
|
|
2907
|
-
});
|
|
2908
|
-
}
|
|
2909
|
-
|
|
2910
|
-
handleTestAndPreview = () => {
|
|
2911
|
-
console.log('🔓 handleTestAndPreview called - current isTestAndPreviewMode:', this.state.isTestAndPreviewMode);
|
|
2912
|
-
console.log('🔓 Setting isTestAndPreviewMode to true and opening slidebox');
|
|
2913
|
-
this.setState({
|
|
2914
|
-
showTestAndPreviewSlidebox: true,
|
|
2915
|
-
isTestAndPreviewMode: true // Set flag to prevent validation
|
|
2916
|
-
}, () => {
|
|
2917
|
-
console.log('🔓 State updated - new isTestAndPreviewMode:', this.state.isTestAndPreviewMode);
|
|
2918
|
-
});
|
|
2919
|
-
}
|
|
2920
|
-
|
|
2921
|
-
componentDidUpdate(prevProps, prevState) {
|
|
2922
|
-
// Debug flag changes
|
|
2923
|
-
if (prevState.isTestAndPreviewMode !== this.state.isTestAndPreviewMode) {
|
|
2924
|
-
console.log('🔄 isTestAndPreviewMode changed from', prevState.isTestAndPreviewMode, 'to', this.state.isTestAndPreviewMode);
|
|
2925
|
-
}
|
|
2926
|
-
}
|
|
2927
2805
|
}
|
|
2928
2806
|
|
|
2929
2807
|
Email.propTypes = {
|
|
@@ -55,7 +55,6 @@ const useEmailWrapper = ({
|
|
|
55
55
|
showTestAndPreviewSlidebox,
|
|
56
56
|
handleTestAndPreview,
|
|
57
57
|
handleCloseTestAndPreview,
|
|
58
|
-
isTestAndPreviewMode,
|
|
59
58
|
}) => {
|
|
60
59
|
// State management
|
|
61
60
|
const [templateName, setTemplateName] = useState('');
|
|
@@ -300,7 +299,6 @@ const useEmailWrapper = ({
|
|
|
300
299
|
showTestAndPreviewSlidebox,
|
|
301
300
|
handleTestAndPreview,
|
|
302
301
|
handleCloseTestAndPreview,
|
|
303
|
-
isTestAndPreviewMode,
|
|
304
302
|
}), [
|
|
305
303
|
setIsLoadingContent,
|
|
306
304
|
routeParams,
|
|
@@ -324,7 +322,6 @@ const useEmailWrapper = ({
|
|
|
324
322
|
showTestAndPreviewSlidebox,
|
|
325
323
|
handleTestAndPreview,
|
|
326
324
|
handleCloseTestAndPreview,
|
|
327
|
-
isTestAndPreviewMode,
|
|
328
325
|
]);
|
|
329
326
|
|
|
330
327
|
// Prepare props for CmsTemplatesComponent
|
|
@@ -61,7 +61,6 @@ const EmailWrapper = (props) => {
|
|
|
61
61
|
showTestAndPreviewSlidebox,
|
|
62
62
|
handleTestAndPreview,
|
|
63
63
|
handleCloseTestAndPreview,
|
|
64
|
-
isTestAndPreviewMode,
|
|
65
64
|
} = props;
|
|
66
65
|
|
|
67
66
|
// Pass destructured props to the custom hook
|
|
@@ -114,7 +113,6 @@ const EmailWrapper = (props) => {
|
|
|
114
113
|
showTestAndPreviewSlidebox,
|
|
115
114
|
handleTestAndPreview,
|
|
116
115
|
handleCloseTestAndPreview,
|
|
117
|
-
isTestAndPreviewMode,
|
|
118
116
|
});
|
|
119
117
|
|
|
120
118
|
// Render using the presentation component with data from the hook
|
|
@@ -176,10 +174,6 @@ EmailWrapper.propTypes = {
|
|
|
176
174
|
onPreviewContentClicked: PropTypes.func,
|
|
177
175
|
onTestContentClicked: PropTypes.func,
|
|
178
176
|
editor: PropTypes.object,
|
|
179
|
-
showTestAndPreviewSlidebox: PropTypes.bool,
|
|
180
|
-
handleTestAndPreview: PropTypes.func,
|
|
181
|
-
handleCloseTestAndPreview: PropTypes.func,
|
|
182
|
-
isTestAndPreviewMode: PropTypes.bool,
|
|
183
177
|
};
|
|
184
178
|
|
|
185
179
|
const mapStateToProps = createStructuredSelector({
|
|
@@ -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';
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import PropTypes from 'prop-types';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
// import styled from 'styled-components';
|
|
4
|
-
import { Link } from 'react-router';
|
|
5
|
-
import _ from 'lodash';
|
|
6
|
-
|
|
7
|
-
class BreadCrumbs extends React.Component { // eslint-disable-line react/prefer-stateless-function
|
|
8
|
-
constructor(props) {
|
|
9
|
-
super(props);
|
|
10
|
-
this.prepareBreadcrumbElement = this.prepareBreadcrumbElement.bind(this);
|
|
11
|
-
this.disabledBreadcrumb = this.disabledBreadcrumb.bind(this);
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
disabledBreadcrumb(e, location) {
|
|
15
|
-
if (location.disabled) {
|
|
16
|
-
e.preventDefault();
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
prepareBreadcrumbElement() {
|
|
21
|
-
const breadcrumbs = [];
|
|
22
|
-
_.forEach(this.props.locations, (location) => {
|
|
23
|
-
const titleText = (typeof location.text === 'string') ? location.text : location.text.props.defaultMessage;
|
|
24
|
-
const element = (
|
|
25
|
-
<Link
|
|
26
|
-
to={location.url}
|
|
27
|
-
key={titleText}
|
|
28
|
-
title={titleText}
|
|
29
|
-
onClick={(e) => this.disabledBreadcrumb(e, location)}
|
|
30
|
-
>
|
|
31
|
-
<span
|
|
32
|
-
className={location.disabled ? 'disabled-breadcrumb' : 'active-breadcrumb'}
|
|
33
|
-
disabled={location.disabled}
|
|
34
|
-
> {location.text}
|
|
35
|
-
</span>
|
|
36
|
-
</Link>
|
|
37
|
-
);
|
|
38
|
-
if (breadcrumbs.length !== 0) {
|
|
39
|
-
breadcrumbs.push(
|
|
40
|
-
<span
|
|
41
|
-
key={`${titleText}separator`}
|
|
42
|
-
> {this.props.separator ? this.props.separator : ' / '}
|
|
43
|
-
</span>
|
|
44
|
-
);
|
|
45
|
-
}
|
|
46
|
-
breadcrumbs.push(element);
|
|
47
|
-
});
|
|
48
|
-
return breadcrumbs;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
render() {
|
|
52
|
-
return (
|
|
53
|
-
<div className="breadcrumbs-wrapper">
|
|
54
|
-
{this.prepareBreadcrumbElement()}
|
|
55
|
-
</div>
|
|
56
|
-
);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
BreadCrumbs.propTypes = {
|
|
61
|
-
locations: PropTypes.array.isRequired,
|
|
62
|
-
separator: PropTypes.string,
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
export default BreadCrumbs;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* BreadCrumbs Messages
|
|
3
|
-
*
|
|
4
|
-
* This contains all the text for the BreadCrumbs component.
|
|
5
|
-
*/
|
|
6
|
-
import { defineMessages } from 'react-intl';
|
|
7
|
-
|
|
8
|
-
export default defineMessages({
|
|
9
|
-
header: {
|
|
10
|
-
id: 'creatives.components.BreadCrumbs.header',
|
|
11
|
-
defaultMessage: 'This is the BreadCrumbs component !',
|
|
12
|
-
},
|
|
13
|
-
});
|