@capillarytech/creatives-library 9.0.26 → 9.0.28
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 +1 -1
- package/v2Containers/Email/index.js +26 -17
package/package.json
CHANGED
|
@@ -245,22 +245,24 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
245
245
|
if (_.isEmpty(this.props.Templates.BEETemplate) && !_.isEmpty(this.props.templateData)) {
|
|
246
246
|
const td = this.props.templateData;
|
|
247
247
|
const activeTab = _.get(td, 'versions.base.activeTab', 'en');
|
|
248
|
-
// This path bypasses setEditData, so seed the subject from the inline
|
|
249
|
-
// templateData too (otherwise the title is empty for a created drag-drop).
|
|
250
|
-
const inlineSubject = _.get(td, 'base.subject')
|
|
251
|
-
|| _.get(td, `versions.base.${activeTab}.subject`)
|
|
252
|
-
|| _.get(td, 'versions.base.subject')
|
|
253
|
-
|| _.get(td, 'emailSubject')
|
|
254
|
-
|| _.get(td, 'subject');
|
|
255
|
-
if (inlineSubject) {
|
|
256
|
-
formData['template-subject'] = inlineSubject;
|
|
257
|
-
}
|
|
258
248
|
const inlineIsDragDrop = _.get(td, 'base.is_drag_drop')
|
|
259
249
|
|| _.get(td, `versions.base.${activeTab}.is_drag_drop`)
|
|
260
250
|
|| _.get(td, 'versions.base.is_drag_drop')
|
|
261
251
|
|| _.get(td, 'is_drag_drop');
|
|
252
|
+
// BEE-ONLY: everything below is gated on is_drag_drop so this fallback
|
|
253
|
+
// never touches the HTML/CKEditor flow (which also has an empty BEETemplate).
|
|
262
254
|
if ((inlineIsDragDrop === true || inlineIsDragDrop === 1) && isBEEAppEnable) {
|
|
263
255
|
this.setState({ isDragDrop: true });
|
|
256
|
+
// This path bypasses setEditData, so seed the subject from the inline
|
|
257
|
+
// templateData too (otherwise the title is empty for a created drag-drop).
|
|
258
|
+
const inlineSubject = _.get(td, 'base.subject')
|
|
259
|
+
|| _.get(td, `versions.base.${activeTab}.subject`)
|
|
260
|
+
|| _.get(td, 'versions.base.subject')
|
|
261
|
+
|| _.get(td, 'emailSubject')
|
|
262
|
+
|| _.get(td, 'subject');
|
|
263
|
+
if (inlineSubject) {
|
|
264
|
+
formData['template-subject'] = inlineSubject;
|
|
265
|
+
}
|
|
264
266
|
const inlineDragDropId = _.get(td, 'base.drag_drop_id')
|
|
265
267
|
|| _.get(td, 'base.id')
|
|
266
268
|
|| _.get(td, `versions.base.${activeTab}.drag_drop_id`)
|
|
@@ -1183,13 +1185,20 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
1183
1185
|
const type = this.props.location.query.type;
|
|
1184
1186
|
|
|
1185
1187
|
formData['template-name'] = editData.name;
|
|
1186
|
-
//
|
|
1187
|
-
// emailSubject) over the fetched template's subject
|
|
1188
|
-
// on re-open.
|
|
1189
|
-
//
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|| _.get(this.props, 'templateData.
|
|
1188
|
+
// BEE-ONLY: for embedded drag-drop content, prefer the inline edited subject
|
|
1189
|
+
// (base.subject / emailSubject) over the fetched template's subject so subject
|
|
1190
|
+
// edits persist on re-open. Gated on is_drag_drop so the HTML/CKEditor flow is
|
|
1191
|
+
// untouched (it keeps using editData.versions.base.subject as before).
|
|
1192
|
+
// setEditData runs once (editDataSet), so this is a one-time load-time override.
|
|
1193
|
+
const tdIsDragDrop = _.get(this.props, 'templateData.base.is_drag_drop') === true
|
|
1194
|
+
|| _.get(this.props, 'templateData.base.is_drag_drop') === 1
|
|
1195
|
+
|| _.get(this.props, 'templateData.is_drag_drop') === true
|
|
1196
|
+
|| _.get(this.props, 'templateData.is_drag_drop') === 1;
|
|
1197
|
+
const inlineSubject = tdIsDragDrop
|
|
1198
|
+
? (_.get(this.props, 'templateData.base.subject', '')
|
|
1199
|
+
|| _.get(this.props, 'templateData.emailSubject', '')
|
|
1200
|
+
|| _.get(this.props, 'templateData.subject', ''))
|
|
1201
|
+
: '';
|
|
1193
1202
|
const subject = inlineSubject || _.get(editData, 'versions.base.subject', '');
|
|
1194
1203
|
formData['template-subject'] = subject;
|
|
1195
1204
|
formData.base = editData.versions.base;
|