Dimensions
dimensions
diff --git a/tools/importer/transformers/metadata.js b/tools/importer/transformers/metadata.js
index a26894fdb..5c07c4574 100644
--- a/tools/importer/transformers/metadata.js
+++ b/tools/importer/transformers/metadata.js
@@ -58,6 +58,14 @@ const addCategoryMeta = (url, meta) => {
}
};
+const addSKUMeta = (url, meta) => {
+ // detect family|sku|budle pages based on url and set sku metadata
+ if (url.pathname.match(/\/content\/danaher\/ls\/us\/en\/products\/(family\/|sku\/|bundle\/)/)) {
+ const sku = url.pathname.replace(/^\/content\/danaher\/ls\/us\/en\/products\//, '').replace(/\.html$/, '').split('/');
+ meta.sku = sku.pop();
+ }
+};
+
// eslint-disable-next-line no-unused-vars
const createMetadata = (main, document, html, params, urlStr) => {
const meta = {};
@@ -147,6 +155,7 @@ const createMetadata = (main, document, html, params, urlStr) => {
addArticleMeta(document, meta);
addDataLayerMeta(document, html, meta);
addCategoryMeta(urlStr, meta);
+ addSKUMeta(urlStr, meta);
const block = WebImporter.Blocks.getMetadataBlock(document, meta);
main.append(block);
diff --git a/tools/importer/transformers/product.js b/tools/importer/transformers/product.js
index 41c280879..9aac27145 100644
--- a/tools/importer/transformers/product.js
+++ b/tools/importer/transformers/product.js
@@ -4,6 +4,7 @@ import {
/* global WebImporter */
const TABS_MAPPING = [
+ { id: 'feature' },
{ id: 'overview', sectionName: 'Product Overview' },
{ id: 'specification', sectionName: 'Product Specifications' },
{ id: 'solutions', sectionName: 'Product Solutions' },
@@ -59,19 +60,18 @@ const createProductPage = (main, document) => {
const attributeCells = [];
const template = product.querySelector(`template[v-slot:${tab.tabId}]`);
const tabConfig = TABS_MAPPING.find((m) => m.id.toLowerCase() === tab.tabId.toLowerCase());
- const blockName = tabConfig ? tabConfig.sectionName : tab.tabId;
- if (tab.tabId !== 'feature') {
- const block = WebImporter.DOMUtils.createTable([[blockName], ['']], document);
- main.append(block);
- }
- if (tab.tabId === 'specification') {
+
+ if (tab.tabId === 'specification' && tabConfig.sectionName) {
const attributes = JSON.parse(product.getAttribute('attributes'));
- attributeCells.push(['Product Attributes']);
+ attributeCells.push([tabConfig.sectionName]);
attributes.forEach((attribute) => {
attributeCells.push([attribute.attributeLabel, attribute.attribute]);
});
const attributeTable = WebImporter.DOMUtils.createTable(attributeCells, document);
main.append(attributeTable);
+ } else if (tabConfig.sectionName) {
+ const block = WebImporter.DOMUtils.createTable([[tabConfig.sectionName], ['']], document);
+ main.append(block);
}
if (template.content.childNodes.length > 1) {