Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions admin/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ in the `admin/src/Component/User` directory:
// admin/src/Component/User/Create.js

import React from 'react';
import { Create, SimpleForm, TextInput, email, required } from 'react-admin';
import { Create, SimpleForm, TextInput, email, required, ArrayInput, SimpleFormIterator } from 'react-admin';

export const UserCreate = (props) => (
<Create { ...props }>
Expand All @@ -330,6 +330,11 @@ export const UserCreate = (props) => (
<TextInput source="plainPassword" label="Password" validate={ required() } />
<TextInput source="name" label="Name"/>
<TextInput source="phone" label="Phone"/>
<ArrayInput source="roles" label="Roles">
<SimpleFormIterator>
<TextInput />
</SimpleFormIterator>
</ArrayInput>
</SimpleForm>
</Create>
);
Expand All @@ -340,7 +345,7 @@ export const UserCreate = (props) => (
// admin/src/Component/User/Edit.js

import React from 'react';
import { Edit, SimpleForm, DisabledInput, TextInput, DateInput, email } from 'react-admin';
import { Edit, SimpleForm, DisabledInput, TextInput, email, ArrayInput, SimpleFormIterator, DateInput } from 'react-admin';

export const UserEdit = (props) => (
<Edit {...props}>
Expand All @@ -349,6 +354,11 @@ export const UserEdit = (props) => (
<TextInput source="email" label="Email" validate={ email() } />
<TextInput source="name" label="Name"/>
<TextInput source="phone" label="Phone"/>
<ArrayInput source="roles" label="Roles">
<SimpleFormIterator>
<TextInput />
</SimpleFormIterator>
</ArrayInput>
<DateInput disabled source="createdAt" label="Date"/>
</SimpleForm>
</Edit>
Expand Down