X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/e4b54c3b5d99c99553e319ead28c3aa8dcd6eecc..ac09b3b5c8ecd122b778bb9c17f2aef1f00f6b05:/src/views/ssh-key-panel/ssh-key-panel.tsx diff --git a/src/views/ssh-key-panel/ssh-key-panel.tsx b/src/views/ssh-key-panel/ssh-key-panel.tsx index f600677d..6575a9cc 100644 --- a/src/views/ssh-key-panel/ssh-key-panel.tsx +++ b/src/views/ssh-key-panel/ssh-key-panel.tsx @@ -5,19 +5,27 @@ import { RootState } from '~/store/store'; import { Dispatch } from 'redux'; import { connect } from 'react-redux'; +import { openSshKeyCreateDialog, openPublicKeyDialog } from '~/store/auth/auth-action-ssh'; +import { openSshKeyContextMenu } from '~/store/context-menu/context-menu-actions'; import { SshKeyPanelRoot, SshKeyPanelRootDataProps, SshKeyPanelRootActionProps } from '~/views/ssh-key-panel/ssh-key-panel-root'; -import { openSshKeyCreateDialog } from '~/store/auth/auth-action'; const mapStateToProps = (state: RootState): SshKeyPanelRootDataProps => { return { - sshKeys: state.auth.sshKeys + sshKeys: state.auth.sshKeys, + hasKeys: state.auth.sshKeys!.length > 0 }; }; const mapDispatchToProps = (dispatch: Dispatch): SshKeyPanelRootActionProps => ({ - onClick: () => { - dispatch(openSshKeyCreateDialog()); + openSshKeyCreateDialog: () => { + dispatch(openSshKeyCreateDialog()); + }, + openRowOptions: (event, sshKey) => { + dispatch(openSshKeyContextMenu(event, sshKey)); + }, + openPublicKeyDialog: (name: string, publicKey: string) => { + dispatch(openPublicKeyDialog(name, publicKey)); } }); -export const SshKeyPanel = connect(mapStateToProps, mapDispatchToProps)(SshKeyPanelRoot); \ No newline at end of file +export const SshKeyPanel = connect(mapStateToProps, mapDispatchToProps)(SshKeyPanelRoot);