15064: Tell users which clusters are being searched.
[arvados-workbench2.git] / src / views / search-results-panel / search-results-panel.tsx
index 8b01ca3f410e03d0e7f29d8cf5a50ef5ac75497a..8fa0828bec7d33662a68cd92f3c8dab83f8406b2 100644 (file)
@@ -5,22 +5,20 @@
 import { Dispatch } from "redux";
 import { connect } from "react-redux";
 import { navigateTo } from '~/store/navigation/navigation-action';
-import { SearchResultsPanelActionProps, SearchResultsPanelDataProps } from './search-results-panel-view';
-import { RootState } from '~/store/store';
+import { SearchResultsPanelActionProps } from './search-results-panel-view';
 import { openContextMenu, resourceKindToContextMenuKind } from '~/store/context-menu/context-menu-actions';
 import { ResourceKind } from '~/models/resource';
 import { loadDetailsPanel } from '~/store/details-panel/details-panel-action';
 import { SearchResultsPanelView } from '~/views/search-results-panel/search-results-panel-view';
+import { RootState } from '~/store/store';
 
-const mapStateToProps = (state: RootState): SearchResultsPanelDataProps => ({
-    data: {
-        inTrash: false,
-        dataFrom: '',
-        dataTo: '',
-        saveQuery: false,
-        searchQuery: ''
-    }
-});
+const mapStateToProps = (rootState: RootState) => {
+    return {
+        user: rootState.auth.user,
+        sessions: rootState.auth.sessions,
+        remoteHostsConfig: rootState.auth.remoteHostsConfig
+    };
+};
 
 const mapDispatchToProps = (dispatch: Dispatch): SearchResultsPanelActionProps => ({
     onContextMenu: (event, resourceUuid) => {
@@ -34,6 +32,7 @@ const mapDispatchToProps = (dispatch: Dispatch): SearchResultsPanelActionProps =
                 menuKind: kind
             }));
         }
+        dispatch<any>(loadDetailsPanel(resourceUuid));
     },
     onDialogOpen: (ownerUuid: string) => { return; },
     onItemClick: (resourceUuid: string) => {
@@ -44,4 +43,4 @@ const mapDispatchToProps = (dispatch: Dispatch): SearchResultsPanelActionProps =
     }
 });
 
-export const SearchResultsPanel = connect(mapStateToProps, mapDispatchToProps)(SearchResultsPanelView);
\ No newline at end of file
+export const SearchResultsPanel = connect(mapStateToProps, mapDispatchToProps)(SearchResultsPanelView);