Skip to content

Commit a5e00b8

Browse files
slax57alanpoulain
andauthored
Apply suggestions from code review
Co-authored-by: Alan Poulain <[email protected]>
1 parent 427153f commit a5e00b8

File tree

5 files changed

+14
-14
lines changed

5 files changed

+14
-14
lines changed

Diff for: admin/advanced-customization.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ With these simple changes we already get a more appealing form layout:
296296

297297
Speaking of tabbed layout, a common pattern is to display related records in a dedicated tab of the show view of the main record.
298298

299-
For instance, let's leverage the [`<TabbedShowLayout>`](https://marmelab.com/react-admin/TabbedShowLayout.html) component provided by `react-admin` to display the reviews of a book in a dedicated tab.
299+
For instance, let's leverage the [`<TabbedShowLayout>`](https://marmelab.com/react-admin/TabbedShowLayout.html) component provided by React Admin to display the reviews of a book in a dedicated tab.
300300

301301
We will also leverage `<ReferenceArrayField>` to fetch the related reviews of a book, and `<SimpleList>` to display them in a list.
302302

@@ -451,4 +451,4 @@ Here are some examples, from the simplest to the most complete solutions:
451451
- [SolarLayout](https://marmelab.com/react-admin/SolarLayout.html)
452452
- And many more...
453453

454-
React Admin already includes 230+ hooks and components. And it always allow you to make your own, thanks to the building blocks it provides. Feel free to read through its [All Features](https://marmelab.com/react-admin/Features.html) documentation page to discover them all.
454+
React Admin already includes 230+ hooks and components. And it always allows you to make your own, thanks to the building blocks it provides. Feel free to read through its [All Features](https://marmelab.com/react-admin/Features.html) documentation page to discover them all.

Diff for: admin/customizing.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -90,13 +90,13 @@ Here is the result:
9090

9191
By default, `<ResourceGuesser>` will render a `<ListGuesser>` component as the list view for a resource.
9292

93-
Again, this component will automatically introspect the API schema and generate a list view with all the fields of the resource.
93+
This component will automatically introspect the API schema and generate a list view with all the fields of the resource.
9494

9595
![Admin default generated list view](./images/admin-default-list.png)
9696

9797
This is already usable, but may not provide the best user experience yet.
9898

99-
Here, too, to start customizing the list view, you can look at the DevTools console. You will see messages like this:
99+
To start customizing the list view, you can look at the DevTools console. You will see messages like this:
100100

101101
```txt
102102
If you want to override at least one field, create a BookList component with this content:
@@ -182,7 +182,7 @@ And here is the result:
182182

183183
## Customizing the `<ShowGuesser>`
184184

185-
Following the same principles (including looking at the DevTools console) we can customize the show view.
185+
Following the same principles as the `<ListGuesser>` (including looking at the DevTools console) we can customize the show view.
186186

187187
In the following example, the show view for the `books` resource was customized to make the label of the `isbn` field uppercase:
188188

@@ -241,7 +241,7 @@ const ReviewShow = () => (
241241

242242
Customizing the `<EditGuesser>` and `<CreateGuesser>` is very similar to customizing the `<ShowGuesser>`.
243243

244-
Again, we can start by looking at the DevTools console to get the initial code of the components.
244+
We can start by looking at the DevTools console to get the initial code of the components.
245245

246246
```txt
247247
If you want to override at least one input, create a ReviewEdit component with this content:
@@ -299,7 +299,7 @@ Here is the result:
299299

300300
![Admin with customized edit guesser](./images/admin-custom-edit-guesser.png)
301301

302-
**Tip:** Here, we leveraged the `multiline` and `readOnly` props of the `<InputGuesser>` component. But you can use any [common input prop](https://marmelab.com/react-admin/Inputs.html#common-input-props) supported by react-admin [Inputs](https://marmelab.com/react-admin/Inputs.html) on them.
302+
**Tip:** Here, we leveraged the `multiline` and `readOnly` props of the `<InputGuesser>` component. But you can use any [common input prop](https://marmelab.com/react-admin/Inputs.html#common-input-props) supported by React Admin [Inputs](https://marmelab.com/react-admin/Inputs.html) on them.
303303

304304
## From `<InputGuesser>` To React Admin Inputs
305305

@@ -336,7 +336,7 @@ const ReviewsEdit = () => (
336336
337337
## Next Step
338338

339-
The above examples limit to customizing the various API Platform Admin Guessers, but this is just the tip of the iceberg.
339+
The above examples are limited to customizing the various API Platform Admin Guessers, but this is just the tip of the iceberg.
340340

341341
By leveraging React Admin components and props, you can go much further in customizing the generated pages.
342342

Diff for: admin/index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ API Platform Admin is a Single Page Application (SPA), based on [React Admin](ht
2323

2424
Thanks to its built-in **guessers**, API Platform Admin parses the API documentation then uses React Admin to expose a nice, responsive management interface (Create-Retrieve-Update-Delete, i.e. CRUD) for all documented resource types.
2525

26-
Afterwards, you can **customize everything** by using the numerous components provided [React Admin](https://marmelab.com/react-admin/documentation.html) and [MUI](https://mui.com/), or even writing your own [React](https://reactjs.org/) components.
26+
Afterwards, you can **customize everything** by using the numerous components provided by [React Admin](https://marmelab.com/react-admin/documentation.html) and [MUI](https://mui.com/), or even writing your own [React](https://reactjs.org/) components.
2727

2828
<iframe src="https://www.youtube-nocookie.com/embed/UyAkN85wGNk" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen style="aspect-ratio: 16 / 9;width:100%;margin-bottom:1em;"></iframe>
2929

Diff for: admin/performance.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ the admin will fetch the relations one by one.
99

1010
In this case, it can be improved by doing only one request for all the related resources instead.
1111

12-
To do so, you need to make sure the [search filter](../core/filters.md#apifilter-attribute) is enabled for the identifier of the related resource.
12+
To do so, you need to make sure the [search filter](../core/doctrine-filters.md#search-filter) is enabled for the identifier of the related resource.
1313

1414
For instance, if you have a `book` resource having a relation to `author` resources and you display the author names on your book list,
1515
you can make sure the authors are retrieved in one go by writing:

Diff for: admin/schema-org.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ Lastly, API Platform Admin has native support for the popular [Schema.org](./sch
88

99
## Adding Filtering Capabilities
1010

11-
You can add the [`ApiFilter` attribute](../core/filters.md#apifilter-attribute) to an Entity to configure a filter on a property.
11+
You can add the [`ApiFilter` attribute](../core/filters.md#apifilter-attribute) to an API Platform resource to configure a filter on a property.
1212

13-
For instance, here is how configure filtering on the `id`, `title` and `author` properties of a `Book` entity:
13+
For instance, here is how configure filtering on the `id`, `title` and `author` properties of a `Book` resource:
1414

1515
```php
1616
<?php
@@ -43,9 +43,9 @@ If you are using the guessers, the Admin will automatically update the Book list
4343

4444
## Adding Sorting Capabilities
4545

46-
You can also use the [`ApiFilter` attribute](../core/filters.md#apifilter-attribute) on an Entity to configure sorting.
46+
You can also use the [`ApiFilter` attribute](../core/filters.md#apifilter-attribute) on an API Plaform resource to configure sorting.
4747

48-
For instance, here is how to configure sorting on the `id`, `isbn`, `title`, `author` and `publicationDate` properties of a `Book` entity:
48+
For instance, here is how to configure sorting on the `id`, `isbn`, `title`, `author` and `publicationDate` properties of a `Book` resource:
4949

5050
```php
5151
<?php

0 commit comments

Comments
 (0)