@capillarytech/creatives-library 2.0.62 → 2.0.64
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/assets/NoImage1.js +50 -0
- package/assets/WithImage1.js +57 -0
- package/components/EmailPreview/assets/images/iPad.svg +10 -0
- package/components/EmailPreview/assets/images/mobile.png +0 -0
- package/components/FormBuilder/_formBuilder.scss +7 -1
- package/components/FormBuilder/index.js +97 -65
- package/components/MobilePushPreviewV2/index.js +120 -0
- package/components/MobilePushPreviewV2/messages.js +13 -0
- package/components/MobilePushPreviewV2/tests/index.test.js +10 -0
- package/components/TemplatePreview/index.js +1 -1
- package/containers/CreativesContainer/SlideBoxContent.js +27 -4
- package/containers/CreativesContainer/SlideBoxFooter.js +3 -3
- package/containers/CreativesContainer/index.js +71 -24
- package/containers/MobilePush/Create/_mobilePushCreate.scss +13 -0
- package/containers/MobilePush/Create/actions.js +6 -0
- package/containers/MobilePush/Create/constants.js +1 -0
- package/containers/MobilePush/Create/index.js +630 -1130
- package/containers/MobilePush/Create/messages.js +5 -1
- package/containers/MobilePush/Create/reducer.js +2 -0
- package/containers/MobilePush/Create/selectors.js +3 -3
- package/containers/MobilePush/Edit/_mobilePushCreate.scss +10 -0
- package/containers/MobilePush/Edit/index.js +375 -1106
- package/containers/MobilePush/Edit/messages.js +4 -0
- package/containers/MobilePush/Edit/reducer.js +2 -1
- package/containers/MobilePush/Edit/selectors.js +3 -1
- package/containers/MobilePush/commonMethods.js +249 -0
- package/containers/MobilePush/eventsMap.js +127 -0
- package/containers/MobilePush/initialSchema.js +1751 -0
- package/containers/MobilepushWrapper/_mobilepushWrapper.scss +18 -0
- package/containers/MobilepushWrapper/index.js +95 -0
- package/containers/MobilepushWrapper/messages.js +25 -0
- package/containers/MobilepushWrapper/tests/index.test.js +10 -0
- package/containers/WeChat/_wechat.scss +8 -0
- package/containers/WeChat/actions.js +52 -0
- package/containers/WeChat/constants.js +28 -0
- package/containers/WeChat/index.js +1635 -0
- package/containers/WeChat/messages.js +73 -0
- package/containers/WeChat/reducer.js +74 -0
- package/containers/WeChat/sagas.js +86 -0
- package/containers/WeChat/selectors.js +25 -0
- package/containers/WeChat/tests/actions.test.js +18 -0
- package/containers/WeChat/tests/index.test.js +10 -0
- package/containers/WeChat/tests/reducer.test.js +9 -0
- package/containers/WeChat/tests/sagas.test.js +15 -0
- package/containers/WeChat/tests/selectors.test.js +10 -0
- package/index.js +1 -1
- package/package.json +1 -1
- package/services/api.js +3 -0
|
@@ -12,9 +12,11 @@ import {bindActionCreators} from "redux";
|
|
|
12
12
|
import { connect } from 'react-redux';
|
|
13
13
|
import { Row, Col, Spin, Breadcrumb, notification } from 'antd';
|
|
14
14
|
import { createStructuredSelector } from 'reselect';
|
|
15
|
-
import { injectIntl, intlShape } from 'react-intl';
|
|
16
|
-
import _, {get} from 'lodash';
|
|
17
|
-
import {
|
|
15
|
+
import { injectIntl, intlShape, FormattedMessage } from 'react-intl';
|
|
16
|
+
import _, {get, findIndex, set, forEach, cloneDeep} from 'lodash';
|
|
17
|
+
import { CapSlideBox, CapHeader, CapTable, CapLink, CapRow, CapColumn, CapIcons} from '@capillarytech/cap-ui-library';
|
|
18
|
+
import styled from 'styled-components';
|
|
19
|
+
import {makeSelectEdit, makeSelectEditResponse, makeSelectTemplateDetailsResponse, makeSelectIosCta} from "./selectors";
|
|
18
20
|
import {makeSelectMetaEntities} from "../../Cap/selectors";
|
|
19
21
|
import {getMessageObject} from "../../../utils/messageUtils";
|
|
20
22
|
import FormBuilder from '../../../components/FormBuilder';
|
|
@@ -25,129 +27,19 @@ import {makeSelectTemplates} from "../../Templates/selectors";
|
|
|
25
27
|
import messages from './messages';
|
|
26
28
|
import './_mobilePushCreate.scss';
|
|
27
29
|
import callNativeEvent from '../../../utils/callNativeEvent';
|
|
28
|
-
|
|
29
30
|
import {makeSelectCreate} from "../Create/selectors";
|
|
31
|
+
|
|
32
|
+
import getEventsMap from '../eventsMap';
|
|
33
|
+
import {getPrimaryCtaFields, getSecondaryCtaFields, getLinkTypeFields} from '../commonMethods';
|
|
30
34
|
const BreadcrumbItem = Breadcrumb.Item;
|
|
31
35
|
|
|
36
|
+
const PrefixWrapper = styled.div`
|
|
37
|
+
margin-right: 16px;
|
|
38
|
+
`;
|
|
32
39
|
export class Edit extends React.Component { // eslint-disable-line react/prefer-stateless-function
|
|
33
40
|
constructor(props) {
|
|
34
41
|
super(props);
|
|
35
|
-
const
|
|
36
|
-
"template-name": {
|
|
37
|
-
onChange: this.onTemplateNameChange,
|
|
38
|
-
},
|
|
39
|
-
"cta-deeplink-secondary-cta-0": {
|
|
40
|
-
onChange: this.onLinkTypeChange,
|
|
41
|
-
},
|
|
42
|
-
"cta-deeplink-secondary-cta-1": {
|
|
43
|
-
onChange: this.onLinkTypeChange,
|
|
44
|
-
},
|
|
45
|
-
"cta-deeplink-delete": {
|
|
46
|
-
onDelete: this.deletePrimaryCTA,
|
|
47
|
-
},
|
|
48
|
-
"cta-deeplink2-delete": {
|
|
49
|
-
onDelete: this.deletePrimaryCTA,
|
|
50
|
-
},
|
|
51
|
-
"secondary-cta-0-delete": {
|
|
52
|
-
onDelete: this.deleteSecondaryCTA,
|
|
53
|
-
},
|
|
54
|
-
"secondary-cta-1-delete": {
|
|
55
|
-
onDelete: this.deleteSecondaryCTA,
|
|
56
|
-
},
|
|
57
|
-
"secondary-cta-1-delete-ios": {
|
|
58
|
-
onDelete: this.deleteSecondaryCtaIos,
|
|
59
|
-
},
|
|
60
|
-
"discard-button": {
|
|
61
|
-
discardValues: this.discardValues,
|
|
62
|
-
},
|
|
63
|
-
"cancel-button": {
|
|
64
|
-
cancelTemplate: this.cancelTemplate,
|
|
65
|
-
},
|
|
66
|
-
"copy-android-content": {
|
|
67
|
-
onClick: this.copyAndroidContent,
|
|
68
|
-
},
|
|
69
|
-
"copy-iphone-content": {
|
|
70
|
-
onClick: this.copyIphoneContent,
|
|
71
|
-
},
|
|
72
|
-
"save-button": {
|
|
73
|
-
saveFormData: this.saveFormData,
|
|
74
|
-
},
|
|
75
|
-
"message-editor": {
|
|
76
|
-
onChange: this.onTemplateContentChange,
|
|
77
|
-
},
|
|
78
|
-
"message-editor2": {
|
|
79
|
-
onChange: this.onTemplateContentChange,
|
|
80
|
-
},
|
|
81
|
-
"message-tagList": {
|
|
82
|
-
onTagSelect: this.onTagSelect,
|
|
83
|
-
},
|
|
84
|
-
"message-tagList2": {
|
|
85
|
-
onTagSelect: this.onTagSelect,
|
|
86
|
-
},
|
|
87
|
-
"title-tagList": {
|
|
88
|
-
onTagSelect: this.onTagSelect,
|
|
89
|
-
},
|
|
90
|
-
"title-tagList2": {
|
|
91
|
-
onTagSelect: this.onTagSelect,
|
|
92
|
-
},
|
|
93
|
-
"pane": {
|
|
94
|
-
onTabChange: this.onTabChange,
|
|
95
|
-
},
|
|
96
|
-
"cta-deeplink": {
|
|
97
|
-
onChange: this.onLinkTypeChange,
|
|
98
|
-
},
|
|
99
|
-
"cta-deeplink2": {
|
|
100
|
-
onChange: this.onLinkTypeChange,
|
|
101
|
-
},
|
|
102
|
-
"cta-deeplink-secondary-cta-1-select": {
|
|
103
|
-
onSelect: this.showCtaKeys,
|
|
104
|
-
},
|
|
105
|
-
"cta-deeplink-secondary-cta-1-select2": {
|
|
106
|
-
onSelect: this.showCtaKeys,
|
|
107
|
-
},
|
|
108
|
-
"cta-deeplink-secondary-cta-0-select": {
|
|
109
|
-
onSelect: this.showCtaKeys,
|
|
110
|
-
},
|
|
111
|
-
"cta-deeplink-select": {
|
|
112
|
-
onSelect: this.showCtaKeys,
|
|
113
|
-
},
|
|
114
|
-
"cta-deeplink2-select": {
|
|
115
|
-
onSelect: this.showCtaKeys,
|
|
116
|
-
},
|
|
117
|
-
"add-pri-cta": {
|
|
118
|
-
addPrimaryCta: this.addPrimaryCta,
|
|
119
|
-
},
|
|
120
|
-
"add-pri-cta-ios": {
|
|
121
|
-
addPrimaryCta: this.addPrimaryCta,
|
|
122
|
-
},
|
|
123
|
-
"add-sec-cta": {
|
|
124
|
-
addSecondaryCta: this.addSecondoryCta,
|
|
125
|
-
},
|
|
126
|
-
"add-sec-cta-ios": {
|
|
127
|
-
addSecondaryCtaIos: this.addSecondoryCtaIos,
|
|
128
|
-
},
|
|
129
|
-
"image-upload-android": {
|
|
130
|
-
onUpload: this.uploadImage,
|
|
131
|
-
},
|
|
132
|
-
"image-upload-ios": {
|
|
133
|
-
onUpload: this.uploadImage,
|
|
134
|
-
},
|
|
135
|
-
"secondary-cta-1-table": {
|
|
136
|
-
onRowClick: this.selectCtaIos,
|
|
137
|
-
},
|
|
138
|
-
"cta-deeplink-select-show-keys": {
|
|
139
|
-
onShowCtaKeys: this.showCtaKeys,
|
|
140
|
-
},
|
|
141
|
-
"cta-deeplink-secondary-cta-0-select-show-keys": {
|
|
142
|
-
onShowCtaKeys: this.showCtaKeys,
|
|
143
|
-
},
|
|
144
|
-
"cta-deeplink-secondary-cta-1-select-show-keys": {
|
|
145
|
-
onShowCtaKeys: this.showCtaKeys,
|
|
146
|
-
},
|
|
147
|
-
"mobilepush-template": {
|
|
148
|
-
onSelect: this.onTemplateChange,
|
|
149
|
-
},
|
|
150
|
-
};
|
|
42
|
+
const eventsMap = getEventsMap(this);
|
|
151
43
|
this.state = {
|
|
152
44
|
formData: {},
|
|
153
45
|
tabCount: 1,
|
|
@@ -158,9 +50,12 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
158
50
|
isFormValid: true,
|
|
159
51
|
injectedTags: {},
|
|
160
52
|
showModal: false,
|
|
161
|
-
eventsMap
|
|
53
|
+
eventsMap,
|
|
162
54
|
modalContent: {title: "Alert", body: this.props.intl.formatMessage(messages['template not configured,']), type: 'confirm'},
|
|
163
55
|
};
|
|
56
|
+
this.getPrimaryCtaFields = getPrimaryCtaFields.bind(this);
|
|
57
|
+
this.getSecondaryCtaFields = getSecondaryCtaFields.bind(this);
|
|
58
|
+
this.getLinkTypeFields = getLinkTypeFields.bind(this);
|
|
164
59
|
}
|
|
165
60
|
componentWillMount() {
|
|
166
61
|
console.log('edit mounting');
|
|
@@ -176,6 +71,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
176
71
|
const query = {
|
|
177
72
|
layout: 'MOBILEPUSH',
|
|
178
73
|
type: 'LAYOUT',
|
|
74
|
+
version: "v2",
|
|
179
75
|
};
|
|
180
76
|
this.props.globalActions.fetchSchemaForEntity(query);
|
|
181
77
|
console.log(this.props.params);
|
|
@@ -236,10 +132,24 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
236
132
|
this.setTemplateOptions(nextProps.Edit.mobilepushTemplates);
|
|
237
133
|
}
|
|
238
134
|
}
|
|
239
|
-
if (nextProps.templateDetails &&
|
|
135
|
+
if (!_.isEmpty(nextProps.templateDetails) && _.isEmpty(this.state.editData) && !_.isEmpty(this.state.fullSchema) && selectedWeChatAccount && (this.props.location.query.type !== 'embedded' || this.props.isFullMode === false)) {
|
|
240
136
|
this.props = nextProps;
|
|
241
137
|
const mode = nextProps.templateDetails.definition ? nextProps.templateDetails.definition.mode : nextProps.templateDetails.mode;
|
|
242
138
|
const schema = mode === "text" ? this.state.fullSchema.textSchema : this.state.fullSchema.imageSchema;
|
|
139
|
+
const isAndroidSupported = get(this, "props.Templates.selectedWeChatAccount.configs.android") === '1';
|
|
140
|
+
const isIosSupported = get(this, "props.Templates.selectedWeChatAccount.configs.ios") === '1';
|
|
141
|
+
if (!isAndroidSupported) {
|
|
142
|
+
const androidField = get(schema, "containers[0].panes[0]");
|
|
143
|
+
androidField.isSupported = false;
|
|
144
|
+
this.setState({currentTab: 2});
|
|
145
|
+
set(schema, "containers[0].panes[0]", androidField);
|
|
146
|
+
}
|
|
147
|
+
if (!isIosSupported) {
|
|
148
|
+
const iosField = get(schema, "containers[0].panes[1]");
|
|
149
|
+
iosField.isSupported = false;
|
|
150
|
+
|
|
151
|
+
set(schema, "containers[0].panes[1]", iosField);
|
|
152
|
+
}
|
|
243
153
|
this.setEditState(nextProps.templateDetails, schema);
|
|
244
154
|
this.getTags();
|
|
245
155
|
}
|
|
@@ -249,8 +159,8 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
249
159
|
this.setState({formData});
|
|
250
160
|
this.props.actions.clearAsset();
|
|
251
161
|
}
|
|
252
|
-
if (nextProps.
|
|
253
|
-
this.setState({
|
|
162
|
+
if (nextProps.iosCtasData) {
|
|
163
|
+
this.setState({showIosCtaTable: true});
|
|
254
164
|
}
|
|
255
165
|
if (nextProps.Edit.editResponse && nextProps.Edit.editResponse.templateId) {
|
|
256
166
|
console.log('reseting schema');
|
|
@@ -316,12 +226,13 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
316
226
|
onFormDataChange = (formData, tabCount, currentTab) => {
|
|
317
227
|
console.log('Form data changed is ', formData, tabCount, currentTab);
|
|
318
228
|
const newFormData = _.cloneDeep(formData);
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
newFormData[this.state.currentTab - 1][`secondary-cta-${this.state.currentTab - 1}-
|
|
229
|
+
const {templateCta} = this.state;
|
|
230
|
+
if (!_.isEmpty(templateCta)) {
|
|
231
|
+
newFormData[this.state.currentTab - 1][`secondary-cta-${this.state.currentTab - 1}-label`] = templateCta.name;
|
|
232
|
+
newFormData[this.state.currentTab - 1][`secondary-cta-${this.state.currentTab - 1}-action`] = templateCta.ctaTemplateDetails[0].buttonText;
|
|
322
233
|
delete newFormData[this.state.currentTab - 1][`secondary-cta-${this.state.currentTab - 1}-action2`];
|
|
323
|
-
if (
|
|
324
|
-
newFormData[this.state.currentTab - 1][`secondary-cta-${this.state.currentTab - 1}-action2`] =
|
|
234
|
+
if (templateCta.ctaTemplateDetails[1]) {
|
|
235
|
+
newFormData[this.state.currentTab - 1][`secondary-cta-${this.state.currentTab - 1}-action2`] = templateCta.ctaTemplateDetails[1].buttonText;
|
|
325
236
|
}
|
|
326
237
|
}
|
|
327
238
|
if (newFormData["mobilepush-accounts"] !== this.state.formData["mobilepush-accounts"]) {
|
|
@@ -344,157 +255,23 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
344
255
|
}
|
|
345
256
|
};
|
|
346
257
|
|
|
347
|
-
onLinkTypeChange = (eventTriggered, formData, field,
|
|
348
|
-
const currentTab = tabIndex || this.state.currentTab;
|
|
258
|
+
onLinkTypeChange = (eventTriggered, formData, field, currentTab, inputSchema) => {
|
|
349
259
|
const selectedWeChatAccount = (!_.isEmpty(this.props.Templates.selectedWeChatAccount) ? this.props.Templates.selectedWeChatAccount : this.props.Edit.selectedWeChatAccount);
|
|
350
260
|
const schema = inputSchema ? _.cloneDeep(inputSchema) : _.cloneDeep(this.state.schema);
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
const deeplinkValue = formData[currentTab - 1][field.id];
|
|
366
|
-
const componentIndex = fieldIndex + 1;
|
|
367
|
-
let inputId = deeplinkValue && deeplinkValue.toLowerCase() === "deeplink" ? `${col.id}-select` : `${col.id}-text`;
|
|
368
|
-
if (field.id === "cta-deeplink-secondary-cta-1" && (tabIndex > 1 || this.state.currentTab > 1)) {
|
|
369
|
-
inputId = `${inputId}${tabIndex || this.state.currentTab}`;
|
|
370
|
-
}
|
|
371
|
-
if ( deeplinkValue && deeplinkValue.toLowerCase() === "deeplink" && (fieldIndex === child.inputFields.length - 1 || child.inputFields[componentIndex].id !== "cta-deeplink-select-section")) {
|
|
372
|
-
const row = {
|
|
373
|
-
rowClassName: 'mobile-push-row',
|
|
374
|
-
id: 'cta-deeplink-select-section',
|
|
375
|
-
cols: [
|
|
376
|
-
{
|
|
377
|
-
id: "cta-label",
|
|
378
|
-
metaType: "label",
|
|
379
|
-
value: "",
|
|
380
|
-
primitive: true,
|
|
381
|
-
dynamicTab: false,
|
|
382
|
-
type: "div",
|
|
383
|
-
width: 4,
|
|
384
|
-
onlyDisplay: true,
|
|
385
|
-
colStyle: {
|
|
386
|
-
flex: 1,
|
|
387
|
-
},
|
|
388
|
-
},
|
|
389
|
-
{
|
|
390
|
-
id: inputId,
|
|
391
|
-
placeholder: "Select DeepLink",
|
|
392
|
-
type: "select", //Resembles component to be used
|
|
393
|
-
options: deepLinkOptions,
|
|
394
|
-
errorMessage: "Select a deeplink",
|
|
395
|
-
metaType: "text",
|
|
396
|
-
datatype: "string",
|
|
397
|
-
required: true,
|
|
398
|
-
fluid: true,
|
|
399
|
-
width: 19,
|
|
400
|
-
style: {
|
|
401
|
-
fontSize: '14px',
|
|
402
|
-
fontFamily: 'open-sans',
|
|
403
|
-
fontStyle: 'normal',
|
|
404
|
-
// fontWeight: 600,
|
|
405
|
-
marginBottom: '16px',
|
|
406
|
-
},
|
|
407
|
-
styling: "semantic",
|
|
408
|
-
order: 1,
|
|
409
|
-
disabled: this.props.location.query.type === 'embedded' && this.props.location.query.module !== "dvs",
|
|
410
|
-
customComponent: false,
|
|
411
|
-
supportedEvents: [
|
|
412
|
-
'onSelect',
|
|
413
|
-
],
|
|
414
|
-
},
|
|
415
|
-
],
|
|
416
|
-
};
|
|
417
|
-
if (!child.inputFields[fieldIndex + 1] || child.inputFields[componentIndex].id === "cta-external-link") {
|
|
418
|
-
formChaild.inputFields[componentIndex] = row;
|
|
419
|
-
} else {
|
|
420
|
-
formChaild.inputFields.splice(componentIndex, 0, row);
|
|
421
|
-
}
|
|
422
|
-
} else if ( deeplinkValue && deeplinkValue.toLowerCase() === "external link") {
|
|
423
|
-
const row = {
|
|
424
|
-
rowClassName: 'mobile-push-row',
|
|
425
|
-
id: 'cta-external-link',
|
|
426
|
-
cols: [
|
|
427
|
-
{
|
|
428
|
-
id: "cta-label",
|
|
429
|
-
metaType: "label",
|
|
430
|
-
value: "",
|
|
431
|
-
primitive: true,
|
|
432
|
-
dynamicTab: false,
|
|
433
|
-
type: "div",
|
|
434
|
-
width: 4,
|
|
435
|
-
offset: 0,
|
|
436
|
-
onlyDisplay: true,
|
|
437
|
-
},
|
|
438
|
-
{
|
|
439
|
-
id: inputId,
|
|
440
|
-
placeholder: "External Link",
|
|
441
|
-
type: "input", //Resembles component to be used
|
|
442
|
-
metaType: "text",
|
|
443
|
-
datatype: "string",
|
|
444
|
-
errorMessage: "External Link cannot be empty.",
|
|
445
|
-
required: true,
|
|
446
|
-
fluid: true,
|
|
447
|
-
width: 19,
|
|
448
|
-
style: {
|
|
449
|
-
fontSize: '14px',
|
|
450
|
-
fontFamily: 'open-sans',
|
|
451
|
-
fontStyle: 'normal',
|
|
452
|
-
// fontWeight: 600,
|
|
453
|
-
marginBottom: '16px',
|
|
454
|
-
},
|
|
455
|
-
styling: "semantic",
|
|
456
|
-
order: 1,
|
|
457
|
-
disabled: this.props.location.query.type === 'embedded' && this.props.location.query.module !== "dvs",
|
|
458
|
-
offSet: 4,
|
|
459
|
-
customComponent: false,
|
|
460
|
-
standalone: false,
|
|
461
|
-
},
|
|
462
|
-
],
|
|
463
|
-
};
|
|
464
|
-
if (!child.inputFields[fieldIndex + 1] || child.inputFields[componentIndex].id === "cta-deeplink-select-section") {
|
|
465
|
-
formChaild.inputFields[componentIndex] = row;
|
|
466
|
-
if (child.inputFields[componentIndex + 1] && child.inputFields[componentIndex + 1].id === "show-cta-deeplink-keys-label") {
|
|
467
|
-
formChaild.inputFields.splice(componentIndex + 1, 1);
|
|
468
|
-
}
|
|
469
|
-
if (child.inputFields[componentIndex + 1] && child.inputFields[componentIndex + 1].id === "cta-deeplink-keys") {
|
|
470
|
-
const dataIndex = tabIndex || this.state.currentTab;
|
|
471
|
-
let selector = `${col.id}-select`;
|
|
472
|
-
if (field.id === "cta-deeplink-secondary-cta-1" && (tabIndex > 1 || this.state.currentTab > 1)) {
|
|
473
|
-
selector = `${selector}${tabIndex || this.state.currentTab}`;
|
|
474
|
-
}
|
|
475
|
-
let configkeys = _.filter(JSON.parse(ck ? selectedWeChatAccount.configs.deeplink : '[]'), (dl) => dl.link === formData[dataIndex - 1][selector]);
|
|
476
|
-
if (configkeys[0]) {
|
|
477
|
-
configkeys = configkeys[0].keys;
|
|
478
|
-
}
|
|
479
|
-
if (configkeys.length) {
|
|
480
|
-
formChaild.inputFields = formChaild.inputFields.slice(0, componentIndex + 1).concat(formChaild.inputFields.slice( componentIndex + 1 + configkeys.length, formChaild.inputFields.length));
|
|
481
|
-
}
|
|
482
|
-
}
|
|
483
|
-
} else {
|
|
484
|
-
formChaild.inputFields.splice(componentIndex, 0, row);
|
|
485
|
-
}
|
|
486
|
-
}
|
|
487
|
-
}
|
|
488
|
-
});
|
|
489
|
-
}
|
|
490
|
-
});
|
|
491
|
-
}
|
|
492
|
-
});
|
|
493
|
-
});
|
|
494
|
-
});
|
|
495
|
-
});
|
|
496
|
-
});
|
|
497
|
-
if (tabIndex) {
|
|
261
|
+
const tabIndex = currentTab || this.state.currentTab;
|
|
262
|
+
const inputFields = get(schema, `containers[0].panes[${tabIndex - 1}].sections[0].childSections[0].childSections[0].inputFields`);
|
|
263
|
+
const id = field.id;
|
|
264
|
+
const fieldIndex = findIndex(inputFields, {identifier: id});
|
|
265
|
+
const ck = selectedWeChatAccount.configs ? !!selectedWeChatAccount.configs.deeplink : false;
|
|
266
|
+
const deepLinkOptions = _.map(JSON.parse(ck ? selectedWeChatAccount.configs.deeplink : '[]'), (link) => ({label: link.name, value: link.link, title: link.link }) );
|
|
267
|
+
// let inputId = deeplinkValue && deeplinkValue.toLowerCase() === "deeplink" ? `${id}-select` : `${id}-text`;
|
|
268
|
+
// if (field.id === "cta-deeplink-secondary-cta-1" && (tabIndex > 1 || this.state.currentTab > 1)) {
|
|
269
|
+
// inputId = `${inputId}${tabIndex || this.state.currentTab}`;
|
|
270
|
+
// }
|
|
271
|
+
const newInputFields = this.getLinkTypeFields({inputFieldsArgs: inputFields, fieldIndex, deepLinkOptions, formData, field});
|
|
272
|
+
set(schema, `containers[0].panes[${tabIndex - 1}].sections[0].childSections[0].childSections[0].inputFields`, newInputFields);
|
|
273
|
+
|
|
274
|
+
if (currentTab) { // identifying where ist called from setEditData or by event handler
|
|
498
275
|
return schema;
|
|
499
276
|
}
|
|
500
277
|
this.setState({schema, initialState: this.state.initialState ? this.state.initialState : this.state.schema, isSchemaChanged: true});
|
|
@@ -777,7 +554,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
777
554
|
type: ios['cta-deeplink-secondary-cta-1'] && (ios['cta-deeplink-secondary-cta-1'].toLowerCase() === "deeplink" ? "DEEP_LINK" : "EXTERNAL_URL"),
|
|
778
555
|
actionLink: ios['cta-deeplink-secondary-cta-1'] && (ios['cta-deeplink-secondary-cta-1'].toLowerCase() === "deeplink" ? ios['cta-deeplink-secondary-cta-1-select2'] : ios['cta-deeplink-secondary-cta-1-text2']),
|
|
779
556
|
ioscdeepLinkName: this.getLinkName(ios['cta-deeplink-secondary-cta-1-select']),
|
|
780
|
-
templateCtaId:
|
|
557
|
+
templateCtaId: get(this.state, "templateCta.ctaTemplateDetails[0].id"),
|
|
781
558
|
};
|
|
782
559
|
if (this.props.location.query.type === 'embedded') {
|
|
783
560
|
delete cta.ioscdeepLinkName;
|
|
@@ -817,7 +594,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
817
594
|
getMappedEvent = (id, event) => {
|
|
818
595
|
const map = this.state.eventsMap;
|
|
819
596
|
if (!map[id] || !map[id][event]) {
|
|
820
|
-
console.log(`error map[id] ${map[id]}` );
|
|
597
|
+
console.log(`error map[id] ${map[id]} ${id} ${event}` );
|
|
821
598
|
}
|
|
822
599
|
return map[id][event];
|
|
823
600
|
};
|
|
@@ -922,6 +699,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
922
699
|
}
|
|
923
700
|
formData[0] = android;
|
|
924
701
|
const ios = {};
|
|
702
|
+
const templateCta = {};
|
|
925
703
|
ios[`message-title2`] = iosData ? iosData.title : '';
|
|
926
704
|
ios['message-editor2'] = iosData ? iosData.message : '';
|
|
927
705
|
if (data.mode === "image") {
|
|
@@ -968,8 +746,12 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
968
746
|
ios[`custom-value-${param.split('=')[0]}-cta-deeplink-secondary-cta-1-select2`] = param.split('=')[1];
|
|
969
747
|
});
|
|
970
748
|
}
|
|
749
|
+
set(templateCta, "ctaTemplateDetails[0].buttonText", iosData.expandableDetails.ctas[0].actionLabel);
|
|
750
|
+
set(templateCta, "name", iosData.expandableDetails.ctas[0].actionText);
|
|
751
|
+
set(templateCta, "ctaTemplateDetails[0].id", iosData.expandableDetails.ctas[0].templateCtaId);
|
|
971
752
|
ios['secondary-cta-1-action'] = iosData.expandableDetails.ctas[0].actionLabel;
|
|
972
753
|
if (iosData.expandableDetails.ctas[0].actionLabel2) {
|
|
754
|
+
set(templateCta, "ctaTemplateDetails[1].buttonText", iosData.expandableDetails.ctas[0].actionLabel2);
|
|
973
755
|
ios['secondary-cta-1-action2'] = iosData.expandableDetails.ctas[0].actionLabel2;
|
|
974
756
|
}
|
|
975
757
|
}
|
|
@@ -980,42 +762,51 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
980
762
|
// formData[0].tabKey = '1';
|
|
981
763
|
// formData[1].tabKey = '2';
|
|
982
764
|
console.log('form data after discarding ', formData);
|
|
983
|
-
this.
|
|
984
|
-
|
|
765
|
+
this.setState({templateCta}, () => {
|
|
766
|
+
this.getSchemaForFormData(formData, schema);
|
|
767
|
+
this.setState({tabCount, formData, editData: data, currentTab: 1});
|
|
768
|
+
});
|
|
985
769
|
}
|
|
986
770
|
|
|
987
|
-
getSchemaForFormData = (
|
|
771
|
+
getSchemaForFormData = (formdata, inputSchema) => {
|
|
988
772
|
let schema = inputSchema;
|
|
773
|
+
const formData = _.cloneDeep(formdata);
|
|
989
774
|
if (!_.isEmpty(formData[0])) {
|
|
990
775
|
if (formData[0]['cta-deeplink']) {
|
|
991
|
-
|
|
776
|
+
formData[0]['add-pri-cta'] = true;
|
|
777
|
+
schema = this.addPrimaryCta(null, formData, {id: 'add-pri-cta'}, schema, 1);
|
|
992
778
|
schema = this.onLinkTypeChange(true, formData, {id: 'cta-deeplink'}, 1, schema);
|
|
993
779
|
schema = this.showCtaKeys(true, formData, {id: 'cta-deeplink-select'}, 1, schema);
|
|
994
780
|
}
|
|
995
781
|
if (formData[0]['cta-deeplink-secondary-cta-0']) {
|
|
996
|
-
|
|
782
|
+
formData[0]['add-sec-cta'] = true;
|
|
783
|
+
schema = this.addSecondoryCta(null, formData, {id: 'add-sec-cta'}, schema, 1);
|
|
997
784
|
schema = this.onLinkTypeChange(true, formData, {id: 'cta-deeplink-secondary-cta-0'}, 1, schema);
|
|
998
785
|
schema = this.showCtaKeys(true, formData, {id: 'cta-deeplink-secondary-cta-0-select'}, 1, schema);
|
|
999
786
|
}
|
|
1000
787
|
if (formData[0]['cta-deeplink-secondary-cta-1']) {
|
|
1001
|
-
|
|
788
|
+
formData[0]['add-sec-cta-2'] = true;
|
|
789
|
+
schema = this.addSecondoryCta(null, formData, {id: 'add-sec-cta-2'}, schema, 1);
|
|
1002
790
|
schema = this.onLinkTypeChange(true, formData, {id: 'cta-deeplink-secondary-cta-1'}, 1, schema);
|
|
1003
791
|
schema = this.showCtaKeys(true, formData, {id: 'cta-deeplink-secondary-cta-1-select'}, 1, schema);
|
|
1004
792
|
}
|
|
1005
793
|
}
|
|
1006
794
|
if (!_.isEmpty(formData[1])) {
|
|
1007
795
|
if (formData[1]['cta-deeplink2']) {
|
|
1008
|
-
|
|
796
|
+
formData[1]['add-pri-cta-ios'] = true;
|
|
797
|
+
schema = this.addPrimaryCta(null, formData, {id: 'add-pri-cta-ios'}, schema, 2);
|
|
1009
798
|
schema = this.onLinkTypeChange(true, formData, {id: 'cta-deeplink2'}, 2, schema);
|
|
1010
799
|
schema = this.showCtaKeys(true, formData, {id: 'cta-deeplink2-select'}, 2, schema);
|
|
1011
800
|
}
|
|
1012
801
|
if (formData[1]['secondary-cta-1-action']) {
|
|
802
|
+
formData[1]['add-sec-cta-ios'] = true;
|
|
803
|
+
|
|
1013
804
|
schema = this.showSelectedIosCta(schema, {id: 'add-sec-cta-ios'}, 2, undefined, formData[1]['cta-deeplink-secondary-cta-1']);
|
|
1014
805
|
schema = this.onLinkTypeChange(true, formData, {id: 'cta-deeplink-secondary-cta-1'}, 2, schema);
|
|
1015
806
|
schema = this.showCtaKeys(true, formData, {id: 'cta-deeplink-secondary-cta-1-select2'}, 2, schema);
|
|
1016
807
|
}
|
|
1017
808
|
}
|
|
1018
|
-
this.setState({schema, isSchemaChanged: true});
|
|
809
|
+
this.setState({schema, isSchemaChanged: true, formData});
|
|
1019
810
|
this.injectEvents(schema);
|
|
1020
811
|
};
|
|
1021
812
|
|
|
@@ -1111,218 +902,128 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
1111
902
|
}
|
|
1112
903
|
};
|
|
1113
904
|
|
|
1114
|
-
showSelectedIosCta = (inputSchema, field, tab, selectedConfig
|
|
905
|
+
showSelectedIosCta = (inputSchema, field, tab, selectedConfig) => {
|
|
1115
906
|
const currentTab = tab || this.state.currentTab;
|
|
1116
907
|
const schema = inputSchema ? _.cloneDeep(inputSchema) : _.cloneDeep(this.state.schema);
|
|
1117
908
|
const selectedWeChatAccount = (!_.isEmpty(this.props.Templates.selectedWeChatAccount) ? this.props.Templates.selectedWeChatAccount : this.props.Edit.selectedWeChatAccount);
|
|
1118
909
|
const ck = selectedWeChatAccount.configs ? !!selectedWeChatAccount.configs.deeplink : false;
|
|
1119
910
|
const deepLinkOptions = _.map(JSON.parse(ck ? selectedWeChatAccount.configs.deeplink : '[]'), (link) => ({label: link.name, value: link.link, title: link.link }) );
|
|
1120
911
|
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
912
|
+
const inputFields = get(schema, `containers[0].panes[${currentTab - 1}].sections[0].childSections[0].childSections[0].inputFields`);
|
|
913
|
+
forEach(inputFields, (inputField, fieldIndex) => {
|
|
914
|
+
forEach(inputField.cols, (col) => {
|
|
915
|
+
if (col.id === "add-sec-cta-ios") {
|
|
916
|
+
const inputId = `secondary-cta-${currentTab - 1}`;
|
|
917
|
+
inputFields.splice(fieldIndex + 1, 0, {
|
|
918
|
+
rowClassName: 'mobile-push-row',
|
|
919
|
+
cols: [
|
|
920
|
+
{
|
|
921
|
+
id: `${inputId}-action-display`,
|
|
922
|
+
metaType: "label",
|
|
923
|
+
value: <CapRow>
|
|
924
|
+
<CapColumn span={18}>
|
|
925
|
+
<CapHeader
|
|
926
|
+
title={this.state.templateCta.name}
|
|
927
|
+
description={get(this.state, "templateCta.ctaTemplateDetails[0].buttonText")}
|
|
928
|
+
size={"label"}/>
|
|
929
|
+
</CapColumn>
|
|
930
|
+
<CapColumn span={6}>
|
|
931
|
+
<CapLink title="change" onClick={() => this.addSecondoryCtaIos(true, this.state.formData, {id: "add-sec-cta-ios"})}/>
|
|
932
|
+
</CapColumn>
|
|
933
|
+
</CapRow>,
|
|
934
|
+
primitive: true,
|
|
935
|
+
dynamicTab: false,
|
|
936
|
+
type: "div",
|
|
937
|
+
width: 18,
|
|
938
|
+
offset: 1,
|
|
939
|
+
},
|
|
940
|
+
{
|
|
941
|
+
id: `${inputId}-action`,
|
|
942
|
+
metaType: "label",
|
|
943
|
+
value: "",
|
|
944
|
+
primitive: true,
|
|
945
|
+
dynamicTab: false,
|
|
946
|
+
type: "div",
|
|
947
|
+
width: 8,
|
|
948
|
+
offset: 0,
|
|
949
|
+
style: {
|
|
950
|
+
display: 'none',
|
|
951
|
+
},
|
|
952
|
+
},
|
|
953
|
+
{
|
|
954
|
+
id: `${inputId}-action2`,
|
|
955
|
+
metaType: "label",
|
|
956
|
+
value: "",
|
|
957
|
+
primitive: true,
|
|
958
|
+
dynamicTab: false,
|
|
959
|
+
type: "div",
|
|
960
|
+
width: 8,
|
|
961
|
+
offset: 0,
|
|
962
|
+
style: {display: 'none'},
|
|
963
|
+
},
|
|
1133
964
|
|
|
1134
|
-
|
|
1135
|
-
rowClassName: 'mobile-push-row',
|
|
1136
|
-
cols: [
|
|
1137
|
-
{
|
|
1138
|
-
id: `${inputId}-action-label`,
|
|
1139
|
-
metaType: "label",
|
|
1140
|
-
value: "Secondary CTA",
|
|
1141
|
-
primitive: true,
|
|
1142
|
-
dynamicTab: false,
|
|
1143
|
-
type: "div",
|
|
1144
|
-
width: 4,
|
|
1145
|
-
style: {
|
|
1146
|
-
backgroundColor: 'white',
|
|
1147
|
-
textAlign: 'left',
|
|
1148
|
-
color: '#333333',
|
|
1149
|
-
lineHeight: '24px',
|
|
1150
|
-
fontSize: '14px',
|
|
1151
|
-
fontFamily: 'open-sans',
|
|
1152
|
-
fontStyle: 'normal',
|
|
1153
|
-
paddingTop: '8px',
|
|
1154
|
-
},
|
|
1155
|
-
offset: 0,
|
|
1156
|
-
onlyDisplay: true,
|
|
1157
|
-
colStyle: {
|
|
1158
|
-
flex: 1,
|
|
1159
|
-
},
|
|
1160
|
-
},
|
|
1161
|
-
{
|
|
1162
|
-
id: `${inputId}-label`,
|
|
1163
|
-
metaType: "label",
|
|
1164
|
-
value: "",
|
|
1165
|
-
primitive: true,
|
|
1166
|
-
dynamicTab: false,
|
|
1167
|
-
type: "div",
|
|
1168
|
-
width: 18,
|
|
1169
|
-
style: {
|
|
1170
|
-
backgroundColor: 'white',
|
|
1171
|
-
textAlign: 'left',
|
|
1172
|
-
color: '#333333',
|
|
1173
|
-
lineHeight: '24px',
|
|
1174
|
-
fontSize: '14px',
|
|
1175
|
-
fontFamily: 'open-sans',
|
|
1176
|
-
fontStyle: 'normal',
|
|
1177
|
-
paddingTop: '8px',
|
|
1178
|
-
},
|
|
1179
|
-
offset: 0,
|
|
1180
|
-
colStyle: {
|
|
1181
|
-
flex: 1,
|
|
1182
|
-
},
|
|
1183
|
-
},
|
|
1184
|
-
{
|
|
1185
|
-
id: `${inputId}-delete-ios`,
|
|
1186
|
-
type: "icon",
|
|
1187
|
-
value: 'delete',
|
|
1188
|
-
width: 1,
|
|
1189
|
-
submitAction: "onDelete",
|
|
1190
|
-
supportedEvents: ["onDelete"],
|
|
1191
|
-
},
|
|
1192
|
-
],
|
|
1193
|
-
};
|
|
1194
|
-
formChaild.inputFields[fieldIndex + 1] = {
|
|
1195
|
-
rowClassName: 'mobile-push-row',
|
|
1196
|
-
cols: [
|
|
1197
|
-
{
|
|
1198
|
-
id: `${inputId}-action-label-empty`,
|
|
1199
|
-
metaType: "label",
|
|
1200
|
-
value: "",
|
|
1201
|
-
primitive: true,
|
|
1202
|
-
dynamicTab: false,
|
|
1203
|
-
type: "div",
|
|
1204
|
-
width: 4,
|
|
1205
|
-
colStyle: {
|
|
1206
|
-
flex: 1,
|
|
1207
|
-
},
|
|
1208
|
-
},
|
|
1209
|
-
{
|
|
1210
|
-
id: `${inputId}-action`,
|
|
1211
|
-
metaType: "label",
|
|
1212
|
-
value: "",
|
|
1213
|
-
primitive: true,
|
|
1214
|
-
dynamicTab: false,
|
|
1215
|
-
type: "div",
|
|
1216
|
-
width: 16,
|
|
1217
|
-
offset: 0,
|
|
1218
|
-
},
|
|
1219
|
-
{
|
|
1220
|
-
id: `${inputId}-action2`,
|
|
1221
|
-
metaType: "label",
|
|
1222
|
-
value: "",
|
|
1223
|
-
primitive: true,
|
|
1224
|
-
dynamicTab: false,
|
|
1225
|
-
type: "div",
|
|
1226
|
-
width: 8,
|
|
1227
|
-
offset: 0,
|
|
1228
|
-
style: {display: 'none'},
|
|
1229
|
-
},
|
|
1230
|
-
],
|
|
1231
|
-
};
|
|
1232
|
-
let showDeeplinkOption = selectedConfig ? (selectedConfig.id !== "16589g0g" && selectedConfig.id !== "17543720" && selectedConfig.id !== "1a491g56") : true;
|
|
1233
|
-
if (!selectedConfig) {
|
|
1234
|
-
showDeeplinkOption = showDeeplink;
|
|
1235
|
-
}
|
|
1236
|
-
if (showDeeplinkOption) {
|
|
1237
|
-
formChaild.inputFields[fieldIndex + 2] = {
|
|
1238
|
-
rowClassName: "mobile-push-row",
|
|
1239
|
-
cols: [
|
|
1240
|
-
{
|
|
1241
|
-
id: `${inputId}-action-label-empty`,
|
|
1242
|
-
metaType: "label",
|
|
1243
|
-
value: "",
|
|
1244
|
-
primitive: true,
|
|
1245
|
-
dynamicTab: false,
|
|
1246
|
-
type: "div",
|
|
1247
|
-
width: 4,
|
|
1248
|
-
offset: 0,
|
|
1249
|
-
onlyDisplay: true,
|
|
1250
|
-
},
|
|
1251
|
-
{
|
|
1252
|
-
id: `cta-deeplink-${inputId}`,
|
|
1253
|
-
type: "radioGroup", //Resembles component to be used
|
|
1254
|
-
metaType: "text",
|
|
1255
|
-
datatype: "string",
|
|
1256
|
-
options: ["Deeplink", "External Link"],
|
|
1257
|
-
value: "Deeplink",
|
|
1258
|
-
required: true,
|
|
1259
|
-
width: 16,
|
|
1260
|
-
offSet: 4,
|
|
1261
|
-
fluid: true,
|
|
1262
|
-
style: {
|
|
1263
|
-
fontFamily: 'open-sans',
|
|
1264
|
-
fontSize: '14px',
|
|
1265
|
-
lineHeight: '24px',
|
|
1266
|
-
},
|
|
1267
|
-
styling: "semantic",
|
|
1268
|
-
order: 1,
|
|
1269
|
-
supportedEvents: ["onChange"],
|
|
1270
|
-
customComponent: false,
|
|
1271
|
-
},
|
|
1272
|
-
],
|
|
1273
|
-
};
|
|
1274
|
-
formChaild.inputFields[fieldIndex + 3] = {
|
|
1275
|
-
rowClassName: 'mobile-push-row',
|
|
1276
|
-
id: 'cta-deeplink-select-section',
|
|
1277
|
-
cols: [
|
|
1278
|
-
{
|
|
1279
|
-
id: "cta-label",
|
|
1280
|
-
metaType: "label",
|
|
1281
|
-
value: "",
|
|
1282
|
-
primitive: true,
|
|
1283
|
-
dynamicTab: false,
|
|
1284
|
-
type: "div",
|
|
1285
|
-
width: 4,
|
|
1286
|
-
onlyDisplay: true,
|
|
1287
|
-
colStyle: {
|
|
1288
|
-
flex: 1,
|
|
1289
|
-
},
|
|
1290
|
-
},
|
|
1291
|
-
{
|
|
1292
|
-
id: `cta-deeplink-${inputId}-select2`,
|
|
1293
|
-
placeholder: "Select DeepLink",
|
|
1294
|
-
type: "select", //Resembles component to be used
|
|
1295
|
-
options: deepLinkOptions,
|
|
1296
|
-
errorMessage: "Select a deeplink",
|
|
1297
|
-
metaType: "text",
|
|
1298
|
-
datatype: "string",
|
|
1299
|
-
required: true,
|
|
1300
|
-
fluid: true,
|
|
1301
|
-
width: 19,
|
|
1302
|
-
style: {
|
|
1303
|
-
fontSize: '14px',
|
|
1304
|
-
fontFamily: 'open-sans',
|
|
1305
|
-
fontStyle: 'normal',
|
|
1306
|
-
// fontWeight: 600,
|
|
1307
|
-
marginBottom: '16px',
|
|
1308
|
-
},
|
|
1309
|
-
styling: "semantic",
|
|
1310
|
-
order: 1,
|
|
1311
|
-
customComponent: false,
|
|
1312
|
-
supportedEvents: [
|
|
1313
|
-
'onSelect',
|
|
1314
|
-
],
|
|
1315
|
-
},
|
|
1316
|
-
],
|
|
1317
|
-
};
|
|
1318
|
-
}
|
|
1319
|
-
}
|
|
1320
|
-
});
|
|
1321
|
-
});
|
|
1322
|
-
}
|
|
1323
|
-
});
|
|
965
|
+
],
|
|
1324
966
|
});
|
|
1325
|
-
|
|
967
|
+
if (selectedConfig && (selectedConfig.id !== "16589g0g" && selectedConfig.id !== "17543720" && selectedConfig.id !== "1a491g56")) {
|
|
968
|
+
inputFields.splice(fieldIndex + 2, 0, {
|
|
969
|
+
rowClassName: "mobile-push-row",
|
|
970
|
+
identifier: `cta-deeplink-${inputId}`,
|
|
971
|
+
cols: [
|
|
972
|
+
|
|
973
|
+
{
|
|
974
|
+
id: `cta-deeplink-${inputId}`,
|
|
975
|
+
type: "radioGroup", //Resembles component to be used
|
|
976
|
+
metaType: "text",
|
|
977
|
+
datatype: "string",
|
|
978
|
+
options: ["Deeplink", "External Link"],
|
|
979
|
+
inductiveText: ["A page within mobile app", "An external web page"],
|
|
980
|
+
value: "Deeplink",
|
|
981
|
+
required: true,
|
|
982
|
+
width: 18,
|
|
983
|
+
offset: 1,
|
|
984
|
+
errorMessage: "Please select link type",
|
|
985
|
+
fluid: true,
|
|
986
|
+
|
|
987
|
+
styling: "semantic",
|
|
988
|
+
order: 1,
|
|
989
|
+
supportedEvents: ["onChange"],
|
|
990
|
+
customComponent: false,
|
|
991
|
+
},
|
|
992
|
+
],
|
|
993
|
+
});
|
|
994
|
+
inputFields.splice(fieldIndex + 3, 0, {
|
|
995
|
+
rowClassName: 'mobile-push-row',
|
|
996
|
+
id: 'cta-deeplink-select-section',
|
|
997
|
+
identifier: `cta-deeplink-${inputId}-select2`,
|
|
998
|
+
cols: [
|
|
999
|
+
|
|
1000
|
+
{
|
|
1001
|
+
id: `cta-deeplink-${inputId}-select2`,
|
|
1002
|
+
placeholder: "Select DeepLink",
|
|
1003
|
+
type: "select", //Resembles component to be used
|
|
1004
|
+
options: deepLinkOptions,
|
|
1005
|
+
metaType: "text",
|
|
1006
|
+
datatype: "string",
|
|
1007
|
+
errorMessage: "Select a deeplink",
|
|
1008
|
+
required: true,
|
|
1009
|
+
fluid: true,
|
|
1010
|
+
width: 18,
|
|
1011
|
+
offset: 1,
|
|
1012
|
+
style: {
|
|
1013
|
+
width: '100%',
|
|
1014
|
+
marginBottom: '16px',
|
|
1015
|
+
},
|
|
1016
|
+
styling: "semantic",
|
|
1017
|
+
order: 1,
|
|
1018
|
+
customComponent: false,
|
|
1019
|
+
supportedEvents: [
|
|
1020
|
+
'onSelect',
|
|
1021
|
+
],
|
|
1022
|
+
},
|
|
1023
|
+
],
|
|
1024
|
+
});
|
|
1025
|
+
}
|
|
1026
|
+
}
|
|
1326
1027
|
});
|
|
1327
1028
|
});
|
|
1328
1029
|
if (!inputSchema) {
|
|
@@ -1416,98 +1117,19 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
1416
1117
|
this.injectEvents(schema);
|
|
1417
1118
|
};
|
|
1418
1119
|
|
|
1419
|
-
deleteSecondaryCtaIos = (
|
|
1420
|
-
const
|
|
1421
|
-
const
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
_.forEach(schema.containers, (container) => {
|
|
1429
|
-
_.forEach(container.panes, (pane) => {
|
|
1430
|
-
_.forEach(pane.sections, (section) => {
|
|
1431
|
-
_.forEach(section.childSections, (childeSection) => {
|
|
1432
|
-
_.forEach(childeSection.childSections, (formChild) => {
|
|
1433
|
-
const child = formChild;
|
|
1434
|
-
if (child.type === 'multicols') {
|
|
1435
|
-
_.forEach(child.inputFields, (inputField, fieldIndex) => {
|
|
1436
|
-
if (inputField) {
|
|
1437
|
-
_.forEach(inputField.cols, (col) => {
|
|
1438
|
-
if (col.id === id) {
|
|
1439
|
-
if (device === 'ios') {
|
|
1440
|
-
child.inputFields.splice(fieldIndex, 3);
|
|
1441
|
-
delete formData[self.state.currentTab - 1][`secondary-cta-1-action`];
|
|
1442
|
-
delete formData[self.state.currentTab - 1][`secondary-cta-1-action2`];
|
|
1443
|
-
delete formData[self.state.currentTab - 1][`secondary-cta-1-label`];
|
|
1444
|
-
delete formData[self.state.currentTab - 1][`cta-deeplink-secondary-cta-1`];
|
|
1445
|
-
}
|
|
1446
|
-
if (child.inputFields[fieldIndex] && child.inputFields[fieldIndex].id === "cta-external-link") {
|
|
1447
|
-
child.inputFields.splice(fieldIndex, 1);
|
|
1448
|
-
delete formData[self.state.currentTab - 1][`cta-deeplink-secondary-cta-1-text2`];
|
|
1449
|
-
}
|
|
1450
|
-
if (child.inputFields[fieldIndex] && child.inputFields[fieldIndex].id === "cta-deeplink-select-section") {
|
|
1451
|
-
const ck = selectedWeChatAccount.configs ? !!selectedWeChatAccount.configs.deeplink : false;
|
|
1452
|
-
const configkeys = selectedWeChatAccount ? _.filter(JSON.parse(ck ? selectedWeChatAccount.configs.deeplink : '[]'), (dl) => dl.link === selectedDeeplink) : [];
|
|
1453
|
-
if (configkeys.length) {
|
|
1454
|
-
const options = configkeys[0].keys;
|
|
1455
|
-
_.forEach(options, (opt) => {
|
|
1456
|
-
delete formData[this.state.currentTab - 1][`custom-value-${opt}2-cta-deeplink-${id.replace('delete-ios', 'select2')}`];
|
|
1457
|
-
delete formData[this.state.currentTab - 1][`custom-value-${opt}-cta-deeplink-${id.replace('delete-ios', 'select2')}`];
|
|
1458
|
-
});
|
|
1459
|
-
child.inputFields = child.inputFields.slice(0, fieldIndex).concat(child.inputFields.slice( fieldIndex + options.length + 1, child.inputFields.length));
|
|
1460
|
-
|
|
1461
|
-
delete formData[this.state.currentTab - 1][`cta-deeplink-${id.replace('delete-ios', 'select2')}`];
|
|
1462
|
-
} else {
|
|
1463
|
-
child.inputFields.splice(fieldIndex, 1);
|
|
1464
|
-
}
|
|
1465
|
-
}
|
|
1466
|
-
if (device === 'ios') {
|
|
1467
|
-
child.inputFields[fieldIndex] = {
|
|
1468
|
-
cols: [
|
|
1469
|
-
{
|
|
1470
|
-
id: "add-sec-cta-ios",
|
|
1471
|
-
metaType: "label",
|
|
1472
|
-
value: "Add Secondary CTA",
|
|
1473
|
-
primitive: true,
|
|
1474
|
-
dynamicTab: false,
|
|
1475
|
-
type: "div",
|
|
1476
|
-
style: {
|
|
1477
|
-
backgroundColor: 'white',
|
|
1478
|
-
textAlign: 'left',
|
|
1479
|
-
color: '#2673D7',
|
|
1480
|
-
lineHeight: '24px',
|
|
1481
|
-
fontSize: '14px',
|
|
1482
|
-
marginTop: '16px',
|
|
1483
|
-
fontWeight: '600',
|
|
1484
|
-
fontFamily: 'open-sans',
|
|
1485
|
-
fontStyle: 'normal',
|
|
1486
|
-
cursor: 'pointer',
|
|
1487
|
-
},
|
|
1488
|
-
offset: 0,
|
|
1489
|
-
onlyDisplay: true,
|
|
1490
|
-
colStyle: {
|
|
1491
|
-
flex: 1,
|
|
1492
|
-
},
|
|
1493
|
-
submitAction: "addSecondaryCtaIos",
|
|
1494
|
-
supportedEvents: ["addSecondaryCtaIos"],
|
|
1495
|
-
},
|
|
1496
|
-
],
|
|
1497
|
-
};
|
|
1498
|
-
}
|
|
1499
|
-
}
|
|
1500
|
-
});
|
|
1501
|
-
}
|
|
1502
|
-
});
|
|
1503
|
-
}
|
|
1504
|
-
});
|
|
1505
|
-
});
|
|
1120
|
+
deleteSecondaryCtaIos = (callback) => {
|
|
1121
|
+
const schema = cloneDeep(this.state.schema);
|
|
1122
|
+
const inputFields = get(schema, `containers[0].panes[${this.state.currentTab - 1}].sections[0].childSections[0].childSections[0].inputFields`);
|
|
1123
|
+
forEach(inputFields, (inputField, fieldIndex) => {
|
|
1124
|
+
if (inputField) {
|
|
1125
|
+
forEach(inputField.cols, (col) => {
|
|
1126
|
+
if (col.id === "add-sec-cta-ios") {
|
|
1127
|
+
inputFields.splice(fieldIndex + 1, inputFields.length);
|
|
1128
|
+
}
|
|
1506
1129
|
});
|
|
1507
|
-
}
|
|
1130
|
+
}
|
|
1508
1131
|
});
|
|
1509
|
-
|
|
1510
|
-
this.setState({schema, initialState: this.state.initialState ? this.state.initialState : this.state.schema, formData, isSchemaChanged: true});
|
|
1132
|
+
this.setState({schema, initialState: this.state.initialState ? this.state.initialState : this.state.schema, isSchemaChanged: true}, callback);
|
|
1511
1133
|
this.injectEvents(schema);
|
|
1512
1134
|
};
|
|
1513
1135
|
|
|
@@ -1764,10 +1386,10 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
1764
1386
|
if (this.props.location.query.type === 'embedded' && ((temp.type === "tag-list" || temp.type === "div" || temp.type === "icon") && this.props.location.query.module !== "dvs") && (temp.supportedEvents)) {
|
|
1765
1387
|
temp.className = `${temp.className} hide`;
|
|
1766
1388
|
}
|
|
1767
|
-
if (this.props.location.query.type === 'embedded' && (temp.type === "input" || temp.type === "textarea" || temp.type === "radioGroup") && this.props.location.query.module !== "dvs") {
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
}
|
|
1389
|
+
// if (this.props.location.query.type === 'embedded' && (temp.type === "input" || temp.type === "textarea" || temp.type === "radioGroup") && this.props.location.query.module !== "dvs") {
|
|
1390
|
+
// temp.className = `${temp.className} disabled`;
|
|
1391
|
+
// temp.disabled = true;
|
|
1392
|
+
// }
|
|
1771
1393
|
if (this.props.location.query.type === 'embedded' && temp.id === "mobilepush-template" ) {
|
|
1772
1394
|
temp.options = this.state.templateOptions ? this.state.templateOptions : [];
|
|
1773
1395
|
}
|
|
@@ -1787,7 +1409,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
1787
1409
|
_.forEach(section.actionFields, (actionField) => {
|
|
1788
1410
|
_.forEach(actionField.cols, (col) => {
|
|
1789
1411
|
const temp = col;
|
|
1790
|
-
temp.disabled = this.props.location.query.type === 'embedded' && this.props.location.query.module !== "dvs";
|
|
1412
|
+
// temp.disabled = this.props.location.query.type === 'embedded' && this.props.location.query.module !== "dvs";
|
|
1791
1413
|
if (temp.type === 'popover') {
|
|
1792
1414
|
temp.content.sections = this.injectSections(temp.content.sections);
|
|
1793
1415
|
temp.value.sections = this.injectSections(temp.value.sections);
|
|
@@ -1866,114 +1488,49 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
1866
1488
|
const currentTab = tabIndex || this.state.currentTab;
|
|
1867
1489
|
const schema = _.cloneDeep(schemaInput || this.state.schema);
|
|
1868
1490
|
const eventsMap = _.cloneDeep(this.state.eventsMap);
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
},
|
|
1903
|
-
},
|
|
1904
|
-
{
|
|
1905
|
-
id: `${key}-label`,
|
|
1906
|
-
metaType: "label",
|
|
1907
|
-
value: key.replace('_', " "),
|
|
1908
|
-
primitive: true,
|
|
1909
|
-
dynamicTab: false,
|
|
1910
|
-
type: "div",
|
|
1911
|
-
width: 5,
|
|
1912
|
-
style: {
|
|
1913
|
-
backgroundColor: 'white',
|
|
1914
|
-
textAlign: 'left',
|
|
1915
|
-
lineHeight: '24px',
|
|
1916
|
-
fontSize: '14px',
|
|
1917
|
-
fontFamily: 'open-sans',
|
|
1918
|
-
fontStyle: 'normal',
|
|
1919
|
-
cursor: 'pointer',
|
|
1920
|
-
paddingTop: '8px',
|
|
1921
|
-
},
|
|
1922
|
-
offset: 0,
|
|
1923
|
-
onlyDisplay: true,
|
|
1924
|
-
colStyle: {
|
|
1925
|
-
flex: 1,
|
|
1926
|
-
},
|
|
1927
|
-
},
|
|
1928
|
-
{
|
|
1929
|
-
id: `custom-value-${key}-${col.id}`,
|
|
1930
|
-
label: "value",
|
|
1931
|
-
type: "input", //Resembles component to be used
|
|
1932
|
-
metaType: "text",
|
|
1933
|
-
datatype: "string",
|
|
1934
|
-
required: true,
|
|
1935
|
-
width: 14,
|
|
1936
|
-
placeholder: `Please input ${key.replace('_', " ")}.`,
|
|
1937
|
-
fluid: true,
|
|
1938
|
-
styling: "semantic",
|
|
1939
|
-
order: 1,
|
|
1940
|
-
disabled: this.props.location.query.type === 'embedded' && this.props.location.query.module !== "dvs",
|
|
1941
|
-
customComponent: false,
|
|
1942
|
-
errorMessage: "value cannot be empty.",
|
|
1943
|
-
},
|
|
1944
|
-
],
|
|
1945
|
-
};
|
|
1946
|
-
//eventsMap[`custome-${key}`] = {"onChange": this.onMessageTitleChange};
|
|
1947
|
-
return row;
|
|
1948
|
-
// formChaild.inputFields[fieldIndex + index] = field;
|
|
1949
|
-
});
|
|
1950
|
-
console.log(formChaild);
|
|
1951
|
-
console.log("this in getctakeys", this);
|
|
1952
|
-
if (!tabIndex) { // removes the existing selected options keys so that newly selected options keys can be added.
|
|
1953
|
-
const configkeys = _.filter(JSON.parse(ck ? selectedWeChatAccount.configs.deeplink : '[]'), (dl) => dl.link === this.state.formData[currentTab - 1][field.id]);
|
|
1954
|
-
if (configkeys.length) {
|
|
1955
|
-
const options = configkeys[0].keys;
|
|
1956
|
-
formChaild.inputFields = formChaild.inputFields.slice(0, fieldIndex + 1).concat(formChaild.inputFields.slice(fieldIndex + options.length + 1, formChaild.inputFields.length));
|
|
1957
|
-
// delete formData[self.state.currentTab - 1][`cta-deeplink-${id.replace('delete', 'select')}`];
|
|
1958
|
-
// delete formData[self.state.currentTab - 1][`cta-deeplink-${id.replace('-delete', '')}`];
|
|
1959
|
-
}
|
|
1960
|
-
}
|
|
1961
|
-
if (formChaild.inputFields[fieldIndex + 1] && formChaild.inputFields[fieldIndex + 1].id === "cta-deeplink-keys") {
|
|
1962
|
-
rows = formChaild.inputFields.slice(0, fieldIndex + 1).concat(rows).concat(formChaild.inputFields.slice(fieldIndex + 1, formChaild.inputFields.length));
|
|
1963
|
-
formChaild.inputFields = rows;
|
|
1964
|
-
} else {
|
|
1965
|
-
rows = formChaild.inputFields.slice(0, fieldIndex + 1).concat(rows).concat(formChaild.inputFields.slice(fieldIndex + 1, formChaild.inputFields.length));
|
|
1966
|
-
formChaild.inputFields = rows;
|
|
1967
|
-
}
|
|
1968
|
-
}
|
|
1969
|
-
});
|
|
1970
|
-
});
|
|
1971
|
-
}
|
|
1972
|
-
});
|
|
1973
|
-
});
|
|
1974
|
-
});
|
|
1975
|
-
});
|
|
1491
|
+
let inputFields = get(schema, `containers[0].panes[${currentTab - 1}].sections[0].childSections[0].childSections[0].inputFields`);
|
|
1492
|
+
const {id} = field;
|
|
1493
|
+
const fieldIndex = findIndex(inputFields, {identifier: id});
|
|
1494
|
+
const formDataKey = id.replace("-show-keys", "");
|
|
1495
|
+
const ck = selectedWeChatAccount.configs ? !!selectedWeChatAccount.configs.deeplink : false;
|
|
1496
|
+
let keys = selectedWeChatAccount ? _.filter(JSON.parse(ck ? selectedWeChatAccount.configs.deeplink : '[]'), (dl) => dl.link === formData[currentTab - 1][formDataKey]) : [];
|
|
1497
|
+
if (keys[0]) {
|
|
1498
|
+
keys = keys[0].keys;
|
|
1499
|
+
}
|
|
1500
|
+
_.map(keys, (key, index) => {
|
|
1501
|
+
const row = {
|
|
1502
|
+
rowClassName: 'mobile-push-row',
|
|
1503
|
+
id: 'cta-deeplink-keys',
|
|
1504
|
+
cols: [
|
|
1505
|
+
{
|
|
1506
|
+
id: `custom-value-${key}-${id}`,
|
|
1507
|
+
label: key.replace('_', " "),
|
|
1508
|
+
type: "input", //Resembles component to be used
|
|
1509
|
+
metaType: "text",
|
|
1510
|
+
datatype: "string",
|
|
1511
|
+
required: true,
|
|
1512
|
+
width: 18,
|
|
1513
|
+
offset: 1,
|
|
1514
|
+
placeholder: `Please input ${key.replace('_', " ")}.`,
|
|
1515
|
+
fluid: true,
|
|
1516
|
+
styling: "semantic",
|
|
1517
|
+
order: 1,
|
|
1518
|
+
customComponent: false,
|
|
1519
|
+
errorMessage: "value cannot be empty.",
|
|
1520
|
+
},
|
|
1521
|
+
],
|
|
1522
|
+
};
|
|
1523
|
+
inputFields.splice(fieldIndex + index + 1, 0, row);
|
|
1976
1524
|
});
|
|
1525
|
+
if (!tabIndex) { // removes the existing selected options keys so that newly selected options keys can be added.
|
|
1526
|
+
const configkeys = _.filter(JSON.parse(ck ? selectedWeChatAccount.configs.deeplink : '[]'), (dl) => dl.link === this.state.formData[currentTab - 1][field.id]);
|
|
1527
|
+
if (configkeys.length) {
|
|
1528
|
+
const options = configkeys[0].keys;
|
|
1529
|
+
inputFields = inputFields.slice(0, fieldIndex + 1).concat(inputFields.slice(fieldIndex + options.length + 1, inputFields.length));
|
|
1530
|
+
// delete formData[self.state.currentTab - 1][`cta-deeplink-${id.replace('delete', 'select')}`];
|
|
1531
|
+
// delete formData[self.state.currentTab - 1][`cta-deeplink-${id.replace('-delete', '')}`];
|
|
1532
|
+
}
|
|
1533
|
+
}
|
|
1977
1534
|
if (tabIndex) {
|
|
1978
1535
|
return schema;
|
|
1979
1536
|
}
|
|
@@ -1981,131 +1538,26 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
1981
1538
|
this.injectEvents(schema);
|
|
1982
1539
|
return schema;
|
|
1983
1540
|
};
|
|
1984
|
-
addPrimaryCta = (
|
|
1541
|
+
addPrimaryCta = (flag, formData, field, inputSchema, currentTab) => {
|
|
1985
1542
|
const selectedWeChatAccount = (!_.isEmpty(this.props.Templates.selectedWeChatAccount) ? this.props.Templates.selectedWeChatAccount : this.props.Edit.selectedWeChatAccount);
|
|
1986
|
-
const id = field
|
|
1543
|
+
const id = field.id;
|
|
1987
1544
|
const schema = inputSchema ? _.cloneDeep(inputSchema) : _.cloneDeep(this.state.schema);
|
|
1988
1545
|
const ck = selectedWeChatAccount.configs ? !!selectedWeChatAccount.configs.deeplink : false;
|
|
1989
1546
|
const deepLinkOptions = selectedWeChatAccount ? _.map(JSON.parse(ck ? selectedWeChatAccount.configs.deeplink : '[]'), (link) => ({label: link.name, value: link.link, title: link.link }) ) : [];
|
|
1990
1547
|
// const eventsMap = _.cloneDeep(this.state.eventsMap);
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
cols: [
|
|
2005
|
-
{
|
|
2006
|
-
id: "cta-label",
|
|
2007
|
-
metaType: "label",
|
|
2008
|
-
value: "Primary CTA",
|
|
2009
|
-
primitive: true,
|
|
2010
|
-
dynamicTab: false,
|
|
2011
|
-
type: "div",
|
|
2012
|
-
width: 4,
|
|
2013
|
-
style: {
|
|
2014
|
-
backgroundColor: 'white',
|
|
2015
|
-
textAlign: 'left',
|
|
2016
|
-
color: '#333333',
|
|
2017
|
-
lineHeight: '24px',
|
|
2018
|
-
fontSize: '14px',
|
|
2019
|
-
fontFamily: 'open-sans',
|
|
2020
|
-
fontStyle: 'normal',
|
|
2021
|
-
},
|
|
2022
|
-
offset: 0,
|
|
2023
|
-
onlyDisplay: true,
|
|
2024
|
-
colStyle: {
|
|
2025
|
-
flex: 1,
|
|
2026
|
-
},
|
|
2027
|
-
},
|
|
2028
|
-
{
|
|
2029
|
-
id: `cta-deeplink${id === 'add-pri-cta' ? '' : 2}`,
|
|
2030
|
-
type: "radioGroup", //Resembles component to be used
|
|
2031
|
-
metaType: "text",
|
|
2032
|
-
datatype: "string",
|
|
2033
|
-
options: ["Deeplink", "External Link"],
|
|
2034
|
-
value: "Deeplink",
|
|
2035
|
-
required: true,
|
|
2036
|
-
width: 18,
|
|
2037
|
-
errorMessage: "Please select link type",
|
|
2038
|
-
fluid: true,
|
|
2039
|
-
styling: "semantic",
|
|
2040
|
-
order: 1,
|
|
2041
|
-
customComponent: false,
|
|
2042
|
-
disabled: this.props.location.query.type === 'embedded' && this.props.location.query.module !== "dvs",
|
|
2043
|
-
supportedEvents: ["onChange"],
|
|
2044
|
-
},
|
|
2045
|
-
{
|
|
2046
|
-
id: `cta-deeplink${id === 'add-pri-cta' ? '' : 2}-delete`,
|
|
2047
|
-
type: "icon",
|
|
2048
|
-
value: 'delete',
|
|
2049
|
-
width: 1,
|
|
2050
|
-
submitAction: "onDelete",
|
|
2051
|
-
supportedEvents: ["onDelete"],
|
|
2052
|
-
},
|
|
2053
|
-
],
|
|
2054
|
-
});
|
|
2055
|
-
child.inputFields.splice(fieldIndex + 1, 0, {
|
|
2056
|
-
rowClassName: 'mobile-push-row',
|
|
2057
|
-
id: 'cta-deeplink-select-section',
|
|
2058
|
-
cols: [
|
|
2059
|
-
{
|
|
2060
|
-
id: "cta-label",
|
|
2061
|
-
metaType: "label",
|
|
2062
|
-
value: "",
|
|
2063
|
-
primitive: true,
|
|
2064
|
-
dynamicTab: false,
|
|
2065
|
-
type: "div",
|
|
2066
|
-
width: 4,
|
|
2067
|
-
onlyDisplay: true,
|
|
2068
|
-
colStyle: {
|
|
2069
|
-
flex: 1,
|
|
2070
|
-
},
|
|
2071
|
-
},
|
|
2072
|
-
{
|
|
2073
|
-
id: `cta-deeplink${id === 'add-pri-cta' ? '' : 2}-select`,
|
|
2074
|
-
placeholder: "Select DeepLink",
|
|
2075
|
-
type: "select", //Resembles component to be used
|
|
2076
|
-
options: deepLinkOptions,
|
|
2077
|
-
errorMessage: "Select a deeplink",
|
|
2078
|
-
metaType: "text",
|
|
2079
|
-
datatype: "string",
|
|
2080
|
-
required: true,
|
|
2081
|
-
fluid: true,
|
|
2082
|
-
width: 19,
|
|
2083
|
-
style: {
|
|
2084
|
-
fontSize: '14px',
|
|
2085
|
-
fontFamily: 'open-sans',
|
|
2086
|
-
fontStyle: 'normal',
|
|
2087
|
-
// fontWeight: 600,
|
|
2088
|
-
marginBottom: '16px',
|
|
2089
|
-
},
|
|
2090
|
-
styling: "semantic",
|
|
2091
|
-
order: 1,
|
|
2092
|
-
disabled: this.props.location.query.type === 'embedded' && this.props.location.query.module !== "dvs",
|
|
2093
|
-
customComponent: false,
|
|
2094
|
-
supportedEvents: [
|
|
2095
|
-
'onSelect',
|
|
2096
|
-
],
|
|
2097
|
-
},
|
|
2098
|
-
],
|
|
2099
|
-
});
|
|
2100
|
-
}
|
|
2101
|
-
});
|
|
2102
|
-
});
|
|
2103
|
-
}
|
|
2104
|
-
});
|
|
2105
|
-
});
|
|
2106
|
-
});
|
|
2107
|
-
});
|
|
2108
|
-
});
|
|
1548
|
+
const tabIndex = currentTab || this.state.currentTab;
|
|
1549
|
+
const inputFields = get(schema, `containers[0].panes[${tabIndex - 1}].sections[0].childSections[0].childSections[0].inputFields`);
|
|
1550
|
+
const fieldIndex = findIndex(inputFields, {identifier: id});
|
|
1551
|
+
let newInputFields;
|
|
1552
|
+
if (formData[tabIndex - 1][id]) {
|
|
1553
|
+
newInputFields = this.getPrimaryCtaFields({inputFields, fieldIndex, deepLinkOptions});
|
|
1554
|
+
} else {
|
|
1555
|
+
const identifier = (tabIndex - 1) ? 'add-sec-cta-ios' : 'add-sec-cta';
|
|
1556
|
+
const indexOfNextField = findIndex(inputFields, {identifier});
|
|
1557
|
+
const deleteCount = indexOfNextField - fieldIndex;
|
|
1558
|
+
newInputFields = [...inputFields.slice(0, fieldIndex + 1), ...inputFields.slice(fieldIndex + deleteCount, inputFields.length)];
|
|
1559
|
+
}
|
|
1560
|
+
set(schema, `containers[0].panes[${tabIndex - 1}].sections[0].childSections[0].childSections[0].inputFields`, newInputFields);
|
|
2109
1561
|
if (inputSchema) {
|
|
2110
1562
|
return schema;
|
|
2111
1563
|
}
|
|
@@ -2114,191 +1566,25 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
2114
1566
|
return schema;
|
|
2115
1567
|
};
|
|
2116
1568
|
|
|
2117
|
-
addSecondoryCta = (
|
|
2118
|
-
const id = field
|
|
1569
|
+
addSecondoryCta = (flag, formData, field, inputSchema, currentTab) => {
|
|
1570
|
+
const id = field.id;
|
|
1571
|
+
const tabIndex = currentTab || this.state.currentTab;
|
|
2119
1572
|
const schema = inputSchema ? _.cloneDeep(inputSchema) : _.cloneDeep(this.state.schema);
|
|
2120
1573
|
const selectedWeChatAccount = (!_.isEmpty(this.props.Templates.selectedWeChatAccount) ? this.props.Templates.selectedWeChatAccount : this.props.Edit.selectedWeChatAccount);
|
|
2121
1574
|
const ck = selectedWeChatAccount.configs ? !!selectedWeChatAccount.configs.deeplink : false;
|
|
2122
1575
|
const deepLinkOptions = selectedWeChatAccount ? _.map(JSON.parse(ck ? selectedWeChatAccount.configs.deeplink : '[]'), (link) => ({label: link.name, value: link.link, title: link.link }) ) : [];
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
const inputId = `secondary-cta-${col.fieldsCount}`;
|
|
2136
|
-
console.log(child.inputFields, fieldIndex);
|
|
2137
|
-
child.inputFields.splice(fieldIndex, 0, {
|
|
2138
|
-
rowClassName: 'mobile-push-row',
|
|
2139
|
-
cols: [
|
|
2140
|
-
{
|
|
2141
|
-
id: `${inputId}-space`,
|
|
2142
|
-
metaType: "label",
|
|
2143
|
-
value: "Secondary CTA",
|
|
2144
|
-
primitive: true,
|
|
2145
|
-
dynamicTab: false,
|
|
2146
|
-
type: "div",
|
|
2147
|
-
width: 4,
|
|
2148
|
-
style: {
|
|
2149
|
-
backgroundColor: 'white',
|
|
2150
|
-
textAlign: 'left',
|
|
2151
|
-
color: '#333333',
|
|
2152
|
-
lineHeight: '24px',
|
|
2153
|
-
fontSize: '14px',
|
|
2154
|
-
fontFamily: 'open-sans',
|
|
2155
|
-
fontStyle: 'normal',
|
|
2156
|
-
paddingTop: '8px',
|
|
2157
|
-
},
|
|
2158
|
-
offset: 0,
|
|
2159
|
-
onlyDisplay: true,
|
|
2160
|
-
colStyle: {
|
|
2161
|
-
flex: 1,
|
|
2162
|
-
},
|
|
2163
|
-
},
|
|
2164
|
-
{
|
|
2165
|
-
id: `${inputId}-label`,
|
|
2166
|
-
label: "link",
|
|
2167
|
-
type: "input", //Resembles component to be used
|
|
2168
|
-
metaType: "text",
|
|
2169
|
-
datatype: "string",
|
|
2170
|
-
required: true,
|
|
2171
|
-
width: 18,
|
|
2172
|
-
offset: 4,
|
|
2173
|
-
placeholder: "Enter CTA Label here",
|
|
2174
|
-
fluid: true,
|
|
2175
|
-
styling: "semantic",
|
|
2176
|
-
order: 1,
|
|
2177
|
-
customComponent: false,
|
|
2178
|
-
errorMessage: "CTA label cannot be empty.",
|
|
2179
|
-
},
|
|
2180
|
-
{
|
|
2181
|
-
id: `${inputId}-delete`,
|
|
2182
|
-
type: "icon",
|
|
2183
|
-
value: 'delete',
|
|
2184
|
-
width: 1,
|
|
2185
|
-
submitAction: "onDelete",
|
|
2186
|
-
supportedEvents: ["onDelete"],
|
|
2187
|
-
},
|
|
2188
|
-
],
|
|
2189
|
-
});
|
|
2190
|
-
child.inputFields.splice(fieldIndex + 1, 0, {
|
|
2191
|
-
rowClassName: 'mobile-push-row',
|
|
2192
|
-
cols: [
|
|
2193
|
-
{
|
|
2194
|
-
id: `${inputId}-label-space`,
|
|
2195
|
-
metaType: "label",
|
|
2196
|
-
value: "",
|
|
2197
|
-
primitive: true,
|
|
2198
|
-
dynamicTab: false,
|
|
2199
|
-
type: "div",
|
|
2200
|
-
width: 4,
|
|
2201
|
-
style: {
|
|
2202
|
-
backgroundColor: 'white',
|
|
2203
|
-
textAlign: 'left',
|
|
2204
|
-
color: '#333333',
|
|
2205
|
-
lineHeight: '24px',
|
|
2206
|
-
fontSize: '14px',
|
|
2207
|
-
fontFamily: 'open-sans',
|
|
2208
|
-
fontStyle: 'normal',
|
|
2209
|
-
paddingTop: '8px',
|
|
2210
|
-
},
|
|
2211
|
-
offset: 0,
|
|
2212
|
-
onlyDisplay: true,
|
|
2213
|
-
colStyle: {
|
|
2214
|
-
flex: 1,
|
|
2215
|
-
},
|
|
2216
|
-
},
|
|
2217
|
-
{
|
|
2218
|
-
id: `cta-deeplink-${inputId}`,
|
|
2219
|
-
type: "radioGroup", //Resembles component to be used
|
|
2220
|
-
metaType: "text",
|
|
2221
|
-
datatype: "string",
|
|
2222
|
-
options: ["Deeplink", "External Link"],
|
|
2223
|
-
value: "Deeplink",
|
|
2224
|
-
required: true,
|
|
2225
|
-
width: 16,
|
|
2226
|
-
fluid: true,
|
|
2227
|
-
styling: "semantic",
|
|
2228
|
-
order: 1,
|
|
2229
|
-
style: {
|
|
2230
|
-
lineHeight: '24px',
|
|
2231
|
-
fontSize: '14px',
|
|
2232
|
-
},
|
|
2233
|
-
disabled: this.props.location.query.type === 'embedded' && this.props.location.query.module !== "dvs",
|
|
2234
|
-
customComponent: false,
|
|
2235
|
-
supportedEvents: ["onChange"],
|
|
2236
|
-
},
|
|
2237
|
-
],
|
|
2238
|
-
});
|
|
2239
|
-
child.inputFields.splice(fieldIndex + 2, 0, {
|
|
2240
|
-
rowClassName: 'mobile-push-row',
|
|
2241
|
-
id: 'cta-deeplink-select-section',
|
|
2242
|
-
cols: [
|
|
2243
|
-
{
|
|
2244
|
-
id: "cta-label",
|
|
2245
|
-
metaType: "label",
|
|
2246
|
-
value: "",
|
|
2247
|
-
primitive: true,
|
|
2248
|
-
dynamicTab: false,
|
|
2249
|
-
type: "div",
|
|
2250
|
-
width: 4,
|
|
2251
|
-
onlyDisplay: true,
|
|
2252
|
-
colStyle: {
|
|
2253
|
-
flex: 1,
|
|
2254
|
-
},
|
|
2255
|
-
},
|
|
2256
|
-
{
|
|
2257
|
-
id: `cta-deeplink-${inputId}-select`,
|
|
2258
|
-
placeholder: "Select DeepLink",
|
|
2259
|
-
type: "select", //Resembles component to be used
|
|
2260
|
-
options: deepLinkOptions,
|
|
2261
|
-
errorMessage: "Select a deeplink",
|
|
2262
|
-
metaType: "text",
|
|
2263
|
-
datatype: "string",
|
|
2264
|
-
required: true,
|
|
2265
|
-
fluid: true,
|
|
2266
|
-
width: 19,
|
|
2267
|
-
style: {
|
|
2268
|
-
fontSize: '14px',
|
|
2269
|
-
fontFamily: 'open-sans',
|
|
2270
|
-
fontStyle: 'normal',
|
|
2271
|
-
// fontWeight: 600,
|
|
2272
|
-
marginBottom: '16px',
|
|
2273
|
-
},
|
|
2274
|
-
styling: "semantic",
|
|
2275
|
-
order: 1,
|
|
2276
|
-
disabled: this.props.location.query.type === 'embedded' && this.props.location.query.module !== "dvs",
|
|
2277
|
-
customComponent: false,
|
|
2278
|
-
supportedEvents: [
|
|
2279
|
-
'onSelect',
|
|
2280
|
-
],
|
|
2281
|
-
},
|
|
2282
|
-
],
|
|
2283
|
-
});
|
|
2284
|
-
|
|
2285
|
-
const colField = col;
|
|
2286
|
-
colField.value = "Add Another CTA";
|
|
2287
|
-
colField.fieldsCount += 1;
|
|
2288
|
-
if (col.fieldsCount === col.fieldsLimit) {
|
|
2289
|
-
child.inputFields.pop();
|
|
2290
|
-
}
|
|
2291
|
-
// eventsMap[`cta-deeplink-${inputId}`] = {"onChange": this.onLinkTypeChange};
|
|
2292
|
-
}
|
|
2293
|
-
}
|
|
2294
|
-
});
|
|
2295
|
-
});
|
|
2296
|
-
}
|
|
2297
|
-
});
|
|
2298
|
-
});
|
|
2299
|
-
});
|
|
2300
|
-
});
|
|
2301
|
-
});
|
|
1576
|
+
const inputFields = get(schema, `containers[0].panes[${tabIndex - 1}].sections[0].childSections[0].childSections[0].inputFields`);
|
|
1577
|
+
const fieldIndex = findIndex(inputFields, {identifier: id});
|
|
1578
|
+
let newInputFields;
|
|
1579
|
+
if (formData[tabIndex - 1][id]) {
|
|
1580
|
+
newInputFields = this.getSecondaryCtaFields({inputFields, fieldIndex, deepLinkOptions});
|
|
1581
|
+
} else {
|
|
1582
|
+
const identifier = id === "add-sec-cta" ? 'add-sec-cta-2' : null;
|
|
1583
|
+
const indexOfNextField = identifier ? findIndex(inputFields, {identifier}) : inputFields.length;
|
|
1584
|
+
const deleteCount = indexOfNextField - fieldIndex;
|
|
1585
|
+
newInputFields = [...inputFields.slice(0, fieldIndex + 1), ...inputFields.slice(fieldIndex + deleteCount, inputFields.length)];
|
|
1586
|
+
}
|
|
1587
|
+
set(schema, `containers[0].panes[${tabIndex - 1}].sections[0].childSections[0].childSections[0].inputFields`, newInputFields);
|
|
2302
1588
|
if (inputSchema) {
|
|
2303
1589
|
return schema;
|
|
2304
1590
|
}
|
|
@@ -2307,120 +1593,41 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
2307
1593
|
return schema;
|
|
2308
1594
|
};
|
|
2309
1595
|
|
|
2310
|
-
addSecondoryCtaIos = (
|
|
2311
|
-
const id =
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
width: 4,
|
|
2337
|
-
style: {
|
|
2338
|
-
backgroundColor: 'white',
|
|
2339
|
-
textAlign: 'left',
|
|
2340
|
-
color: '#333333',
|
|
2341
|
-
lineHeight: '24px',
|
|
2342
|
-
fontSize: '14px',
|
|
2343
|
-
fontFamily: 'open-sans',
|
|
2344
|
-
fontStyle: 'normal',
|
|
2345
|
-
paddingTop: '8px',
|
|
2346
|
-
},
|
|
2347
|
-
offset: 0,
|
|
2348
|
-
onlyDisplay: true,
|
|
2349
|
-
colStyle: {
|
|
2350
|
-
flex: 1,
|
|
2351
|
-
},
|
|
2352
|
-
},
|
|
2353
|
-
{
|
|
2354
|
-
id: `${inputId}-table`,
|
|
2355
|
-
type: "table", //Resembles component to be used
|
|
2356
|
-
metaType: "text",
|
|
2357
|
-
datatype: "string",
|
|
2358
|
-
pagination: false,
|
|
2359
|
-
columns: [
|
|
2360
|
-
{
|
|
2361
|
-
title: "Name and Description",
|
|
2362
|
-
dataIndex: "name",
|
|
2363
|
-
key: "name",
|
|
2364
|
-
width: 200,
|
|
2365
|
-
render: (text, record) => (
|
|
2366
|
-
<div>
|
|
2367
|
-
<div>{record.name}</div>
|
|
2368
|
-
<div>{record.description}</div>
|
|
2369
|
-
</div>),
|
|
2370
|
-
},
|
|
2371
|
-
{
|
|
2372
|
-
title: "Button 1",
|
|
2373
|
-
dataIndex: "description",
|
|
2374
|
-
key: "button1",
|
|
2375
|
-
width: 100,
|
|
2376
|
-
render: (text, record) => (
|
|
2377
|
-
<div>
|
|
2378
|
-
{record.ctaTemplateDetails[0] && record.ctaTemplateDetails[0].buttonText}
|
|
2379
|
-
</div>),
|
|
2380
|
-
},
|
|
2381
|
-
{
|
|
2382
|
-
title: "Button 2",
|
|
2383
|
-
dataIndex: "description",
|
|
2384
|
-
key: "button2",
|
|
2385
|
-
width: 100,
|
|
2386
|
-
render: (text, record) => (
|
|
2387
|
-
<div>
|
|
2388
|
-
{record.ctaTemplateDetails[1] ? record.ctaTemplateDetails[1].buttonText : ''}
|
|
2389
|
-
</div>
|
|
2390
|
-
),
|
|
2391
|
-
},
|
|
2392
|
-
],
|
|
2393
|
-
required: true,
|
|
2394
|
-
width: 16,
|
|
2395
|
-
fluid: true,
|
|
2396
|
-
styling: "semantic",
|
|
2397
|
-
order: 1,
|
|
2398
|
-
customComponent: false,
|
|
2399
|
-
supportedEvents: ["onRowClick"],
|
|
2400
|
-
},
|
|
2401
|
-
],
|
|
2402
|
-
});
|
|
2403
|
-
|
|
2404
|
-
const colField = col;
|
|
2405
|
-
colField.value = "Add Another CTA";
|
|
2406
|
-
colField.fieldsCount += 1;
|
|
2407
|
-
if (col.fieldsCount === col.fieldsLimit) {
|
|
2408
|
-
child.inputFields.pop();
|
|
2409
|
-
}
|
|
2410
|
-
}
|
|
2411
|
-
});
|
|
2412
|
-
});
|
|
2413
|
-
}
|
|
2414
|
-
});
|
|
2415
|
-
});
|
|
1596
|
+
addSecondoryCtaIos = (flag, formData, schemaField) => {
|
|
1597
|
+
const id = schemaField.id;
|
|
1598
|
+
if (formData[this.state.currentTab - 1][id]) {
|
|
1599
|
+
const actionText = formData[this.state.currentTab - 1]['secondary-cta-1-action'];
|
|
1600
|
+
if (!this.props.iosCtasData) {
|
|
1601
|
+
if (!_.isEmpty(actionText)) {
|
|
1602
|
+
this.deleteSecondaryCtaIos();
|
|
1603
|
+
}
|
|
1604
|
+
this.props.actions.getIosCtas(this.props.Templates.selectedWeChatAccount.sourceAccountIdentifier);//TODO: need to get license code of accoutn and send as arg
|
|
1605
|
+
} else {
|
|
1606
|
+
this.deleteSecondaryCtaIos(() => { // oncick of change
|
|
1607
|
+
this.setState({showIosCtaTable: true});
|
|
1608
|
+
});
|
|
1609
|
+
}
|
|
1610
|
+
} else {
|
|
1611
|
+
const schema = cloneDeep(this.state.schema);
|
|
1612
|
+
const inputFields = get(schema, `containers[0].panes[${this.state.currentTab - 1}].sections[0].childSections[0].childSections[0].inputFields`);
|
|
1613
|
+
forEach(inputFields, (inputField, fieldIndex) => {
|
|
1614
|
+
forEach(inputField.cols, (col) => {
|
|
1615
|
+
if (col.id === id) {
|
|
1616
|
+
const indexOfNextField = inputFields.length;
|
|
1617
|
+
const deleteCount = indexOfNextField - fieldIndex;
|
|
1618
|
+
const newInputFields = [...inputFields.slice(0, fieldIndex + 1), ...inputFields.slice(fieldIndex + deleteCount, inputField.length)];
|
|
1619
|
+
set(schema, `containers[0].panes[${this.state.currentTab - 1}].sections[0].childSections[0].childSections[0].inputFields`, newInputFields);
|
|
1620
|
+
this.setState({schema});
|
|
1621
|
+
}
|
|
2416
1622
|
});
|
|
2417
1623
|
});
|
|
2418
|
-
}
|
|
2419
|
-
this.setState({schema, initialState: this.state.initialState ? this.state.initialState : this.state.schema, isSchemaChanged: true});
|
|
2420
|
-
this.injectEvents(schema);
|
|
2421
|
-
this.props.actions.getIosCtas(selectedWeChatAccount.sourceAccountIdentifier);//TODO: need to get license code of accoutn and send as arg
|
|
1624
|
+
}
|
|
2422
1625
|
};
|
|
2423
|
-
|
|
1626
|
+
handleClose = () => {
|
|
1627
|
+
const formData = cloneDeep(this.state.formData);
|
|
1628
|
+
formData[this.state.currentTab - 1]['add-sec-cta-ios'] = false;
|
|
1629
|
+
this.setState({showIosCtaTable: false, formData});
|
|
1630
|
+
}
|
|
2424
1631
|
injectContainer = (container) => {
|
|
2425
1632
|
const temp = container;
|
|
2426
1633
|
if (temp.type === 'tabs') {
|
|
@@ -2529,6 +1736,64 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
2529
1736
|
setModalContent={this.setModalContent}
|
|
2530
1737
|
/>
|
|
2531
1738
|
</Col>
|
|
1739
|
+
{this.props.iosCtasData && this.state.showIosCtaTable &&
|
|
1740
|
+
<CapSlideBox
|
|
1741
|
+
size="size-l"
|
|
1742
|
+
header={<CapHeader
|
|
1743
|
+
title={<FormattedMessage {...messages.selectActionButton} />}
|
|
1744
|
+
prefix={
|
|
1745
|
+
<PrefixWrapper>
|
|
1746
|
+
<CapIcons.backIcon onClick={this.handleClose} />
|
|
1747
|
+
</PrefixWrapper>
|
|
1748
|
+
}
|
|
1749
|
+
|
|
1750
|
+
/>}
|
|
1751
|
+
content={<CapTable
|
|
1752
|
+
rowSelection={{
|
|
1753
|
+
type: 'radio',
|
|
1754
|
+
onSelect: (record) => {
|
|
1755
|
+
this.setState({templateCta: record, showIosCtaTable: false}, () => this.selectCtaIos(record));
|
|
1756
|
+
},
|
|
1757
|
+
}}
|
|
1758
|
+
dataSource={this.props.iosCtasData} columns={[
|
|
1759
|
+
{
|
|
1760
|
+
title: "Name and Description",
|
|
1761
|
+
dataIndex: "name",
|
|
1762
|
+
key: "name",
|
|
1763
|
+
width: 200,
|
|
1764
|
+
render: (text, record) => (
|
|
1765
|
+
<div>
|
|
1766
|
+
<div>{record.name}</div>
|
|
1767
|
+
<div>{record.description}</div>
|
|
1768
|
+
</div>),
|
|
1769
|
+
},
|
|
1770
|
+
{
|
|
1771
|
+
title: "Button 1",
|
|
1772
|
+
dataIndex: "description",
|
|
1773
|
+
key: "button1",
|
|
1774
|
+
width: 100,
|
|
1775
|
+
render: (text, record) => (
|
|
1776
|
+
<div>
|
|
1777
|
+
{record.ctaTemplateDetails[0] && record.ctaTemplateDetails[0].buttonText}
|
|
1778
|
+
</div>),
|
|
1779
|
+
},
|
|
1780
|
+
{
|
|
1781
|
+
title: "Button 2",
|
|
1782
|
+
dataIndex: "description",
|
|
1783
|
+
key: "button2",
|
|
1784
|
+
width: 100,
|
|
1785
|
+
render: (text, record) => (
|
|
1786
|
+
<div>
|
|
1787
|
+
{record.ctaTemplateDetails[1] ? record.ctaTemplateDetails[1].buttonText : ''}
|
|
1788
|
+
</div>
|
|
1789
|
+
),
|
|
1790
|
+
},
|
|
1791
|
+
]}
|
|
1792
|
+
/>}
|
|
1793
|
+
show={this.state.showIosCtaTable}
|
|
1794
|
+
handleClose={this.handleClose}
|
|
1795
|
+
/>
|
|
1796
|
+
}
|
|
2532
1797
|
</Row>
|
|
2533
1798
|
</Spin>
|
|
2534
1799
|
</div>
|
|
@@ -2552,6 +1817,8 @@ Edit.propTypes = {
|
|
|
2552
1817
|
getDefaultTags: PropTypes.string,
|
|
2553
1818
|
templateData: PropTypes.object,
|
|
2554
1819
|
isFullMode: PropTypes.bool,
|
|
1820
|
+
iosCtasData: PropTypes.array,
|
|
1821
|
+
|
|
2555
1822
|
};
|
|
2556
1823
|
|
|
2557
1824
|
const mapStateToProps = createStructuredSelector({
|
|
@@ -2561,6 +1828,8 @@ const mapStateToProps = createStructuredSelector({
|
|
|
2561
1828
|
templateDetails: makeSelectTemplateDetailsResponse(),
|
|
2562
1829
|
metaEntities: makeSelectMetaEntities(),
|
|
2563
1830
|
Templates: makeSelectTemplates(),
|
|
1831
|
+
iosCtasData: makeSelectIosCta(),
|
|
1832
|
+
|
|
2564
1833
|
});
|
|
2565
1834
|
|
|
2566
1835
|
function mapDispatchToProps(dispatch) {
|