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/getting-started.md
+11-12Lines changed: 11 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -67,12 +67,12 @@ The API Platform's admin parses the Hydra documentation exposed by the API and t
67
67
### Using Custom Components
68
68
69
69
In the following example, we change components used for the `description` property of the `books` resource to ones accepting HTML (respectively `RichTextField` that renders HTML markup and `RichTextInput`, a WYSWYG editor).
70
-
(To use the `RichTextInput`, the `aor-rich-text-input` package is must be installed: `yarn add aor-rich-text-input`).
70
+
(To use the `RichTextInput`, the `ra-input-rich-text` package is must be installed: `yarn add ra-input-rich-text`).
71
71
72
72
```javascript
73
73
import React from 'react';
74
-
import { RichTextField } from 'admin-on-rest';
75
-
import RichTextInput from 'aor-rich-text-input';
74
+
import { RichTextField } from 'react-admin';
75
+
import RichTextInput from 'ra-input-rich-text';
76
76
import { HydraAdmin } from '@api-platform/admin';
77
77
import parseHydraDocumentation from '@api-platform/api-doc-parser/lib/hydra/parseHydraDocumentation';
The `field` property of the `Field` class allows to set the component used to render a property in list and show screens.
103
103
The `input` property allows to set the component to use to render the input used in create and edit screens.
104
104
105
-
Any [field](https://marmelab.com/admin-on-rest/Fields.html) or [input](https://marmelab.com/admin-on-rest/Inputs.html) provided by the Admin On Rest library can be used.
105
+
Any [field](https://marmelab.com/react-admin/Fields.html) or [input](https://marmelab.com/react-admin/Inputs.html) provided by the React Admin library can be used.
106
106
107
-
To go further, take a look to the "[Including admin-on-rest on another React app](https://marmelab.com/admin-on-rest/CustomApp.html)" documentation page of Admin On Rest to learn how to use directly redux, react-router, and redux-saga along with components provided by this library.
107
+
To go further, take a look to the "[Including react-admin on another React app](https://marmelab.com/react-admin/CustomApp.html)" documentation page of React Admin to learn how to use directly redux, react-router, and redux-saga along with components provided by this library.
108
108
109
109
### Managing Files and Images
110
110
111
111
In the following example, we will:
112
-
* find every [ImageObject](http://schema.org/ImageObject) resources. For each [contentUrl](http://schema.org/contentUrl) fields, we will use [ImageField](https://marmelab.com/admin-on-rest/Fields.html#imagefield) as `field` and [ImageInput](https://marmelab.com/admin-on-rest/Inputs.html#imageinput) as `input`.
113
-
* [ImageInput](https://marmelab.com/admin-on-rest/Inputs.html#imageinput) will return a [File](https://developer.mozilla.org/en/docs/Web/API/File) instance. In this example, we will send a multi-part form data to a special action (`https://demo.api-platform.com/images/upload`). The action will return the ID of the uploaded image. We will "replace" the [File](https://developer.mozilla.org/en/docs/Web/API/File) instance by the ID in `normalizeData`.
114
-
* As `contentUrl` fields will return a string, we have to convert Hydra data to AOR data. This action will be done by `denormalizeData`.
112
+
* find every [ImageObject](http://schema.org/ImageObject) resources. For each [contentUrl](http://schema.org/contentUrl) fields, we will use [ImageField](https://marmelab.com/react-admin/Fields.html#imagefield) as `field` and [ImageInput](https://marmelab.com/react-admin/Inputs.html#imageinput) as `input`.
113
+
* [ImageInput](https://marmelab.com/react-admin/Inputs.html#imageinput) will return a [File](https://developer.mozilla.org/en/docs/Web/API/File) instance. In this example, we will send a multi-part form data to a special action (`https://demo.api-platform.com/images/upload`). The action will return the ID of the uploaded image. We will "replace" the [File](https://developer.mozilla.org/en/docs/Web/API/File) instance by the ID in `normalizeData`.
114
+
* As `contentUrl` fields will return a string, we have to convert Hydra data to React Admin data. This action will be done by `denormalizeData`.
115
115
116
116
```javascript
117
-
import { FunctionField, ImageField, ImageInput } from 'admin-on-rest/lib/mui';
118
117
import React from 'react';
119
-
import { RichTextField } from 'admin-on-rest';
120
-
import RichTextInput from 'aor-rich-text-input';
118
+
import { FunctionField, ImageField, ImageInput, RichTextField } from 'react-admin';
119
+
import RichTextInput from 'ra-input-rich-text';
121
120
import { HydraAdmin } from '@api-platform/admin';
122
121
import parseHydraDocumentation from '@api-platform/api-doc-parser/lib/hydra/parseHydraDocumentation';
123
122
@@ -225,7 +224,7 @@ export default class extends Component {
225
224
render() {
226
225
if (null===this.state.api) return<div>Loading...</div>;
0 commit comments