1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 import { Dispatch } from "redux";
6 import { connect } from "react-redux";
7 import { navigateTo } from '~/store/navigation/navigation-action';
8 import { SearchResultsPanelActionProps } from './search-results-panel-view';
9 import { openContextMenu, resourceKindToContextMenuKind } from '~/store/context-menu/context-menu-actions';
10 import { ResourceKind } from '~/models/resource';
11 import { loadDetailsPanel } from '~/store/details-panel/details-panel-action';
12 import { SearchResultsPanelView } from '~/views/search-results-panel/search-results-panel-view';
14 const mapDispatchToProps = (dispatch: Dispatch): SearchResultsPanelActionProps => ({
15 onContextMenu: (event, resourceUuid) => {
16 const kind = resourceKindToContextMenuKind(resourceUuid);
18 dispatch<any>(openContextMenu(event, {
22 kind: ResourceKind.NONE,
26 dispatch<any>(loadDetailsPanel(resourceUuid));
28 onDialogOpen: (ownerUuid: string) => { return; },
29 onItemClick: (resourceUuid: string) => {
30 dispatch<any>(loadDetailsPanel(resourceUuid));
32 onItemDoubleClick: uuid => {
33 dispatch<any>(navigateTo(uuid));
37 export const SearchResultsPanel = connect(null, mapDispatchToProps)(SearchResultsPanelView);