remove SshKey interface and change object type
authorJanicki Artur <artur.janicki@contractors.roche.com>
Wed, 21 Nov 2018 09:27:11 +0000 (10:27 +0100)
committerJanicki Artur <artur.janicki@contractors.roche.com>
Wed, 21 Nov 2018 09:27:11 +0000 (10:27 +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/store/auth/auth-reducer.ts
src/views/ssh-key-panel/ssh-key-panel-root.tsx

index 76d6ffd94c78a0c1b9a1b505706d662ece7d105f..8c2a3fda28dca2f749dc65b360ac9e6de6108a6e 100644 (file)
@@ -4,14 +4,6 @@
 
 import { Resource } from '~/models/resource';
 
 
 import { Resource } from '~/models/resource';
 
-export interface SshKey {
-    name: string;
-    keyType: KeyType;
-    authorizedUserUuid: string;
-    publicKey: string;
-    expiresAt: string;
-}
-
 export interface SshKeyCreateFormDialogData {
     publicKey: string;
     name: string;
 export interface SshKeyCreateFormDialogData {
     publicKey: string;
     name: string;
index 64ee7196cba0597e8724ef80f1677ce35ad4350e..1a4ba0c447d7b25677cbfcf62acb21ca8979812c 100644 (file)
@@ -12,7 +12,7 @@ import { getCommonResourceServiceError, CommonResourceServiceError } from '~/ser
 import { AxiosInstance } from "axios";
 import { snackbarActions } from '~/store/snackbar/snackbar-actions';
 import { dialogActions } from '~/store/dialog/dialog-actions';
 import { AxiosInstance } from "axios";
 import { snackbarActions } from '~/store/snackbar/snackbar-actions';
 import { dialogActions } from '~/store/dialog/dialog-actions';
-import { SshKeyCreateFormDialogData, SshKey, KeyType } from '~/models/ssh-key';
+import { SshKeyCreateFormDialogData, KeyType, SshKeyResource } from '~/models/ssh-key';
 import { setBreadcrumbs } from '../breadcrumbs/breadcrumbs-actions';
 
 export const authActions = unionize({
 import { setBreadcrumbs } from '../breadcrumbs/breadcrumbs-actions';
 
 export const authActions = unionize({
@@ -22,8 +22,8 @@ export const authActions = unionize({
     INIT: ofType<{ user: User, token: string }>(),
     USER_DETAILS_REQUEST: {},
     USER_DETAILS_SUCCESS: ofType<User>(),
     INIT: ofType<{ user: User, token: string }>(),
     USER_DETAILS_REQUEST: {},
     USER_DETAILS_SUCCESS: ofType<User>(),
-    SET_SSH_KEYS: ofType<SshKey[]>(),
-    ADD_SSH_KEY: ofType<SshKey>()
+    SET_SSH_KEYS: ofType<SshKeyResource[]>(),
+    ADD_SSH_KEY: ofType<SshKeyResource>()
 });
 
 export const SSH_KEY_CREATE_FORM_NAME = 'sshKeyCreateFormName';
 });
 
 export const SSH_KEY_CREATE_FORM_NAME = 'sshKeyCreateFormName';
index 8a30a2a6805f1548cbac4c113ac2a3a4c60822b9..8f234dad35bf8a9d68f508ab47d4a1166eea454e 100644 (file)
@@ -5,12 +5,12 @@
 import { authActions, AuthAction } from "./auth-action";
 import { User } from "~/models/user";
 import { ServiceRepository } from "~/services/services";
 import { authActions, AuthAction } from "./auth-action";
 import { User } from "~/models/user";
 import { ServiceRepository } from "~/services/services";
-import { SshKey } from '~/models/ssh-key';
+import { SshKeyResource } from '~/models/ssh-key';
 
 export interface AuthState {
     user?: User;
     apiToken?: string;
 
 export interface AuthState {
     user?: User;
     apiToken?: string;
-    sshKeys?: SshKey[];
+    sshKeys?: SshKeyResource[];
 }
 
 const initialState: AuthState = {
 }
 
 const initialState: AuthState = {
@@ -36,10 +36,10 @@ export const authReducer = (services: ServiceRepository) => (state: AuthState =
         USER_DETAILS_SUCCESS: (user: User) => {
             return {...state, user};
         },
         USER_DETAILS_SUCCESS: (user: User) => {
             return {...state, user};
         },
-        SET_SSH_KEYS: (sshKeys: SshKey[]) => {
+        SET_SSH_KEYS: (sshKeys: SshKeyResource[]) => {
             return {...state, sshKeys};
         },
             return {...state, sshKeys};
         },
-        ADD_SSH_KEY: (sshKey: SshKey) => {
+        ADD_SSH_KEY: (sshKey: SshKeyResource) => {
             return { ...state, sshKeys: state.sshKeys!.concat(sshKey) };
         },
         default: () => state
             return { ...state, sshKeys: state.sshKeys!.concat(sshKey) };
         },
         default: () => state
index 90602de0d2a1d05320c6ccfae3e6cd5bf86f2381..f752228ffc13452ac5f434172d50e60db472b977 100644 (file)
@@ -5,7 +5,7 @@
 import * as React from 'react';
 import { StyleRulesCallback, WithStyles, withStyles, Card, CardContent, Button, Typography } from '@material-ui/core';
 import { ArvadosTheme } from '~/common/custom-theme';
 import * as React from 'react';
 import { StyleRulesCallback, WithStyles, withStyles, Card, CardContent, Button, Typography } from '@material-ui/core';
 import { ArvadosTheme } from '~/common/custom-theme';
-import { SshKey } from '~/models/ssh-key';
+import { SshKeyResource } from '~/models/ssh-key';
 
 
 type CssRules = 'root' | 'link';
 
 
 type CssRules = 'root' | 'link';
@@ -26,7 +26,7 @@ export interface SshKeyPanelRootActionProps {
 }
 
 export interface SshKeyPanelRootDataProps {
 }
 
 export interface SshKeyPanelRootDataProps {
-    sshKeys?: SshKey[];
+    sshKeys?: SshKeyResource[];
 }
 
 type SshKeyPanelRootProps = SshKeyPanelRootDataProps & SshKeyPanelRootActionProps & WithStyles<CssRules>;
 }
 
 type SshKeyPanelRootProps = SshKeyPanelRootDataProps & SshKeyPanelRootActionProps & WithStyles<CssRules>;