@capillarytech/creatives-library 2.0.81 → 2.0.83
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/CapTagList/index.js +24 -21
- package/components/CardGrid/index.js +10 -16
- package/components/Ckeditor/index.js +1 -2
- package/components/CustomPopOver/index.js +1 -1
- package/components/EmailPreview/index.js +2 -3
- package/components/FormBuilder/_formBuilder.scss +15 -8
- package/components/FormBuilder/index.js +192 -258
- package/components/Header/index.js +1 -4
- package/components/PreviewSideBar/_previewsidebar.scss +1 -1
- package/components/PreviewSideBar/index.js +5 -3
- package/components/TemplatePreview/WechatRichmediaTemplatePreview/index.js +3 -2
- package/components/TemplatePreview/_templatePreview.scss +1 -1
- package/components/TemplatePreview/index.js +47 -47
- package/components/TemplatePreview/messages.js +1 -9
- package/containers/Assets/Gallery/index.js +1 -1
- package/containers/Email/index.js +1 -1
- package/containers/Login/components/LoginForm/index.js +1 -1
- package/containers/Templates/index.js +1 -1
- package/containers/WeChat/RichmediaTemplates/Create/index.js +1 -1
- package/package.json +2 -1
- package/v2Components/BreadCrumbs/index.js +65 -0
- package/v2Components/BreadCrumbs/messages.js +13 -0
- package/v2Components/BreadCrumbs/tests/index.test.js +10 -0
- package/v2Components/CallTaskPreview/_callTaskPreview.scss +17 -0
- package/v2Components/CallTaskPreview/images/Footer.png +0 -0
- package/v2Components/CallTaskPreview/images/Header.png +0 -0
- package/v2Components/CallTaskPreview/index.js +37 -0
- package/v2Components/CallTaskPreview/messages.js +13 -0
- package/v2Components/CallTaskPreview/tests/index.test.js +15 -0
- package/v2Components/CapTagList/index.js +232 -0
- package/v2Components/CapTagList/messages.js +25 -0
- package/{containers/TemplatesV2 → v2Components/CapTagList}/tests/index.test.js +2 -2
- package/v2Components/Card/_customCard.scss +27 -0
- package/v2Components/Card/index.js +78 -0
- package/{containers/WeChat → v2Components/Card}/tests/index.test.js +2 -2
- package/v2Components/CardGrid/index.js +77 -0
- package/{containers/EmailWrapper → v2Components/CardGrid}/tests/index.test.js +2 -2
- package/v2Components/Ckeditor/index.js +234 -0
- package/v2Components/Ckeditor/messages.js +13 -0
- package/{containers/ChannelTemplates → v2Components/Ckeditor}/tests/index.test.js +2 -2
- package/v2Components/CmsTemplatesComponent/index.js +33 -0
- package/v2Components/CmsTemplatesComponent/messages.js +17 -0
- package/v2Components/CmsTemplatesComponent/tests/index.test.js +10 -0
- package/v2Components/Component/index.js +29 -0
- package/v2Components/Component/tests/index.test.js +10 -0
- package/v2Components/CustomPopOver/index.js +82 -0
- package/v2Components/CustomPopOver/messages.js +13 -0
- package/v2Components/CustomPopOver/tests/index.test.js +10 -0
- package/v2Components/DateFilter/index.js +349 -0
- package/v2Components/DateFilter/messages.js +17 -0
- package/v2Components/DateFilter/tests/index.test.js +15 -0
- package/v2Components/DateRange/index.js +113 -0
- package/v2Components/DateRange/messages.js +13 -0
- package/v2Components/DateRange/tests/index.test.js +10 -0
- package/v2Components/Edmeditor/index.js +65 -0
- package/v2Components/Edmeditor/messages.js +13 -0
- package/v2Components/Edmeditor/tests/index.test.js +10 -0
- package/v2Components/EmailMobilePreview/index.js +129 -0
- package/v2Components/EmailMobilePreview/index.scss +55 -0
- package/v2Components/EmailPreview/_emailPreview.scss +119 -0
- package/v2Components/EmailPreview/index.js +106 -0
- package/v2Components/EmailPreview/messages.js +17 -0
- package/v2Components/EmailPreview/tests/index.test.js +10 -0
- package/v2Components/EmailPreviewV2/_emailPreviewV2.scss +69 -0
- package/v2Components/EmailPreviewV2/index.js +132 -0
- package/v2Components/EmailPreviewV2/messages.js +41 -0
- package/v2Components/EmailPreviewV2/tests/index.test.js +10 -0
- package/v2Components/Footer/index.js +27 -0
- package/v2Components/Footer/messages.js +13 -0
- package/v2Components/Footer/tests/index.test.js +10 -0
- package/v2Components/FormBuilder/_formBuilder.scss +78 -0
- package/v2Components/FormBuilder/index.js +3309 -0
- package/v2Components/FormBuilder/messages.js +13 -0
- package/v2Components/FormBuilder/tests/index.test.js +10 -0
- package/v2Components/Header/index.js +46 -0
- package/v2Components/Header/messages.js +25 -0
- package/v2Components/Header/tests/index.test.js +10 -0
- package/v2Components/ImagePreview/_imagePreview.scss +63 -0
- package/v2Components/ImagePreview/index.js +52 -0
- package/v2Components/ImagePreview/messages.js +13 -0
- package/v2Components/ImagePreview/tests/index.test.js +10 -0
- package/v2Components/MobilePushPreviewV2/index.js +120 -0
- package/v2Components/MobilePushPreviewV2/messages.js +13 -0
- package/{containers/MobilepushWrapper → v2Components/MobilePushPreviewV2}/tests/index.test.js +2 -2
- package/v2Components/NewCallTask/_newCallTask.scss +9 -0
- package/v2Components/NewCallTask/index.js +152 -0
- package/v2Components/NewCallTask/messages.js +29 -0
- package/{containers/CallTask → v2Components/NewCallTask}/tests/index.test.js +2 -2
- package/v2Components/PageHeader/_pageHeader.scss +22 -0
- package/v2Components/PageHeader/index.js +37 -0
- package/v2Components/PageHeader/messages.js +13 -0
- package/v2Components/PageHeader/tests/index.test.js +10 -0
- package/v2Components/Pagination/_pagination.scss +5 -0
- package/v2Components/Pagination/index.js +49 -0
- package/v2Components/Pagination/tests/index.test.js +10 -0
- package/v2Components/PreviewSideBar/_previewsidebar.scss +28 -0
- package/v2Components/PreviewSideBar/index.js +150 -0
- package/v2Components/PreviewSideBar/messages.js +33 -0
- package/v2Components/PreviewSideBar/tests/index.test.js +10 -0
- package/v2Components/Sidebar/_sidebar.scss +115 -0
- package/v2Components/Sidebar/index.js +208 -0
- package/v2Components/Sidebar/messages.js +21 -0
- package/v2Components/Sidebar/tests/index.test.js +10 -0
- package/v2Components/SlideBox/_slideBox.scss +63 -0
- package/v2Components/SlideBox/index.js +48 -0
- package/v2Components/SlideBox/tests/index.test.js +103 -0
- package/v2Components/SmsEditor/index.js +55 -0
- package/v2Components/SmsEditor/tests/index.test.js +10 -0
- package/v2Components/SmsTest/index.js +115 -0
- package/v2Components/SmsTest/messages.js +13 -0
- package/v2Components/SmsTest/tests/index.test.js +10 -0
- package/v2Components/TemplatePreview/WechatRichmediaTemplatePreview/_wechatRichmediaTemplatePrev.scss +42 -0
- package/v2Components/TemplatePreview/WechatRichmediaTemplatePreview/index.js +139 -0
- package/v2Components/TemplatePreview/WechatRichmediaTemplatePreview/messages.js +21 -0
- package/v2Components/TemplatePreview/WechatRichmediaTemplatePreview/tests/index.test.js +10 -0
- package/v2Components/TemplatePreview/_templatePreview.scss +352 -0
- package/v2Components/TemplatePreview/assets/images/WECHAT_5x.png +0 -0
- package/v2Components/TemplatePreview/assets/images/androidPushMessage.svg +45 -0
- package/v2Components/TemplatePreview/assets/images/iPhonePushMessage.svg +135 -0
- package/v2Components/TemplatePreview/assets/images/mobile.svg +24 -0
- package/v2Components/TemplatePreview/assets/images/sms-body.png +0 -0
- package/v2Components/TemplatePreview/assets/images/sms-icon.png +0 -0
- package/v2Components/TemplatePreview/assets/images/sms_mobile.png +0 -0
- package/v2Components/TemplatePreview/assets/images/user-icon.svg +19 -0
- package/v2Components/TemplatePreview/assets/images/wechat-mobile.svg +78 -0
- package/v2Components/TemplatePreview/index.js +175 -0
- package/v2Components/TemplatePreview/messages.js +37 -0
- package/v2Components/TemplatePreview/tests/index.test.js +10 -0
- package/v2Components/Toastr/index.js +60 -0
- package/v2Components/Toastr/messages.js +13 -0
- package/v2Components/Toastr/tests/index.test.js +10 -0
- package/v2Components/ToastrMessage/index.js +110 -0
- package/v2Components/ToastrMessage/messages.js +13 -0
- package/v2Components/ToastrMessage/tests/index.test.js +10 -0
- package/v2Components/TopBar/_topbar.scss +46 -0
- package/v2Components/TopBar/assets/images/capillary_logo.png +0 -0
- package/v2Components/TopBar/index.js +113 -0
- package/v2Components/TopBar/messages.js +29 -0
- package/v2Components/TopBar/tests/index.test.js +10 -0
- package/v2Containers/Assets/Gallery/index.js +1 -1
- package/v2Containers/CallTask/index.js +1 -1
- package/v2Containers/Cap/index.js +2 -2
- package/v2Containers/CreativesContainer/SlideBoxContent.js +3 -3
- package/v2Containers/CreativesContainer/index.js +1 -0
- package/v2Containers/Dashboard/index.js +2 -2
- package/v2Containers/Ebill/index.js +2 -2
- package/v2Containers/Email/index.js +13 -13
- package/v2Containers/EmailWrapper/index.js +1 -1
- package/v2Containers/Line/Create/index.js +1 -1
- package/v2Containers/Line/Edit/index.js +1 -1
- package/v2Containers/Login/index.js +1 -1
- package/v2Containers/MobilePush/Create/index.js +26 -3
- package/v2Containers/MobilePush/Edit/index.js +32 -7
- package/v2Containers/MobilePush/initialSchema.js +2 -0
- 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/Templates/index.js +4 -4
- package/v2Containers/TestPage/index.js +1 -1
- package/v2Containers/WeChat/MapTemplates/index.js +3 -3
- package/v2Containers/WeChat/RichmediaTemplates/Create/index.js +3 -3
- package/components/FormBuilder/test +0 -1845
- package/containers/CallTask/_callTask.scss +0 -5
- package/containers/CallTask/actions.js +0 -15
- package/containers/CallTask/constants.js +0 -7
- package/containers/CallTask/index.js +0 -141
- package/containers/CallTask/messages.js +0 -21
- package/containers/CallTask/reducer.js +0 -23
- package/containers/CallTask/sagas.js +0 -11
- package/containers/CallTask/selectors.js +0 -25
- package/containers/CallTask/tests/actions.test.js +0 -18
- package/containers/CallTask/tests/reducer.test.js +0 -9
- package/containers/CallTask/tests/sagas.test.js +0 -15
- package/containers/CallTask/tests/selectors.test.js +0 -10
- package/containers/ChannelTemplates/actions.js +0 -20
- package/containers/ChannelTemplates/constants.js +0 -8
- package/containers/ChannelTemplates/index.js +0 -48
- package/containers/ChannelTemplates/messages.js +0 -13
- package/containers/ChannelTemplates/reducer.js +0 -34
- package/containers/ChannelTemplates/sagas.js +0 -32
- package/containers/ChannelTemplates/selectors.js +0 -25
- package/containers/ChannelTemplates/tests/actions.test.js +0 -18
- package/containers/ChannelTemplates/tests/reducer.test.js +0 -9
- package/containers/ChannelTemplates/tests/sagas.test.js +0 -15
- package/containers/ChannelTemplates/tests/selectors.test.js +0 -10
- package/containers/CreativesContainer/SlideBoxContent.js +0 -248
- package/containers/CreativesContainer/SlideBoxFooter.js +0 -38
- package/containers/CreativesContainer/SlideBoxHeader.js +0 -65
- package/containers/CreativesContainer/actions.js +0 -27
- package/containers/CreativesContainer/constants.js +0 -13
- package/containers/CreativesContainer/index.js +0 -418
- package/containers/CreativesContainer/index.scss +0 -27
- package/containers/CreativesContainer/messages.js +0 -17
- package/containers/CreativesContainer/reducer.js +0 -29
- package/containers/CreativesContainer/sagas.js +0 -11
- package/containers/CreativesContainer/selectors.js +0 -30
- package/containers/CreativesContainer/tests/actions.test.js +0 -18
- package/containers/CreativesContainer/tests/index.test.js +0 -10
- package/containers/CreativesContainer/tests/reducer.test.js +0 -9
- package/containers/CreativesContainer/tests/sagas.test.js +0 -15
- package/containers/CreativesContainer/tests/selectors.test.js +0 -10
- package/containers/EmailWrapper/actions.js +0 -15
- package/containers/EmailWrapper/constants.js +0 -7
- package/containers/EmailWrapper/index.js +0 -238
- package/containers/EmailWrapper/messages.js +0 -57
- package/containers/EmailWrapper/reducer.js +0 -23
- package/containers/EmailWrapper/sagas.js +0 -11
- package/containers/EmailWrapper/selectors.js +0 -25
- package/containers/EmailWrapper/tests/actions.test.js +0 -18
- package/containers/EmailWrapper/tests/reducer.test.js +0 -9
- package/containers/EmailWrapper/tests/sagas.test.js +0 -15
- package/containers/EmailWrapper/tests/selectors.test.js +0 -10
- package/containers/MobilePush/commonMethods.js +0 -249
- package/containers/MobilePush/eventsMap.js +0 -127
- package/containers/MobilePush/initialSchema.js +0 -1739
- package/containers/MobilepushWrapper/_mobilepushWrapper.scss +0 -18
- package/containers/MobilepushWrapper/index.js +0 -97
- package/containers/MobilepushWrapper/messages.js +0 -25
- package/containers/TemplatesV2/_templatesV2.scss +0 -5
- package/containers/TemplatesV2/actions.js +0 -16
- package/containers/TemplatesV2/constants.js +0 -10
- package/containers/TemplatesV2/index.js +0 -207
- package/containers/TemplatesV2/messages.js +0 -29
- package/containers/TemplatesV2/selectors.js +0 -25
- package/containers/TemplatesV2/tests/actions.test.js +0 -18
- package/containers/TemplatesV2/tests/reducer.test.js +0 -9
- package/containers/TemplatesV2/tests/sagas.test.js +0 -15
- package/containers/TemplatesV2/tests/selectors.test.js +0 -10
- package/containers/WeChat/RichmediaTemplates/Create/testschema.js +0 -379
- package/containers/WeChat/_wechat.scss +0 -8
- package/containers/WeChat/actions.js +0 -52
- package/containers/WeChat/constants.js +0 -28
- package/containers/WeChat/index.js +0 -1635
- package/containers/WeChat/messages.js +0 -73
- package/containers/WeChat/reducer.js +0 -74
- package/containers/WeChat/sagas.js +0 -86
- package/containers/WeChat/selectors.js +0 -25
- package/containers/WeChat/tests/actions.test.js +0 -18
- package/containers/WeChat/tests/reducer.test.js +0 -9
- package/containers/WeChat/tests/sagas.test.js +0 -15
- package/containers/WeChat/tests/selectors.test.js +0 -10
|
@@ -12,9 +12,9 @@ import moment from 'moment';
|
|
|
12
12
|
import 'moment/locale/zh-cn';
|
|
13
13
|
import { injectIntl, intlShape } from 'react-intl';
|
|
14
14
|
import {CapNotification} from '@capillarytech/cap-ui-library';
|
|
15
|
-
import TopBar from '../../
|
|
15
|
+
import TopBar from '../../v2Components/TopBar';
|
|
16
16
|
// import 'moment/locale/en-us';
|
|
17
|
-
import Sidebar from '../../
|
|
17
|
+
import Sidebar from '../../v2Components/Sidebar';
|
|
18
18
|
import { makeSelectAuthenticated, makeSelectUser } from './selectors';
|
|
19
19
|
import * as actions from './actions';
|
|
20
20
|
import * as locationActions from '../LanguageProvider/actions';
|
|
@@ -2,14 +2,14 @@ import React from 'react';
|
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import styled from 'styled-components';
|
|
4
4
|
import TemplatesV2 from '../TemplatesV2';
|
|
5
|
-
import TemplatePreview from '../../
|
|
5
|
+
import TemplatePreview from '../../v2Components/TemplatePreview';
|
|
6
6
|
import SmsCreate from '../Sms/Create';
|
|
7
7
|
import SmsEdit from '../Sms/Edit';
|
|
8
8
|
import Email from '../Email';
|
|
9
9
|
import EmailWrapper from '../EmailWrapper';
|
|
10
10
|
import MobilepushWrapper from '../MobilepushWrapper';
|
|
11
|
-
import EmailPreviewV2 from '../../
|
|
12
|
-
import MobilePushPreview from '../../
|
|
11
|
+
import EmailPreviewV2 from '../../v2Components/EmailPreviewV2';
|
|
12
|
+
import MobilePushPreview from '../../v2Components/MobilePushPreviewV2';
|
|
13
13
|
import CallTask from '../CallTask';
|
|
14
14
|
import MobliPushEdit from '../MobilePush/Edit';
|
|
15
15
|
import * as constants from './constants';
|
|
@@ -80,6 +80,7 @@ class Creatives extends React.Component {
|
|
|
80
80
|
|
|
81
81
|
onShowTemplates = () => {
|
|
82
82
|
this.setState({ slidBoxContent: 'templates', showSlideBox: true, isGetFormData: false });
|
|
83
|
+
this.resetStep();
|
|
83
84
|
};
|
|
84
85
|
onChannelChange = (channel) => {
|
|
85
86
|
this.setState({currentChannel: channel});
|
|
@@ -9,8 +9,8 @@ import makeSelectDashboard from './selectors';
|
|
|
9
9
|
import messages from './messages';
|
|
10
10
|
import { UserIsAuthenticated } from '../../../utils/authWrapper';
|
|
11
11
|
import * as actions from './actions';
|
|
12
|
-
import PageHeader from '../../
|
|
13
|
-
import BreadCrumbs from '../../
|
|
12
|
+
import PageHeader from '../../v2Components/PageHeader';
|
|
13
|
+
import BreadCrumbs from '../../v2Components/BreadCrumbs/index';
|
|
14
14
|
export class Dashboard extends React.Component { // eslint-disable-line react/prefer-stateless-function
|
|
15
15
|
render() {
|
|
16
16
|
const breadCrumbLocations = [
|
|
@@ -15,7 +15,7 @@ import { injectIntl, intlShape } from 'react-intl';
|
|
|
15
15
|
import _ from 'lodash';
|
|
16
16
|
import { createStructuredSelector } from 'reselect';
|
|
17
17
|
import * as actions from './actions';
|
|
18
|
-
import FormBuilder from '../../
|
|
18
|
+
import FormBuilder from '../../v2Components/FormBuilder';
|
|
19
19
|
import { makeSelectMetaEntities, makeSelectAuthenticated, setInjectedTags } from '../Cap/selectors';
|
|
20
20
|
import * as globalActions from '../../containers/Cap/actions';
|
|
21
21
|
import { UserIsAuthenticated } from '../../utils/authWrapper';
|
|
@@ -23,7 +23,7 @@ import { makeSelectTemplates } from '../Templates/selectors';
|
|
|
23
23
|
import {getMessageObject} from '../../utils/messageUtils';
|
|
24
24
|
import makeSelectEbill from './selectors';
|
|
25
25
|
import messages from './messages';
|
|
26
|
-
import EmailPreview from '../../
|
|
26
|
+
import EmailPreview from '../../v2Components/EmailPreview';
|
|
27
27
|
import './_ebill.scss';
|
|
28
28
|
import callNativeEvent from '../../utils/callNativeEvent';
|
|
29
29
|
const BreadcrumbItem = Breadcrumb.Item;
|
|
@@ -15,7 +15,7 @@ import { CapButton, CapInput, CapSpin, CapSlideBox, CapCustomCard } from '@capil
|
|
|
15
15
|
import { createStructuredSelector } from 'reselect';
|
|
16
16
|
import _ from 'lodash';
|
|
17
17
|
import moment from "moment";
|
|
18
|
-
import FormBuilder from '../../
|
|
18
|
+
import FormBuilder from '../../v2Components/FormBuilder';
|
|
19
19
|
import { makeSelectMetaEntities, selectCurrentOrgDetails, isLoadingMetaEntities, makeSelectAuthenticated, setInjectedTags } from '../Cap/selectors';
|
|
20
20
|
import * as actions from './actions';
|
|
21
21
|
import * as templatesActions from '../Templates/actions';
|
|
@@ -24,12 +24,12 @@ import { UserIsAuthenticated } from '../../utils/authWrapper';
|
|
|
24
24
|
import {makeSelectEmail} from './selectors';
|
|
25
25
|
import { makeSelectTemplates } from '../Templates/selectors';
|
|
26
26
|
import messages from './messages';
|
|
27
|
-
// import PageHeader from '../../
|
|
27
|
+
// import PageHeader from '../../v2Components/PageHeader';
|
|
28
28
|
import './_email.scss';
|
|
29
29
|
import {getMessageObject} from '../../utils/messageUtils';
|
|
30
|
-
import EmailPreview from '../../
|
|
30
|
+
import EmailPreview from '../../v2Components/EmailPreview';
|
|
31
31
|
|
|
32
|
-
import Pagination from '../../
|
|
32
|
+
import Pagination from '../../v2Components/Pagination';
|
|
33
33
|
import * as creativesContainerActions from '../CreativesContainer/actions';
|
|
34
34
|
const {CapCustomCardList} = CapCustomCard;
|
|
35
35
|
export class Email extends React.Component { // eslint-disable-line react/prefer-stateless-function
|
|
@@ -604,15 +604,13 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
604
604
|
const langIndex = formData[this.state.currentTab - 1].selectedLanguages.indexOf(langId);
|
|
605
605
|
const win = document.getElementById(`edmeditor${(langIndex + 1) > 1 ? (langIndex + 1) : ''}`).contentWindow;
|
|
606
606
|
win.postMessage(msgString, '*');
|
|
607
|
+
} else if (data === "unsubscribe") {
|
|
608
|
+
const anchor = `<a href='{{${data}}}'>${data}</a>`;
|
|
609
|
+
this.state.editorInstanse.insertHtml(`${anchor}`);
|
|
607
610
|
} else {
|
|
608
|
-
|
|
609
|
-
const anchor = `<a href='{{${data}}}'>${data}</a>`;
|
|
610
|
-
this.state.editorInstanse.insertHtml(`${anchor}`);
|
|
611
|
-
} else {
|
|
612
|
-
this.state.editorInstanse.insertHtml(`{{${data}}}`);
|
|
613
|
-
}
|
|
614
|
-
//this.resetCkEditorInstance(currentTab, formData, true, data);
|
|
611
|
+
this.state.editorInstanse.insertHtml(`{{${data}}}`);
|
|
615
612
|
}
|
|
613
|
+
//this.resetCkEditorInstance(currentTab, formData, true, data);
|
|
616
614
|
}
|
|
617
615
|
|
|
618
616
|
onImageSelect = () => {
|
|
@@ -866,7 +864,9 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
866
864
|
|
|
867
865
|
|
|
868
866
|
this.setState({ formData, schema, tabKey, currentTab, tabCount: editData.versions.history.length, loadingStatus: this.state.loadingStatus + 1 }, () => {
|
|
869
|
-
this.props.
|
|
867
|
+
if (this.props.isFullMode) {
|
|
868
|
+
this.props.showTemplateName({formData, onFormDataChange: this.onFormDataChange});
|
|
869
|
+
}
|
|
870
870
|
_.forEach((editData.versions.base.selectedLanguages), (language) => {
|
|
871
871
|
// if (formData[this.state.currentTab - 1].tabKey === formData[this.state.currentTab - 1][language].tabKey) {
|
|
872
872
|
// formData[this.state.currentTab - 1].activeTab = language;
|
|
@@ -1214,7 +1214,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
1214
1214
|
const baseData = {};
|
|
1215
1215
|
const baseLanguage = props.currentOrgDetails.basic_details.base_language;
|
|
1216
1216
|
this.supportedLanguages = this.getSupportedLanguages(props);
|
|
1217
|
-
const languageObject = this.supportedLanguages[_.findIndex(this.supportedLanguages, {iso_code: baseLanguage})];
|
|
1217
|
+
const languageObject = this.supportedLanguages[_.findIndex(this.supportedLanguages, {iso_code: baseLanguage})] || {iso_code: 'en', lang_id: 1, language: "English"};
|
|
1218
1218
|
baseData.activeTab = baseLanguage;
|
|
1219
1219
|
baseData[languageObject.iso_code] = {};
|
|
1220
1220
|
baseData[languageObject.iso_code].is_drag_drop = false;
|
|
@@ -17,7 +17,7 @@ import { UserIsAuthenticated } from '../../utils/authWrapper';
|
|
|
17
17
|
import {selectEmailLayout, selectCmsTemplates, selectEdmEditor, uploadSelector} from '../Templates/selectors';
|
|
18
18
|
import * as templatesActionsCreators from '../Templates/actions';
|
|
19
19
|
import Email from '../Email';
|
|
20
|
-
import CmsTemplatesComponent from '../../
|
|
20
|
+
import CmsTemplatesComponent from '../../v2Components/CmsTemplatesComponent';
|
|
21
21
|
import messages from './messages';
|
|
22
22
|
const CapRadioCardWithLabel = ComponentWithLabelHOC(CapRadioCard);
|
|
23
23
|
const CardContainer = styled.div`
|
|
@@ -8,7 +8,7 @@ import { Row, Col, Spin, Breadcrumb } from 'antd';
|
|
|
8
8
|
import _ from 'lodash';
|
|
9
9
|
import messages from './messages';
|
|
10
10
|
import * as actions from './actions';
|
|
11
|
-
import FormBuilder from '../../../
|
|
11
|
+
import FormBuilder from '../../../v2Components/FormBuilder';
|
|
12
12
|
import { UserIsAuthenticated } from '../../../utils/authWrapper';
|
|
13
13
|
import * as globalActions from '../../../containers/Cap/actions';
|
|
14
14
|
//import { makeSelectCreate, makeSelectCreateResponse, makeSelectEdit, makeSelectEditResponse, makeSelectTemplateDetailsResponse } from './selectors';
|
|
@@ -17,7 +17,7 @@ import _ from 'lodash';
|
|
|
17
17
|
import {makeSelectEdit, makeSelectEditResponse, makeSelectTemplateDetailsResponse} from "../../MobilePush/Edit/selectors";
|
|
18
18
|
import {makeSelectMetaEntities, setInjectedTags} from "../../Cap/selectors";
|
|
19
19
|
import {getMessageObject} from "../../../utils/messageUtils";
|
|
20
|
-
import FormBuilder from '../../../
|
|
20
|
+
import FormBuilder from '../../../v2Components/FormBuilder';
|
|
21
21
|
import * as globalActions from "../../Cap/actions";
|
|
22
22
|
import * as actions from "../../MobilePush/Edit/actions";
|
|
23
23
|
import * as templatesActions from "../../Templates/actions";
|
|
@@ -10,7 +10,7 @@ import { createStructuredSelector } from 'reselect';
|
|
|
10
10
|
import makeSelectLogin from './selectors';
|
|
11
11
|
import messages from './messages';
|
|
12
12
|
import config from '../../config/app';
|
|
13
|
-
import LoginForm from './
|
|
13
|
+
import LoginForm from './v2Components/LoginForm';
|
|
14
14
|
import * as actions from '../../containers/Cap/actions';
|
|
15
15
|
import { UserIsNotAuthenticated } from '../../utils/authWrapper';
|
|
16
16
|
import loaderGif from '../../assets/loading_img.gif';
|
|
@@ -18,7 +18,7 @@ import { CapSlideBox, CapHeader, CapTable, CapLink, CapRow, CapColumn, CapIcons,
|
|
|
18
18
|
import { makeSelectCreate, makeSelectCreateResponse, makeSelectIosCta } from './selectors';
|
|
19
19
|
import { makeSelectMetaEntities, setInjectedTags } from '../../Cap/selectors';
|
|
20
20
|
import * as globalActions from '../../../containers/Cap/actions';
|
|
21
|
-
import FormBuilder from '../../../
|
|
21
|
+
import FormBuilder from '../../../v2Components/FormBuilder';
|
|
22
22
|
import './_mobilePushCreate.scss';
|
|
23
23
|
import * as actions from './actions';
|
|
24
24
|
|
|
@@ -151,7 +151,7 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
151
151
|
|
|
152
152
|
};
|
|
153
153
|
|
|
154
|
-
onFormDataChange = (formData, tabCount) => {
|
|
154
|
+
onFormDataChange = (formData, tabCount, currentTab, inputField) => {
|
|
155
155
|
const newFormData = cloneDeep(formData);
|
|
156
156
|
const {templateCta} = this.state;
|
|
157
157
|
if (!isEmpty(templateCta)) {
|
|
@@ -187,6 +187,11 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
187
187
|
if (this.props.isFullMode && this.props.defaultData && isEmpty(formData['template-name'])) {
|
|
188
188
|
newFormData['template-name'] = get(this.props, "defaultData['template-name']");
|
|
189
189
|
}
|
|
190
|
+
if (inputField && inputField.id === "add-sec-cta") {
|
|
191
|
+
if (!newFormData[0]["add-sec-cta"]) {
|
|
192
|
+
newFormData[0]["add-sec-cta-2"] = false;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
190
195
|
this.setState({formData: newFormData, tabCount, isSchemaChanged: !this.state.isSchemaChanged}, () => {
|
|
191
196
|
if (this.props.isFullMode) {
|
|
192
197
|
this.props.showTemplateName({formData: this.state.formData, onFormDataChange: this.onFormDataChange});
|
|
@@ -1169,6 +1174,7 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
1169
1174
|
addSecondoryCta = (flag, formData, schemaField) => {
|
|
1170
1175
|
const id = schemaField.id;
|
|
1171
1176
|
const schema = cloneDeep(this.state.schema);
|
|
1177
|
+
const formDataCopy = cloneDeep(formData);
|
|
1172
1178
|
const ck = this.props.Templates.selectedWeChatAccount.configs ? !!this.props.Templates.selectedWeChatAccount.configs.deeplink : false;
|
|
1173
1179
|
const deeplinks = ck ? this.props.Templates.selectedWeChatAccount.configs.deeplink : '[]';
|
|
1174
1180
|
const deepLinkOptions = this.props.Templates.selectedWeChatAccount ? map(JSON.parse(deeplinks), (link) => ({label: link.name, value: link.link, title: link.link }) ) : [];
|
|
@@ -1270,7 +1276,24 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
1270
1276
|
}
|
|
1271
1277
|
});
|
|
1272
1278
|
});
|
|
1273
|
-
|
|
1279
|
+
if (id === "add-sec-cta") {
|
|
1280
|
+
//The following block of code enables and disables add secondary button based on the primary button
|
|
1281
|
+
const indexOfSecondary = findIndex(inputFields, {identifier: 'add-sec-cta-2'});
|
|
1282
|
+
inputFields[indexOfSecondary].cols[0].disabled = !formData[this.state.currentTab - 1][id];
|
|
1283
|
+
//Calling the following function to unset the data set under secondary button
|
|
1284
|
+
if (!formData[this.state.currentTab - 1][id]) {
|
|
1285
|
+
formDataCopy[this.state.currentTab - 1]['add-sec-cta-2'] = false;
|
|
1286
|
+
}
|
|
1287
|
+
//Calling set state here to update the state and schema before manually triggering secondarycta update
|
|
1288
|
+
this.setState(
|
|
1289
|
+
{schema, initialState: this.state.initialState ? this.state.initialState : this.state.schema, isSchemaChanged: true},
|
|
1290
|
+
() => {
|
|
1291
|
+
this.injectEvents(schema);
|
|
1292
|
+
this.addSecondoryCta(true, formDataCopy, inputFields[indexOfSecondary].cols[0]);
|
|
1293
|
+
});
|
|
1294
|
+
} else {
|
|
1295
|
+
this.setState({schema, initialState: this.state.initialState ? this.state.initialState : this.state.schema, isSchemaChanged: true}, () => { this.injectEvents(schema); });
|
|
1296
|
+
}
|
|
1274
1297
|
};
|
|
1275
1298
|
copyIphoneContent = () => {
|
|
1276
1299
|
const formData = cloneDeep(this.state.formData);
|
|
@@ -19,7 +19,7 @@ import styled from 'styled-components';
|
|
|
19
19
|
import {makeSelectEdit, makeSelectEditResponse, makeSelectTemplateDetailsResponse, makeSelectIosCta} from "./selectors";
|
|
20
20
|
import {makeSelectMetaEntities, setInjectedTags, isLoadingMetaEntities} from "../../Cap/selectors";
|
|
21
21
|
import {getMessageObject} from "../../../utils/messageUtils";
|
|
22
|
-
import FormBuilder from '../../../
|
|
22
|
+
import FormBuilder from '../../../v2Components/FormBuilder';
|
|
23
23
|
import * as globalActions from "../../Cap/actions";
|
|
24
24
|
import * as actions from "../../MobilePush/Edit/actions";
|
|
25
25
|
import * as templatesActions from "../../Templates/actions";
|
|
@@ -189,7 +189,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
189
189
|
}
|
|
190
190
|
});
|
|
191
191
|
};
|
|
192
|
-
onFormDataChange = (formData, tabCount, currentTab) => {
|
|
192
|
+
onFormDataChange = (formData, tabCount, currentTab, inputField) => {
|
|
193
193
|
console.log('Form data changed is ', formData, tabCount, currentTab);
|
|
194
194
|
const newFormData = _.cloneDeep(formData);
|
|
195
195
|
const {templateCta} = this.state;
|
|
@@ -218,6 +218,11 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
218
218
|
if (this.props.isFullMode && this.props.defaultData && _.isEmpty(formData['template-name'])) {
|
|
219
219
|
newFormData['template-name'] = _.get(this.props, "defaultData['template-name']");
|
|
220
220
|
}
|
|
221
|
+
if (inputField && inputField.id === "add-sec-cta") {
|
|
222
|
+
if (!newFormData[0]["add-sec-cta"]) {
|
|
223
|
+
newFormData[0]["add-sec-cta-2"] = false;
|
|
224
|
+
}
|
|
225
|
+
}
|
|
221
226
|
this.setState({formData: newFormData, tabCount}, () => {
|
|
222
227
|
this.props.showTemplateName({formData: this.state.formData, onFormDataChange: this.onFormDataChange});
|
|
223
228
|
});
|
|
@@ -1604,6 +1609,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
1604
1609
|
addSecondoryCta = (flag, formData, field, inputSchema, currentTab) => {
|
|
1605
1610
|
const id = field.id;
|
|
1606
1611
|
const tabIndex = currentTab || this.state.currentTab;
|
|
1612
|
+
const formDataCopy = cloneDeep(formData);
|
|
1607
1613
|
const schema = inputSchema ? _.cloneDeep(inputSchema) : _.cloneDeep(this.state.schema);
|
|
1608
1614
|
const selectedWeChatAccount = (!_.isEmpty(this.props.Templates.selectedWeChatAccount) ? this.props.Templates.selectedWeChatAccount : this.props.Edit.selectedWeChatAccount);
|
|
1609
1615
|
const ck = selectedWeChatAccount.configs ? !!selectedWeChatAccount.configs.deeplink : false;
|
|
@@ -1619,13 +1625,32 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
1619
1625
|
const deleteCount = indexOfNextField - fieldIndex;
|
|
1620
1626
|
newInputFields = [...inputFields.slice(0, fieldIndex + 1), ...inputFields.slice(fieldIndex + deleteCount, inputFields.length)];
|
|
1621
1627
|
}
|
|
1622
|
-
|
|
1623
|
-
|
|
1628
|
+
if (id === "add-sec-cta") {
|
|
1629
|
+
//The following block of code enables and disables add secondary button based on the primary button
|
|
1630
|
+
const indexOfSecondary = findIndex(newInputFields, {identifier: 'add-sec-cta-2'});
|
|
1631
|
+
newInputFields[indexOfSecondary].cols[0].disabled = !formData[this.state.currentTab - 1][id];
|
|
1632
|
+
//Calling the following function to unset the data set under secondary button
|
|
1633
|
+
if (!formData[this.state.currentTab - 1][id]) {
|
|
1634
|
+
formDataCopy[this.state.currentTab - 1]['add-sec-cta-2'] = false;
|
|
1635
|
+
}
|
|
1636
|
+
set(schema, `containers[0].panes[${tabIndex - 1}].sections[0].childSections[0].childSections[0].inputFields`, newInputFields);
|
|
1637
|
+
//Calling set state here to update the state and schema before manually triggering secondarycta update
|
|
1638
|
+
this.setState(
|
|
1639
|
+
{schema, initialState: this.state.initialState ? this.state.initialState : this.state.schema, isSchemaChanged: true},
|
|
1640
|
+
() => {
|
|
1641
|
+
this.injectEvents(schema);
|
|
1642
|
+
this.addSecondoryCta(true, formDataCopy, newInputFields[indexOfSecondary].cols[0]);
|
|
1643
|
+
});
|
|
1644
|
+
} else {
|
|
1645
|
+
set(schema, `containers[0].panes[${tabIndex - 1}].sections[0].childSections[0].childSections[0].inputFields`, newInputFields);
|
|
1646
|
+
if (inputSchema) {
|
|
1647
|
+
return schema;
|
|
1648
|
+
}
|
|
1649
|
+
this.setState({schema, initialState: this.state.initialState ? this.state.initialState : this.state.schema, isSchemaChanged: true});
|
|
1650
|
+
this.injectEvents(schema);
|
|
1624
1651
|
return schema;
|
|
1625
1652
|
}
|
|
1626
|
-
|
|
1627
|
-
this.injectEvents(schema);
|
|
1628
|
-
return schema;
|
|
1653
|
+
return true;
|
|
1629
1654
|
};
|
|
1630
1655
|
|
|
1631
1656
|
addSecondoryCtaIos = (flag, formData, schemaField) => {
|
|
@@ -441,6 +441,7 @@ export const response = {
|
|
|
441
441
|
id: "add-sec-cta-2",
|
|
442
442
|
metaType: "label",
|
|
443
443
|
dynamicTab: false,
|
|
444
|
+
disabled: true,
|
|
444
445
|
label: "Add secondary button to notification",
|
|
445
446
|
styling: "semantic",
|
|
446
447
|
type: "checkbox",
|
|
@@ -1323,6 +1324,7 @@ export const response = {
|
|
|
1323
1324
|
id: "add-sec-cta-2",
|
|
1324
1325
|
metaType: "label",
|
|
1325
1326
|
dynamicTab: false,
|
|
1327
|
+
disabled: true,
|
|
1326
1328
|
label: "Add secondary button to notification",
|
|
1327
1329
|
styling: "semantic",
|
|
1328
1330
|
type: "checkbox",
|
|
@@ -17,7 +17,7 @@ import { makeSelectCreate, makeSelectCreateResponse } from './selectors';
|
|
|
17
17
|
import { makeSelectMetaEntities, isLoadingMetaEntities, setInjectedTags } from '../../Cap/selectors';
|
|
18
18
|
import { UserIsAuthenticated } from '../../../utils/authWrapper';
|
|
19
19
|
import './_smsCreate.scss';
|
|
20
|
-
import FormBuilder from '../../../
|
|
20
|
+
import FormBuilder from '../../../v2Components/FormBuilder';
|
|
21
21
|
import * as actions from './actions';
|
|
22
22
|
import messages from './messages';
|
|
23
23
|
import * as charCount from '../../../utils/smsCharCount';
|
|
@@ -17,7 +17,7 @@ import { bindActionCreators } from 'redux';
|
|
|
17
17
|
import { makeSelectEdit, makeSelectEditResponse, makeSelectTemplateDetailsResponse } from './selectors';
|
|
18
18
|
import { makeSelectMetaEntities, isLoadingMetaEntities, setInjectedTags } from '../../Cap/selectors';
|
|
19
19
|
import { UserIsAuthenticated } from '../../../utils/authWrapper';
|
|
20
|
-
import FormBuilder from '../../../
|
|
20
|
+
import FormBuilder from '../../../v2Components/FormBuilder';
|
|
21
21
|
import * as actions from './actions';
|
|
22
22
|
import {checkUnicode, updateCharCount} from '../../../utils/smsCharCountV2';
|
|
23
23
|
import '../Create/_smsCreate.scss';
|
|
@@ -17,7 +17,7 @@ import { UserIsAuthenticated } from '../../utils/authWrapper';
|
|
|
17
17
|
import * as actions from './actions';
|
|
18
18
|
import * as globalActions from '../../containers/Cap/actions';
|
|
19
19
|
// import styled from styled-components;
|
|
20
|
-
import CapTagList from '../../
|
|
20
|
+
import CapTagList from '../../v2Components/CapTagList';
|
|
21
21
|
import './_tagList.scss';
|
|
22
22
|
const TreeNode = Tree.TreeNode;
|
|
23
23
|
|
|
@@ -33,17 +33,17 @@ import * as smsEditActions from '../Sms/Edit/actions';
|
|
|
33
33
|
import * as ebillActions from '../Ebill/actions';
|
|
34
34
|
import * as emailActions from '../Email/actions';
|
|
35
35
|
import * as lineActions from '../Line/Create/actions';
|
|
36
|
-
import CardGrid from '../../
|
|
36
|
+
import CardGrid from '../../v2Components/CardGrid';
|
|
37
37
|
import config from '../../config/app';
|
|
38
38
|
import './_templates.scss';
|
|
39
39
|
import * as globalActions from '../Cap/actions';
|
|
40
40
|
import { makeSelectAuthenticated } from '../Cap/selectors';
|
|
41
41
|
import {getMessageObject} from '../../utils/messageUtils';
|
|
42
42
|
import * as commonUtil from '../../utils/common';
|
|
43
|
-
import Pagination from '../../
|
|
44
|
-
import EmailPreview from '../../
|
|
43
|
+
import Pagination from '../../v2Components/Pagination';
|
|
44
|
+
import EmailPreview from '../../v2Components/EmailPreview';
|
|
45
45
|
import CreativesContainer from '../CreativesContainer';
|
|
46
|
-
import WechatRichmediaTemplatePreview from '../../
|
|
46
|
+
import WechatRichmediaTemplatePreview from '../../v2Components/TemplatePreview/WechatRichmediaTemplatePreview';
|
|
47
47
|
import { MOBILE_PUSH, WECHAT, SMS, EMAIL, EBILL, LINE } from '../CreativesContainer/constants';
|
|
48
48
|
const {CapCustomCardList} = CapCustomCard;
|
|
49
49
|
const InlineDiv = styled.div`
|
|
@@ -19,13 +19,13 @@ import { makeSelectMetaEntities, makeSelectFetchingSchema, setInjectedTags } fro
|
|
|
19
19
|
import makeSelectWeChat from './selectors';
|
|
20
20
|
import messages from './messages';
|
|
21
21
|
import * as actions from './actions';
|
|
22
|
-
import FormBuilder from '../../../
|
|
22
|
+
import FormBuilder from '../../../v2Components/FormBuilder';
|
|
23
23
|
import { UserIsAuthenticated } from '../../../utils/authWrapper';
|
|
24
24
|
import * as globalActions from '../../../containers/Cap/actions';
|
|
25
25
|
import {getMessageObject} from '../../../utils/messageUtils';
|
|
26
26
|
import * as templateActions from '../../Templates/actions';
|
|
27
|
-
// import SlideBox from '../../
|
|
28
|
-
// import PageHeader from '../../
|
|
27
|
+
// import SlideBox from '../../v2Components/SlideBox';
|
|
28
|
+
// import PageHeader from '../../v2Components/PageHeader';
|
|
29
29
|
import './_mapTemplates.scss';
|
|
30
30
|
|
|
31
31
|
import callNativeEvent from '../../../utils/callNativeEvent';
|
|
@@ -22,9 +22,9 @@ import './_createRichmedia.scss';
|
|
|
22
22
|
import messages from './messages';
|
|
23
23
|
import * as globalActions from '../../../../containers/Cap/actions';
|
|
24
24
|
import {getMessageObject} from '../../../../../utils/messageUtils';
|
|
25
|
-
import FormBuilder from '../../../../
|
|
26
|
-
import Header from '../../../../
|
|
27
|
-
import WechatRichmediaTemplatePreview from '../../../../
|
|
25
|
+
import FormBuilder from '../../../../v2Components/FormBuilder';
|
|
26
|
+
import Header from '../../../../v2Components/Header';
|
|
27
|
+
import WechatRichmediaTemplatePreview from '../../../../v2Components/TemplatePreview/WechatRichmediaTemplatePreview';
|
|
28
28
|
const MenuItem = Menu.Item;
|
|
29
29
|
export class Create extends React.Component { // eslint-disable-line react/prefer-stateless-function
|
|
30
30
|
constructor(props) {
|