diff --git a/docs/Actions.md b/docs/Actions.md index 66dbb339bf2..3921a53f26a 100644 --- a/docs/Actions.md +++ b/docs/Actions.md @@ -343,7 +343,7 @@ React-admin can handle the following side effects metas: - `refresh`: Force a rerender of the current view (equivalent to pressing the Refresh button). Set to true to enable. - `unselectAll`: Unselect all lines in the current datagrid. Set to true to enable. - `callback`: Execute an arbitrary function. The meta value should be the function to execute. It receives the `requestPayload` and the response `payload`. -- `basePath`: This is not a side effect, but it's used internaly to compute redirection paths. Set it when you have a redirection side effect. +- `basePath`: This is not a side effect, but it's used internally to compute redirection paths. Set it when you have a redirection side effect. ## Success and Failure Side Effects diff --git a/docs/Authentication.md b/docs/Authentication.md index 6d268ef61d5..674d071057e 100644 --- a/docs/Authentication.md +++ b/docs/Authentication.md @@ -176,7 +176,7 @@ export default (type, params) => { if (type === AUTH_CHECK) { return localStorage.getItem('token') ? Promise.resolve() : Promise.reject(); } - return Promise.reject('Unkown method'); + return Promise.reject('Unknown method'); }; ``` @@ -199,7 +199,7 @@ export default (type, params) => { if (type === AUTH_CHECK) { return localStorage.getItem('token') ? Promise.resolve() : Promise.reject({ redirectTo: '/no-access' }); } - return Promise.reject('Unkown method'); + return Promise.reject('Unknown method'); }; ``` @@ -228,7 +228,7 @@ export default (type, params) => { // check credentials for the comments resource } } - return Promise.reject('Unkown method'); + return Promise.reject('Unknown method'); }; ``` diff --git a/docs/Authorization.md b/docs/Authorization.md index 233b47dc000..b7de0d2756f 100644 --- a/docs/Authorization.md +++ b/docs/Authorization.md @@ -57,7 +57,7 @@ export default (type, params) => { const role = localStorage.getItem('role'); return role ? Promise.resolve(role) : Promise.reject(); } - return Promise.reject('Unkown method'); + return Promise.reject('Unknown method'); }; ``` {% endraw %} diff --git a/docs/CreateEdit.md b/docs/CreateEdit.md index 0d09b3dd5cf..055c6f6cb8a 100644 --- a/docs/CreateEdit.md +++ b/docs/CreateEdit.md @@ -138,7 +138,7 @@ Using a custom `EditActions` component also allow to remove the `` ## Prefilling a `` Record -You may need to prepopulate a record based on another one. For that use case, use the `` component. It expects a `record` and a `basePath` (usually injected to children of ``, ``, ``, etc.), so it's as simple to use as a regulat field or input. +You may need to prepopulate a record based on another one. For that use case, use the `` component. It expects a `record` and a `basePath` (usually injected to children of ``, ``, ``, etc.), so it's as simple to use as a regular field or input. For instance, to allow cloning all the posts from the list: @@ -212,7 +212,7 @@ const CreateRelatedCommentButton = ({ record }) => ( ``` {% endraw %} -However, this will only work if the post ids are typed as strings in the store. That's because the query string `?post_id=123`, once deserialized, reads as `{ post_id: '123' }` and not `{ post_id: 123 }`. Since [the `` uses srict equality to check the selected option](https://github.com/mui-org/material-ui/issues/12047) comparing the `post_id` `'123'` from the URL with values like `123` in the choices will fail. +However, this will only work if the post ids are typed as strings in the store. That's because the query string `?post_id=123`, once deserialized, reads as `{ post_id: '123' }` and not `{ post_id: 123 }`. Since [the `` uses strict equality to check the selected option](https://github.com/mui-org/material-ui/issues/12047) comparing the `post_id` `'123'` from the URL with values like `123` in the choices will fail. So prefer `location.state` instead of `location.search` when you can, or use custom selection components. @@ -229,7 +229,7 @@ to change this behaviour you can pass `false` for the `submitOnEnter` property, Here are all the props accepted by the `` component: -* [`defautValue`](#default-values) +* [`defaultValue`](#default-values) * [`validate`](#validation) * [`submitOnEnter`](#submit-on-enter) * [`redirect`](#redirection-after-submission) @@ -261,7 +261,7 @@ to change this behaviour you can pass `false` for the `submitOnEnter` property. Here are all the props accepted by the `` component: -* [`defautValue`](#default-values) +* [`defaultValue`](#default-values) * [`validate`](#validation) * [`submitOnEnter`](#submit-on-enter) * [`redirect`](#redirection-after-submission) @@ -619,7 +619,7 @@ Here are the props received by the `Toolbar` component when passed as the `toolb **Tip**: Don't forget to also set the `redirect` prop of the Form component to handle submission by the `ENTER` key. -**Tip**: To alter the form values before submitting, you should use the `handleSubmit` prop. See [Altering the Form Values before Submitting](./Actions.md#altering-the-form-values-before-submitting) for more informations and example. +**Tip**: To alter the form values before submitting, you should use the `handleSubmit` prop. See [Altering the Form Values before Submitting](./Actions.md#altering-the-form-values-before-submitting) for more information and examples. ## Customizing Input Container Styles diff --git a/docs/DataProviders.md b/docs/DataProviders.md index 62a159c45d8..3b52a1f19d3 100644 --- a/docs/DataProviders.md +++ b/docs/DataProviders.md @@ -209,7 +209,7 @@ const addUploadFeature = requestHandler => (type, resource, params) => { })); } } - // for other request types and reources, fall back to the defautl request handler + // for other request types and resources, fall back to the default request handler return requestHandler(type, resource, params); }; diff --git a/docs/Inputs.md b/docs/Inputs.md index 1318d82b085..cd006a9fd69 100644 --- a/docs/Inputs.md +++ b/docs/Inputs.md @@ -308,7 +308,7 @@ import { AutocompleteArrayInput, ReferenceArrayInput } from 'react-admin' | `allowEmpty` | Optional | `boolean` | `false` | If `false` and the searchText typed did not match any suggestion, the searchText will revert to the current value when the field is blurred. If `true` and the `searchText` is set to `''` then the field will set the input value to `null`. | | `inputValueMatcher` | Optional | `Function` | `(input, suggestion, getOptionText) => input.toLowerCase().trim() === getOptionText(suggestion).toLowerCase().trim()` | Allows to define how choices are matched with the searchText while typing. | | `optionValue` | Optional | `string` | `id` | Fieldname of record containing the value to use as input value | -| `optionText` | Optional | string | Function | `name` | Fieldname of record to display in the suggestion item or function which accepts the currect record as argument (`(record)=> {string}`) | +| `optionText` | Optional | string | Function | `name` | Fieldname of record to display in the suggestion item or function which accepts the current record as argument (`(record)=> {string}`) | | `setFilter` | Optional | `Function` | null | A callback to inform the `searchText` has changed and new `choices` can be retrieved based on this `searchText`. Signature `searchText => void`. This function is automatically setup when using `ReferenceInput`. | | `suggestionComponent` | Optional | Function | `({ suggestion, query, isHighlighted, props }) =>
` | Allows to override how the item is rendered. | @@ -513,7 +513,7 @@ Previews are enabled using `` children, as following: Writing a custom field component for displaying the current value(s) is easy: it's a standard [field](./Fields.md#writing_your_own_field_component). -When receiving **new** files, `ImageInput` will add a `rawFile` property to the object passed as the `record` prop of children. This `rawFile` is the [File](https://developer.mozilla.org/en-US/docs/Web/API/File) instance of the newly added file. This can be useful to display informations about size or mimetype inside a custom field. +When receiving **new** files, `ImageInput` will add a `rawFile` property to the object passed as the `record` prop of children. This `rawFile` is the [File](https://developer.mozilla.org/en-US/docs/Web/API/File) instance of the newly added file. This can be useful to display information about size or mimetype inside a custom field. The `ImageInput` component accepts an `options` prop into which you can pass all the [react-dropzone properties](https://react-dropzone.netlify.com/#proptypes). However, some of the most useful props should be passed **directly** on the `ImageInput`: `maxSize`, `minSize`, `multiple`. @@ -543,7 +543,7 @@ Previews (actually a simple list of files names) are enabled using `` Writing a custom field component for displaying the current value(s) is easy: it's a standard [field](./Fields.md#writing_your_own_field_component). -When receiving **new** files, `FileInput` will add a `rawFile` property to the object passed as the `record` prop of children. This `rawFile` is the [File](https://developer.mozilla.org/en-US/docs/Web/API/File) instance of the newly added file. This can be useful to display informations about size or mimetype inside a custom field. +When receiving **new** files, `FileInput` will add a `rawFile` property to the object passed as the `record` prop of children. This `rawFile` is the [File](https://developer.mozilla.org/en-US/docs/Web/API/File) instance of the newly added file. This can be useful to display information about size or mimetype inside a custom field. The `FileInput` component accepts an `options` prop into which you can pass all the [react-dropzone properties](https://react-dropzone.netlify.com/#proptypes). However, some of the most useful props should be passed **directly** on the `FileInput`: `maxSize`, `minSize`, `multiple`. diff --git a/docs/List.md b/docs/List.md index 0dbec60c4a6..e6e0fa68b1d 100644 --- a/docs/List.md +++ b/docs/List.md @@ -520,7 +520,7 @@ export const PostList = (props) => ( ``` {% endraw %} -**Tip**: The `filter` and `filterDefaultValues` props have one key difference: the `filterDefaultValues` can be overriddent by the user, while the `filter` values are always sent to the data provider. Or, to put it otherwise: +**Tip**: The `filter` and `filterDefaultValues` props have one key difference: the `filterDefaultValues` can be overridden by the user, while the `filter` values are always sent to the data provider. Or, to put it otherwise: ```js const filterSentToDataProvider = { ...filterDefaultValues, ...filterChosenByUser, ...filters }; diff --git a/examples/README.md b/examples/README.md index b2eb44421de..e81e2872d9f 100644 --- a/examples/README.md +++ b/examples/README.md @@ -2,7 +2,7 @@ ## Contributing -If you'd like to contribute example applications, you'll likely use [`create-react-app`](https://github.com/facebookincubator/create-react-app). Unfortunatly, you won't be able to initialize your example by running `create-react-app myexample` directly in this directory. This is because `create-react-app` does not work yet with yarn workspaces and lerna. There is a workaround though: +If you'd like to contribute example applications, you'll likely use [`create-react-app`](https://github.com/facebookincubator/create-react-app). Unfortunately, you won't be able to initialize your example by running `create-react-app myexample` directly in this directory. This is because `create-react-app` does not work yet with yarn workspaces and lerna. There is a workaround though: Initialize your new example application outside of react-admin folder then simply move the newly created folder inside the `examples` folder. Finally, run `yarn` at the react-admin root folder.