15397: Fix usage of deprecated assertRegexpMatches.
[arvados.git] / services / workbench2 / src / views-components / dialog-forms / update-collection-dialog.ts
1 // Copyright (C) The Arvados Authors. All rights reserved.
2 //
3 // SPDX-License-Identifier: AGPL-3.0
4
5 import { compose, Dispatch } from "redux";
6 import { reduxForm } from 'redux-form';
7 import { withDialog } from "store/dialog/with-dialog";
8 import { DialogCollectionUpdate } from 'views-components/dialog-update/dialog-collection-update';
9 import {
10     COLLECTION_UPDATE_FORM_NAME,
11     CollectionUpdateFormDialogData,
12     updateCollection
13 } from 'store/collections/collection-update-actions';
14
15 export const UpdateCollectionDialog = compose(
16     withDialog(COLLECTION_UPDATE_FORM_NAME),
17     reduxForm<CollectionUpdateFormDialogData>({
18         touchOnChange: true,
19         form: COLLECTION_UPDATE_FORM_NAME,
20         onSubmit: (data: CollectionUpdateFormDialogData, dispatch: Dispatch) => {
21             dispatch<any>(updateCollection(data));
22         }
23     })
24 )(DialogCollectionUpdate);