X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/00ddf216e1a5046a858b1c8b49f0e967404474ca..e51530db62c369733186003cc5f005e491f29373:/src/views-components/search-bar/search-bar.tsx diff --git a/src/views-components/search-bar/search-bar.tsx b/src/views-components/search-bar/search-bar.tsx index affd5e4c69..98440fda29 100644 --- a/src/views-components/search-bar/search-bar.tsx +++ b/src/views-components/search-bar/search-bar.tsx @@ -5,20 +5,26 @@ import { connect } from 'react-redux'; import { RootState } from '~/store/store'; import { Dispatch } from 'redux'; -import { goToView, searchBarActions } from '~/store/search-bar/search-bar-actions'; +import { goToView, searchData, searchBarActions } from '~/store/search-bar/search-bar-actions'; import { SearchBarView } from '~/views-components/search-bar/search-bar-view'; +import { saveRecentQuery, loadRecentQueries } from '~/store/search-bar/search-bar-actions'; const mapStateToProps = ({ searchBar }: RootState) => { return { + searchValue: searchBar.searchValue, currentView: searchBar.currentView, - open: searchBar.open + open: searchBar.open, + searchResults: searchBar.searchResults }; }; const mapDispatchToProps = (dispatch: Dispatch) => ({ + onSearch: (valueSearch: string) => dispatch(searchData(valueSearch)), onSetView: (currentView: string) => dispatch(goToView(currentView)), openView: () => dispatch(searchBarActions.OPEN_SEARCH_VIEW()), - closeView: () => dispatch(searchBarActions.CLOSE_SEARCH_VIEW()) + closeView: () => dispatch(searchBarActions.CLOSE_SEARCH_VIEW()), + saveQuery: (query: string) => dispatch(saveRecentQuery(query)), + loadQueries: () => dispatch(loadRecentQueries()) }); export const SearchBar = connect(mapStateToProps, mapDispatchToProps)(SearchBarView); \ No newline at end of file