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 js vs jsx markdown styles in docs code. #3938

Merged
merged 4 commits into from
Nov 6, 2019
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
16 changes: 8 additions & 8 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@
* Fix `ReferenceInput` ignores its `sort` prop ([3783](https://github.com/marmelab/react-admin/pull/3783)) ([djhi](https://github.com/djhi))
* Add `redux-devtools-extension` trace feature in development mode if available ([3781](https://github.com/marmelab/react-admin/pull/3781)) ([WiXSL](https://github.com/WiXSL))
* Fix unstable tests ([3777](https://github.com/marmelab/react-admin/pull/3777)) ([djhi](https://github.com/djhi))
* Fix minor typo in custom data-provider exemple documentation([3775](https://github.com/marmelab/react-admin/pull/3775)) ([alexisjanvier](https://github.com/alexisjanvier))
* Fix minor typo in custom data-provider example documentation([3775](https://github.com/marmelab/react-admin/pull/3775)) ([alexisjanvier](https://github.com/alexisjanvier))
* Fix missing deprecated component in Upgrade guide ([3770](https://github.com/marmelab/react-admin/pull/3770)) ([Kmaschta](https://github.com/Kmaschta))
* Add hooks to Reference documentation ([3768](https://github.com/marmelab/react-admin/pull/3768)) ([fzaninotto](https://github.com/fzaninotto))
* Fix missing quote in `i18nProvider` upgrade guide ([3766](https://github.com/marmelab/react-admin/pull/3766)) ([mabhub](https://github.com/mabhub))
* Fix example for `useDispatch` hook in upgrade guide ([3765](https://github.com/marmelab/react-admin/pull/3765)) ([mabhub](https://github.com/mabhub))
* Update dependencies for stateful packages to avoid duplicate pckages bug ([3763](https://github.com/marmelab/react-admin/pull/3763)) ([kopax](https://github.com/kopax))
* Update dependencies for stateful packages to avoid duplicate packages bug ([3763](https://github.com/marmelab/react-admin/pull/3763)) ([kopax](https://github.com/kopax))
* Fix Forms Remove Empty Values ([3758](https://github.com/marmelab/react-admin/pull/3758)) ([djhi](https://github.com/djhi))

## v3.0.0-beta.1
Expand Down Expand Up @@ -612,7 +612,7 @@ For highlights about this version, read [the react-admin 2.6 announcement blog p

## v2.5.1

* Fix warning in SelectInput test ([2608](https://github.com/marmelab/react-admin/pull/2608)) ([fzaninotto](https://github.com/fzaninotto))
* Fix warning in `SelectInput` test ([2608](https://github.com/marmelab/react-admin/pull/2608)) ([fzaninotto](https://github.com/fzaninotto))
* Fix Autocomplete suggestions positioning is sometimes not recalculated properly ([2607](https://github.com/marmelab/react-admin/pull/2607)) ([djhi](https://github.com/djhi))
* Fix login background style ([2594](https://github.com/marmelab/react-admin/pull/2594), [2596](https://github.com/marmelab/react-admin/pull/2596)) ([Kmaschta](https://github.com/Kmaschta))

Expand Down Expand Up @@ -725,7 +725,7 @@ For highlights about this version, read the [react-admin 2.4 announcement blog p
* Fix query-string parsing for array values in `Create` ([#2373](https://github.com/marmelab/react-admin/pull/2373)) ([djhi](https://github.com/djhi))
* Fix out of boundaries pagination does not allow pagination ([#2365](https://github.com/marmelab/react-admin/pull/2365)) ([fzaninotto](https://github.com/fzaninotto))
* Fix `SimpleFormIterator` does not iterate on sub records ([#2364](https://github.com/marmelab/react-admin/pull/2364)) ([fzaninotto](https://github.com/fzaninotto))
* Fix triling whitespaces in documentation ([#2359](https://github.com/marmelab/react-admin/pull/2359)) ([josx](https://github.com/josx))
* Fix trailing whitespaces in documentation ([#2359](https://github.com/marmelab/react-admin/pull/2359)) ([josx](https://github.com/josx))
* Fix Feathers dataProvidr package name to `ra-data-feathers` ([#2358](https://github.com/marmelab/react-admin/pull/2358)) ([josx](https://github.com/josx))
* Fix small typo in `List` doc ([#2355](https://github.com/marmelab/react-admin/pull/2355)) ([ArnaudD](https://github.com/ArnaudD))
* Fix `fetchRelatedRecords` should ignore nullable relationships in `exporter` ([#2354](https://github.com/marmelab/react-admin/pull/2354)) ([Luwangel](https://github.com/Luwangel))
Expand Down Expand Up @@ -795,7 +795,7 @@ For highlights about this version, read [the 2.3 release announcement post](http
* [GraphQL] Allow easier per-query override ([djhi](https://github.com/djhi))
* [npm] Expose `esm` modules to enable tree shaking (and smaller bundle size) ([Kmaschta](https://github.com/Kmaschta))
* [npm] Remove babel `stage-0` preset and use `preset-env` instead ([Kmaschta](https://github.com/Kmaschta))
* [redux] Allow to use <Admin> inside an external <Provider> ([fzaninotto](https://github.com/fzaninotto))
* [redux] Allow to use `<Admin>` inside an external `<Provider>` ([fzaninotto](https://github.com/fzaninotto))

Deprecations:

Expand Down Expand Up @@ -849,7 +849,7 @@ Deprecations:
* Fix `ra-data-graphql-simple` example usage ([kfern](https://github.com/kfern))
* Fix typo in `<ArrayInput>` documentation ([igneel64](https://github.com/igneel64))
* Fix documentation links not working work when browsing the doc via Github ([fzaninotto](https://github.com/fzaninotto))
* Fix link in `CreateEdit` dicumentation ([JulienMattiussi](https://github.com/JulienMattiussi))
* Fix link in `CreateEdit` documentation ([JulienMattiussi](https://github.com/JulienMattiussi))
* Fix error when using `<ReferenceInput>` in `<SimpleFormIterator>` ([blasic](https://github.com/blasic))
* Fix Field with `sortBy` and no `source` is not sortable ([Luwangel](https://github.com/Luwangel))
* Fix `<label>` and `<input>` not bounded correctly in login form ([josx](https://github.com/josx))
Expand Down Expand Up @@ -1042,7 +1042,7 @@ This new release is not backwards compatible with 1.x. Please refer to [the Upgr

# v1.4.0

* Documentation: change extraction of status for AUTH_ERROR ([zifnab87](https://github.com/zifnab87))
* Documentation: change extraction of status for `AUTH_ERROR` ([zifnab87](https://github.com/zifnab87))
* Add Slovak translation ([zavadpe](https://github.com/zavadpe))
* Documentation: Use standard es6 in docs and example ([djhi](https://github.com/djhi))
* Fix: Ensure validation custom messages without translation don't add warnings ([djhi](https://github.com/djhi))
Expand Down Expand Up @@ -1540,7 +1540,7 @@ See the [v0.7.0 announcement in the marmelab blog](https://marmelab.com/blog/201

## v0.6.0

* [BC Break] The `filter` prop of the <List> component now expects an element rather than a component (`<List filter={<MyFilter/>} >` rather than `<List filter={MyFilter} >`)
* [BC Break] The `filter` prop of the `<List>` component now expects an element rather than a component (`<List filter={<MyFilter/>} >` rather than `<List filter={MyFilter} >`)
* [BC Break] The `title` prop of all view components now expect an element rather than a component (`<List title={<MyTitle/>`} > rather than `<List title={MyTitle} >`)
* [BC Break] Rename `style` to `elStyle` and let style override container element
* Add special design for non-sortable columns in `<Datagrid>`
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ Unit tests use `jest`, so you should be able to run a subset of tests, or run te
yarn jest
```

Besides, tests related to the modified files are ran automatically at commit useing a git pre-commit hook. this means you won't be able to commit your changes if they break the tests.
Besides, tests related to the modified files are ran automatically at commit using a git pre-commit hook. this means you won't be able to commit your changes if they break the tests.

When working on the end to end tests, you can leverage [cypress](https://www.cypress.io/) runner by starting the simple example yourself (`make run-simple` or `yarn run-simple`) and starting cypress in another terminal (`make test-e2e-local` or `yarn test-e2e-local`).

Expand Down
6 changes: 3 additions & 3 deletions UPGRADE.md
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ const OrderEdit = (props) => (

## Validators Should Return Non-Translated Messages

Form validators used to return translated error messages - that's why they received the field `props` as argument, including the `translate` function. They don't receive these props anymore, and they must return unstranslated messages instead - react-admin translates validation messages afterwards.
Form validators used to return translated error messages - that's why they received the field `props` as argument, including the `translate` function. They don't receive these props anymore, and they must return untranslated messages instead - react-admin translates validation messages afterwards.

```diff
// in validators/required.js
Expand Down Expand Up @@ -397,7 +397,7 @@ If you had custom exporter on `List` components, here's how to migrate:

## The `exporter` Function Has Changed Signature

In a `List`, you can pass a custom `exporter` function to control the data downloaded by users when they cllick on the "Export" button.
In a `List`, you can pass a custom `exporter` function to control the data downloaded by users when they click on the "Export" button.

```jsx
const CommentList = props => (
Expand Down Expand Up @@ -1023,7 +1023,7 @@ const PostEdit = props =>

## The `<AutocompleteInput>` And `<AutocompleteArrayInput>` Components No Longer Support Certain Props

We rewrote the `<AutocompleteInput>` and `<AutocompleteArrayInput>` components from scratch using [`downshift`](https://github.com/downshift-js/downshift), while the previous version was based on [react-autosuggest](http://react-autosuggest.js.org/). The new components are more robust and more future-proof, and their API didn't change.
We rewrote the `<AutocompleteInput>` and `<AutocompleteArrayInput>` components from scratch using [`downshift`](https://github.com/downshift-js/downshift), while the previous version was based on [react-autosuggest](https://react-autosuggest.js.org/). The new components are more robust and more future-proof, and their API didn't change.

There are three breaking changes in the new `<AutocompleteInput>` and `<AutocompleteArrayInput>` components:

Expand Down
10 changes: 5 additions & 5 deletions docs/Actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@ const UserProfile = ({ userId }) => {

The return value of `useQuery` is an object representing the query state, using the following keys:

- `data`: undefined until the response arrives, then contains the `data` key in the `dataProvider` response
- `total`: null until the response arrives, then contains the `total` key in the `dataProvider` response (only for `getList` and `getManyReference` types)
- `error`: null unless the `dataProvider` threw an error, in which case it contains that error.
- `data`: `undefined` until the response arrives, then contains the `data` key in the `dataProvider` response
- `total`: `null` until the response arrives, then contains the `total` key in the `dataProvider` response (only for `getList` and `getManyReference` types)
- `error`: `null` unless the `dataProvider` threw an error, in which case it contains that error.
- `loading`: A boolean updating according to the request state
- `loaded`: A boolean updating according to the request state

Expand Down Expand Up @@ -166,8 +166,8 @@ The return value of `useQuery` is an array with the following items:

- A callback function
- An object representing the query state, using the following keys
- `data`: undefined until the response arrives, then contains the `data` key in the `dataProvider` response
- `error`: null unless the `dataProvider` threw an error, in which case it contains that error.
- `data`: `undefined` until the response arrives, then contains the `data` key in the `dataProvider` response
- `error`: `null` unless the `dataProvider` threw an error, in which case it contains that error.
- `loading`: A boolean updating according to the request state
- `loaded`: A boolean updating according to the request state

Expand Down
2 changes: 1 addition & 1 deletion docs/Admin.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ const App = () => (

**Tip**: This prop is deprecated. To override the menu component, use a [custom layout](#layout) instead.

React-admin uses the list of `<Resource>` components passed as children of `<Admin>` to build a menu to each resource with a `list` component.
React-admin uses the list of `<Resource>` components passed as children of `<Admin>` to build a menu to each resource with a `<List>` component.

If you want to add or remove menu items, for instance to link to non-resources pages, you can create your own menu component:

Expand Down
10 changes: 5 additions & 5 deletions docs/Authentication.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Upon submission, this form calls the `authProvider.login({ login, password })` m

For instance, to query an authentication route via HTTPS and store the credentials (a token) in local storage, configure `authProvider` as follows:

```jsx
```js
// in src/authProvider.js
export default {
login: ({ username, password }) => {
Expand Down Expand Up @@ -117,7 +117,7 @@ As soon as you provide an `authProvider` prop to `<Admin>`, react-admin displays

So it's the responsibility of the `authProvider` to cleanup the current authentication data. For instance, if the authentication was a token stored in local storage, here the code to remove it:

```jsx
```js
// in src/authProvider.js
export default {
login: ({ username, password }) => { /* ... */ },
Expand All @@ -143,7 +143,7 @@ Fortunately, each time the API returns an error, react-admin calls the `authProv

For instance, to redirect the user to the login page for both 401 and 403 codes:

```jsx
```js
// in src/authProvider.js
export default {
login: ({ username, password }) => { /* ... */ },
Expand All @@ -170,7 +170,7 @@ Fortunately, each time the user navigates, react-admin calls the `authProvider.c

For instance, to check for the existence of the token in local storage:

```jsx
```js
// in src/authProvider.js
export default {
login: ({ username, password }) => { /* ... */ },
Expand All @@ -185,7 +185,7 @@ export default {

If the promise is rejected, react-admin redirects by default to the `/login` page. You can override where to redirect the user in `checkAuth()`, by rejecting an object with a `redirectTo` property:

```jsx
```js
// in src/authProvider.js
export default {
login: ({ username, password }) => { /* ... */ },
Expand Down
2 changes: 1 addition & 1 deletion docs/CustomApp.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ You can use this script as a base and then add your own middlewares or enhancers

Then, use the `<Admin>` component as you would in a standalone application. Here is an example with 3 resources: `posts`, `comments`, and `users`

```js
```jsx
// in src/App.js
import React from 'react';
import { Provider } from 'react-redux';
Expand Down
2 changes: 1 addition & 1 deletion docs/DataProviders.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ dataProvider
.getOne('posts', { id: 123 })
.then(response => {
console.log(response.data); // { id: 123, title: "hello, world" }
})
});
```

It's the Data Provider's job to turns these method calls into HTTP requests, and transform the HTTP responses to the data format expected by react-admin. In technical terms, a Data Provider is an *adapter* for an API.
Expand Down
14 changes: 7 additions & 7 deletions docs/Fields.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export const PostShow = ({ ...props }) => (

**Tip**: If you display a record with a complex structure, you can use a path with dot separators as the `source` attribute. For instance, if the API returns the following 'book' record:

```jsx
```js
{
id: 1234,
title: 'War and Peace',
Expand Down Expand Up @@ -441,14 +441,14 @@ const FullNameField = ({ record }) => <Chip>{record.first_name} {record.last_nam

The current choice is translated by default, so you can use translation identifiers as choices:

```jsx
```js
const choices = [
{ id: 'M', name: 'myroot.gender.male' },
{ id: 'F', name: 'myroot.gender.female' },
];
```

However, in some cases (e.g. inside a `<ReferenceField>`), you may not want the choice to be translated. In that case, set the `translateChoice` prop to false.
However, in some cases (e.g. inside a `<ReferenceField>`), you may not want the choice to be translated. In that case, set the `translateChoice` prop to `false`.

```jsx
<SelectField source="gender" choices={choices} translateChoice={false}/>
Expand Down Expand Up @@ -529,7 +529,7 @@ You can also use a custom `link` function to get a custom path for the children.

**Tip**: React-admin accumulates and deduplicates the ids of the referenced records to make *one* `GET_MANY` call for the entire list, instead of n `GET_ONE` calls. So for instance, if the API returns the following list of comments:

```jsx
```js
[
{
id: 123,
Expand Down Expand Up @@ -905,7 +905,7 @@ const TextField = ({ source, record = {} }) => <span>{get(record, source)}</span

If you are not looking for reusability, you can create even simpler components, with no attributes. Let's say an API returns user records with `firstName` and `lastName` properties, and that you want to display a full name in a user list.

```jsx
```js
{
id: 123,
firstName: 'John',
Expand Down Expand Up @@ -941,7 +941,7 @@ React-admin uses a trick: the Show view layouts (`<SimpleShowLayout>` and `<Tabb

That means that the only thing you need to add to a custom component to make it usable in a Show view is a `addLabel: true` default prop.

```jsx
```js
FullNameField.defaultProps = {
addLabel: true,
};
Expand All @@ -965,7 +965,7 @@ const ConditionalEmailField = ({ record, ...rest }) =>
export default ConditionalEmailField;
```

**Tip**: Always check that the `record` is defined before inspecting its properties, as react-admin displays the Show view *before* fetching the record from the data provider. So the first time it renders the show view for a resource, the `record` is undefined.
**Tip**: Always check that the `record` is defined before inspecting its properties, as react-admin displays the Show view *before* fetching the record from the data provider. So the first time it renders the show view for a resource, the `record` is `undefined`.

This `ConditionalEmailField` is properly hidden when `hasEmail` is false. But when `hasEmail` is true, the Show layout renders it... without label. And if you add a `addLabel` default prop, the Show layout will render the label regardless of the `hasEmail` value...

Expand Down
Loading