1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
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';
10 const Form = withStyles(({ spacing }) => ({ container: { marginBottom: spacing.unit * 2 } }))(ResourcePropertiesForm);
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));