rerobe-js-orm 3.3.3 → 3.3.5
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/lib/models/Product.js +12 -5
- package/package.json +1 -1
package/lib/models/Product.js
CHANGED
|
@@ -510,25 +510,32 @@ class Product extends Base_1.default {
|
|
|
510
510
|
].filter(Boolean),
|
|
511
511
|
},
|
|
512
512
|
];
|
|
513
|
-
|
|
513
|
+
const sectionsHTML = [];
|
|
514
514
|
// Generate HTML for base attribute sections
|
|
515
515
|
baseAttributeSections.forEach((section) => {
|
|
516
516
|
const sectionHTML = section.attributes
|
|
517
|
-
.map((attribute) =>
|
|
517
|
+
.map((attribute) => attribute ? `<li class="editor-listitem"><span style="white-space: pre-wrap;">${attribute}</span></li>` : '')
|
|
518
518
|
.filter(Boolean) // Removes any falsey values
|
|
519
519
|
.join('\n');
|
|
520
|
-
|
|
520
|
+
if (sectionHTML) {
|
|
521
|
+
sectionsHTML.push(`<p class="editor-paragraph" dir="ltr"><b><strong class="editor-text-bold" style="white-space: pre-wrap;">${t(section.title)}</strong></b></p>` + `<ul class="editor-list-ul">\n${sectionHTML}\n</ul>`);
|
|
522
|
+
}
|
|
521
523
|
});
|
|
522
524
|
// Generate HTML for additional sections
|
|
523
525
|
additionalSections.forEach((section) => {
|
|
524
526
|
if (section.title && section.attributes && section.attributes.length > 0) {
|
|
525
527
|
const sectionHTML = section.attributes
|
|
526
|
-
.map((attribute) =>
|
|
528
|
+
.map((attribute) => attribute
|
|
529
|
+
? `<li class="editor-listitem"><span style="white-space: pre-wrap;">${t(attribute)}</span></li>`
|
|
530
|
+
: '')
|
|
527
531
|
.filter(Boolean) // Removes any falsey values
|
|
528
532
|
.join('\n');
|
|
529
|
-
|
|
533
|
+
if (sectionHTML) {
|
|
534
|
+
sectionsHTML.push(`<p class="editor-paragraph" dir="ltr"><b><strong class="editor-text-bold" style="white-space: pre-wrap;">${t(section.title)}</strong></b></p>` + `<ul class="editor-list-ul">\n${sectionHTML}\n</ul>`);
|
|
535
|
+
}
|
|
530
536
|
}
|
|
531
537
|
});
|
|
538
|
+
const descriptionHTML = sectionsHTML.join('');
|
|
532
539
|
return t(this.attributes.description) + (descriptionHTML ? `\n${descriptionHTML}` : '');
|
|
533
540
|
}
|
|
534
541
|
autoCreateMetaDescription() {
|