2020-01-19 17:39:37 -09:00
|
|
|
import React from 'react'
|
|
|
|
|
import {
|
|
|
|
|
BooleanInput,
|
|
|
|
|
Create,
|
|
|
|
|
TextInput,
|
|
|
|
|
PasswordInput,
|
|
|
|
|
required,
|
2020-01-20 05:54:29 -09:00
|
|
|
email,
|
2020-01-19 17:39:37 -09:00
|
|
|
SimpleForm,
|
2020-04-27 19:22:17 -08:00
|
|
|
useTranslate,
|
2020-01-19 17:39:37 -09:00
|
|
|
} from 'react-admin'
|
2020-01-22 06:19:13 -09:00
|
|
|
import { Title } from '../common'
|
2020-01-19 17:39:37 -09:00
|
|
|
|
2020-04-27 19:22:17 -08:00
|
|
|
const UserCreate = (props) => {
|
|
|
|
|
const translate = useTranslate()
|
|
|
|
|
const resourceName = translate('resources.user.name', { smart_count: 1 })
|
|
|
|
|
const title = translate('ra.page.create', {
|
|
|
|
|
name: `${resourceName}`,
|
|
|
|
|
})
|
|
|
|
|
return (
|
|
|
|
|
<Create title={<Title subTitle={title} />} {...props}>
|
2020-08-17 07:19:39 -08:00
|
|
|
<SimpleForm redirect="list" variant={'outlined'}>
|
2020-04-27 19:22:17 -08:00
|
|
|
<TextInput source="userName" validate={[required()]} />
|
|
|
|
|
<TextInput source="name" validate={[required()]} />
|
2020-08-19 07:46:13 -08:00
|
|
|
<TextInput source="email" validate={[email()]} />
|
2020-04-27 19:22:17 -08:00
|
|
|
<PasswordInput source="password" validate={[required()]} />
|
|
|
|
|
<BooleanInput source="isAdmin" defaultValue={false} />
|
|
|
|
|
</SimpleForm>
|
|
|
|
|
</Create>
|
|
|
|
|
)
|
|
|
|
|
}
|
2020-01-19 17:39:37 -09:00
|
|
|
|
|
|
|
|
export default UserCreate
|