From 164969ad64cc1e19e498b9738ad44098b9377955 Mon Sep 17 00:00:00 2001 From: wz914876 Date: Thu, 30 Nov 2023 17:10:19 +0530 Subject: [PATCH 1/5] Carousel Converter Structure Change --- tools/importer/transformers/carousel.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tools/importer/transformers/carousel.js b/tools/importer/transformers/carousel.js index c02db7ff1..bb15e4575 100644 --- a/tools/importer/transformers/carousel.js +++ b/tools/importer/transformers/carousel.js @@ -3,11 +3,11 @@ const createCarousel = (main, document) => { const carousel = main.querySelector('home-carousel'); if (carousel) { const cells = []; - const carousels = []; // eslint-disable-next-line no-undef const carouselLists = JSON.parse(decodeHtmlEntities(carousel.getAttribute('slidedata'))); cells.push(['carousel']); - [...carouselLists].forEach((list) => { + const carousels = carouselLists.map((list) => { + const rightDiv = document.createElement('div'); const title = document.createElement('p'); title.innerHTML = list.title; @@ -48,10 +48,9 @@ const createCarousel = (main, document) => { img.setAttribute('alt', 'Danaher Corporation'); } leftDiv.append(img); - - carousels.push(leftDiv, rightDiv); + return [rightDiv, leftDiv]; }); - cells.push(carousels); + cells.push(...carousels); const block = WebImporter.DOMUtils.createTable(cells, document); carousel.append(block); } From d4db12914fe6edfcb1135611c315fbe58d0118cd Mon Sep 17 00:00:00 2001 From: wz914876 Date: Thu, 30 Nov 2023 17:40:53 +0530 Subject: [PATCH 2/5] lint errors fix --- tools/importer/transformers/carousel.js | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/importer/transformers/carousel.js b/tools/importer/transformers/carousel.js index bb15e4575..bb72dcb09 100644 --- a/tools/importer/transformers/carousel.js +++ b/tools/importer/transformers/carousel.js @@ -7,7 +7,6 @@ const createCarousel = (main, document) => { const carouselLists = JSON.parse(decodeHtmlEntities(carousel.getAttribute('slidedata'))); cells.push(['carousel']); const carousels = carouselLists.map((list) => { - const rightDiv = document.createElement('div'); const title = document.createElement('p'); title.innerHTML = list.title; From fe91628433ecc5e157bb6717e91cb1237219985d Mon Sep 17 00:00:00 2001 From: wz914876 Date: Thu, 30 Nov 2023 19:06:03 +0530 Subject: [PATCH 3/5] updated the test case --- .../convert/test/fixtures/product1-converted.html | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/tools/actions/convert/test/fixtures/product1-converted.html b/tools/actions/convert/test/fixtures/product1-converted.html index 35c0f3870..a14dfec53 100644 --- a/tools/actions/convert/test/fixtures/product1-converted.html +++ b/tools/actions/convert/test/fixtures/product1-converted.html @@ -1,4 +1,3 @@ -
@@ -16,29 +15,33 @@
From 2401213aefa6af76c7f6a7406fab29786d64bb76 Mon Sep 17 00:00:00 2001 From: wz914876 Date: Fri, 1 Dec 2023 09:43:06 +0530 Subject: [PATCH 4/5] Changed title field with H2 tag --- tools/actions/convert/test/fixtures/product1-converted.html | 6 +++--- tools/importer/transformers/carousel.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/actions/convert/test/fixtures/product1-converted.html b/tools/actions/convert/test/fixtures/product1-converted.html index a14dfec53..8e0ceaddb 100644 --- a/tools/actions/convert/test/fixtures/product1-converted.html +++ b/tools/actions/convert/test/fixtures/product1-converted.html @@ -16,7 +16,7 @@