Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
109 commits
Select commit Hold shift + click to select a range
d2ca7ad
Allow resource specific translations for pages and `<CreateButton>`
djhi Apr 21, 2025
cbd6210
Update docs/Buttons.md
djhi Apr 21, 2025
0553e8d
Support resource specific translations in EditButton
djhi Apr 30, 2025
2e5ce15
Support resource specific translations in ShowButton
djhi Apr 30, 2025
997e3b5
Update documentation
djhi Apr 30, 2025
a0fe4ec
Support resource specific translations in DeleteButton
djhi Apr 30, 2025
e85023e
Improve CreateButton stories
djhi Apr 30, 2025
81f3266
Support resource specific translations in ListButton
djhi Apr 30, 2025
cce833d
Add RecordField component
fzaninotto May 16, 2025
5a0eca3
Fix build
fzaninotto May 17, 2025
359493d
Add unit tests
fzaninotto May 20, 2025
44b7cbf
rename emptyText to empty, remove defaultValue
fzaninotto May 20, 2025
43e20fb
Make default props themeable
fzaninotto May 20, 2025
96993c6
Add support for record prop
fzaninotto May 20, 2025
e21fa84
Update docs/RecordField.md
fzaninotto May 26, 2025
44ea740
Update packages/ra-ui-materialui/src/field/RecordField.tsx
fzaninotto May 26, 2025
9c87f76
Review
fzaninotto May 26, 2025
33aef90
Merge pull request #10749 from marmelab/recordfield
slax57 May 27, 2025
862d9cb
Merge branch 'next' into resource-specific-translations
djhi May 28, 2025
895d614
Avoid double translation in buttons
djhi May 28, 2025
dad7916
Introduce useResourceTranslation
djhi May 28, 2025
31f2c0c
Merge branch 'master' into next
djhi May 28, 2025
6251bda
Improve DeleteWithConfirmButton resource name
djhi May 28, 2025
c83a5c3
WIP
erwanMarmelab Jun 5, 2025
579926b
replace Datagrid by DataTable in doc - part 2
erwanMarmelab Jun 6, 2025
c1e45ad
replace Datagrid by DataTable in doc - part 3
erwanMarmelab Jun 6, 2025
1b8b5ee
Customizable email field and add basic story to test it.
Madeorsk Jun 6, 2025
0beabe6
Customizable date field and add basic story to test it.
Madeorsk Jun 6, 2025
91255d9
Customizable number field and add basic story to test it.
Madeorsk Jun 6, 2025
a1ee185
Customizable rich text field and improve stories to test it.
Madeorsk Jun 6, 2025
3a4240d
Customizable select field and improve stories to test it.
Madeorsk Jun 6, 2025
4ddc8f9
Customizable text field and add basic story to test it.
Madeorsk Jun 6, 2025
d4b3ca3
Customizable url field and add basic story to test it.
Madeorsk Jun 6, 2025
0a1efc9
Customizable reference many count and improve stories to test it.
Madeorsk Jun 6, 2025
3747ebc
Customizable delete button.
Madeorsk Jun 6, 2025
97954a9
Easier ReferenceManyCount theming.
Madeorsk Jun 6, 2025
16d9841
Easier ReferenceField theming.
Madeorsk Jun 6, 2025
a27f996
Add theme provider to reference fields stories to test theming.
Madeorsk Jun 6, 2025
581df3d
Allow to set default props for DeleteButton.
Madeorsk Jun 9, 2025
3db0330
Improve delete button props type.
Madeorsk Jun 9, 2025
522e589
Allow to set default props for Create, Edit and Show.
Madeorsk Jun 9, 2025
a85c9b6
Improve delete button props type.
Madeorsk Jun 9, 2025
34810f8
Allow to set default props for UpdateButton, BulkDeleteButton and Bul…
Madeorsk Jun 9, 2025
4c63628
Allow to theme ShowButton and set its default props.
Madeorsk Jun 9, 2025
4ea1e01
Allow to theme ToggleThemeButton.
Madeorsk Jun 9, 2025
4f4c7f7
Allow to set default props for List.
Madeorsk Jun 9, 2025
288b84e
Allow to theme BulkExportButton and set its default props.
Madeorsk Jun 9, 2025
6f6e223
Allow to set default props for InfiniteList.
Madeorsk Jun 9, 2025
19be41b
Allow to theme ListButton and set its default props.
Madeorsk Jun 9, 2025
ded3f48
Allow to theme RefreshButton and set its default props.
Madeorsk Jun 9, 2025
ea76c72
Allow to theme CloneButton and set its default props.
Madeorsk Jun 9, 2025
db112ae
Add missing useThemeProps in SimpleList.
Madeorsk Jun 9, 2025
88749f5
Add stories to test lists themes.
Madeorsk Jun 9, 2025
0cf7e1e
Add stories to test detail views themes.
Madeorsk Jun 9, 2025
4938e25
Test buttons default props.
Madeorsk Jun 9, 2025
7a15615
Allow to theme all inputs.
Madeorsk Jun 9, 2025
4c6a503
Add stories for themed inputs.
Madeorsk Jun 9, 2025
b8572fb
Merge branch 'master' into next
djhi Jun 11, 2025
d83e645
Add stories to test themes and fix ReferenceField and ReferenceOneFie…
Madeorsk Jun 11, 2025
669995b
Add missing stories to test buttons.
Madeorsk Jun 12, 2025
b2e1a50
Add unit tests for all themed inputs.
Madeorsk Jun 12, 2025
54d0084
Remove unused import and variable.
Madeorsk Jun 12, 2025
3ecc932
Merge pull request #10770 from marmelab/customizable-components
djhi Jun 12, 2025
c693cf8
Merge pull request #10771 from marmelab/override-props
djhi Jun 12, 2025
8af02ea
Fix warnings and remove deepmerge where not needed.
Madeorsk Jun 13, 2025
f80fa27
Merge pull request #10772 from marmelab/customizable-inputs
djhi Jun 16, 2025
01be6d1
review
slax57 Jun 16, 2025
8fe4f1c
Remove theme props override from view components, fix infinite list t…
Madeorsk Jun 19, 2025
2bd2320
Merge pull request #10791 from marmelab/remove-use-theme-props-in-views
djhi Jun 19, 2025
3ee2989
add useUpdateMany middleware support
slax57 Jun 19, 2025
dcb7de6
Merge pull request #10795 from marmelab/useUpdateMany-middleware
fzaninotto Jun 20, 2025
5140841
[no ci] update tutorial screenshots
slax57 Jun 20, 2025
2559a74
Apply suggestions from code review
djhi Jun 20, 2025
2be9066
Improve buttons documentation for label prop
djhi Jun 20, 2025
cdca12e
Handle passing label=false in useResourceTranslation
djhi Jun 20, 2025
f8054c8
Improve `Button` documentation
djhi Jun 20, 2025
ee33346
[no ci] Update docs/Actions.md
slax57 Jun 20, 2025
2ca36a4
[no ci] Update docs/Actions.md
slax57 Jun 20, 2025
17ec181
[no ci] Update docs/AppTheme.md
slax57 Jun 20, 2025
2e6e5cb
[no ci] Update docs/Buttons.md
slax57 Jun 20, 2025
7c9c1cc
[no ci] Update docs/EditDialog.md
slax57 Jun 20, 2025
27a5c2d
[no ci] Update docs/Features.md
slax57 Jun 20, 2025
37412b1
[no ci] Update docs/Fields.md
slax57 Jun 20, 2025
8dcc3d2
[no ci] Update docs/FilterList.md
slax57 Jun 20, 2025
41cf311
[no ci] Update docs/FilteringTutorial.md
slax57 Jun 20, 2025
39924f3
[no ci] Update docs/UnitTesting.md
slax57 Jun 20, 2025
658134a
[no ci] Update docs/useGetLocks.md
slax57 Jun 20, 2025
b435e8a
[no ci] Update docs/useGetOne.md
slax57 Jun 20, 2025
e072164
[no ci] Update docs/useMediaQuery.md
slax57 Jun 20, 2025
0106c7d
[no ci] Update docs/useRecordContext.md
slax57 Jun 20, 2025
1e1cc25
[no ci] Update docs/ListTutorial.md
slax57 Jun 20, 2025
c8e8c0b
[no ci] Update docs/SX.md
slax57 Jun 20, 2025
bf3c81c
[no ci] Update docs/SX.md
slax57 Jun 20, 2025
48b8387
[no ci] Update docs/ShowDialog.md
slax57 Jun 20, 2025
df0cb8d
[no ci] Update docs/Store.md
slax57 Jun 20, 2025
e49e973
[no ci] Update docs/TranslationTranslating.md
slax57 Jun 20, 2025
5278f07
Add more tests and stories + leverage `useResourceTranslation` where …
djhi Jun 20, 2025
23a5bba
Merge branch 'next' into resource-specific-translations
djhi Jun 20, 2025
ae8d4b5
Add tests for button
djhi Jun 20, 2025
20feab0
[Doc] AuthProvider List: Add Appwrite
slax57 Jun 23, 2025
2025a90
Merge pull request #10766 from marmelab/doc/change-datagrid-for-datat…
djhi Jun 23, 2025
854d839
Merge pull request #10798 from marmelab/doc-appwrite-auth-provider
djhi Jun 23, 2025
5a9ea03
Avoid double translation in `<UpdateWithConfirmButton>`
djhi Jun 23, 2025
706daf4
Merge pull request #10686 from marmelab/resource-specific-translations
slax57 Jun 23, 2025
dea00a7
Merge branch 'master' into next
djhi Jun 23, 2025
f1ed291
v5.9.0
djhi Jun 23, 2025
1cf4647
Update docs/OldVersion.md for version 5.9.0
djhi Jun 23, 2025
1da2505
Update create-react-admin templates dependencies for version 5.9.0
djhi Jun 23, 2025
67e6782
Update changelog for version 5.9.0
djhi Jun 23, 2025
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
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
# Changelog

