From b6aa78529407b7f6df14c28881fe450526a3fb32 Mon Sep 17 00:00:00 2001 From: asvarcas Date: Thu, 18 Mar 2021 15:23:52 -0300 Subject: [PATCH] Fix typos and doc anchors --- UPGRADE.md | 24 ++++++++++---------- docs/Authentication.md | 2 +- docs/CreateEdit.md | 2 +- docs/Inputs.md | 4 ++-- docs/Translation.md | 5 ++-- packages/ra-core/src/form/useFormGroup.ts | 4 ++-- packages/ra-core/src/i18n/useTranslatable.ts | 2 +- packages/ra-data-fakerest/README.md | 8 +++---- packages/ra-test/README.md | 2 +- 9 files changed, 27 insertions(+), 26 deletions(-) diff --git a/UPGRADE.md b/UPGRADE.md index 21cdff83f10..454d0468bb0 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -34,7 +34,7 @@ Failing to upgrade one of the `ra-` packages will result in a duplication of the * `react` and `react-dom` are now required to be >= 16.9. This version is backward compatible with 16.3, which was the minimum requirement in react-admin, and it offers the support for Hooks, on which react-admin v3 relies heavily. * `react-redux` requires a minimum version of 7.1.0 (instead of 5.0). Check their upgrade guide for [6.0](https://github.com/reduxjs/react-redux/releases/tag/v6.0.0) and [7.0](https://github.com/reduxjs/react-redux/releases/tag/v7.0.0) -* `redux-saga` requires a minimim version of 1.0.0 (instead of ~0.16.0). Check their [list of breaking changes for redux-saga 1.0](https://github.com/redux-saga/redux-saga/releases/tag/v1.0.0) on GitHub. +* `redux-saga` requires a minimum version of 1.0.0 (instead of ~0.16.0). Check their [list of breaking changes for redux-saga 1.0](https://github.com/redux-saga/redux-saga/releases/tag/v1.0.0) on GitHub. * `material-ui` requires a minimum of 4.0.0 (instead of 1.5). Check their [Upgrade guide](https://next.material-ui.com/guides/migration-v3/). ## `react-router-redux` replaced by `connected-react-router` @@ -1118,17 +1118,17 @@ We've described how to pre-fill some fields in the create form in an [Advanced T ```jsx const AddNewCommentButton = ({ record }) => ( - + ); ``` diff --git a/docs/Authentication.md b/docs/Authentication.md index a7c8d3b5145..af92d28116e 100644 --- a/docs/Authentication.md +++ b/docs/Authentication.md @@ -52,7 +52,7 @@ You can get more details about input params, response and error formats in the [ ## Available Providers -It's very common that your auth logic is so specific that so you'll need to write your own `authProvider`. However, the community has built a few open-source Auth Providers that may fit your need: +It's very common that your auth logic is so specific that you'll need to write your own `authProvider`. However, the community has built a few open-source Auth Providers that may fit your need: - **[AWS Amplify](https://docs.amplify.aws)**: [MrHertal/react-admin-amplify](https://github.com/MrHertal/react-admin-amplify) - **[AWS Cognito](https://docs.aws.amazon.com/cognito/latest/developerguide/setting-up-the-javascript-sdk.html)**: [thedistance/ra-cognito](https://github.com/thedistance/ra-cognito) diff --git a/docs/CreateEdit.md b/docs/CreateEdit.md index c4508508cfc..89893f60260 100644 --- a/docs/CreateEdit.md +++ b/docs/CreateEdit.md @@ -577,7 +577,7 @@ const PostList = props => ( **Note**: `` is designed to be used in a `` and in an edit view `` component, not inside the form ``. The `Toolbar` is basically for submitting the form, not for going to another resource. -Alternately, users need to prepopulate a record based on a *related* record. For instance, to create a comment related to an exising post. +Alternately, users need to prepopulate a record based on a *related* record. For instance, to create a comment related to an existing post. By default, the `` view starts with an empty `record`. However, if the `location` object (injected by [react-router-dom](https://reacttraining.com/react-router/web/api/location)) contains a `record` in its `state`, the `` view uses that `record` instead of the empty object. That's how the `` works under the hood. diff --git a/docs/Inputs.md b/docs/Inputs.md index ac4e8afb4db..aa2f68f4203 100644 --- a/docs/Inputs.md +++ b/docs/Inputs.md @@ -1499,7 +1499,7 @@ You can tweak how this component fetches the possible values using the `perPage` ``` {% endraw %} -In addition to the `ReferenceArrayInputContext`, `` also sets up a `ListContext` providing access to the records from the reference resource in a similar fashion to that of the `` component. This `ListContext` value is accessible with the [`useListContext`](/List.md#uselistcontext) hook. +In addition to the `ReferenceArrayInputContext`, `` also sets up a `ListContext` providing access to the records from the reference resource in a similar fashion to that of the `` component. This `ListContext` value is accessible with the [`useListContext`](./List.md#uselistcontext) hook. `` also accepts the [common input props](./Inputs.md#common-input-props). @@ -1507,7 +1507,7 @@ In addition to the `ReferenceArrayInputContext`, `` also se The [``](#referencearrayinput) component take care of fetching the data, and put that data in a context called `ReferenceArrayInputContext` so that it’s available for its descendants. This context also stores filters, pagination, sort state, and provides callbacks to update them. -Any component decendent of `` can grab information from the `ReferenceArrayInputContext` using the `useReferenceArrayInputContext` hook. Here is what it returns: +Any component descendant of `` can grab information from the `ReferenceArrayInputContext` using the `useReferenceArrayInputContext` hook. Here is what it returns: ```js const { diff --git a/docs/Translation.md b/docs/Translation.md index 886ed648dff..3b88204b91f 100644 --- a/docs/Translation.md +++ b/docs/Translation.md @@ -669,8 +669,9 @@ resources: { fields: { id: 'Id', name: 'Bezeichnung', - }, - }, + } + } +} ``` ## Silencing Translation Warnings diff --git a/packages/ra-core/src/form/useFormGroup.ts b/packages/ra-core/src/form/useFormGroup.ts index f5a6dbe2005..cb88fee2c99 100644 --- a/packages/ra-core/src/form/useFormGroup.ts +++ b/packages/ra-core/src/form/useFormGroup.ts @@ -52,7 +52,7 @@ type FormGroupState = { * ); * } * - * @param {string] name The form group name + * @param {string} name The form group name * @returns {FormGroupState} The form group state */ export const useFormGroup = (name: string): FormGroupState => { @@ -104,7 +104,7 @@ export const useFormGroup = (name: string): FormGroupState => { /** * Get the state of a form group * - * @param {FieldStates} fieldStates A map of field states from final-form where the key is the field name. + * @param {FieldState[]} fieldStates A map of field states from final-form where the key is the field name. * @returns {FormGroupState} The state of the group. */ export const getFormGroupState = ( diff --git a/packages/ra-core/src/i18n/useTranslatable.ts b/packages/ra-core/src/i18n/useTranslatable.ts index 98afbab0b63..a3b51ac61ce 100644 --- a/packages/ra-core/src/i18n/useTranslatable.ts +++ b/packages/ra-core/src/i18n/useTranslatable.ts @@ -10,7 +10,7 @@ import useTranslate from './useTranslate'; * * @param options The hook options * @param {string} options.defaultLocale The locale of the default selected locale. Defaults to 'en'. - * @param {strong[]} options.locales An array of the supported locales. Each is an object with a locale and a name property. For example { locale: 'en', name: 'English' }. + * @param {string[]} options.locales An array of the supported locales. Each is an object with a locale and a name property. For example { locale: 'en', name: 'English' }. * * @returns * An object with following properties and methods: diff --git a/packages/ra-data-fakerest/README.md b/packages/ra-data-fakerest/README.md index deb66fd7a69..5d849201a85 100644 --- a/packages/ra-data-fakerest/README.md +++ b/packages/ra-data-fakerest/README.md @@ -59,12 +59,12 @@ Here is an example input: ```json { "posts": [ - { "id": 0, "title": 'Hello, world!' }, - { "id": 1, "title": 'FooBar' } + { "id": 0, "title": "Hello, world!" }, + { "id": 1, "title": "FooBar" } ], "comments": [ - { "id": 0, "post_id": 0, "author": 'John Doe', "body": 'Sensational!' }, - { "id": 1, "post_id": 0, "author": 'Jane Doe', "body": 'I agree' } + { "id": 0, "post_id": 0, "author": "John Doe", "body": "Sensational!" }, + { "id": 1, "post_id": 0, "author": "Jane Doe", "body": "I agree" } ] } ``` diff --git a/packages/ra-test/README.md b/packages/ra-test/README.md index 4d2dee866f2..4b13940ebc2 100644 --- a/packages/ra-test/README.md +++ b/packages/ra-test/README.md @@ -88,7 +88,7 @@ it('should send the user to another url', () => { ### Testing Permissions -As explained on the [Auth Provider chapter](./Authentication.md#authorization), it's possible to manage permissions via the `authProvider` in order to filter page and fields the users can see. +As explained on the [Auth Provider chapter](https://marmelab.com/react-admin/Authentication.html#authorization), it's possible to manage permissions via the `authProvider` in order to filter page and fields the users can see. In order to avoid regressions and make the design explicit to your co-workers, it's better to unit test which fields are supposed to be displayed or hidden for each permission.