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';
9 import { Dispatch } from 'redux';
11 const Form = withStyles(({ spacing }) => ({ container: { marginBottom: spacing.unit * 2 } }))(ResourcePropertiesForm);
13 export const CollectionTagForm = reduxForm<ResourcePropertiesFormData>({
14 form: COLLECTION_TAG_FORM_NAME,
15 onSubmit: (data, dispatch: Dispatch) => {
16 dispatch<any>(createCollectionTag(data));
17 dispatch(reset(COLLECTION_TAG_FORM_NAME));