## 5.9.0

* Add support for customization with MUI theme to inputs ([#10772](https://github.com/marmelab/react-admin/pull/10772)) ([Madeorsk](https://github.com/Madeorsk))
* Add support for customization with MUI theme to main views components and buttons ([#10771](https://github.com/marmelab/react-admin/pull/10771)) ([Madeorsk](https://github.com/Madeorsk))
* Add support for customization with MUI theme to fields and delete buttons ([#10770](https://github.com/marmelab/react-admin/pull/10770)) ([Madeorsk](https://github.com/Madeorsk))
* Add `<RecordField>` component ([#10749](https://github.com/marmelab/react-admin/pull/10749)) ([fzaninotto](https://github.com/fzaninotto))
* Add support for middlewares to `useUpdateMany` ([#10795](https://github.com/marmelab/react-admin/pull/10795)) ([slax57](https://github.com/slax57))
* Allow resource specific translations for pages and buttons ([#10686](https://github.com/marmelab/react-admin/pull/10686)) ([djhi](https://github.com/djhi))
* Fix `<AutocompleteInput>` should not break when overriding input slot props ([#10793](https://github.com/marmelab/react-admin/pull/10793)) ([slax57](https://github.com/slax57))
* Fix bulk action buttons hover style ([#10788](https://github.com/marmelab/react-admin/pull/10788)) ([djhi](https://github.com/djhi))
* Fix image alignment in ready page in some contexts ([#10780](https://github.com/marmelab/react-admin/pull/10780)) ([Madeorsk](https://github.com/Madeorsk))
* Fix `useLogoutAccessDenied` should not throw when no `redirectTo` is provided ([#10763](https://github.com/marmelab/react-admin/pull/10763)) ([carloshv93](https://github.com/carloshv93))
* [Doc] AuthProvider List: Add Appwrite ([#10798](https://github.com/marmelab/react-admin/pull/10798)) ([slax57](https://github.com/slax57))
* [Doc] DataProvider List: Update Appwrite logo and name ([#10787](https://github.com/marmelab/react-admin/pull/10787)) ([slax57](https://github.com/slax57))
* [Doc] Add a migration section in `<DataTable>` documentation that shows the codemod ([#10786](https://github.com/marmelab/react-admin/pull/10786)) ([djhi](https://github.com/djhi))
* [Doc] Mention that `helperText` also supports translation keys ([#10785](https://github.com/marmelab/react-admin/pull/10785)) ([slax57](https://github.com/slax57))
* [Doc] Add deployment instructions ([#10783](https://github.com/marmelab/react-admin/pull/10783)) ([Madeorsk](https://github.com/Madeorsk))
* [Doc] Change our `Datagrid` examples to `DataTable` ([#10766](https://github.com/marmelab/react-admin/pull/10766)) ([erwanMarmelab](https://github.com/erwanMarmelab))
* [Demo] Remove duplicate file `segments.ts` ([#10792](https://github.com/marmelab/react-admin/pull/10792)) ([slax57](https://github.com/slax57))
* [chore] Ensure tests are working in all environments by running them in US english ([#10781](https://github.com/marmelab/react-admin/pull/10781)) ([Madeorsk](https://github.com/Madeorsk))

## 5.8.4

* Replace `Datagrid` by `DataTable` in Guessers ([#10754](https://github.com/marmelab/react-admin/pull/10754)) ([erwanMarmelab](https://github.com/erwanMarmelab))
Expand Down
20 changes: 11 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,20 +65,22 @@ The `<Resource>` component defines CRUD pages (`list`, `edit`, and `create`) for
```jsx
// in posts.js
import * as React from "react";
import { List, Datagrid, Edit, Create, SimpleForm, DateField, TextField, EditButton, TextInput, DateInput, useRecordContext } from 'react-admin';
import { List, DataTable, Edit, Create, SimpleForm, DateField, EditButton, TextInput, DateInput, useRecordContext } from 'react-admin';
import BookIcon from '@mui/icons-material/Book';
export const PostIcon = BookIcon;

export const PostList = () => (
<List>
<Datagrid>
<TextField source="id" />
<TextField source="title" />
<DateField source="published_at" />
<TextField source="average_note" />
<TextField source="views" />
<EditButton />
</Datagrid>
<DataTable>
<DataTable.Col source="id" />
<DataTable.Col source="title" />
<DataTable.Col source="published_at" field={DateField} />
<DataTable.Col source="average_note" />
<DataTable.Col source="views" />
<DataTable.Col>
<EditButton />
</DataTable.Col>
</DataTable>
</List>
);

Expand Down
16 changes: 8 additions & 8 deletions docs/Actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,17 +156,17 @@ See the [Success and Error Side Effects](#success-and-error-side-effects) below

{% raw %}
```jsx
import { List, Datagrid, TextField } from 'react-admin';
import { List, DataTable } from 'react-admin';

const PostList = () => (
<List
queryOptions={{ onSettled: (data, error) => console.log(data, error) }}
>
<Datagrid>
<TextField source="id" />
<TextField source="title" />
<TextField source="body" />
</Datagrid>
<DataTable>
<DataTable.Col source="id" />
<DataTable.Col source="title" />
<DataTable.Col source="body" />
</DataTable>
</List>
);
```
Expand Down Expand Up @@ -319,8 +319,8 @@ To execute some logic after a query or a mutation is complete, use the `onSucces
- [`useNotify`](./useNotify.md): Return a function to display a notification.
- [`useRedirect`](./useRedirect.md): Return a function to redirect the user to another page.
- [`useRefresh`](./useRefresh.md): Return a function to force a rerender of the current view (equivalent to pressing the Refresh button).
- [`useUnselect`](./useUnselect.md): Return a function to unselect lines in the current `Datagrid` based on the ids passed to it.
- [`useUnselectAll`](./useUnselectAll.md): Return a function to unselect all lines in the current `Datagrid`.
- [`useUnselect`](./useUnselect.md): Return a function to unselect lines in the current `<DataTable>` based on the ids passed to it.
- [`useUnselectAll`](./useUnselectAll.md): Return a function to unselect all lines in the current `<DataTable>`.

### `onSuccess`

Expand Down
12 changes: 6 additions & 6 deletions docs/AppTheme.md
Original file line number Diff line number Diff line change
Expand Up @@ -273,19 +273,19 @@ const ThemeToggler = () => {

In a custom theme, you can override the style of a component for the entire application using the `components` key.

For instance, to create a custom theme that overrides the style of the `<Datagrid>` component:
For instance, to create a custom theme that overrides the style of the `<DataTable>` component:

```jsx
import { defaultTheme } from 'react-admin';
import { deepmerge } from '@mui/utils';

const theme = deepmerge(defaultTheme, {
components: {
RaDatagrid: {
RaDataTable: {
styleOverrides: {
root: {
backgroundColor: "Lavender",
"& .RaDatagrid-headerCell": {
"& .RaDataTable-headerCell": {
backgroundColor: "MistyRose",
},
}
Expand All @@ -306,7 +306,7 @@ There are 2 important gotchas here:
- Don't forget to merge your custom style overrides with the ones from react-admin's `defaultTheme`, otherwise the application will have the default Material UI theme (most notably, outlined text inputs)
- Custom style overrides must live under a `root` key. Then, the style override syntax is the same as the one used for the [`sx`](./SX.md) prop.

To guess the name of the subclass to use (like `.RaDatagrid-headerCell` above) for customizing a component, you can use the developer tools of your browser, or check the react-admin documentation for individual components (e.g. the [Datagrid CSS documentation](./Datagrid.md#sx-css-api)).
To guess the name of the subclass to use (like `.RaDataTable-headerCell` above) for customizing a component, you can use the developer tools of your browser, or check the react-admin documentation for individual components (e.g. the [`<DataTable>` CSS documentation](./DataTable.md#sx-css-api)).

**Tip**: As an alternative, you can also re-export styled components, and use them instead of the react-admin components. Check the [Reusable Components](./SX.md#reusable-components) documentation for an example.

Expand Down Expand Up @@ -499,11 +499,11 @@ import { defaultTheme } from 'react-admin';

const theme = deepmerge(defaultTheme, {
components: {
RaDatagrid: {
RaDataTable: {
styleOverrides: {
root: {
backgroundColor: "Lavender",
"& .RaDatagrid-headerCell": {
"& .RaDataTable-headerCell": {
backgroundColor: "MistyRose",
},
}
Expand Down
52 changes: 26 additions & 26 deletions docs/ArrayField.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ title: "The ArrayField Component"

![ArrayField](./img/array-field.webp)

`<ArrayField>` creates a [`ListContext`](./useListContext.md) with the field value, and renders its children components - usually iterator components like [`<Datagrid>`](./Datagrid.md) or [`<SingleFieldList>`](./SingleFieldList.md).
`<ArrayField>` creates a [`ListContext`](./useListContext.md) with the field value, and renders its children components - usually iterator components like [`<DataTable>`](./DataTable.md) or [`<SingleFieldList>`](./SingleFieldList.md).

## Usage

Expand All @@ -35,13 +35,13 @@ title: "The ArrayField Component"
}
```

Leverage `<ArrayField>` e.g. in a Show view, to display the `tags` as a `<SingleFieldList>` and the `backlinks` as a `<Datagrid>`:
Leverage `<ArrayField>` e.g. in a Show view, to display the `tags` as a `<SingleFieldList>` and the `backlinks` as a `<DataTable>`:

```jsx
import {
ArrayField,
ChipField,
Datagrid,
DataTable,
Show,
SimpleShowLayout,
SingleFieldList,
Expand All @@ -58,11 +58,11 @@ const PostShow = () => (
</SingleFieldList>
</ArrayField>
<ArrayField source="backlinks">
<Datagrid bulkActionButtons={false}>
<TextField source="uuid" />
<TextField source="date" />
<TextField source="url" />
</Datagrid>
<DataTable bulkActionButtons={false}>
<DataTable.Col source="uuid" />
<DataTable.Col source="date" />
<DataTable.Col source="url" />
</DataTable>
</ArrayField>
</SimpleShowLayout>
</Show>
Expand All @@ -84,7 +84,7 @@ const PostShow = () => (

## `children`

`<ArrayField>` renders its `children` component wrapped in a [`<ListContextProvider>`](./useListContext.md). Commonly used child components are [`<Datagrid>`](./Datagrid.md), [`<SingleFieldList>`](./SingleFieldList.md), and [`<SimpleList>`](./SimpleList.md).
`<ArrayField>` renders its `children` component wrapped in a [`<ListContextProvider>`](./useListContext.md). Commonly used child components are [`<DataTable>`](./DataTable.md), [`<SingleFieldList>`](./SingleFieldList.md), and [`<SimpleList>`](./SimpleList.md).

```jsx
{/* using SingleFieldList as child */}
Expand All @@ -94,13 +94,13 @@ const PostShow = () => (
</SingleFieldList>
</ArrayField>

{/* using Datagrid as child */}
{/* using DataTable as child */}
<ArrayField source="backlinks">
<Datagrid>
<TextField source="uuid" />
<TextField source="date" />
<TextField source="url" />
</Datagrid>
<DataTable>
<DataTable.Col source="uuid" />
<DataTable.Col source="date" />
<DataTable.Col source="url" />
</DataTable>
</ArrayField>

{/* using SimpleList as child */}
Expand Down Expand Up @@ -159,11 +159,11 @@ You can use the `filter` prop to display only a subset of the items in the array
{% raw %}
```jsx
<ArrayField source="backlinks" filter={{ date: '2012-08-10T00:00:00.000Z' }}>
<Datagrid>
<TextField source="uuid" />
<TextField source="date" />
<TextField source="url" />
</Datagrid>
<DataTable>
<DataTable.Col source="uuid" />
<DataTable.Col source="date" />
<DataTable.Col source="url" />
</DataTable>
</ArrayField>
```
{% endraw %}
Expand All @@ -179,7 +179,7 @@ As `<ArrayField>` creates a [`ListContext`](./useListContext.md), you can use th
```jsx
import {
ArrayField,
Datagrid,
DataTable,
Pagination,
Show,
SimpleShowLayout,
Expand All @@ -191,11 +191,11 @@ const PostShow = () => (
<SimpleShowLayout>
<TextField source="title" />
<ArrayField source="backlinks" perPage={5}>
<Datagrid>
<TextField source="uuid" />
<TextField source="date" />
<TextField source="url" />
</Datagrid>
<DataTable>
<DataTable.Col source="uuid" />
<DataTable.Col source="date" />
<DataTable.Col source="url" />
</DataTable>
<Pagination />
</ArrayField>
</SimpleShowLayout>
Expand Down
1 change: 1 addition & 0 deletions docs/AuthProviderList.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ title: "Supported Auth Provider Backends"
It's very common that your auth logic is so specific that you'll need to write your own `authProvider`. However, the community has built a few open-source Auth Providers that may fit your need:

<div class="providers-list" markdown="1">
- ![Appwrite Logo](./img/backend-logos/appwrite.svg "Appwrite Logo")**[Appwrite](https://appwrite.io/)**: [marmelab/ra-appwrite](https://github.com/marmelab/ra-appwrite)
- ![auth0 Logo](./img/backend-logos/auth0.svg "auth0 Logo")**[Auth0 by Okta](https://auth0.com/)**: [marmelab/ra-auth-auth0](https://github.com/marmelab/ra-auth-auth0/blob/main/packages/ra-auth-auth0/Readme.md)
- ![amplify Logo](./img/backend-logos/amplify.svg "amplify Logo")**[AWS Amplify](https://docs.amplify.aws)**: [MrHertal/react-admin-amplify](https://github.com/MrHertal/react-admin-amplify)
- ![cognito Logo](./img/backend-logos/aws.png "cognito Logo")**[AWS Cognito](https://docs.aws.amazon.com/cognito/latest/developerguide/setting-up-the-javascript-sdk.html)**: [marmelab/ra-auth-cognito](https://github.com/marmelab/ra-auth-cognito/blob/main/packages/ra-auth-cognito/Readme.md)
Expand Down
Loading