move ssh form interface from model to action
authorJanicki Artur <artur.janicki@contractors.roche.com>
Wed, 21 Nov 2018 11:09:20 +0000 (12:09 +0100)
committerJanicki Artur <artur.janicki@contractors.roche.com>
Wed, 21 Nov 2018 11:09:20 +0000 (12:09 +0100)
Feature #14479_ssh_keys

Arvados-DCO-1.1-Signed-off-by: Janicki Artur <artur.janicki@contractors.roche.com>

src/models/ssh-key.ts
src/store/auth/auth-action.ts
src/views-components/dialog-create/dialog-ssh-key-create.tsx
src/views-components/dialog-forms/create-ssh-key-dialog.ts

index 8c2a3fda28dca2f749dc65b360ac9e6de6108a6e..8ccbd92908109b3d126bd76154d74beedc3e4913 100644 (file)
@@ -4,11 +4,6 @@
 
 import { Resource } from '~/models/resource';
 
-export interface SshKeyCreateFormDialogData {
-    publicKey: string;
-    name: string;
-}
-
 export enum KeyType {
     SSH = 'SSH'
 }
index 00e372a2ecd5206852790da4e32ac2b5bb239c94..3658c589b6a4814f8dddc359494e744c1b0cf77c 100644 (file)
@@ -12,7 +12,7 @@ import { dialogActions } from '~/store/dialog/dialog-actions';
 import { setBreadcrumbs } from '~/store/breadcrumbs/breadcrumbs-actions';
 import { ServiceRepository } from "~/services/services";
 import { getAuthorizedKeysServiceError, AuthorizedKeysServiceError } from '~/services/authorized-keys-service/authorized-keys-service';
-import { SshKeyCreateFormDialogData, KeyType, SshKeyResource } from '~/models/ssh-key';
+import { KeyType, SshKeyResource } from '~/models/ssh-key';
 import { User } from "~/models/user";
 
 export const authActions = unionize({
@@ -28,6 +28,11 @@ export const authActions = unionize({
 
 export const SSH_KEY_CREATE_FORM_NAME = 'sshKeyCreateFormName';
 
+export interface SshKeyCreateFormDialogData {
+    publicKey: string;
+    name: string;
+}
+
 function setAuthorizationHeader(services: ServiceRepository, token: string) {
     services.apiClient.defaults.headers.common = {
         Authorization: `OAuth2 ${token}`
index 28c3a36225387a5b23e177f7d24b0dab67594373..b7c9b1fbe6e19bba50db582618c1455c75813cf0 100644 (file)
@@ -7,7 +7,7 @@ import { InjectedFormProps } from 'redux-form';
 import { WithDialogProps } from '~/store/dialog/with-dialog';
 import { FormDialog } from '~/components/form-dialog/form-dialog';
 import { SshKeyPublicField, SshKeyNameField } from '~/views-components/form-fields/ssh-key-form-fields';
-import { SshKeyCreateFormDialogData } from '~/models/ssh-key';
+import { SshKeyCreateFormDialogData } from '~/store/auth/auth-action';
 
 type DialogSshKeyProps = WithDialogProps<{}> & InjectedFormProps<SshKeyCreateFormDialogData>;
 
index bc436d91cfe8b92310896bebc603cf9a39ddb4e3..e96524338dd626bd333b3f3d6afd93dc91e85335 100644 (file)
@@ -5,9 +5,8 @@
 import { compose } from "redux";
 import { reduxForm } from 'redux-form';
 import { withDialog } from "~/store/dialog/with-dialog";
-import { SSH_KEY_CREATE_FORM_NAME, createSshKey } from '~/store/auth/auth-action';
+import { SSH_KEY_CREATE_FORM_NAME, createSshKey, SshKeyCreateFormDialogData } from '~/store/auth/auth-action';
 import { DialogSshKeyCreate } from '~/views-components/dialog-create/dialog-ssh-key-create';
-import { SshKeyCreateFormDialogData } from '~/models/ssh-key';
 
 export const CreateSshKeyDialog = compose(
     withDialog(SSH_KEY_CREATE_FORM_NAME),