18219: Unifies code for showing the list of properties on rsc forms.
[arvados-workbench2.git] / src / views-components / dialog-update / dialog-collection-update.tsx
index b98e0e840f71ae94b98de0dc99636703db22e13f..852dab1a354b874cb1273340f48b752342df3dc8 100644 (file)
@@ -2,12 +2,19 @@
 //
 // SPDX-License-Identifier: AGPL-3.0
 
-import * as React from 'react';
+import React from 'react';
 import { InjectedFormProps } from 'redux-form';
-import { WithDialogProps } from '~/store/dialog/with-dialog';
-import { CollectionUpdateFormDialogData } from '~/store/collections/collection-update-actions';
-import { FormDialog } from '~/components/form-dialog/form-dialog';
-import { CollectionNameField, CollectionDescriptionField } from '~/views-components/form-fields/collection-form-fields';
+import { WithDialogProps } from 'store/dialog/with-dialog';
+import { CollectionUpdateFormDialogData, COLLECTION_UPDATE_FORM_NAME } from 'store/collections/collection-update-actions';
+import { FormDialog } from 'components/form-dialog/form-dialog';
+import {
+    CollectionNameField,
+    CollectionDescriptionField,
+    CollectionStorageClassesField
+} from 'views-components/form-fields/collection-form-fields';
+import { UpdateCollectionPropertiesForm } from 'views-components/collection-properties/update-collection-properties-form';
+import { FormGroup, FormLabel } from '@material-ui/core';
+import { resourcePropertiesList } from 'views-components/resource-properties/resource-properties-list';
 
 type DialogCollectionProps = WithDialogProps<{}> & InjectedFormProps<CollectionUpdateFormDialogData>;
 
@@ -19,7 +26,15 @@ export const DialogCollectionUpdate = (props: DialogCollectionProps) =>
         {...props}
     />;
 
+const UpdateCollectionPropertiesList = resourcePropertiesList(COLLECTION_UPDATE_FORM_NAME);
+
 const CollectionEditFields = () => <span>
     <CollectionNameField />
     <CollectionDescriptionField />
+    <FormLabel>Properties</FormLabel>
+    <FormGroup>
+        <UpdateCollectionPropertiesForm />
+        <UpdateCollectionPropertiesList />
+    </FormGroup>
+    <CollectionStorageClassesField />
 </span>;