Skip to content

Commit 9f83cab

Browse files
committed
Merge remote-tracking branch 'origin/next' into support-offline-mode
2 parents 25ff38b + baecacd commit 9f83cab

File tree

372 files changed

+16109
-2979
lines changed

Some content is hidden

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

372 files changed

+16109
-2979
lines changed

.env.template

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
GITHUB_ACCESS_TOKEN=your_github_access_token
1+
GITHUB_ACCESS_TOKEN=your_github_access_token
2+
RA_ENTERPRISE_PATH=../ra-enterprise
3+
RA_DOC_PATH=../react-admin-doc

.eslintrc

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
],
3838
"no-redeclare": "off",
3939
"import/no-anonymous-default-export": "off",
40-
"@typescript-eslint/no-redeclare": ["error"],
40+
"@typescript-eslint/no-redeclare": "error",
4141
"no-unused-vars": "off",
4242
"@typescript-eslint/no-unused-vars": [
4343
"warn", // or "error"
@@ -48,5 +48,14 @@
4848
"ignoreRestSiblings": true,
4949
},
5050
],
51+
"import/no-extraneous-dependencies": ["error"],
5152
},
53+
"overrides": [
54+
{
55+
"files": ["*.stories.*", "*.spec.*", "**/examples/**"],
56+
"rules": {
57+
"import/no-extraneous-dependencies": ["off"],
58+
},
59+
},
60+
],
5261
}

.github/pull_request_template.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ _Describe the steps required to test the changes_
1212

1313
## Additional Checks
1414

15-
- [ ] The PR targets `master` for a bugfix, or `next` for a feature
15+
- [ ] The PR targets `master` for a bugfix or a documentation fix, or `next` for a feature
1616
- [ ] The PR includes **unit tests** (if not possible, describe why)
1717
- [ ] The PR includes one or several **stories** (if not possible, describe why)
1818
- [ ] The **documentation** is up to date

.github/workflows/test.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,10 +194,14 @@ jobs:
194194
- name: Run e-commerce
195195
# Run the demo in production mode
196196
run: cd ./examples/demo/dist && python3 -m http.server 4173 &
197+
- name: Install GreenFrame CLI
198+
run: curl https://assets.greenframe.io/install.sh | bash
199+
shell: bash
197200
- name: Run GreenFrame Analysis
198-
uses: marmelab/[email protected]
199201
env:
200202
GREENFRAME_SECRET_TOKEN: ${{secrets.GREENFRAME_SECRET_TOKEN}}
203+
run: greenframe analyze -C .greenframe.yml --branchName master
204+
shell: bash
201205

202206
create-react-admin:
203207
runs-on: ubuntu-latest

CHANGELOG.md

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

