X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/b6ac7fe88d347582d39fffa002e300af222c578f..e10e24d713e5c31cbc34efca458f5718eb6eb000:/src/views-components/dialog-create/dialog-collection-create.tsx

diff --git a/src/views-components/dialog-create/dialog-collection-create.tsx b/src/views-components/dialog-create/dialog-collection-create.tsx
index fb957d53..17a24e48 100644
--- a/src/views-components/dialog-create/dialog-collection-create.tsx
+++ b/src/views-components/dialog-create/dialog-collection-create.tsx
@@ -5,29 +5,56 @@
 import React from 'react';
 import { InjectedFormProps, Field } from 'redux-form';
 import { WithDialogProps } from 'store/dialog/with-dialog';
-import { CollectionCreateFormDialogData } from 'store/collections/collection-create-actions';
+import { CollectionCreateFormDialogData, COLLECTION_CREATE_FORM_NAME } from 'store/collections/collection-create-actions';
 import { FormDialog } from 'components/form-dialog/form-dialog';
-import { CollectionNameField, CollectionDescriptionField } from 'views-components/form-fields/collection-form-fields';
+import {
+    CollectionNameField,
+    CollectionDescriptionField,
+    CollectionStorageClassesField
+} from 'views-components/form-fields/collection-form-fields';
 import { FileUploaderField } from '../file-uploader/file-uploader';
 import { ResourceParentField } from '../form-fields/resource-form-fields';
+import { CreateCollectionPropertiesForm } from 'views-components/collection-properties/create-collection-properties-form';
+import { FormGroup, FormLabel, StyleRulesCallback, WithStyles, withStyles } from '@material-ui/core';
+import { resourcePropertiesList } from 'views-components/resource-properties/resource-properties-list';
+
+type CssRules = 'propertiesForm';
+
+const styles: StyleRulesCallback<CssRules> = theme => ({
+    propertiesForm: {
+        marginTop: theme.spacing.unit * 2,
+        marginBottom: theme.spacing.unit * 2,
+    },
+});
 
 type DialogCollectionProps = WithDialogProps<{}> & InjectedFormProps<CollectionCreateFormDialogData>;
 
 export const DialogCollectionCreate = (props: DialogCollectionProps) =>
     <FormDialog
         dialogTitle='New collection'
-        formFields={CollectionAddFields}
+        formFields={CollectionAddFields as any}
         submitLabel='Create a Collection'
         {...props}
     />;
 
-const CollectionAddFields = () => <span>
-    <ResourceParentField />
-    <CollectionNameField />
-    <CollectionDescriptionField />
-    <Field
-        name='files'
-        label='Files'
-        component={FileUploaderField} />
-</span>;
+const CreateCollectionPropertiesList = resourcePropertiesList(COLLECTION_CREATE_FORM_NAME);
+
+const CollectionAddFields = withStyles(styles)(
+    ({ classes }: WithStyles<CssRules>) => <span>
+        <ResourceParentField />
+        <CollectionNameField />
+        <CollectionDescriptionField />
+        <div className={classes.propertiesForm}>
+            <FormLabel>Properties</FormLabel>
+            <FormGroup>
+                <CreateCollectionPropertiesForm />
+                <CreateCollectionPropertiesList />
+            </FormGroup>
+        </div>
+        <CollectionStorageClassesField defaultClasses={['default']} />
+        <Field
+            name='files'
+            label='Files'
+            component={FileUploaderField} />
+    </span>);
 
