X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/c0b0f2e4f2f795e06412db84c77b6b0447815ca2..cfd501bed1fb431e74816069f0ae8f83aacf29c7:/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 b40225b6..41cf2916 100644
--- a/src/views-components/search-bar/search-bar.tsx
+++ b/src/views-components/search-bar/search-bar.tsx
@@ -10,13 +10,13 @@ import {
     searchData,
     deleteSavedQuery,
     loadRecentQueries,
-    saveQuery,
     openSearchView,
     closeSearchView,
+    closeAdvanceView,
     navigateToItem,
     editSavedQuery,
     changeData,
-    submitData
+    submitData, moveUp, moveDown, setAdvancedDataFromSearchValue
 } from '~/store/search-bar/search-bar-actions';
 import { SearchBarView, SearchBarActionProps, SearchBarDataProps } from '~/views-components/search-bar/search-bar-view';
 import { SearchBarAdvanceFormData } from '~/models/search-bar';
@@ -27,8 +27,12 @@ const mapStateToProps = ({ searchBar, form }: RootState): SearchBarDataProps =>
         currentView: searchBar.currentView,
         isPopoverOpen: searchBar.open,
         searchResults: searchBar.searchResults,
+        selectedItem: searchBar.selectedItem,
         savedQueries: searchBar.savedQueries,
-        tags: form.searchBarAdvanceFormName
+        tags: form.searchBarAdvanceFormName,
+        saveQuery: form.searchBarAdvanceFormName &&
+            form.searchBarAdvanceFormName.values &&
+            form.searchBarAdvanceFormName.values.saveQuery
     };
 };
 
@@ -38,12 +42,15 @@ const mapDispatchToProps = (dispatch: Dispatch): SearchBarActionProps => ({
     onSetView: (currentView: string) => dispatch(goToView(currentView)),
     onSubmit: (event: React.FormEvent<HTMLFormElement>) => dispatch<any>(submitData(event)),
     closeView: () => dispatch<any>(closeSearchView()),
+    closeAdvanceView: () => dispatch<any>(closeAdvanceView()),
     loadRecentQueries: () => dispatch<any>(loadRecentQueries()),
-    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))
+    editSavedQuery: (data: SearchBarAdvanceFormData) => dispatch<any>(editSavedQuery(data)),
+    moveUp: () => dispatch<any>(moveUp()),
+    moveDown: () => dispatch<any>(moveDown()),
+    setAdvancedDataFromSearchValue: (search: string) => dispatch<any>(setAdvancedDataFromSearchValue(search))
 });
 
-export const SearchBar = connect(mapStateToProps, mapDispatchToProps)(SearchBarView);
\ No newline at end of file
+export const SearchBar = connect(mapStateToProps, mapDispatchToProps)(SearchBarView);
