You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: admin/components.md
-7Lines changed: 0 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -252,13 +252,6 @@ Analyses your resources and retrieves their types according to the [Schema.org](
252
252
253
253
## Other Components
254
254
255
-
### Pagination
256
-
257
-
Set by default in the [ListGuesser component](components.md#listguesser), the `Pagination` component uses React Admin [Pagination component](https://marmelab.com/react-admin/List.html#pagination).
258
-
By default, it renders 30 items per page and displays a navigation UI.
259
-
If you want to change the number of items per page or disable the pagination, see the [Pagination documentation](../core/pagination.md).
260
-
It is also capable to handle partial pagination.
261
-
262
255
### FieldGuesser
263
256
264
257
Renders fields according to their types, using the [schema analyzer](components.md#schemaanalyzer).
Copy file name to clipboardExpand all lines: admin/handling-relations.md
+60-55Lines changed: 60 additions & 55 deletions
Original file line number
Diff line number
Diff line change
@@ -6,12 +6,14 @@ Thanks to [the Schema.org support](schema.org.md), you can easily display the na
6
6
7
7
## Embedded Relations
8
8
9
-
If a relation is an array of [embeddeds or an embedded](../core/serialization.md#embedding-relations) resource,
10
-
by default, the admin automatically replaces the embedded resources' data by their IRI.
11
-
However, the embedded data is inserted to a local cache: it will not be necessary to make more requests if you reference some fields of the embedded resource later on.
9
+
If a relation is an array of [embeddeds or an embedded](../core/serialization.md#embedding-relations) resource, the admin will keep them by default.
12
10
13
-
If you need to edit the embedded data or if you want to display some of the nested fields by using the dot notation for complex structures,
14
-
you can keep the embedded data by setting the `useEmbedded` parameter of the Hydra data provider to `true`.
11
+
The embedded data will be displayed as text field and editable as text input: the admin cannot determine the fields present in it.
12
+
To display the fields you want, see [this section](handling-relations.md#display-a-field-of-an-embedded-relation).
13
+
14
+
You can also ask the admin to automatically replace the embedded resources' data by their IRI,
15
+
by setting the `useEmbedded` parameter of the Hydra data provider to `false`.
16
+
Embedded data is inserted to a local cache: it will not be necessary to make more requests if you reference some fields of the embedded resource later on.
The embedded data will be displayed as text field and editable as text input: the admin cannot determine the fields present in it.
41
-
To display the fields you want, see [this section](handling-relations.md#display-a-field-of-an-embedded-relation).
42
-
43
-
This behavior will be the default one in 3.0.
44
-
45
42
## Display a Field of an Embedded Relation
46
43
47
44
If you have an [embedded relation](../core/serialization.md#embedding-relations) and need to display a nested field, the code you need to write depends of the value of `useEmbedded` of the Hydra data provider.
48
45
49
-
If `false` (default behavior), make sure you write the code as if the relation needs to be fetched as a reference.
46
+
If `true` (default behavior), you need to use the dot notation to display a field:
47
+
48
+
```javascript
49
+
import {
50
+
HydraAdmin,
51
+
FieldGuesser,
52
+
ListGuesser,
53
+
ResourceGuesser
54
+
} from"@api-platform/admin";
55
+
import { TextField } from"react-admin";
56
+
57
+
constBooksList= (props) => (
58
+
<ListGuesser {...props}>
59
+
<FieldGuesser source="title"/>
60
+
{/* Use react-admin components directly when you want complex fields. */}
61
+
<TextField label="Author first name" source="author.firstName"/>
Let's go one step further thanks to the [customization capabilities](customizing.md) of API Platform Admin by adding autocompletion support to form inputs for relations.
Copy file name to clipboardExpand all lines: admin/index.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,7 @@ according to the API-first paradigm.
14
14
API Platform Admin parses the API documentation then uses the awesome [React Admin](https://marmelab.com/react-admin/)
15
15
library to expose a nice, responsive, management interface (Create-Retrieve-Update-Delete) for all documented resource types.
16
16
17
-
You can **customize everything** by using provided React Admin and [Material UI](https://material-ui.com/) components, or by writing your custom [React](https://reactjs.org/) components.
17
+
You can **customize everything** by using provided React Admin and [MUI](https://mui.com/) components, or by writing your custom [React](https://reactjs.org/) components.
0 commit comments