X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/b6ac7fe88d347582d39fffa002e300af222c578f..7e9513099881d63a99a70c69ddd71c5d83567fa4:/src/views-components/dialog-forms/setup-shell-account-dialog.tsx?ds=sidebyside

diff --git a/src/views-components/dialog-forms/setup-shell-account-dialog.tsx b/src/views-components/dialog-forms/setup-shell-account-dialog.tsx
deleted file mode 100644
index 3bf700ba..00000000
--- a/src/views-components/dialog-forms/setup-shell-account-dialog.tsx
+++ /dev/null
@@ -1,86 +0,0 @@
-// Copyright (C) The Arvados Authors. All rights reserved.
-//
-// SPDX-License-Identifier: AGPL-3.0
-import React from 'react';
-import { compose } from "redux";
-import { reduxForm, InjectedFormProps, Field } from 'redux-form';
-import { withDialog, WithDialogProps } from "store/dialog/with-dialog";
-import { FormDialog } from 'components/form-dialog/form-dialog';
-import { TextField } from 'components/text-field/text-field';
-import { VirtualMachinesResource } from 'models/virtual-machines';
-import { USER_LENGTH_VALIDATION, CHOOSE_VM_VALIDATION } from 'validators/validators';
-import { InputLabel } from '@material-ui/core';
-import { NativeSelectField } from 'components/select-field/select-field';
-import { SetupShellAccountFormDialogData, SETUP_SHELL_ACCOUNT_DIALOG, setupUserVM } from 'store/users/users-actions';
-import { UserResource } from 'models/user';
-
-export const SetupShellAccountDialog = compose(
-    withDialog(SETUP_SHELL_ACCOUNT_DIALOG),
-    reduxForm<SetupShellAccountFormDialogData>({
-        form: SETUP_SHELL_ACCOUNT_DIALOG,
-        onSubmit: (data, dispatch) => {
-            dispatch(setupUserVM(data));
-        }
-    })
-)(
-    (props: SetupShellAccountDialogComponentProps) =>
-        <FormDialog
-            dialogTitle='Setup shell account'
-            formFields={SetupShellAccountFormFields}
-            submitLabel='Submit'
-            {...props}
-        />
-);
-
-interface UserProps {
-    data: {
-        user: UserResource;
-    };
-}
-
-interface VirtualMachinesProps {
-    data: {
-        items: VirtualMachinesResource[];
-    };
-}
-interface DataProps {
-    user: UserResource;
-    items: VirtualMachinesResource[];
-}
-
-const UserEmailField = ({ data }: UserProps) =>
-    <span>
-        <Field
-            name='email'
-            component={TextField as any}
-            disabled
-            label={data.user.email} /></span>;
-
-const UserVirtualMachineField = ({ data }: VirtualMachinesProps) =>
-    <div style={{ marginBottom: '21px' }}>
-        <InputLabel>Virtual Machine</InputLabel>
-        <Field
-            name='virtualMachine'
-            component={NativeSelectField as any}
-            validate={CHOOSE_VM_VALIDATION}
-            items={getVirtualMachinesList(data.items)} />
-    </div>;
-
-const UserGroupsVirtualMachineField = () =>
-    <Field
-        name='groups'
-        component={TextField as any}
-        validate={USER_LENGTH_VALIDATION}
-        label="Groups for virtual machine (comma separated list)" />;
-
-const getVirtualMachinesList = (virtualMachines: VirtualMachinesResource[]) =>
-    [{ key: "", value: "" }].concat(virtualMachines.map(it => ({ key: it.hostname, value: it.hostname })));
-
-type SetupShellAccountDialogComponentProps = WithDialogProps<{}> & InjectedFormProps<SetupShellAccountFormDialogData>;
-
-const SetupShellAccountFormFields = (props: SetupShellAccountDialogComponentProps) =>
-    <>
-        <UserEmailField data={props.data as DataProps} />
-        <UserVirtualMachineField data={props.data as DataProps} />
-        <UserGroupsVirtualMachineField />
-    </>;
