Skip to content

Commit dea00a7

Browse files
committed
Merge branch 'master' into next
2 parents 706daf4 + 854d839 commit dea00a7

File tree

113 files changed

+1710
-1306
lines changed

Some content is hidden

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

113 files changed

+1710
-1306
lines changed

README.md

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -65,20 +65,22 @@ The `<Resource>` component defines CRUD pages (`list`, `edit`, and `create`) for
6565
```jsx
6666
// in posts.js
6767
import * as React from "react";
68-
import { List, Datagrid, Edit, Create, SimpleForm, DateField, TextField, EditButton, TextInput, DateInput, useRecordContext } from 'react-admin';
68+
import { List, DataTable, Edit, Create, SimpleForm, DateField, EditButton, TextInput, DateInput, useRecordContext } from 'react-admin';
6969
import BookIcon from '@mui/icons-material/Book';
7070
export const PostIcon = BookIcon;
7171

7272
export const PostList = () => (
7373
<List>
74-
<Datagrid>
75-
<TextField source="id" />
76-
<TextField source="title" />
77-
<DateField source="published_at" />
78-
<TextField source="average_note" />
79-
<TextField source="views" />
80-
<EditButton />
81-
</Datagrid>
74+
<DataTable>
75+
<DataTable.Col source="id" />
76+
<DataTable.Col source="title" />
77+
<DataTable.Col source="published_at" field={DateField} />
78+
<DataTable.Col source="average_note" />
79+
<DataTable.Col source="views" />
80+
<DataTable.Col>
81+
<EditButton />
82+
</DataTable.Col>
83+
</DataTable>
8284
</List>
8385
);
8486

docs/Actions.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -156,17 +156,17 @@ See the [Success and Error Side Effects](#success-and-error-side-effects) below
156156

157157
{% raw %}
158158
```jsx
159-
import { List, Datagrid, TextField } from 'react-admin';
159+
import { List, DataTable } from 'react-admin';
160160

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

325325
### `onSuccess`
326326

