From a9c4c089c42e5ceb981aaeb4e411096df206b3e2 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Fri, 26 May 2023 23:11:09 -0700 Subject: [PATCH 01/29] Fix glossary warning due to lack of empty line before a term (#4820) --- docs/source/configuration/settings-reference.md | 2 +- news/4820.documentation | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 news/4820.documentation diff --git a/docs/source/configuration/settings-reference.md b/docs/source/configuration/settings-reference.md index 65d3d3cca1..779d7f1417 100644 --- a/docs/source/configuration/settings-reference.md +++ b/docs/source/configuration/settings-reference.md @@ -226,7 +226,6 @@ workflowMapping It's meant to be extended with your own workflows/transitions. It is recommended to assign the same color to the transition as the destination state, so the user can have the visual hint to which state are they transitioning to. - styleClassNameConverters An object with functions used by the style wrapper helpers to convert style data to actual class names. You can customize the generated classname by @@ -374,6 +373,7 @@ additionalToolbarComponents }} ``` + blockSettingsTabFieldsetsInitialStateOpen A Boolean, `true` by default. The fieldsets in the blocks settings tab start by default as non-collapsed (opened), you can decide to have them collapsed (closed) by default setting this to `false`. diff --git a/news/4820.documentation b/news/4820.documentation new file mode 100644 index 0000000000..54143e75c9 --- /dev/null +++ b/news/4820.documentation @@ -0,0 +1 @@ +Fix glossary warning due to lack of empty line before a term. @stevepiercy From 7eebc6610a8177e7a622d7cfc9df98635f80fa10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Fern=C3=A1ndez=20de=20Alba?= Date: Mon, 29 May 2023 16:00:38 +0200 Subject: [PATCH 02/29] Fix block is undefined in StyleWrapper helper when building classnames (#4827) --- news/4827.bugfix | 1 + src/components/theme/View/RenderBlocks.jsx | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 news/4827.bugfix diff --git a/news/4827.bugfix b/news/4827.bugfix new file mode 100644 index 0000000000..5fb332d601 --- /dev/null +++ b/news/4827.bugfix @@ -0,0 +1 @@ +Fix block is undefined in StyleWrapper helper when building classnames @sneridagh diff --git a/src/components/theme/View/RenderBlocks.jsx b/src/components/theme/View/RenderBlocks.jsx index 86de669b25..440dd53df0 100644 --- a/src/components/theme/View/RenderBlocks.jsx +++ b/src/components/theme/View/RenderBlocks.jsx @@ -44,7 +44,13 @@ const RenderBlocks = (props) => { }); return Block ? ( - + Date: Mon, 29 May 2023 16:02:42 +0200 Subject: [PATCH 03/29] fix special characters in request urls (#4825) --- news/4825.bugfix | 1 + src/helpers/Api/Api.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 news/4825.bugfix diff --git a/news/4825.bugfix b/news/4825.bugfix new file mode 100644 index 0000000000..1954c0f6ec --- /dev/null +++ b/news/4825.bugfix @@ -0,0 +1 @@ +Fix special characters in request urls @pnicolli @mamico @luca-bellenghi @cekk diff --git a/src/helpers/Api/Api.js b/src/helpers/Api/Api.js index e804499e71..c91a667ea4 100644 --- a/src/helpers/Api/Api.js +++ b/src/helpers/Api/Api.js @@ -89,7 +89,7 @@ class Api { checkUrl && request.url && request.xhr && - stripQuerystring(request.url) !== + encodeURI(stripQuerystring(request.url)) !== stripQuerystring(request.xhr.responseURL) ) { if (request.xhr.responseURL?.length === 0) { From 0b4f36072843a3982fffcd7b3c2a28c975d831b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Fern=C3=A1ndez=20de=20Alba?= Date: Thu, 1 Jun 2023 14:03:38 +0200 Subject: [PATCH 04/29] Fix navigation sections in 404 pages (#4836) --- news/4836.bugfix | 1 + src/components/theme/NotFound/NotFound.jsx | 96 +++++++++++++--------- 2 files changed, 56 insertions(+), 41 deletions(-) create mode 100644 news/4836.bugfix diff --git a/news/4836.bugfix b/news/4836.bugfix new file mode 100644 index 0000000000..072331927b --- /dev/null +++ b/news/4836.bugfix @@ -0,0 +1 @@ +Fix navigation sections in 404 pages @sneridagh diff --git a/src/components/theme/NotFound/NotFound.jsx b/src/components/theme/NotFound/NotFound.jsx index 3f93d0fe9b..d0a90723a2 100644 --- a/src/components/theme/NotFound/NotFound.jsx +++ b/src/components/theme/NotFound/NotFound.jsx @@ -1,53 +1,67 @@ -/** - * Home container. - * @module components/theme/NotFound/NotFound - */ - -import React from 'react'; +import { useEffect } from 'react'; +import { BodyClass, toBackendLang } from '@plone/volto/helpers'; import { FormattedMessage } from 'react-intl'; import { Link } from 'react-router-dom'; import { Container } from 'semantic-ui-react'; import { withServerErrorCode } from '@plone/volto/helpers/Utils/Utils'; +import { useDispatch, useSelector } from 'react-redux'; +import { getNavigation } from '@plone/volto/actions'; +import config from '@plone/volto/registry'; /** * Not found function. * @function NotFound * @returns {string} Markup of the not found page. */ -const NotFound = () => ( - -

- -

-

- -

-

- - - - ), - }} - /> -

-

- -

-
-); +const NotFound = () => { + const dispatch = useDispatch(); + const lang = useSelector((state) => state.intl.locale); + + useEffect(() => { + dispatch( + getNavigation( + config.settings.isMultilingual ? `/${toBackendLang(lang)}` : '/', + config.settings.navDepth, + ), + ); + }, [dispatch, lang]); + + return ( + + +

+ +

+

+ +

+

+ + + + ), + }} + /> +

+

+ +

