Commit 51738ca4 authored by Maxym Borodenko's avatar Maxym Borodenko

Map filtering errors

parent b91bb82e
...@@ -129,7 +129,7 @@ class AutocompleteFilterInternal extends React.Component<IAutocompleteFilterInte ...@@ -129,7 +129,7 @@ class AutocompleteFilterInternal extends React.Component<IAutocompleteFilterInte
const values = _.get(props, `${props.names[1]}.input.value`); const values = _.get(props, `${props.names[1]}.input.value`);
this.state = { this.state = {
excludedValues: null, excludedValues: [],
values, values,
notValues, notValues,
text: '', text: '',
...@@ -143,7 +143,7 @@ class AutocompleteFilterInternal extends React.Component<IAutocompleteFilterInte ...@@ -143,7 +143,7 @@ class AutocompleteFilterInternal extends React.Component<IAutocompleteFilterInte
const notValue = _.get(this.props, `${this.props.names[1]}.input.value`); const notValue = _.get(this.props, `${this.props.names[1]}.input.value`);
this.setState({ this.setState({
excludedValues: null, excludedValues: [],
values: [ ...value ], values: [ ...value ],
notValues: [ ...notValue ], notValues: [ ...notValue ],
text: '', text: '',
...@@ -274,7 +274,7 @@ class AutocompleteFilterInternal extends React.Component<IAutocompleteFilterInte ...@@ -274,7 +274,7 @@ class AutocompleteFilterInternal extends React.Component<IAutocompleteFilterInte
{ terms && { terms &&
<Properties> <Properties>
<h5 className="pl-10 pt-1rem mb-10">{ t('common:f.suggestedFilters') }</h5> <h5 className="pl-10 pt-1rem mb-10">{ t('common:f.suggestedFilters') }</h5>
{ terms && Array.from(terms).slice(0, 10).filter(([key, value]) => !excludedValues || !excludedValues.includes(key)).map(([key, value]) => ( { terms && Array.from(terms).slice(0, 10).filter(([key, value]) => excludedValues.length === 0 || !excludedValues.includes(key)).map(([key, value]) => (
<PropertiesItem key={ key } title={ key } onClick={ () => input.onChange(this.maybeAdd(key)) } classes={ {...classes, propertiesRow: 'cursor-pointer'} }> <PropertiesItem key={ key } title={ key } onClick={ () => input.onChange(this.maybeAdd(key)) } classes={ {...classes, propertiesRow: 'cursor-pointer'} }>
<span className="float-right"> <span className="float-right">
<Number value={ value }/> <Number value={ value }/>
......
...@@ -138,7 +138,7 @@ class InternalStringArrField extends React.Component<IStringArrFilterInternal & ...@@ -138,7 +138,7 @@ class InternalStringArrField extends React.Component<IStringArrFilterInternal &
const values = _.get(props, `${props.names[1]}.input.value`); const values = _.get(props, `${props.names[1]}.input.value`);
this.state = { this.state = {
excludedValues: null, excludedValues: [],
values, values,
notValues, notValues,
text: '', text: '',
...@@ -151,7 +151,7 @@ class InternalStringArrField extends React.Component<IStringArrFilterInternal & ...@@ -151,7 +151,7 @@ class InternalStringArrField extends React.Component<IStringArrFilterInternal &
const notValue = _.get(this.props, `${this.props.names[1]}.input.value`); const notValue = _.get(this.props, `${this.props.names[1]}.input.value`);
this.setState({ this.setState({
excludedValues: null, excludedValues: [],
values: [ ...value ], values: [ ...value ],
notValues: [ ...notValue ], notValues: [ ...notValue ],
text: '', text: '',
...@@ -402,7 +402,7 @@ class InternalStringArrField extends React.Component<IStringArrFilterInternal & ...@@ -402,7 +402,7 @@ class InternalStringArrField extends React.Component<IStringArrFilterInternal &
{ !withOptions && terms && { !withOptions && terms &&
<Properties> <Properties>
<h5 className="pl-10 pt-1rem mb-10">{ t('common:f.suggestedFilters') }</h5> <h5 className="pl-10 pt-1rem mb-10">{ t('common:f.suggestedFilters') }</h5>
{ terms && Array.from(terms).slice(0, 10).filter(([key, value]) => !excludedValues || !excludedValues.includes(key)).map(([key, value]) => ( { terms && Array.from(terms).slice(0, 10).filter(([key, value]) => excludedValues.length === 0 || !excludedValues.includes(key)).map(([key, value]) => (
<PropertiesItem key={ key } title={ key } onClick={ () => input.onChange(this.maybeAdd(key)) } classes={ {...classes, propertiesRow: 'cursor-pointer'} }> <PropertiesItem key={ key } title={ key } onClick={ () => input.onChange(this.maybeAdd(key)) } classes={ {...classes, propertiesRow: 'cursor-pointer'} }>
<span className="float-right"> <span className="float-right">
<Number value={ value }/> <Number value={ value }/>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment