-export const DialogProjectCreate = (props: DialogProjectProps) =>
- <FormDialog
- dialogTitle='New project'
- formFields={ProjectAddFields}
- submitLabel='Create a Project'
+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) => {
+ let title = 'New Project';
+ let fields = ProjectAddFields;
+ const sourcePanel = props.data.sourcePanel || '';
+
+ if (sourcePanel === GroupClass.ROLE) {
+ title = 'New Group';
+ fields = GroupAddFields;
+ }
+
+ return <FormDialog
+ dialogTitle={title}
+ formFields={fields as any}
+ submitLabel='Create'