+
+ ); +}; export default withServerErrorCode(404)(NotFound); From b208d9e948917be30eba7b2b7723c18b655d3da4 Mon Sep 17 00:00:00 2001 From: Victor Fernandez de Alba Date: Thu, 1 Jun 2023 17:03:17 +0200 Subject: [PATCH 05/29] Release 17.0.0-alpha.9 --- CHANGELOG.md | 13 +++++++++++++ news/4820.documentation | 1 - news/4825.bugfix | 1 - news/4827.bugfix | 1 - news/4836.bugfix | 1 - package.json | 2 +- packages/volto-slate/package.json | 2 +- 7 files changed, 15 insertions(+), 6 deletions(-) delete mode 100644 news/4820.documentation delete mode 100644 news/4825.bugfix delete mode 100644 news/4827.bugfix delete mode 100644 news/4836.bugfix diff --git a/CHANGELOG.md b/CHANGELOG.md index ed90e70754..e7c8d246e5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,19 @@ +## 17.0.0-alpha.9 (2023-06-01) + +### Bugfix + +- Fix special characters in request urls @pnicolli @mamico @luca-bellenghi @cekk [#4825](https://github.com/plone/volto/issues/4825) +- Fix block is undefined in StyleWrapper helper when building classnames @sneridagh [#4827](https://github.com/plone/volto/issues/4827) +- Fix navigation sections in 404 pages @sneridagh [#4836](https://github.com/plone/volto/issues/4836) + +### Documentation + +- Fix glossary warning due to lack of empty line before a term. @stevepiercy [#4820](https://github.com/plone/volto/issues/4820) + + ## 17.0.0-alpha.8 (2023-05-24) ### Feature diff --git a/news/4820.documentation b/news/4820.documentation deleted file mode 100644 index 54143e75c9..0000000000 --- a/news/4820.documentation +++ /dev/null @@ -1 +0,0 @@ -Fix glossary warning due to lack of empty line before a term. @stevepiercy diff --git a/news/4825.bugfix b/news/4825.bugfix deleted file mode 100644 index 1954c0f6ec..0000000000 --- a/news/4825.bugfix +++ /dev/null @@ -1 +0,0 @@ -Fix special characters in request urls @pnicolli @mamico @luca-bellenghi @cekk diff --git a/news/4827.bugfix b/news/4827.bugfix deleted file mode 100644 index 5fb332d601..0000000000 --- a/news/4827.bugfix +++ /dev/null @@ -1 +0,0 @@ -Fix block is undefined in StyleWrapper helper when building classnames @sneridagh diff --git a/news/4836.bugfix b/news/4836.bugfix deleted file mode 100644 index 072331927b..0000000000 --- a/news/4836.bugfix +++ /dev/null @@ -1 +0,0 @@ -Fix navigation sections in 404 pages @sneridagh diff --git a/package.json b/package.json index 06606e5281..4dc9c19184 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ } ], "license": "MIT", - "version": "17.0.0-alpha.8", + "version": "17.0.0-alpha.9", "repository": { "type": "git", "url": "git@github.com:plone/volto.git" diff --git a/packages/volto-slate/package.json b/packages/volto-slate/package.json index 4b159c1895..5cffb00466 100644 --- a/packages/volto-slate/package.json +++ b/packages/volto-slate/package.json @@ -1,6 +1,6 @@ { "name": "@plone/volto-slate", - "version": "17.0.0-alpha.8", + "version": "17.0.0-alpha.9", "description": "Slate.js integration with Volto", "main": "src/index.js", "author": "European Environment Agency: IDM2 A-Team", From 10c94fda2633a342d3d368cb67acfcdfb53151ed Mon Sep 17 00:00:00 2001 From: Philip Bauer Date: Fri, 2 Jun 2023 18:03:23 +0200 Subject: [PATCH 06/29] Search Block: Add support for advanced facets that are displayed on demand (#4784) --- docs/source/user-manual/blocks.md | 3 + locales/ca/LC_MESSAGES/volto.po | 30 ++++++++++ locales/de/LC_MESSAGES/volto.po | 30 ++++++++++ locales/en/LC_MESSAGES/volto.po | 30 ++++++++++ locales/es/LC_MESSAGES/volto.po | 30 ++++++++++ locales/eu/LC_MESSAGES/volto.po | 30 ++++++++++ locales/fi/LC_MESSAGES/volto.po | 30 ++++++++++ locales/fr/LC_MESSAGES/volto.po | 30 ++++++++++ locales/it/LC_MESSAGES/volto.po | 30 ++++++++++ locales/ja/LC_MESSAGES/volto.po | 30 ++++++++++ locales/nl/LC_MESSAGES/volto.po | 30 ++++++++++ locales/pt/LC_MESSAGES/volto.po | 30 ++++++++++ locales/pt_BR/LC_MESSAGES/volto.po | 30 ++++++++++ locales/ro/LC_MESSAGES/volto.po | 30 ++++++++++ locales/volto.pot | 32 +++++++++- locales/zh_CN/LC_MESSAGES/volto.po | 30 ++++++++++ news/4783.feature | 2 + .../Blocks/Search/components/Facets.jsx | 60 ++++++++++++++++++- .../Blocks/Search/layout/LeftColumnFacets.jsx | 22 +++++-- .../Search/layout/RightColumnFacets.jsx | 22 +++++-- .../Blocks/Search/layout/TopSideFacets.jsx | 26 ++++++-- src/components/manage/Blocks/Search/schema.js | 17 +++++- theme/themes/pastanaga/extras/search.less | 6 ++ 23 files changed, 591 insertions(+), 19 deletions(-) create mode 100644 news/4783.feature diff --git a/docs/source/user-manual/blocks.md b/docs/source/user-manual/blocks.md index 9e4c744d4d..7c8e42b3d5 100644 --- a/docs/source/user-manual/blocks.md +++ b/docs/source/user-manual/blocks.md @@ -408,6 +408,9 @@ Hide facet? : Toggle to show or hide the facet. Hidden facets will still filter the results if proper parameters are passed in URLs +Advanced facet? +: Select to set the facet as advanced. + Advanced facets are initially hidden and displayed on demand. #### Controls diff --git a/locales/ca/LC_MESSAGES/volto.po b/locales/ca/LC_MESSAGES/volto.po index a02dd0dc4c..4fd41e4e6b 100644 --- a/locales/ca/LC_MESSAGES/volto.po +++ b/locales/ca/LC_MESSAGES/volto.po @@ -277,6 +277,16 @@ msgstr "" msgid "Addon upgraded succesfuly" msgstr "" +#: components/manage/Blocks/Search/schema +# defaultMessage: Advanced facet? +msgid "Advanced facet?" +msgstr "" + +#: components/manage/Blocks/Search/schema +# defaultMessage: Advanced facets are initially hidden and displayed on demand +msgid "Advanced facets are initially hidden and displayed on demand" +msgstr "" + #: config/Views # defaultMessage: Album view msgid "Album view" @@ -1582,6 +1592,11 @@ msgstr "Amaga les respostes" msgid "Hide facet?" msgstr "Amagar la faceta?" +#: components/manage/Blocks/Search/components/Facets +# defaultMessage: Hide filters +msgid "Hide filters" +msgstr "" + #: components/manage/History/History #: components/manage/Toolbar/More # defaultMessage: History @@ -1878,6 +1893,11 @@ msgstr "Imatge Principal" msgid "Left" msgstr "A l'esquerra" +#: components/manage/Blocks/Search/components/Facets +# defaultMessage: Less filters +msgid "Less filters" +msgstr "" + #: components/manage/Toolbar/Toolbar # defaultMessage: Link msgid "Link" @@ -2087,6 +2107,11 @@ msgstr "Mensual" msgid "More" msgstr "Més" +#: components/manage/Blocks/Search/components/Facets +# defaultMessage: More filters +msgid "More filters" +msgstr "" + #: components/manage/Controlpanels/UpgradeControlPanel # defaultMessage: More information about the upgrade procedure can be found in the documentation section of plone.org in the Upgrade Guide. msgid "More information about the upgrade procedure can be found in the documentation section of plone.org in the Upgrade Guide." @@ -3096,6 +3121,11 @@ msgstr "Mostrar tots" msgid "Show Replies" msgstr "Mostra les respostes" +#: components/manage/Blocks/Search/components/Facets +# defaultMessage: Show filters +msgid "Show filters" +msgstr "" + #: helpers/MessageLabels/MessageLabels # defaultMessage: Show groups of users below msgid "Show groups of users below" diff --git a/locales/de/LC_MESSAGES/volto.po b/locales/de/LC_MESSAGES/volto.po index 16f7066fe3..c662174ae1 100644 --- a/locales/de/LC_MESSAGES/volto.po +++ b/locales/de/LC_MESSAGES/volto.po @@ -274,6 +274,16 @@ msgstr "Erweiterung erfolgreich deaktiviert" msgid "Addon upgraded succesfuly" msgstr "Erweiterung erfolgreich aktualisiert" +#: components/manage/Blocks/Search/schema +# defaultMessage: Advanced facet? +msgid "Advanced facet?" +msgstr "" + +#: components/manage/Blocks/Search/schema +# defaultMessage: Advanced facets are initially hidden and displayed on demand +msgid "Advanced facets are initially hidden and displayed on demand" +msgstr "" + #: config/Views # defaultMessage: Album view msgid "Album view" @@ -1579,6 +1589,11 @@ msgstr "Antworten ausblenden" msgid "Hide facet?" msgstr "Facette verstecken" +#: components/manage/Blocks/Search/components/Facets +# defaultMessage: Hide filters +msgid "Hide filters" +msgstr "" + #: components/manage/History/History #: components/manage/Toolbar/More # defaultMessage: History @@ -1875,6 +1890,11 @@ msgstr "Lead-Bild" msgid "Left" msgstr "Links" +#: components/manage/Blocks/Search/components/Facets +# defaultMessage: Less filters +msgid "Less filters" +msgstr "" + #: components/manage/Toolbar/Toolbar # defaultMessage: Link msgid "Link" @@ -2084,6 +2104,11 @@ msgstr "Monatlich" msgid "More" msgstr "Mehr" +#: components/manage/Blocks/Search/components/Facets +# defaultMessage: More filters +msgid "More filters" +msgstr "" + #: components/manage/Controlpanels/UpgradeControlPanel # defaultMessage: More information about the upgrade procedure can be found in the documentation section of plone.org in the Upgrade Guide. msgid "More information about the upgrade procedure can be found in the documentation section of plone.org in the Upgrade Guide." @@ -3093,6 +3118,11 @@ msgstr "Alle anzeigen" msgid "Show Replies" msgstr "Antworten anzeigen" +#: components/manage/Blocks/Search/components/Facets +# defaultMessage: Show filters +msgid "Show filters" +msgstr "" + #: helpers/MessageLabels/MessageLabels # defaultMessage: Show groups of users below msgid "Show groups of users below" diff --git a/locales/en/LC_MESSAGES/volto.po b/locales/en/LC_MESSAGES/volto.po index a24059b653..d99f995048 100644 --- a/locales/en/LC_MESSAGES/volto.po +++ b/locales/en/LC_MESSAGES/volto.po @@ -268,6 +268,16 @@ msgstr "" msgid "Addon upgraded succesfuly" msgstr "" +#: components/manage/Blocks/Search/schema +# defaultMessage: Advanced facet? +msgid "Advanced facet?" +msgstr "" + +#: components/manage/Blocks/Search/schema +# defaultMessage: Advanced facets are initially hidden and displayed on demand +msgid "Advanced facets are initially hidden and displayed on demand" +msgstr "" + #: config/Views # defaultMessage: Album view msgid "Album view" @@ -1573,6 +1583,11 @@ msgstr "" msgid "Hide facet?" msgstr "" +#: components/manage/Blocks/Search/components/Facets +# defaultMessage: Hide filters +msgid "Hide filters" +msgstr "" + #: components/manage/History/History #: components/manage/Toolbar/More # defaultMessage: History @@ -1869,6 +1884,11 @@ msgstr "" msgid "Left" msgstr "" +#: components/manage/Blocks/Search/components/Facets +# defaultMessage: Less filters +msgid "Less filters" +msgstr "" + #: components/manage/Toolbar/Toolbar # defaultMessage: Link msgid "Link" @@ -2078,6 +2098,11 @@ msgstr "" msgid "More" msgstr "" +#: components/manage/Blocks/Search/components/Facets +# defaultMessage: More filters +msgid "More filters" +msgstr "" + #: components/manage/Controlpanels/UpgradeControlPanel # defaultMessage: More information about the upgrade procedure can be found in the documentation section of plone.org in the Upgrade Guide. msgid "More information about the upgrade procedure can be found in the documentation section of plone.org in the Upgrade Guide." @@ -3087,6 +3112,11 @@ msgstr "" msgid "Show Replies" msgstr "" +#: components/manage/Blocks/Search/components/Facets +# defaultMessage: Show filters +msgid "Show filters" +msgstr "" + #: helpers/MessageLabels/MessageLabels # defaultMessage: Show groups of users below msgid "Show groups of users below" diff --git a/locales/es/LC_MESSAGES/volto.po b/locales/es/LC_MESSAGES/volto.po index 46d8d38ef5..112723bb18 100644 --- a/locales/es/LC_MESSAGES/volto.po +++ b/locales/es/LC_MESSAGES/volto.po @@ -279,6 +279,16 @@ msgstr "Complemento desinstalado con éxito" msgid "Addon upgraded succesfuly" msgstr "Complemento actualizado con éxito" +#: components/manage/Blocks/Search/schema +# defaultMessage: Advanced facet? +msgid "Advanced facet?" +msgstr "" + +#: components/manage/Blocks/Search/schema +# defaultMessage: Advanced facets are initially hidden and displayed on demand +msgid "Advanced facets are initially hidden and displayed on demand" +msgstr "" + #: config/Views # defaultMessage: Album view msgid "Album view" @@ -1584,6 +1594,11 @@ msgstr "Ocultar respuestas" msgid "Hide facet?" msgstr "¿Ocultar la faceta?" +#: components/manage/Blocks/Search/components/Facets +# defaultMessage: Hide filters +msgid "Hide filters" +msgstr "" + #: components/manage/History/History #: components/manage/Toolbar/More # defaultMessage: History @@ -1880,6 +1895,11 @@ msgstr "Imagen principal" msgid "Left" msgstr "Izquierda" +#: components/manage/Blocks/Search/components/Facets +# defaultMessage: Less filters +msgid "Less filters" +msgstr "" + #: components/manage/Toolbar/Toolbar # defaultMessage: Link msgid "Link" @@ -2089,6 +2109,11 @@ msgstr "Mensualmente" msgid "More" msgstr "Más" +#: components/manage/Blocks/Search/components/Facets +# defaultMessage: More filters +msgid "More filters" +msgstr "" + #: components/manage/Controlpanels/UpgradeControlPanel # defaultMessage: More information about the upgrade procedure can be found in the documentation section of plone.org in the Upgrade Guide. msgid "More information about the upgrade procedure can be found in the documentation section of plone.org in the Upgrade Guide." @@ -3098,6 +3123,11 @@ msgstr "Mostrar todos" msgid "Show Replies" msgstr "Mostrar respuestas" +#: components/manage/Blocks/Search/components/Facets +# defaultMessage: Show filters +msgid "Show filters" +msgstr "" + #: helpers/MessageLabels/MessageLabels # defaultMessage: Show groups of users below msgid "Show groups of users below" diff --git a/locales/eu/LC_MESSAGES/volto.po b/locales/eu/LC_MESSAGES/volto.po index 931b0ccfcc..c549d73d94 100644 --- a/locales/eu/LC_MESSAGES/volto.po +++ b/locales/eu/LC_MESSAGES/volto.po @@ -275,6 +275,16 @@ msgstr "Produktu gehigarria ondo kendu da" msgid "Addon upgraded succesfuly" msgstr "Produktu gehigarria ondo eguneratu da" +#: components/manage/Blocks/Search/schema +# defaultMessage: Advanced facet? +msgid "Advanced facet?" +msgstr "" + +#: components/manage/Blocks/Search/schema +# defaultMessage: Advanced facets are initially hidden and displayed on demand +msgid "Advanced facets are initially hidden and displayed on demand" +msgstr "" + #: config/Views # defaultMessage: Album view msgid "Album view" @@ -1580,6 +1590,11 @@ msgstr "Ezkutatu erantzunak" msgid "Hide facet?" msgstr "Fazeta ezkutatu?" +#: components/manage/Blocks/Search/components/Facets +# defaultMessage: Hide filters +msgid "Hide filters" +msgstr "" + #: components/manage/History/History #: components/manage/Toolbar/More # defaultMessage: History @@ -1876,6 +1891,11 @@ msgstr "Irudia" msgid "Left" msgstr "Ezkerrean" +#: components/manage/Blocks/Search/components/Facets +# defaultMessage: Less filters +msgid "Less filters" +msgstr "" + #: components/manage/Toolbar/Toolbar # defaultMessage: Link msgid "Link" @@ -2085,6 +2105,11 @@ msgstr "Hilero" msgid "More" msgstr "Gehiago" +#: components/manage/Blocks/Search/components/Facets +# defaultMessage: More filters +msgid "More filters" +msgstr "" + #: components/manage/Controlpanels/UpgradeControlPanel # defaultMessage: More information about the upgrade procedure can be found in the documentation section of plone.org in the Upgrade Guide. msgid "More information about the upgrade procedure can be found in the documentation section of plone.org in the Upgrade Guide." @@ -3094,6 +3119,11 @@ msgstr "Erakutsi guztiak" msgid "Show Replies" msgstr "Erakutsi erantzunak" +#: components/manage/Blocks/Search/components/Facets +# defaultMessage: Show filters +msgid "Show filters" +msgstr "" + #: helpers/MessageLabels/MessageLabels # defaultMessage: Show groups of users below msgid "Show groups of users below" diff --git a/locales/fi/LC_MESSAGES/volto.po b/locales/fi/LC_MESSAGES/volto.po index 814af6ebdd..c7f76d17a4 100644 --- a/locales/fi/LC_MESSAGES/volto.po +++ b/locales/fi/LC_MESSAGES/volto.po @@ -279,6 +279,16 @@ msgstr "Laajennos poistettu onnistuneesti" msgid "Addon upgraded succesfuly" msgstr "Laajennos päivitetty onnistuneesti" +#: components/manage/Blocks/Search/schema +# defaultMessage: Advanced facet? +msgid "Advanced facet?" +msgstr "" + +#: components/manage/Blocks/Search/schema +# defaultMessage: Advanced facets are initially hidden and displayed on demand +msgid "Advanced facets are initially hidden and displayed on demand" +msgstr "" + #: config/Views # defaultMessage: Album view msgid "Album view" @@ -1584,6 +1594,11 @@ msgstr "Piilota vastaukset" msgid "Hide facet?" msgstr "Piilota fasetti?" +#: components/manage/Blocks/Search/components/Facets +# defaultMessage: Hide filters +msgid "Hide filters" +msgstr "" + #: components/manage/History/History #: components/manage/Toolbar/More # defaultMessage: History @@ -1880,6 +1895,11 @@ msgstr "Nostokuva" msgid "Left" msgstr "Vasemmalla" +#: components/manage/Blocks/Search/components/Facets +# defaultMessage: Less filters +msgid "Less filters" +msgstr "" + #: components/manage/Toolbar/Toolbar # defaultMessage: Link msgid "Link" @@ -2089,6 +2109,11 @@ msgstr "Kuukausittain" msgid "More" msgstr "Lisää" +#: components/manage/Blocks/Search/components/Facets +# defaultMessage: More filters +msgid "More filters" +msgstr "" + #: components/manage/Controlpanels/UpgradeControlPanel # defaultMessage: More information about the upgrade procedure can be found in the documentation section of plone.org in the Upgrade Guide. msgid "More information about the upgrade procedure can be found in the documentation section of plone.org in the Upgrade Guide." @@ -3098,6 +3123,11 @@ msgstr "Näytä kaikki" msgid "Show Replies" msgstr "Näytä vastaukset" +#: components/manage/Blocks/Search/components/Facets +# defaultMessage: Show filters +msgid "Show filters" +msgstr "" + #: helpers/MessageLabels/MessageLabels # defaultMessage: Show groups of users below msgid "Show groups of users below" diff --git a/locales/fr/LC_MESSAGES/volto.po b/locales/fr/LC_MESSAGES/volto.po index d437f15166..3c29448196 100644 --- a/locales/fr/LC_MESSAGES/volto.po +++ b/locales/fr/LC_MESSAGES/volto.po @@ -285,6 +285,16 @@ msgstr "Module désinstallé avec succès" msgid "Addon upgraded succesfuly" msgstr "Module mis à jour avec succès" +#: components/manage/Blocks/Search/schema +# defaultMessage: Advanced facet? +msgid "Advanced facet?" +msgstr "" + +#: components/manage/Blocks/Search/schema +# defaultMessage: Advanced facets are initially hidden and displayed on demand +msgid "Advanced facets are initially hidden and displayed on demand" +msgstr "" + #: config/Views # defaultMessage: Album view msgid "Album view" @@ -1590,6 +1600,11 @@ msgstr "Masquer les réponses" msgid "Hide facet?" msgstr "Masquer la facette ?" +#: components/manage/Blocks/Search/components/Facets +# defaultMessage: Hide filters +msgid "Hide filters" +msgstr "" + #: components/manage/History/History #: components/manage/Toolbar/More # defaultMessage: History @@ -1886,6 +1901,11 @@ msgstr "Image de garde" msgid "Left" msgstr "Gauche" +#: components/manage/Blocks/Search/components/Facets +# defaultMessage: Less filters +msgid "Less filters" +msgstr "" + #: components/manage/Toolbar/Toolbar # defaultMessage: Link msgid "Link" @@ -2095,6 +2115,11 @@ msgstr "Mensuel" msgid "More" msgstr "Plus" +#: components/manage/Blocks/Search/components/Facets +# defaultMessage: More filters +msgid "More filters" +msgstr "" + #: components/manage/Controlpanels/UpgradeControlPanel # defaultMessage: More information about the upgrade procedure can be found in the documentation section of plone.org in the Upgrade Guide. msgid "More information about the upgrade procedure can be found in the documentation section of plone.org in the Upgrade Guide." @@ -3104,6 +3129,11 @@ msgstr "Afficher tous" msgid "Show Replies" msgstr "Afficher les réponses" +#: components/manage/Blocks/Search/components/Facets +# defaultMessage: Show filters +msgid "Show filters" +msgstr "" + #: helpers/MessageLabels/MessageLabels # defaultMessage: Show groups of users below msgid "Show groups of users below" diff --git a/locales/it/LC_MESSAGES/volto.po b/locales/it/LC_MESSAGES/volto.po index aafcf9dda1..d7daf1981d 100644 --- a/locales/it/LC_MESSAGES/volto.po +++ b/locales/it/LC_MESSAGES/volto.po @@ -268,6 +268,16 @@ msgstr "" msgid "Addon upgraded succesfuly" msgstr "" +#: components/manage/Blocks/Search/schema +# defaultMessage: Advanced facet? +msgid "Advanced facet?" +msgstr "" + +#: components/manage/Blocks/Search/schema +# defaultMessage: Advanced facets are initially hidden and displayed on demand +msgid "Advanced facets are initially hidden and displayed on demand" +msgstr "" + #: config/Views # defaultMessage: Album view msgid "Album view" @@ -1573,6 +1583,11 @@ msgstr "Nascondi risposte" msgid "Hide facet?" msgstr "Nascondi il filtro" +#: components/manage/Blocks/Search/components/Facets +# defaultMessage: Hide filters +msgid "Hide filters" +msgstr "" + #: components/manage/History/History #: components/manage/Toolbar/More # defaultMessage: History @@ -1869,6 +1884,11 @@ msgstr "Immagine di testata" msgid "Left" msgstr "Sinistra" +#: components/manage/Blocks/Search/components/Facets +# defaultMessage: Less filters +msgid "Less filters" +msgstr "" + #: components/manage/Toolbar/Toolbar # defaultMessage: Link msgid "Link" @@ -2078,6 +2098,11 @@ msgstr "Mensile" msgid "More" msgstr "Altro" +#: components/manage/Blocks/Search/components/Facets +# defaultMessage: More filters +msgid "More filters" +msgstr "" + #: components/manage/Controlpanels/UpgradeControlPanel # defaultMessage: More information about the upgrade procedure can be found in the documentation section of plone.org in the Upgrade Guide. msgid "More information about the upgrade procedure can be found in the documentation section of plone.org in the Upgrade Guide." @@ -3087,6 +3112,11 @@ msgstr "Mostra tutti" msgid "Show Replies" msgstr "Mostra risposte" +#: components/manage/Blocks/Search/components/Facets +# defaultMessage: Show filters +msgid "Show filters" +msgstr "" + #: helpers/MessageLabels/MessageLabels # defaultMessage: Show groups of users below msgid "Show groups of users below" diff --git a/locales/ja/LC_MESSAGES/volto.po b/locales/ja/LC_MESSAGES/volto.po index 0ecb23ffe3..e630519d58 100644 --- a/locales/ja/LC_MESSAGES/volto.po +++ b/locales/ja/LC_MESSAGES/volto.po @@ -276,6 +276,16 @@ msgstr "" msgid "Addon upgraded succesfuly" msgstr "" +#: components/manage/Blocks/Search/schema +# defaultMessage: Advanced facet? +msgid "Advanced facet?" +msgstr "" + +#: components/manage/Blocks/Search/schema +# defaultMessage: Advanced facets are initially hidden and displayed on demand +msgid "Advanced facets are initially hidden and displayed on demand" +msgstr "" + #: config/Views # defaultMessage: Album view msgid "Album view" @@ -1581,6 +1591,11 @@ msgstr "" msgid "Hide facet?" msgstr "" +#: components/manage/Blocks/Search/components/Facets +# defaultMessage: Hide filters +msgid "Hide filters" +msgstr "" + #: components/manage/History/History #: components/manage/Toolbar/More # defaultMessage: History @@ -1877,6 +1892,11 @@ msgstr "リード画像" msgid "Left" msgstr "左" +#: components/manage/Blocks/Search/components/Facets +# defaultMessage: Less filters +msgid "Less filters" +msgstr "" + #: components/manage/Toolbar/Toolbar # defaultMessage: Link msgid "Link" @@ -2086,6 +2106,11 @@ msgstr "毎月" msgid "More" msgstr "もっと見る" +#: components/manage/Blocks/Search/components/Facets +# defaultMessage: More filters +msgid "More filters" +msgstr "" + #: components/manage/Controlpanels/UpgradeControlPanel # defaultMessage: More information about the upgrade procedure can be found in the documentation section of plone.org in the Upgrade Guide. msgid "More information about the upgrade procedure can be found in the documentation section of plone.org in the Upgrade Guide." @@ -3095,6 +3120,11 @@ msgstr "すべて表示" msgid "Show Replies" msgstr "" +#: components/manage/Blocks/Search/components/Facets +# defaultMessage: Show filters +msgid "Show filters" +msgstr "" + #: helpers/MessageLabels/MessageLabels # defaultMessage: Show groups of users below msgid "Show groups of users below" diff --git a/locales/nl/LC_MESSAGES/volto.po b/locales/nl/LC_MESSAGES/volto.po index 0c6aacd343..fb7e7a52cd 100644 --- a/locales/nl/LC_MESSAGES/volto.po +++ b/locales/nl/LC_MESSAGES/volto.po @@ -287,6 +287,16 @@ msgstr "" msgid "Addon upgraded succesfuly" msgstr "" +#: components/manage/Blocks/Search/schema +# defaultMessage: Advanced facet? +msgid "Advanced facet?" +msgstr "" + +#: components/manage/Blocks/Search/schema +# defaultMessage: Advanced facets are initially hidden and displayed on demand +msgid "Advanced facets are initially hidden and displayed on demand" +msgstr "" + #: config/Views # defaultMessage: Album view msgid "Album view" @@ -1592,6 +1602,11 @@ msgstr "" msgid "Hide facet?" msgstr "" +#: components/manage/Blocks/Search/components/Facets +# defaultMessage: Hide filters +msgid "Hide filters" +msgstr "" + #: components/manage/History/History #: components/manage/Toolbar/More # defaultMessage: History @@ -1888,6 +1903,11 @@ msgstr "" msgid "Left" msgstr "" +#: components/manage/Blocks/Search/components/Facets +# defaultMessage: Less filters +msgid "Less filters" +msgstr "" + #: components/manage/Toolbar/Toolbar # defaultMessage: Link msgid "Link" @@ -2097,6 +2117,11 @@ msgstr "" msgid "More" msgstr "" +#: components/manage/Blocks/Search/components/Facets +# defaultMessage: More filters +msgid "More filters" +msgstr "" + #: components/manage/Controlpanels/UpgradeControlPanel # defaultMessage: More information about the upgrade procedure can be found in the documentation section of plone.org in the Upgrade Guide. msgid "More information about the upgrade procedure can be found in the documentation section of plone.org in the Upgrade Guide." @@ -3106,6 +3131,11 @@ msgstr "" msgid "Show Replies" msgstr "" +#: components/manage/Blocks/Search/components/Facets +# defaultMessage: Show filters +msgid "Show filters" +msgstr "" + #: helpers/MessageLabels/MessageLabels # defaultMessage: Show groups of users below msgid "Show groups of users below" diff --git a/locales/pt/LC_MESSAGES/volto.po b/locales/pt/LC_MESSAGES/volto.po index ca756af8c7..623b2ed337 100644 --- a/locales/pt/LC_MESSAGES/volto.po +++ b/locales/pt/LC_MESSAGES/volto.po @@ -276,6 +276,16 @@ msgstr "" msgid "Addon upgraded succesfuly" msgstr "" +#: components/manage/Blocks/Search/schema +# defaultMessage: Advanced facet? +msgid "Advanced facet?" +msgstr "" + +#: components/manage/Blocks/Search/schema +# defaultMessage: Advanced facets are initially hidden and displayed on demand +msgid "Advanced facets are initially hidden and displayed on demand" +msgstr "" + #: config/Views # defaultMessage: Album view msgid "Album view" @@ -1581,6 +1591,11 @@ msgstr "" msgid "Hide facet?" msgstr "" +#: components/manage/Blocks/Search/components/Facets +# defaultMessage: Hide filters +msgid "Hide filters" +msgstr "" + #: components/manage/History/History #: components/manage/Toolbar/More # defaultMessage: History @@ -1877,6 +1892,11 @@ msgstr "" msgid "Left" msgstr "Esquerda" +#: components/manage/Blocks/Search/components/Facets +# defaultMessage: Less filters +msgid "Less filters" +msgstr "" + #: components/manage/Toolbar/Toolbar # defaultMessage: Link msgid "Link" @@ -2086,6 +2106,11 @@ msgstr "" msgid "More" msgstr "" +#: components/manage/Blocks/Search/components/Facets +# defaultMessage: More filters +msgid "More filters" +msgstr "" + #: components/manage/Controlpanels/UpgradeControlPanel # defaultMessage: More information about the upgrade procedure can be found in the documentation section of plone.org in the Upgrade Guide. msgid "More information about the upgrade procedure can be found in the documentation section of plone.org in the Upgrade Guide." @@ -3095,6 +3120,11 @@ msgstr "" msgid "Show Replies" msgstr "" +#: components/manage/Blocks/Search/components/Facets +# defaultMessage: Show filters +msgid "Show filters" +msgstr "" + #: helpers/MessageLabels/MessageLabels # defaultMessage: Show groups of users below msgid "Show groups of users below" diff --git a/locales/pt_BR/LC_MESSAGES/volto.po b/locales/pt_BR/LC_MESSAGES/volto.po index e2fdf9d27a..5bf7724273 100644 --- a/locales/pt_BR/LC_MESSAGES/volto.po +++ b/locales/pt_BR/LC_MESSAGES/volto.po @@ -278,6 +278,16 @@ msgstr "Complemento desinstalado com sucesso" msgid "Addon upgraded succesfuly" msgstr "Complemento atualizado com sucesso" +#: components/manage/Blocks/Search/schema +# defaultMessage: Advanced facet? +msgid "Advanced facet?" +msgstr "" + +#: components/manage/Blocks/Search/schema +# defaultMessage: Advanced facets are initially hidden and displayed on demand +msgid "Advanced facets are initially hidden and displayed on demand" +msgstr "" + #: config/Views # defaultMessage: Album view msgid "Album view" @@ -1583,6 +1593,11 @@ msgstr "Ocultar respostas" msgid "Hide facet?" msgstr "Ocultar faceta?" +#: components/manage/Blocks/Search/components/Facets +# defaultMessage: Hide filters +msgid "Hide filters" +msgstr "" + #: components/manage/History/History #: components/manage/Toolbar/More # defaultMessage: History @@ -1879,6 +1894,11 @@ msgstr "Imagem principal" msgid "Left" msgstr "Esquerda" +#: components/manage/Blocks/Search/components/Facets +# defaultMessage: Less filters +msgid "Less filters" +msgstr "" + #: components/manage/Toolbar/Toolbar # defaultMessage: Link msgid "Link" @@ -2088,6 +2108,11 @@ msgstr "Mensalmente" msgid "More" msgstr "Mais" +#: components/manage/Blocks/Search/components/Facets +# defaultMessage: More filters +msgid "More filters" +msgstr "" + #: components/manage/Controlpanels/UpgradeControlPanel # defaultMessage: More information about the upgrade procedure can be found in the documentation section of plone.org in the Upgrade Guide. msgid "More information about the upgrade procedure can be found in the documentation section of plone.org in the Upgrade Guide." @@ -3097,6 +3122,11 @@ msgstr "Mostrar tudo" msgid "Show Replies" msgstr "Mostrar respostas" +#: components/manage/Blocks/Search/components/Facets +# defaultMessage: Show filters +msgid "Show filters" +msgstr "" + #: helpers/MessageLabels/MessageLabels # defaultMessage: Show groups of users below msgid "Show groups of users below" diff --git a/locales/ro/LC_MESSAGES/volto.po b/locales/ro/LC_MESSAGES/volto.po index 970e3a748c..dace4b8f77 100644 --- a/locales/ro/LC_MESSAGES/volto.po +++ b/locales/ro/LC_MESSAGES/volto.po @@ -268,6 +268,16 @@ msgstr "" msgid "Addon upgraded succesfuly" msgstr "" +#: components/manage/Blocks/Search/schema +# defaultMessage: Advanced facet? +msgid "Advanced facet?" +msgstr "" + +#: components/manage/Blocks/Search/schema +# defaultMessage: Advanced facets are initially hidden and displayed on demand +msgid "Advanced facets are initially hidden and displayed on demand" +msgstr "" + #: config/Views # defaultMessage: Album view msgid "Album view" @@ -1573,6 +1583,11 @@ msgstr "Ascunde răspunsurile" msgid "Hide facet?" msgstr "Ascundeți fațeta?" +#: components/manage/Blocks/Search/components/Facets +# defaultMessage: Hide filters +msgid "Hide filters" +msgstr "" + #: components/manage/History/History #: components/manage/Toolbar/More # defaultMessage: History @@ -1869,6 +1884,11 @@ msgstr "Imaginea de start" msgid "Left" msgstr "Stânga" +#: components/manage/Blocks/Search/components/Facets +# defaultMessage: Less filters +msgid "Less filters" +msgstr "" + #: components/manage/Toolbar/Toolbar # defaultMessage: Link msgid "Link" @@ -2078,6 +2098,11 @@ msgstr "Lunar" msgid "More" msgstr "Mai mult" +#: components/manage/Blocks/Search/components/Facets +# defaultMessage: More filters +msgid "More filters" +msgstr "" + #: components/manage/Controlpanels/UpgradeControlPanel # defaultMessage: More information about the upgrade procedure can be found in the documentation section of plone.org in the Upgrade Guide. msgid "More information about the upgrade procedure can be found in the documentation section of plone.org in the Upgrade Guide." @@ -3087,6 +3112,11 @@ msgstr "Afișează tot" msgid "Show Replies" msgstr "Afișați răspunsurile" +#: components/manage/Blocks/Search/components/Facets +# defaultMessage: Show filters +msgid "Show filters" +msgstr "" + #: helpers/MessageLabels/MessageLabels # defaultMessage: Show groups of users below msgid "Show groups of users below" diff --git a/locales/volto.pot b/locales/volto.pot index 08666abef4..03a68ccf47 100644 --- a/locales/volto.pot +++ b/locales/volto.pot @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: Plone\n" -"POT-Creation-Date: 2023-05-23T08:20:31.464Z\n" +"POT-Creation-Date: 2023-06-02T14:22:59.421Z\n" "Last-Translator: Plone i18n \n" "Language-Team: Plone i18n \n" "MIME-Version: 1.0\n" @@ -270,6 +270,16 @@ msgstr "" msgid "Addon upgraded succesfuly" msgstr "" +#: components/manage/Blocks/Search/schema +# defaultMessage: Advanced facet? +msgid "Advanced facet?" +msgstr "" + +#: components/manage/Blocks/Search/schema +# defaultMessage: Advanced facets are initially hidden and displayed on demand +msgid "Advanced facets are initially hidden and displayed on demand" +msgstr "" + #: config/Views # defaultMessage: Album view msgid "Album view" @@ -1575,6 +1585,11 @@ msgstr "" msgid "Hide facet?" msgstr "" +#: components/manage/Blocks/Search/components/Facets +# defaultMessage: Hide filters +msgid "Hide filters" +msgstr "" + #: components/manage/History/History #: components/manage/Toolbar/More # defaultMessage: History @@ -1871,6 +1886,11 @@ msgstr "" msgid "Left" msgstr "" +#: components/manage/Blocks/Search/components/Facets +# defaultMessage: Less filters +msgid "Less filters" +msgstr "" + #: components/manage/Toolbar/Toolbar # defaultMessage: Link msgid "Link" @@ -2080,6 +2100,11 @@ msgstr "" msgid "More" msgstr "" +#: components/manage/Blocks/Search/components/Facets +# defaultMessage: More filters +msgid "More filters" +msgstr "" + #: components/manage/Controlpanels/UpgradeControlPanel # defaultMessage: More information about the upgrade procedure can be found in the documentation section of plone.org in the Upgrade Guide. msgid "More information about the upgrade procedure can be found in the documentation section of plone.org in the Upgrade Guide." @@ -3089,6 +3114,11 @@ msgstr "" msgid "Show Replies" msgstr "" +#: components/manage/Blocks/Search/components/Facets +# defaultMessage: Show filters +msgid "Show filters" +msgstr "" + #: helpers/MessageLabels/MessageLabels # defaultMessage: Show groups of users below msgid "Show groups of users below" diff --git a/locales/zh_CN/LC_MESSAGES/volto.po b/locales/zh_CN/LC_MESSAGES/volto.po index 7f1887725d..5f46b9ff89 100644 --- a/locales/zh_CN/LC_MESSAGES/volto.po +++ b/locales/zh_CN/LC_MESSAGES/volto.po @@ -274,6 +274,16 @@ msgstr "附件卸载成功" msgid "Addon upgraded succesfuly" msgstr "附件升级成功" +#: components/manage/Blocks/Search/schema +# defaultMessage: Advanced facet? +msgid "Advanced facet?" +msgstr "" + +#: components/manage/Blocks/Search/schema +# defaultMessage: Advanced facets are initially hidden and displayed on demand +msgid "Advanced facets are initially hidden and displayed on demand" +msgstr "" + #: config/Views # defaultMessage: Album view msgid "Album view" @@ -1579,6 +1589,11 @@ msgstr "隐藏回复" msgid "Hide facet?" msgstr "" +#: components/manage/Blocks/Search/components/Facets +# defaultMessage: Hide filters +msgid "Hide filters" +msgstr "" + #: components/manage/History/History #: components/manage/Toolbar/More # defaultMessage: History @@ -1875,6 +1890,11 @@ msgstr "首图" msgid "Left" msgstr "" +#: components/manage/Blocks/Search/components/Facets +# defaultMessage: Less filters +msgid "Less filters" +msgstr "" + #: components/manage/Toolbar/Toolbar # defaultMessage: Link msgid "Link" @@ -2084,6 +2104,11 @@ msgstr "每月" msgid "More" msgstr "更多" +#: components/manage/Blocks/Search/components/Facets +# defaultMessage: More filters +msgid "More filters" +msgstr "" + #: components/manage/Controlpanels/UpgradeControlPanel # defaultMessage: More information about the upgrade procedure can be found in the documentation section of plone.org in the Upgrade Guide. msgid "More information about the upgrade procedure can be found in the documentation section of plone.org in the Upgrade Guide." @@ -3093,6 +3118,11 @@ msgstr "显示全部" msgid "Show Replies" msgstr "显示回复" +#: components/manage/Blocks/Search/components/Facets +# defaultMessage: Show filters +msgid "Show filters" +msgstr "" + #: helpers/MessageLabels/MessageLabels # defaultMessage: Show groups of users below msgid "Show groups of users below" diff --git a/news/4783.feature b/news/4783.feature new file mode 100644 index 0000000000..531d971133 --- /dev/null +++ b/news/4783.feature @@ -0,0 +1,2 @@ +Search Block: Add support for advanced facets that are only displayed on demand. +[pbauer, razvanMiu, claudiaifrim] diff --git a/src/components/manage/Blocks/Search/components/Facets.jsx b/src/components/manage/Blocks/Search/components/Facets.jsx index 0adc1009d0..ea016334e7 100644 --- a/src/components/manage/Blocks/Search/components/Facets.jsx +++ b/src/components/manage/Blocks/Search/components/Facets.jsx @@ -1,7 +1,16 @@ -import React from 'react'; +import React, { useState, useMemo } from 'react'; +import { Button, Grid } from 'semantic-ui-react'; import { resolveExtension } from '@plone/volto/helpers/Extensions/withBlockExtensions'; import config from '@plone/volto/registry'; import { hasNonValueOperation, hasDateOperation } from '../utils'; +import { defineMessages, useIntl } from 'react-intl'; + +const messages = defineMessages({ + moreFilters: { id: 'More filters', defaultMessage: 'More filters' }, + lessFilters: { id: 'Less filters', defaultMessage: 'Less filters' }, + showFilters: { id: 'Show filters', defaultMessage: 'Show filters' }, + hideFilters: { id: 'Hide filters', defaultMessage: 'Hide filters' }, +}); const showFacet = (index) => { const { values } = index; @@ -14,6 +23,7 @@ const showFacet = (index) => { }; const Facets = (props) => { + const [hidden, setHidden] = useState(true); const { querystring, data = {}, @@ -24,11 +34,29 @@ const Facets = (props) => { } = props; const { search } = config.blocks.blocksConfig; + const advancedFilters = useMemo(() => { + let count = 0; + for (let facetSettings of data.facets || []) { + if (facetSettings.advanced) { + count++; + } + } + + if (count === data.facets?.length) { + return 2; + } + if (count) { + return 1; + } + return 0; + }, [data.facets]); + const FacetWrapper = facetWrapper; const query_to_values = Object.assign( {}, ...(data?.query?.query?.map(({ i, v }) => ({ [i]: v })) || []), ); + const intl = useIntl(); return ( <> @@ -36,6 +64,7 @@ const Facets = (props) => { ?.filter((facetSettings) => !facetSettings.hidden) .map((facetSettings) => { const field = facetSettings?.field?.value; + const isAdvanced = facetSettings?.advanced; const index = querystring.indexes[field] || {}; const { values = {} } = index; @@ -58,6 +87,7 @@ const Facets = (props) => { const isMulti = facetSettings.multiple; const selectedValue = facets[facetSettings?.field?.value]; + const visible = (isAdvanced && !hidden) || !isAdvanced; // TODO :handle changing the type of facet (multi/nonmulti) @@ -74,7 +104,11 @@ const Facets = (props) => { } = search.extensions.facetWidgets; return FacetWrapper && (isEditMode || showFacet(index)) ? ( - + { '' ); })} + {advancedFilters > 0 && ( + + + + )} ); }; diff --git a/src/components/manage/Blocks/Search/layout/LeftColumnFacets.jsx b/src/components/manage/Blocks/Search/layout/LeftColumnFacets.jsx index 626f721de2..950a688628 100644 --- a/src/components/manage/Blocks/Search/layout/LeftColumnFacets.jsx +++ b/src/components/manage/Blocks/Search/layout/LeftColumnFacets.jsx @@ -11,6 +11,7 @@ import { Grid, Segment } from 'semantic-ui-react'; import { Button } from 'semantic-ui-react'; import { flushSync } from 'react-dom'; import { defineMessages, useIntl } from 'react-intl'; +import cx from 'classnames'; const messages = defineMessages({ searchButtonText: { @@ -19,11 +20,22 @@ const messages = defineMessages({ }, }); -const FacetWrapper = ({ children }) => ( - - {children} - -); +const FacetWrapper = ({ children, facetSettings = {}, visible }) => { + const { advanced, field = {} } = facetSettings; + + return ( + + {children} + + ); +}; const LeftColumnFacets = (props) => { const { diff --git a/src/components/manage/Blocks/Search/layout/RightColumnFacets.jsx b/src/components/manage/Blocks/Search/layout/RightColumnFacets.jsx index 091449bf1e..fc378b610f 100644 --- a/src/components/manage/Blocks/Search/layout/RightColumnFacets.jsx +++ b/src/components/manage/Blocks/Search/layout/RightColumnFacets.jsx @@ -11,6 +11,7 @@ import { Grid, Segment } from 'semantic-ui-react'; import { Button } from 'semantic-ui-react'; import { flushSync } from 'react-dom'; import { defineMessages, useIntl } from 'react-intl'; +import cx from 'classnames'; const messages = defineMessages({ searchButtonText: { @@ -19,11 +20,22 @@ const messages = defineMessages({ }, }); -const FacetWrapper = ({ children }) => ( - - {children} - -); +const FacetWrapper = ({ children, facetSettings = {}, visible }) => { + const { advanced, field = {} } = facetSettings; + + return ( + + {children} + + ); +}; const RightColumnFacets = (props) => { const { diff --git a/src/components/manage/Blocks/Search/layout/TopSideFacets.jsx b/src/components/manage/Blocks/Search/layout/TopSideFacets.jsx index 21469e625e..5518382f7f 100644 --- a/src/components/manage/Blocks/Search/layout/TopSideFacets.jsx +++ b/src/components/manage/Blocks/Search/layout/TopSideFacets.jsx @@ -11,6 +11,7 @@ import { SortOn, ViewSwitcher, } from '../components'; +import cx from 'classnames'; const messages = defineMessages({ searchButtonText: { @@ -19,11 +20,24 @@ const messages = defineMessages({ }, }); -const FacetWrapper = ({ children }) => ( - - {children} - -); +const FacetWrapper = ({ children, facetSettings = {}, visible }) => { + const { advanced, field = {} } = facetSettings; + + return ( + + {children} + + ); +}; const TopSideFacets = (props) => { const { @@ -117,6 +131,7 @@ const TopSideFacets = (props) => { )} + {data.facets?.length > 0 && (
{data.facetsTitle &&

{data.facetsTitle}

} @@ -136,6 +151,7 @@ const TopSideFacets = (props) => {
)} +