Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typos and doc anchors #6059

Merged
merged 1 commit into from
Mar 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions UPGRADE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down Expand Up @@ -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 }) => (
<Button
component={Link}
to={{
pathname: "/comments/create",
- search: `?post_id=${record.id}`,
+ search: `?source=${JSON.stringify({ post_id: record.id })}`,
}}
label="Add a comment"
>
<ChatBubbleIcon />
</Button>
<Button
component={Link}
to={{
pathname: "/comments/create",
- search: `?post_id=${record.id}`,
+ search: `?source=${JSON.stringify({ post_id: record.id })}`,
}}
label="Add a comment"
>
<ChatBubbleIcon />
</Button>
);
```

Expand Down
2 changes: 1 addition & 1 deletion docs/Authentication.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion docs/CreateEdit.md
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@ const PostList = props => (

**Note**: `<CloneButton>` is designed to be used in a `<Datagrid>` and in an edit view `<Actions>` component, not inside the form `<Toolbar>`. 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 `<Create>` 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 `<Create>` view uses that `record` instead of the empty object. That's how the `<CloneButton>` works under the hood.

Expand Down
4 changes: 2 additions & 2 deletions docs/Inputs.md
Original file line number Diff line number Diff line change
Expand Up @@ -1499,15 +1499,15 @@ You can tweak how this component fetches the possible values using the `perPage`
```
{% endraw %}

In addition to the `ReferenceArrayInputContext`, `<ReferenceArrayInput>` also sets up a `ListContext` providing access to the records from the reference resource in a similar fashion to that of the `<List>` component. This `ListContext` value is accessible with the [`useListContext`](/List.md#uselistcontext) hook.
In addition to the `ReferenceArrayInputContext`, `<ReferenceArrayInput>` also sets up a `ListContext` providing access to the records from the reference resource in a similar fashion to that of the `<List>` component. This `ListContext` value is accessible with the [`useListContext`](./List.md#uselistcontext) hook.

`<ReferenceArrayInput>` also accepts the [common input props](./Inputs.md#common-input-props).

### `useReferenceArrayInputContext`

The [`<ReferenceArrayInput>`](#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 `<ReferenceArryInput>` can grab information from the `ReferenceArrayInputContext` using the `useReferenceArrayInputContext` hook. Here is what it returns:
Any component descendant of `<ReferenceArryInput>` can grab information from the `ReferenceArrayInputContext` using the `useReferenceArrayInputContext` hook. Here is what it returns:

```js
const {
Expand Down
5 changes: 3 additions & 2 deletions docs/Translation.md
Original file line number Diff line number Diff line change
Expand Up @@ -669,8 +669,9 @@ resources: {
fields: {
id: 'Id',
name: 'Bezeichnung',
},
},
}
}
}
```

## Silencing Translation Warnings
Expand Down
4 changes: 2 additions & 2 deletions packages/ra-core/src/form/useFormGroup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 => {
Expand Down Expand Up @@ -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 = (
Expand Down
2 changes: 1 addition & 1 deletion packages/ra-core/src/i18n/useTranslatable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
8 changes: 4 additions & 4 deletions packages/ra-data-fakerest/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
]
}
```
Expand Down
2 changes: 1 addition & 1 deletion packages/ra-test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down