Commit f0303b8f authored by Matija Obreza's avatar Matija Obreza

Merge branch '614-excluding-option-isn-t-displayed-after-applying-filters' into 'master'

Excluding option isn`t displayed after applying filters

Closes #614

See merge request genesys-pgr/genesys-ui!600
parents d33e85be 9dddbd60
......@@ -141,6 +141,7 @@ const AccessionFilters = ({handleSubmit, initialValues, initialize, filterCode,
byKey
indented
terms={ terms && terms.get('sampStat') }
initialFormValues={ initialValues }
/>
</CollapsibleComponentSearch>
<CollapsibleComponentSearch sectionIndex={ sectionIndex++ } title={ t('accessions.common.storageType') }>
......@@ -150,6 +151,7 @@ const AccessionFilters = ({handleSubmit, initialValues, initialize, filterCode,
byKey
indented
terms={ terms && terms.get('storage') }
initialFormValues={ initialValues }
/>
</CollapsibleComponentSearch>
<CollapsibleComponentSearch sectionIndex={ sectionIndex++ } title={ t('accessions.public.f.status') }>
......
......@@ -61,7 +61,7 @@ const DatasetFilters = ({ handleSubmit, initialize, t, terms, crops, initialValu
labelField="name"
options={ crops }
terms={ terms && terms.get('crops') }
initialFormValues={ initialValues }
initialFormValues={ initialValues }
/>
</CollapsibleComponentSearch>
<CollapsibleComponentSearch sectionIndex={ sectionIndex++ } title={ t('datasets.public.f.accession') }>
......
......@@ -50,7 +50,7 @@ const DescriptorListFilters = ({ handleSubmit, initialize, t, terms, crops, init
labelField="name"
options={ crops }
terms={ terms && terms.get('crop') }
initialFormValues={ initialValues }
initialFormValues={ initialValues }
/>
</CollapsibleComponentSearch>
<CollapsibleComponentSearch sectionIndex={ sectionIndex++ } title={ t('descriptorlists.public.common.publisher') }>
......
......@@ -274,7 +274,9 @@ class OptionsFilter extends React.Component<IOptionsFilterProps, any> {
public render() {
const { name, label, options, indented, terms, valueField, labelField, byKey, t, initialFormValues = {}, validate = [], renderCustomLabel } = this.props;
const notIgnoredValues = [...(_.get(initialFormValues, name) || []), ...(_.get(initialFormValues, `NOT.${name}`) || [])];
const notIgnoredValues =
[...(_.get(initialFormValues, name) || []), ...(_.get(initialFormValues, `NOT.${name}`) || [])]
.map((val) => typeof val === 'number' ? `${val}` : val);
return (
<div>
......
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