Commit ad7ab009 authored by Matija Obreza's avatar Matija Obreza

Search accessions from entry page

parent 9229952b
......@@ -101,7 +101,7 @@ const CropCard = ({crop, classes, compact = false, edit = false, t, ...other}: {
}
const gridSizes: IGridSizes = { xs: 12, sm: 6, md: 4, lg: 3, xl: 2, ...other };
console.log(`CropCard sizes:`, gridSizes, other);
// console.log(`CropCard sizes:`, gridSizes, other);
return compact ? (
<Grid item { ...gridSizes } >
......
......@@ -26,6 +26,7 @@ import ActivityPostCard from 'cms/ui/c/ActivityPostCard';
import PageTitle from 'ui/common/PageTitle';
import SectionHeader from 'ui/common/heading/SectionHeader';
import Card, { CardContent } from 'ui/common/Card';
import { applyFilters } from 'accessions/actions/public';
const styles = (theme) => ({
/* tslint:disable */
......@@ -263,6 +264,7 @@ interface IWelcomeProps {
crops: any;
lastNews: ActivityPost[];
loadLastNews: () => ActivityPost[];
applyFilters: (AccessionFilter) => any;
}
class WelcomePage extends React.Component<IWelcomeProps, any> {
......@@ -303,10 +305,11 @@ class WelcomePage extends React.Component<IWelcomeProps, any> {
const onSubmitSearch = (e) => {
const { query } = this.state;
const { applyFilters } = this.props;
// const { navigateTo, t } = this.props;
e.preventDefault();
if (query && query.length > 0) {
// navigateTo(`/datasets/suggest`, { q: query });
applyFilters({ _text: query });
} else {
this.setState({
...this.state,
......@@ -465,6 +468,7 @@ const mapStateToProps = (state) => ({
const mapDispatchToProps = (dispatch) => bindActionCreators({
loadLastNews,
applyFilters,
// navigateTo,
}, dispatch);
......
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