From d540d8840439a99420552aafc73454494b7d3a0d Mon Sep 17 00:00:00 2001 From: fzaninotto Date: Mon, 14 Dec 2020 09:57:36 +0100 Subject: [PATCH 01/27] Prepare changelog for v3.11 --- CHANGELOG.md | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a4c02e99fbf..b7af32c3ede 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,43 @@ # Changelog +## v3.11.0 + +Starting with this version, react-admin applications send an anonymous request on mount to a telemetry server operated by marmelab. You can see this request by looking at the Network tab of your browser DevTools: + +`https://react-admin-telemetry.marmelab.com/react-admin-telemetry` + +The only data sent to the telemetry server is the admin domain (e.g. "example.com") - no personal data is ever sent, and no cookie is included in the response. The react-admin team uses these domains to track the usage of the framework. + +You can opt out of telemetry by simply adding `disableTelemetry` to the `` component: + +```jsx +// in src/App.js +import * as React from "react"; +import { Admin } from 'react-admin'; + +const App = () => ( + + // ... + +); +``` + +* Add domain telemetry on app mount ([5631](https://github.com/marmelab/react-admin/pull/5631)) ([djhi](https://github.com/djhi)) +* Add ability to access (and override) side effects in `SaveContext` ([5604](https://github.com/marmelab/react-admin/pull/5604)) ([djhi](https://github.com/djhi)) +* Add support for `disabled` in `` ([5618](https://github.com/marmelab/react-admin/pull/5618)) ([fzaninotto](https://github.com/fzaninotto)) +* Disable ripple effect on Buttons for improved performance ([5598](https://github.com/marmelab/react-admin/pull/5598)) ([fzaninotto](https://github.com/fzaninotto)) +* Fix `` doesn't contain `notifications` node ([5659](https://github.com/marmelab/react-admin/pull/5659)) ([fzaninotto](https://github.com/fzaninotto)) +* Fix `` fails to show compound filters with no default value ([5657](https://github.com/marmelab/react-admin/pull/5657)) ([fzaninotto](https://github.com/fzaninotto)) +* Fix "Missing translation" console error when the `dataProvider` fails ([5655](https://github.com/marmelab/react-admin/pull/5655)) ([fzaninotto](https://github.com/fzaninotto)) +* Fix `` doesn't appear selected when more than one filter is applied ([5644](https://github.com/marmelab/react-admin/pull/5644)) ([fzaninotto](https://github.com/fzaninotto)) +* [Doc] Add `rowStyle` example usage to `` jsDoc ([5661](https://github.com/marmelab/react-admin/pull/5661)) ([vdimitroff](https://github.com/vdimitroff)) +* [Doc] Fix `` prop type to show that it accepts a function ([5660](https://github.com/marmelab/react-admin/pull/5660)) ([vdimitroff](https://github.com/vdimitroff)) +* [Doc] Fix missing import in `List` example ([5658](https://github.com/marmelab/react-admin/pull/5658)) ([WiXSL](https://github.com/WiXSL)) +* [Doc] Fix syntax error in `` prop usage ([5649](https://github.com/marmelab/react-admin/pull/5649)) ([WiXSL](https://github.com/WiXSL)) +* [Doc] Fix Sidebar size change resets the theme color ([5646](https://github.com/marmelab/react-admin/pull/5646)) ([zheya08](https://github.com/zheya08)) +* [Doc] Fix `` and `` JSDocs point to the wrong `dataProvider` method ([5645](https://github.com/marmelab/react-admin/pull/5645)) ([WiXSL](https://github.com/WiXSL)) +* [Doc] Add mention of saved queries in List chapter ([5638](https://github.com/marmelab/react-admin/pull/5638)) ([fzaninotto](https://github.com/fzaninotto)) + ## v3.10.4 * Fix `ra-data-simple-rest` delete method fails because of bad header ([5628](https://github.com/marmelab/react-admin/pull/5628)) ([fzaninotto](https://github.com/fzaninotto)) From 5b8b174ee74b626c5e105a8320f4de313d5420ff Mon Sep 17 00:00:00 2001 From: fzaninotto Date: Mon, 14 Dec 2020 10:07:01 +0100 Subject: [PATCH 02/27] Move async validators doc to a dedicated section --- docs/CreateEdit.md | 73 +++++++++++++++++++++++++--------------------- 1 file changed, 40 insertions(+), 33 deletions(-) diff --git a/docs/CreateEdit.md b/docs/CreateEdit.md index 230eb7aab69..a1a9123cdf5 100644 --- a/docs/CreateEdit.md +++ b/docs/CreateEdit.md @@ -1092,37 +1092,7 @@ export const UserCreate = (props) => ( **Tip**: The props you pass to `` and `` are passed to the [
](https://final-form.org/docs/react-final-form/api/Form) of `react-final-form`. -**Tip**: The `validate` function can return a promise for asynchronous validation. For instance: - -```jsx -const validateUserCreation = async (values) => { - const errors = {}; - if (!values.firstName) { - errors.firstName = ['The firstName is required']; - } - if (!values.age) { - errors.age = ['The age is required']; - } else if (values.age < 18) { - errors.age = ['Must be over 18']; - } - - const isEmailUnique = await checkEmailIsUnique(values.userName); - if (!isEmailUnique) { - errors.email = ['Email already used']; - } - return errors -}; - -export const UserCreate = (props) => ( - - - - - - - -); -``` +**Tip**: The `validate` function can return a promise for asynchronous validation. See [the Server-Side Validation section](#server-side-validation) below. ### Per Input Validation: Built-in Field Validators @@ -1289,7 +1259,43 @@ export const ProductEdit = ({ ...props }) => ( **Tip**: You can use *both* Form validation and input validation. -**Tip**: The custom validator function can return a promise for asynchronous validation. For instance: +**Tip**: The custom validator function can return a promise, e.g. to use server-side validation. See next section for details. + +### Server-Side Validation + +You can validate the entire form data server-side by returning a Promise in the form `validate` function. For instance: + +```jsx +const validateUserCreation = async (values) => { + const errors = {}; + if (!values.firstName) { + errors.firstName = ['The firstName is required']; + } + if (!values.age) { + errors.age = ['The age is required']; + } else if (values.age < 18) { + errors.age = ['Must be over 18']; + } + + const isEmailUnique = await checkEmailIsUnique(values.userName); + if (!isEmailUnique) { + errors.email = ['Email already used']; + } + return errors +}; + +export const UserCreate = (props) => ( + + + + + + + +); +``` + +Per Input validators can also return a Promise to call the server for validation. For instance: ```jsx const validateEmailUnicity = async (value) => { @@ -1321,7 +1327,8 @@ export const UserCreate = (props) => ( ); ``` -**Important**: Note that asynchronous validators are not supported on the `ArrayInput` component due to a limitation of [react-final-form-arrays](https://github.com/final-form/react-final-form-arrays). +**Important**: Note that asynchronous validators are not supported on the `` component due to a limitation of [react-final-form-arrays](https://github.com/final-form/react-final-form-arrays). + ## Submit On Enter By default, pressing `ENTER` in any of the form fields submits the form - this is the expected behavior in most cases. However, some of your custom input components (e.g. Google Maps widget) may have special handlers for the `ENTER` key. In that case, to disable the automated form submission on enter, set the `submitOnEnter` prop of the form component to `false`: From 0e1066b3203f14da842e6bf54af51fd3abd5b086 Mon Sep 17 00:00:00 2001 From: fzaninotto Date: Mon, 14 Dec 2020 10:27:07 +0100 Subject: [PATCH 03/27] v3.11.0 --- lerna.json | 2 +- packages/ra-core/package.json | 2 +- packages/ra-data-json-server/package.json | 4 ++-- packages/ra-i18n-polyglot/package.json | 4 ++-- packages/ra-language-english/package.json | 4 ++-- packages/ra-language-french/package.json | 4 ++-- packages/ra-ui-materialui/package.json | 4 ++-- packages/react-admin/package.json | 10 +++++----- 8 files changed, 17 insertions(+), 17 deletions(-) diff --git a/lerna.json b/lerna.json index b60c3ffd305..255e7976179 100644 --- a/lerna.json +++ b/lerna.json @@ -4,5 +4,5 @@ "examples/data-generator", "packages/*" ], - "version": "3.10.4" + "version": "3.11.0" } diff --git a/packages/ra-core/package.json b/packages/ra-core/package.json index a1fcfe3c1d4..8781b462359 100644 --- a/packages/ra-core/package.json +++ b/packages/ra-core/package.json @@ -1,6 +1,6 @@ { "name": "ra-core", - "version": "3.10.4", + "version": "3.11.0", "description": "Core components of react-admin, a frontend Framework for building admin applications on top of REST services, using ES6, React", "files": [ "*.md", diff --git a/packages/ra-data-json-server/package.json b/packages/ra-data-json-server/package.json index 104e5e981d2..d2ef7f4ab2c 100644 --- a/packages/ra-data-json-server/package.json +++ b/packages/ra-data-json-server/package.json @@ -1,6 +1,6 @@ { "name": "ra-data-json-server", - "version": "3.10.4", + "version": "3.11.0", "description": "JSON Server data provider for react-admin", "main": "lib/index.js", "module": "esm/index.js", @@ -26,7 +26,7 @@ }, "dependencies": { "query-string": "^5.1.1", - "ra-core": "^3.10.4" + "ra-core": "^3.11.0" }, "devDependencies": { "cross-env": "^5.2.0", diff --git a/packages/ra-i18n-polyglot/package.json b/packages/ra-i18n-polyglot/package.json index a431ee26e83..52b31c224e8 100644 --- a/packages/ra-i18n-polyglot/package.json +++ b/packages/ra-i18n-polyglot/package.json @@ -1,6 +1,6 @@ { "name": "ra-i18n-polyglot", - "version": "3.10.4", + "version": "3.11.0", "description": "Polyglot i18n provider for react-admin", "main": "lib/index.js", "module": "esm/index.js", @@ -26,7 +26,7 @@ }, "dependencies": { "node-polyglot": "^2.2.2", - "ra-core": "^3.10.4" + "ra-core": "^3.11.0" }, "devDependencies": { "cross-env": "^5.2.0", diff --git a/packages/ra-language-english/package.json b/packages/ra-language-english/package.json index 5aaa015e8d5..4beb55df416 100644 --- a/packages/ra-language-english/package.json +++ b/packages/ra-language-english/package.json @@ -1,6 +1,6 @@ { "name": "ra-language-english", - "version": "3.10.4", + "version": "3.11.0", "description": "English messages for react-admin, the frontend framework for building admin applications on top of REST/GraphQL services", "repository": { "type": "git", @@ -22,7 +22,7 @@ "watch": "tsc --outDir esm --module es2015 --watch" }, "dependencies": { - "ra-core": "^3.10.4" + "ra-core": "^3.11.0" }, "keywords": [ "react", diff --git a/packages/ra-language-french/package.json b/packages/ra-language-french/package.json index e4e63f0c73d..c8b2164ae19 100644 --- a/packages/ra-language-french/package.json +++ b/packages/ra-language-french/package.json @@ -1,6 +1,6 @@ { "name": "ra-language-french", - "version": "3.10.4", + "version": "3.11.0", "description": "French messages for react-admin, the frontend framework for building admin applications on top of REST/GraphQL services", "repository": { "type": "git", @@ -16,7 +16,7 @@ "watch": "tsc --outDir esm --module es2015 --watch" }, "dependencies": { - "ra-core": "^3.10.4" + "ra-core": "^3.11.0" }, "keywords": [ "react", diff --git a/packages/ra-ui-materialui/package.json b/packages/ra-ui-materialui/package.json index 9b5547a558c..1aecd2260b1 100644 --- a/packages/ra-ui-materialui/package.json +++ b/packages/ra-ui-materialui/package.json @@ -1,6 +1,6 @@ { "name": "ra-ui-materialui", - "version": "3.10.4", + "version": "3.11.0", "description": "UI Components for react-admin with MaterialUI", "files": [ "*.md", @@ -38,7 +38,7 @@ "final-form": "^4.20.0", "final-form-arrays": "^3.0.1", "ignore-styles": "~5.0.1", - "ra-core": "^3.10.4", + "ra-core": "^3.11.0", "react": "^17.0.0", "react-dom": "^17.0.0", "react-final-form": "^6.5.0", diff --git a/packages/react-admin/package.json b/packages/react-admin/package.json index a6993979303..506f2f356f9 100644 --- a/packages/react-admin/package.json +++ b/packages/react-admin/package.json @@ -1,6 +1,6 @@ { "name": "react-admin", - "version": "3.10.4", + "version": "3.11.0", "description": "A frontend Framework for building admin applications on top of REST services, using ES6, React and Material UI", "files": [ "*.md", @@ -40,10 +40,10 @@ "connected-react-router": "^6.5.2", "final-form": "^4.18.5", "final-form-arrays": "^3.0.1", - "ra-core": "^3.10.4", - "ra-i18n-polyglot": "^3.10.4", - "ra-language-english": "^3.10.4", - "ra-ui-materialui": "^3.10.4", + "ra-core": "^3.11.0", + "ra-i18n-polyglot": "^3.11.0", + "ra-language-english": "^3.11.0", + "ra-ui-materialui": "^3.11.0", "react-final-form": "^6.3.3", "react-final-form-arrays": "^3.1.1", "react-redux": "^7.1.0", From a2dc26391210bfc4f6c25ba8eceaa2038d8e23a5 Mon Sep 17 00:00:00 2001 From: Gildas Garcia <1122076+djhi@users.noreply.github.com> Date: Mon, 14 Dec 2020 17:24:43 +0100 Subject: [PATCH 04/27] Optimize References Loaders Display --- .../ra-ui-materialui/src/field/ReferenceArrayField.tsx | 4 ++-- packages/ra-ui-materialui/src/field/ReferenceField.tsx | 5 +++-- .../ra-ui-materialui/src/input/ReferenceArrayInput.tsx | 4 ++-- packages/ra-ui-materialui/src/input/ReferenceInput.tsx | 4 ++-- .../src/layout/LinearProgressIfTooLong.tsx | 9 +++++++++ 5 files changed, 18 insertions(+), 8 deletions(-) create mode 100644 packages/ra-ui-materialui/src/layout/LinearProgressIfTooLong.tsx diff --git a/packages/ra-ui-materialui/src/field/ReferenceArrayField.tsx b/packages/ra-ui-materialui/src/field/ReferenceArrayField.tsx index 5da928cb5ab..e2243371e17 100644 --- a/packages/ra-ui-materialui/src/field/ReferenceArrayField.tsx +++ b/packages/ra-ui-materialui/src/field/ReferenceArrayField.tsx @@ -1,7 +1,6 @@ import * as React from 'react'; import { Children, cloneElement, FC, memo, ReactElement } from 'react'; import PropTypes from 'prop-types'; -import { LinearProgress } from '@material-ui/core'; import { makeStyles } from '@material-ui/core/styles'; import { ListContextProvider, @@ -16,6 +15,7 @@ import { import { fieldPropTypes, PublicFieldProps, InjectedFieldProps } from './types'; import { ClassesOverride } from '../types'; import sanitizeFieldRestProps from './sanitizeFieldRestProps'; +import { LinearProgressIfTooLong } from '../layout/LinearProgressIfTooLong'; /** * A container component that fetches records from another resource specified @@ -175,7 +175,7 @@ export const ReferenceArrayFieldView: FC = props = const { loaded } = useListContext(props); if (!loaded) { - return ; + return ; } return ( diff --git a/packages/ra-ui-materialui/src/field/ReferenceField.tsx b/packages/ra-ui-materialui/src/field/ReferenceField.tsx index 6847c25ce7f..3d0445858ba 100644 --- a/packages/ra-ui-materialui/src/field/ReferenceField.tsx +++ b/packages/ra-ui-materialui/src/field/ReferenceField.tsx @@ -15,11 +15,11 @@ import { Record, } from 'ra-core'; -import LinearProgress from '../layout/LinearProgress'; import Link from '../Link'; import sanitizeFieldRestProps from './sanitizeFieldRestProps'; import { PublicFieldProps, fieldPropTypes, InjectedFieldProps } from './types'; import { ClassesOverride } from '../types'; +import { LinearProgressIfTooLong } from '../layout/LinearProgressIfTooLong'; /** * Fetch reference record, and delegate rendering to child component. @@ -194,8 +194,9 @@ export const ReferenceFieldView: FC = props => { ...rest } = props; const classes = useStyles(props); + if (!loaded) { - return ; + return ; } if (error) { return ( diff --git a/packages/ra-ui-materialui/src/input/ReferenceArrayInput.tsx b/packages/ra-ui-materialui/src/input/ReferenceArrayInput.tsx index 5aa1f561347..fae1b73f552 100644 --- a/packages/ra-ui-materialui/src/input/ReferenceArrayInput.tsx +++ b/packages/ra-ui-materialui/src/input/ReferenceArrayInput.tsx @@ -14,7 +14,7 @@ import { } from 'ra-core'; import sanitizeInputRestProps from './sanitizeInputRestProps'; -import LinearProgress from '../layout/LinearProgress'; +import { LinearProgressIfTooLong } from '../layout/LinearProgressIfTooLong'; import Labeled from './Labeled'; import ReferenceError from './ReferenceError'; import { FieldInputProps, FieldMetaState } from 'react-final-form'; @@ -261,7 +261,7 @@ export const ReferenceArrayInputView = ({ className={className} isRequired={isRequired} > - + ); } diff --git a/packages/ra-ui-materialui/src/input/ReferenceInput.tsx b/packages/ra-ui-materialui/src/input/ReferenceInput.tsx index 22cea4be65c..87622ec5d28 100644 --- a/packages/ra-ui-materialui/src/input/ReferenceInput.tsx +++ b/packages/ra-ui-materialui/src/input/ReferenceInput.tsx @@ -17,9 +17,9 @@ import { } from 'ra-core'; import sanitizeInputRestProps from './sanitizeInputRestProps'; -import LinearProgress from '../layout/LinearProgress'; import Labeled from './Labeled'; import ReferenceError from './ReferenceError'; +import { LinearProgressIfTooLong } from '../layout/LinearProgressIfTooLong'; /** * An Input component for choosing a reference record. Useful for foreign keys. @@ -231,7 +231,7 @@ export const ReferenceInputView: FunctionComponent = ({ meta={meta} input={input} > - + ); } diff --git a/packages/ra-ui-materialui/src/layout/LinearProgressIfTooLong.tsx b/packages/ra-ui-materialui/src/layout/LinearProgressIfTooLong.tsx new file mode 100644 index 00000000000..437a2aad728 --- /dev/null +++ b/packages/ra-ui-materialui/src/layout/LinearProgressIfTooLong.tsx @@ -0,0 +1,9 @@ +import { useTimeout } from 'ra-core'; +import * as React from 'react'; +import LinearProgress from './LinearProgress'; + +export const LinearProgressIfTooLong = ({ timeout = 1000, ...props }) => { + const oneSecondHasPassed = useTimeout(timeout); + + return oneSecondHasPassed ? : null; +}; From 6041ef65949a1d45fc14bdba3635abd4050ce7a4 Mon Sep 17 00:00:00 2001 From: Paulo Viana Date: Mon, 14 Dec 2020 18:24:15 -0400 Subject: [PATCH 05/27] Fix typos in Tutorial doc --- docs/Tutorial.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/Tutorial.md b/docs/Tutorial.md index 739959ab928..4e90b12d3e2 100644 --- a/docs/Tutorial.md +++ b/docs/Tutorial.md @@ -472,7 +472,7 @@ import { Edit, SimpleForm, ReferenceInput, - SelectIpnut, + SelectInput, TextInput, } from 'react-admin'; @@ -534,7 +534,7 @@ import { + Create, SimpleForm, ReferenceInput, - SelectIpnut, + SelectInput, TextInput, } from 'react-admin'; From 05de98261a2151a46b9e0619aa4639d30edf018e Mon Sep 17 00:00:00 2001 From: rkfg Date: Tue, 15 Dec 2020 14:41:39 +0300 Subject: [PATCH 06/27] Remove min width in confirmation dialog --- packages/ra-ui-materialui/src/layout/Confirm.tsx | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/packages/ra-ui-materialui/src/layout/Confirm.tsx b/packages/ra-ui-materialui/src/layout/Confirm.tsx index 3f25271e320..dc2d3c4b7fb 100644 --- a/packages/ra-ui-materialui/src/layout/Confirm.tsx +++ b/packages/ra-ui-materialui/src/layout/Confirm.tsx @@ -16,9 +16,6 @@ import { useTranslate } from 'ra-core'; const useStyles = makeStyles( theme => ({ - contentText: { - minWidth: 400, - }, confirmPrimary: { color: theme.palette.primary.main, }, @@ -97,7 +94,7 @@ const Confirm: FC = props => { {translate(title, { _: title, ...translateOptions })} - + {translate(content, { _: content, ...translateOptions, From d14faf25b2c592e0b7fbdd651bf82248274f38b6 Mon Sep 17 00:00:00 2001 From: Gildas Garcia <1122076+djhi@users.noreply.github.com> Date: Tue, 15 Dec 2020 15:51:56 +0100 Subject: [PATCH 07/27] Fix tests --- .../src/field/ReferenceArrayField.spec.tsx | 4 +- .../src/field/ReferenceField.spec.tsx | 49 ++++++++++++++----- .../src/field/ReferenceField.tsx | 7 +-- .../src/input/ReferenceArrayInput.spec.js | 21 +++++++- .../src/input/ReferenceInput.spec.tsx | 20 +++++++- 5 files changed, 82 insertions(+), 19 deletions(-) diff --git a/packages/ra-ui-materialui/src/field/ReferenceArrayField.spec.tsx b/packages/ra-ui-materialui/src/field/ReferenceArrayField.spec.tsx index d6e3526113f..b3ebad26d44 100644 --- a/packages/ra-ui-materialui/src/field/ReferenceArrayField.spec.tsx +++ b/packages/ra-ui-materialui/src/field/ReferenceArrayField.spec.tsx @@ -10,7 +10,7 @@ import SingleFieldList from '../list/SingleFieldList'; describe('', () => { afterEach(cleanup); - it('should render a loading indicator when related records are not yet fetched', () => { + it('should render a loading indicator when related records are not yet fetched and a second has passed', async () => { const { queryAllByRole } = render( ', () => { ); + + await new Promise(resolve => setTimeout(resolve, 1001)); expect(queryAllByRole('progressbar')).toHaveLength(1); }); diff --git a/packages/ra-ui-materialui/src/field/ReferenceField.spec.tsx b/packages/ra-ui-materialui/src/field/ReferenceField.spec.tsx index b96098b7c41..a7e5a1fbffc 100644 --- a/packages/ra-ui-materialui/src/field/ReferenceField.spec.tsx +++ b/packages/ra-ui-materialui/src/field/ReferenceField.spec.tsx @@ -9,20 +9,43 @@ import TextField from './TextField'; describe('', () => { afterEach(cleanup); + const record = { id: 123, postId: 123 }; describe('Progress bar', () => { - it('should display a loader on mount if the reference is not in the store', () => { + it("should not display a loader on mount if the reference is not in the store and a second hasn't passed yet", async () => { const { queryByRole, container } = renderWithRedux( - - + + ); + await new Promise(resolve => setTimeout(resolve, 500)); + expect(queryByRole('progressbar')).toBeNull(); + const links = container.getElementsByTagName('a'); + expect(links).toHaveLength(0); + }); + it('should display a loader on mount if the reference is not in the store and a second has passed', async () => { + const { queryByRole, container } = renderWithRedux( + + + ); + await new Promise(resolve => setTimeout(resolve, 1001)); expect(queryByRole('progressbar')).not.toBeNull(); const links = container.getElementsByTagName('a'); expect(links).toHaveLength(0); @@ -32,7 +55,7 @@ describe('', () => { const { queryByRole, container } = renderWithRedux( ', () => { ', () => { // @ts-ignore-line ', () => { // @ts-ignore-line ', () => { const { container, getByText } = renderWithRedux( ', () => { ', () => { // @ts-ignore-line ', () => { const { container } = render( ', () => { it('should render no link when resourceLinkPath is not specified', () => { const { container } = render( only accepts a single child'); } - const { basePath, resource } = props; + const { basePath, resource, reference } = props; const resourceLinkPath = getResourceLinkPath({ ...props, resource, @@ -147,12 +147,13 @@ export const NonEmptyReferenceField: FC + ', () => { translate: x => `*${x}*`, }; - it('should render a progress bar if loading is true', () => { + it("should render a progress bar if loading is true and a second hasn't passed", async () => { const MyComponent = () =>
MyComponent
; const { queryByRole, queryByText } = render( ', () => { ); + await new Promise(resolve => setTimeout(resolve, 250)); + expect(queryByRole('progressbar')).toBeNull(); + expect(queryByText('MyComponent')).toBeNull(); + }); + + it('should render a progress bar if loading is true and a second has passed', async () => { + const MyComponent = () =>
MyComponent
; + const { queryByRole, queryByText } = render( + + + + ); + await new Promise(resolve => setTimeout(resolve, 1001)); expect(queryByRole('progressbar')).not.toBeNull(); expect(queryByText('MyComponent')).toBeNull(); }); diff --git a/packages/ra-ui-materialui/src/input/ReferenceInput.spec.tsx b/packages/ra-ui-materialui/src/input/ReferenceInput.spec.tsx index 2133fc801f8..6d3a250f9df 100644 --- a/packages/ra-ui-materialui/src/input/ReferenceInput.spec.tsx +++ b/packages/ra-ui-materialui/src/input/ReferenceInput.spec.tsx @@ -59,7 +59,7 @@ describe('', () => { afterEach(cleanup); - it('should render a LinearProgress if loading is true', () => { + it('should render a LinearProgress if loading is true and a second has passed', async () => { const { queryByRole } = render( ', () => { ); + await new Promise(resolve => setTimeout(resolve, 1001)); expect(queryByRole('progressbar')).not.toBeNull(); }); + it("should not render a LinearProgress if loading is true and a second hasn't passed", async () => { + const { queryByRole } = render( + + + + ); + + await new Promise(resolve => setTimeout(resolve, 250)); + expect(queryByRole('progressbar')).toBeNull(); + }); + it('should not render a LinearProgress if loading is false', () => { const { queryByRole } = render( Date: Tue, 15 Dec 2020 17:21:55 +0100 Subject: [PATCH 08/27] Apply review --- .../src/field/ReferenceArrayField.tsx | 4 ++-- .../src/field/ReferenceField.tsx | 4 ++-- .../src/input/ReferenceArrayInput.spec.js | 2 +- .../src/input/ReferenceArrayInput.tsx | 4 ++-- .../src/input/ReferenceInput.tsx | 4 ++-- .../src/layout/LinearProgress.tsx | 20 +++++++++++++++---- .../src/layout/LinearProgressIfTooLong.tsx | 9 --------- packages/ra-ui-materialui/src/layout/index.ts | 3 ++- 8 files changed, 27 insertions(+), 23 deletions(-) delete mode 100644 packages/ra-ui-materialui/src/layout/LinearProgressIfTooLong.tsx diff --git a/packages/ra-ui-materialui/src/field/ReferenceArrayField.tsx b/packages/ra-ui-materialui/src/field/ReferenceArrayField.tsx index e2243371e17..04a06a546cf 100644 --- a/packages/ra-ui-materialui/src/field/ReferenceArrayField.tsx +++ b/packages/ra-ui-materialui/src/field/ReferenceArrayField.tsx @@ -15,7 +15,7 @@ import { import { fieldPropTypes, PublicFieldProps, InjectedFieldProps } from './types'; import { ClassesOverride } from '../types'; import sanitizeFieldRestProps from './sanitizeFieldRestProps'; -import { LinearProgressIfTooLong } from '../layout/LinearProgressIfTooLong'; +import { LinearProgress } from '../layout'; /** * A container component that fetches records from another resource specified @@ -175,7 +175,7 @@ export const ReferenceArrayFieldView: FC = props = const { loaded } = useListContext(props); if (!loaded) { - return ; + return ; } return ( diff --git a/packages/ra-ui-materialui/src/field/ReferenceField.tsx b/packages/ra-ui-materialui/src/field/ReferenceField.tsx index 1821c2dd621..e82276334bc 100644 --- a/packages/ra-ui-materialui/src/field/ReferenceField.tsx +++ b/packages/ra-ui-materialui/src/field/ReferenceField.tsx @@ -19,7 +19,7 @@ import Link from '../Link'; import sanitizeFieldRestProps from './sanitizeFieldRestProps'; import { PublicFieldProps, fieldPropTypes, InjectedFieldProps } from './types'; import { ClassesOverride } from '../types'; -import { LinearProgressIfTooLong } from '../layout/LinearProgressIfTooLong'; +import { LinearProgress } from '../layout'; /** * Fetch reference record, and delegate rendering to child component. @@ -197,7 +197,7 @@ export const ReferenceFieldView: FC = props => { const classes = useStyles(props); if (!loaded) { - return ; + return ; } if (error) { return ( diff --git a/packages/ra-ui-materialui/src/input/ReferenceArrayInput.spec.js b/packages/ra-ui-materialui/src/input/ReferenceArrayInput.spec.js index 6cb0de40def..6b34638f6c0 100644 --- a/packages/ra-ui-materialui/src/input/ReferenceArrayInput.spec.js +++ b/packages/ra-ui-materialui/src/input/ReferenceArrayInput.spec.js @@ -15,7 +15,7 @@ describe('', () => { translate: x => `*${x}*`, }; - it("should render a progress bar if loading is true and a second hasn't passed", async () => { + it("should not render a progress bar if loading is true and a second hasn't passed", async () => { const MyComponent = () =>
MyComponent
; const { queryByRole, queryByText } = render( - + ); } diff --git a/packages/ra-ui-materialui/src/input/ReferenceInput.tsx b/packages/ra-ui-materialui/src/input/ReferenceInput.tsx index 87622ec5d28..c7547297a5a 100644 --- a/packages/ra-ui-materialui/src/input/ReferenceInput.tsx +++ b/packages/ra-ui-materialui/src/input/ReferenceInput.tsx @@ -19,7 +19,7 @@ import { import sanitizeInputRestProps from './sanitizeInputRestProps'; import Labeled from './Labeled'; import ReferenceError from './ReferenceError'; -import { LinearProgressIfTooLong } from '../layout/LinearProgressIfTooLong'; +import { LinearProgress } from '../layout'; /** * An Input component for choosing a reference record. Useful for foreign keys. @@ -231,7 +231,7 @@ export const ReferenceInputView: FunctionComponent = ({ meta={meta} input={input} > - + ); } diff --git a/packages/ra-ui-materialui/src/layout/LinearProgress.tsx b/packages/ra-ui-materialui/src/layout/LinearProgress.tsx index e990ac25640..68f51bddd00 100644 --- a/packages/ra-ui-materialui/src/layout/LinearProgress.tsx +++ b/packages/ra-ui-materialui/src/layout/LinearProgress.tsx @@ -1,8 +1,11 @@ import * as React from 'react'; -import Progress from '@material-ui/core/LinearProgress'; +import Progress, { + LinearProgressProps as ProgressProps, +} from '@material-ui/core/LinearProgress'; import PropTypes from 'prop-types'; import { makeStyles } from '@material-ui/core/styles'; import classnames from 'classnames'; +import { useTimeout } from 'ra-core'; const useStyles = makeStyles( theme => ({ @@ -24,18 +27,27 @@ const useStyles = makeStyles( * * @param {Object} classes CSS class names */ -const LinearProgress = props => { +const LinearProgress = ({ timeout = 1000, ...props }: LinearProgressProps) => { const { classes: classesOverride, className, ...rest } = props; const classes = useStyles(props); - return ( + const oneSecondHasPassed = useTimeout(timeout); + + return oneSecondHasPassed ? ( - ); + ) : null; }; + LinearProgress.propTypes = { classes: PropTypes.object, className: PropTypes.string, + timeout: PropTypes.number, }; + // wat? TypeScript looses the displayName if we don't set it explicitly LinearProgress.displayName = 'LinearProgress'; +export interface LinearProgressProps extends ProgressProps { + timeout?: number; +} + export default LinearProgress; diff --git a/packages/ra-ui-materialui/src/layout/LinearProgressIfTooLong.tsx b/packages/ra-ui-materialui/src/layout/LinearProgressIfTooLong.tsx deleted file mode 100644 index 437a2aad728..00000000000 --- a/packages/ra-ui-materialui/src/layout/LinearProgressIfTooLong.tsx +++ /dev/null @@ -1,9 +0,0 @@ -import { useTimeout } from 'ra-core'; -import * as React from 'react'; -import LinearProgress from './LinearProgress'; - -export const LinearProgressIfTooLong = ({ timeout = 1000, ...props }) => { - const oneSecondHasPassed = useTimeout(timeout); - - return oneSecondHasPassed ? : null; -}; diff --git a/packages/ra-ui-materialui/src/layout/index.ts b/packages/ra-ui-materialui/src/layout/index.ts index 10a4e673615..7ca62dcf6e8 100644 --- a/packages/ra-ui-materialui/src/layout/index.ts +++ b/packages/ra-ui-materialui/src/layout/index.ts @@ -9,7 +9,7 @@ import HideOnScroll, { HideOnScrollProps } from './HideOnScroll'; import Layout, { LayoutProps } from './Layout'; import Loading from './Loading'; import LoadingPage from './LoadingPage'; -import LinearProgress from './LinearProgress'; +import LinearProgress, { LinearProgressProps } from './LinearProgress'; import LoadingIndicator from './LoadingIndicator'; import Menu, { MenuProps } from './Menu'; import MenuItemLink, { MenuItemLinkProps } from './MenuItemLink'; @@ -57,6 +57,7 @@ export type { ErrorProps, HideOnScrollProps, LayoutProps, + LinearProgressProps, MenuItemLinkProps, MenuProps, ResponsiveProps, From b5cc365df792ef357f1cb2748c234b0bfb22a833 Mon Sep 17 00:00:00 2001 From: fzaninotto Date: Tue, 15 Dec 2020 17:55:54 +0100 Subject: [PATCH 09/27] Fix ExportButton doesn't take permanent filter into account Closes #5286 --- packages/ra-core/src/controller/useListController.ts | 2 ++ packages/ra-core/src/controller/useListParams.ts | 8 +------- packages/ra-ui-materialui/src/button/ExportButton.tsx | 6 +++++- packages/ra-ui-materialui/src/types.ts | 3 ++- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/packages/ra-core/src/controller/useListController.ts b/packages/ra-core/src/controller/useListController.ts index ea4e46597b2..38c751d1d36 100644 --- a/packages/ra-core/src/controller/useListController.ts +++ b/packages/ra-core/src/controller/useListController.ts @@ -61,6 +61,7 @@ export interface ListControllerProps { displayedFilters: any; error?: any; exporter?: Exporter | false; + filter?: FilterPayload; filterValues: any; hasCreate: boolean; hideFilter: (filterName: string) => void; @@ -250,6 +251,7 @@ const useListController = ( displayedFilters: query.displayedFilters, error, exporter, + filter, filterValues: query.filterValues, hasCreate, hideFilter: queryModifiers.hideFilter, diff --git a/packages/ra-core/src/controller/useListParams.ts b/packages/ra-core/src/controller/useListParams.ts index 0b961163dfe..e5d634c75cb 100644 --- a/packages/ra-core/src/controller/useListParams.ts +++ b/packages/ra-core/src/controller/useListParams.ts @@ -26,8 +26,6 @@ interface ListParamsOptions { sort?: SortPayload; // default value for a filter when displayed but not yet set filterDefaultValues?: FilterPayload; - // permanent filter which always overrides the user entry - filter?: FilterPayload; debounce?: number; } @@ -111,7 +109,6 @@ const useListParams = ({ resource, location, filterDefaultValues, - filter, // permanent filter sort = defaultSort, perPage = 10, debounce = 500, @@ -191,10 +188,7 @@ const useListParams = ({ requestSignature // eslint-disable-line react-hooks/exhaustive-deps ); - const filterValues = useMemo( - () => ({ ...(query.filter || emptyObject), ...filter }), - [filter, query.filter] - ); + const filterValues = query.filter || emptyObject; const displayedFilterValues = query.displayedFilters || emptyObject; const debouncedSetFilters = lodashDebounce((filter, displayedFilters) => { diff --git a/packages/ra-ui-materialui/src/button/ExportButton.tsx b/packages/ra-ui-materialui/src/button/ExportButton.tsx index 6183de01a61..ca3e947c093 100644 --- a/packages/ra-ui-materialui/src/button/ExportButton.tsx +++ b/packages/ra-ui-materialui/src/button/ExportButton.tsx @@ -25,6 +25,7 @@ const ExportButton: FunctionComponent = props => { ...rest } = props; const { + filter, filterValues, currentSort, exporter: exporterFromContext, @@ -39,7 +40,9 @@ const ExportButton: FunctionComponent = props => { dataProvider .getList(resource, { sort: currentSort || sort, - filter: filterValues, + filter: filter + ? { ...filterValues, ...filter } + : filterValues, pagination: { page: 1, perPage: maxResults }, }) .then( @@ -64,6 +67,7 @@ const ExportButton: FunctionComponent = props => { currentSort, dataProvider, exporter, + filter, filterValues, maxResults, notify, diff --git a/packages/ra-ui-materialui/src/types.ts b/packages/ra-ui-materialui/src/types.ts index da829e9a7cf..083d8103324 100644 --- a/packages/ra-ui-materialui/src/types.ts +++ b/packages/ra-ui-materialui/src/types.ts @@ -3,6 +3,7 @@ import { Identifier, Exporter, SortPayload, + FilterPayload, Record as RaRecord, ResourceComponentProps, ResourceComponentPropsWithId, @@ -17,7 +18,7 @@ export interface ListProps extends ResourceComponentProps { component?: ElementType; empty?: ReactElement | false; exporter?: Exporter | false; - filter?: any; + filter?: FilterPayload; filterDefaultValues?: any; filters?: ReactElement; pagination?: ReactElement | false; From cb1aa1ac2a2b3b2d4e35882f75877b437f4c8858 Mon Sep 17 00:00:00 2001 From: fzaninotto Date: Tue, 15 Dec 2020 18:03:56 +0100 Subject: [PATCH 10/27] Add missing change in 3.11 changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b7af32c3ede..5ab9110e026 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,7 @@ const App = () => ( * Add domain telemetry on app mount ([5631](https://github.com/marmelab/react-admin/pull/5631)) ([djhi](https://github.com/djhi)) * Add ability to access (and override) side effects in `SaveContext` ([5604](https://github.com/marmelab/react-admin/pull/5604)) ([djhi](https://github.com/djhi)) * Add support for `disabled` in `` ([5618](https://github.com/marmelab/react-admin/pull/5618)) ([fzaninotto](https://github.com/fzaninotto)) +* Add ability to customize the notification element in the `` page ([5630](https://github.com/marmelab/react-admin/pull/5630)) ([hieusmiths](https://github.com/hieusmiths)) * Disable ripple effect on Buttons for improved performance ([5598](https://github.com/marmelab/react-admin/pull/5598)) ([fzaninotto](https://github.com/fzaninotto)) * Fix `` doesn't contain `notifications` node ([5659](https://github.com/marmelab/react-admin/pull/5659)) ([fzaninotto](https://github.com/fzaninotto)) * Fix `` fails to show compound filters with no default value ([5657](https://github.com/marmelab/react-admin/pull/5657)) ([fzaninotto](https://github.com/fzaninotto)) From 4219afc5082ac84751322c8a03e5094bd790e13c Mon Sep 17 00:00:00 2001 From: fzaninotto Date: Tue, 15 Dec 2020 18:07:53 +0100 Subject: [PATCH 11/27] Add missing changes in 3.11 changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5ab9110e026..49973993a59 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,6 +31,7 @@ const App = () => ( * Fix `` fails to show compound filters with no default value ([5657](https://github.com/marmelab/react-admin/pull/5657)) ([fzaninotto](https://github.com/fzaninotto)) * Fix "Missing translation" console error when the `dataProvider` fails ([5655](https://github.com/marmelab/react-admin/pull/5655)) ([fzaninotto](https://github.com/fzaninotto)) * Fix `` doesn't appear selected when more than one filter is applied ([5644](https://github.com/marmelab/react-admin/pull/5644)) ([fzaninotto](https://github.com/fzaninotto)) +* Fix `usePermissions` always triggers a re-render even though the permissions are unchanged ([5607](https://github.com/marmelab/react-admin/pull/5607)) ([fzaninotto](https://github.com/fzaninotto)) * [Doc] Add `rowStyle` example usage to `` jsDoc ([5661](https://github.com/marmelab/react-admin/pull/5661)) ([vdimitroff](https://github.com/vdimitroff)) * [Doc] Fix `` prop type to show that it accepts a function ([5660](https://github.com/marmelab/react-admin/pull/5660)) ([vdimitroff](https://github.com/vdimitroff)) * [Doc] Fix missing import in `List` example ([5658](https://github.com/marmelab/react-admin/pull/5658)) ([WiXSL](https://github.com/WiXSL)) @@ -38,6 +39,7 @@ const App = () => ( * [Doc] Fix Sidebar size change resets the theme color ([5646](https://github.com/marmelab/react-admin/pull/5646)) ([zheya08](https://github.com/zheya08)) * [Doc] Fix `` and `` JSDocs point to the wrong `dataProvider` method ([5645](https://github.com/marmelab/react-admin/pull/5645)) ([WiXSL](https://github.com/WiXSL)) * [Doc] Add mention of saved queries in List chapter ([5638](https://github.com/marmelab/react-admin/pull/5638)) ([fzaninotto](https://github.com/fzaninotto)) +* [Doc] Fix `` prop injection documentation misses package version constraint ([5538](https://github.com/marmelab/react-admin/pull/5538)) ([fzaninotto](https://github.com/fzaninotto)) ## v3.10.4 From de87f234e18e7936156da3dbd0277b90ff08e948 Mon Sep 17 00:00:00 2001 From: fzaninotto Date: Tue, 15 Dec 2020 18:24:10 +0100 Subject: [PATCH 12/27] [Doc] Fix custom theme doc doesn't explain how to override default theme Closes #5672 --- docs/Theming.md | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/docs/Theming.md b/docs/Theming.md index f98749bce94..ec7a0603ec7 100644 --- a/docs/Theming.md +++ b/docs/Theming.md @@ -310,15 +310,18 @@ const App = () => ( ## Writing a Custom Theme -If you need more fine-tuning, you'll need to write your own `theme` object, following [Material UI themes documentation](https://material-ui.com/customization/themes/). Material UI merges custom theme objects with the default theme. +If you need more fine-tuning, you'll need to write your own `theme` object, following [Material UI themes documentation](https://material-ui.com/customization/themes/). + +For instance, here is how to override the default react-admin theme: ```jsx -import { createMuiTheme } from '@material-ui/core/styles'; +import { defaultTheme } from 'react-admin'; +import merge from 'lodash/merge'; import indigo from '@material-ui/core/colors/indigo'; import pink from '@material-ui/core/colors/pink'; import red from '@material-ui/core/colors/red'; -const myTheme = createMuiTheme({ +const myTheme = merge({}, defaultTheme, { palette: { primary: indigo, secondary: pink, @@ -328,17 +331,13 @@ const myTheme = createMuiTheme({ }, typography: { // Use the system font instead of the default Roboto font. - fontFamily: [ - '-apple-system', - 'BlinkMacSystemFont', - '"Segoe UI"', - 'Arial', - 'sans-serif', - ].join(','), + fontFamily: ['-apple-system', 'BlinkMacSystemFont', '"Segoe UI"', 'Arial', 'sans-serif'].join(','), }, overrides: { - MuiButton: { // override the styles of all instances of this component - root: { // Name of the rule + MuiButton: { + // override the styles of all instances of this component + root: { + // Name of the rule color: 'white', // Some CSS }, }, @@ -346,7 +345,7 @@ const myTheme = createMuiTheme({ }); ``` -The `myTheme` object contains the following keys: +A `theme` object can contain the following keys: * `breakpoints` * `direction` @@ -355,9 +354,9 @@ The `myTheme` object contains the following keys: * `palette` * `props` * `shadows` -* `typography` -* `transitions` * `spacing` +* `transitions` +* `typography` * `zIndex` **Tip**: Check [Material UI default theme documentation](https://material-ui.com/customization/default-theme/) to see the default values and meaning for these keys. From 6b478360a41d9e6e97bdad5f7c77fe6da940b473 Mon Sep 17 00:00:00 2001 From: fzaninotto Date: Tue, 15 Dec 2020 18:25:06 +0100 Subject: [PATCH 13/27] Fix spacing --- docs/Theming.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/docs/Theming.md b/docs/Theming.md index ec7a0603ec7..c1b92db161f 100644 --- a/docs/Theming.md +++ b/docs/Theming.md @@ -334,10 +334,8 @@ const myTheme = merge({}, defaultTheme, { fontFamily: ['-apple-system', 'BlinkMacSystemFont', '"Segoe UI"', 'Arial', 'sans-serif'].join(','), }, overrides: { - MuiButton: { - // override the styles of all instances of this component - root: { - // Name of the rule + MuiButton: { // override the styles of all instances of this component + root: { // Name of the rule color: 'white', // Some CSS }, }, From 6995f0efbd09d4c924544dacfe772a4e04f7f7a1 Mon Sep 17 00:00:00 2001 From: Ankita Date: Wed, 16 Dec 2020 10:46:05 +0530 Subject: [PATCH 14/27] fix reselect empty in autocomplete --- packages/ra-ui-materialui/src/input/AutocompleteInput.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/ra-ui-materialui/src/input/AutocompleteInput.tsx b/packages/ra-ui-materialui/src/input/AutocompleteInput.tsx index da67916470d..2c77a3ebd2c 100644 --- a/packages/ra-ui-materialui/src/input/AutocompleteInput.tsx +++ b/packages/ra-ui-materialui/src/input/AutocompleteInput.tsx @@ -265,9 +265,13 @@ const AutocompleteInput: FunctionComponent = props => { const handleChange = useCallback( (item: any) => { + if (getChoiceValue(item) == null && filterValue) { + setFilterValue(''); + } + input.onChange(getChoiceValue(item)); }, - [getChoiceValue, input] + [filterValue, getChoiceValue, input] ); // This function ensures that the suggestion list stay aligned to the From ffb872264e71f7542d14bcf7d3286d8e3f672162 Mon Sep 17 00:00:00 2001 From: fzaninotto Date: Thu, 17 Dec 2020 17:15:10 +0100 Subject: [PATCH 15/27] Add references to the ra-search module in the public documentation --- docs/List.md | 14 ++++++++++++++ docs/Reference.md | 2 ++ docs/Theming.md | 2 ++ 3 files changed, 18 insertions(+) diff --git a/docs/List.md b/docs/List.md index 339611d48e4..5811d5c1ca0 100644 --- a/docs/List.md +++ b/docs/List.md @@ -1392,6 +1392,20 @@ export const PostList = (props) => ( You can use a similar approach to customize the list filter completely, e.g. to display the filters in a sidebar, or as a line in the datagrid, etc. +### Global Search + +Although list filters allow to make precise queries using per-field criteria, users often prefer simpler interfaces like full-text search. After all, that's what they use every day on search engines, email clients, and in their file explorer. + +If you want to display a full-text search allowing to look for any record in the admin using a single form input, check out [ra-search](https://marmelab.com/ra-enterprise/modules/ra-search), an [Enterprise Edition](https://marmelab.com/ra-enterprise) module. + +![ra-search basic](https://marmelab.com/ra-enterprise/modules/assets/ra-search-overview.gif) + +`ra-search` can plug to any existing search engine (ElasticSearch, Lucene, or custom search engine), and lets you customize the search results to provide quick navigation to related items, turniun the search engine into an "Omnibox": + +![ra-search demo](https://marmelab.com/ra-enterprise/modules/assets/ra-search-demo.gif) + +For mode details about the global search, check the [`ra-search` module](https://marmelab.com/ra-enterprise/modules/ra-search) in React-Admin Enterprise Edition. + ## Sorting The List diff --git a/docs/Reference.md b/docs/Reference.md index df8e056779f..be825a92f9e 100644 --- a/docs/Reference.md +++ b/docs/Reference.md @@ -106,6 +106,7 @@ title: "Reference" * [``](https://marmelab.com/ra-enterprise/modules/ra-editable-datagrid#rowform) * `` * [``](https://marmelab.com/ra-enterprise/modules/ra-preferences#savedquerieslist-and-filterwithsave-store-user-queries-in-preferences) +* [``](https://marmelab.com/ra-enterprise/modules/ra-search#the-search-component) * `` * [``](./Inputs.md#selectarrayinput) * [``](https://marmelab.com/ra-enterprise/modules/ra-preferences#selectcolumnsbutton-store-datagrid-columns-in-preferences) @@ -189,6 +190,7 @@ title: "Reference" * `useReferenceInputController` * `useReferenceManyFieldController` * [`useRefresh`](./Actions.md#handling-side-effects-in-usedataprovider) +* [`useSearch`](https://marmelab.com/ra-enterprise/modules/ra-search#the-usesearch-hook) * [`useSetLocale`](./Translation.md#usesetlocale-changing-locale-at-runtime) * [`useShowController`](./Show.md#useshowcontroller) * `useSortState` diff --git a/docs/Theming.md b/docs/Theming.md index c1b92db161f..d81f59c70b5 100644 --- a/docs/Theming.md +++ b/docs/Theming.md @@ -891,6 +891,8 @@ The `MenuItemLink` component make use of the React Router [NavLink](https://reac **Tip**: If you need a multi-level menu, or a Mega Menu opening panels with custom content, check out [the `ra-navigation` module](https://marmelab.com/ra-enterprise/modules/ra-navigation) (part of the [Enterprise Edition](https://marmelab.com/ra-enterprise)) +![multi-level menu](https://marmelab.com/ra-enterprise/modules/assets/ra-multilevelmenu-item.gif) + ![MegaMenu and Breadcrumb](https://marmelab.com/ra-enterprise/modules/assets/ra-multilevelmenu-categories.gif) ## Using a Custom Login Page From c0c66c0d4cc3c9b1778b8825eb6b1edd7b78a2af Mon Sep 17 00:00:00 2001 From: Austin Denny <57812295+abdenny@users.noreply.github.com> Date: Thu, 17 Dec 2020 12:19:26 -0600 Subject: [PATCH 16/27] [Doc] Fix syntax in actions example for useUpdate. Optimistic Rendering and Undo section ApproveButton example is missing the 4th argument for previousData in useUpdate. --- docs/Actions.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/Actions.md b/docs/Actions.md index bd2e144bb7f..d35410dda31 100644 --- a/docs/Actions.md +++ b/docs/Actions.md @@ -528,6 +528,7 @@ const ApproveButton = ({ record }) => { 'comments', record.id, { isApproved: true }, + record, { undoable: true, onSuccess: ({ data }) => { From e071c652a0bf3fc7dfceef36b324be2cc9a2dcb2 Mon Sep 17 00:00:00 2001 From: Md-khaleelur-rehman Date: Wed, 16 Dec 2020 11:39:24 +0530 Subject: [PATCH 17/27] Bug fix for autocomplete off --- packages/ra-ui-materialui/src/input/SearchInput.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/ra-ui-materialui/src/input/SearchInput.tsx b/packages/ra-ui-materialui/src/input/SearchInput.tsx index 22f733c7588..160e6e2ad37 100644 --- a/packages/ra-ui-materialui/src/input/SearchInput.tsx +++ b/packages/ra-ui-materialui/src/input/SearchInput.tsx @@ -42,6 +42,7 @@ const SearchInput: FunctionComponent< ), + autoComplete: 'off', }} className={classes.input} {...rest} From e1fc7a35dd073a98cef9eed1094e34a0cacf50a3 Mon Sep 17 00:00:00 2001 From: Gildas Garcia <1122076+djhi@users.noreply.github.com> Date: Fri, 18 Dec 2020 09:54:18 +0100 Subject: [PATCH 18/27] Update data-providers for Hasura --- docs/DataProviders.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/DataProviders.md b/docs/DataProviders.md index 10f1797ba83..7a2598a213c 100644 --- a/docs/DataProviders.md +++ b/docs/DataProviders.md @@ -77,7 +77,8 @@ Developers from the react-admin community have open-sourced Data Providers for m * **[Firebase Realtime Database](https://firebase.google.com/docs/database)**: [aymendhaya/ra-data-firebase-client](https://github.com/aymendhaya/ra-data-firebase-client). * **[GraphQL](https://graphql.org/)**: [marmelab/ra-data-graphql](https://github.com/marmelab/react-admin/tree/master/packages/ra-data-graphql) (uses [Apollo](https://www.apollodata.com/)) * **[HAL](http://stateless.co/hal_specification.html)**: [b-social/ra-data-hal](https://github.com/b-social/ra-data-hal) -* **[Hasura](https://github.com/hasura/graphql-engine)**: [hasura/ra-data-hasura](https://github.com/hasura/graphql-engine/tree/master/community/tools/ra-data-hasura) +* **[Hasura V1](https://github.com/hasura/graphql-engine)**: [hasura/ra-data-hasura](https://github.com/hasura/ra-data-hasura), communicates with Hasura V1, using standard REST and not GraphQL +* **[Hasura](https://github.com/hasura/graphql-engine)**: [Steams/ra-data-hasura-graphql](https://github.com/Steams/ra-data-hasura-graphql), auto generates valid GraphQL queries based on the properties exposed by the Hasura API. * **[Hydra](https://www.hydra-cg.com/) / [JSON-LD](https://json-ld.org/)**: [api-platform/admin/hydra](https://github.com/api-platform/admin/blob/master/src/hydra/dataProvider.js) * **[IndexedDB](https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API)**: [tykoth/ra-data-dexie](https://github.com/tykoth/ra-data-dexie) * **[JSON API](https://jsonapi.org/)**: [henvo/ra-jsonapi-client](https://github.com/henvo/ra-jsonapi-client) From 7e88a77be59ab29162f237a3285371e6fd8a0a7b Mon Sep 17 00:00:00 2001 From: Gildas Garcia <1122076+djhi@users.noreply.github.com> Date: Fri, 18 Dec 2020 10:53:46 +0100 Subject: [PATCH 19/27] Revert "Fix for autocomplete off #5620" --- packages/ra-ui-materialui/src/input/SearchInput.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/ra-ui-materialui/src/input/SearchInput.tsx b/packages/ra-ui-materialui/src/input/SearchInput.tsx index 160e6e2ad37..22f733c7588 100644 --- a/packages/ra-ui-materialui/src/input/SearchInput.tsx +++ b/packages/ra-ui-materialui/src/input/SearchInput.tsx @@ -42,7 +42,6 @@ const SearchInput: FunctionComponent< ), - autoComplete: 'off', }} className={classes.input} {...rest} From df48a4d88add4571f44491b19fdb1101ee2923b6 Mon Sep 17 00:00:00 2001 From: Gildas Garcia <1122076+djhi@users.noreply.github.com> Date: Fri, 18 Dec 2020 11:04:55 +0100 Subject: [PATCH 20/27] Apply review --- packages/ra-ui-materialui/src/field/ReferenceField.tsx | 2 +- packages/ra-ui-materialui/src/input/ReferenceArrayInput.tsx | 2 +- packages/ra-ui-materialui/src/input/ReferenceInput.tsx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/ra-ui-materialui/src/field/ReferenceField.tsx b/packages/ra-ui-materialui/src/field/ReferenceField.tsx index e82276334bc..c1fc99e3e4a 100644 --- a/packages/ra-ui-materialui/src/field/ReferenceField.tsx +++ b/packages/ra-ui-materialui/src/field/ReferenceField.tsx @@ -15,11 +15,11 @@ import { Record, } from 'ra-core'; +import LinearProgress from '../layout/LinearProgress'; import Link from '../Link'; import sanitizeFieldRestProps from './sanitizeFieldRestProps'; import { PublicFieldProps, fieldPropTypes, InjectedFieldProps } from './types'; import { ClassesOverride } from '../types'; -import { LinearProgress } from '../layout'; /** * Fetch reference record, and delegate rendering to child component. diff --git a/packages/ra-ui-materialui/src/input/ReferenceArrayInput.tsx b/packages/ra-ui-materialui/src/input/ReferenceArrayInput.tsx index c2237a0540c..5aa1f561347 100644 --- a/packages/ra-ui-materialui/src/input/ReferenceArrayInput.tsx +++ b/packages/ra-ui-materialui/src/input/ReferenceArrayInput.tsx @@ -14,7 +14,7 @@ import { } from 'ra-core'; import sanitizeInputRestProps from './sanitizeInputRestProps'; -import { LinearProgress } from '../layout'; +import LinearProgress from '../layout/LinearProgress'; import Labeled from './Labeled'; import ReferenceError from './ReferenceError'; import { FieldInputProps, FieldMetaState } from 'react-final-form'; diff --git a/packages/ra-ui-materialui/src/input/ReferenceInput.tsx b/packages/ra-ui-materialui/src/input/ReferenceInput.tsx index c7547297a5a..22cea4be65c 100644 --- a/packages/ra-ui-materialui/src/input/ReferenceInput.tsx +++ b/packages/ra-ui-materialui/src/input/ReferenceInput.tsx @@ -17,9 +17,9 @@ import { } from 'ra-core'; import sanitizeInputRestProps from './sanitizeInputRestProps'; +import LinearProgress from '../layout/LinearProgress'; import Labeled from './Labeled'; import ReferenceError from './ReferenceError'; -import { LinearProgress } from '../layout'; /** * An Input component for choosing a reference record. Useful for foreign keys. From 32d4b74a2b798b01b7aa1f46a69fe3088150486a Mon Sep 17 00:00:00 2001 From: Gildas Garcia <1122076+djhi@users.noreply.github.com> Date: Fri, 18 Dec 2020 11:19:07 +0100 Subject: [PATCH 21/27] Fix Empty Component Display When No Create --- .../src/dataProvider/useQueryWithStore.ts | 1 + packages/ra-ui-materialui/src/list/Empty.tsx | 22 +++++++++++-------- .../ra-ui-materialui/src/list/ListView.tsx | 7 +----- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/packages/ra-core/src/dataProvider/useQueryWithStore.ts b/packages/ra-core/src/dataProvider/useQueryWithStore.ts index 109c9e4654e..0ef65e71952 100644 --- a/packages/ra-core/src/dataProvider/useQueryWithStore.ts +++ b/packages/ra-core/src/dataProvider/useQueryWithStore.ts @@ -158,6 +158,7 @@ const useQueryWithStore = ( data, total, loaded: true, + loading: false, })); } } diff --git a/packages/ra-ui-materialui/src/list/Empty.tsx b/packages/ra-ui-materialui/src/list/Empty.tsx index 9d13594efac..91f901290fd 100644 --- a/packages/ra-ui-materialui/src/list/Empty.tsx +++ b/packages/ra-ui-materialui/src/list/Empty.tsx @@ -33,7 +33,7 @@ const useStyles = makeStyles( ); const Empty: FC = props => { - const { basePath } = useListContext(props); + const { basePath, hasCreate } = useListContext(props); const resource = useResourceContext(props); const classes = useStyles(props); const translate = useTranslate(); @@ -61,15 +61,19 @@ const Empty: FC = props => { _: emptyMessage, })} - - {translate(`resources.${resource}.invite`, { - _: inviteMessage, - })} - - -
- + {hasCreate && ( + + {translate(`resources.${resource}.invite`, { + _: inviteMessage, + })} + + )}
+ {hasCreate && ( +
+ +
+ )} ); }; diff --git a/packages/ra-ui-materialui/src/list/ListView.tsx b/packages/ra-ui-materialui/src/list/ListView.tsx index c70baa6ac98..6a7baa503ee 100644 --- a/packages/ra-ui-materialui/src/list/ListView.tsx +++ b/packages/ra-ui-materialui/src/list/ListView.tsx @@ -46,7 +46,6 @@ export const ListView = (props: ListViewProps) => { total, loaded, loading, - hasCreate, filterValues, selectedIds, } = listContext; @@ -88,11 +87,7 @@ export const ListView = (props: ListViewProps) => { ); const shouldRenderEmptyPage = - hasCreate && - loaded && - !loading && - total === 0 && - !Object.keys(filterValues).length; + loaded && !loading && total === 0 && !Object.keys(filterValues).length; return (
Date: Fri, 18 Dec 2020 10:55:26 -0300 Subject: [PATCH 22/27] Fix external link --- docs/CreateEdit.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/CreateEdit.md b/docs/CreateEdit.md index a1a9123cdf5..0fc9797f500 100644 --- a/docs/CreateEdit.md +++ b/docs/CreateEdit.md @@ -1255,7 +1255,7 @@ export const ProductEdit = ({ ...props }) => ( ``` {% endraw %} -**Tip**: The props of your Input components are passed to a `react-final-form` [](https://final-form.org/docs/react-final-form/api/Field) component. +**Tip**: The props of your Input components are passed to a `react-final-form` [Field](https://final-form.org/docs/react-final-form/api/Field) component. **Tip**: You can use *both* Form validation and input validation. From 752e1f59170ac977e3a2636f66bbc6d930b88d76 Mon Sep 17 00:00:00 2001 From: fzaninotto Date: Mon, 21 Dec 2020 16:58:31 +0100 Subject: [PATCH 23/27] Prepare changelog for 3.11.1 --- CHANGELOG.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 49973993a59..e7501ff4bc5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ # Changelog +## v3.11.1 + +* Fix select empty option in `` does not reset the input ([5698](https://github.com/marmelab/react-admin/5698)) ([AnkitaGupta111](https://github.com/AnkitaGupta111)) +* Fix `` list component does not display when the `Resource` has no `create` component ([5688](https://github.com/marmelab/react-admin/5688)) ([djhi](https://github.com/djhi)) +* Fix `` doesn't take permanent `filter` into account ([5675](https://github.com/marmelab/react-admin/5675)) ([fzaninotto](https://github.com/fzaninotto)) +* Fix `` dialog shows a scroll bar on mobile ([5674](https://github.com/marmelab/react-admin/5674)) ([rkfg](https://github.com/rkfg)) +* Fix `` and `` performance by showing loader only after a delay ([5668](https://github.com/marmelab/react-admin/5668)) ([djhi](https://github.com/djhi)) +* [Doc] Fix link to react-final-form `Field` documentation in CreateEdit chapter ([5689](https://github.com/marmelab/react-admin/5689)) ([WiXSL](https://github.com/WiXSL)) +* [Doc] Fix outdated Hasura Data Provider reference ([5686](https://github.com/marmelab/react-admin/5686)) ([djhi](https://github.com/djhi)) +* [Doc] Fix syntax in actions example for `useUpdate` ([5681](https://github.com/marmelab/react-admin/5681)) ([abdenny](https://github.com/abdenny)) +* [Doc] Fix custom theme doc doesn't explain how to override default theme ([5676](https://github.com/marmelab/react-admin/5676)) ([fzaninotto](https://github.com/fzaninotto)) +* [Doc] Fix typos in Tutorial doc ([5669](https://github.com/marmelab/react-admin/5669)) ([paulo9mv](https://github.com/paulo9mv)) + ## v3.11.0 Starting with this version, react-admin applications send an anonymous request on mount to a telemetry server operated by marmelab. You can see this request by looking at the Network tab of your browser DevTools: From a25dcedf860f2216173c22f8bbc98672c7e3b920 Mon Sep 17 00:00:00 2001 From: fzaninotto Date: Mon, 21 Dec 2020 16:58:41 +0100 Subject: [PATCH 24/27] v3.11.1 --- lerna.json | 2 +- packages/ra-core/package.json | 2 +- packages/ra-data-json-server/package.json | 4 ++-- packages/ra-i18n-polyglot/package.json | 4 ++-- packages/ra-language-english/package.json | 4 ++-- packages/ra-language-french/package.json | 4 ++-- packages/ra-ui-materialui/package.json | 4 ++-- packages/react-admin/package.json | 10 +++++----- 8 files changed, 17 insertions(+), 17 deletions(-) diff --git a/lerna.json b/lerna.json index 255e7976179..6531f0a200b 100644 --- a/lerna.json +++ b/lerna.json @@ -4,5 +4,5 @@ "examples/data-generator", "packages/*" ], - "version": "3.11.0" + "version": "3.11.1" } diff --git a/packages/ra-core/package.json b/packages/ra-core/package.json index 8781b462359..35e4c7f8ba5 100644 --- a/packages/ra-core/package.json +++ b/packages/ra-core/package.json @@ -1,6 +1,6 @@ { "name": "ra-core", - "version": "3.11.0", + "version": "3.11.1", "description": "Core components of react-admin, a frontend Framework for building admin applications on top of REST services, using ES6, React", "files": [ "*.md", diff --git a/packages/ra-data-json-server/package.json b/packages/ra-data-json-server/package.json index d2ef7f4ab2c..7e5301f5240 100644 --- a/packages/ra-data-json-server/package.json +++ b/packages/ra-data-json-server/package.json @@ -1,6 +1,6 @@ { "name": "ra-data-json-server", - "version": "3.11.0", + "version": "3.11.1", "description": "JSON Server data provider for react-admin", "main": "lib/index.js", "module": "esm/index.js", @@ -26,7 +26,7 @@ }, "dependencies": { "query-string": "^5.1.1", - "ra-core": "^3.11.0" + "ra-core": "^3.11.1" }, "devDependencies": { "cross-env": "^5.2.0", diff --git a/packages/ra-i18n-polyglot/package.json b/packages/ra-i18n-polyglot/package.json index 52b31c224e8..214ad1d367a 100644 --- a/packages/ra-i18n-polyglot/package.json +++ b/packages/ra-i18n-polyglot/package.json @@ -1,6 +1,6 @@ { "name": "ra-i18n-polyglot", - "version": "3.11.0", + "version": "3.11.1", "description": "Polyglot i18n provider for react-admin", "main": "lib/index.js", "module": "esm/index.js", @@ -26,7 +26,7 @@ }, "dependencies": { "node-polyglot": "^2.2.2", - "ra-core": "^3.11.0" + "ra-core": "^3.11.1" }, "devDependencies": { "cross-env": "^5.2.0", diff --git a/packages/ra-language-english/package.json b/packages/ra-language-english/package.json index 4beb55df416..25cbb81d624 100644 --- a/packages/ra-language-english/package.json +++ b/packages/ra-language-english/package.json @@ -1,6 +1,6 @@ { "name": "ra-language-english", - "version": "3.11.0", + "version": "3.11.1", "description": "English messages for react-admin, the frontend framework for building admin applications on top of REST/GraphQL services", "repository": { "type": "git", @@ -22,7 +22,7 @@ "watch": "tsc --outDir esm --module es2015 --watch" }, "dependencies": { - "ra-core": "^3.11.0" + "ra-core": "^3.11.1" }, "keywords": [ "react", diff --git a/packages/ra-language-french/package.json b/packages/ra-language-french/package.json index c8b2164ae19..9acee94f6cb 100644 --- a/packages/ra-language-french/package.json +++ b/packages/ra-language-french/package.json @@ -1,6 +1,6 @@ { "name": "ra-language-french", - "version": "3.11.0", + "version": "3.11.1", "description": "French messages for react-admin, the frontend framework for building admin applications on top of REST/GraphQL services", "repository": { "type": "git", @@ -16,7 +16,7 @@ "watch": "tsc --outDir esm --module es2015 --watch" }, "dependencies": { - "ra-core": "^3.11.0" + "ra-core": "^3.11.1" }, "keywords": [ "react", diff --git a/packages/ra-ui-materialui/package.json b/packages/ra-ui-materialui/package.json index 1aecd2260b1..ffea2624cf7 100644 --- a/packages/ra-ui-materialui/package.json +++ b/packages/ra-ui-materialui/package.json @@ -1,6 +1,6 @@ { "name": "ra-ui-materialui", - "version": "3.11.0", + "version": "3.11.1", "description": "UI Components for react-admin with MaterialUI", "files": [ "*.md", @@ -38,7 +38,7 @@ "final-form": "^4.20.0", "final-form-arrays": "^3.0.1", "ignore-styles": "~5.0.1", - "ra-core": "^3.11.0", + "ra-core": "^3.11.1", "react": "^17.0.0", "react-dom": "^17.0.0", "react-final-form": "^6.5.0", diff --git a/packages/react-admin/package.json b/packages/react-admin/package.json index 506f2f356f9..5777d6f0cf0 100644 --- a/packages/react-admin/package.json +++ b/packages/react-admin/package.json @@ -1,6 +1,6 @@ { "name": "react-admin", - "version": "3.11.0", + "version": "3.11.1", "description": "A frontend Framework for building admin applications on top of REST services, using ES6, React and Material UI", "files": [ "*.md", @@ -40,10 +40,10 @@ "connected-react-router": "^6.5.2", "final-form": "^4.18.5", "final-form-arrays": "^3.0.1", - "ra-core": "^3.11.0", - "ra-i18n-polyglot": "^3.11.0", - "ra-language-english": "^3.11.0", - "ra-ui-materialui": "^3.11.0", + "ra-core": "^3.11.1", + "ra-i18n-polyglot": "^3.11.1", + "ra-language-english": "^3.11.1", + "ra-ui-materialui": "^3.11.1", "react-final-form": "^6.3.3", "react-final-form-arrays": "^3.1.1", "react-redux": "^7.1.0", From 4e674ab1141a036fcb19ec9da160c383684b52c2 Mon Sep 17 00:00:00 2001 From: asvarcas Date: Tue, 22 Dec 2020 16:36:53 -0300 Subject: [PATCH 25/27] Fix anchor --- docs/List.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/List.md b/docs/List.md index 5811d5c1ca0..bf4590d120b 100644 --- a/docs/List.md +++ b/docs/List.md @@ -1912,7 +1912,7 @@ You can find many usage examples of `useListContext` in this page, including: - [Building an Aside Component](#aside-aside-component) - [Building a Custom Empty Page](#empty-empty-page-component) - [Building a Custom Filter](#building-a-custom-filter) -- [Building a Custom Sort Control](##building-a-custom-sort-control) +- [Building a Custom Sort Control](#building-a-custom-sort-control) - [Building a Custom Pagination Control](#building-a-custom-pagination-control) - [Building a Custom Iterator](#using-a-custom-iterator) From 3fe232187473a0b0ba243d39913180f0574d1a09 Mon Sep 17 00:00:00 2001 From: asvarcas Date: Tue, 22 Dec 2020 17:06:59 -0300 Subject: [PATCH 26/27] Fix links --- CHANGELOG.md | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e7501ff4bc5..4f60860a9a6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,16 +2,16 @@ ## v3.11.1 -* Fix select empty option in `` does not reset the input ([5698](https://github.com/marmelab/react-admin/5698)) ([AnkitaGupta111](https://github.com/AnkitaGupta111)) -* Fix `` list component does not display when the `Resource` has no `create` component ([5688](https://github.com/marmelab/react-admin/5688)) ([djhi](https://github.com/djhi)) -* Fix `` doesn't take permanent `filter` into account ([5675](https://github.com/marmelab/react-admin/5675)) ([fzaninotto](https://github.com/fzaninotto)) -* Fix `` dialog shows a scroll bar on mobile ([5674](https://github.com/marmelab/react-admin/5674)) ([rkfg](https://github.com/rkfg)) -* Fix `` and `` performance by showing loader only after a delay ([5668](https://github.com/marmelab/react-admin/5668)) ([djhi](https://github.com/djhi)) -* [Doc] Fix link to react-final-form `Field` documentation in CreateEdit chapter ([5689](https://github.com/marmelab/react-admin/5689)) ([WiXSL](https://github.com/WiXSL)) -* [Doc] Fix outdated Hasura Data Provider reference ([5686](https://github.com/marmelab/react-admin/5686)) ([djhi](https://github.com/djhi)) -* [Doc] Fix syntax in actions example for `useUpdate` ([5681](https://github.com/marmelab/react-admin/5681)) ([abdenny](https://github.com/abdenny)) -* [Doc] Fix custom theme doc doesn't explain how to override default theme ([5676](https://github.com/marmelab/react-admin/5676)) ([fzaninotto](https://github.com/fzaninotto)) -* [Doc] Fix typos in Tutorial doc ([5669](https://github.com/marmelab/react-admin/5669)) ([paulo9mv](https://github.com/paulo9mv)) +* Fix select empty option in `` does not reset the input ([5698](https://github.com/marmelab/react-admin/pull/5698)) ([AnkitaGupta111](https://github.com/AnkitaGupta111)) +* Fix `` list component does not display when the `Resource` has no `create` component ([5688](https://github.com/marmelab/react-admin/pull/5688)) ([djhi](https://github.com/djhi)) +* Fix `` doesn't take permanent `filter` into account ([5675](https://github.com/marmelab/react-admin/pull/5675)) ([fzaninotto](https://github.com/fzaninotto)) +* Fix `` dialog shows a scroll bar on mobile ([5674](https://github.com/marmelab/react-admin/pull/5674)) ([rkfg](https://github.com/rkfg)) +* Fix `` and `` performance by showing loader only after a delay ([5668](https://github.com/marmelab/react-admin/pull/5668)) ([djhi](https://github.com/djhi)) +* [Doc] Fix link to react-final-form `Field` documentation in CreateEdit chapter ([5689](https://github.com/marmelab/react-admin/pull/5689)) ([WiXSL](https://github.com/WiXSL)) +* [Doc] Fix outdated Hasura Data Provider reference ([5686](https://github.com/marmelab/react-admin/pull/5686)) ([djhi](https://github.com/djhi)) +* [Doc] Fix syntax in actions example for `useUpdate` ([5681](https://github.com/marmelab/react-admin/pull/5681)) ([abdenny](https://github.com/abdenny)) +* [Doc] Fix custom theme doc doesn't explain how to override default theme ([5676](https://github.com/marmelab/react-admin/pull/5676)) ([fzaninotto](https://github.com/fzaninotto)) +* [Doc] Fix typos in Tutorial doc ([5669](https://github.com/marmelab/react-admin/pull/5669)) ([paulo9mv](https://github.com/paulo9mv)) ## v3.11.0 @@ -2027,7 +2027,7 @@ This new release is not backwards compatible with 1.x. Please refer to [the Upgr * Fix date filters ([djhi](https://github.com/djhi)) * Fix typo in custom actions documentation ([RWOverdijk](https://github.com/RWOverdijk)) -## v.1.3.0 +## v1.3.0 * Add permissions handling ([djhi](https://github.com/djhi)) * Add Not Found page ([fzaninotto](https://github.com/fzaninotto)) From da2a0cb701fff625c35a43f2e884321ef92b6a95 Mon Sep 17 00:00:00 2001 From: Khalid Jebbari Date: Wed, 23 Dec 2020 15:29:08 +0100 Subject: [PATCH 27/27] Minor typo in docstring, missing 's' --- packages/ra-core/src/controller/useSelectionState.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/ra-core/src/controller/useSelectionState.ts b/packages/ra-core/src/controller/useSelectionState.ts index 2a3df94fdaf..7701647a2d4 100644 --- a/packages/ra-core/src/controller/useSelectionState.ts +++ b/packages/ra-core/src/controller/useSelectionState.ts @@ -19,7 +19,7 @@ export interface SelectionState { * * @example * - * const { selectedIds, onSelect, onToggleItem, onUnselectItem } = useSelectionState(); + * const { selectedIds, onSelect, onToggleItem, onUnselectItems } = useSelectionState(); * */ const useSelectionState = (