13493: Merge branch 'master' into 13494-collection-version-browser
[arvados-workbench2.git] / src / views / api-client-authorization-panel / api-client-authorization-panel.tsx
1 // Copyright (C) The Arvados Authors. All rights reserved.
2 //
3 // SPDX-License-Identifier: AGPL-3.0
4
5 import { RootState } from '~/store/store';
6 import { Dispatch } from 'redux';
7 import { connect } from 'react-redux';
8 import {
9     ApiClientAuthorizationPanelRoot,
10     ApiClientAuthorizationPanelRootDataProps,
11     ApiClientAuthorizationPanelRootActionProps
12 } from '~/views/api-client-authorization-panel/api-client-authorization-panel-root';
13 import { openApiClientAuthorizationContextMenu } from '~/store/context-menu/context-menu-actions';
14 import { openApiClientAuthorizationsHelpDialog } from '~/store/api-client-authorizations/api-client-authorizations-actions';
15
16 const mapStateToProps = (state: RootState): ApiClientAuthorizationPanelRootDataProps => {
17     return {
18         resources: state.resources
19     };
20 };
21
22 const mapDispatchToProps = (dispatch: Dispatch): ApiClientAuthorizationPanelRootActionProps => ({
23     onContextMenu: (event, apiClientAuthorization) => {
24         dispatch<any>(openApiClientAuthorizationContextMenu(event, apiClientAuthorization));
25     },
26     onItemClick: (resourceUuid: string) => { return; },
27     onItemDoubleClick: uuid => { return; },
28     openHelpDialog: () => {
29         dispatch<any>(openApiClientAuthorizationsHelpDialog());
30     }
31 });
32
33 export const ApiClientAuthorizationPanel = connect(mapStateToProps, mapDispatchToProps)(ApiClientAuthorizationPanelRoot);