From 9c9e6deab16a9b34b863d9692df61d680260596f Mon Sep 17 00:00:00 2001 From: Miu Razvan Date: Sun, 11 Oct 2020 16:53:59 +0300 Subject: [PATCH] Updated Search page --- .../volto/components/theme/Search/Search.jsx | 69 +++++++++++-------- 1 file changed, 39 insertions(+), 30 deletions(-) diff --git a/src/customizations/volto/components/theme/Search/Search.jsx b/src/customizations/volto/components/theme/Search/Search.jsx index 082f8998..26ac1a0e 100644 --- a/src/customizations/volto/components/theme/Search/Search.jsx +++ b/src/customizations/volto/components/theme/Search/Search.jsx @@ -97,7 +97,9 @@ const getSummary = (item, searchableText) => { item.blocks && Object.entries(item.blocks).forEach(([key, block], index) => { const text = getText(block); - summary.fullSummary.push(paragraph(text, searchableText)); + if (text && text.length > 0) { + summary.fullSummary.push(paragraph(text, searchableText)); + } if (text && text.length > 0 && summary.firstParagraph.length === 0) { summary.firstParagraph.push(paragraph(smallText(text), searchableText)); } @@ -110,6 +112,7 @@ const getSummary = (item, searchableText) => { ); } }); + return summary; }; @@ -317,7 +320,7 @@ class Search extends Component { id={`article_${item['@id']}`} > -

+

-

+
@@ -346,39 +349,45 @@ class Search extends Component { ? item.summary.firstParagraph[0] : item.description}
- + {item.summary.fullSummary.length ? ( + + ) : ( + '' + )}
))}
-

Pollutants

+

Pollutants

{pollutants .filter( (pollutant) =>