--- /dev/null
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+
+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';
+
+const mapStateToProps = (state: RootState): SshKeyPanelRootDataProps => {
+ return {
+ sshKeys: state.auth.sshKeys,
+ hasKeys: state.auth.sshKeys!.length > 0
+ };
+};
+
+const mapDispatchToProps = (dispatch: Dispatch): SshKeyPanelRootActionProps => ({
+ openSshKeyCreateDialog: () => {
+ dispatch<any>(openSshKeyCreateDialog());
+ },
+ openRowOptions: (event, sshKey) => {
+ dispatch<any>(openSshKeyContextMenu(event, sshKey));
+ },
+ openPublicKeyDialog: (name: string, publicKey: string) => {
+ dispatch<any>(openPublicKeyDialog(name, publicKey));
+ }
+});
+
+export const SshKeyAdminPanel = connect(mapStateToProps, mapDispatchToProps)(SshKeyPanelRoot);
import { SshKeyPanelRoot, SshKeyPanelRootDataProps, SshKeyPanelRootActionProps } from 'views/ssh-key-panel/ssh-key-panel-root';
const mapStateToProps = (state: RootState): SshKeyPanelRootDataProps => {
+ const sshKeys = state.auth.sshKeys = state.auth.sshKeys.filter((key) => {
+ return key.authorizedUserUuid == state.auth.user.uuid;
+ });
+
return {
- sshKeys: state.auth.sshKeys,
- hasKeys: state.auth.sshKeys!.length > 0
+ sshKeys: sshKeys,
+ hasKeys: sshKeys!.length > 0
};
};
import { WorkflowPanel } from 'views/workflow-panel/workflow-panel';
import { SearchResultsPanel } from 'views/search-results-panel/search-results-panel';
import { SshKeyPanel } from 'views/ssh-key-panel/ssh-key-panel';
+import { SshKeyAdminPanel } from 'views/ssh-key-panel/ssh-key-admin-panel';
import { SiteManagerPanel } from "views/site-manager-panel/site-manager-panel";
import { MyAccountPanel } from 'views/my-account-panel/my-account-panel';
import { SharingDialog } from 'views-components/sharing-dialog/sharing-dialog';
<Route path={Routes.VIRTUAL_MACHINES_ADMIN} component={VirtualMachineAdminPanel} />
<Route path={Routes.REPOSITORIES} component={RepositoriesPanel} />
<Route path={Routes.SSH_KEYS_USER} component={SshKeyPanel} />
- <Route path={Routes.SSH_KEYS_ADMIN} component={SshKeyPanel} />
+ <Route path={Routes.SSH_KEYS_ADMIN} component={SshKeyAdminPanel} />
<Route path={Routes.SITE_MANAGER} component={SiteManagerPanel} />
<Route path={Routes.KEEP_SERVICES} component={KeepServicePanel} />
<Route path={Routes.USERS} component={UserPanel} />