Skip to content

Commit

Permalink
Added empty block for product not found
Browse files Browse the repository at this point in the history
  • Loading branch information
rgravitvl committed Dec 3, 2024
1 parent 2205655 commit d533dbe
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tools/importer/transformers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ import stats from './stats.js';
import workflowCarousel from './workflowCarousel.js';
import embedScript from './embedScript.js';
import callToActionText from './callToActionText.js';
import productNotFound from './product-not-found.js';

// eslint-disable-next-line import/prefer-default-export
export const transformers = [
Expand Down Expand Up @@ -91,6 +92,7 @@ export const transformers = [
workflowCarousel,
embedScript,
callToActionText,
productNotFound,
];

export const asyncTransformers = [
Expand Down
10 changes: 10 additions & 0 deletions tools/importer/transformers/product-not-found.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/* global WebImporter */
const productNotFound = (main, document) => {
const notFoundEl = main.querySelector('div#product-not-found');
if (notFoundEl) {
const block = [['Product not found'], ['']];
const table = WebImporter.DOMUtils.createTable(block, document);
notFoundEl.replaceWith(table);
}
};
export default productNotFound;

0 comments on commit d533dbe

Please sign in to comment.