From 797de873f80c74a6c67596668a6b4243b5487014 Mon Sep 17 00:00:00 2001 From: "sabrina.bongiovanni" Date: Tue, 17 Dec 2024 15:53:02 +0100 Subject: [PATCH] fix: removed query b_size limit for event_location vocabulary --- RELEASE.md | 14 ++++++++++++++ .../Blocks/Common/SearchFilters/SelectFilter.jsx | 12 +++++++++--- .../Blocks/EventSearch/DefaultFilters.js | 1 + .../volto/actions/vocabularies/vocabularies.js | 8 ++++++-- 4 files changed, 30 insertions(+), 5 deletions(-) diff --git a/RELEASE.md b/RELEASE.md index 8ad7c3aa6..5802f6327 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -41,6 +41,20 @@ - ... --> +## Versione X.X.X (dd/mm/yyyy) + +### Migliorie + +- ... + +### Novità + +- ... + +### Fix + +- Il menu a tendina da cui è possibile filtrare i luoghi nel blocco Ricerca Eventi mostra tutti i luoghi collegati agli eventi presenti nel percorso selezionato dalla Sidebar, senza limitarne il numero. + ## Versione 11.25.3 (12/12/2024) ### Migliorie diff --git a/src/components/ItaliaTheme/Blocks/Common/SearchFilters/SelectFilter.jsx b/src/components/ItaliaTheme/Blocks/Common/SearchFilters/SelectFilter.jsx index 0b988aaa3..cce6137d9 100644 --- a/src/components/ItaliaTheme/Blocks/Common/SearchFilters/SelectFilter.jsx +++ b/src/components/ItaliaTheme/Blocks/Common/SearchFilters/SelectFilter.jsx @@ -11,6 +11,7 @@ const SelectFilter = ({ onChange, placeholder, isSearchable = false, + optionsQuerySize = 25, }) => { const dispatch = useDispatch(); @@ -52,15 +53,20 @@ const SelectFilter = ({ ); } } else if (options.vocabulary) { - dispatch(getVocabulary({ vocabNameOrURL: options.vocabulary })); + dispatch( + getVocabulary({ + vocabNameOrURL: options.vocabulary, + size: optionsQuerySize, + }), + ); } }, []); const select_options = options?.choices ? options.choices : options?.vocabulary - ? vocabularies?.[options.vocabulary]?.items - : selectOptions; + ? vocabularies?.[options.vocabulary]?.items + : selectOptions; return (
diff --git a/src/components/ItaliaTheme/Blocks/EventSearch/DefaultFilters.js b/src/components/ItaliaTheme/Blocks/EventSearch/DefaultFilters.js index 6a7fd0eef..5d64e27f8 100644 --- a/src/components/ItaliaTheme/Blocks/EventSearch/DefaultFilters.js +++ b/src/components/ItaliaTheme/Blocks/EventSearch/DefaultFilters.js @@ -72,6 +72,7 @@ const DefaultFilters = () => { vocabulary: 'design.plone.vocabularies.event_location', placeholder: intl.formatMessage(messages.venues), }, + optionsQuerySize: -1, }, }, query: (value, query) => { diff --git a/src/customizations/volto/actions/vocabularies/vocabularies.js b/src/customizations/volto/actions/vocabularies/vocabularies.js index 0230dcc87..9ce64f606 100644 --- a/src/customizations/volto/actions/vocabularies/vocabularies.js +++ b/src/customizations/volto/actions/vocabularies/vocabularies.js @@ -36,7 +36,9 @@ export function getVocabulary({ const vocabulary = getVocabName(vocabNameOrURL); const contextualVocabularies = config.settings.contextualVocabularies; const vocabPath = - contextualVocabularies && contextualVocabularies.includes(vocabulary) && vocabulary !== vocabNameOrURL + contextualVocabularies && + contextualVocabularies.includes(vocabulary) && + vocabulary !== vocabNameOrURL ? flattenToAppURL(vocabNameOrURL) : `/@vocabularies/${vocabulary}`; let queryString = `b_start=${start}${size ? '&b_size=' + size : ''}`; @@ -74,7 +76,9 @@ export function getVocabularyTokenTitle({ const vocabulary = getVocabName(vocabNameOrURL); const contextualVocabularies = config.settings.contextualVocabularies; const vocabPath = - contextualVocabularies && contextualVocabularies.includes(vocabulary) && vocabulary !== vocabNameOrURL + contextualVocabularies && + contextualVocabularies.includes(vocabulary) && + vocabulary !== vocabNameOrURL ? flattenToAppURL(vocabNameOrURL) : `/@vocabularies/${vocabulary}`; const queryString = {