refs #14356-it-is-possible-to-save-a-search-query-without-the-key-value-or-both
[arvados.git] / src / views-components / search-bar / search-bar-view.tsx
index a81eec97e018d8b32415473f1d92cfa62b31b813..cfaee6d4f32032c2b6968d3e51c4efc1e8ee65c0 100644 (file)
@@ -58,6 +58,7 @@ type SearchBarDataProps = {
 
 interface SearchBarActionProps {
     onSearch: (value: string) => any;
+    searchDataOnEnter: (value: string) => void;
     debounce?: number;
     onSetView: (currentView: string) => void;
     closeView: () => void;
@@ -77,8 +78,8 @@ interface SearchBarState {
 }
 
 interface RenderRecentQueriesProps {
-    text: string | JSX.Element;
-    onSearch: (searchValue: string | JSX.Element) => void;
+    text: string;
+    onSearch: (searchValue: string) => void;
 }
 
 export const RenderRecentQueries = (props: RenderRecentQueriesProps) => {
@@ -100,10 +101,10 @@ export const RenderAutocompleteItems = (props: RenderAutocompleteItemsProps) =>
 };
 
 interface RenderSavedQueriesProps {
-    text: string | JSX.Element;
+    text: string;
     id: number;
     deleteSavedQuery: (id: number) => void;
-    onSearch: (searchValue: string | JSX.Element) => void;
+    onSearch: (searchValue: string) => void;
     editSavedQuery: (data: SearchBarAdvanceFormData, id: number) => void;
     data: SearchBarAdvanceFormData;
 }
@@ -201,7 +202,7 @@ export const SearchBarView = withStyles(styles)(
             event.preventDefault();
             clearTimeout(this.timeout);
             this.props.saveRecentQuery(this.state.value);
-            this.props.onSearch(this.state.value);
+            this.props.searchDataOnEnter(this.state.value);
             this.props.loadRecentQueries();
         }