Skip to content

Commit 87e537a

Browse files
committed
Merge branch 'next' into support-offline-mode
2 parents eae5aa6 + 3495c54 commit 87e537a

File tree

309 files changed

+7356
-4606
lines changed

Some content is hidden

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

309 files changed

+7356
-4606
lines changed

.eslintignore

Lines changed: 0 additions & 7 deletions
This file was deleted.

.eslintrc

Lines changed: 0 additions & 61 deletions
This file was deleted.

.yarn/patches/@storybook-source-loader-npm-8.4.4-55dafc88e2.patch

Lines changed: 0 additions & 28 deletions
This file was deleted.

CHANGELOG.md

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

3+
## 5.8.0
4+
5+
* Add `<InPlaceEditor>` for edit-in-place ([#10690](https://github.com/marmelab/react-admin/pull/10690)) ([fzaninotto](https://github.com/fzaninotto))
6+
* Add `<DataTable>` component ([#10597](https://github.com/marmelab/react-admin/pull/10597)) ([fzaninotto](https://github.com/fzaninotto))
7+
* Add `<AuthLayout>` to share layout of login page with register & forgot password pages ([#10640](https://github.com/marmelab/react-admin/pull/10640)) ([djhi](https://github.com/djhi))
8+
* Add support for defaultProps override via theme ([#10655](https://github.com/marmelab/react-admin/pull/10655)) ([djhi](https://github.com/djhi))
9+
* Add support for MUI v7 ([#10639](https://github.com/marmelab/react-admin/pull/10639)) ([djhi](https://github.com/djhi))
10+
* Add ability to configure `<Loading>` timeout ([#10689](https://github.com/marmelab/react-admin/pull/10689)) ([WiXSL](https://github.com/WiXSL))
11+
* Improve `<DeleteButton>` and `<UpdateButton>` confirmation wording using record representation ([#10654](https://github.com/marmelab/react-admin/pull/10654)) ([djhi](https://github.com/djhi))
12+
* [Doc] Rewrite `<AutocompleteArrayInput>` create doc example ([#10700](https://github.com/marmelab/react-admin/pull/10700)) ([Cimanel](https://github.com/Cimanel))
13+
* [chore] create-react-admin: Remove sourcemaps from production build ([#10693](https://github.com/marmelab/react-admin/pull/10693)) ([slax57](https://github.com/slax57))
14+
* Bump json-graphql-server to 3.2.0 ([#10713](https://github.com/marmelab/react-admin/pull/10713)) ([fzaninotto](https://github.com/fzaninotto))
15+
* Bump react-router from 7.1.1 to 7.5.3 ([#10712](https://github.com/marmelab/react-admin/pull/10712)) ([fzaninotto](https://github.com/fzaninotto))
16+
17+
## 5.7.4
18+
19+
* Fix `<FilterLiveForm>` compatibility with react-hook-form 7.55.0, part 2 ([#10697](https://github.com/marmelab/react-admin/pull/10697)) ([slax57](https://github.com/slax57))
20+
* Fix `<SelectInput>` shows gap in border when using no label with outlined variant ([#10692](https://github.com/marmelab/react-admin/pull/10692)) ([fzaninotto](https://github.com/fzaninotto))
21+
* Fix `canAccess` is called even when `disableAuthentication` is `true` ([#10691](https://github.com/marmelab/react-admin/pull/10691)) ([slax57](https://github.com/slax57))
22+
* [Doc] improve AutocompleteInput create example ([#10696](https://github.com/marmelab/react-admin/pull/10696)) ([Cimanel](https://github.com/Cimanel))
23+
* [Demo] Fix unneeded check in CRM demo ([#10694](https://github.com/marmelab/react-admin/pull/10694)) ([afilp](https://github.com/afilp))
24+
* [chore] ESLint: (re)enable import rules ([#10685](https://github.com/marmelab/react-admin/pull/10685)) ([slax57](https://github.com/slax57))
25+
26+
## 5.7.3
27+
28+
* Fix `<ShowGuesser>` print incorrect code for reference arrays ([#10682](https://github.com/marmelab/react-admin/pull/10682)) ([djhi](https://github.com/djhi))
29+
* Fix `<RichTextField>` should render `emptyText` when value is an empty string ([#10670](https://github.com/marmelab/react-admin/pull/10670)) ([slax57](https://github.com/slax57))
30+
* Fix TS error when using `EditGuesser` in module's default export ([#10669](https://github.com/marmelab/react-admin/pull/10669)) ([slax57](https://github.com/slax57))
31+
* Fix `useInput` default value overrides `null` ([#10665](https://github.com/marmelab/react-admin/pull/10665)) ([djhi](https://github.com/djhi))
32+
* [Doc] Fix `useNotify` custom notification with close example ([#10683](https://github.com/marmelab/react-admin/pull/10683)) ([djhi](https://github.com/djhi))
33+
* [doc] Add `AutoPersistInStore` doc page ([#10681](https://github.com/marmelab/react-admin/pull/10681)) ([erwanMarmelab](https://github.com/erwanMarmelab))
34+
* [Doc] Fix docs anchors ([#10675](https://github.com/marmelab/react-admin/pull/10675)) ([WiXSL](https://github.com/WiXSL))
35+
* [Doc] Fix Dialog Forms examples regarding `hasCreate` ([#10671](https://github.com/marmelab/react-admin/pull/10671)) ([slax57](https://github.com/slax57))
36+
* [Doc] Explain how React admin handles empty values ([#10666](https://github.com/marmelab/react-admin/pull/10666)) ([djhi](https://github.com/djhi))
37+
* [Doc] Update NextJS integration ([#10664](https://github.com/marmelab/react-admin/pull/10664)) ([djhi](https://github.com/djhi))
38+
* [Doc] Document how to setup Remix for production debugging ([#10663](https://github.com/marmelab/react-admin/pull/10663)) ([djhi](https://github.com/djhi))
39+
* [Demo] Use Echarts instead of rechart ([#10677](https://github.com/marmelab/react-admin/pull/10677)) ([fzaninotto](https://github.com/fzaninotto))
40+
* [Demo] Fix order chart currency ([#10668](https://github.com/marmelab/react-admin/pull/10668)) ([fzaninotto](https://github.com/fzaninotto))
41+
* Bump vite from 5.4.16 to 5.4.17 ([#10659](https://github.com/marmelab/react-admin/pull/10659)) ([dependabot[bot]](https://github.com/apps/dependabot))
42+
43+
## 5.7.2
44+
45+
* Fix `<FilterLiveForm>` compatibility with react-hook-form 7.55.0 ([#10657](https://github.com/marmelab/react-admin/pull/10657)) ([slax57](https://github.com/slax57))
46+
* Fix `<AutocompleteInput>` has hole in the outline when no `label` ([#10646](https://github.com/marmelab/react-admin/pull/10646)) ([slax57](https://github.com/slax57))
47+
* [Doc] Update `TranslationLocales.md` (Portuguese pt-pt) ([#10653](https://github.com/marmelab/react-admin/pull/10653)) ([PauloCoelhoP5](https://github.com/PauloCoelhoP5))
48+
* [Doc] Fix links and anchors ([#10658](https://github.com/marmelab/react-admin/pull/10658)) ([WiXSL](https://github.com/WiXSL))
49+
* [Doc] Improve `ra-realtime` doc to unlock record ([#10648](https://github.com/marmelab/react-admin/pull/10648)) ([erwanMarmelab](https://github.com/erwanMarmelab))
50+
* [Doc] Improve `<DatagridAg>` first screenshot ([#10647](https://github.com/marmelab/react-admin/pull/10647)) ([erwanMarmelab](https://github.com/erwanMarmelab))
51+
* [Doc] Fix documentation build ([#10644](https://github.com/marmelab/react-admin/pull/10644)) ([djhi](https://github.com/djhi))
52+
* [chore] Improve release script old version doc ([#10643](https://github.com/marmelab/react-admin/pull/10643)) ([djhi](https://github.com/djhi))
53+
54+
## 5.7.1
55+
56+
* Fix: Apply a default `defaultValue` on `ArrayInput` ([#10636](https://github.com/marmelab/react-admin/pull/10636)) ([erwanMarmelab](https://github.com/erwanMarmelab))
57+
* [Doc] Fix `<Layout error>` documentation ([#10642](https://github.com/marmelab/react-admin/pull/10642)) ([djhi](https://github.com/djhi))
58+
* [Doc] Improve `useNotify` custom notification example ([#10638](https://github.com/marmelab/react-admin/pull/10638)) ([djhi](https://github.com/djhi))
59+
* [Doc] Fix `useCreate` documentation ([#10632](https://github.com/marmelab/react-admin/pull/10632)) ([djhi](https://github.com/djhi))
60+
* [Doc] Fix tips loading in production ([#10630](https://github.com/marmelab/react-admin/pull/10630)) ([djhi](https://github.com/djhi))
61+
* [chore] Fix `create-react-admin` pnpm template ([#10631](https://github.com/marmelab/react-admin/pull/10631)) ([djhi](https://github.com/djhi))
62+
* [chore] Fix npm warnings when creating new app with `create-react-admin` ([#10622](https://github.com/marmelab/react-admin/pull/10622)) ([slax57](https://github.com/slax57))
63+
* [chore] Fix release script does not update documentation completely ([#10627](https://github.com/marmelab/react-admin/pull/10627)) ([djhi](https://github.com/djhi))
64+
* Bump vite from 5.4.15 to 5.4.16 ([#10633](https://github.com/marmelab/react-admin/pull/10633)) ([dependabot[bot]](https://github.com/apps/dependabot))
65+
* Bump vite from 5.4.14 to 5.4.15 ([#10626](https://github.com/marmelab/react-admin/pull/10626)) ([dependabot[bot]](https://github.com/apps/dependabot))
66+
367
## 5.7.0
468

569
* Introduce `useCloseNotification` hook ([#10614](https://github.com/marmelab/react-admin/pull/10614)) ([djhi](https://github.com/djhi))

cypress/.eslintrc

Lines changed: 0 additions & 7 deletions
This file was deleted.

docs/AccordionForm.md

Lines changed: 46 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ title: "AccordionForm"
55

66
# `<AccordionForm>`
77

8-
This [Enterprise Edition](https://react-admin-ee.marmelab.com)<img class="icon" src="./img/premium.svg" /> component offers an alternative layout for Edit and Create forms, where Inputs are grouped into expandable panels.
8+
This [Enterprise Edition](https://react-admin-ee.marmelab.com)<img class="icon" src="./img/premium.svg" alt="React Admin Enterprise Edition icon" /> component offers an alternative layout for Edit and Create forms, where Inputs are grouped into expandable panels.
99

1010
<video controls autoplay playsinline muted loop>
1111
<source src="https://react-admin-ee.marmelab.com/assets/ra-accordion-form-overview.mp4" type="video/mp4" />
@@ -504,19 +504,19 @@ This component renders a [Material UI `<Accordion>` component](https://mui.com/c
504504

505505
Here are all the props you can set on the `<AccordionForm.Panel>` component:
506506

507-
| Prop | Required | Type | Default | Description |
508-
| ----------------- | -------- | ----------------------- | ------- | ------------------------------------------------------------------------------------------------ |
509-
| `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. |
507+
| Prop | Required | Type | Default | Description |
508+
| ----------------- | -------- | ----------------------- | ------- |-------------------------------------------------------------------------------------------------------------------|
509+
| `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. |
520520

521521
```tsx
522522
import {
@@ -830,15 +830,43 @@ const PersonEdit = () => (
830830
```
831831
{% endraw %}
832832

833-
Note that you **must** set the `<AccordionForm 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.
833+
Check [the `<AutoSave>` component](./AutoSave.md) documentation for more details.
834834

835-
If you're using it in an `<Edit>` page, you must also use a `pessimistic` or `optimistic` [`mutationMode`](./Edit.md#mutationmode) - `<AutoSave>` doesn't work with the default `mutationMode="undoable"`.
835+
An alternative to the `<AutoSave>` component is to use [the `<AutoPersistInStore>` component](./AutoPersistInStore.md). This component saves the form values in the local storage of the browser. This way, if the user navigates away without saving, the form values are reapplied when the user comes back to the page. This is useful for long forms where users may spend a lot of time.
836836

837-
Check [the `<AutoSave>` component](./AutoSave.md) documentation for more details.
837+
To enable this behavior, add the `<AutoPersistInStore>` component inside the form component:
838+
839+
```tsx
840+
import { AccordionForm, AutoPersistInStore } from '@react-admin/ra-form-layout';
841+
import { Create, TextInput, DateInput, SelectInput } from 'react-admin';
842+
843+
const CustomerCreate = () => (
844+
<Create>
845+
<AccordionForm>
846+
<AccordionForm.Panel label="Identity">
847+
<TextInput source="first_name" />
848+
<TextInput source="last_name" />
849+
<DateInput source="born" />
850+
<SelectInput source="sex" choices={[
851+
{ id: 'male', name: 'Male' },
852+
{ id: 'female', name: 'Female' },
853+
{ id: 'other', name: 'Other' },
854+
]} />
855+
</AccordionForm.Panel>
856+
<AccordionForm.Panel label="Work">
857+
{/* ... */}
858+
</AccordionForm.Panel>
859+
<AutoPersistInStore />
860+
</AccordionForm>
861+
</Create>
862+
);
863+
```
864+
865+
Check [the `<AutoPersistInStore>` component](./AutoPersistInStore.md) documentation for more details.
838866

839867
## Access Control
840868

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`.
869+
`<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`.
842870

843871
Check the [`enableAccessControl` prop](#enableaccesscontrol) section for more details.
844872

docs/Admin.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1266,7 +1266,7 @@ You might want to dynamically define the resources when the app starts. To do so
12661266
12671267
### Using a Function As `<Admin>` Child
12681268
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).
12701270
12711271
For instance, getting the resource from an API might look like:
12721272

0 commit comments

Comments
 (0)