X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/54e859c204c3952a8eaf96d2145dfa96c199b934..1323cfa23f5e3e326927364d4e43f151f5b33427:/src/views/search-results-panel/search-results-panel.tsx

diff --git a/src/views/search-results-panel/search-results-panel.tsx b/src/views/search-results-panel/search-results-panel.tsx
index fd322d75fc..0902f15bdc 100644
--- a/src/views/search-results-panel/search-results-panel.tsx
+++ b/src/views/search-results-panel/search-results-panel.tsx
@@ -4,25 +4,45 @@
 
 import { Dispatch } from "redux";
 import { connect } from "react-redux";
-import { navigateTo } from '~/store/navigation/navigation-action';
-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 { navigateTo } from 'store/navigation/navigation-action';
+import { openSearchResultsContextMenu } from 'store/context-menu/context-menu-actions';
+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';
+import { SearchBarAdvancedFormData } from 'models/search-bar';
+import { User } from "models/user";
+import { Config } from 'common/config';
+import { Session } from "models/session";
+
+export interface SearchResultsPanelDataProps {
+    data: SearchBarAdvancedFormData;
+    user: User;
+    sessions: Session[];
+    remoteHostsConfig: { [key: string]: Config };
+    localCluster: string;
+}
+
+export interface SearchResultsPanelActionProps {
+    onItemClick: (item: string) => void;
+    onContextMenu: (event: React.MouseEvent<HTMLElement>, item: string) => void;
+    onDialogOpen: (ownerUuid: string) => void;
+    onItemDoubleClick: (item: string) => void;
+}
+
+export type SearchResultsPanelProps = SearchResultsPanelDataProps & SearchResultsPanelActionProps;
+
+const mapStateToProps = (rootState: RootState) => {
+    return {
+        user: rootState.auth.user,
+        sessions: rootState.auth.sessions,
+        remoteHostsConfig: rootState.auth.remoteHostsConfig,
+        localCluster: rootState.auth.localCluster,
+    };
+};
 
 const mapDispatchToProps = (dispatch: Dispatch): SearchResultsPanelActionProps => ({
     onContextMenu: (event, resourceUuid) => {
-        const kind = resourceKindToContextMenuKind(resourceUuid);
-        if (kind) {
-            dispatch<any>(openContextMenu(event, {
-                name: '',
-                uuid: resourceUuid,
-                ownerUuid: '',
-                kind: ResourceKind.NONE,
-                menuKind: kind
-            }));
-        }
+        dispatch<any>(openSearchResultsContextMenu(event, resourceUuid));
     },
     onDialogOpen: (ownerUuid: string) => { return; },
     onItemClick: (resourceUuid: string) => {
@@ -33,4 +53,4 @@ const mapDispatchToProps = (dispatch: Dispatch): SearchResultsPanelActionProps =
     }
 });
 
-export const SearchResultsPanel = connect(null, mapDispatchToProps)(SearchResultsPanelView);
\ No newline at end of file
+export const SearchResultsPanel = connect(mapStateToProps, mapDispatchToProps)(SearchResultsPanelView);
