From a7dce556b16782a2d81a16a141a43ddbc76bf623 Mon Sep 17 00:00:00 2001 From: asvarcas Date: Tue, 23 Feb 2021 11:48:37 -0300 Subject: [PATCH 1/2] Fix typos in docs and comments --- CHANGELOG.md | 2 +- docs/Authentication.md | 2 +- docs/CreateEdit.md | 2 +- docs/Fields.md | 2 +- docs/List.md | 2 +- packages/ra-core/src/auth/usePermissionsOptimized.ts | 2 +- .../ra-core/src/controller/input/referenceDataStatus.spec.ts | 4 ++-- packages/ra-core/src/controller/useListParams.ts | 2 +- packages/ra-core/src/util/FieldTitle.tsx | 2 +- packages/ra-core/src/util/TestContext.tsx | 4 ++-- packages/ra-ui-materialui/src/field/ImageField.tsx | 2 +- packages/ra-ui-materialui/src/field/NumberField.tsx | 2 +- packages/ra-ui-materialui/src/field/TextField.tsx | 2 +- packages/ra-ui-materialui/src/form/FormInput.tsx | 2 +- packages/ra-ui-materialui/src/layout/LinearProgress.tsx | 2 +- packages/ra-ui-materialui/src/list/datagrid/Datagrid.tsx | 2 +- packages/ra-ui-materialui/src/list/datagrid/DatagridCell.tsx | 2 +- 17 files changed, 19 insertions(+), 19 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e024efe3b76..072d667fc9d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,7 +11,7 @@ * Fix form children props are overridden ([5895](https://github.com/marmelab/react-admin/pull/5895)) ([djhi](https://github.com/djhi)) * [Doc] Add lb4, processmaker3, and mixer data provider links ([5939](https://github.com/marmelab/react-admin/pull/5939)) ([ckoliber](https://github.com/ckoliber)) * [Doc] Fix minor typos ([5912](https://github.com/marmelab/react-admin/pull/5912)) ([WiXSL](https://github.com/WiXSL)) -* [TypeScript] Fix data provider mutation types don't allow to specity Record type ([5934](https://github.com/marmelab/react-admin/pull/5934)) ([andrico1234](https://github.com/andrico1234)) +* [TypeScript] Fix data provider mutation types don't allow to specify Record type ([5934](https://github.com/marmelab/react-admin/pull/5934)) ([andrico1234](https://github.com/andrico1234)) ## v3.12.4 diff --git a/docs/Authentication.md b/docs/Authentication.md index 65356180a97..a7c8d3b5145 100644 --- a/docs/Authentication.md +++ b/docs/Authentication.md @@ -209,7 +209,7 @@ export default { Redirecting to the login page whenever a REST response uses a 401 status code is usually not enough. React-admin keeps data on the client side, and could briefly display stale data while contacting the server - even after the credentials are no longer valid. -Fortunately, each time the user navigates to a list, edit, create or show page, react-admin calls the `authProvider.checkAuth()` method. If this method returns a rejected Promise, react-admin calls `authProvider.logout()` and redirects the user to the login page. So it's the ideal place to make sure the credentials are still valid. +Fortunately, each time the user navigates to a list, edit, create or show page, react-admin calls the `authProvider.checkAuth()` method. If this method returns a rejected Promise, react-admin calls `authProvider.logout()` and redirects the user to the login page. So it's the ideal place to make sure the credentials are still valid. For instance, to check for the existence of the authentication data in local storage: diff --git a/docs/CreateEdit.md b/docs/CreateEdit.md index e08c65e6aa3..b13fe8d054f 100644 --- a/docs/CreateEdit.md +++ b/docs/CreateEdit.md @@ -86,7 +86,7 @@ The `` and `` components call the `dataProvider`, prepare the form ![post creation form](./img/create-view.png) -The `` component clones its child, and passes it an empty object `{}`) as `record` prop. It also passes a callback as `save` prop, which calls `dataProvider.create()`. +The `` component clones its child, and passes it an empty object `{}` as `record` prop. It also passes a callback as `save` prop, which calls `dataProvider.create()`. ![post edition form](./img/edit-view.png) diff --git a/docs/Fields.md b/docs/Fields.md index be75fdcca5a..74053e530e2 100644 --- a/docs/Fields.md +++ b/docs/Fields.md @@ -218,7 +218,7 @@ import { DateField } from 'react-admin'; | ---------- | -------- | ------- | ------- | -------------------------------------------------------------------------------------------------------- | | `locales` | Optional | string | '' | Override the browser locale in the date formatting. Passed as first argument to `Intl.DateTimeFormat()`. | | `options` | Optional | Object | - | Date formatting options. Passed as second argument to `Intl.DateTimeFormat()`. | -| `showTime` | Optional | boolean | false | If true, show date and time. If false, show only date | +| `showTime` | Optional | boolean | `false` | If true, show date and time. If false, show only date | `` also accepts the [common field props](./Fields.md#common-field-props). diff --git a/docs/List.md b/docs/List.md index 0652c321083..3586d408647 100644 --- a/docs/List.md +++ b/docs/List.md @@ -1259,7 +1259,7 @@ const SongList: FC = props => ( ); ``` -For mode details about Saved Queries, check the [`ra-preferences` module](https://marmelab.com/ra-enterprise/modules/ra-preferences#savedquerieslist-and-filterwithsave-store-user-queries-in-preferences) in React-Admin Enterprise Edition. +For mode details about Saved Queries, check the [`ra-preferences` module](https://marmelab.com/ra-enterprise/modules/ra-preferences#savedquerieslist-and-filterwithsave-store-user-queries-in-preferences) in React-Admin Enterprise Edition. ### Building a Custom Filter diff --git a/packages/ra-core/src/auth/usePermissionsOptimized.ts b/packages/ra-core/src/auth/usePermissionsOptimized.ts index e56b8c709a3..74681e2ddbd 100644 --- a/packages/ra-core/src/auth/usePermissionsOptimized.ts +++ b/packages/ra-core/src/auth/usePermissionsOptimized.ts @@ -46,7 +46,7 @@ const alreadyFetchedPermissions = { '{}': undefined }; * const PostDetail = props => { * const { permissions } = usePermissionsOptimized(); * if (permissions !== 'editor') { - * return + * return * } else { * return * } diff --git a/packages/ra-core/src/controller/input/referenceDataStatus.spec.ts b/packages/ra-core/src/controller/input/referenceDataStatus.spec.ts index 4d1221e126e..93f97f0ef35 100644 --- a/packages/ra-core/src/controller/input/referenceDataStatus.spec.ts +++ b/packages/ra-core/src/controller/input/referenceDataStatus.spec.ts @@ -106,7 +106,7 @@ describe('References data status', () => { referenceRecord: null, }, null, - 'there is no error if there is a linked reference without data but the references fetch succeeds even empty' + 'there is no error if there is a linked reference without data but the references fetch succeeds even empty' ); test( { @@ -351,7 +351,7 @@ describe('References data status', () => { referenceRecords: [], }, null, - 'there is no error if there is a linked reference without data but the references fetch succeeds even empty' + 'there is no error if there is a linked reference without data but the references fetch succeeds even empty' ); test( { diff --git a/packages/ra-core/src/controller/useListParams.ts b/packages/ra-core/src/controller/useListParams.ts index 45ba1346abb..d2d2246c8cf 100644 --- a/packages/ra-core/src/controller/useListParams.ts +++ b/packages/ra-core/src/controller/useListParams.ts @@ -154,7 +154,7 @@ const useListParams = ({ // On mount, if the location includes params (for example from a link like // the categories products on the demo), we need to persist them in the - // redux state as well so that we don't loose them after a redirection back + // redux state as well so that we don't lose them after a redirection back // to the list useEffect(() => { if (Object.keys(queryFromLocation).length > 0) { diff --git a/packages/ra-core/src/util/FieldTitle.tsx b/packages/ra-core/src/util/FieldTitle.tsx index 20e9151e65c..a8d28f38b80 100644 --- a/packages/ra-core/src/util/FieldTitle.tsx +++ b/packages/ra-core/src/util/FieldTitle.tsx @@ -35,7 +35,7 @@ export const FieldTitle: FunctionComponent = ({ ); }; -// wat? TypeScript looses the displayName if we don't set it explicitly +// What? TypeScript loses the displayName if we don't set it explicitly FieldTitle.displayName = 'FieldTitle'; export default memo(FieldTitle); diff --git a/packages/ra-core/src/util/TestContext.tsx b/packages/ra-core/src/util/TestContext.tsx index 8fa2ccc67bd..b7ce3d014fa 100644 --- a/packages/ra-core/src/util/TestContext.tsx +++ b/packages/ra-core/src/util/TestContext.tsx @@ -42,7 +42,7 @@ const dataProviderDefaultResponse = { data: null }; * Pass custom store values as store prop * * @example - * // in an react testing-library test + * // in a react testing-library test * const utils = render( * * @@ -50,7 +50,7 @@ const dataProviderDefaultResponse = { data: null }; * ); * * @example - * // in an react testing-library test, using jest. + * // in a react testing-library test, using jest. * const utils = render( * * {({ store }) => { diff --git a/packages/ra-ui-materialui/src/field/ImageField.tsx b/packages/ra-ui-materialui/src/field/ImageField.tsx index 2a4a9cad43d..2e86f4cae23 100644 --- a/packages/ra-ui-materialui/src/field/ImageField.tsx +++ b/packages/ra-ui-materialui/src/field/ImageField.tsx @@ -96,7 +96,7 @@ const ImageField: FC = props => { ); }; -// wat? TypeScript looses the displayName if we don't set it explicitly +// What? TypeScript loses the displayName if we don't set it explicitly ImageField.displayName = 'ImageField'; ImageField.defaultProps = { diff --git a/packages/ra-ui-materialui/src/field/NumberField.tsx b/packages/ra-ui-materialui/src/field/NumberField.tsx index 4b23015cab9..d7672bc0fb4 100644 --- a/packages/ra-ui-materialui/src/field/NumberField.tsx +++ b/packages/ra-ui-materialui/src/field/NumberField.tsx @@ -84,7 +84,7 @@ export const NumberField: FC = memo( } ); -// what? TypeScript looses the displayName if we don't set it explicitly +// what? TypeScript loses the displayName if we don't set it explicitly NumberField.displayName = 'NumberField'; NumberField.defaultProps = { diff --git a/packages/ra-ui-materialui/src/field/TextField.tsx b/packages/ra-ui-materialui/src/field/TextField.tsx index ea13e4fc4f8..ec2cbcdfe3b 100644 --- a/packages/ra-ui-materialui/src/field/TextField.tsx +++ b/packages/ra-ui-materialui/src/field/TextField.tsx @@ -25,7 +25,7 @@ const TextField: FC = memo( } ); -// what? TypeScript looses the displayName if we don't set it explicitly +// what? TypeScript loses the displayName if we don't set it explicitly TextField.displayName = 'TextField'; TextField.defaultProps = { diff --git a/packages/ra-ui-materialui/src/form/FormInput.tsx b/packages/ra-ui-materialui/src/form/FormInput.tsx index a630199d261..600214f93be 100644 --- a/packages/ra-ui-materialui/src/form/FormInput.tsx +++ b/packages/ra-ui-materialui/src/form/FormInput.tsx @@ -98,7 +98,7 @@ export interface FormInputProps< variant?: 'standard' | 'outlined' | 'filled'; } -// wat? TypeScript looses the displayName if we don't set it explicitly +// What? TypeScript loses the displayName if we don't set it explicitly FormInput.displayName = 'FormInput'; export default FormInput; diff --git a/packages/ra-ui-materialui/src/layout/LinearProgress.tsx b/packages/ra-ui-materialui/src/layout/LinearProgress.tsx index f9ee3e7ecfa..d80570e7cb7 100644 --- a/packages/ra-ui-materialui/src/layout/LinearProgress.tsx +++ b/packages/ra-ui-materialui/src/layout/LinearProgress.tsx @@ -48,7 +48,7 @@ LinearProgress.propTypes = { timeout: PropTypes.number, }; -// wat? TypeScript looses the displayName if we don't set it explicitly +// What? TypeScript loses the displayName if we don't set it explicitly LinearProgress.displayName = 'LinearProgress'; export interface LinearProgressProps extends ProgressProps { diff --git a/packages/ra-ui-materialui/src/list/datagrid/Datagrid.tsx b/packages/ra-ui-materialui/src/list/datagrid/Datagrid.tsx index 05f506a4765..23938362132 100644 --- a/packages/ra-ui-materialui/src/list/datagrid/Datagrid.tsx +++ b/packages/ra-ui-materialui/src/list/datagrid/Datagrid.tsx @@ -64,7 +64,7 @@ import { ClassesOverride } from '../../types'; * * * - * @example Usage it outside of a or a . + * @example Use it outside of a or a . * * const currentSort = { field: 'published_at', order: 'DESC' }; * diff --git a/packages/ra-ui-materialui/src/list/datagrid/DatagridCell.tsx b/packages/ra-ui-materialui/src/list/datagrid/DatagridCell.tsx index 77abb475c65..9fbd7385111 100644 --- a/packages/ra-ui-materialui/src/list/datagrid/DatagridCell.tsx +++ b/packages/ra-ui-materialui/src/list/datagrid/DatagridCell.tsx @@ -38,7 +38,7 @@ export interface DatagridCellProps extends TableCellProps { resource?: string; } -// wat? TypeScript looses the displayName if we don't set it explicitly +// What? TypeScript loses the displayName if we don't set it explicitly DatagridCell.displayName = 'DatagridCell'; export default DatagridCell; From 02b00d8308df00c7672a38bdefd62675998779ab Mon Sep 17 00:00:00 2001 From: asvarcas Date: Tue, 23 Feb 2021 11:53:42 -0300 Subject: [PATCH 2/2] Fix to the previous commit --- packages/ra-ui-materialui/src/list/datagrid/Datagrid.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/ra-ui-materialui/src/list/datagrid/Datagrid.tsx b/packages/ra-ui-materialui/src/list/datagrid/Datagrid.tsx index 23938362132..506bd411806 100644 --- a/packages/ra-ui-materialui/src/list/datagrid/Datagrid.tsx +++ b/packages/ra-ui-materialui/src/list/datagrid/Datagrid.tsx @@ -64,7 +64,7 @@ import { ClassesOverride } from '../../types'; * * * - * @example Use it outside of a or a . + * @example Usage outside of a or a . * * const currentSort = { field: 'published_at', order: 'DESC' }; *