@capillarytech/creatives-library 7.17.192 → 7.17.193-alpha.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/package.json
CHANGED
|
@@ -105,8 +105,22 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
105
105
|
} else if (nextProps.isGetFormData && this.props.isGetFormData !== nextProps.isGetFormData && this.props.isFullMode && !this.props.Create.createTemplateInProgress) {
|
|
106
106
|
this.startValidation();
|
|
107
107
|
}
|
|
108
|
-
|
|
109
|
-
(
|
|
108
|
+
let selectedWeChatAccount = {};
|
|
109
|
+
if(this.props.location.pathname === '/mobilepush/edit') {
|
|
110
|
+
if(!_.isEmpty(this.props.Edit.selectedWeChatAccount)) {
|
|
111
|
+
selectedWeChatAccount = this.props.Edit.selectedWeChatAccount;
|
|
112
|
+
console.log('selectedWeChatAccount---> if 112', selectedWeChatAccount);
|
|
113
|
+
} else {
|
|
114
|
+
selectedWeChatAccount = nextProps.Templates.selectedWeChatAccount;
|
|
115
|
+
console.log('selectedWeChatAccount---> else 115', selectedWeChatAccount);
|
|
116
|
+
}
|
|
117
|
+
}else if(!_.isEmpty(this.props.Templates.selectedWeChatAccount)){
|
|
118
|
+
selectedWeChatAccount = this.props.Templates.selectedWeChatAccount;
|
|
119
|
+
console.log('selectedWeChatAccount---> else if 119', selectedWeChatAccount);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
// const selectedWeChatAccount = (!_.isEmpty(this.props.Templates.selectedWeChatAccount) ? this.props.Templates.selectedWeChatAccount :
|
|
123
|
+
// (!_.isEmpty(this.props.Edit.selectedWeChatAccount) ? this.props.Edit.selectedWeChatAccount : nextProps.Edit.selectedWeChatAccount));
|
|
110
124
|
if (this.props.location.query.type === 'embedded' && !nextProps.Edit.fetchingWeCrmAccounts && !_.isEqual(this.props.Edit.weCrmAccounts, nextProps.Edit.weCrmAccounts) && (!selectedWeChatAccount || _.isEmpty(selectedWeChatAccount))) {
|
|
111
125
|
this.setMobilePushAccountOptions(nextProps.Edit.weCrmAccounts, get(this.props, "templateData.definition.accountId"));
|
|
112
126
|
}
|
|
@@ -214,7 +228,17 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
214
228
|
};
|
|
215
229
|
|
|
216
230
|
onLinkTypeChange = (eventTriggered, formData, field, currentTab, inputSchema) => {
|
|
217
|
-
|
|
231
|
+
let selectedWeChatAccount = {};
|
|
232
|
+
if(this.props.location.pathname === '/mobilepush/edit') {
|
|
233
|
+
if(!_.isEmpty(this.props.Edit.selectedWeChatAccount)) {
|
|
234
|
+
selectedWeChatAccount = this.props.Edit.selectedWeChatAccount;
|
|
235
|
+
console.log('selectedWeChatAccount---> if 235', selectedWeChatAccount);
|
|
236
|
+
}
|
|
237
|
+
}else if(!_.isEmpty(this.props.Templates.selectedWeChatAccount)){
|
|
238
|
+
selectedWeChatAccount = this.props.Templates.selectedWeChatAccount;
|
|
239
|
+
console.log('selectedWeChatAccount---> else 239', selectedWeChatAccount);
|
|
240
|
+
}
|
|
241
|
+
//const selectedWeChatAccount = (!_.isEmpty(this.props.Templates.selectedWeChatAccount) ? this.props.Templates.selectedWeChatAccount : this.props.Edit.selectedWeChatAccount);
|
|
218
242
|
const schema = inputSchema ? _.cloneDeep(inputSchema) : _.cloneDeep(this.state.schema);
|
|
219
243
|
const tabIndex = currentTab || this.state.currentTab;
|
|
220
244
|
const inputFields = get(schema, `containers[0].panes[${tabIndex - 1}].sections[0].childSections[0].childSections[0].inputFields`);
|
|
@@ -331,7 +355,17 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
331
355
|
};
|
|
332
356
|
|
|
333
357
|
getTransformedData = (formData) => {
|
|
334
|
-
|
|
358
|
+
let selectedWeChatAccount = {};
|
|
359
|
+
if(this.props.location.pathname === '/mobilepush/edit') {
|
|
360
|
+
if(!_.isEmpty(this.props.Edit.selectedWeChatAccount)) {
|
|
361
|
+
selectedWeChatAccount = this.props.Edit.selectedWeChatAccount;
|
|
362
|
+
console.log('selectedWeChatAccount---> if 362', selectedWeChatAccount);
|
|
363
|
+
}
|
|
364
|
+
}else if(!_.isEmpty(this.props.Templates.selectedWeChatAccount)){
|
|
365
|
+
selectedWeChatAccount = this.props.Templates.selectedWeChatAccount;
|
|
366
|
+
console.log('selectedWeChatAccount---> else 366', selectedWeChatAccount);
|
|
367
|
+
}
|
|
368
|
+
//const selectedWeChatAccount = (!_.isEmpty(this.props.Templates.selectedWeChatAccount) ? this.props.Templates.selectedWeChatAccount : this.props.Edit.selectedWeChatAccount);
|
|
335
369
|
const obj = _.cloneDeep(this.state.editData);
|
|
336
370
|
obj.versions = {
|
|
337
371
|
base: {},
|
|
@@ -561,7 +595,17 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
561
595
|
};
|
|
562
596
|
|
|
563
597
|
getLinkName = (link) => {
|
|
564
|
-
|
|
598
|
+
let selectedWeChatAccount = {};
|
|
599
|
+
if(this.props.location.pathname === '/mobilepush/edit') {
|
|
600
|
+
if(!_.isEmpty(this.props.Edit.selectedWeChatAccount)) {
|
|
601
|
+
selectedWeChatAccount = this.props.Edit.selectedWeChatAccount;
|
|
602
|
+
console.log('selectedWeChatAccount---> if 602', selectedWeChatAccount);
|
|
603
|
+
}
|
|
604
|
+
}else if(!_.isEmpty(this.props.Templates.selectedWeChatAccount)){
|
|
605
|
+
selectedWeChatAccount = this.props.Templates.selectedWeChatAccount;
|
|
606
|
+
console.log('selectedWeChatAccount---> else 606', selectedWeChatAccount);
|
|
607
|
+
}
|
|
608
|
+
// const selectedWeChatAccount = (!_.isEmpty(this.props.Templates.selectedWeChatAccount) ? this.props.Templates.selectedWeChatAccount : this.props.Edit.selectedWeChatAccount);
|
|
565
609
|
const ck = selectedWeChatAccount.configs ? !!selectedWeChatAccount.configs.deeplink : false;
|
|
566
610
|
const deepLinkOptions = _.filter(JSON.parse(ck ? selectedWeChatAccount.configs.deeplink : '[]'), (l) => l.link === link);
|
|
567
611
|
if (deepLinkOptions[0]) {
|
|
@@ -960,7 +1004,17 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
960
1004
|
showSelectedIosCta = (inputSchema, field, tab, selectedConfig) => {
|
|
961
1005
|
const currentTab = tab || this.state.currentTab;
|
|
962
1006
|
const schema = inputSchema ? _.cloneDeep(inputSchema) : _.cloneDeep(this.state.schema);
|
|
963
|
-
|
|
1007
|
+
let selectedWeChatAccount = {};
|
|
1008
|
+
if(this.props.location.pathname === '/mobilepush/edit') {
|
|
1009
|
+
if(!_.isEmpty(this.props.Edit.selectedWeChatAccount)) {
|
|
1010
|
+
selectedWeChatAccount = this.props.Edit.selectedWeChatAccount;
|
|
1011
|
+
console.log('selectedWeChatAccount---> if 1011', selectedWeChatAccount);
|
|
1012
|
+
}
|
|
1013
|
+
}else if(!_.isEmpty(this.props.Templates.selectedWeChatAccount)){
|
|
1014
|
+
selectedWeChatAccount = this.props.Templates.selectedWeChatAccount;
|
|
1015
|
+
console.log('selectedWeChatAccount---> else 1015', selectedWeChatAccount);
|
|
1016
|
+
}
|
|
1017
|
+
// const selectedWeChatAccount = (!_.isEmpty(this.props.Templates.selectedWeChatAccount) ? this.props.Templates.selectedWeChatAccount : this.props.Edit.selectedWeChatAccount);
|
|
964
1018
|
const ck = selectedWeChatAccount.configs ? !!selectedWeChatAccount.configs.deeplink : false;
|
|
965
1019
|
const deepLinkOptions = _.map(JSON.parse(ck ? selectedWeChatAccount.configs.deeplink : '[]'), (link) => ({label: link.name, value: link.link, title: link.link }) );
|
|
966
1020
|
|
|
@@ -1088,7 +1142,17 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
1088
1142
|
};
|
|
1089
1143
|
|
|
1090
1144
|
deletePrimaryCTA = (event) => {
|
|
1091
|
-
|
|
1145
|
+
let selectedWeChatAccount = {};
|
|
1146
|
+
if(this.props.location.pathname === '/mobilepush/edit') {
|
|
1147
|
+
if(!_.isEmpty(this.props.Edit.selectedWeChatAccount)) {
|
|
1148
|
+
selectedWeChatAccount = this.props.Edit.selectedWeChatAccount;
|
|
1149
|
+
console.log('selectedWeChatAccount---> if 1149', selectedWeChatAccount);
|
|
1150
|
+
}
|
|
1151
|
+
}else if(!_.isEmpty(this.props.Templates.selectedWeChatAccount)){
|
|
1152
|
+
selectedWeChatAccount = this.props.Templates.selectedWeChatAccount;
|
|
1153
|
+
console.log('selectedWeChatAccount---> else 1153', selectedWeChatAccount);
|
|
1154
|
+
}
|
|
1155
|
+
// const selectedWeChatAccount = (!_.isEmpty(this.props.Templates.selectedWeChatAccount) ? this.props.Templates.selectedWeChatAccount : this.props.Edit.selectedWeChatAccount);
|
|
1092
1156
|
const id = event.currentTarget.id;
|
|
1093
1157
|
const schema = _.cloneDeep(this.state.schema);
|
|
1094
1158
|
// const eventsMap = _.cloneDeep(this.state.eventsMap);
|
|
@@ -1188,7 +1252,17 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
1188
1252
|
};
|
|
1189
1253
|
|
|
1190
1254
|
deleteSecondaryCTA = (event) => {
|
|
1191
|
-
|
|
1255
|
+
let selectedWeChatAccount = {};
|
|
1256
|
+
if(this.props.location.pathname === '/mobilepush/edit') {
|
|
1257
|
+
if(!_.isEmpty(this.props.Edit.selectedWeChatAccount)) {
|
|
1258
|
+
selectedWeChatAccount = this.props.Edit.selectedWeChatAccount;
|
|
1259
|
+
console.log('selectedWeChatAccount---> if 1259', selectedWeChatAccount);
|
|
1260
|
+
}
|
|
1261
|
+
}else if(!_.isEmpty(this.props.Templates.selectedWeChatAccount)){
|
|
1262
|
+
selectedWeChatAccount = this.props.Templates.selectedWeChatAccount;
|
|
1263
|
+
console.log('selectedWeChatAccount---> else 1263', selectedWeChatAccount);
|
|
1264
|
+
}
|
|
1265
|
+
//const selectedWeChatAccount = (!_.isEmpty(this.props.Templates.selectedWeChatAccount) ? this.props.Templates.selectedWeChatAccount : this.props.Edit.selectedWeChatAccount);
|
|
1192
1266
|
const id = event.currentTarget.id;
|
|
1193
1267
|
if (id === "secondary-cta-0-delete") {
|
|
1194
1268
|
const secCta2 = document.getElementById("secondary-cta-1-delete");
|
|
@@ -1561,7 +1635,17 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
1561
1635
|
};
|
|
1562
1636
|
|
|
1563
1637
|
showCtaKeys = (eventTriggered, formData, field, tabIndex, schemaInput) => {
|
|
1564
|
-
|
|
1638
|
+
let selectedWeChatAccount = {};
|
|
1639
|
+
if(this.props.location.pathname === '/mobilepush/edit') {
|
|
1640
|
+
if(!_.isEmpty(this.props.Edit.selectedWeChatAccount)) {
|
|
1641
|
+
selectedWeChatAccount = this.props.Edit.selectedWeChatAccount;
|
|
1642
|
+
console.log('selectedWeChatAccount---> if 1642', selectedWeChatAccount);
|
|
1643
|
+
}
|
|
1644
|
+
}else if(!_.isEmpty(this.props.Templates.selectedWeChatAccount)){
|
|
1645
|
+
selectedWeChatAccount = this.props.Templates.selectedWeChatAccount;
|
|
1646
|
+
console.log('selectedWeChatAccount---> else 1646', selectedWeChatAccount);
|
|
1647
|
+
}
|
|
1648
|
+
// const selectedWeChatAccount = (!_.isEmpty(this.props.Templates.selectedWeChatAccount) ? this.props.Templates.selectedWeChatAccount : this.props.Edit.selectedWeChatAccount);
|
|
1565
1649
|
const currentTab = tabIndex || this.state.currentTab;
|
|
1566
1650
|
const schema = _.cloneDeep(schemaInput || this.state.schema);
|
|
1567
1651
|
const eventsMap = _.cloneDeep(this.state.eventsMap);
|
|
@@ -1616,7 +1700,17 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
1616
1700
|
return schema;
|
|
1617
1701
|
};
|
|
1618
1702
|
addPrimaryCta = (flag, formData, field, inputSchema, currentTab) => {
|
|
1619
|
-
|
|
1703
|
+
let selectedWeChatAccount = {};
|
|
1704
|
+
if(this.props.location.pathname === '/mobilepush/edit') {
|
|
1705
|
+
if(!_.isEmpty(this.props.Edit.selectedWeChatAccount)) {
|
|
1706
|
+
selectedWeChatAccount = this.props.Edit.selectedWeChatAccount;
|
|
1707
|
+
console.log('selectedWeChatAccount---> if 1707', selectedWeChatAccount);
|
|
1708
|
+
}
|
|
1709
|
+
}else if(!_.isEmpty(this.props.Templates.selectedWeChatAccount)){
|
|
1710
|
+
selectedWeChatAccount = this.props.Templates.selectedWeChatAccount;
|
|
1711
|
+
console.log('selectedWeChatAccount---> else 1711', selectedWeChatAccount);
|
|
1712
|
+
}
|
|
1713
|
+
// const selectedWeChatAccount = (!_.isEmpty(this.props.Templates.selectedWeChatAccount) ? this.props.Templates.selectedWeChatAccount : this.props.Edit.selectedWeChatAccount);
|
|
1620
1714
|
const id = field.id;
|
|
1621
1715
|
const schema = inputSchema ? _.cloneDeep(inputSchema) : _.cloneDeep(this.state.schema);
|
|
1622
1716
|
const ck = selectedWeChatAccount.configs ? !!selectedWeChatAccount.configs.deeplink : false;
|
|
@@ -1649,7 +1743,17 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
1649
1743
|
const tabIndex = currentTab || this.state.currentTab;
|
|
1650
1744
|
const formDataCopy = cloneDeep(formData);
|
|
1651
1745
|
const schema = inputSchema ? _.cloneDeep(inputSchema) : _.cloneDeep(this.state.schema);
|
|
1652
|
-
|
|
1746
|
+
let selectedWeChatAccount = {};
|
|
1747
|
+
if(this.props.location.pathname === '/mobilepush/edit') {
|
|
1748
|
+
if(!_.isEmpty(this.props.Edit.selectedWeChatAccount)) {
|
|
1749
|
+
selectedWeChatAccount = this.props.Edit.selectedWeChatAccount;
|
|
1750
|
+
console.log('selectedWeChatAccount---> if 1746', selectedWeChatAccount);
|
|
1751
|
+
}
|
|
1752
|
+
}else if(!_.isEmpty(this.props.Templates.selectedWeChatAccount)){
|
|
1753
|
+
selectedWeChatAccount = this.props.Templates.selectedWeChatAccount;
|
|
1754
|
+
console.log('selectedWeChatAccount---> else 1754', selectedWeChatAccount);
|
|
1755
|
+
}
|
|
1756
|
+
//const selectedWeChatAccount = (!_.isEmpty(this.props.Templates.selectedWeChatAccount) ? this.props.Templates.selectedWeChatAccount : this.props.Edit.selectedWeChatAccount);
|
|
1653
1757
|
const ck = selectedWeChatAccount.configs ? !!selectedWeChatAccount.configs.deeplink : false;
|
|
1654
1758
|
const deepLinkOptions = selectedWeChatAccount ? _.map(JSON.parse(ck ? selectedWeChatAccount.configs.deeplink : '[]'), (link) => ({label: link.name, value: link.link, title: link.link }) ) : [];
|
|
1655
1759
|
const inputFields = get(schema, `containers[0].panes[${tabIndex - 1}].sections[0].childSections[0].childSections[0].inputFields`);
|