@capillarytech/creatives-library 6.8.8 → 6.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/CapTagList/index.js +1 -1
- package/components/Edmeditor/index.js +1 -1
- package/components/FormBuilder/index.js +0 -1
- package/components/TemplatePreview/_templatePreview.scss +0 -6
- package/components/TemplatePreview/index.js +28 -35
- package/config/app.js +1 -1
- package/containers/TagList/index.js +3 -3
- package/index.html +5 -0
- package/package.json +2 -1
- package/services/api.js +16 -1
- package/v2Components/BeeEditor/index.js +272 -0
- package/v2Components/BeeEditor/messages.js +47 -0
- package/v2Components/BeeEditor/tests/index.test.js +10 -0
- package/v2Components/CapTagList/index.js +55 -26
- package/v2Components/CmsTemplatesComponent/index.js +4 -4
- package/v2Components/Edmeditor/index.js +1 -1
- package/v2Components/FormBuilder/index.js +117 -43
- package/v2Components/TemplatePreview/WechatRichmediaTemplatePreview/_wechatRichmediaTemplatePrev.scss +151 -151
- package/v2Components/TemplatePreview/WechatRichmediaTemplatePreview/messages.js +33 -33
- package/v2Components/TemplatePreview/WechatRichmediaTemplatePreview/tests/index.test.js +10 -10
- package/v2Components/TemplatePreview/_templatePreview.scss +0 -1
- package/v2Components/TemplatePreview/assets/images/androidPushMessage.svg +44 -44
- package/v2Components/TemplatePreview/assets/images/home-screen-android.svg +21 -21
- package/v2Components/TemplatePreview/assets/images/home-screen-ios.svg +16 -16
- package/v2Components/TemplatePreview/assets/images/iPhonePushMessage.svg +134 -134
- package/v2Components/TemplatePreview/assets/images/mobile.svg +23 -23
- package/v2Components/TemplatePreview/assets/images/sms_mobile_android.svg +22 -22
- package/v2Components/TemplatePreview/assets/images/user-icon.svg +18 -18
- package/v2Components/TemplatePreview/assets/images/wechat-home-screen-android.svg +21 -21
- package/v2Components/TemplatePreview/assets/images/wechat-mobile.svg +77 -77
- package/v2Components/TemplatePreview/assets/images/wechat_mobile_android.svg +20 -20
- package/v2Components/TemplatePreview/index.js +29 -36
- package/v2Components/TemplatePreview/tests/index.test.js +10 -10
- package/v2Containers/CreativesContainer/SlideBoxContent.js +1 -7
- package/v2Containers/CreativesContainer/SlideBoxFooter.js +51 -51
- package/v2Containers/CreativesContainer/actions.js +27 -27
- package/v2Containers/CreativesContainer/constants.js +17 -17
- package/v2Containers/CreativesContainer/index.js +7 -2
- package/v2Containers/CreativesContainer/index.scss +44 -44
- package/v2Containers/CreativesContainer/messages.js +305 -305
- package/v2Containers/CreativesContainer/reducer.js +29 -29
- package/v2Containers/CreativesContainer/sagas.js +11 -11
- package/v2Containers/CreativesContainer/selectors.js +30 -30
- package/v2Containers/CreativesContainer/tests/actions.test.js +18 -18
- package/v2Containers/CreativesContainer/tests/index.test.js +10 -10
- package/v2Containers/CreativesContainer/tests/reducer.test.js +9 -9
- package/v2Containers/CreativesContainer/tests/sagas.test.js +15 -15
- package/v2Containers/CreativesContainer/tests/selectors.test.js +10 -10
- package/v2Containers/Email/constants.js +1 -0
- package/v2Containers/Email/index.js +209 -107
- package/v2Containers/Email/initialSchema.js +17 -2
- package/v2Containers/Email/sagas.js +2 -2
- package/v2Containers/Email/selectors.js +5 -0
- package/v2Containers/EmailWrapper/index.js +18 -3
- package/v2Containers/Line/Container/Image/index.js +19 -21
- package/v2Containers/Line/Container/ImageMap/constants.js +1 -2
- package/v2Containers/Line/Container/ImageMap/index.js +6 -31
- package/v2Containers/Line/Container/ImageMap/messages.js +0 -12
- package/v2Containers/Line/Container/Wrapper/index.js +1 -5
- package/v2Containers/Line/Container/Wrapper/messages.js +0 -4
- package/v2Containers/Line/Container/Wrapper/utils.js +16 -15
- package/v2Containers/Line/Container/_lineCreate.scss +2 -2
- package/v2Containers/Line/Container/actions.js +2 -4
- package/v2Containers/Line/Container/constants.js +0 -3
- package/v2Containers/Line/Container/index.js +11 -49
- package/v2Containers/Line/Container/reducer.js +2 -2
- package/v2Containers/Line/Container/sagas.js +2 -2
- package/v2Containers/Line/Container/style.js +1 -2
- package/v2Containers/TagList/index.js +6 -0
- package/v2Containers/Templates/_templates.scss +0 -9
- package/v2Containers/Templates/actions.js +122 -117
- package/v2Containers/Templates/constants.js +49 -47
- package/v2Containers/Templates/index.js +4 -35
- package/v2Containers/Templates/messages.js +0 -4
- package/v2Containers/Templates/reducer.js +153 -145
- package/v2Containers/Templates/sagas.js +179 -179
- package/v2Containers/Templates/selectors.js +19 -1
- package/v2Containers/Templates/tests/actions.test.js +18 -18
- package/v2Containers/Templates/tests/index.test.js +10 -10
- package/v2Containers/Templates/tests/reducer.test.js +9 -9
- package/v2Containers/Templates/tests/sagas.test.js +15 -15
- package/v2Containers/Templates/tests/selectors.test.js +10 -10
- package/v2Containers/TemplatesV2/TemplatesV2.style.js +29 -29
- package/v2Containers/TemplatesV2/actions.js +16 -16
- package/v2Containers/TemplatesV2/constants.js +10 -10
- package/v2Containers/TemplatesV2/messages.js +61 -61
- package/v2Containers/TemplatesV2/selectors.js +25 -25
- package/v2Containers/TemplatesV2/tests/actions.test.js +18 -18
- package/v2Containers/TemplatesV2/tests/index.test.js +10 -10
- package/v2Containers/TemplatesV2/tests/reducer.test.js +9 -9
- package/v2Containers/TemplatesV2/tests/sagas.test.js +15 -15
- package/v2Containers/TemplatesV2/tests/selectors.test.js +10 -10
- package/v2Components/Carousel/index.js +0 -120
- package/v2Components/Carousel/style.scss +0 -40
- package/v2Containers/Line/Container/ImageCarousel/Content.js +0 -554
- package/v2Containers/Line/Container/ImageCarousel/constants.js +0 -10
- package/v2Containers/Line/Container/ImageCarousel/index.js +0 -526
- package/v2Containers/Line/Container/ImageCarousel/messages.js +0 -178
- package/v2Containers/Line/Container/ImageCarousel/style.js +0 -61
|
@@ -156,50 +156,72 @@ class CapTagList extends React.Component { // eslint-disable-line react/prefer-s
|
|
|
156
156
|
}
|
|
157
157
|
|
|
158
158
|
render() {
|
|
159
|
-
const
|
|
159
|
+
const { hidePopover = false, tags = {}, intl = {}, moduleFilterEnabled, label, modalProps } = this.props;
|
|
160
|
+
const tg = tags;
|
|
161
|
+
const {formatMessage} = intl;
|
|
162
|
+
const { tagValue, expandedKeys, autoExpandParent, searchValue, visible } = this.state;
|
|
160
163
|
const options = [
|
|
161
164
|
{
|
|
162
165
|
value: "All",
|
|
163
|
-
label:
|
|
166
|
+
label: formatMessage(messages.all),
|
|
164
167
|
key: 'all',
|
|
165
168
|
},
|
|
166
169
|
{
|
|
167
170
|
value: "Outbound",
|
|
168
|
-
label:
|
|
171
|
+
label: formatMessage(messages.outbound),
|
|
169
172
|
key: 'outbound',
|
|
170
173
|
},
|
|
171
174
|
{
|
|
172
175
|
value: "Loyalty",
|
|
173
|
-
label:
|
|
176
|
+
label: formatMessage(messages.loyalty),
|
|
174
177
|
key: 'loyalty',
|
|
175
178
|
},
|
|
176
179
|
];
|
|
180
|
+
const contentSection = (<div>
|
|
181
|
+
<CapSpin tip={formatMessage(messages.gettingTags)} spinning={this.props.loading}>
|
|
182
|
+
<Search
|
|
183
|
+
style={{ marginBottom: 8, width: '250px'}}
|
|
184
|
+
placeholder={formatMessage(messages.search)}
|
|
185
|
+
onChange={this.onChange} />
|
|
186
|
+
{moduleFilterEnabled ?
|
|
187
|
+
<CapSelect
|
|
188
|
+
getPopupContainer={(triggerNode) => triggerNode.parentNode}
|
|
189
|
+
style={{width: '250px', marginBottom: '16px', minWidth: 'initial', display: 'inherit'}}
|
|
190
|
+
onChange={this.props.onContextChange}
|
|
191
|
+
defaultValue={formatMessage(messages.all)}
|
|
192
|
+
options={options}>
|
|
193
|
+
</CapSelect> : ''}
|
|
194
|
+
<CapTree
|
|
195
|
+
styling={{height: '350px', overflow: 'auto'}}
|
|
196
|
+
onSelect={this.handleOnSelect}
|
|
197
|
+
selectedKeys={tagValue}
|
|
198
|
+
expandedKeys={expandedKeys}
|
|
199
|
+
autoExpandParent={autoExpandParent}
|
|
200
|
+
onExpand={this.onExpand}
|
|
201
|
+
>
|
|
202
|
+
{this.renderTags(tg, searchValue)}
|
|
203
|
+
</CapTree>
|
|
204
|
+
</CapSpin>
|
|
205
|
+
</div>);
|
|
177
206
|
return (
|
|
178
|
-
|
|
207
|
+
<>
|
|
208
|
+
{hidePopover ? <CapModal
|
|
209
|
+
visible={this.props.visibleTaglist}
|
|
210
|
+
footer={[]}
|
|
211
|
+
{...modalProps}
|
|
212
|
+
>
|
|
213
|
+
{contentSection}
|
|
214
|
+
</CapModal> :
|
|
179
215
|
<CapPopover
|
|
180
|
-
visible={
|
|
216
|
+
visible={visible}
|
|
181
217
|
onVisibleChange={this.togglePopoverVisibility}
|
|
182
|
-
content={
|
|
183
|
-
<CapSpin tip={this.props.intl.formatMessage(messages.gettingTags)} spinning={this.props.loading}>
|
|
184
|
-
<Search style={{ marginBottom: 8, width: '250px'}} placeholder={this.props.intl.formatMessage(messages.search)} onChange={this.onChange} />
|
|
185
|
-
{this.props.moduleFilterEnabled ? <CapSelect getPopupContainer={(triggerNode) => triggerNode.parentNode} style={{width: '250px', marginBottom: '16px', minWidth: 'initial', display: 'inherit'}} onChange={this.props.onContextChange} defaultValue={this.props.intl.formatMessage(messages.all)} options={options}>
|
|
186
|
-
</CapSelect> : ''}
|
|
187
|
-
<CapTree
|
|
188
|
-
styling={{height: '350px', overflow: 'auto'}}
|
|
189
|
-
onSelect={this.handleOnSelect}
|
|
190
|
-
selectedKeys={this.state.tagValue}
|
|
191
|
-
expandedKeys={this.state.expandedKeys}
|
|
192
|
-
autoExpandParent={this.state.autoExpandParent}
|
|
193
|
-
onExpand={this.onExpand}
|
|
194
|
-
>
|
|
195
|
-
{this.renderTags(tg, this.state.searchValue)}
|
|
196
|
-
</CapTree>
|
|
197
|
-
</CapSpin>
|
|
198
|
-
</div>}
|
|
218
|
+
content={contentSection}
|
|
199
219
|
trigger="click"
|
|
200
|
-
placement="
|
|
201
|
-
|
|
220
|
+
placement="topLeft"
|
|
221
|
+
>
|
|
222
|
+
<CapButton isAddBtn type="flat">{label || ''}</CapButton>
|
|
202
223
|
</CapPopover>
|
|
224
|
+
}
|
|
203
225
|
<CapModal
|
|
204
226
|
visible={this.state.showModal}
|
|
205
227
|
title={this.props.intl.formatMessage(messages["Dynamic Days before Expiry"])}
|
|
@@ -215,7 +237,7 @@ class CapTagList extends React.Component { // eslint-disable-line react/prefer-s
|
|
|
215
237
|
<p>{this.props.intl.formatMessage(messages.numberOfDaysBeforeExpiry)}</p>
|
|
216
238
|
<CapInput onChange={this.handleDynamicDateChange} value={this.state.dynamicDateValue} size="default"></CapInput>
|
|
217
239
|
</CapModal>
|
|
218
|
-
|
|
240
|
+
</>
|
|
219
241
|
);
|
|
220
242
|
}
|
|
221
243
|
}
|
|
@@ -228,6 +250,13 @@ CapTagList.propTypes = {
|
|
|
228
250
|
loading: PropTypes.bool,
|
|
229
251
|
moduleFilterEnabled: PropTypes.bool,
|
|
230
252
|
intl: intlShape.isRequired,
|
|
253
|
+
visibleTaglist: PropTypes.bool,
|
|
254
|
+
hidePopover: PropTypes.bool,
|
|
255
|
+
modalProps: PropTypes.any,
|
|
256
|
+
};
|
|
257
|
+
|
|
258
|
+
CapTagList.defaultValue = {
|
|
259
|
+
hidePopover: false,
|
|
231
260
|
};
|
|
232
261
|
|
|
233
262
|
export default injectIntl(CapTagList);
|
|
@@ -7,23 +7,23 @@
|
|
|
7
7
|
import React from 'react';
|
|
8
8
|
import PropTypes from 'prop-types';
|
|
9
9
|
// import styled from 'styled-components';
|
|
10
|
-
import {CapButton, CapCustomCard} from '@capillarytech/cap-ui-library';
|
|
10
|
+
import {CapButton, CapCustomCard, CapSpin} from '@capillarytech/cap-ui-library';
|
|
11
11
|
import { FormattedMessage } from 'react-intl';
|
|
12
12
|
import messages from './messages';
|
|
13
13
|
const {CapCustomCardList} = CapCustomCard;
|
|
14
14
|
function CmsTemplatesComponent(props) {
|
|
15
|
-
const cardDataList = props.cmsTemplates.map((template) => (
|
|
15
|
+
const cardDataList = (props.cmsTemplates || []).map((template) => (
|
|
16
16
|
{
|
|
17
17
|
key: template.name,
|
|
18
18
|
title: template.name,
|
|
19
19
|
url: template.versions.base.preview_http_url,
|
|
20
20
|
hoverOption: <CapButton onClick={() => props.handleEdmDefaultTemplateSelection(template._id)}><FormattedMessage {...messages.select}/></CapButton>,
|
|
21
21
|
}));
|
|
22
|
-
return (<
|
|
22
|
+
return (<CapSpin spinning={props.cmsTemplatesLoader}>
|
|
23
23
|
<div className="pagination-container">
|
|
24
24
|
<CapCustomCardList cardList={cardDataList} type="Email" />
|
|
25
25
|
</div>
|
|
26
|
-
</
|
|
26
|
+
</CapSpin>);
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
CmsTemplatesComponent.propTypes = {
|
|
@@ -44,7 +44,7 @@ class Edmeditor extends React.Component { // eslint-disable-line react/prefer-st
|
|
|
44
44
|
console.log('current language edm editor loading', this.props.id, this.props.edmSrc);
|
|
45
45
|
return (
|
|
46
46
|
this.props.edmSrc ?
|
|
47
|
-
(<iframe id={this.props.id} className={this.props.activeClass} src={this.props.edmSrc} height="460" width="100%" style={{
|
|
47
|
+
(<iframe id={this.props.id} className={this.props.activeClass} src={this.props.edmSrc} height="460" width="100%" style={{height: "calc(100vh - 180px)"}}></iframe>)
|
|
48
48
|
: 'aaasass'
|
|
49
49
|
);
|
|
50
50
|
}
|
|
@@ -11,7 +11,7 @@ import PropTypes from 'prop-types';
|
|
|
11
11
|
import React from 'react';
|
|
12
12
|
import _ from 'lodash';
|
|
13
13
|
import { Tabs, Table, Modal} from 'antd';
|
|
14
|
-
import { CapDrawer, CapButton, CapInput, CapPopover, CapImage, CapCheckbox, CapRadio, CapSelect, CapTable, CapRow, CapColumn, CapNotification, CapUploader, CapHeading, CapIcon} from '@capillarytech/cap-ui-library';
|
|
14
|
+
import { CapSpin, CapDrawer, CapButton, CapInput, CapPopover, CapImage, CapCheckbox, CapRadio, CapSelect, CapTable, CapRow, CapColumn, CapNotification, CapUploader, CapHeading, CapIcon} from '@capillarytech/cap-ui-library';
|
|
15
15
|
import { injectIntl, intlShape, FormattedMessage } from 'react-intl';
|
|
16
16
|
import LabelHOC from '@capillarytech/cap-ui-library/assets/HOCs/ComponentWithLabelHOC';
|
|
17
17
|
import { CAP_SPACE_12, CAP_SPACE_08, FONT_COLOR_05, FONT_COLOR_04 } from '@capillarytech/cap-ui-library/styled/variables';
|
|
@@ -21,6 +21,7 @@ import SlideBox from '../SlideBox';
|
|
|
21
21
|
import CardGrid from '../CardGrid';
|
|
22
22
|
import CKEditor from "../Ckeditor/";
|
|
23
23
|
import EDMEditor from "../Edmeditor";
|
|
24
|
+
import BeeEditor from '../BeeEditor';
|
|
24
25
|
import CustomPopOver from '../CustomPopOver';
|
|
25
26
|
import messages from './messages';
|
|
26
27
|
import './_formBuilder.scss';
|
|
@@ -275,7 +276,6 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
275
276
|
onEdit() {
|
|
276
277
|
|
|
277
278
|
}
|
|
278
|
-
|
|
279
279
|
getModal = () => {
|
|
280
280
|
let modal;
|
|
281
281
|
if (this.state.modal) {
|
|
@@ -925,7 +925,10 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
925
925
|
for (var i = 0; i < data.selectedLanguages.length; i+= 1) {
|
|
926
926
|
const currentLang = data.selectedLanguages[i];
|
|
927
927
|
const content = data[currentLang]['template-content'];
|
|
928
|
-
|
|
928
|
+
if (!content) {
|
|
929
|
+
return false;
|
|
930
|
+
}
|
|
931
|
+
const tagValidationResponse = this.validateTags(content, tags, injectedTags);;
|
|
929
932
|
if (errorData[index][currentLang] === undefined) {
|
|
930
933
|
errorData[index][currentLang] = {};
|
|
931
934
|
}
|
|
@@ -2953,24 +2956,28 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
2953
2956
|
if (channel === 'EMAIL') {
|
|
2954
2957
|
moduleFilterEnabled = this.props.isFullMode;
|
|
2955
2958
|
}
|
|
2956
|
-
|
|
2957
|
-
|
|
2958
|
-
|
|
2959
|
-
|
|
2960
|
-
|
|
2961
|
-
|
|
2962
|
-
|
|
2963
|
-
|
|
2964
|
-
|
|
2965
|
-
|
|
2966
|
-
|
|
2967
|
-
|
|
2968
|
-
|
|
2969
|
-
|
|
2970
|
-
|
|
2971
|
-
|
|
2972
|
-
|
|
2973
|
-
|
|
2959
|
+
const langIndex = 0;
|
|
2960
|
+
const currentLang = (!_.isEmpty(this.state.formData) && !_.isEmpty(this.state.formData[`${this.state.currentTab - 1}`]) && !_.isEmpty(this.state.formData[`${this.state.currentTab - 1}`].selectedLanguages) && this.state.formData[`${this.state.currentTab - 1}`].selectedLanguages[langIndex]) ? this.state.formData[`${this.state.currentTab - 1}`].selectedLanguages[langIndex] : this.props.baseLanguage;
|
|
2961
|
+
if (!(_.get(this.state, `formData[${this.state.currentTab - 1}][${currentLang}].is_drag_drop`, false)) || channel !== 'EMAIL') {
|
|
2962
|
+
columns.push(
|
|
2963
|
+
<CapColumn key={`input-${val.id}`} offset={val.offset} span={val.width ? val.width : ''} style={val.style ? val.style : {marginBottom: '16px'}}>
|
|
2964
|
+
<TagList
|
|
2965
|
+
key={`input-${val.id}`}
|
|
2966
|
+
moduleFilterEnabled={moduleFilterEnabled}
|
|
2967
|
+
label={val.label ? val.label : ''}
|
|
2968
|
+
onTagSelect={(data) => this.callChildEvent(data, val, 'onTagSelect')}
|
|
2969
|
+
onContextChange={this.props.onContextChange}
|
|
2970
|
+
location={this.props.location}
|
|
2971
|
+
tags={this.props.tags ? this.props.tags : []}
|
|
2972
|
+
injectedTags={this.props.injectedTags ? this.props.injectedTags : {}}
|
|
2973
|
+
className={val.className ? val.className : ''}
|
|
2974
|
+
id={val.id}
|
|
2975
|
+
userLocale={this.props.userLocale}
|
|
2976
|
+
selectedOfferDetails={this.props.selectedOfferDetails}
|
|
2977
|
+
/>
|
|
2978
|
+
</CapColumn>
|
|
2979
|
+
);
|
|
2980
|
+
}
|
|
2974
2981
|
break;
|
|
2975
2982
|
case "button":
|
|
2976
2983
|
if (styling === 'semantic' && val.metaType === 'submit-button') {
|
|
@@ -3191,38 +3198,92 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
3191
3198
|
}
|
|
3192
3199
|
}
|
|
3193
3200
|
break;
|
|
3194
|
-
|
|
3195
|
-
|
|
3196
|
-
|
|
3197
|
-
|
|
3201
|
+
// once bee tested completely will remove this code
|
|
3202
|
+
// case "edmeditor": {
|
|
3203
|
+
// // if (!this.state.formData[`${this.state.currentTab - 1}`]) {
|
|
3204
|
+
// // return true;
|
|
3205
|
+
// // }
|
|
3206
|
+
// let langTab = 1;
|
|
3207
|
+
// if (val.id.match(/edmeditor/g)) {
|
|
3208
|
+
// if (val.id.length > 9 && val.id.charAt(9)) {
|
|
3209
|
+
// langTab = val.id.charAt(9);
|
|
3210
|
+
// }
|
|
3211
|
+
// }
|
|
3212
|
+
// const supportedLanguages = this.state.formData[this.state.currentTab - 1].selectedLanguages;
|
|
3213
|
+
// // let langIndex = 0;
|
|
3214
|
+
// // if (val.id.indexOf('edmeditor') > -1 && val.id !== 'edmeditorsrc') {
|
|
3215
|
+
// // const test = val.id.replace('src', '');
|
|
3216
|
+
// // langIndex = parseInt(test.replace('edmeditor', ''), 10) - 1;
|
|
3217
|
+
// // }
|
|
3218
|
+
// // const currentLang = (!_.isEmpty(this.state.formData) && !_.isEmpty(this.state.formData[`${this.state.currentTab - 1}`]) && !_.isEmpty(this.state.formData[`${this.state.currentTab - 1}`].selectedLanguages) && this.state.formData[`${this.state.currentTab - 1}`].selectedLanguages[langIndex]) ? this.state.formData[`${this.state.currentTab - 1}`].selectedLanguages[langIndex] : this.props.baseLanguage;
|
|
3219
|
+
// const currentLang = supportedLanguages[langTab - 1];
|
|
3220
|
+
// const edmSrc = this.state.formData[`${this.state.currentTab - 1}`][currentLang] && this.state.formData[`${this.state.currentTab - 1}`][currentLang][`edmeditor${this.state.currentTab > 1 ? this.state.currentTab : ''}src`];
|
|
3221
|
+
|
|
3222
|
+
|
|
3223
|
+
// if (!edmSrc) {
|
|
3224
|
+
// return false;
|
|
3225
|
+
// }
|
|
3226
|
+
|
|
3227
|
+
|
|
3228
|
+
// columns.push(
|
|
3229
|
+
// <CapColumn style={val.colStyle ? val.colStyle : {}} span={val.width}>
|
|
3230
|
+
// <EDMEditor
|
|
3231
|
+
// id={val.id}
|
|
3232
|
+
// getEditorInstanse={this.getEditorInstanse}
|
|
3233
|
+
// edmSrc={edmSrc}
|
|
3234
|
+
// />
|
|
3235
|
+
// </CapColumn>
|
|
3236
|
+
// );
|
|
3237
|
+
// }
|
|
3238
|
+
// break;
|
|
3239
|
+
case "BEEeditor": {
|
|
3198
3240
|
let langTab = 1;
|
|
3199
|
-
if (val.id.match(/
|
|
3241
|
+
if (val.id.match(/BEEeditor/g)) {
|
|
3200
3242
|
if (val.id.length > 9 && val.id.charAt(9)) {
|
|
3201
3243
|
langTab = val.id.charAt(9);
|
|
3202
3244
|
}
|
|
3203
3245
|
}
|
|
3204
|
-
const
|
|
3205
|
-
|
|
3206
|
-
// if (val.id.indexOf('edmeditor') > -1 && val.id !== 'edmeditorsrc') {
|
|
3207
|
-
// const test = val.id.replace('src', '');
|
|
3208
|
-
// langIndex = parseInt(test.replace('edmeditor', ''), 10) - 1;
|
|
3209
|
-
// }
|
|
3210
|
-
// const currentLang = (!_.isEmpty(this.state.formData) && !_.isEmpty(this.state.formData[`${this.state.currentTab - 1}`]) && !_.isEmpty(this.state.formData[`${this.state.currentTab - 1}`].selectedLanguages) && this.state.formData[`${this.state.currentTab - 1}`].selectedLanguages[langIndex]) ? this.state.formData[`${this.state.currentTab - 1}`].selectedLanguages[langIndex] : this.props.baseLanguage;
|
|
3246
|
+
const { currentTab, formData } = this.state;
|
|
3247
|
+
const supportedLanguages = formData[currentTab - 1].selectedLanguages;
|
|
3211
3248
|
const currentLang = supportedLanguages[langTab - 1];
|
|
3212
|
-
const edmSrc = this.state.formData[`${this.state.currentTab - 1}`][currentLang] && this.state.formData[`${this.state.currentTab - 1}`][currentLang][`edmeditor${this.state.currentTab > 1 ? this.state.currentTab : ''}src`];
|
|
3213
|
-
|
|
3214
3249
|
|
|
3215
|
-
|
|
3250
|
+
let beeJson = '',
|
|
3251
|
+
beeToken = '',
|
|
3252
|
+
uuid = '';
|
|
3253
|
+
const data = formData[`${currentTab - 1}`][currentLang];
|
|
3254
|
+
if (data) {
|
|
3255
|
+
beeJson = data[`BEEeditor${currentTab > 1 ? currentTab : ''}json`];
|
|
3256
|
+
beeToken = data[`BEEeditor${currentTab > 1 ? currentTab : ''}token`];
|
|
3257
|
+
uuid = this.props.uuid;
|
|
3258
|
+
}
|
|
3259
|
+
if (!beeJson || !beeToken) {
|
|
3216
3260
|
return false;
|
|
3217
3261
|
}
|
|
3218
|
-
|
|
3219
|
-
|
|
3262
|
+
console.log('beeJson', beeJson);
|
|
3263
|
+
let isModuleFilterEnabled = _.get(this.props.location, 'query.type', '') !== 'embedded';
|
|
3264
|
+
const schemaChannel = _.get(this.props.schema, 'channel', "");
|
|
3265
|
+
if (schemaChannel === 'EMAIL') {
|
|
3266
|
+
isModuleFilterEnabled = this.props.isFullMode;
|
|
3267
|
+
}
|
|
3220
3268
|
columns.push(
|
|
3221
3269
|
<CapColumn style={val.colStyle ? val.colStyle : {}} span={val.width}>
|
|
3222
|
-
<
|
|
3270
|
+
<BeeEditor
|
|
3271
|
+
uid={uuid}
|
|
3272
|
+
tokenData={beeToken}
|
|
3223
3273
|
id={val.id}
|
|
3224
|
-
|
|
3225
|
-
|
|
3274
|
+
beeJson={beeJson}
|
|
3275
|
+
showTagsPopover={this.showTagsPopover}
|
|
3276
|
+
location={this.props.location}
|
|
3277
|
+
label={val.label || ''}
|
|
3278
|
+
className={val.className || ''}
|
|
3279
|
+
userLocale={this.props.userLocale}
|
|
3280
|
+
selectedOfferDetails={this.props.selectedOfferDetails}
|
|
3281
|
+
tags={this.props.tags || []}
|
|
3282
|
+
injectedTags={this.props.injectedTags ? this.props.injectedTags : {}}
|
|
3283
|
+
saveBeeInstance={this.props.saveBeeInstance}
|
|
3284
|
+
saveBeeData={this.props.saveBeeData}
|
|
3285
|
+
onContextChange={this.props.onContextChange}
|
|
3286
|
+
moduleFilterEnabled={isModuleFilterEnabled}
|
|
3226
3287
|
/>
|
|
3227
3288
|
</CapColumn>
|
|
3228
3289
|
);
|
|
@@ -3263,7 +3324,9 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
3263
3324
|
}
|
|
3264
3325
|
</CapRow>
|
|
3265
3326
|
);
|
|
3266
|
-
|
|
3327
|
+
if (columns.length) {
|
|
3328
|
+
fields.push(row);
|
|
3329
|
+
}
|
|
3267
3330
|
});
|
|
3268
3331
|
|
|
3269
3332
|
_.forEach(section.actionFields, (field) => {
|
|
@@ -3303,8 +3366,18 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
3303
3366
|
}
|
|
3304
3367
|
</CapRow>
|
|
3305
3368
|
);
|
|
3306
|
-
|
|
3369
|
+
if (columns.length) {
|
|
3370
|
+
fields.push(row);
|
|
3371
|
+
}
|
|
3372
|
+
|
|
3307
3373
|
});
|
|
3374
|
+
if(!this.props.isEmailLoading && !fields.length) {
|
|
3375
|
+
return (
|
|
3376
|
+
<div style={{ textAlign: 'center' }}>
|
|
3377
|
+
<CapSpin spinning />
|
|
3378
|
+
</div>
|
|
3379
|
+
);
|
|
3380
|
+
}
|
|
3308
3381
|
return fields;
|
|
3309
3382
|
}
|
|
3310
3383
|
|
|
@@ -3538,6 +3611,7 @@ FormBuilder.propTypes = {
|
|
|
3538
3611
|
setDrawerVisibility: PropTypes.bool,
|
|
3539
3612
|
capDrawerContent: PropTypes.array,
|
|
3540
3613
|
isFullMode: PropTypes.bool,
|
|
3614
|
+
|
|
3541
3615
|
};
|
|
3542
3616
|
|
|
3543
3617
|
export default injectIntl(FormBuilder);
|