@capillarytech/creatives-library 7.17.216 → 7.17.218
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
|
@@ -442,7 +442,7 @@ export class Creatives extends React.Component {
|
|
|
442
442
|
} = {},
|
|
443
443
|
} = templateData;
|
|
444
444
|
const mediaParams = {};
|
|
445
|
-
const { url = '', previewUrl = '', docParams = {}, footer = '', headerVarMapped = {}, headerTemplate = ''} = whatsappMedia;
|
|
445
|
+
const { url = '', previewUrl = '', docParams = {}, footer = '', headerVarMapped = {}, headerTemplate = ''} = whatsappMedia || {};
|
|
446
446
|
switch (mediaType) {
|
|
447
447
|
case (WHATSAPP_MEDIA_TYPES.IMAGE):
|
|
448
448
|
mediaParams.imageUrl = url;
|
|
@@ -117,11 +117,11 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
117
117
|
const { id: selectedWeChatAccountId } = editSelectedWeChatAccount || {};
|
|
118
118
|
const { definition } = templateDetails || {};
|
|
119
119
|
const { accountId: templateAccountId } = definition || {};
|
|
120
|
-
const { Edit: nextEdit } = nextProps || {};
|
|
120
|
+
const { Templates: nextTemplates, Edit: nextEdit } = nextProps || {};
|
|
121
121
|
if (isEmbeddedEditOrPreview(queryType, creativesMode)) {
|
|
122
122
|
selectedWeChatAccount = !_.isEmpty(editSelectedWeChatAccount)
|
|
123
123
|
? editSelectedWeChatAccount
|
|
124
|
-
:
|
|
124
|
+
: nextTemplates?.selectedWeChatAccount;
|
|
125
125
|
} else if (!_.isEmpty(Templates?.selectedWeChatAccount)) {
|
|
126
126
|
selectedWeChatAccount = Templates?.selectedWeChatAccount;
|
|
127
127
|
}
|
|
@@ -154,11 +154,11 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
154
154
|
) {
|
|
155
155
|
this.setMobilePushAccountOptions(nextEdit?.weCrmAccounts, templateAccountId);
|
|
156
156
|
}
|
|
157
|
-
if (!_.isEmpty(
|
|
157
|
+
if (!_.isEmpty(nextTemplates?.selectedWeChatAccount) && !_.isEqual(editSelectedWeChatAccount, nextEdit?.selectedWeChatAccount) && (queryType === EMBEDDED) && this.props.location.query.module === "loyalty") {
|
|
158
158
|
const params = {
|
|
159
159
|
name: '',
|
|
160
160
|
sortBy: 'Most Recent',
|
|
161
|
-
accountId:
|
|
161
|
+
accountId: nextTemplates?.selectedWeChatAccount?.id,
|
|
162
162
|
};
|
|
163
163
|
this.props.actions.getMobilepushTemplatesList('mobilepush', params);
|
|
164
164
|
}
|
|
@@ -169,8 +169,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
169
169
|
if (nextProps.location.query.module !== 'loyalty' && templateId && templateId !== 'temp') {
|
|
170
170
|
this.props.actions.getTemplateDetails(templateId);
|
|
171
171
|
}
|
|
172
|
-
|
|
173
|
-
if (type === 'embedded' && templateId === 'temp' && _.isEmpty(this.state.formData)) { // when his.props.params.id is temp that means mobile push template content will be passed from post message from parent with startTemplateCreation action
|
|
172
|
+
if (queryType === EMBEDDED && templateId === 'temp' && _.isEmpty(this.state.formData)) { // when his.props.params.id is temp that means mobile push template content will be passed from post message from parent with startTemplateCreation action
|
|
174
173
|
const response = {
|
|
175
174
|
action: 'startTemplateCreation',
|
|
176
175
|
};
|
|
@@ -178,12 +177,12 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
178
177
|
this.getTags();
|
|
179
178
|
}
|
|
180
179
|
});
|
|
181
|
-
if (
|
|
180
|
+
if (queryType === EMBEDDED) {
|
|
182
181
|
this.showNext();
|
|
183
182
|
}
|
|
184
183
|
}
|
|
185
184
|
if (nextProps.metaEntities && nextProps.metaEntities.layouts && nextProps.metaEntities.layouts.length > 0 && nextProps.Edit.mobilepushTemplates && !_.isEqual(nextProps.Edit.mobilepushTemplates, this.props.Edit.mobilepushTemplates)) { //used inloyalty
|
|
186
|
-
if (nextProps.location.query.type ===
|
|
185
|
+
if (nextProps.location.query.type === EMBEDDED && nextProps.location.query.module === 'loyalty') {
|
|
187
186
|
this.setTemplateOptions(nextProps.Edit.mobilepushTemplates);
|
|
188
187
|
}
|
|
189
188
|
}
|