Commit 784b3060 authored by Viacheslav Pavlov's avatar Viacheslav Pavlov Committed by Matija Obreza

Explore: Filter suggestions

- Suggestions for "institute.code", "taxonomy.genus", "countryOfOrigin.code3"
- Added BooleanTermedFilter
parent 12ec1698
...@@ -66,7 +66,9 @@ ...@@ -66,7 +66,9 @@
"createdDate": "Created on", "createdDate": "Created on",
"lastModifiedDate": "Last modified", "lastModifiedDate": "Last modified",
"textSearch": "Text search", "textSearch": "Text search",
"keyword": "Keyword search" "keyword": "Keyword search",
"noFilters": "No available filters",
"suggestedFilters": "Suggested filters"
}, },
"fileUploader": { "fileUploader": {
"chooseFiles": "Choose files to upload", "chooseFiles": "Choose files to upload",
......
...@@ -36,7 +36,8 @@ ...@@ -36,7 +36,8 @@
"gt": "{{what}} >", "gt": "{{what}} >",
"accessions": { "accessions": {
"crop": "Crop", "crop": "Crop",
"acceNumb": "Accession number", "crops": "Crops",
"accessionNumber": "Accession number",
"seqNo": "Sequential number", "seqNo": "Sequential number",
"sampStat": "Biological status", "sampStat": "Biological status",
"storage": "Storage", "storage": "Storage",
...@@ -52,14 +53,14 @@ ...@@ -52,14 +53,14 @@
"bio15": "Precipitation seasonality" "bio15": "Precipitation seasonality"
} }
}, },
"holder": { "institute": {
"code": "Holder", "code": "Holder",
"networks": "Network", "networks": "Network",
"owner": { "owner": {
"uuid": "Data provider" "uuid": "Data provider"
}, },
"country": { "country": {
"iso3": "Holder country", "code3": "Holder country",
"region": "Holder region" "region": "Holder region"
} }
}, },
...@@ -68,8 +69,11 @@ ...@@ -68,8 +69,11 @@
"species": "Species", "species": "Species",
"subtaxa": "Subtaxa" "subtaxa": "Subtaxa"
}, },
"origin": { "owner": {
"iso3": "Provenance" "uuid": "Data provider"
},
"countryOfOrigin": {
"code3": "Provenance"
}, },
"taxonomy": { "taxonomy": {
"genus": "Genus", "genus": "Genus",
...@@ -107,17 +111,20 @@ ...@@ -107,17 +111,20 @@
}, },
"subsets": { "subsets": {
"title": "Title", "title": "Title",
"crop": "Crop", "crops": "Crop",
"institutes": "Institute code", "institutes": "Institute code",
"description": "Description", "description": "Description",
"state": "Status", "state": "Status",
"dateCreated": "Date created" "dateCreated": "Date created",
"owner": {
"uuid": "Data provider"
}
}, },
"wiews": { "wiews": {
"code": "Institute code", "code": "Institute code",
"accessions": "Accessions in Genesys", "accessions": "Accessions in Genesys",
"country": { "country": {
"iso3": "Country code" "code3": "Country code"
}, },
"owner": { "owner": {
"uuid": "Data provider" "uuid": "Data provider"
...@@ -139,14 +146,14 @@ ...@@ -139,14 +146,14 @@
}, },
"datasets": { "datasets": {
"_text": "Keywords", "_text": "Keywords",
"accessionRef": { "accessionRefs": {
"acceNumb": "Accession number", "acceNumb": "Accession number",
"doi": "Accession DOI", "doi": "Accession DOI",
"genus": "Accession genus", "genus": "Accession genus",
"instCode": "Accession holder" "instCode": "Accession holder"
}, },
"description": "Description", "description": "Description",
"descriptor": { "descriptors": {
"_text": "Descriptor keywords", "_text": "Descriptor keywords",
"title": "Descriptor title" "title": "Descriptor title"
}, },
...@@ -155,7 +162,7 @@ ...@@ -155,7 +162,7 @@
"shortName": "Provider short name", "shortName": "Provider short name",
"wiewsCodes": "Owner WIEWS institute code" "wiewsCodes": "Owner WIEWS institute code"
}, },
"location": { "locations": {
"country": "Evaluated in", "country": "Evaluated in",
"latitude": "Latitude", "latitude": "Latitude",
"longitude": "Longitude" "longitude": "Longitude"
...@@ -163,7 +170,7 @@ ...@@ -163,7 +170,7 @@
"published": "Published", "published": "Published",
"title": "Title", "title": "Title",
"rights": "License", "rights": "License",
"crop": "Crop", "crops": "Crop",
"state": "Status" "state": "Status"
}, },
"partner": { "partner": {
...@@ -196,7 +203,7 @@ ...@@ -196,7 +203,7 @@
"category": "Category", "category": "Category",
"columnName": "Column name", "columnName": "Column name",
"key": "Key crop descriptor", "key": "Key crop descriptor",
"list": { "descriptorLists": {
"uuid": "Descriptor list" "uuid": "Descriptor list"
}, },
"owner": { "owner": {
......
...@@ -16,6 +16,7 @@ import { ...@@ -16,6 +16,7 @@ import {
RECEIVE_ACCESSION_AUDIT_LOG, RECEIVE_ACCESSION_AUDIT_LOG,
RECEIVE_TILE_LAYER, RECEIVE_TILE_LAYER,
APPEND_ACCESSIONS, APPEND_ACCESSIONS,
APPEND_ACCESSIONS_WITH_SUGGESTIONS,
} from 'accessions/constants'; } from 'accessions/constants';
import AccessionService from 'service/genesys/AccessionService'; import AccessionService from 'service/genesys/AccessionService';
import ClimateService from 'service/genesys/ClimateService'; import ClimateService from 'service/genesys/ClimateService';
...@@ -32,6 +33,7 @@ const receiveAccessionMapInfo = (apiCall: ApiCall<any>) => ({ ...@@ -32,6 +33,7 @@ const receiveAccessionMapInfo = (apiCall: ApiCall<any>) => ({
// Wrapped API calls // Wrapped API calls
const apiListAccessions = createApiCaller(AccessionService.list, APPEND_ACCESSIONS); const apiListAccessions = createApiCaller(AccessionService.list, APPEND_ACCESSIONS);
const apiListAccessionSugestions = createApiCaller(AccessionService.listSuggestions, APPEND_ACCESSIONS_WITH_SUGGESTIONS);
const apiAccessionsOverview = createApiCaller(AccessionService.listOverview, RECEIVE_ACCESSION_OVERVIEW); const apiAccessionsOverview = createApiCaller(AccessionService.listOverview, RECEIVE_ACCESSION_OVERVIEW);
const apiAccessionsMapInfo = createApiCaller(AccessionService.mapInfo, RECEIVE_ACCESSION_MAPINFO); const apiAccessionsMapInfo = createApiCaller(AccessionService.mapInfo, RECEIVE_ACCESSION_MAPINFO);
...@@ -63,7 +65,7 @@ export const applyFilters = (filters: string | AccessionFilter, page: IPageReque ...@@ -63,7 +65,7 @@ export const applyFilters = (filters: string | AccessionFilter, page: IPageReque
console.log('Applying new filter', filters); console.log('Applying new filter', filters);
dispatch(showSnackbar('Applying filters...')); dispatch(showSnackbar('Applying filters...'));
return dispatch(apiListAccessions(filters, page)) return dispatch(apiListAccessionSugestions(filters, page))
.then((paged) => { .then((paged) => {
dispatch(updateRoute(paged)); dispatch(updateRoute(paged));
dispatch(showSnackbar(`Filters applied.`)); dispatch(showSnackbar(`Filters applied.`));
......
export const APPEND_ACCESSIONS = 'accessions/APPEND_ACCESSIONS'; export const APPEND_ACCESSIONS = 'accessions/APPEND_ACCESSIONS';
export const APPEND_ACCESSIONS_WITH_SUGGESTIONS = 'accessions/APPEND_ACCESSIONS_WITH_SUGGESTIONS';
export const RECEIVE_ACCESSION_OVERVIEW = 'accessions/RECEIVE_ACCESSION_OVERVIEW'; export const RECEIVE_ACCESSION_OVERVIEW = 'accessions/RECEIVE_ACCESSION_OVERVIEW';
export const RECEIVE_TILE_LAYER = 'accessions/RECEIVE_TILE_LAYER'; export const RECEIVE_TILE_LAYER = 'accessions/RECEIVE_TILE_LAYER';
export const RECEIVE_ACCESSION_AUDIT_LOG = 'accessions/RECEIVE_ACCESSION_AUDIT_LOG'; export const RECEIVE_ACCESSION_AUDIT_LOG = 'accessions/RECEIVE_ACCESSION_AUDIT_LOG';
......
...@@ -7,7 +7,7 @@ import { ...@@ -7,7 +7,7 @@ import {
APPEND_ACCESSIONS, APPEND_ACCESSIONS,
RECEIVE_ACCESSION_MAPINFO, RECEIVE_ACCESSION_MAPINFO,
RECEIVE_ACCESSION_AUDIT_LOG, RECEIVE_ACCESSION_AUDIT_LOG,
RECEIVE_TILE_LAYER, RECEIVE_TILE_LAYER, APPEND_ACCESSIONS_WITH_SUGGESTIONS,
} from 'accessions/constants'; } from 'accessions/constants';
import FilteredPage from 'model/FilteredPage'; import FilteredPage from 'model/FilteredPage';
...@@ -22,6 +22,7 @@ const INITIAL_STATE: { ...@@ -22,6 +22,7 @@ const INITIAL_STATE: {
accession: ApiCall<Accession>; accession: ApiCall<Accession>;
auditLog: ApiCall<AccessionAuditLog>, auditLog: ApiCall<AccessionAuditLog>,
paged: ApiCall<FilteredPage<Accession>>; paged: ApiCall<FilteredPage<Accession>>;
suggestions: any;
overview: ApiCall<AccessionOverview>; overview: ApiCall<AccessionOverview>;
mapInfo: ApiCall<AccessionMapInfo>; mapInfo: ApiCall<AccessionMapInfo>;
mapLayers: MapLayer[] mapLayers: MapLayer[]
...@@ -29,6 +30,7 @@ const INITIAL_STATE: { ...@@ -29,6 +30,7 @@ const INITIAL_STATE: {
accession: null, accession: null,
auditLog: null, auditLog: null,
paged: null, paged: null,
suggestions: null,
overview: null, overview: null,
mapInfo: null, mapInfo: null,
mapLayers: AVAILABLE_LAYERS, mapLayers: AVAILABLE_LAYERS,
...@@ -96,6 +98,22 @@ function publicAccessions(state = INITIAL_STATE, action: IReducerAction) { ...@@ -96,6 +98,22 @@ function publicAccessions(state = INITIAL_STATE, action: IReducerAction) {
// overview: { $set: null }, // overview: { $set: null },
}); });
} }
case APPEND_ACCESSIONS_WITH_SUGGESTIONS: {
const {apiCall: {loading, error, timestamp, data}} = action.payload;
return update(state, {
paged: {
$set: {
loading,
error,
timestamp,
data: FilteredPage.merge(state.paged && state.paged.data, data),
},
},
suggestions: {$set: data ? data.suggestions : state.suggestions},
// mapInfo: { $set: null },
// overview: { $set: null },
});
}
case RECEIVE_ACCESSION_MAPINFO: { case RECEIVE_ACCESSION_MAPINFO: {
const { apiCall } = action.payload; const { apiCall } = action.payload;
......
...@@ -42,15 +42,27 @@ class BrowsePage extends BrowsePageTemplate<Accession> { ...@@ -42,15 +42,27 @@ class BrowsePage extends BrowsePageTemplate<Accession> {
} }
public render() { public render() {
const { paged, loadMoreData, filterCode, currentTab, loading, t} = this.props; const { paged, loadMoreData, filterCode, currentTab, loading, suggestions, crops, t} = this.props;
const slug: string = this.state.authenticated ? 'download-authenticated' : 'download-anonymous'; const slug: string = this.state.authenticated ? 'download-authenticated' : 'download-anonymous';
const renderAccession = (s: Accession, index: number) => { const renderAccession = (s: Accession, index: number) => {
return <AccessionCard key={ s.uuid } index={ index } accession={ s } />; return <AccessionCard key={ s.uuid } index={ index } accession={ s } />;
}; };
const suggestionTerms = new Map();
if (suggestions) {
Object.keys(suggestions).forEach((key) => {
const overviewEl = suggestions[key];
const terms = new Map();
overviewEl.terms.forEach((term) => terms.set(term.term, term.count));
suggestionTerms.set(key, terms);
});
}
return ( return (
<PageLayout sidebar={ <PageLayout sidebar={
<AccessionFilters initialValues={ paged && paged.filter || {} } onSubmit={ this.myApplyFilters } /> <AccessionFilters initialValues={ paged && paged.filter || {} } onSubmit={ this.myApplyFilters } terms={ suggestionTerms } crops={ crops }/>
}> }>
<PageTitle title={ t('accessions.public.p.browse.title') }/> <PageTitle title={ t('accessions.public.p.browse.title') }/>
<ContentHeader title={ t('accessions.public.p.browse.title') } subTitle={ t('accessions.public.p.browse.subTitle') } /> <ContentHeader title={ t('accessions.public.p.browse.title') } subTitle={ t('accessions.public.p.browse.subTitle') } />
...@@ -100,6 +112,8 @@ class BrowsePage extends BrowsePageTemplate<Accession> { ...@@ -100,6 +112,8 @@ class BrowsePage extends BrowsePageTemplate<Accession> {
} }
const mapStateToProps = (state, ownProps) => ({ const mapStateToProps = (state, ownProps) => ({
suggestions: state.accessions.public.suggestions,
crops: state.crop.public.list ? state.crop.public.list.data : undefined,
paged: state.accessions.public.paged ? state.accessions.public.paged.data : undefined, paged: state.accessions.public.paged ? state.accessions.public.paged.data : undefined,
loading: state.accessions.public.paged ? state.accessions.public.paged.loading : false, loading: state.accessions.public.paged ? state.accessions.public.paged.loading : false,
filterCode: ownProps.match.params.filterCode, filterCode: ownProps.match.params.filterCode,
......
import * as React from 'react'; import * as React from 'react';
import { connect } from 'react-redux';
import { reduxForm } from 'redux-form'; import { reduxForm } from 'redux-form';
import {translate} from 'react-i18next'; import {translate} from 'react-i18next';
...@@ -6,25 +7,27 @@ import { ACCESSION_FILTERFORM } from 'accessions/constants'; ...@@ -6,25 +7,27 @@ import { ACCESSION_FILTERFORM } from 'accessions/constants';
import FiltersBlock from 'ui/common/filter/FiltersBlock'; import FiltersBlock from 'ui/common/filter/FiltersBlock';
import CollapsibleComponentSearch from 'ui/common/filter/CollapsibleComponentSearch'; import CollapsibleComponentSearch from 'ui/common/filter/CollapsibleComponentSearch';
import BooleanFilter from 'ui/common/filter/BooleanFilter';
import NumberFilter from 'ui/common/filter/NumberFilter'; import NumberFilter from 'ui/common/filter/NumberFilter';
import StringFilter from 'ui/common/filter/StringFilter'; import StringFilter from 'ui/common/filter/StringFilter';
import StringArrFilter from 'ui/common/filter/StringArrFilter'; import StringArrFilter from 'ui/common/filter/StringArrFilter';
import Accession from 'model/accession/Accession'; import Accession from 'model/accession/Accession';
import DateFilter from 'ui/common/filter/DateFilter'; import DateFilter from 'ui/common/filter/DateFilter';
import CropFilter from 'crop/ui/c/CropFilter'; import BooleanFilter from 'ui/common/filter/BooleanFilter';
const AccessionFilters = ({handleSubmit, initialValues, initialize, t, ...other}) => { const AccessionFilters = ({handleSubmit, initialValues, initialize, terms, crops, t, ...other}) => {
// console.log('AccessionFilters', initialValues); // console.log('AccessionFilters', initialValues);
return ( return (
<FiltersBlock title={ t('accessions.public.f.filtersTitle') } handleSubmit={ handleSubmit } initialize={ initialize } { ...other }> <FiltersBlock title={ t('accessions.public.f.filtersTitle') } handleSubmit={ handleSubmit } initialize={ initialize } { ...other }>
<CollapsibleComponentSearch title={ t('accessions.public.f.historic') }> <CollapsibleComponentSearch title={ t('accessions.public.f.historic') }>
<BooleanFilter name="historic"/> <BooleanFilter
name="historic"
terms={ terms && terms.get('historic') }
/>
</CollapsibleComponentSearch> </CollapsibleComponentSearch>
<CollapsibleComponentSearch title={ t('common:f.textSearch') }> <CollapsibleComponentSearch title={ t('common:f.textSearch') }>
<StringArrFilter name="holder.code" label={ t('accessions.common.instituteCode') } placeholder="NGA039"/> <StringArrFilter name="institute.code" terms={ terms && terms.get('institute.code') } label={ t('accessions.common.instituteCode') } placeholder="NGA039"/>
<StringArrFilter name="holder.country.iso3" label={ t('accessions.model.institute.country.iso3') } placeholder="NGA"/> <StringArrFilter name="institute.country.code3" label={ t('accessions.model.institute.country.iso3') } placeholder="NGA"/>
<StringFilter name="acceNumb" searchType="contains" label={ t('accessions.common.acceNumb') } placeholder="IRGC"/> <StringFilter name="accessionNumber" searchType="contains" label={ t('accessions.common.acceNumb') } placeholder="IRGC"/>
<NumberFilter name="seqNo" label={ t('accessions.public.f.seqNumber') } /> <NumberFilter name="seqNo" label={ t('accessions.public.f.seqNumber') } />
</CollapsibleComponentSearch> </CollapsibleComponentSearch>
<CollapsibleComponentSearch title={ t('common:f.dateSearch') }> <CollapsibleComponentSearch title={ t('common:f.dateSearch') }>
...@@ -32,15 +35,21 @@ const AccessionFilters = ({handleSubmit, initialValues, initialize, t, ...other} ...@@ -32,15 +35,21 @@ const AccessionFilters = ({handleSubmit, initialValues, initialize, t, ...other}
<DateFilter name="lastModifiedDate" label={ t('common:f.lastModifiedDate') }/> <DateFilter name="lastModifiedDate" label={ t('common:f.lastModifiedDate') }/>
</CollapsibleComponentSearch> </CollapsibleComponentSearch>
<CollapsibleComponentSearch title={ t('accessions.public.f.crop') }> <CollapsibleComponentSearch title={ t('accessions.public.f.crop') }>
<CropFilter/> <StringArrFilter
name="crop"
valueField="shortName"
labelField="name"
options={ crops }
terms={ terms && terms.get('crop.shortName') }
/>
</CollapsibleComponentSearch> </CollapsibleComponentSearch>
<CollapsibleComponentSearch title={ t('accessions.common.taxonomy') }> <CollapsibleComponentSearch title={ t('accessions.common.taxonomy') }>
<StringArrFilter name="taxa.genus" label={ t('accessions.common.genus') } placeholder="Hordeum"/> <StringArrFilter name="taxonomy.genus" terms={ terms && terms.get('taxonomy.genus') } label={ t('accessions.common.genus') } placeholder="Hordeum"/>
<StringArrFilter name="taxa.species" label={ t('accessions.common.species') } placeholder="vulgare"/> <StringArrFilter name="taxonomy.species" label={ t('accessions.common.species') } placeholder="vulgare"/>
<StringFilter name="taxa.subtaxa" searchType="contains" label={ t('accessions.public.f.subtaxon') } placeholder=""/> <StringFilter name="taxonomy.subtaxa" searchType="contains" label={ t('accessions.public.f.subtaxon') } placeholder=""/>
</CollapsibleComponentSearch> </CollapsibleComponentSearch>
<CollapsibleComponentSearch title={ t('accessions.public.f.originOfMaterial') }> <CollapsibleComponentSearch title={ t('accessions.public.f.originOfMaterial') }>
<StringArrFilter name="origin.iso3" label={ t('accessions.common.countryOfOrigin') } placeholder="SVN"/> <StringArrFilter name="countryOfOrigin.code3" terms={ terms && terms.get('countryOfOrigin.code3') } label={ t('accessions.common.countryOfOrigin') } placeholder="SVN"/>
<NumberFilter name="geo.latitude" label={ t('geo.common.latitude') } /> <NumberFilter name="geo.latitude" label={ t('geo.common.latitude') } />
<NumberFilter name="geo.longitude" label={ t('geo.common.longitude') } /> <NumberFilter name="geo.longitude" label={ t('geo.common.longitude') } />
<NumberFilter name="geo.elevation" label={ t('accessions.public.f.elevation') } /> <NumberFilter name="geo.elevation" label={ t('accessions.public.f.elevation') } />
...@@ -67,24 +76,55 @@ const AccessionFilters = ({handleSubmit, initialValues, initialize, t, ...other} ...@@ -67,24 +76,55 @@ const AccessionFilters = ({handleSubmit, initialValues, initialize, t, ...other}
<NumberFilter name="geo.climate.bio19" label={ t('accessions.climate.bio19') } /> <NumberFilter name="geo.climate.bio19" label={ t('accessions.climate.bio19') } />
</CollapsibleComponentSearch> </CollapsibleComponentSearch>
<CollapsibleComponentSearch title={ t('accessions.common.sampStat') }> <CollapsibleComponentSearch title={ t('accessions.common.sampStat') }>
<StringArrFilter name="sampStat" options={ Accession.SAMPSTAT } /> <StringArrFilter
name="sampStat"
options={ Accession.SAMPSTAT }
byKey
terms={ terms && terms.get('sampStat') }
/>
</CollapsibleComponentSearch> </CollapsibleComponentSearch>
<CollapsibleComponentSearch title={ t('accessions.common.storageType') }> <CollapsibleComponentSearch title={ t('accessions.common.storageType') }>
<StringArrFilter name="storage" options={ Accession.STORAGE } /> <StringArrFilter
name="storage"
options={ Accession.STORAGE }
byKey
terms={ terms && terms.get('storage') }
/>
</CollapsibleComponentSearch> </CollapsibleComponentSearch>
<CollapsibleComponentSearch title={ t('accessions.public.f.status') }> <CollapsibleComponentSearch title={ t('accessions.public.f.status') }>
<BooleanFilter name="historic" label={ t('accessions.public.f.historic') } /> <BooleanFilter
<BooleanFilter name="available" label={ t('accessions.public.f.available') } /> name="available"
<BooleanFilter name="mlsStatus" label={ t('accessions.public.f.mlsStatus') } /> label={ t('accessions.public.f.available') }
<BooleanFilter name="sgsv" label={ t('accessions.public.f.sgsv') } /> terms={ terms && terms.get('available') }
<BooleanFilter name="images" label={ t('accessions.public.f.images') } /> />
<BooleanFilter
name="mlsStatus"
label={ t('accessions.public.f.mlsStatus') }
terms={ terms && terms.get('mlsStatus') }
/>
<BooleanFilter
name="sgsv"
label={ t('accessions.public.f.sgsv') }
terms={ terms && terms.get('sgsv') }
/>
<BooleanFilter
name="images"
label={ t('accessions.public.f.images') }
terms={ terms && terms.get('images') }
initialValues
/>
</CollapsibleComponentSearch> </CollapsibleComponentSearch>
</FiltersBlock> </FiltersBlock>
); );
}; };
const mapStateToProps = (state, ownProps) => ({
crops: state.crop.public.list ? state.crop.public.list.data : undefined,
});
export default translate()(reduxForm({ export default translate()(reduxForm({
enableReinitialize: true, enableReinitialize: true,
destroyOnUnmount: false, destroyOnUnmount: false,
form: ACCESSION_FILTERFORM, form: ACCESSION_FILTERFORM,
})(AccessionFilters)); })(connect(mapStateToProps)(AccessionFilters)));
...@@ -10,31 +10,11 @@ interface IProps extends React.ClassAttributes<any> { ...@@ -10,31 +10,11 @@ interface IProps extends React.ClassAttributes<any> {
} }
class CropFilter extends React.Component<IProps, any> { class CropFilter extends React.Component<IProps, any> {
private options: object = {};
public componentWillMount() {
const { crops } = this.props;
if (crops && crops.length > 0) {
this.options = {};
crops.sort((a, b) => a.name.localeCompare(b.name)).forEach((crop) => {
this.options[crop.shortName] = crop.name;
});
}
}
public componentWillReceiveProps(nextProps) {
const { crops } = nextProps;
if (crops && crops.length > 0) {
this.options = {};
crops.sort((a, b) => a.name.localeCompare(b.name)).forEach((crop) => {
this.options[crop.shortName] = crop.name;
});
}
}
public render() { public render() {
const {crops} = this.props;
return ( return (
<StringArrFilter name="crop" options={ this.options } /> <StringArrFilter name="crop" options={ crops && crops.sort((a, b) => a.name.localeCompare(b.name)) } valueField="shortName" labelField="name" { ...this.props }/>
); );
} }
} }
......
...@@ -19,24 +19,24 @@ import LicenceFilter from 'ui/common/filter/LicenceFilter'; ...@@ -19,24 +19,24 @@ import LicenceFilter from 'ui/common/filter/LicenceFilter';
const DatasetFilters = ({ handleSubmit, initialize, t, ...other }) => ( const DatasetFilters = ({ handleSubmit, initialize, t, ...other }) => (
<FiltersBlock title={ t('datasets.common.modelName_plural') } handleSubmit={ handleSubmit } initialize={ initialize }{ ...other }> <FiltersBlock title={ t('datasets.common.modelName_plural') } handleSubmit={ handleSubmit } initialize={ initialize }{ ...other }>
<TextFilter name="_text" label={ t('datasets.public.f.keywordSearch') } placeholder={ t('datasets.public.f.rice') } className="pb-10 pr-20 pl-20 pt-10"/> <TextFilter name="_text" label={ t('datasets.public.f.keywordSearch') } placeholder={ t('datasets.public.f.rice') } className="pb-10 pr-20 pl-20 pt-10"/>
<TextFilter name="descriptor._text" label={ t('datasets.public.f.traitKeywords') } placeholder={ t('datasets.public.f.rice') } className="pt-10 pr-20 pl-20 pb-20"/> <TextFilter name="descriptors._text" label={ t('datasets.public.f.traitKeywords') } placeholder={ t('datasets.public.f.rice') } className="pt-10 pr-20 pl-20 pb-20"/>
<CollapsibleComponentSearch title={ t('datasets.public.f.partner') }> <CollapsibleComponentSearch title={ t('datasets.public.f.partner') }>
<StringArrFilter name="owner.wiewsCodes" label={ t('datasets.public.f.faoWiews') } placeholder="COL003"/> <StringArrFilter name="owner.wiewsCodes" label={ t('datasets.public.f.faoWiews') } placeholder="COL003"/>
<PartnerFilter name="owner" label="datasets.public.f.partner"/> <PartnerFilter name="owner" label="datasets.public.f.partner"/>
</CollapsibleComponentSearch> </CollapsibleComponentSearch>
<CollapsibleComponentSearch title={ t('datasets.public.f.evaluationSite') }> <CollapsibleComponentSearch title={ t('datasets.public.f.evaluationSite') }>
<StringArrFilter name="location.country" label={ t('datasets.public.f.countryEv') } placeholder={ t('datasets.public.f.countryPlaceholder') }/> <StringArrFilter name="locations.userCountry" label={ t('datasets.public.f.countryEv') } placeholder={ t('datasets.public.f.countryPlaceholder') }/>
<NumberFilter name="location.latitude" label={ t('datasets.public.f.latitude') }/> <NumberFilter name="locations.decimalLatitude" label={ t('datasets.public.f.latitude') }/>
<NumberFilter name="location.longitude" label={ t('datasets.public.f.longitude') }/> <NumberFilter name="locations.decimalLongitude" label={ t('datasets.public.f.longitude') }/>
</CollapsibleComponentSearch> </CollapsibleComponentSearch>
<CollapsibleComponentSearch title={ t('datasets.public.f.crop') }> <CollapsibleComponentSearch title={ t('datasets.public.f.crop') }>
<CropFilter/> <CropFilter name="crops"/>
</CollapsibleComponentSearch> </CollapsibleComponentSearch>
<CollapsibleComponentSearch title={ t('datasets.public.f.accession') }> <CollapsibleComponentSearch title={ t('datasets.public.f.accession') }>
<StringArrFilter name="accessionRef.genus" label={ t('datasets.public.f.genus') } placeholder={ t('datasets.public.f.genusPlaceholder') }/> <StringArrFilter name="accessionRefs.genus" label={ t('datasets.public.f.genus') } placeholder={ t('datasets.public.f.genusPlaceholder') }/>
<StringFilter name="accessionRef.acceNumb" searchType="contains" label={ t('datasets.public.f.accNumber') } placeholder="IRGC100"/> <StringFilter name="accessionRefs.acceNumb" searchType="contains" label={ t('datasets.public.f.accNumber') } placeholder="IRGC100"/>
<StringArrFilter name="accessionRef.instCode" label={ t('datasets.public.f.faoWiews') } placeholder="PHL001"/> <StringArrFilter name="accessionRefs.instCode" label={ t('datasets.public.f.faoWiews') } placeholder="PHL001"/>
<StringArrFilter name="accessionRef.doi" label={ t('datasets.public.f.accDoi') } placeholder="10.xxxx/yyyyy"/> <StringArrFilter name="accessionRefs.doi" label={ t('datasets.public.f.accDoi') } placeholder="10.xxxx/yyyyy"/>
</CollapsibleComponentSearch> </CollapsibleComponentSearch>
<CollapsibleComponentSearch title={ t('datasets.public.f.licence') }> <CollapsibleComponentSearch title={ t('datasets.public.f.licence') }>
<LicenceFilter name={ t('datasets.public.f.rights') } className="p-20"/> <LicenceFilter name={ t('datasets.publi