From: Lucas Di Pentima Date: Tue, 4 Jan 2022 14:56:02 +0000 (-0300) Subject: 18219: Improves edit & create dialogs adding some separation between fields. X-Git-Tag: 2.4.0~21^2~1 X-Git-Url: https://git.arvados.org/arvados-workbench2.git/commitdiff_plain/5a5f30dbbfa1df4fd3dfade4cb5deab2a4ded56c 18219: Improves edit & create dialogs adding some separation between fields. Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima --- diff --git a/src/views-components/collection-properties/create-collection-properties-form.tsx b/src/views-components/collection-properties/create-collection-properties-form.tsx index ab389ddc..3f19e158 100644 --- a/src/views-components/collection-properties/create-collection-properties-form.tsx +++ b/src/views-components/collection-properties/create-collection-properties-form.tsx @@ -18,7 +18,6 @@ const Form = withStyles( ({ spacing }) => ( { container: { - paddingTop: spacing.unit, margin: 0, } }) diff --git a/src/views-components/collection-properties/update-collection-properties-form.tsx b/src/views-components/collection-properties/update-collection-properties-form.tsx index 940e318c..9092c7cc 100644 --- a/src/views-components/collection-properties/update-collection-properties-form.tsx +++ b/src/views-components/collection-properties/update-collection-properties-form.tsx @@ -18,7 +18,6 @@ const Form = withStyles( ({ spacing }) => ( { container: { - paddingTop: spacing.unit, margin: 0, } }) diff --git a/src/views-components/dialog-create/dialog-collection-create.tsx b/src/views-components/dialog-create/dialog-collection-create.tsx index 163eb983..17a24e48 100644 --- a/src/views-components/dialog-create/dialog-collection-create.tsx +++ b/src/views-components/dialog-create/dialog-collection-create.tsx @@ -15,34 +15,46 @@ import { 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 = theme => ({ + propertiesForm: { + marginTop: theme.spacing.unit * 2, + marginBottom: theme.spacing.unit * 2, + }, +}); + type DialogCollectionProps = WithDialogProps<{}> & InjectedFormProps; export const DialogCollectionCreate = (props: DialogCollectionProps) => ; const CreateCollectionPropertiesList = resourcePropertiesList(COLLECTION_CREATE_FORM_NAME); -const CollectionAddFields = () => - - - - Properties - - - - - - -; +const CollectionAddFields = withStyles(styles)( + ({ classes }: WithStyles) => + + + +
+ Properties + + + + +
+ + +
); diff --git a/src/views-components/dialog-create/dialog-project-create.tsx b/src/views-components/dialog-create/dialog-project-create.tsx index 65da87d3..d85a304e 100644 --- a/src/views-components/dialog-create/dialog-project-create.tsx +++ b/src/views-components/dialog-create/dialog-project-create.tsx @@ -10,10 +10,23 @@ import { FormDialog } from 'components/form-dialog/form-dialog'; 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 = 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; export const DialogProjectCreate = (props: DialogProjectProps) => { @@ -28,7 +41,7 @@ export const DialogProjectCreate = (props: DialogProjectProps) => { return ; @@ -36,24 +49,34 @@ export const DialogProjectCreate = (props: DialogProjectProps) => { const CreateProjectPropertiesList = resourcePropertiesList(PROJECT_CREATE_FORM_NAME); -const ProjectAddFields = () => - - - - Properties - - - - -; - -const GroupAddFields = () => - - - - Properties - - - - -; +const ProjectAddFields = withStyles(styles)( + ({ classes }: WithStyles) => + + +
+ +
+
+ Properties + + + + +
+
); + +const GroupAddFields = withStyles(styles)( + ({ classes }: WithStyles) => + + +
+ +
+
+ Properties + + + + +
+
); diff --git a/src/views-components/dialog-update/dialog-collection-update.tsx b/src/views-components/dialog-update/dialog-collection-update.tsx index 852dab1a..d77d10ff 100644 --- a/src/views-components/dialog-update/dialog-collection-update.tsx +++ b/src/views-components/dialog-update/dialog-collection-update.tsx @@ -13,28 +13,40 @@ import { 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 = theme => ({ + propertiesForm: { + marginTop: theme.spacing.unit * 2, + marginBottom: theme.spacing.unit * 2, + }, +}); + type DialogCollectionProps = WithDialogProps<{}> & InjectedFormProps; export const DialogCollectionUpdate = (props: DialogCollectionProps) => ; const UpdateCollectionPropertiesList = resourcePropertiesList(COLLECTION_UPDATE_FORM_NAME); -const CollectionEditFields = () => - - - Properties - - - - - -; +const CollectionEditFields = withStyles(styles)( + ({ classes }: WithStyles) => + + +
+ Properties + + + + +
+ +
); diff --git a/src/views-components/dialog-update/dialog-project-update.tsx b/src/views-components/dialog-update/dialog-project-update.tsx index bad01815..a6ac65b1 100644 --- a/src/views-components/dialog-update/dialog-project-update.tsx +++ b/src/views-components/dialog-update/dialog-project-update.tsx @@ -9,10 +9,23 @@ import { ProjectUpdateFormDialogData, PROJECT_UPDATE_FORM_NAME } from 'store/pro 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 = 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; export const DialogProjectUpdate = (props: DialogProjectProps) => { @@ -25,7 +38,7 @@ export const DialogProjectUpdate = (props: DialogProjectProps) => { return ; @@ -34,12 +47,17 @@ export const DialogProjectUpdate = (props: DialogProjectProps) => { const UpdateProjectPropertiesList = resourcePropertiesList(PROJECT_UPDATE_FORM_NAME); // Also used as "Group Edit Fields" -const ProjectEditFields = () => - - - Properties - - - - -; +const ProjectEditFields = withStyles(styles)( + ({ classes }: WithStyles) => + +
+ +
+
+ Properties + + + + +
+
); diff --git a/src/views-components/project-properties/create-project-properties-form.tsx b/src/views-components/project-properties/create-project-properties-form.tsx index aa9965b5..8c26523e 100644 --- a/src/views-components/project-properties/create-project-properties-form.tsx +++ b/src/views-components/project-properties/create-project-properties-form.tsx @@ -18,7 +18,6 @@ const Form = withStyles( ({ spacing }) => ( { container: { - paddingTop: spacing.unit, margin: 0, } }) diff --git a/src/views-components/project-properties/update-project-properties-form.tsx b/src/views-components/project-properties/update-project-properties-form.tsx index e6151229..0b5554bc 100644 --- a/src/views-components/project-properties/update-project-properties-form.tsx +++ b/src/views-components/project-properties/update-project-properties-form.tsx @@ -18,7 +18,6 @@ const Form = withStyles( ({ spacing }) => ( { container: { - paddingTop: spacing.unit, margin: 0, } })