Skip to content

Commit

Permalink
fixed lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
rgravitvl committed Dec 7, 2023
1 parent 192a62a commit 5c0950b
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions tools/importer/transformers/columns.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,22 @@ import {
/* global WebImporter */

const render = {
featureimage : (item, row, document) => {
featureimage: (item, row, document) => {
const featureImages = (item.content) ? item.content.querySelectorAll('div.featureimage') : [item];
featureImages.forEach((featureImageEL) => {
if (featureImageEL?.firstElementChild?.localName === 'feature-image') {
featureImage(featureImageEL, document);
WebImporter.DOMUtils.remove(featureImageEL, ['feature-image']);
}

if (featureImageEL) {
row.push(featureImageEL);
}
});
return row;
},

imagetext : (template, row, document) => {
imagetext: (template, row, document) => {
const imageText = template.content.querySelector('imagetext');
if (imageText) {
const img = document.createElement('img');
Expand All @@ -28,7 +28,7 @@ const render = {
}
},

heading : (template, row, document) => {
heading: (template, row, document) => {
const heading = template.content.querySelector('div.heading');
if (heading) {
const headingEL = heading?.querySelector('heading');
Expand All @@ -45,7 +45,7 @@ const render = {
}
},

'heading-aem' : (item, row, document) => {
'heading-aem': (item, row, document) => {
const heading = (item.content) ? item.content.querySelector('div.heading-aem') : item;
if (heading) {
if (heading.nextElementSibling && [...heading.nextElementSibling.classList].includes('featureimage')) {
Expand All @@ -56,12 +56,12 @@ const render = {
}
},

script : (template, row) => {
const featureImage = template.content.querySelector('div.featureimage');
if (featureImage) {
row.push(featureImage);
script: (template, row) => {
const featureImageEl = template.content.querySelector('div.featureimage');
if (featureImageEl) {
row.push(featureImageEl);
}
}
},
};

const createAllColumns = (allColumns, document, noOfColumn) => {
Expand All @@ -81,21 +81,21 @@ const createAllColumns = (allColumns, document, noOfColumn) => {
[...template.content.children].forEach((element) => {
if (element.className === 'container responsivegrid') {
const container = template.content.querySelector('div.cmp-container');
if(container){
let match = cells[0][0].match(/Columns\s*\(\s*([^)]*)\s*\)/);
if (container) {
const match = cells[0][0].match(/Columns\s*\(\s*([^)]*)\s*\)/);
if (match) {
let contentInsideParentheses = match[1];
let updatedString = `Columns (${contentInsideParentheses}, ${container.id})`;
const contentInsideParentheses = match[1];
const updatedString = `Columns (${contentInsideParentheses}, ${container.id})`;
cells.splice(0, 1); cells.push([updatedString]);
} else {
let updatedString = `Columns (${container.id})`;
const updatedString = `Columns (${container.id})`;
cells.splice(0, 1); cells.push([updatedString]);
}
[...container.children].forEach((item) => {
render[item.className](item, row, document);
})
[...container.children].forEach((childItem) => {
render[item.className](childItem, row, document);
});
}
} else if(element.className !== 'articlecard'){
} else if (element.className !== 'articlecard') {
render[element.className](template, row, document);
}
});
Expand Down

0 comments on commit 5c0950b

Please sign in to comment.