X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/c4106363643160b30bb924b72f5b6ad95e4ba2ae..c952afae1af2fb31b68be04f70bd7ae6f9d52aba:/src/views-components/dialog-create/dialog-project-create.tsx diff --git a/src/views-components/dialog-create/dialog-project-create.tsx b/src/views-components/dialog-create/dialog-project-create.tsx index 481957d1..d85a304e 100644 --- a/src/views-components/dialog-create/dialog-project-create.tsx +++ b/src/views-components/dialog-create/dialog-project-create.tsx @@ -2,28 +2,81 @@ // // 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 { ProjectCreateFormDialogData } from '~/store/projects/project-create-actions'; -import { FormDialog } from '~/components/form-dialog/form-dialog'; -import { ProjectNameField, ProjectDescriptionField } from '~/views-components/form-fields/project-form-fields'; -import { CreateProjectPropertiesForm } from '~/views-components/project-properties/create-project-properties-form'; -import { CreateProjectPropertiesList } from '~/views-components/project-properties/create-project-properties-list'; - -type DialogProjectProps = WithDialogProps<{}> & InjectedFormProps; - -export const DialogProjectCreate = (props: DialogProjectProps) => - = 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) => { + let title = 'New Project'; + let fields = ProjectAddFields; + const sourcePanel = props.data.sourcePanel || ''; + + if (sourcePanel === GroupClass.ROLE) { + title = 'New Group'; + fields = GroupAddFields; + } + + return ; +}; + +const CreateProjectPropertiesList = resourcePropertiesList(PROJECT_CREATE_FORM_NAME); + +const ProjectAddFields = withStyles(styles)( + ({ classes }: WithStyles) => + + +
+ +
+
+ Properties + + + + +
+
); -const ProjectAddFields = (props: any) => - - - - -; +const GroupAddFields = withStyles(styles)( + ({ classes }: WithStyles) => + + +
+ +
+
+ Properties + + + + +
+
);