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 in docs and comments #5946

Merged
merged 2 commits into from
Feb 23, 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
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* Fix form children props are overridden ([5895](https://github.com/marmelab/react-admin/pull/5895)) ([djhi](https://github.com/djhi))
* [Doc] Add lb4, processmaker3, and mixer data provider links ([5939](https://github.com/marmelab/react-admin/pull/5939)) ([ckoliber](https://github.com/ckoliber))
* [Doc] Fix minor typos ([5912](https://github.com/marmelab/react-admin/pull/5912)) ([WiXSL](https://github.com/WiXSL))
* [TypeScript] Fix data provider mutation types don't allow to specity Record type ([5934](https://github.com/marmelab/react-admin/pull/5934)) ([andrico1234](https://github.com/andrico1234))
* [TypeScript] Fix data provider mutation types don't allow to specify Record type ([5934](https://github.com/marmelab/react-admin/pull/5934)) ([andrico1234](https://github.com/andrico1234))

## v3.12.4

Expand Down
2 changes: 1 addition & 1 deletion docs/Authentication.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ export default {

Redirecting to the login page whenever a REST response uses a 401 status code is usually not enough. React-admin keeps data on the client side, and could briefly display stale data while contacting the server - even after the credentials are no longer valid.

Fortunately, each time the user navigates to a list, edit, create or show page, react-admin calls the `authProvider.checkAuth()` method. If this method returns a rejected Promise, react-admin calls `authProvider.logout()` and redirects the user to the login page. So it's the ideal place to make sure the credentials are still valid.
Fortunately, each time the user navigates to a list, edit, create or show page, react-admin calls the `authProvider.checkAuth()` method. If this method returns a rejected Promise, react-admin calls `authProvider.logout()` and redirects the user to the login page. So it's the ideal place to make sure the credentials are still valid.

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

Expand Down
2 changes: 1 addition & 1 deletion docs/CreateEdit.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ The `<Create>` and `<Edit>` components call the `dataProvider`, prepare the form

![post creation form](./img/create-view.png)

The `<Create>` component clones its child, and passes it an empty object `{}`) as `record` prop. It also passes a callback as `save` prop, which calls `dataProvider.create()`.
The `<Create>` component clones its child, and passes it an empty object `{}` as `record` prop. It also passes a callback as `save` prop, which calls `dataProvider.create()`.

![post edition form](./img/edit-view.png)

Expand Down
2 changes: 1 addition & 1 deletion docs/Fields.md
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ import { DateField } from 'react-admin';
| ---------- | -------- | ------- | ------- | -------------------------------------------------------------------------------------------------------- |
| `locales` | Optional | string | '' | Override the browser locale in the date formatting. Passed as first argument to `Intl.DateTimeFormat()`. |
| `options` | Optional | Object | - | Date formatting options. Passed as second argument to `Intl.DateTimeFormat()`. |
| `showTime` | Optional | boolean | false | If true, show date and time. If false, show only date |
| `showTime` | Optional | boolean | `false` | If true, show date and time. If false, show only date |

`<DateField>` also accepts the [common field props](./Fields.md#common-field-props).

Expand Down
2 changes: 1 addition & 1 deletion docs/List.md
Original file line number Diff line number Diff line change
Expand Up @@ -1259,7 +1259,7 @@ const SongList: FC<Props> = props => (
);
```

For mode details about Saved Queries, check the [`ra-preferences` module](https://marmelab.com/ra-enterprise/modules/ra-preferences#savedquerieslist-and-filterwithsave-store-user-queries-in-preferences) in React-Admin Enterprise Edition.
For mode details about Saved Queries, check the [`ra-preferences` module](https://marmelab.com/ra-enterprise/modules/ra-preferences#savedquerieslist-and-filterwithsave-store-user-queries-in-preferences) in React-Admin Enterprise Edition.

### Building a Custom Filter

Expand Down
2 changes: 1 addition & 1 deletion packages/ra-core/src/auth/usePermissionsOptimized.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const alreadyFetchedPermissions = { '{}': undefined };
* const PostDetail = props => {
* const { permissions } = usePermissionsOptimized();
* if (permissions !== 'editor') {
* return <Redirect to={`posts/${props.id}/show`} />
* return <Redirect to={`posts/${props.id}/show`} />
* } else {
* return <PostEdit {...props} />
* }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ describe('References data status', () => {
referenceRecord: null,
},
null,
'there is no error if there is a linked reference without data but the references fetch succeeds even empty'
'there is no error if there is a linked reference without data but the references fetch succeeds even empty'
);
test(
{
Expand Down Expand Up @@ -351,7 +351,7 @@ describe('References data status', () => {
referenceRecords: [],
},
null,
'there is no error if there is a linked reference without data but the references fetch succeeds even empty'
'there is no error if there is a linked reference without data but the references fetch succeeds even empty'
);
test(
{
Expand Down
2 changes: 1 addition & 1 deletion packages/ra-core/src/controller/useListParams.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ const useListParams = ({

// On mount, if the location includes params (for example from a link like
// the categories products on the demo), we need to persist them in the
// redux state as well so that we don't loose them after a redirection back
// redux state as well so that we don't lose them after a redirection back
// to the list
useEffect(() => {
if (Object.keys(queryFromLocation).length > 0) {
Expand Down
2 changes: 1 addition & 1 deletion packages/ra-core/src/util/FieldTitle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export const FieldTitle: FunctionComponent<Props> = ({
);
};

// wat? TypeScript looses the displayName if we don't set it explicitly
// What? TypeScript loses the displayName if we don't set it explicitly
FieldTitle.displayName = 'FieldTitle';

export default memo(FieldTitle);
4 changes: 2 additions & 2 deletions packages/ra-core/src/util/TestContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@ const dataProviderDefaultResponse = { data: null };
* Pass custom store values as store prop
*
* @example
* // in an react testing-library test
* // in a react testing-library test
* const utils = render(
* <TestContext initialState={{ admin: { resources: { post: { data: { 1: {id: 1, title: 'foo' } } } } } }}>
* <Show {...defaultShowProps} />
* </TestContext>
* );
*
* @example
* // in an react testing-library test, using jest.
* // in a react testing-library test, using jest.
* const utils = render(
* <TestContext initialState={{ admin: { resources: { post: { data: { 1: {id: 1, title: 'foo' } } } } } }}>
* {({ store }) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/ra-ui-materialui/src/field/ImageField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ const ImageField: FC<ImageFieldProps> = props => {
);
};

// wat? TypeScript looses the displayName if we don't set it explicitly
// What? TypeScript loses the displayName if we don't set it explicitly
ImageField.displayName = 'ImageField';

ImageField.defaultProps = {
Expand Down
2 changes: 1 addition & 1 deletion packages/ra-ui-materialui/src/field/NumberField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export const NumberField: FC<NumberFieldProps> = memo<NumberFieldProps>(
}
);

// what? TypeScript looses the displayName if we don't set it explicitly
// what? TypeScript loses the displayName if we don't set it explicitly
NumberField.displayName = 'NumberField';

NumberField.defaultProps = {
Expand Down
2 changes: 1 addition & 1 deletion packages/ra-ui-materialui/src/field/TextField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const TextField: FC<TextFieldProps> = memo<TextFieldProps>(
}
);

// what? TypeScript looses the displayName if we don't set it explicitly
// what? TypeScript loses the displayName if we don't set it explicitly
TextField.displayName = 'TextField';

TextField.defaultProps = {
Expand Down
2 changes: 1 addition & 1 deletion packages/ra-ui-materialui/src/form/FormInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export interface FormInputProps<
variant?: 'standard' | 'outlined' | 'filled';
}

// wat? TypeScript looses the displayName if we don't set it explicitly
// What? TypeScript loses the displayName if we don't set it explicitly
FormInput.displayName = 'FormInput';

export default FormInput;
2 changes: 1 addition & 1 deletion packages/ra-ui-materialui/src/layout/LinearProgress.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ LinearProgress.propTypes = {
timeout: PropTypes.number,
};

// wat? TypeScript looses the displayName if we don't set it explicitly
// What? TypeScript loses the displayName if we don't set it explicitly
LinearProgress.displayName = 'LinearProgress';

export interface LinearProgressProps extends ProgressProps {
Expand Down
2 changes: 1 addition & 1 deletion packages/ra-ui-materialui/src/list/datagrid/Datagrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ import { ClassesOverride } from '../../types';
* </ReferenceManyField>
*
*
* @example Usage it outside of a <List> or a <ReferenceManyField>.
* @example Usage outside of a <List> or a <ReferenceManyField>.
*
* const currentSort = { field: 'published_at', order: 'DESC' };
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export interface DatagridCellProps extends TableCellProps {
resource?: string;
}

// wat? TypeScript looses the displayName if we don't set it explicitly
// What? TypeScript loses the displayName if we don't set it explicitly
DatagridCell.displayName = 'DatagridCell';

export default DatagridCell;