Skip to content

Commit b8572fb

Browse files
committed
Merge branch 'master' into next
2 parents 31f2c0c + 1768f81 commit b8572fb

File tree

73 files changed

+1534
-535
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+1534
-535
lines changed

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
# Changelog
22

3+
## 5.8.4
4+
5+
* Replace `Datagrid` by `DataTable` in Guessers ([#10754](https://github.com/marmelab/react-admin/pull/10754)) ([erwanMarmelab](https://github.com/erwanMarmelab))
6+
* Fix `<DataTable>` crashes when its data is not a React primitive ([#10777](https://github.com/marmelab/react-admin/pull/10777)) ([djhi](https://github.com/djhi))
7+
* Fix(show/edit): Avoid a redirect loop when `useGetOne` returns an error in `shadcn-admin-kit` ([#10776](https://github.com/marmelab/react-admin/pull/10776)) ([jonathanarnault](https://github.com/jonathanarnault))
8+
* Fix disabled `<BooleanInput>` ([#10773](https://github.com/marmelab/react-admin/pull/10773)) ([Madeorsk](https://github.com/Madeorsk))
9+
* Fix: avoid an infinite loop when loading the demo apps for the first time ([#10769](https://github.com/marmelab/react-admin/pull/10769)) ([jonathanarnault](https://github.com/jonathanarnault))
10+
* Fix `<SaveButton>` is not enabled when the form is prefilled (from `<CloneButton>` for instance) ([#10765](https://github.com/marmelab/react-admin/pull/10765)) ([djhi](https://github.com/djhi))
11+
* [chore] Add spinner while installing dependencies in `create-react-admin` ([#10778](https://github.com/marmelab/react-admin/pull/10778)) ([djhi](https://github.com/djhi))
12+
* [Doc] Rename `convertRaMessagesToI18next` to `convertRaTranslationsToI18next` ([#10774](https://github.com/marmelab/react-admin/pull/10774)) ([Madeorsk](https://github.com/Madeorsk))
13+
* [Doc] Fix videos in `<DataTable>` docs ([#10775](https://github.com/marmelab/react-admin/pull/10775)) ([Madeorsk](https://github.com/Madeorsk))
14+
315
## 5.8.3
416

517
* Fix potential prototype-polluting assignment in `ra-data-local-storage` ([#10758](https://github.com/marmelab/react-admin/pull/10758)) ([fzaninotto](https://github.com/fzaninotto))

docs/Architecture.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -219,9 +219,9 @@ Although this drawback exists, we accept it because the use of composition in re
219219

220220
## Hooks
221221

222-
When you find that you cannot tweak a react-admin component using props, you can always turn to the lower-level API: hooks. In fact, react-admin is built on top of a headless library called `ra-core`, which primarily consists of hooks. These hooks hide the framework's implementation details, allowing you to focus on your business logic. It's perfectly normal to use react-admin hooks in your own components if the default UI doesn't meet your specific requirements.
222+
When you find that you cannot tweak a react-admin component using props, you can always turn to the lower-level API: hooks. In fact, the core of react-admin is a headless library called `ra-core`, which primarily consists of hooks. These hooks hide the framework's implementation details, allowing you to focus on your business logic. It's perfectly normal to use react-admin hooks in your own components if the default UI doesn't meet your specific requirements.
223223

224-
For example, the `<DeleteWithConfirmButton>` button renders a confirmation dialog when clicked and then calls the `dataProvider.delete()` method for the current record. If you want the same feature but with a different UI, you can use the `useDeleteWithConfirmController` hook:
224+
For example, the `<DeleteButton>` button used in `pessimistic` mode renders a confirmation dialog when clicked and then calls the `dataProvider.delete()` method for the current record. If you want the same feature but with a different UI, you can use the `useDeleteWithConfirmController` hook:
225225

226226
{% raw %}
227227
```jsx
@@ -269,7 +269,7 @@ The fact that hook names often end with `Controller` is intentional and reflects
269269
- The view logic is managed by React components (e.g. `<List>`).
270270
- The model logic is left to the developer, and react-admin simply defines the interface that the model must expose through its Providers.
271271

272-
React-admin exposes [dozens of hooks](./Reference.md#hooks) to assist you in building your own components. You can even construct an entire react-admin application without relying on the Material UI components and use a different UI kit if desired. This flexibility allows you to tailor the application to your specific needs and preferences.
272+
React-admin exposes [dozens of hooks](./Reference.md#hooks) to assist you in building your own components. You can even construct an entire react-admin application without relying on the Material UI components and use a different UI kit if desired (see for instance [shadcn-admin-kit](https://github.com/marmelab/shadcn-admin-kit), a library for building admin apps with Shadcn UI). This flexibility allows you to tailor the application to your specific needs and preferences.
273273

274274
## Context: Pull, Don't Push
275275

docs/DataTable.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ React-admin provides four bulk action buttons that you can use in data tables:
203203
**Tip**: Users can select a range of rows by pressing the shift key while clicking a row checkbox.
204204

205205
<video controls autoplay playsinline muted loop>
206-
<source src="./img/Datagrid-select-range.mp4" type="video/mp4"/>
206+
<source src="./img/datagrid-select-range.mp4" type="video/mp4"/>
207207
Your browser does not support the video tag.
208208
</video>
209209

@@ -525,7 +525,7 @@ const BookList = () => (
525525
## `expand`
526526

527527
<video controls autoplay playsinline muted loop>
528-
<source src="./img/Datagrid_expand.mp4" type="video/mp4"/>
528+
<source src="./img/datagrid_expand.mp4" type="video/mp4"/>
529529
Your browser does not support the video tag.
530530
</video>
531531

@@ -1269,7 +1269,7 @@ Refer to the [`<NumberField>`](./NumberField.md) documentation for more details.
12691269
`<DataTable>` has sticky headers, which means that the header row will remain visible even when scrolling down the page.
12701270

12711271
<video controls autoplay playsinline muted loop>
1272-
<source src="./img/Datagrid-headers-pinning.mp4" type="video/mp4"/>
1272+
<source src="./img/datagrid-headers-pinning.mp4" type="video/mp4"/>
12731273
Your browser does not support the video tag.
12741274
</video>
12751275

docs/Features.md

Lines changed: 35 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -273,11 +273,43 @@ And for mobile users, react-admin renders a different layout with larger margins
273273

274274
## Headless Core
275275

276-
React-admin components use Material UI components by default, which lets you scaffold a page in no time. As material UI supports [theming](#theming), you can easily customize the look and feel of your app. But in some cases, this is not enough, and you need to use another UI library.
276+
React-admin components use Material UI components by default, which lets you scaffold a page in no time. As Material UI supports [theming](#theming), you can easily customize the look and feel of your app. But in some cases, this is not enough, and you need to use another UI library.
277277

278278
You can change the UI library you use with react-admin to use [Ant Design](https://ant.design/), [Daisy UI](https://daisyui.com/), [Chakra UI](https://chakra-ui.com/), or even you own custom UI library. The **headless logic** behind react-admin components is agnostic of the UI library, and is exposed via `...Base` components and controller hooks.
279279

280-
For instance, here a List view built with [Ant Design](https://ant.design/):
280+
For instance, [`shadcn-admin-kit`](https://github.com/marmelab/shadcn-admin-kit) is a react-admin distribution that replaces Material UI with [Shadcn UI](https://ui.shadcn.com/).
281+
282+
[![Shadcn admin kit](https://github.com/marmelab/shadcn-admin-kit/raw/main/public/shadcn-admin-kit.webp)](https://github.com/marmelab/shadcn-admin-kit)
283+
284+
`shadcn-admin-kit` follows the same syntax conventions as react-admin, so most of the react-admin documentation still applies. For example, the `<ProductEdit>` component looks like this:
285+
286+
```tsx
287+
import {
288+
AutocompleteInput,
289+
Edit,
290+
ReferenceInput,
291+
SimpleForm,
292+
TextInput,
293+
} from "@/components/admin";
294+
import { required } from "ra-core";
295+
296+
export const ProductEdit = () => (
297+
<Edit>
298+
<SimpleForm>
299+
<TextInput source="reference" label="Reference" validate={required()} />
300+
<ReferenceInput source="category_id" reference="categories">
301+
<AutocompleteInput label="Category" validate={required()} />
302+
</ReferenceInput>
303+
<TextInput source="width" type="number" />
304+
<TextInput source="height" type="number" />
305+
<TextInput source="price" type="number" />
306+
<TextInput source="stock" label="Stock" type="number" />
307+
</SimpleForm>
308+
</Edit>
309+
);
310+
```
311+
312+
Here is another example: a List view built with [Ant Design](https://ant.design/):
281313

282314
![List view built with Ant Design](./img/list_ant_design.png)
283315

@@ -360,10 +392,7 @@ Check the following hooks to learn more about headless controllers:
360392
- [`useCreateController`](./useCreateController.md)
361393
- [`useShowController`](./useShowController.md)
362394

363-
And check these examples for admin panels built with react-admin but without Material UI:
364-
365-
- [DaisyUI, Tailwind CSS, Tanstack Table and React-Aria](https://marmelab.com/blog/2023/11/28/using-react-admin-with-your-favorite-ui-library.html)
366-
- [shadcn/ui, Tailwind CSS and Radix UI](https://github.com/marmelab/ra-shadcn-demo)
395+
And for a more in-depth tutorial about using react-admin with your favorite UI library, check the following article: [Building an admin with DaisyUI, Tailwind CSS, Tanstack Table and React-Aria](https://marmelab.com/blog/2023/11/28/using-react-admin-with-your-favorite-ui-library.html).
367396

368397
## Guessers & Scaffolding
369398

0 commit comments

Comments
 (0)