Skip to content

Commit

Permalink
Merge pull request #2390 from civilizedgorilla/hotfix/documentation-s…
Browse files Browse the repository at this point in the history
…pelling-updates

Fix Documentation Spelling & Grammar Errors
  • Loading branch information
fzaninotto authored Oct 4, 2018
2 parents 58f5597 + b972e34 commit 6f1c6fc
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion docs/Actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 3 additions & 3 deletions docs/Authentication.md
Original file line number Diff line number Diff line change
Expand Up @@ -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');
};
```

Expand All @@ -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');
};
```

Expand Down Expand Up @@ -228,7 +228,7 @@ export default (type, params) => {
// check credentials for the comments resource
}
}
return Promise.reject('Unkown method');
return Promise.reject('Unknown method');
};
```

Expand Down
2 changes: 1 addition & 1 deletion docs/Authorization.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}
Expand Down
10 changes: 5 additions & 5 deletions docs/CreateEdit.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ Using a custom `EditActions` component also allow to remove the `<DeleteButton>`

## Prefilling a `<Create>` Record

You may need to prepopulate a record based on another one. For that use case, use the `<CloneButton>` component. It expects a `record` and a `basePath` (usually injected to children of `<Datagrid>`, `<SimpleForm>`, `<SimpleShowLayout>`, 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 `<CloneButton>` component. It expects a `record` and a `basePath` (usually injected to children of `<Datagrid>`, `<SimpleForm>`, `<SimpleShowLayout>`, 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:

Expand Down Expand Up @@ -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 `<SelectInput>` 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 `<SelectInput>` 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.

Expand All @@ -229,7 +229,7 @@ to change this behaviour you can pass `false` for the `submitOnEnter` property,

Here are all the props accepted by the `<SimpleForm>` component:

* [`defautValue`](#default-values)
* [`defaultValue`](#default-values)
* [`validate`](#validation)
* [`submitOnEnter`](#submit-on-enter)
* [`redirect`](#redirection-after-submission)
Expand Down Expand Up @@ -261,7 +261,7 @@ to change this behaviour you can pass `false` for the `submitOnEnter` property.

Here are all the props accepted by the `<TabbedForm>` component:

* [`defautValue`](#default-values)
* [`defaultValue`](#default-values)
* [`validate`](#validation)
* [`submitOnEnter`](#submit-on-enter)
* [`redirect`](#redirection-after-submission)
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docs/DataProviders.md
Original file line number Diff line number Diff line change
Expand Up @@ -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);
};

Expand Down
6 changes: 3 additions & 3 deletions docs/Inputs.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 | <code>string &#124; Function</code> | `name` | Fieldname of record to display in the suggestion item or function which accepts the currect record as argument (`(record)=> {string}`) |
| `optionText` | Optional | <code>string &#124; Function</code> | `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 }) => <div {...props} />` | Allows to override how the item is rendered. |

Expand Down Expand Up @@ -513,7 +513,7 @@ Previews are enabled using `<ImageInput>` 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`.

Expand Down Expand Up @@ -543,7 +543,7 @@ Previews (actually a simple list of files names) are enabled using `<FileInput>`

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`.

Expand Down
2 changes: 1 addition & 1 deletion docs/List.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 };
Expand Down
2 changes: 1 addition & 1 deletion examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down

0 comments on commit 6f1c6fc

Please sign in to comment.