18219: Replaces properties form on collection panel.
[arvados-workbench2.git] / src / views-components / resource-properties-dialog / resource-properties-dialog-form.tsx
similarity index 56%
rename from src/views-components/project-properties-dialog/project-properties-form.tsx
rename to src/views-components/resource-properties-dialog/resource-properties-dialog-form.tsx
index f36bacf4aeb3007dfe706a7db5dced57961ef0b2..cfb999cc77b4e1bdaf0f1ac42c1fedbf30026933 100644 (file)
@@ -3,17 +3,18 @@
 // SPDX-License-Identifier: AGPL-3.0
 
 import { reduxForm, reset } from 'redux-form';
-import { PROJECT_PROPERTIES_FORM_NAME, createProjectProperty } from 'store/details-panel/details-panel-action';
+import { RESOURCE_PROPERTIES_FORM_NAME } from 'store/details-panel/details-panel-action';
 import { ResourcePropertiesForm, ResourcePropertiesFormData } from 'views-components/resource-properties-form/resource-properties-form';
 import { withStyles } from '@material-ui/core';
 import { Dispatch } from 'redux';
+import { createResourceProperty } from 'store/resources/resources-actions';
 
 const Form = withStyles(({ spacing }) => ({ container: { marginBottom: spacing.unit * 2 } }))(ResourcePropertiesForm);
 
-export const ProjectPropertiesForm = reduxForm<ResourcePropertiesFormData>({
-    form: PROJECT_PROPERTIES_FORM_NAME,
+export const ResourcePropertiesDialogForm = reduxForm<ResourcePropertiesFormData, {uuid: string}>({
+    form: RESOURCE_PROPERTIES_FORM_NAME,
     onSubmit: (data, dispatch: Dispatch) => {
-        dispatch<any>(createProjectProperty(data));
-        dispatch(reset(PROJECT_PROPERTIES_FORM_NAME));
+        dispatch<any>(createResourceProperty(data));
+        dispatch(reset(RESOURCE_PROPERTIES_FORM_NAME));
     }
 })(Form);