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: CHANGELOG.md
+19Lines changed: 19 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,24 @@
1
1
# Changelog
2
2
3
+
## 5.10.2
4
+
5
+
* Add warning when using `queryOptions` to add a `meta` in `<Edit>` and `<EditBase>` ([#10882](https://github.com/marmelab/react-admin/pull/10882)) ([Madeorsk](https://github.com/Madeorsk))
6
+
* Fix error when authProvider check methods are not async ([#10890](https://github.com/marmelab/react-admin/pull/10890)) ([fzaninotto](https://github.com/fzaninotto))
7
+
* Fix `ChipField` consider zero to be empty ([#10877](https://github.com/marmelab/react-admin/pull/10877)) ([djhi](https://github.com/djhi))
*[Doc] Add details about Datagrid to DataTable migration ([#10884](https://github.com/marmelab/react-admin/pull/10884)) ([Madeorsk](https://github.com/Madeorsk))
10
+
11
+
## 5.10.1
12
+
13
+
* Fix `<ColumnsButton>` cannot be used with keyboard ([#10869](https://github.com/marmelab/react-admin/pull/10869)) ([djhi](https://github.com/djhi))
* Fix `<ReferenceArrayInput>` does not accept `alwaysOn` prop ([#10863](https://github.com/marmelab/react-admin/pull/10863)) ([djhi](https://github.com/djhi))
16
+
* Fix `DateInput` JSDoc formatting and example ([#10855](https://github.com/marmelab/react-admin/pull/10855)) ([ogroppo](https://github.com/ogroppo))
17
+
* Fix B&W theme label is invisible for inputs with `standard` variant ([#10854](https://github.com/marmelab/react-admin/pull/10854)) ([djhi](https://github.com/djhi))
18
+
* Fix Show and Edit controllers can trigger a redirect loop with react-router v7 if getOne rejects ([#10850](https://github.com/marmelab/react-admin/pull/10850)) ([slax57](https://github.com/slax57))
19
+
*[Demo] Migrate from `fetch-mock` to `msw` ([#10844](https://github.com/marmelab/react-admin/pull/10844)) ([erwanMarmelab](https://github.com/erwanMarmelab))
20
+
* Bump linkifyjs from 4.1.1 to 4.3.2 ([#10868](https://github.com/marmelab/react-admin/pull/10868)) ([dependabot[bot]](https://github.com/apps/dependabot))
21
+
3
22
## 5.10.0
4
23
5
24
* Add filter input to `<ColumnsButton>` when there are many columns ([#10848](https://github.com/marmelab/react-admin/pull/10848)) ([slax57](https://github.com/slax57))
"description": "A frontend Framework for building single-page applications running in the browser on top of REST/GraphQL APIs, using TypeScript, React, react-router, react-hook-form, react-query, and Material Design.",
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:
- Remove the `optimized` prop (which isn't necessary anymore)
1880
+
- Rename the keys in `sx` prop from `"& .RaDatagrid-xxxx"` to `"& .RaDataTable-xxxx"`.
1881
+
- Replace simple `<TextField>` with `<DataTable.Col>`.
1882
+
- Replace simple `<NumberField>` with `<DataTable.NumberCol>`.
1883
+
- Wrap all other fields in `<DataTable.Col>`, keeping `source` and `label` properties in `<DataTable.Col>`.
1884
+
- Replace `Datagrid` imports by `DataTable`, and remove unused `TextField` and `NumberField` imports if they are now all replaced.
1885
+
1886
+
However, the codemod will **not**:
1887
+
1888
+
- Replace `<DatagridConfigurable>` with `<DataTable>` (column selection is now natively supported by `<DataTable>`).
1889
+
- Remove the `sortBy` and `sortable` props on fields (sorting is now managed by `<DataTable.Col source>`)
1890
+
- Move the `sortByOrder` prop from the field to `<DataTable.Col>`
1891
+
- Replace a `<FunctionField>` child with `<DataTable.Col render>`
1892
+
- Replace `<Datagrid>` from `@react-admin/ra-rbac` (and all its children). Refer to [Access Control section](#access-control) to use `<DataTable>` with `<CanAccess>`.
1893
+
- Move the column styles from `<Datagrid sx>` to the individual `<DataTable.Col sx>`
Copy file name to clipboardExpand all lines: docs/Edit.md
+7-1Lines changed: 7 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -414,6 +414,8 @@ const PostEdit = () => (
414
414
415
415
{% endraw %}
416
416
417
+
**Warning**: If you set `mutationOptions` meta without [redirecting](#redirect), make sure that [`queryOptions`](#queryoptions) meta is the same, or you will have data update issues.
418
+
417
419
You can also use `mutationOptions` to override success or error side effects, by setting the `mutationOptions` prop. Refer to the [useMutation documentation](https://tanstack.com/query/v5/docs/react/reference/useMutation) in the react-query website for a list of the possible options.
418
420
419
421
Let's see an example with the success side effect. By default, when the save action succeeds, react-admin shows a notification, and redirects to the list page. You can override this behavior and pass custom success side effects by providing a `mutationOptions` prop with an `onSuccess` key:
**Warning**: If you set `queryOptions` meta without [redirecting](#redirect), make sure that [`mutationOptions`](#mutationoptions) meta is the same, or you will have data update issues.
600
+
597
601
You can also use `queryOptions` to force a refetch on reconnect:
598
602
599
603
{% raw %}
@@ -629,7 +633,9 @@ const PostEdit = () => (
629
633
);
630
634
```
631
635
632
-
Note that the `redirect` prop is ignored if you set [the `mutationOptions` prop](#mutationoptions). See that prop for how to set a different redirection path in that case.
636
+
Note that the `redirect` prop is ignored if you set an `onSuccess` callback of [the `mutationOptions` prop](#mutationoptions). See that prop for how to set a different redirection path in that case.
637
+
638
+
**Warning**: If you set [`queryOptions`](#queryoptions) meta without redirecting, make sure that [`mutationOptions`](#mutationoptions) meta is the same, or you will have data update issues.
Copy file name to clipboardExpand all lines: docs/ListBase.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -93,6 +93,7 @@ The `<ListBase>` component accepts the following props:
93
93
* `render`
94
94
* [`resource`](./List.md#resource)
95
95
* [`sort`](./List.md#sort)
96
+
* [`storeKey`](./List.md#storeKey)
96
97
97
98
In addition, `<ListBase>` renders its children components inside a `ListContext`. Check [the `<List children>` documentation](./List.md#children) for usage examples.
`<ReferenceArrayField>` fetches a list of referenced records (using the `dataProvider.getMany()` method), and puts them in a [`ListContext`](./useListContext.md). It then renders each related record, using its [`recordRepresentation`](./Resource.md#recordrepresentation), in a [`<ChipField>`](./ChipField.md).
13
+
`<ReferenceArrayField>` fetches a list of referenced records (using the `dataProvider.getMany()` method), and puts them in a [`ListContext`](./useListContext.md). It then renders each related record, using its [`recordRepresentation`](./Resource.md#recordrepresentation), in a [`<ChipField>`](./ChipField.md).
14
14
15
15
**Tip**: If the relationship is materialized by a foreign key on the referenced resource, use [the `<ReferenceManyField>` component](./ReferenceManyField.md) instead.
16
16
@@ -101,7 +101,7 @@ You can change how the list of related records is rendered by passing a custom c
101
101
102
102
## `children`
103
103
104
-
By default, `<ReferenceArrayField>` renders one string by related record, via a [`<SingleFieldList>`](./SingleFieldList.md) with a [`<ChipField>`](./ChipField.md) using the resource [`recordRepresentation`](./Resource.md#recordrepresentation).
104
+
By default, `<ReferenceArrayField>` renders one string by related record, via a [`<SingleFieldList>`](./SingleFieldList.md) with a [`<ChipField>`](./ChipField.md) using the resource [`recordRepresentation`](./Resource.md#recordrepresentation).
105
105
106
106

107
107
@@ -131,7 +131,7 @@ Is equivalent to:
131
131
-[`<SimpleList>`](./SimpleList.md)
132
132
-[`<EditableDatagrid>`](./EditableDatagrid.md)
133
133
-[`<Calendar>`](./Calendar.md)
134
-
- Or a component of your own (check the [`<WithListContext>`](./WithListContext.md) and the [`useListContext`](./useListContext.md) chapters to learn how).
134
+
- Or a component of your own (check the [`<WithListContext>`](./WithListContext.md) and the [`useListContext`](./useListContext.md) chapters to learn how).
135
135
136
136
For instance, use a `<DataTable>` to render the related records in a table:
`<ReferenceArrayField>` fetches all the related records, and displays them all, too. You can use the `filter` prop to filter the list of related records to display (this works by filtering the records client-side, after the fetch).
192
-
)} />
193
-
<EditButton />
194
-
</SimpleShowLayout>
195
-
</Show>
196
-
);
197
-
```
198
-
199
-
## `filter`
200
-
201
191
`<ReferenceArrayField>` fetches all the related records, and displays them all, too. You can use the `filter` prop to filter the list of related records to display (this works by filtering the records client-side, after the fetch).
202
192
203
193
For instance, to render only tags that are 'published', you can use the following code:
204
194
205
195
{% raw %}
196
+
206
197
```jsx
207
198
<ReferenceArrayField
208
199
label="Tags"
@@ -211,6 +202,7 @@ For instance, to render only tags that are 'published', you can use the followin
211
202
filter={{ is_published:true }}
212
203
/>
213
204
```
205
+
214
206
{% endraw %}
215
207
216
208
## `label`
@@ -314,9 +306,11 @@ Use the `queryOptions` prop to pass options to [the `dataProvider.getMany()` que
314
306
For instance, to pass [a custom `meta`](./Actions.md#meta-parameter):
@@ -367,6 +361,7 @@ By default, the related records are displayed in the order in which they appear
367
361
For instance, to sort tags by title in ascending order, you can use the following code:
368
362
369
363
{% raw %}
364
+
370
365
```jsx
371
366
<ReferenceArrayField
372
367
label="Tags"
@@ -375,6 +370,7 @@ For instance, to sort tags by title in ascending order, you can use the followin
375
370
sort={{ field:'title', order:'ASC' }}
376
371
/>
377
372
```
373
+
378
374
{% endraw %}
379
375
380
376
## `sx`: CSS API
@@ -386,4 +382,3 @@ The `<ReferenceArrayField>` component accepts the usual `className` prop. You ca
386
382
|`& .RaReferenceArrayField-progress`| Applied to the Material UI's `LinearProgress` component while `isPending` prop is `true`|
387
383
388
384
To override the style of all instances of `<ReferenceArrayField>` using the [application-wide style overrides](./AppTheme.md#theming-individual-components), use the `RaReferenceArrayField` key.
0 commit comments