Merge branch '17018-readonly-file-actions-fix'
[arvados-workbench2.git] / src / views / collection-panel / collection-tag-form.tsx
1 // Copyright (C) The Arvados Authors. All rights reserved.
2 //
3 // SPDX-License-Identifier: AGPL-3.0
4
5 import { reduxForm, reset } from 'redux-form';
6 import { createCollectionTag, COLLECTION_TAG_FORM_NAME } from '~/store/collection-panel/collection-panel-action';
7 import { ResourcePropertiesForm, ResourcePropertiesFormData } from '~/views-components/resource-properties-form/resource-properties-form';
8 import { withStyles } from '@material-ui/core';
9
10 const Form = withStyles(({ spacing }) => ({ container: { marginBottom: spacing.unit * 2 } }))(ResourcePropertiesForm);
11
12 export const CollectionTagForm = reduxForm<ResourcePropertiesFormData>({
13     form: COLLECTION_TAG_FORM_NAME,
14     onSubmit: (data, dispatch) => {
15         dispatch<any>(createCollectionTag(data));
16         dispatch(reset(COLLECTION_TAG_FORM_NAME));
17     }
18 })(Form);