Merge branch 'master' of git.curoverse.com:arvados-workbench2 into 14652_api_tokens_p...
[arvados.git] / src / views-components / dialog-forms / create-user-dialog.ts
1 // Copyright (C) The Arvados Authors. All rights reserved.
2 //
3 // SPDX-License-Identifier: AGPL-3.0
4
5 import { compose } from "redux";
6 import { reduxForm } from 'redux-form';
7 import { withDialog } from "~/store/dialog/with-dialog";
8 import { USER_CREATE_FORM_NAME, createUser, UserCreateFormDialogData } from "~/store/users/users-actions";
9 import { UserRepositoryCreate } from "~/views-components/dialog-create/dialog-user-create";
10
11 export const CreateUserDialog = compose(
12     withDialog(USER_CREATE_FORM_NAME),
13     reduxForm<UserCreateFormDialogData>({
14         form: USER_CREATE_FORM_NAME,
15         onSubmit: (data, dispatch) => {
16             dispatch(createUser(data));
17         }
18     })
19 )(UserRepositoryCreate);