diff --git a/tools/actions/convert/test/fixtures/product-converted.html b/tools/actions/convert/test/fixtures/product-converted.html index 107bf1a44..7b5593c59 100644 --- a/tools/actions/convert/test/fixtures/product-converted.html +++ b/tools/actions/convert/test/fixtures/product-converted.html @@ -41,11 +41,6 @@
-
-
-
-
-
Specifications
specifications
diff --git a/tools/actions/convert/test/fixtures/product1-converted.html b/tools/actions/convert/test/fixtures/product1-converted.html index d09971675..00903e369 100644 --- a/tools/actions/convert/test/fixtures/product1-converted.html +++ b/tools/actions/convert/test/fixtures/product1-converted.html @@ -133,11 +133,6 @@

Streamlined Workflow


-
-
-
-
-
Dimensions
dimensions
diff --git a/tools/actions/convert/test/fixtures/product2-converted.html b/tools/actions/convert/test/fixtures/product2-converted.html index 6e3bdff6d..fc10e89f2 100644 --- a/tools/actions/convert/test/fixtures/product2-converted.html +++ b/tools/actions/convert/test/fixtures/product2-converted.html @@ -178,11 +178,6 @@

Enhanced for stem cell applications*


-
-
-
-
-
Imaging
imaging
diff --git a/tools/actions/convert/test/fixtures/product3-converted.html b/tools/actions/convert/test/fixtures/product3-converted.html index 7471dcf38..199b85bde 100644 --- a/tools/actions/convert/test/fixtures/product3-converted.html +++ b/tools/actions/convert/test/fixtures/product3-converted.html @@ -129,11 +129,6 @@

The Microhub era is now!


-
-
-
-
-
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) {