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
|`authorizationError`| Optional |`ReactNode`|`null`| The content to display when authorization checks fail |
510
-
|`children`| Required |`ReactNode`| - | A list of `<Input>` elements |
511
-
|`defaultExpanded`| Optional |`boolean`|`false`| Set to true to have the accordion expanded by default (except if autoClose = true on the parent) |
512
-
|`disabled`| Optional |`boolean`|`false`| If true, the accordion will be displayed in a disabled state. |
513
-
|`enableAccessControl`| Optional |`boolean`|`false`| Enable checking authorization rights for this panel's inputs |
514
-
|`id`| Optional |`string`| - | An id for this Accordion to be used in the [`useFormGroup`](./Upgrade.md#useformgroup-hook-returned-state-has-changed) hook and for CSS classes. |
515
-
|`label`| Required |`string` or `ReactNode`| - | The main label used as the accordion summary. Appears in red when the accordion has errors |
516
-
|`loading`| Optional |`ReactNode`|| The content to display when checking authorizations |
517
-
|`secondary`| Optional |`string` or `ReactNode`| - | The secondary label used as the accordion summary |
518
-
|`square`| Optional |`boolean`|`false`| If true, rounded corners are disabled. |
519
-
|`sx`| Optional |`Object`| - | An object containing the MUI style overrides to apply to the root component. |
|`authorizationError`| Optional |`ReactNode`|`null`| The content to display when authorization checks fail |
510
+
|`children`| Required |`ReactNode`| - | A list of `<Input>` elements |
511
+
|`defaultExpanded`| Optional |`boolean`|`false`| Set to true to have the accordion expanded by default (except if autoClose = true on the parent) |
512
+
|`disabled`| Optional |`boolean`|`false`| If true, the accordion will be displayed in a disabled state. |
513
+
|`enableAccessControl`| Optional |`boolean`|`false`| Enable checking authorization rights for this panel's inputs |
514
+
|`id`| Optional |`string`| - | An id for this Accordion to be used in the [`useFormGroup`](./Forms.md#grouping-inputs) hook and for CSS classes. |
515
+
|`label`| Required |`string` or `ReactNode`| - | The main label used as the accordion summary. Appears in red when the accordion has errors |
516
+
|`loading`| Optional |`ReactNode`|| The content to display when checking authorizations |
517
+
|`secondary`| Optional |`string` or `ReactNode`| - | The secondary label used as the accordion summary |
518
+
|`square`| Optional |`boolean`|`false`| If true, rounded corners are disabled. |
519
+
|`sx`| Optional |`Object`| - | An object containing the MUI style overrides to apply to the root component. |
520
520
521
521
```tsx
522
522
import {
@@ -838,7 +838,7 @@ Check [the `<AutoSave>` component](./AutoSave.md) documentation for more details
838
838
839
839
## Access Control
840
840
841
-
`<AccordionForm>` can use [Access Control](./AccessControl.md) to check permissions for each section and input. To enable this feature, set the `enableAccessControl` prop to `true`.
841
+
`<AccordionForm>` can use [Access Control](./Permissions.md#access-control) to check permissions for each section and input. To enable this feature, set the `enableAccessControl` prop to `true`.
842
842
843
843
Check the [`enableAccessControl` prop](#enableaccesscontrol) section for more details.
Copy file name to clipboardExpand all lines: docs/Admin.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1266,7 +1266,7 @@ You might want to dynamically define the resources when the app starts. To do so
1266
1266
1267
1267
### Using a Function As `<Admin>` Child
1268
1268
1269
-
The `<Admin>` component accepts a function as one of its children and this function can return a Promise. If you also defined an `authProvider`, the child function will receive the result of a call to `authProvider.getPermissions()` (you can read more about this in the [Auth Provider](./Authentication.md#enabling-auth-features) chapter).
1269
+
The `<Admin>` component accepts a function as one of its children and this function can return a Promise. If you also defined an `authProvider`, the child function will receive the result of a call to `authProvider.getPermissions()` (you can read more about this in the [Auth Provider](./Permissions.md#authprovidergetpermissions) chapter).
1270
1270
1271
1271
For instance, getting the resource from an API might look like:
Copy file name to clipboardExpand all lines: docs/ArrayInput.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -183,4 +183,4 @@ const UserArray = () => (
183
183
184
184
{% endraw %}
185
185
186
-
**Tip:** If you only need the item's index, you can leverage the [`useSimpleFormIteratorItem` hook](./SimpleFormIterator.md#getting-the-element-index) instead.
186
+
**Tip:** If you only need the item's index, you can leverage the [`useSimpleFormIteratorItem` hook](./SimpleFormIterator.md#getting-the-element-index) instead.
Copy file name to clipboardExpand all lines: docs/AuthProviderWriting.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -449,7 +449,7 @@ const authProvider = {
449
449
450
450
Check the [Access Control documentation](./Permissions.md#access-control) for more information on how to use the `canAccess` method.
451
451
452
-
**Tip**: [The Role-Based Access Control (RBAC) module](./AuthRBAC.md) allows fined-grained permissions in react-admin apps leveraging the `canAccess` method. Check [the RBAC documentation](./AuthRBAC.md#authprovider-methods) for more information.
452
+
**Tip**: [The Role-Based Access Control (RBAC) module](./AuthRBAC.md) allows fined-grained permissions in react-admin apps leveraging the `canAccess` method. Check [the RBAC documentation](./AuthRBAC.md) for more information.
453
453
454
454
455
455
### `getPermissions`
@@ -545,4 +545,4 @@ const authProvider = {
545
545
546
546
Some auth providers may already support query cancellation. Check their documentation for details.
547
547
548
-
**Note**: In development, if your app is using [`<React.StrictMode>`](https://react.dev/reference/react/StrictMode), enabling query cancellation will duplicate the API queries. This is only a development issue and won't happen in production.
548
+
**Note**: In development, if your app is using [`<React.StrictMode>`](https://react.dev/reference/react/StrictMode), enabling query cancellation will duplicate the API queries. This is only a development issue and won't happen in production.
Copy file name to clipboardExpand all lines: docs/AuthRBAC.md
+10-10Lines changed: 10 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -100,16 +100,16 @@ An _action_ is a string, usually a verb, that represents an operation. Examples
100
100
101
101
React-admin already does page-level access control with actions like "list", "show", "edit", "create", and "delete". RBAC checks additional actions in its components:
|`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>`](#tabform)|
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)|
|`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
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)|
114
114
115
115
**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.
Copy file name to clipboardExpand all lines: docs/AutoSave.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -50,11 +50,11 @@ The component renders nothing by default. It will save the current form values 3
50
50
`<AutoSave>` imposes a few limitations:
51
51
52
52
- You must set the `<Form resetOptions>` prop to `{ keepDirtyValues: true }`. If you forget that prop, any change entered by the end user after the autosave but before its acknowledgement by the server will be lost.
53
-
- In an `<Edit>` page, you must set [`mutationMode`](./Edit.html#mutationmode) to `pessimistic` or `optimistic` (`<AutoSave>` doesn't work with the default `mutationMode="undoable"`).
53
+
- In an `<Edit>` page, you must set [`mutationMode`](./Edit.md#mutationmode) to `pessimistic` or `optimistic` (`<AutoSave>` doesn't work with the default `mutationMode="undoable"`).
54
54
- You can't use `<Form warnWhenUnsavedChanges>` with this component. `<AutoSave>` implements its own similar mechanism, and it's enabled by default. You can disable it with the [`disableWarnWhenUnsavedChanges` prop](#disablewarnwhenunsavedchanges).
55
55
- It requires that you use a Data Router. This is the default for react-admin apps, but if you're using a custom router, you may need to adjust your configuration. Check the react-router documentation about [Using a Data Router with react-router v6](https://reactrouter.com/6.22.3/routers/picking-a-router) or [Using a Data Router with react-router v7](https://reactrouter.com/7.2.0/start/framework/custom).
56
-
- When used in forms that have child routes (e.g., [`<TabbedForm>`](./TabbedForm.html)), you must set the [`syncWithLocation` prop](./TabbedForm.html#syncwithlocation) to `false`.
57
-
- If you want to support navigation between Edit pages of the same resource, for instance using [`<PrevNextButtons>`](./PrevNextButtons.html#prevnextbuttons), you must ensure that the `<Edit key>` changes whenever the record changes:
56
+
- When used in forms that have child routes (e.g., [`<TabbedForm>`](./TabbedForm.md)), you must set the [`syncWithLocation` prop](./TabbedForm.md#syncwithlocation) to `false`.
57
+
- If you want to support navigation between Edit pages of the same resource, for instance using [`<PrevNextButtons>`](./PrevNextButtons.md#prevnextbuttons), you must ensure that the `<Edit key>` changes whenever the record changes:
58
58
59
59
{% raw %}
60
60
@@ -182,7 +182,7 @@ If you want an autosave feature with another user interface, you can leverage th
182
182
**Note**: you **must** add the `resetOptions` prop with `{ keepDirtyValues: true }` to avoid having the user changes overridden by the latest update operation result.
183
183
184
184
**Note**: `useAutoSave` is not compatible with the default `warnWhenUnsavedChanges` prop of the react-admin form components. However, it implements its own similar mechanism which is enabled by default.
185
-
You can disable it with the [`disableWarnWhenUnsavedChanges` prop](#disablewarnwhenunsavedchanges-1).
185
+
You can disable it with the [`disableWarnWhenUnsavedChanges` prop](#disablewarnwhenunsavedchanges).
186
186
187
187
**Note**: Due to limitations in react-router, this equivalent of `warnWhenUnsavedChanges` only works if you use the default router provided by react-admin, or if you use a [Data Router with react-router v6](https://reactrouter.com/6.22.3/routers/picking-a-router) or [with react-router v7](https://reactrouter.com/7.2.0/start/framework/custom).
188
188
If not, you'll need to use the `disableWarnWhenUnsavedChanges` prop.
0 commit comments