({ spacing }) => (
{ container:
{
- paddingTop: spacing.unit,
margin: 0,
}
})
({ spacing }) => (
{ container:
{
- paddingTop: spacing.unit,
margin: 0,
}
})
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 } from '@material-ui/core';
+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 CreateCollectionPropertiesList = resourcePropertiesList(COLLECTION_CREATE_FORM_NAME);
-const CollectionAddFields = () => <span>
- <ResourceParentField />
- <CollectionNameField />
- <CollectionDescriptionField />
- <FormLabel>Properties</FormLabel>
- <FormGroup>
- <CreateCollectionPropertiesForm />
- <CreateCollectionPropertiesList />
- </FormGroup>
- <CollectionStorageClassesField defaultClasses={['default']} />
- <Field
- name='files'
- label='Files'
- component={FileUploaderField} />
-</span>;
+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>);
import { ProjectNameField, ProjectDescriptionField, UsersField } from 'views-components/form-fields/project-form-fields';
import { CreateProjectPropertiesForm } from 'views-components/project-properties/create-project-properties-form';
import { ResourceParentField } from '../form-fields/resource-form-fields';
-import { FormGroup, FormLabel } from '@material-ui/core';
+import { FormGroup, FormLabel, StyleRulesCallback, WithStyles, withStyles } from '@material-ui/core';
import { resourcePropertiesList } from 'views-components/resource-properties/resource-properties-list';
import { GroupClass } from 'models/group';
+type CssRules = 'propertiesForm' | 'description';
+
+const styles: StyleRulesCallback<CssRules> = theme => ({
+ propertiesForm: {
+ marginTop: theme.spacing.unit * 2,
+ marginBottom: theme.spacing.unit * 2,
+ },
+ description: {
+ marginTop: theme.spacing.unit * 2,
+ marginBottom: theme.spacing.unit * 2,
+ },
+});
+
type DialogProjectProps = WithDialogProps<{sourcePanel: GroupClass}> & InjectedFormProps<ProjectCreateFormDialogData>;
export const DialogProjectCreate = (props: DialogProjectProps) => {
return <FormDialog
dialogTitle={title}
- formFields={fields}
+ formFields={fields as any}
submitLabel='Create'
{...props}
/>;
const CreateProjectPropertiesList = resourcePropertiesList(PROJECT_CREATE_FORM_NAME);
-const ProjectAddFields = () => <span>
- <ResourceParentField />
- <ProjectNameField />
- <ProjectDescriptionField />
- <FormLabel>Properties</FormLabel>
- <FormGroup>
- <CreateProjectPropertiesForm />
- <CreateProjectPropertiesList />
- </FormGroup>
-</span>;
-
-const GroupAddFields = () => <span>
- <ProjectNameField />
- <UsersField />
- <ProjectDescriptionField />
- <FormLabel>Properties</FormLabel>
- <FormGroup>
- <CreateProjectPropertiesForm />
- <CreateProjectPropertiesList />
- </FormGroup>
-</span>;
+const ProjectAddFields = withStyles(styles)(
+ ({ classes }: WithStyles<CssRules>) => <span>
+ <ResourceParentField />
+ <ProjectNameField />
+ <div className={classes.description}>
+ <ProjectDescriptionField />
+ </div>
+ <div className={classes.propertiesForm}>
+ <FormLabel>Properties</FormLabel>
+ <FormGroup>
+ <CreateProjectPropertiesForm />
+ <CreateProjectPropertiesList />
+ </FormGroup>
+ </div>
+ </span>);
+
+const GroupAddFields = withStyles(styles)(
+ ({ classes }: WithStyles<CssRules>) => <span>
+ <ProjectNameField />
+ <UsersField />
+ <div className={classes.description}>
+ <ProjectDescriptionField />
+ </div>
+ <div className={classes.propertiesForm}>
+ <FormLabel>Properties</FormLabel>
+ <FormGroup>
+ <CreateProjectPropertiesForm />
+ <CreateProjectPropertiesList />
+ </FormGroup>
+ </div>
+ </span>);
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 { 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<CollectionUpdateFormDialogData>;
export const DialogCollectionUpdate = (props: DialogCollectionProps) =>
<FormDialog
dialogTitle='Edit Collection'
- formFields={CollectionEditFields}
+ formFields={CollectionEditFields as any}
submitLabel='Save'
{...props}
/>;
const UpdateCollectionPropertiesList = resourcePropertiesList(COLLECTION_UPDATE_FORM_NAME);
-const CollectionEditFields = () => <span>
- <CollectionNameField />
- <CollectionDescriptionField />
- <FormLabel>Properties</FormLabel>
- <FormGroup>
- <UpdateCollectionPropertiesForm />
- <UpdateCollectionPropertiesList />
- </FormGroup>
- <CollectionStorageClassesField />
-</span>;
+const CollectionEditFields = withStyles(styles)(
+ ({ classes }: WithStyles<CssRules>) => <span>
+ <CollectionNameField />
+ <CollectionDescriptionField />
+ <div className={classes.propertiesForm}>
+ <FormLabel>Properties</FormLabel>
+ <FormGroup>
+ <UpdateCollectionPropertiesForm />
+ <UpdateCollectionPropertiesList />
+ </FormGroup>
+ </div>
+ <CollectionStorageClassesField />
+ </span>);
import { FormDialog } from 'components/form-dialog/form-dialog';
import { ProjectNameField, ProjectDescriptionField } from 'views-components/form-fields/project-form-fields';
import { GroupClass } from 'models/group';
-import { FormGroup, FormLabel } from '@material-ui/core';
+import { FormGroup, FormLabel, StyleRulesCallback, WithStyles, withStyles } from '@material-ui/core';
import { UpdateProjectPropertiesForm } from 'views-components/project-properties/update-project-properties-form';
import { resourcePropertiesList } from 'views-components/resource-properties/resource-properties-list';
+type CssRules = 'propertiesForm' | 'description';
+
+const styles: StyleRulesCallback<CssRules> = theme => ({
+ propertiesForm: {
+ marginTop: theme.spacing.unit * 2,
+ marginBottom: theme.spacing.unit * 2,
+ },
+ description: {
+ marginTop: theme.spacing.unit * 2,
+ marginBottom: theme.spacing.unit * 2,
+ },
+});
+
type DialogProjectProps = WithDialogProps<{sourcePanel: GroupClass}> & InjectedFormProps<ProjectUpdateFormDialogData>;
export const DialogProjectUpdate = (props: DialogProjectProps) => {
return <FormDialog
dialogTitle={title}
- formFields={ProjectEditFields}
+ formFields={ProjectEditFields as any}
submitLabel='Save'
{...props}
/>;
const UpdateProjectPropertiesList = resourcePropertiesList(PROJECT_UPDATE_FORM_NAME);
// Also used as "Group Edit Fields"
-const ProjectEditFields = () => <span>
- <ProjectNameField />
- <ProjectDescriptionField />
- <FormLabel>Properties</FormLabel>
- <FormGroup>
- <UpdateProjectPropertiesForm />
- <UpdateProjectPropertiesList />
- </FormGroup>
-</span>;
+const ProjectEditFields = withStyles(styles)(
+ ({ classes }: WithStyles<CssRules>) => <span>
+ <ProjectNameField />
+ <div className={classes.description}>
+ <ProjectDescriptionField />
+ </div>
+ <div className={classes.propertiesForm}>
+ <FormLabel>Properties</FormLabel>
+ <FormGroup>
+ <UpdateProjectPropertiesForm />
+ <UpdateProjectPropertiesList />
+ </FormGroup>
+ </div>
+ </span>);
({ spacing }) => (
{ container:
{
- paddingTop: spacing.unit,
margin: 0,
}
})
({ spacing }) => (
{ container:
{
- paddingTop: spacing.unit,
margin: 0,
}
})