X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/b178ea37c7a247a6399ecf1112d5f8c8aae12136..93926d5be6b62da8d8bedea1c9c3a63fd4e71b31:/src/views-components/virtual-machines-dialog/add-login-dialog.tsx diff --git a/src/views-components/virtual-machines-dialog/add-login-dialog.tsx b/src/views-components/virtual-machines-dialog/add-login-dialog.tsx index bfc04716..d9547d7c 100644 --- a/src/views-components/virtual-machines-dialog/add-login-dialog.tsx +++ b/src/views-components/virtual-machines-dialog/add-login-dialog.tsx @@ -4,7 +4,7 @@ import React from 'react'; import { compose } from "redux"; -import { reduxForm, InjectedFormProps, WrappedFieldProps, Field } from 'redux-form'; +import { reduxForm, InjectedFormProps, WrappedFieldProps, Field, GenericField } from 'redux-form'; import { withDialog, WithDialogProps } from "store/dialog/with-dialog"; import { FormDialog } from 'components/form-dialog/form-dialog'; import { VIRTUAL_MACHINE_ADD_LOGIN_DIALOG, VIRTUAL_MACHINE_ADD_LOGIN_FORM, addUpdateVirtualMachineLogin, AddLoginFormData, VIRTUAL_MACHINE_ADD_LOGIN_USER_FIELD, VIRTUAL_MACHINE_ADD_LOGIN_GROUPS_FIELD } from 'store/virtual-machines/virtual-machines-actions'; @@ -31,26 +31,33 @@ export const VirtualMachineAddLoginDialog = compose( type CreateGroupDialogComponentProps = WithDialogProps<{updating: boolean}> & InjectedFormProps; -const AddLoginFormFields = () => - <> - +const AddLoginFormFields = (props) => { + return <> + ; +} + + +interface UserFieldProps { + excludedParticipants: string[]; +} -const UserField = () => - ; +const ParticipantField = Field as new () => GenericField; -const UserSelect = ({ input, meta }: WrappedFieldProps) => +const UserSelect = (props) => (input.onChange(''))} />; + items={props.input.value ? [props.input.value] : []} + excludedParticipants={props.excludedParticipants} + onSelect={props.input.onChange} + onDelete={() => (props.input.onChange(''))} />;