Skip to content

Commit

Permalink
feat: selectFilter is now searchable for venue search in EventSearch (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
sabrina-bongiovanni authored Apr 5, 2024
1 parent 051b973 commit 93ecc0b
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 1 deletion.
7 changes: 7 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@
- ...
-->

## Versione X.X.X (dd/mm/yyyy)

### Migliorie

- Aggiunta la possibilità di inserire testo nel filtro luogo nel blocco Ricerca Eventi
- Le opzioni del menu a tendina per il filtro luogo nel blocco Ricerca Eventi sono ordinate alfabeticamente

## Versione 11.9.1 (03/04/2024)

### Fix
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,14 @@ import { SelectInput } from 'design-comuni-plone-theme/components';
import { useDispatch, useSelector } from 'react-redux';
import { searchContent, getVocabulary } from '@plone/volto/actions';

const SelectFilter = ({ options, value, id, onChange, placeholder }) => {
const SelectFilter = ({
options,
value,
id,
onChange,
placeholder,
isSearchable = false,
}) => {
const dispatch = useDispatch();

const state = useSelector((state) => {
Expand Down Expand Up @@ -64,6 +71,7 @@ const SelectFilter = ({ options, value, id, onChange, placeholder }) => {
}}
options={select_options?.filter((opt) => !!opt.value?.toString()) ?? []}
isClearable={true}
isSearchable={isSearchable}
// components={{
// ClearIndicator: (props) => {
// const {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,18 @@ const DefaultFilters = () => {
component: SelectFilter,
props: {
value: null,
isSearchable: true,
options: {
dispatch: {
path: subsite ? flattenToAppURL(subsite['@id']) : '/',
portal_types: ['Venue'],
fullobjects: 0,
b_size: 10000,
subrequests_name: 'venues',
additionalParams: {
sort_on: 'sortable_title',
sort_order: 'ascending',
},
},
placeholder: intl.formatMessage(messages.venues),
},
Expand Down
16 changes: 16 additions & 0 deletions src/theme/ItaliaTheme/Blocks/common/_searchBlockFilters.scss
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,18 @@
}
}

.bg-primary {
.search-container {
.filter-wrapper {
&.select-filter {
.react-select__input {
color: color-contrast($primary);
}
}
}
}
}

.bg-secondary {
.search-container {
.filter-wrapper {
Expand Down Expand Up @@ -140,6 +152,10 @@
.react-select__single-value {
color: $secondary-text !important;
}

.react-select__input {
color: color-contrast($secondary);
}
}

&.date-filter .DateRangePickerInput {
Expand Down

0 comments on commit 93ecc0b

Please sign in to comment.