@capillarytech/creatives-library 3.0.25 → 3.0.27
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.
|
@@ -2638,22 +2638,20 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
2638
2638
|
const formData = _.cloneDeep(this.state.formData);
|
|
2639
2639
|
formData[0].selectedLanguages = [];
|
|
2640
2640
|
let tabKey;
|
|
2641
|
-
const isDragDrop = _.get(data, 'base.is_drag_drop');
|
|
2642
2641
|
if (this.props.location.query.type === 'embedded' && (this.props.location.query.isLanguageSupport === undefined || this.props.location.query.isLanguageSupport === 'false')) {
|
|
2643
|
-
formData['template-subject'] =
|
|
2642
|
+
formData['template-subject'] = data.base.subject ? data.base.subject : '';
|
|
2644
2643
|
const baseLanguage = this.props.Global.currentOrgDetails.basic_details.base_language;
|
|
2645
2644
|
let languageIndex = _.findIndex(this.supportedLanguages, {iso_code: baseLanguage});
|
|
2646
2645
|
console.log("startTemplatecreation before index", languageIndex, this.supportedLanguages, baseLanguage, formData);
|
|
2647
2646
|
if (languageIndex === -1) {
|
|
2648
2647
|
languageIndex = 0;
|
|
2649
2648
|
}
|
|
2650
|
-
const isDragDrop = _.get(data, 'base.is_drag_drop');
|
|
2651
2649
|
const tempData = {
|
|
2652
|
-
"is_drag_drop":
|
|
2650
|
+
"is_drag_drop": data.base.is_drag_drop,
|
|
2653
2651
|
"lang_id": this.supportedLanguages[languageIndex].lang_id,
|
|
2654
2652
|
"iso_code": this.supportedLanguages[languageIndex].iso_code,
|
|
2655
2653
|
"language": this.supportedLanguages[languageIndex].language,
|
|
2656
|
-
"template-content": !
|
|
2654
|
+
"template-content": !data.base.is_drag_drop && data.base.is_drag_drop !== 1 ? data.base.html_content : "",
|
|
2657
2655
|
};
|
|
2658
2656
|
formData[0].base = true;
|
|
2659
2657
|
formData[0].selectedLanguages.push(this.supportedLanguages[languageIndex].iso_code);
|
|
@@ -2702,7 +2700,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
2702
2700
|
}
|
|
2703
2701
|
formData.base = _.cloneDeep(formData[0]);
|
|
2704
2702
|
console.log('startTemplateCreation final ', formData);
|
|
2705
|
-
this.setState({formData, loading: false, injectedTags: data.tags, tabKey, isDragDrop: (
|
|
2703
|
+
this.setState({formData, loading: false, injectedTags: data.tags, tabKey, isDragDrop: (data.base.is_drag_drop !== 0 )}, () => {
|
|
2706
2704
|
// this.setState({tabKey: ''});
|
|
2707
2705
|
_.forEach(formData[0].selectedLanguages, (language) => {
|
|
2708
2706
|
if (formData[0][language].is_drag_drop) {
|
|
@@ -222,15 +222,13 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
222
222
|
}
|
|
223
223
|
}
|
|
224
224
|
});
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
});
|
|
233
|
-
}
|
|
225
|
+
this.setState({selectedAccount: selectedAccount.name}, () => {
|
|
226
|
+
params.wecrmId = selectedAccount.configs.wecrm_app_id;
|
|
227
|
+
params.wecrmToken = selectedAccount.configs.wecrm_token;
|
|
228
|
+
params.originalId = selectedAccount.sourceAccountIdentifier;
|
|
229
|
+
nextProps.actions.setWeChatAccount(selectedAccount);
|
|
230
|
+
this.getAllTemplates({params});
|
|
231
|
+
});
|
|
234
232
|
} else if (this.state.channel.toLowerCase() === 'mobilepush' && (nextProps.location.query.account_id || nextProps.location.query.source_account_id)) {
|
|
235
233
|
_.forEach(nextProps.Templates.weCrmAccounts, (account) => {
|
|
236
234
|
if ((nextProps.location.query.account_id && account.id === Number(nextProps.location.query.account_id)) || (nextProps.location.query.source_account_id && account.sourceAccountIdentifier && account.sourceAccountIdentifier === nextProps.location.query.source_account_id)) {
|