docs/AppTheme.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -273,19 +273,19 @@ const ThemeToggler = () => {
273273

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

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

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

282282
const theme = deepmerge(defaultTheme, {
283283
components: {
284-
RaDatagrid: {
284+
RaDataTable: {
285285
styleOverrides: {
286286
root: {
287287
backgroundColor: "Lavender",
288-
"& .RaDatagrid-headerCell": {
288+
"& .RaDataTable-headerCell": {
289289
backgroundColor: "MistyRose",
290290
},
291291
}
@@ -306,7 +306,7 @@ There are 2 important gotchas here:
306306
- 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)
307307
- 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.
308308

309-
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)).
309+
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)).
310310

311311
**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.
312312

@@ -499,11 +499,11 @@ import { defaultTheme } from 'react-admin';
499499

500500
const theme = deepmerge(defaultTheme, {
501501
components: {
502-
RaDatagrid: {
502+
RaDataTable: {
503503
styleOverrides: {
504504
root: {
505505
backgroundColor: "Lavender",
506-
"& .RaDatagrid-headerCell": {
506+
"& .RaDataTable-headerCell": {
507507
backgroundColor: "MistyRose",
508508
},
509509
}

docs/ArrayField.md

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ title: "The ArrayField Component"
99

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

12-
`<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).
12+
`<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).
1313

1414
## Usage
1515

@@ -35,13 +35,13 @@ title: "The ArrayField Component"
3535
}
3636
```
3737

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

4040
```jsx
4141
import {
4242
ArrayField,
4343
ChipField,
44-
Datagrid,
44+
DataTable,
4545
Show,
4646
SimpleShowLayout,
4747
SingleFieldList,
@@ -58,11 +58,11 @@ const PostShow = () => (
5858
</SingleFieldList>
5959
</ArrayField>
6060
<ArrayField source="backlinks">
61-
<Datagrid bulkActionButtons={false}>
62-
<TextField source="uuid" />
63-
<TextField source="date" />
64-
<TextField source="url" />
65-
</Datagrid>
61+
<DataTable bulkActionButtons={false}>
62+
<DataTable.Col source="uuid" />
63+
<DataTable.Col source="date" />
64+
<DataTable.Col source="url" />
65+
</DataTable>
6666
</ArrayField>
6767
</SimpleShowLayout>
6868
</Show>
@@ -84,7 +84,7 @@ const PostShow = () => (
8484

8585
## `children`
8686

87-
`<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).
87+
`<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).
8888

8989
```jsx
9090
{/* using SingleFieldList as child */}
@@ -94,13 +94,13 @@ const PostShow = () => (
9494
</SingleFieldList>
9595
</ArrayField>
9696

97-
{/* using Datagrid as child */}
97+
{/* using DataTable as child */}
9898
<ArrayField source="backlinks">
99-
<Datagrid>
100-
<TextField source="uuid" />
101-
<TextField source="date" />
102-
<TextField source="url" />
103-
</Datagrid>
99+
<DataTable>
100+
<DataTable.Col source="uuid" />
101+
<DataTable.Col source="date" />
102+
<DataTable.Col source="url" />
103+
</DataTable>
104104
</ArrayField>
105105

106106
{/* using SimpleList as child */}
@@ -159,11 +159,11 @@ You can use the `filter` prop to display only a subset of the items in the array
159159
{% raw %}
160160
```jsx
161161
<ArrayField source="backlinks" filter={{ date: '2012-08-10T00:00:00.000Z' }}>
162-
<Datagrid>
163-
<TextField source="uuid" />
164-
<TextField source="date" />
165-
<TextField source="url" />
166-
</Datagrid>
162+
<DataTable>
163+
<DataTable.Col source="uuid" />
164+
<DataTable.Col source="date" />
165+
<DataTable.Col source="url" />
166+
</DataTable>
167167
</ArrayField>
168168
```
169169
{% endraw %}
@@ -179,7 +179,7 @@ As `<ArrayField>` creates a [`ListContext`](./useListContext.md), you can use th
179179
```jsx
180180
import {
181181
ArrayField,
182-
Datagrid,
182+
DataTable,
183183
Pagination,
184184
Show,
185185
SimpleShowLayout,
@@ -191,11 +191,11 @@ const PostShow = () => (
191191
<SimpleShowLayout>
192192
<TextField source="title" />
193193
<ArrayField source="backlinks" perPage={5}>
194-
<Datagrid>
195-
<TextField source="uuid" />
196-
<TextField source="date" />
197-
<TextField source="url" />
198-
</Datagrid>
194+
<DataTable>
195+
<DataTable.Col source="uuid" />
196+
<DataTable.Col source="date" />
197+
<DataTable.Col source="url" />
198+
</DataTable>
199199
<Pagination />
200200
</ArrayField>
201201
</SimpleShowLayout>

docs/AuthProviderList.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ title: "Supported Auth Provider Backends"
88
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:
99

1010
<div class="providers-list" markdown="1">
11+
- ![Appwrite Logo](./img/backend-logos/appwrite.svg "Appwrite Logo")**[Appwrite](https://appwrite.io/)**: [marmelab/ra-appwrite](https://github.com/marmelab/ra-appwrite)
1112
- ![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)
1213
- ![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)
1314
- ![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)

docs/AuthRBAC.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -100,17 +100,17 @@ An _action_ is a string, usually a verb, that represents an operation. Examples
100100

101101
React-admin already does page-level access control with actions like "list", "show", "edit", "create", and "delete". RBAC checks additional actions in its components:
102102

103-
| Action | Description | Used In |
104-
| -------- | -------------------------------- |---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
105-
| `list` | Allow to access the List page | [`<List>`](./List.md#access-control), [`<ListButton>`](./Buttons.md#listbutton), [`<Menu.ResourceItem>`](./Menu.md#access-control) |
106-
| `show` | Allow to access the Show page | [`<Show>`](./Show.md), [`<ShowButton>`](./Buttons.md#showbutton), [`<Datagrid>`](./Datagrid.md#access-control), [`<Edit>`](./Edit.md) |
107-
| `create` | Allow to access the Create page | [`<Create>`](./Create.md), [`<CreateButton>`](./Buttons.md#createbutton), [`<List>`](./List.md#access-control) |
108-
| `edit` | Allow to access the Edit page | [`<Edit>`](./Edit.md), [`<EditButton>`](./Buttons.md#editbutton), [`<Datagrid>`](./Datagrid.md#access-control), [`<Show>`](./Show.md) |
109-
| `delete` | Allow to delete data | [`<DeleteButton>`](./Buttons.md#deletebutton), [`<BulkDeleteButton>`](./Buttons.md#bulkdeletebutton), [`<Datagrid>`](./Datagrid.md#access-control), [`<SimpleForm>`](./SimpleForm.md#access-control), [`<TabbedForm>`](./TabbedForm.md#access-control) |
110-
| `export` | Allow to export data | [`<ExportButton>`](./Buttons.md#exportbutton), [`<List>`](./List.md#access-control) |
111-
| `clone` | Allow to clone a record | [`<CloneButton>`](./Buttons.md#clonebutton), [`<Edit>`](./Edit.md) |
112-
| `read` | Allow to view a field (or a tab) | [`<Datagrid>`](./Datagrid.md#access-control), [`<SimpleShowLayout>`](./SimpleShowLayout.md#access-control), [`<TabbedShowLayout>`](./TabbedShowLayout.md#access-control) |
113-
| `write` | Allow to edit a field (or a tab) | [`<SimpleForm>`](./SimpleForm.md#access-control), [`<TabbedForm>`](./TabbedForm.md#access-control), [`<WizardForm>`](./WizardForm.md#enableaccesscontrol), [`<LongForm>`](./LongForm.md#enableaccesscontrol), [`<AccordionForm>`](./AccordionForm.md#enableaccesscontrol) |
103+
| Action | Description | Used In |
104+
| -------- | -------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
105+
| `list` | Allow to access the List page | [`<List>`](./List.md#access-control), [`<ListButton>`](./Buttons.md#listbutton), [`<Menu.ResourceItem>`](./Menu.md#access-control) |
106+
| `show` | Allow to access the Show page | [`<Show>`](./Show.md), [`<ShowButton>`](./Buttons.md#showbutton), [`<DataTable>`](./DataTable.md#access-control), [`<Datagrid>`](./Datagrid.md#access-control), [`<Edit>`](./Edit.md) |
107+
| `create` | Allow to access the Create page | [`<Create>`](./Create.md), [`<CreateButton>`](./Buttons.md#createbutton), [`<List>`](./List.md#access-control) |
108+
| `edit` | Allow to access the Edit page | [`<Edit>`](./Edit.md), [`<EditButton>`](./Buttons.md#editbutton), [`<DataTable>`](./DataTable.md#access-control), [`<Datagrid>`](./Datagrid.md#access-control), [`<Show>`](./Show.md) |
109+
| `delete` | Allow to delete data | [`<DeleteButton>`](./Buttons.md#deletebutton), [`<BulkDeleteButton>`](./Buttons.md#bulkdeletebutton), [`<DataTable>`](./DataTable.md#access-control), [`<Datagrid>`](./Datagrid.md#access-control), [`<SimpleForm>`](./SimpleForm.md#access-control), [`<TabbedForm>`](./TabbedForm.md#access-control) |
110+
| `export` | Allow to export data | [`<ExportButton>`](./Buttons.md#exportbutton), [`<List>`](./List.md#access-control) |
111+
| `clone` | Allow to clone a record | [`<CloneButton>`](./Buttons.md#clonebutton), [`<Edit>`](./Edit.md) |
112+
| `read` | Allow to view a field (or a tab) | [`<Datagrid>`](./Datagrid.md#access-control), [`<SimpleShowLayout>`](./SimpleShowLayout.md#access-control), [`<TabbedShowLayout>`](./TabbedShowLayout.md#access-control) |
113+
| `write` | Allow to edit a field (or a tab) | [`<SimpleForm>`](./SimpleForm.md#access-control), [`<TabbedForm>`](./TabbedForm.md#access-control), [`<WizardForm>`](./WizardForm.md#enableaccesscontrol), [`<LongForm>`](./LongForm.md#enableaccesscontrol), [`<AccordionForm>`](./AccordionForm.md#enableaccesscontrol) |
114114

115115
**Tip:** Be sure not to confuse "show" and "read", or "edit" and "write", as they are not the same. The first operate at the page level, the second at the field level. A good mnemonic is to realize "show" and "edit" are named the same as the react-admin page they allow to control: the Show and Edit pages.
116116

0 commit comments

Comments
 (0)