X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/b1df18d8e516820b507eb8856800a59035e736ba..79f3533ad0df48c8d6083d5c34f9b7f419173afe:/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 eddc7f0e60..8f39caec28 100644
--- a/src/views-components/search-bar/search-bar.tsx
+++ b/src/views-components/search-bar/search-bar.tsx
@@ -8,34 +8,42 @@ import { Dispatch } from 'redux';
 import {
     goToView,
     searchData,
-    searchBarActions,
     deleteSavedQuery,
     saveRecentQuery,
     loadRecentQueries,
     saveQuery,
-    loadSavedQueries
+    openSearchView,
+    closeSearchView,
+    navigateToItem,
+    editSavedQuery,
+    searchDataOnEnter
 } from '~/store/search-bar/search-bar-actions';
 import { SearchBarView } from '~/views-components/search-bar/search-bar-view';
+import { SearchBarAdvanceFormData } from '~/models/search-bar';
 
-const mapStateToProps = ({ searchBar }: RootState) => {
+const mapStateToProps = ({ searchBar, form }: RootState) => {
     return {
         searchValue: searchBar.searchValue,
         currentView: searchBar.currentView,
         isPopoverOpen: searchBar.open,
-        searchResults: searchBar.searchResults
+        searchResults: searchBar.searchResults,
+        savedQueries: searchBar.savedQueries,
+        tags: form.searchBarAdvanceFormName
     };
 };
 
 const mapDispatchToProps = (dispatch: Dispatch) => ({
     onSearch: (valueSearch: string) => dispatch<any>(searchData(valueSearch)),
     onSetView: (currentView: string) => dispatch(goToView(currentView)),
-    openView: () => dispatch<any>(searchBarActions.OPEN_SEARCH_VIEW()),
-    closeView: () => dispatch<any>(searchBarActions.CLOSE_SEARCH_VIEW()),
+    closeView: () => dispatch<any>(closeSearchView()),
     saveRecentQuery: (query: string) => dispatch<any>(saveRecentQuery(query)),
     loadRecentQueries: () => dispatch<any>(loadRecentQueries()),
-    saveQuery: (query: string) => dispatch<any>(saveQuery(query)),
-    loadSavedQueries: () => dispatch<any>(loadSavedQueries()),
-    deleteSavedQuery: (id: number) => dispatch<any>(deleteSavedQuery(id))
+    saveQuery: (data: SearchBarAdvanceFormData) => dispatch<any>(saveQuery(data)),
+    deleteSavedQuery: (id: number) => dispatch<any>(deleteSavedQuery(id)),
+    openSearchView: () => dispatch<any>(openSearchView()),
+    navigateTo: (uuid: string) => dispatch<any>(navigateToItem(uuid)),
+    editSavedQuery: (data: SearchBarAdvanceFormData) => dispatch<any>(editSavedQuery(data)),
+    searchDataOnEnter: (searchValue: string) => dispatch<any>(searchDataOnEnter(searchValue))
 });
 
 export const SearchBar = connect(mapStateToProps, mapDispatchToProps)(SearchBarView);
\ No newline at end of file
