From 65bdf250e5a09633e482bacd968666861643c150 Mon Sep 17 00:00:00 2001 From: Janicki Artur Date: Wed, 21 Nov 2018 12:09:20 +0100 Subject: [PATCH] move ssh form interface from model to action Feature #14479_ssh_keys Arvados-DCO-1.1-Signed-off-by: Janicki Artur --- src/models/ssh-key.ts | 5 ----- src/store/auth/auth-action.ts | 7 ++++++- .../dialog-create/dialog-ssh-key-create.tsx | 2 +- src/views-components/dialog-forms/create-ssh-key-dialog.ts | 3 +-- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/models/ssh-key.ts b/src/models/ssh-key.ts index 8c2a3fda..8ccbd929 100644 --- a/src/models/ssh-key.ts +++ b/src/models/ssh-key.ts @@ -4,11 +4,6 @@ import { Resource } from '~/models/resource'; -export interface SshKeyCreateFormDialogData { - publicKey: string; - name: string; -} - export enum KeyType { SSH = 'SSH' } diff --git a/src/store/auth/auth-action.ts b/src/store/auth/auth-action.ts index 00e372a2..3658c589 100644 --- a/src/store/auth/auth-action.ts +++ b/src/store/auth/auth-action.ts @@ -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}` diff --git a/src/views-components/dialog-create/dialog-ssh-key-create.tsx b/src/views-components/dialog-create/dialog-ssh-key-create.tsx index 28c3a362..b7c9b1fb 100644 --- a/src/views-components/dialog-create/dialog-ssh-key-create.tsx +++ b/src/views-components/dialog-create/dialog-ssh-key-create.tsx @@ -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; diff --git a/src/views-components/dialog-forms/create-ssh-key-dialog.ts b/src/views-components/dialog-forms/create-ssh-key-dialog.ts index bc436d91..e9652433 100644 --- a/src/views-components/dialog-forms/create-ssh-key-dialog.ts +++ b/src/views-components/dialog-forms/create-ssh-key-dialog.ts @@ -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), -- 2.30.2