@capillarytech/creatives-library 9.0.21 → 9.0.23

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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@capillarytech/creatives-library",
3
3
  "author": "meharaj",
4
- "version": "9.0.21",
4
+ "version": "9.0.23",
5
5
  "description": "Capillary creatives ui",
6
6
  "main": "./index.js",
7
7
  "module": "./index.es.js",
@@ -617,9 +617,14 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
617
617
  'json-content': finalBeeJsonValue,
618
618
  };
619
619
 
620
- // Ensure template-subject is preserved at the top level
620
+ // Ensure template-subject is preserved at the top level. For embedded
621
+ // content templateDetails isn't fetched, so also read the subject from
622
+ // the inline templateData prop (base.subject / subject / emailSubject).
621
623
  if (formData['template-subject'] === undefined || formData['template-subject'] === '') {
622
- const subjectFromEditData = _.get(nextProps, 'Email.templateDetails.versions.base.subject', '');
624
+ const subjectFromEditData = _.get(nextProps, 'Email.templateDetails.versions.base.subject', '')
625
+ || _.get(nextProps, 'templateData.base.subject', '')
626
+ || _.get(nextProps, 'templateData.subject', '')
627
+ || _.get(nextProps, 'templateData.emailSubject', '');
623
628
  if (subjectFromEditData) {
624
629
  formData['template-subject'] = subjectFromEditData;
625
630
  }
@@ -2473,8 +2478,11 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
2473
2478
  formData[0].selectedLanguages = [];
2474
2479
  let tabKey;
2475
2480
  if ((this.props.location.query.isLanguageSupport === undefined || this.props.location.query.isLanguageSupport === 'false')) {
2476
- // If formData['template-subject'] is empty, assign an empty string; otherwise, retain its current value or use data.base.subject.
2477
- formData['template-subject'] = formData?.['template-subject'] === '' ? '' : (data?.base?.subject || '');
2481
+ // Prefer the saved subject from the inline templateData (base.subject);
2482
+ // fall back to any existing value. The previous `=== '' ? '' :` guard kept
2483
+ // an empty subject on open for embedded content (which routes through
2484
+ // startTemplateCreation), dropping data.base.subject.
2485
+ formData['template-subject'] = data?.base?.subject || formData?.['template-subject'] || '';
2478
2486
  const baseLanguage = this.props.currentOrgDetails.basic_details.base_language;
2479
2487
  let languageIndex = _.findIndex(this.supportedLanguages, {iso_code: baseLanguage});
2480
2488