3+
## 5.7.0
4+
5+
* Introduce `useCloseNotification` hook ([#10614](https://github.com/marmelab/react-admin/pull/10614)) ([djhi](https://github.com/djhi))
6+
* Make `<RichTextInput>` fullWidth by default ([#10608](https://github.com/marmelab/react-admin/pull/10608)) ([erwanMarmelab](https://github.com/erwanMarmelab))
7+
* Add `<Translate>` component ([#10605](https://github.com/marmelab/react-admin/pull/10605)) ([erwanMarmelab](https://github.com/erwanMarmelab))
8+
* Improve empty `emptyText` handling for `<ChipField>` ([#10591](https://github.com/marmelab/react-admin/pull/10591)) ([guilbill](https://github.com/guilbill))
9+
* Add ability to pass empty `icon` to all Button components ([#10552](https://github.com/marmelab/react-admin/pull/10552)) ([djhi](https://github.com/djhi))
10+
* Add support for `mutationMode` in `useCreate` ([#10530](https://github.com/marmelab/react-admin/pull/10530)) ([djhi](https://github.com/djhi))
11+
* Fix `useGetOne` returns a never resolving Promise when `id` is `null` ([#10624](https://github.com/marmelab/react-admin/pull/10624)) ([slax57](https://github.com/slax57))
12+
* Fix `<EditGuesser>` produces invalid code for arrays of references ([#10619](https://github.com/marmelab/react-admin/pull/10619)) ([djhi](https://github.com/djhi))
13+
* [Doc] Backport `DatagridAG` doc ([#10618](https://github.com/marmelab/react-admin/pull/10618)) ([erwanMarmelab](https://github.com/erwanMarmelab))
14+
* [Doc] Add a FAQ entry for duplicate react-hook-form versions ([#10617](https://github.com/marmelab/react-admin/pull/10617)) ([djhi](https://github.com/djhi))
15+
* [Doc] fix broken link to useQuery documentation ([#10616](https://github.com/marmelab/react-admin/pull/10616)) ([thibault-barrat](https://github.com/thibault-barrat))
16+
* [Doc] Mention that `httpError` triggers a notification ([#10609](https://github.com/marmelab/react-admin/pull/10609)) ([erwanMarmelab](https://github.com/erwanMarmelab))
17+
* [Doc] Add a tips section on the home page ([#10541](https://github.com/marmelab/react-admin/pull/10541)) ([djhi](https://github.com/djhi))
18+
19+
## 5.6.4
20+
21+
* Improve compatibility with some package managers ([#10599](https://github.com/marmelab/react-admin/pull/10599)) ([djhi](https://github.com/djhi))
22+
* Fix SimpleFormIterator does not display some components correctly ([#10606](https://github.com/marmelab/react-admin/pull/10606)) ([djhi](https://github.com/djhi))
23+
* Fix `<AutcompleteInput>`, `<DateInput>` and `<DateTimeInput>` aren't focused when adding a new item in a `<ArrayInput>` ([#10582](https://github.com/marmelab/react-admin/pull/10582)) ([djhi](https://github.com/djhi))
24+
* Fix `useDataProvider` should only log errors in development mode ([#10515](https://github.com/marmelab/react-admin/pull/10515)) ([vytautassvirskas](https://github.com/vytautassvirskas))
25+
* [Doc] Add kanban board demo ([#10604](https://github.com/marmelab/react-admin/pull/10604)) ([djhi](https://github.com/djhi))
26+
* [Doc] Add strapi v5 data provider ([#10593](https://github.com/marmelab/react-admin/pull/10593)) ([fzaninotto](https://github.com/fzaninotto))
27+
* [Doc] upgrade multilevelmenu doc ([#10590](https://github.com/marmelab/react-admin/pull/10590)) ([erwanMarmelab](https://github.com/erwanMarmelab))
28+
* [Doc] Add a screenshot to the `Tree` doc page ([#10600](https://github.com/marmelab/react-admin/pull/10600)) ([erwanMarmelab](https://github.com/erwanMarmelab))
29+
* [Doc] Fix ra-i18n-next documentation by using correct function name `convertRaTranslationsToI18next` ([#10588](https://github.com/marmelab/react-admin/pull/10588)) ([guilbill](https://github.com/guilbill))
30+
* [Doc] Fix ra-18n-polyglot documentation ([#10587](https://github.com/marmelab/react-admin/pull/10587)) ([guilbill](https://github.com/guilbill))
31+
* [Doc] Add `<EditInDialogButton emptyWhileLoading>` prop documentation ([#10586](https://github.com/marmelab/react-admin/pull/10586)) ([guilbill](https://github.com/guilbill))
32+
* [Doc] Add documentation for `<AutoSave disableWarnWhenUnsavedChanges>` ([#10585](https://github.com/marmelab/react-admin/pull/10585)) ([guilbill](https://github.com/guilbill))
33+
* [Doc] Fix typo in `ShowDialog` doc ([#10583](https://github.com/marmelab/react-admin/pull/10583)) ([erwanMarmelab](https://github.com/erwanMarmelab))
34+
* [chore] Fix incorrect description for build-crm in Makefile ([#10603](https://github.com/marmelab/react-admin/pull/10603)) ([ghadabezine](https://github.com/ghadabezine))
35+
* [chore] Fix `<SimpleListConfigurable>` story ([#10592](https://github.com/marmelab/react-admin/pull/10592)) ([erwanMarmelab](https://github.com/erwanMarmelab))
36+
* [chore] Fix `<SelectAllButton>` limit story ([#10589](https://github.com/marmelab/react-admin/pull/10589)) ([guilbill](https://github.com/guilbill))
37+
* [chore] Fix release script add wrong minor in documentation versions list ([#10584](https://github.com/marmelab/react-admin/pull/10584)) ([djhi](https://github.com/djhi))
38+
* [chore] Automatically update create-react-admin templates when releasing a new minor version ([#10581](https://github.com/marmelab/react-admin/pull/10581)) ([djhi](https://github.com/djhi))
39+
* [chore] Add the tag message in release script ([#10578](https://github.com/marmelab/react-admin/pull/10578)) ([djhi](https://github.com/djhi))
40+
* Bump axios from 1.7.4 to 1.8.2 ([#10577](https://github.com/marmelab/react-admin/pull/10577)) ([dependabot[bot]](https://github.com/apps/dependabot))
41+
42+
## 5.6.3
43+
44+
* Fix `create-react-admin` should correctly generate `data.json` for fakerest ([#10573](https://github.com/marmelab/react-admin/pull/10573)) ([djhi](https://github.com/djhi))
45+
* Fix `useRedirect` might include two slashes in the final pathname ([#10572](https://github.com/marmelab/react-admin/pull/10572)) ([djhi](https://github.com/djhi))
46+
* Fix `helperText` has wrong height when passing an empty string ([#10571](https://github.com/marmelab/react-admin/pull/10571)) ([djhi](https://github.com/djhi))
47+
* Fix offline user experience ([#10555](https://github.com/marmelab/react-admin/pull/10555)) ([slax57](https://github.com/slax57))
48+
* [Doc] Add Todo app to the list of demos ([#10568](https://github.com/marmelab/react-admin/pull/10568)) ([fzaninotto](https://github.com/fzaninotto))
49+
* [Doc] Rewrite `create-react-admin` documentation ([#10566](https://github.com/marmelab/react-admin/pull/10566)) ([erwanMarmelab](https://github.com/erwanMarmelab))
50+
* [Doc] Add Vycanis Modeler to ecosystem page ([#10565](https://github.com/marmelab/react-admin/pull/10565)) ([alberteije](https://github.com/alberteije))
51+
* [Doc] Backport `ra-tree` v10 doc ([#10563](https://github.com/marmelab/react-admin/pull/10563)) ([erwanMarmelab](https://github.com/erwanMarmelab))
52+
* [Doc] Document how to return `Date` object with `<DateTimeInput>` ([#10561](https://github.com/marmelab/react-admin/pull/10561)) ([slax57](https://github.com/slax57))
53+
* [Doc] Improve `AutoSave` and `useAutoSave` ([#10558](https://github.com/marmelab/react-admin/pull/10558)) ([erwanMarmelab](https://github.com/erwanMarmelab))
54+
* [Typescript] Update `Error` component to accept `sx` prop ([#10559](https://github.com/marmelab/react-admin/pull/10559)) ([smeng9](https://github.com/smeng9))
55+
* [TypeScript] Remove usage of `JSX.Element` ([#10553](https://github.com/marmelab/react-admin/pull/10553)) ([djhi](https://github.com/djhi))
56+
* [chore] Skip pushing the documentation changes in release script when in dry mode ([#10576](https://github.com/marmelab/react-admin/pull/10576)) ([djhi](https://github.com/djhi))
57+
* [chore] Improve release script by automating documentation update ([#10575](https://github.com/marmelab/react-admin/pull/10575)) ([djhi](https://github.com/djhi))
58+
* [chore] Improve release script by automating enterprise packages tests ([#10574](https://github.com/marmelab/react-admin/pull/10574)) ([djhi](https://github.com/djhi))
59+
60+
## 5.6.2
61+
62+
* Make `<TabbedForm tabs>` use the `onChange` prop ([#10549](https://github.com/marmelab/react-admin/pull/10549)) ([erwanMarmelab](https://github.com/erwanMarmelab))
63+
* Fix B&W theme buttons in dark mode ([#10557](https://github.com/marmelab/react-admin/pull/10557)) ([fzaninotto](https://github.com/fzaninotto))
64+
* Fix create-react-admin generated package.json when using yarn ([#10556](https://github.com/marmelab/react-admin/pull/10556)) ([djhi](https://github.com/djhi))
65+
* Fix collapsed menu in B&W theme ([#10542](https://github.com/marmelab/react-admin/pull/10542)) ([fzaninotto](https://github.com/fzaninotto))
66+
* [Doc] Update `<MarkdownInput>` doc to address vulnerability in `dompurify` ([#10554](https://github.com/marmelab/react-admin/pull/10554)) ([slax57](https://github.com/slax57))
67+
* [Doc] Update `<ReferenceManyInput>` documentation to mention it cannot reorder its items ([#10551](https://github.com/marmelab/react-admin/pull/10551)) ([djhi](https://github.com/djhi))
68+
* [Doc] Improve `<FormFillerButton>` documentation by explaining the `dataProvider.getCompletion()` ([#10550](https://github.com/marmelab/react-admin/pull/10550)) ([djhi](https://github.com/djhi))
69+
* [Doc] Create a `ShowDialog` doc ([#10548](https://github.com/marmelab/react-admin/pull/10548)) ([erwanMarmelab](https://github.com/erwanMarmelab))
70+
* [Doc] Document `useSourceContext` and improve `useSimpleFormIteratorItem` documentation ([#10547](https://github.com/marmelab/react-admin/pull/10547)) ([slax57](https://github.com/slax57))
71+
* [Doc] Fix `<ReferenceInput enableGetChoices>` example ([#10543](https://github.com/marmelab/react-admin/pull/10543)) ([slax57](https://github.com/slax57))
72+
* [chore] Fix release script does not include the changelog in the tag ([#10544](https://github.com/marmelab/react-admin/pull/10544)) ([slax57](https://github.com/slax57))
73+
374
## 5.6.1
475

576
* Fix create-react-admin package manager detection ([#10534](https://github.com/marmelab/react-admin/pull/10534)) ([djhi](https://github.com/djhi))

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ run-graphql-demo: ## run the ecommerce example with a graphql backend
3636
run-crm: ## run the crm example
3737
@yarn run-crm
3838

39-
build-crm: ## run the crm example
39+
build-crm: ## build the crm example
4040
@yarn build-crm
4141

4242
build-ra-core:
@@ -112,7 +112,7 @@ build-create-react-admin:
112112
@echo "Transpiling create-react-admin files...";
113113
@cd ./packages/create-react-admin && yarn build
114114

115-
build: build-ra-core build-ra-data-fakerest build-ra-ui-materialui build-ra-data-json-server build-ra-data-local-forage build-ra-data-local-storage build-ra-data-simple-rest build-ra-data-graphql build-ra-data-graphql-simple build-ra-i18n-polyglot build-ra-input-rich-text build-data-generator build-ra-language-english build-ra-language-french build-ra-i18n-i18next build-react-admin build-ra-no-code build-create-react-admin ## compile ES6 files to JS
115+
build: build-ra-core build-ra-data-fakerest build-ra-ui-materialui build-ra-data-json-server build-ra-data-local-forage build-ra-data-local-storage build-ra-data-simple-rest build-ra-data-graphql build-ra-data-graphql-simple build-ra-input-rich-text build-data-generator build-ra-language-english build-ra-language-french build-ra-i18n-i18next build-ra-i18n-polyglot build-react-admin build-ra-no-code build-create-react-admin ## compile ES6 files to JS
116116

117117
doc: ## compile doc as html and launch doc web server
118118
@yarn doc

cypress/e2e/list.cy.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ describe('List Page', () => {
254254
.should(el => expect(el).to.have.attr('aria-expanded', 'true'))
255255
.should(el => expect(el).to.have.attr('aria-label', 'Close'));
256256

257-
cy.get('#13-expand').should(el =>
257+
cy.get('#posts-13-expand').should(el =>
258258
expect(el).to.contain(
259259
'Curabitur eu odio ullamcorper, pretium sem at, blandit libero. Nulla sodales facilisis libero, eu gravida tellus ultrices nec. In ut gravida mi. Vivamus finibus tortor tempus egestas lacinia. Cras eu arcu nisl. Donec pretium dolor ipsum, eget feugiat urna iaculis ut.'
260260
)
@@ -269,7 +269,7 @@ describe('List Page', () => {
269269
.should(el => expect(el).to.have.attr('aria-expanded', 'true'))
270270
.should(el => expect(el).to.have.attr('aria-label', 'Close'));
271271

272-
cy.get('#13-expand').should(el => expect(el).to.exist);
272+
cy.get('#posts-13-expand').should(el => expect(el).to.exist);
273273
cy.wait(500); // Ensure animations are done
274274

275275
cy.get('[aria-label="Expand"]')
@@ -278,7 +278,7 @@ describe('List Page', () => {
278278
.should(el => expect(el).to.have.attr('aria-expanded', 'true'))
279279
.should(el => expect(el).to.have.attr('aria-label', 'Close'));
280280

281-
cy.get('#12-expand').should(el => expect(el).to.exist);
281+
cy.get('#posts-12-expand').should(el => expect(el).to.exist);
282282

283283
let all_labels = [13, 12, 11, 10, 9, 8, 7, 6, 4, 2];
284284

@@ -294,7 +294,9 @@ describe('List Page', () => {
294294
cy.get('[aria-label="Expand"]').eq(0).click();
295295

296296
all_labels.forEach(label => {
297-
cy.get(`#${label}-expand`).should(el => expect(el).to.exist);
297+
cy.get(`#posts-${label}-expand`).should(
298+
el => expect(el).to.exist
299+
);
298300
});
299301
});
300302
});

cypress/support/ListPage.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ export default url => ({
1313
nextPage: "button[aria-label='Go to next page']",
1414
previousPage: "button[aria-label='Go to previous page']",
1515
pageNumber: n => `button[aria-label='Go to page ${n}']`,
16-
recordRows: '.datagrid-body tr',
17-
viewsColumn: '.datagrid-body tr td:nth-child(8)',
16+
recordRows: '.datatable-body tr.RaDataTable-row',
17+
viewsColumn: '.datatable-body tr td:nth-child(8)',
1818
datagridHeaders: 'th',
1919
sortBy: name => `th span[data-field="${name}"]`,
2020
svg: (name, criteria = '') =>

docs/Admin.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -906,7 +906,7 @@ React-admin uses [React Query](https://tanstack.com/query/v5/) to fetch, cache a
906906
* The query is optionally configured with a refetch interval
907907
* Query results that are no longer used in the current page are labeled as "inactive" and remain in the cache in case they are used again at a later time.
908908
* By default, "inactive" queries are garbage collected after 5 minutes.
909-
* Queries that fail are silently retried 3 times, with exponential backoff delay before capturing and displaying an error to the UI.
909+
* Queries that fail are silently retried 3 times, with exponential backoff delay before capturing and displaying an error notification to the UI.
910910
* Query results by default are structurally shared to detect if data have actually changed and if not, the data reference remains unchanged to better help with value stabilization in regard to `useMemo` and `useCallback`.
911911

912912
If you want to override the react-query default query and mutation default options, or use a specific client or mutation cache, you can create your own `QueryClient` instance and pass it to the `<Admin queryClient>` prop:

docs/AppTheme.md

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,24 @@ const theme = deepmerge(defaultTheme, {
356356
});
357357
```
358358

359+
This also works with many React Admin components. For instance, here's how to change the icon for all `<SaveButton>`:
360+
361+
```tsx
362+
import { defaultTheme } from 'react-admin';
363+
import { deepmerge } from '@mui/utils';
364+
import CheckIcon from '@mui/icons-material/Check';
365+
366+
const theme = deepmerge(defaultTheme, {
367+
components: {
368+
RaSaveButton: {
369+
defaultProps: {
370+
icon: <CheckIcon />,
371+
},
372+
},
373+
}
374+
});
375+
```
376+
359377
## Customizing The Sidebar Width
360378

361379
You can specify the `Sidebar` width by setting the `width` and `closedWidth` properties on your custom Material UI theme:
@@ -423,10 +441,11 @@ A `theme` object can contain the following keys:
423441

424442
**Tip**: Check [Material UI default theme documentation](https://mui.com/material-ui/customization/default-theme/) to see the default values and meaning for these keys.
425443

426-
```jsx
444+
```tsx
427445
import { lime, purple } from '@mui/material/colors';
446+
import type { ThemeOptions } from '@mui/material';
428447

429-
const theme = {
448+
const theme: ThemeOptions = {
430449
palette: {
431450
primary: {
432451
main: '#FF5733',
@@ -514,10 +533,10 @@ const myTheme = deepmerge(defaultTheme, {
514533
Here is the default theme:
515534

516535
```tsx
517-
import { RaThemeOptions } from './types';
536+
import type { ThemeOptions } from '@mui/material';
518537
import { deepmerge } from '@mui/utils';
519538

520-
const defaultThemeInvariants = {
539+
const defaultThemeInvariants: ThemeOptions = {
521540
typography: {
522541
h6: {
523542
fontWeight: 400,
@@ -578,7 +597,7 @@ const defaultThemeInvariants = {
578597
},
579598
};
580599

581-
export const defaultLightTheme: RaThemeOptions = deepmerge(
600+
export const defaultLightTheme: ThemeOptions = deepmerge(
582601
defaultThemeInvariants,
583602
{
584603
palette: {
@@ -607,7 +626,7 @@ export const defaultLightTheme: RaThemeOptions = deepmerge(
607626
}
608627
);
609628

610-
export const defaultDarkTheme: RaThemeOptions = deepmerge(
629+
export const defaultDarkTheme: ThemeOptions = deepmerge(
611630
defaultThemeInvariants,
612631
{
613632
palette: {
@@ -623,5 +642,4 @@ export const defaultDarkTheme: RaThemeOptions = deepmerge(
623642
);
624643

625644
export const defaultTheme = defaultLightTheme;
626-
627645
```

0 commit comments

Comments
 (0)