diff --git a/packages/ra-core/src/auth/useCheckAuth.spec.tsx b/packages/ra-core/src/auth/useCheckAuth.spec.tsx index 511e8cd4130..4437818d3ee 100644 --- a/packages/ra-core/src/auth/useCheckAuth.spec.tsx +++ b/packages/ra-core/src/auth/useCheckAuth.spec.tsx @@ -102,7 +102,7 @@ describe('useCheckAuth', () => { expect(queryByText('not authenticated')).not.toBeNull(); }); - it('should logout whitout showing a notification when disableNotification is true', async () => { + it('should logout without showing a notification when disableNotification is true', async () => { const { queryByText } = render( @@ -114,7 +114,7 @@ describe('useCheckAuth', () => { expect(queryByText('authenticated')).toBeNull(); }); - it('should logout whitout showing a notification when authProvider returns error with message false', async () => { + it('should logout without showing a notification when authProvider returns error with message false', async () => { const { queryByText } = render( Promise.resolve(); * Logs the user out on failure. * * @param {Object} params The parameters to pass to the authProvider - * @param {boolean} logoutOnFailure Whether the user should be logged out if the authProvider fails to authenticatde them. True by default. + * @param {boolean} logoutOnFailure Whether the user should be logged out if the authProvider fails to authenticate them. True by default. * @param {string} redirectTo The login form url. Defaults to '/login' * @param {boolean} disableNotification Avoid showing a notification after the user is logged out. false by default. * diff --git a/packages/ra-core/src/auth/useLogin.ts b/packages/ra-core/src/auth/useLogin.ts index e2be295c9bb..c072179ee77 100644 --- a/packages/ra-core/src/auth/useLogin.ts +++ b/packages/ra-core/src/auth/useLogin.ts @@ -60,7 +60,7 @@ const useLogin = (): Login => { * Log a user in by calling the authProvider.login() method * * @param {Object} params Login parameters to pass to the authProvider. May contain username/email, password, etc - * @param {string} pathName The path to redirect to after login. By default, redirects to the home page, or to the last page visited after deconnexion. + * @param {string} pathName The path to redirect to after login. By default, redirects to the home page, or to the last page visited after disconnection. * * @return {Promise} The authProvider response */ diff --git a/packages/ra-core/src/auth/useLogout.ts b/packages/ra-core/src/auth/useLogout.ts index edeeb78062e..2f9854b7313 100644 --- a/packages/ra-core/src/auth/useLogout.ts +++ b/packages/ra-core/src/auth/useLogout.ts @@ -54,7 +54,7 @@ const useLogout = (): Logout => { // do not redirect return; } - // redirectTo can contain a query string, e.g '/login?foo=bar' + // redirectTo can contain a query string, e.g. '/login?foo=bar' // we must split the redirectTo to pass a structured location to history.push() const redirectToParts = ( redirectToFromProvider || redirectTo diff --git a/packages/ra-core/src/auth/useLogoutIfAccessDenied.spec.tsx b/packages/ra-core/src/auth/useLogoutIfAccessDenied.spec.tsx index d1a5495be01..539f1bfa015 100644 --- a/packages/ra-core/src/auth/useLogoutIfAccessDenied.spec.tsx +++ b/packages/ra-core/src/auth/useLogoutIfAccessDenied.spec.tsx @@ -107,7 +107,7 @@ describe('useLogoutIfAccessDenied', () => { expect(queryByText('logged in')).toBeNull(); }); - it('should logout whitout showing a notification if disableAuthentication is true', async () => { + it('should logout without showing a notification if disableAuthentication is true', async () => { const { queryByText } = render( { expect(queryByText('logged in')).toBeNull(); }); - it('should logout whitout showing a notification if authProvider returns error with message false', async () => { + it('should logout without showing a notification if authProvider returns error with message false', async () => { const { queryByText } = render( { const logoutIfAccessDeniedWithoutProvider = () => Promise.resolve(false); /** - * Call the authProvider.authError() method, unsing the error passed as argument. + * Call the authProvider.authError() method, using the error passed as argument. * If the authProvider rejects the call, logs the user out and shows a logged out notification. * * @param {Error} error An Error object (usually returned by the dataProvider) diff --git a/packages/ra-core/src/controller/ListContext.tsx b/packages/ra-core/src/controller/ListContext.tsx index 57bb3bec3a9..7792905d182 100644 --- a/packages/ra-core/src/controller/ListContext.tsx +++ b/packages/ra-core/src/controller/ListContext.tsx @@ -5,11 +5,11 @@ import { ListControllerProps } from './useListController'; * Context to store the result of the useListController() hook. * * Use the useListContext() hook to read the context. That's what many - * List components do in react-admn (e.g. , , ). + * List components do in react-admin (e.g. , , ). * * @typedef {Object} ListControllerProps * @prop {Object} data an id-based dictionary of the list data, e.g. { 123: { id: 123, title: 'hello world' }, 456: { ... } } - * @prop {Array} ids an array listing the ids of the records in the list, e.g [123, 456, ...] + * @prop {Array} ids an array listing the ids of the records in the list, e.g. [123, 456, ...] * @prop {integer} total the total number of results for the current filters, excluding pagination. Useful to build the pagination controls. e.g. 23 * @prop {boolean} loaded boolean that is false until the data is available * @prop {boolean} loading boolean that is true on mount, and false once the data was fetched @@ -23,9 +23,9 @@ import { ListControllerProps } from './useListController'; * @prop {Function} setFilters a callback to update the filters, e.g. setFilters(filters, displayedFilters) * @prop {Object} displayedFilters a dictionary of the displayed filters, e.g. { title: true, nationality: true } * @prop {Function} showFilter a callback to show one of the filters, e.g. showFilter('title', defaultValue) - * @prop {Function} hideFilter a callback to hide one of the filters, e.g. hidefilter('title') - * @prop {Array} selectedIds an array listing the ids of the selcted rows, e.g. [123, 456] - * @prop {Function} onSelect callback to change the list of selected rows, e.g onSelect([456, 789]) + * @prop {Function} hideFilter a callback to hide one of the filters, e.g. hideFilter('title') + * @prop {Array} selectedIds an array listing the ids of the selected rows, e.g. [123, 456] + * @prop {Function} onSelect callback to change the list of selected rows, e.g. onSelect([456, 789]) * @prop {Function} onToggleItem callback to toggle the selection of a given record based on its id, e.g. onToggleItem(456) * @prop {Function} onUnselectItems callback to clear the selection, e.g. onUnselectItems(); * @prop {string} basePath deduced from the location, useful for action buttons diff --git a/packages/ra-core/src/controller/ListFilterContext.tsx b/packages/ra-core/src/controller/ListFilterContext.tsx index 9994177d84a..0911aa98689 100644 --- a/packages/ra-core/src/controller/ListFilterContext.tsx +++ b/packages/ra-core/src/controller/ListFilterContext.tsx @@ -6,14 +6,14 @@ import { ListControllerProps } from './useListController'; * Context to store the filter part of the useListController() result. * * Use the useListFilterContext() hook to read the context. That's what many - * List components do in react-admn (e.g. , ). + * List components do in react-admin (e.g. , ). * * @typedef {Object} ListFilterContextValue * @prop {Object} filterValues a dictionary of filter values, e.g. { title: 'lorem', nationality: 'fr' } * @prop {Function} setFilters a callback to update the filters, e.g. setFilters(filters, displayedFilters) * @prop {Object} displayedFilters a dictionary of the displayed filters, e.g. { title: true, nationality: true } * @prop {Function} showFilter a callback to show one of the filters, e.g. showFilter('title', defaultValue) - * @prop {Function} hideFilter a callback to hide one of the filters, e.g. hidefilter('title') + * @prop {Function} hideFilter a callback to hide one of the filters, e.g. hideFilter('title') * @prop {string} resource the resource name, deduced from the location. e.g. 'posts' * * @typedef Props diff --git a/packages/ra-core/src/controller/ListPaginationContext.tsx b/packages/ra-core/src/controller/ListPaginationContext.tsx index 3775d6f0ec5..fece355e30a 100644 --- a/packages/ra-core/src/controller/ListPaginationContext.tsx +++ b/packages/ra-core/src/controller/ListPaginationContext.tsx @@ -6,7 +6,7 @@ import { ListControllerProps } from './useListController'; * Context to store the pagination part of the useListController() result. * * Use the useListPaginationContext() hook to read the pagination information. - * That's what List components do in react-admn (e.g. ). + * That's what List components do in react-admin (e.g. ). * * @typedef {Object} ListPaginationContextValue * @prop {boolean} loading boolean that is true on mount, and false once the data was fetched diff --git a/packages/ra-core/src/controller/ListSortContext.tsx b/packages/ra-core/src/controller/ListSortContext.tsx index 1b553875c8e..08fc7dae79c 100644 --- a/packages/ra-core/src/controller/ListSortContext.tsx +++ b/packages/ra-core/src/controller/ListSortContext.tsx @@ -6,7 +6,7 @@ import { ListControllerProps } from './useListController'; * Context to store the sort part of the useListController() result. * * Use the useListSortContext() hook to read the context. That's what many - * List components do in react-admn (e.g. ). + * List components do in react-admin (e.g. ). * * @typedef {Object} ListSortContextValue * @prop {Object} currentSort a sort object { field, order }, e.g. { field: 'date', order: 'DESC' } diff --git a/packages/ra-core/src/controller/details/SaveContext.tsx b/packages/ra-core/src/controller/details/SaveContext.tsx index 5f8ee690eeb..643039e3376 100644 --- a/packages/ra-core/src/controller/details/SaveContext.tsx +++ b/packages/ra-core/src/controller/details/SaveContext.tsx @@ -61,7 +61,7 @@ export const useSaveContext = < */ if (process.env.NODE_ENV !== 'production') { console.log( - "Edit or Create child components must be used inside a . Relying on props rather than context to get persistance related data and callbacks is deprecated and won't be supported in the next major version of react-admin." + "Edit or Create child components must be used inside a . Relying on props rather than context to get persistence related data and callbacks is deprecated and won't be supported in the next major version of react-admin." ); } diff --git a/packages/ra-core/src/controller/details/index.ts b/packages/ra-core/src/controller/details/index.ts index 617ca37a3c5..1d3703f61f5 100644 --- a/packages/ra-core/src/controller/details/index.ts +++ b/packages/ra-core/src/controller/details/index.ts @@ -23,7 +23,7 @@ export * from './useEditContext'; export * from './useShowContext'; // We don't want to export CreateProps, EditProps and ShowProps as they should -// not be used outside of ra-core would conflict with ra-ui-materialui types, +// not be used outside ra-core, since it would conflict with ra-ui-materialui types, // hence the named imports/exports export type { CreateControllerProps, EditControllerProps, ShowControllerProps }; export { useCreateController, useEditController, useShowController }; diff --git a/packages/ra-core/src/controller/field/ReferenceFieldController.tsx b/packages/ra-core/src/controller/field/ReferenceFieldController.tsx index 4e83cb28098..10c180fc088 100644 --- a/packages/ra-core/src/controller/field/ReferenceFieldController.tsx +++ b/packages/ra-core/src/controller/field/ReferenceFieldController.tsx @@ -23,7 +23,7 @@ interface Props { /** * Fetch reference record, and delegate rendering to child component. * - * The reference prop sould be the name of one of the components + * The reference prop should be the name of one of the components * added as child. * * @example diff --git a/packages/ra-core/src/controller/field/useReferenceManyFieldController.ts b/packages/ra-core/src/controller/field/useReferenceManyFieldController.ts index 138605bd8b3..e50ef83c9ef 100644 --- a/packages/ra-core/src/controller/field/useReferenceManyFieldController.ts +++ b/packages/ra-core/src/controller/field/useReferenceManyFieldController.ts @@ -32,9 +32,9 @@ interface Options { const defaultFilter = {}; /** - * Fetch reference records, and return them when avaliable + * Fetch reference records, and return them when available * - * The reference prop sould be the name of one of the components + * The reference prop should be the name of one of the components * added as child. * * @example diff --git a/packages/ra-core/src/controller/useFilterState.ts b/packages/ra-core/src/controller/useFilterState.ts index 7d1c1249301..daa352c42c6 100644 --- a/packages/ra-core/src/controller/useFilterState.ts +++ b/packages/ra-core/src/controller/useFilterState.ts @@ -33,7 +33,7 @@ const defaultFilterToQuery = (v: string) => ({ q: v }); * permanentFilter: { foo: 'bar' }, * debounceTime: 500, * }); - * // filter inital value: + * // filter initial value: * { * query: '', * foo: 'bar' diff --git a/packages/ra-core/src/controller/useListContext.ts b/packages/ra-core/src/controller/useListContext.ts index 148f8fb7b32..3d059246ff4 100644 --- a/packages/ra-core/src/controller/useListContext.ts +++ b/packages/ra-core/src/controller/useListContext.ts @@ -12,7 +12,7 @@ import { Record } from '../types'; * * @typedef {Object} ListControllerProps * @prop {Object} data an id-based dictionary of the list data, e.g. { 123: { id: 123, title: 'hello world' }, 456: { ... } } - * @prop {Array} ids an array listing the ids of the records in the list, e.g [123, 456, ...] + * @prop {Array} ids an array listing the ids of the records in the list, e.g. [123, 456, ...] * @prop {integer} total the total number of results for the current filters, excluding pagination. Useful to build the pagination controls. e.g. 23 * @prop {boolean} loaded boolean that is false until the data is available * @prop {boolean} loading boolean that is true on mount, and false once the data was fetched @@ -26,9 +26,9 @@ import { Record } from '../types'; * @prop {Function} setFilters a callback to update the filters, e.g. setFilters(filters, displayedFilters) * @prop {Object} displayedFilters a dictionary of the displayed filters, e.g. { title: true, nationality: true } * @prop {Function} showFilter a callback to show one of the filters, e.g. showFilter('title', defaultValue) - * @prop {Function} hideFilter a callback to hide one of the filters, e.g. hidefilter('title') - * @prop {Array} selectedIds an array listing the ids of the selcted rows, e.g. [123, 456] - * @prop {Function} onSelect callback to change the list of selected rows, e.g onSelect([456, 789]) + * @prop {Function} hideFilter a callback to hide one of the filters, e.g. hideFilter('title') + * @prop {Array} selectedIds an array listing the ids of the selected rows, e.g. [123, 456] + * @prop {Function} onSelect callback to change the list of selected rows, e.g. onSelect([456, 789]) * @prop {Function} onToggleItem callback to toggle the selection of a given record based on its id, e.g. onToggleItem(456) * @prop {Function} onUnselectItems callback to clear the selection, e.g. onUnselectItems(); * @prop {string} basePath deduced from the location, useful for action buttons diff --git a/packages/ra-core/src/controller/useListFilterContext.ts b/packages/ra-core/src/controller/useListFilterContext.ts index b4f468f7a5b..386d6e3c97a 100644 --- a/packages/ra-core/src/controller/useListFilterContext.ts +++ b/packages/ra-core/src/controller/useListFilterContext.ts @@ -13,7 +13,7 @@ import ListFilterContext, { ListFilterContextValue } from './ListFilterContext'; * @prop {Function} setFilters a callback to update the filters, e.g. setFilters(filters, displayedFilters) * @prop {Object} displayedFilters a dictionary of the displayed filters, e.g. { title: true, nationality: true } * @prop {Function} showFilter a callback to show one of the filters, e.g. showFilter('title', defaultValue) - * @prop {Function} hideFilter a callback to hide one of the filters, e.g. hidefilter('title') + * @prop {Function} hideFilter a callback to hide one of the filters, e.g. hideFilter('title') * @prop {string} resource the resource name, deduced from the location. e.g. 'posts' * * @returns {ListFilterContextValue} list controller props diff --git a/packages/ra-core/src/controller/usePaginationState.spec.ts b/packages/ra-core/src/controller/usePaginationState.spec.ts index 04901bab91b..8232583ebc0 100644 --- a/packages/ra-core/src/controller/usePaginationState.spec.ts +++ b/packages/ra-core/src/controller/usePaginationState.spec.ts @@ -8,7 +8,7 @@ describe('usePaginationState', () => { expect(hookValue.pagination).toEqual({ page: 1, perPage: 25 }); }); - it('should take given page and perPage props to initalize', () => { + it('should take given page and perPage props to initialize with', () => { const { hookValue } = renderHook(() => usePaginationState({ perPage: 50, page: 10 }) ); diff --git a/packages/ra-core/src/controller/usePaginationState.ts b/packages/ra-core/src/controller/usePaginationState.ts index 1bfe9b661af..67ebf47ae3a 100644 --- a/packages/ra-core/src/controller/usePaginationState.ts +++ b/packages/ra-core/src/controller/usePaginationState.ts @@ -35,11 +35,11 @@ const defaultPagination = { }; /** - * Hooks to provide pagination state (apge and perPage) + * Hooks to provide pagination state (page and perPage) * * @example * - * const { page, setpage, perPage, setPerPage } = usePagination(initialPerPage); + * const { page, setPage, perPage, setPerPage } = usePagination(initialPerPage); * * @param {number} initialPagination the initial value per page * @returns {PaginationHookResult} The pagination props diff --git a/packages/ra-core/src/controller/useReference.spec.tsx b/packages/ra-core/src/controller/useReference.spec.tsx index a61985005eb..547bd01be96 100644 --- a/packages/ra-core/src/controller/useReference.spec.tsx +++ b/packages/ra-core/src/controller/useReference.spec.tsx @@ -99,7 +99,7 @@ describe('useReference', () => { expect(dispatch).toBeCalledTimes(10); }); - it('it should not refetch reference when other props change change', async () => { + it('it should not refetch reference when other props change', async () => { const dataProvider = { getMany: jest.fn(() => Promise.resolve({ data: [{ id: 1, title: 'foo' }] }) diff --git a/packages/ra-core/src/controller/useReference.ts b/packages/ra-core/src/controller/useReference.ts index 51c1fb3826b..ecfd7b31c19 100644 --- a/packages/ra-core/src/controller/useReference.ts +++ b/packages/ra-core/src/controller/useReference.ts @@ -24,7 +24,7 @@ export interface UseReferenceProps { /** * Fetch reference record, and return it when available * - * The reference prop sould be the name of one of the components + * The reference prop should be the name of one of the components * added as child. * * @example diff --git a/packages/ra-core/src/controller/useSortState.ts b/packages/ra-core/src/controller/useSortState.ts index 85d9363e59f..b6d594044a4 100644 --- a/packages/ra-core/src/controller/useSortState.ts +++ b/packages/ra-core/src/controller/useSortState.ts @@ -51,24 +51,24 @@ const sortReducer = (state: SortPayload, action: Action): SortPayload => { export const defaultSort = { field: 'id', order: 'DESC' }; /** - * set the sort { field, order } + * Set the sort { field, order } * @name setSort * @function * @param {SortPayload} sort the sort object */ /** - * set the sort field, swap the order if the field is the same + * Set the sort field, swap the order if the field is the same * @name setSortField * @function * @param {string} field the sort field */ /** - * set the sort order + * Set the sort order * @name setSortOrder * @function - * @param {string} order the sort order eiather ASC or DESC + * @param {string} order The sort order, either ASC or DESC */ /** diff --git a/packages/ra-core/src/core/CoreAdminRouter.tsx b/packages/ra-core/src/core/CoreAdminRouter.tsx index b58f6e5d781..a204530f4b5 100644 --- a/packages/ra-core/src/core/CoreAdminRouter.tsx +++ b/packages/ra-core/src/core/CoreAdminRouter.tsx @@ -141,7 +141,7 @@ const CoreAdminRouter: FunctionComponent = props => { return (
{ - // Render every resources children outside the React Router Switch + // Render every resource children outside the React Router Switch // as we need all of them and not just the one rendered Children.map( childrenToRender, diff --git a/packages/ra-core/src/core/ResourceContext.ts b/packages/ra-core/src/core/ResourceContext.ts index 388b689d97a..52948860aff 100644 --- a/packages/ra-core/src/core/ResourceContext.ts +++ b/packages/ra-core/src/core/ResourceContext.ts @@ -1,7 +1,7 @@ import { createContext } from 'react'; /** - * Context to store the current resource informations. + * Context to store the current resource information. * * Use the useResource() hook to read the context. That's what most components do in react-admin. * diff --git a/packages/ra-core/src/dataProvider/Mutation.tsx b/packages/ra-core/src/dataProvider/Mutation.tsx index cb7e19b8bb1..17154364ce1 100644 --- a/packages/ra-core/src/dataProvider/Mutation.tsx +++ b/packages/ra-core/src/dataProvider/Mutation.tsx @@ -35,8 +35,8 @@ interface Props { * @param {Object} options * @param {string} options.action Redux action type * @param {boolean} options.undoable Set to true to run the mutation locally before calling the dataProvider - * @param {Function} options.onSuccess Side effect function to be executed upon success or failure, e.g. { onSuccess: response => refresh() } } - * @param {Function} options.onFailure Side effect function to be executed upon failure, e.g. { onFailure: error => notify(error.message) } } + * @param {Function} options.onSuccess Side effect function to be executed upon success or failure, e.g. { onSuccess: response => refresh() } + * @param {Function} options.onFailure Side effect function to be executed upon failure, e.g. { onFailure: error => notify(error.message) } * * @example * diff --git a/packages/ra-core/src/dataProvider/Query.spec.tsx b/packages/ra-core/src/dataProvider/Query.spec.tsx index 02030dcdd57..68b4b394df4 100644 --- a/packages/ra-core/src/dataProvider/Query.spec.tsx +++ b/packages/ra-core/src/dataProvider/Query.spec.tsx @@ -552,7 +552,7 @@ describe('Query', () => { payload: undefined, meta: { resource: 'foo' }, }); - dispatchSpy.mockClear(); // clar initial fetch + dispatchSpy.mockClear(); // clear initial fetch const testElement = getByTestId('test'); fireEvent.click(testElement); diff --git a/packages/ra-core/src/dataProvider/Query.tsx b/packages/ra-core/src/dataProvider/Query.tsx index d5c93324937..ebb86fcc6ce 100644 --- a/packages/ra-core/src/dataProvider/Query.tsx +++ b/packages/ra-core/src/dataProvider/Query.tsx @@ -26,8 +26,8 @@ interface Props { * @param {Object} payload The payload object, e.g; { post_id: 12 } * @param {Object} options * @param {string} options.action Redux action type - * @param {Function} options.onSuccess Side effect function to be executed upon success or failure, e.g. { onSuccess: response => refresh() } } - * @param {Function} options.onFailure Side effect function to be executed upon failure, e.g. { onFailure: error => notify(error.message) } } + * @param {Function} options.onSuccess Side effect function to be executed upon success or failure, e.g. { onSuccess: response => refresh() } + * @param {Function} options.onFailure Side effect function to be executed upon failure, e.g. { onFailure: error => notify(error.message) } * * This component also supports legacy side effects (e.g. { onSuccess: { refresh: true } }) * diff --git a/packages/ra-core/src/dataProvider/useCreate.ts b/packages/ra-core/src/dataProvider/useCreate.ts index e39ff70d7f2..6cc84fbb9c0 100644 --- a/packages/ra-core/src/dataProvider/useCreate.ts +++ b/packages/ra-core/src/dataProvider/useCreate.ts @@ -10,7 +10,7 @@ import useMutation from './useMutation'; * - error: [callback, { error: [error from response], loading: false, loaded: true }] * * @param resource The resource name, e.g. 'posts' - * @param data The data to initialize the new record with, e.g. { title: 'hello, world" } + * @param data The data to initialize the new record with, e.g. { title: 'hello, world' } * @param options Options object to pass to the dataProvider. May include side effects to be executed upon success or failure, e.g. { onSuccess: { refresh: true } } * * @returns The current request state. Destructure as [create, { data, error, loading, loaded }]. diff --git a/packages/ra-core/src/dataProvider/useDataProvider.ts b/packages/ra-core/src/dataProvider/useDataProvider.ts index 649c264f91a..7c90939c9b5 100644 --- a/packages/ra-core/src/dataProvider/useDataProvider.ts +++ b/packages/ra-core/src/dataProvider/useDataProvider.ts @@ -59,7 +59,7 @@ import { useState } from 'react'; * * {posts.map((post, key) => )} * - * } + * ); * } * * @example Handling all states (loading, error, success) diff --git a/packages/ra-core/src/dataProvider/useGetOne.ts b/packages/ra-core/src/dataProvider/useGetOne.ts index 1f749c54805..6bf60ea6d0c 100644 --- a/packages/ra-core/src/dataProvider/useGetOne.ts +++ b/packages/ra-core/src/dataProvider/useGetOne.ts @@ -45,7 +45,7 @@ const useGetOne = ( if ( // resources are registered Object.keys(state.admin.resources).length > 0 && - // no registered resource mathing the query + // no registered resource matching the query !state.admin.resources[resource] ) { throw new Error( diff --git a/packages/ra-core/src/dataProvider/useMutation.ts b/packages/ra-core/src/dataProvider/useMutation.ts index 20c5bf24426..c10e3bf2746 100644 --- a/packages/ra-core/src/dataProvider/useMutation.ts +++ b/packages/ra-core/src/dataProvider/useMutation.ts @@ -22,7 +22,7 @@ import useDataProviderWithDeclarativeSideEffects from './useDataProviderWithDecl * * - both, in which case the definition and call time parameters are merged * - * const [mutate] = useMutation(query1, options1); mutate(query2, options2)); + * const [mutate] = useMutation(query1, options1); mutate(query2, options2); * * @param {Object} query * @param {string} query.type The method called on the data provider, e.g. 'getList', 'getOne'. Can also be a custom method if the dataProvider supports is. @@ -31,9 +31,9 @@ import useDataProviderWithDeclarativeSideEffects from './useDataProviderWithDecl * @param {Object} options * @param {string} options.action Redux action type * @param {boolean} options.undoable Set to true to run the mutation locally before calling the dataProvider - * @param {Function} options.onSuccess Side effect function to be executed upon success or failure, e.g. { onSuccess: response => refresh() } } - * @param {Function} options.onFailure Side effect function to be executed upon failure, e.g. { onFailure: error => notify(error.message) } } - * @param {boolean} options.withDeclarativeSideEffectsSupport Set to true to support legacy side effects (e.g. { onSuccess: { refresh: true } }) + * @param {Function} options.onSuccess Side effect function to be executed upon success or failure, e.g. { onSuccess: response => refresh() } + * @param {Function} options.onFailure Side effect function to be executed upon failure, e.g. { onFailure: error => notify(error.message) } + * @param {boolean} options.withDeclarativeSideEffectsSupport Set to true to support legacy side effects e.g. { onSuccess: { refresh: true } } * * @returns A tuple with the mutation callback and the request state. Destructure as [mutate, { data, total, error, loading, loaded }]. * @@ -52,9 +52,9 @@ import useDataProviderWithDeclarativeSideEffects from './useDataProviderWithDecl * - {Object} options * - {string} options.action Redux action type * - {boolean} options.undoable Set to true to run the mutation locally before calling the dataProvider - * - {Function} options.onSuccess Side effect function to be executed upon success or failure, e.g. { onSuccess: response => refresh() } } - * - {Function} options.onFailure Side effect function to be executed upon failure, e.g. { onFailure: error => notify(error.message) } } - * - {boolean} withDeclarativeSideEffectsSupport Set to true to support legacy side effects (e.g. { onSuccess: { refresh: true } }) + * - {Function} options.onSuccess Side effect function to be executed upon success or failure, e.g. { onSuccess: response => refresh() } + * - {Function} options.onFailure Side effect function to be executed upon failure, e.g. { onFailure: error => notify(error.message) } + * - {boolean} withDeclarativeSideEffectsSupport Set to true to support legacy side effects e.g. { onSuccess: { refresh: true } } * * @example * @@ -225,13 +225,13 @@ export type UseMutationValue = [ * * useMutation() parameters can be passed: * - at definition time (e.g. useMutation({ type: 'update', resource: 'posts', payload: { id: 1, data: { title: '' } } }) ) - * - at call time (e.g [mutate] = useMutation(); mutate({ type: 'update', resource: 'posts', payload: { id: 1, data: { title: '' } } })) + * - at call time (e.g. [mutate] = useMutation(); mutate({ type: 'update', resource: 'posts', payload: { id: 1, data: { title: '' } } })) * - both * * This function merges the definition time and call time parameters. * * This is useful because useMutation() is used by higher-level hooks like - * useCreate() or useUpade(), and these hooks can be called both ways. + * useCreate() or useUpdate(), and these hooks can be called both ways. * So it makes sense to make useMutation() capable of handling both call types * as it avoids repetition higher in the hook chain. * diff --git a/packages/ra-core/src/dataProvider/useQuery.ts b/packages/ra-core/src/dataProvider/useQuery.ts index b9ac3fbf414..ff77541f471 100644 --- a/packages/ra-core/src/dataProvider/useQuery.ts +++ b/packages/ra-core/src/dataProvider/useQuery.ts @@ -20,9 +20,9 @@ import useVersion from '../controller/useVersion'; * @param {Object} query.payload The payload object, e.g; { post_id: 12 } * @param {Object} options * @param {string} options.action Redux action type - * @param {Function} options.onSuccess Side effect function to be executed upon success or failure, e.g. { onSuccess: response => refresh() } } - * @param {Function} options.onFailure Side effect function to be executed upon failure, e.g. { onFailure: error => notify(error.message) } } - * @param {boolean} options.withDeclarativeSideEffectsSupport Set to true to support legacy side effects (e.g. { onSuccess: { refresh: true } }) + * @param {Function} options.onSuccess Side effect function to be executed upon success or failure, e.g. { onSuccess: response => refresh() } + * @param {Function} options.onFailure Side effect function to be executed upon failure, e.g. { onFailure: error => notify(error.message) } + * @param {boolean} options.withDeclarativeSideEffectsSupport Set to true to support legacy side effects e.g. { onSuccess: { refresh: true } } * * @returns The current request state. Destructure as { data, total, error, loading, loaded }. * diff --git a/packages/ra-core/src/dataProvider/useQueryWithStore.ts b/packages/ra-core/src/dataProvider/useQueryWithStore.ts index 0ef65e71952..2e5b62749fe 100644 --- a/packages/ra-core/src/dataProvider/useQueryWithStore.ts +++ b/packages/ra-core/src/dataProvider/useQueryWithStore.ts @@ -41,7 +41,7 @@ const queriesThisTick: { [key: string]: Promise } = {}; * Default cache selector. Allows to cache responses by default. * * By default, custom queries are dispatched as a CUSTOM_QUERY Redux action. - * The useDataProvider hookdispatches a CUSTOM_QUERY_SUCCESS when the response + * The useDataProvider hook dispatches a CUSTOM_QUERY_SUCCESS when the response * comes, and the customQueries reducer stores the result in the store. * This selector reads the customQueries store and acts as a response cache. */ @@ -79,8 +79,8 @@ const defaultIsDataLoaded = (data: any): boolean => data !== undefined; * @param {Object} query.payload The payload object, e.g; { post_id: 12 } * @param {Object} options * @param {string} options.action Redux action type - * @param {Function} options.onSuccess Side effect function to be executed upon success or failure, e.g. { onSuccess: response => refresh() } } - * @param {Function} options.onFailure Side effect function to be executed upon failure, e.g. { onFailure: error => notify(error.message) } } + * @param {Function} options.onSuccess Side effect function to be executed upon success or failure, e.g. { onSuccess: response => refresh() } + * @param {Function} options.onFailure Side effect function to be executed upon failure, e.g. { onFailure: error => notify(error.message) } * @param {Function} dataSelector Redux selector to get the result. Required. * @param {Function} totalSelector Redux selector to get the total (optional, only for LIST queries) * diff --git a/packages/ra-core/src/form/useInput.spec.tsx b/packages/ra-core/src/form/useInput.spec.tsx index 9b752177007..9cf6f086cb1 100644 --- a/packages/ra-core/src/form/useInput.spec.tsx +++ b/packages/ra-core/src/form/useInput.spec.tsx @@ -101,7 +101,7 @@ describe('useInput', () => { /> ); const input = getByLabelText('Title'); - // Temporary workaroud until we can upgrade testing-library in v4 + // Temporary workaround until we can upgrade testing-library in v4 input.focus(); expect(handleFocus).toHaveBeenCalled(); expect(formApi.getState().active).toEqual('title'); diff --git a/packages/ra-core/src/form/useSuggestions.ts b/packages/ra-core/src/form/useSuggestions.ts index 2467e61d6a2..3b57073c7c8 100644 --- a/packages/ra-core/src/form/useSuggestions.ts +++ b/packages/ra-core/src/form/useSuggestions.ts @@ -12,7 +12,7 @@ import { useTranslate } from '../i18n'; * @param emptyText The text to use for the empty suggestion. Defaults to an empty string * @param emptyValue The value to use for the empty suggestion. Defaults to `null` * @param limitChoicesToValue A boolean indicating whether the initial suggestions should be limited to the currently selected one(s) - * @param matchSuggestion Optional unless `optionText` is a React element. Function which check wether a choice matches a filter. Must return a boolean. + * @param matchSuggestion Optional unless `optionText` is a React element. Function which check whether a choice matches a filter. Must return a boolean. * @param optionText Either a string defining the property to use to get the choice text, a function or a React element * @param optionValue The property to use to get the choice value * @param selectedItem The currently selected item. May be an array of selected items diff --git a/packages/ra-core/src/form/validate.spec.ts b/packages/ra-core/src/form/validate.spec.ts index 6f772942af1..6cec46e6f78 100644 --- a/packages/ra-core/src/form/validate.spec.ts +++ b/packages/ra-core/src/form/validate.spec.ts @@ -293,13 +293,13 @@ describe('Validators', () => { ); }); - it('should memoize the validator when the regex pattren and message are the same', () => { + it('should memoize the validator when the regex pattern and message are the same', () => { expect(regex(/foo/, 'placeholder')).toBe( regex(/foo/, 'placeholder') ); }); - it('should create new validator when the regex pattren is different', () => { + it('should create new validator when the regex pattern is different', () => { expect(regex(/foo/, 'placeholder')).not.toBe( regex(/notfoo/, 'placeholder') ); diff --git a/packages/ra-core/src/i18n/useLocale.tsx b/packages/ra-core/src/i18n/useLocale.tsx index 49fba1eb87a..faa5c8e398e 100644 --- a/packages/ra-core/src/i18n/useLocale.tsx +++ b/packages/ra-core/src/i18n/useLocale.tsx @@ -5,7 +5,7 @@ import { TranslationContext } from './TranslationContext'; /** * Get the current locale from the TranslationContext * - * This hook rerenders when the locale changes. + * This hook re-renders when the locale changes. * * @example * diff --git a/packages/ra-core/src/i18n/useSetLocale.tsx b/packages/ra-core/src/i18n/useSetLocale.tsx index 48ab4b189e7..06da105f8c8 100644 --- a/packages/ra-core/src/i18n/useSetLocale.tsx +++ b/packages/ra-core/src/i18n/useSetLocale.tsx @@ -7,7 +7,7 @@ import { useNotify } from '../sideEffect'; /** * Set the current locale using the TranslationContext * - * This hook rerenders when the locale changes. + * This hook re-renders when the locale changes. * * @example * diff --git a/packages/ra-core/src/inference/getValuesFromRecords.spec.ts b/packages/ra-core/src/inference/getValuesFromRecords.spec.ts index f9c5ef229b0..1459c155b33 100644 --- a/packages/ra-core/src/inference/getValuesFromRecords.spec.ts +++ b/packages/ra-core/src/inference/getValuesFromRecords.spec.ts @@ -18,7 +18,7 @@ describe('getValuesFromRecords', () => { }); }); - it('should acept recods with variable fields', () => { + it('should accept records with variable fields', () => { const records = [ { a: 1, b: 1, c: 1 }, { b: 2, c: 2, d: 2 }, diff --git a/packages/ra-core/src/inference/inferElementFromValues.tsx b/packages/ra-core/src/inference/inferElementFromValues.tsx index fcb15cdf880..f57e7cd980d 100644 --- a/packages/ra-core/src/inference/inferElementFromValues.tsx +++ b/packages/ra-core/src/inference/inferElementFromValues.tsx @@ -51,7 +51,7 @@ const hasType = (type, types) => typeof types[type] !== 'undefined'; * // new InferredElement() * * Types are optional: if a type isn't provided, the function falls back - * to the neareast type. + * to the nearest type. * * @example * inferElementFromValues( diff --git a/packages/ra-core/src/loading/useLoading.ts b/packages/ra-core/src/loading/useLoading.ts index 80297224de9..c1298bf121e 100644 --- a/packages/ra-core/src/loading/useLoading.ts +++ b/packages/ra-core/src/loading/useLoading.ts @@ -12,7 +12,7 @@ import { ReduxState } from '../types'; * * const MyComponent = () => { * const loading = useLoading(); - * return loading ? : ; + * return loading ? : ; * } */ export default () => diff --git a/packages/ra-core/src/reducer/admin/references/possibleValues.spec.ts b/packages/ra-core/src/reducer/admin/references/possibleValues.spec.ts index f8ff92c52e0..34d4cb3117f 100644 --- a/packages/ra-core/src/reducer/admin/references/possibleValues.spec.ts +++ b/packages/ra-core/src/reducer/admin/references/possibleValues.spec.ts @@ -43,7 +43,7 @@ describe('possibleValues reducer', () => { expect(possibleReferences).toEqual({ error: 'error message' }); }); - it('should return a empty array if the possibleValues in state is empty', () => { + it('should return an empty array if the possibleValues in state is empty', () => { const possibleReferences = getPossibleReferences( referenceState, [] @@ -51,7 +51,7 @@ describe('possibleValues reducer', () => { expect(possibleReferences).toEqual([]); }); - it('should return all formated possibleValues in state if selectedIds param is not set', () => { + it('should return all formatted possibleValues in state if selectedIds param is not set', () => { const possibleReferences = getPossibleReferences(referenceState, [ 1, 2, @@ -64,7 +64,7 @@ describe('possibleValues reducer', () => { ]); }); - it('should return all formated possibleValues in state if selectedIds param is an empty array', () => { + it('should return all formatted possibleValues in state if selectedIds param is an empty array', () => { const possibleReferences = getPossibleReferences( referenceState, [1, 2, 4], @@ -77,7 +77,7 @@ describe('possibleValues reducer', () => { ]); }); - it('should add selectedIds to the formated possibleValues in state if it is not already in', () => { + it('should add selectedIds to the formatted possibleValues in state if it is not already in', () => { const possibleReferences = getPossibleReferences( referenceState, [1, 2, 4], diff --git a/packages/ra-core/src/reducer/admin/resource/data.spec.ts b/packages/ra-core/src/reducer/admin/resource/data.spec.ts index 9614ea876cb..c2cf8094c73 100644 --- a/packages/ra-core/src/reducer/admin/resource/data.spec.ts +++ b/packages/ra-core/src/reducer/admin/resource/data.spec.ts @@ -170,7 +170,7 @@ describe('data reducer', () => { }); }); - it('should update existion records without changing the other ones', () => { + it('should update existing records without changing the other ones', () => { const now = new Date(); const before = new Date(0); const newRecords = [ diff --git a/packages/ra-core/src/reducer/admin/resource/list/ids.ts b/packages/ra-core/src/reducer/admin/resource/list/ids.ts index 42343b5f05c..86f5bea5431 100644 --- a/packages/ra-core/src/reducer/admin/resource/list/ids.ts +++ b/packages/ra-core/src/reducer/admin/resource/list/ids.ts @@ -25,11 +25,11 @@ type ActionTypes = /** * List of the ids of the latest loaded page, regardless of params * - * When loading a the list for the first time, useListController grabs the ids + * When loading the list for the first time, useListController grabs the ids * from the cachedRequests reducer (not this ids reducer). It's only when the user * changes page, sort, or filter, that the useListController hook uses the ids * reducer, so as to show the previous list of results while loading the new - * list (intead of displaying a blank page each time the list params change). + * list (instead of displaying a blank page each time the list params change). * * @see useListController * diff --git a/packages/ra-core/src/reducer/admin/ui.spec.ts b/packages/ra-core/src/reducer/admin/ui.spec.ts index 65f858792f0..7525d811674 100644 --- a/packages/ra-core/src/reducer/admin/ui.spec.ts +++ b/packages/ra-core/src/reducer/admin/ui.spec.ts @@ -51,7 +51,7 @@ describe('ui reducer', () => { ) ); }); - it('should return activated autimatic refresh by default', () => { + it('should return activated automatic refresh by default', () => { expect(reducer(undefined, { type: 'foo' })).toEqual(defaultState); }); it('should set sidebar visibility upon SET_AUTOMATIC_REFRESH', () => { diff --git a/packages/ra-core/src/sideEffect/accumulate.ts b/packages/ra-core/src/sideEffect/accumulate.ts index 5475e023a40..21c4f137f94 100644 --- a/packages/ra-core/src/sideEffect/accumulate.ts +++ b/packages/ra-core/src/sideEffect/accumulate.ts @@ -81,14 +81,14 @@ export const accumulateFactory = (tasks, accumulations, finalize) => */ function* accumulate(action) { - // For backward compatibility, if no accumulateKey is provided, we fallback to the resource + // For backward compatibility, if no accumulateKey is provided, fallback to the resource const key = action.meta.accumulateKey || action.payload.resource; if (tasks[key]) { yield cancel(tasks[key]); } - // For backward compatibility, if no accumulateValues function is provided, we fallback to the old + // For backward compatibility, if no accumulateValues function is provided, fallback to the old // addIds function (used by the crudGetManyAccumulate action for example) const accumulateValues = action.meta.accumulateValues || addIds; diff --git a/packages/ra-core/src/util/renderWithRedux.tsx b/packages/ra-core/src/util/renderWithRedux.tsx index 877b45b46da..db38cb0d5e9 100644 --- a/packages/ra-core/src/util/renderWithRedux.tsx +++ b/packages/ra-core/src/util/renderWithRedux.tsx @@ -21,7 +21,7 @@ export interface RenderWithReduxResult extends RenderResult { * @param {Object} options: Render options, e.g. to use a custom container element * @return {{ dispatch, reduxStore, ...rest }} helper function to test rendered component. * Same as @testing-library/react render method with added dispatch and reduxStore helper - * dispatch: spy on the redux stroe dispatch method + * dispatch: spy on the redux store dispatch method * reduxStore: the redux store used by the tested component */ export default ( diff --git a/packages/ra-ui-materialui/src/detail/EditActions.tsx b/packages/ra-ui-materialui/src/detail/EditActions.tsx index 4760c4c29f5..9237d06b4b3 100644 --- a/packages/ra-ui-materialui/src/detail/EditActions.tsx +++ b/packages/ra-ui-materialui/src/detail/EditActions.tsx @@ -8,7 +8,7 @@ import TopToolbar from '../layout/TopToolbar'; /** * Action Toolbar for the Edit view * - * Internal component. If you want to add or remove actions for a Edit view, + * Internal component. If you want to add or remove actions for an Edit view, * write your own EditActions Component. Then, in the component, * use it in the `actions` prop to pass a custom component. * diff --git a/packages/ra-ui-materialui/src/detail/SimpleShowLayout.tsx b/packages/ra-ui-materialui/src/detail/SimpleShowLayout.tsx index 5b48b7c78a6..7ae1e1f0734 100644 --- a/packages/ra-ui-materialui/src/detail/SimpleShowLayout.tsx +++ b/packages/ra-ui-materialui/src/detail/SimpleShowLayout.tsx @@ -23,7 +23,7 @@ const sanitizeRestProps = ({ * Simple Layout for a Show view, showing fields in one column. * * Receives the current `record` from the parent `` component, - * and passes it to its childen. Children should be Field-like components. + * and passes it to its children. Children should be Field-like components. * * @example * // in src/posts.js diff --git a/packages/ra-ui-materialui/src/detail/TabbedShowLayout.tsx b/packages/ra-ui-materialui/src/detail/TabbedShowLayout.tsx index 67a162d6e90..cbadac922d6 100644 --- a/packages/ra-ui-materialui/src/detail/TabbedShowLayout.tsx +++ b/packages/ra-ui-materialui/src/detail/TabbedShowLayout.tsx @@ -45,7 +45,7 @@ const useStyles = makeStyles( * Tabbed Layout for a Show view, showing fields grouped in tabs. * * Receives the current `record` from the parent `` component, - * and passes it to its childen. Children should be Tab components. + * and passes it to its children. Children should be Tab components. * The component passed as `tabs` props replaces the default material-ui's component. * * @example diff --git a/packages/ra-ui-materialui/src/detail/TabbedShowLayoutTabs.tsx b/packages/ra-ui-materialui/src/detail/TabbedShowLayoutTabs.tsx index 4b2ef9c4a15..b9bf6cf5e9d 100644 --- a/packages/ra-ui-materialui/src/detail/TabbedShowLayoutTabs.tsx +++ b/packages/ra-ui-materialui/src/detail/TabbedShowLayoutTabs.tsx @@ -21,7 +21,7 @@ const TabbedShowLayoutTabs: FC = ({ children, ...rest }) => { {Children.map(children, (tab, index) => { if (!tab || !isValidElement(tab)) return null; - // Builds the full tab tab which is the concatenation of the last matched route in the + // Builds the full tab which is the concatenation of the last matched route in the // TabbedShowLayout hierarchy (ex: '/posts/create', '/posts/12', , '/posts/12/show') // and the tab path. // This will be used as the Tab's value diff --git a/packages/ra-ui-materialui/src/field/ReferenceArrayField.tsx b/packages/ra-ui-materialui/src/field/ReferenceArrayField.tsx index 04a06a546cf..ccd5eecb01d 100644 --- a/packages/ra-ui-materialui/src/field/ReferenceArrayField.tsx +++ b/packages/ra-ui-materialui/src/field/ReferenceArrayField.tsx @@ -57,7 +57,7 @@ import { LinearProgress } from '../layout'; * * * By default, the field displays the results in the order in which they are referenced - * (i.e in the order of the list of ids). You can change this order + * (i.e. in the order of the list of ids). You can change this order * by setting the `sort` prop (an object with `field` and `order` properties). * * @example diff --git a/packages/ra-ui-materialui/src/field/ReferenceField.tsx b/packages/ra-ui-materialui/src/field/ReferenceField.tsx index c1fc99e3e4a..070aad75c41 100644 --- a/packages/ra-ui-materialui/src/field/ReferenceField.tsx +++ b/packages/ra-ui-materialui/src/field/ReferenceField.tsx @@ -24,7 +24,7 @@ import { ClassesOverride } from '../types'; /** * Fetch reference record, and delegate rendering to child component. * - * The reference prop sould be the name of one of the components + * The reference prop should be the name of one of the components * added as child. * * @example diff --git a/packages/ra-ui-materialui/src/field/SelectField.tsx b/packages/ra-ui-materialui/src/field/SelectField.tsx index 821900dcd0f..ea39070154c 100644 --- a/packages/ra-ui-materialui/src/field/SelectField.tsx +++ b/packages/ra-ui-materialui/src/field/SelectField.tsx @@ -22,7 +22,7 @@ import { PublicFieldProps, InjectedFieldProps, fieldPropTypes } from './types'; * * By default, the text is built by * - finding a choice where the 'id' property equals the field value - * - using the 'name' property an the option text + * - using the 'name' property as the option text * * You can also customize the properties to use for the value and text, * thanks to the 'optionValue' and 'optionText' attributes. diff --git a/packages/ra-ui-materialui/src/form/TabbedForm.tsx b/packages/ra-ui-materialui/src/form/TabbedForm.tsx index 1559ac73288..6f28af8be2a 100644 --- a/packages/ra-ui-materialui/src/form/TabbedForm.tsx +++ b/packages/ra-ui-materialui/src/form/TabbedForm.tsx @@ -89,7 +89,7 @@ import { ClassesOverride } from '../types'; * @prop {ReactElement} toolbar The element displayed at the bottom of the form, containing the SaveButton * @prop {string} variant Apply variant to all inputs. Possible values are 'standard', 'outlined', and 'filled' (default) * @prop {string} margin Apply variant to all inputs. Possible values are 'none', 'normal', and 'dense' (default) - * @prop {boolean} sanitizeEmptyValues Wether or not deleted record attributes should be recreated with a `null` value (default: true) + * @prop {boolean} sanitizeEmptyValues Whether or not deleted record attributes should be recreated with a `null` value (default: true) * * @param {Prop} props */ diff --git a/packages/ra-ui-materialui/src/form/TabbedFormTabs.tsx b/packages/ra-ui-materialui/src/form/TabbedFormTabs.tsx index 297227f93f6..1b62a44247a 100644 --- a/packages/ra-ui-materialui/src/form/TabbedFormTabs.tsx +++ b/packages/ra-ui-materialui/src/form/TabbedFormTabs.tsx @@ -24,13 +24,13 @@ const TabbedFormTabs: FC = ({ return getTabFullPath(tab, index, url); }); - // This ensure we don't get warnings from material-ui Tabs component when + // This ensures we don't get warnings from material-ui Tabs component when // the current location pathname targets a dynamically added Tab // In the case the targeted Tab is not present at first render (when // using permissions for example) we temporarily switch to the first // available tab. The current location will be applied again on the // first render containing the targeted tab. This is almost transparent - // for the user who may just see an short tab selection animation + // for the user who may just see a short tab selection animation const tabValue = validTabPaths.includes(location.pathname) ? location.pathname : validTabPaths[0]; @@ -40,7 +40,7 @@ const TabbedFormTabs: FC = ({ {Children.map(children, (tab: ReactElement, index) => { if (!isValidElement(tab)) return null; - // Builds the full tab tab which is the concatenation of the last matched route in the + // Builds the full tab which is the concatenation of the last matched route in the // TabbedShowLayout hierarchy (ex: '/posts/create', '/posts/12', , '/posts/12/show') // and the tab path. // This will be used as the Tab's value diff --git a/packages/ra-ui-materialui/src/input/AutocompleteArrayInput.spec.tsx b/packages/ra-ui-materialui/src/input/AutocompleteArrayInput.spec.tsx index 5e90272b1c4..da6b4e224ac 100644 --- a/packages/ra-ui-materialui/src/input/AutocompleteArrayInput.spec.tsx +++ b/packages/ra-ui-materialui/src/input/AutocompleteArrayInput.spec.tsx @@ -31,7 +31,7 @@ describe('', () => { ); const input = getByLabelText('resources.posts.fields.tags'); - // Temporary workaroud until we can upgrade testing-library in v4 + // Temporary workaround until we can upgrade testing-library in v4 input.focus(); expect(queryAllByRole('option')).toHaveLength(2); expect(getByText('Technical')).not.toBeNull(); @@ -56,7 +56,7 @@ describe('', () => { ); const input = getByLabelText('resources.posts.fields.tags'); - // Temporary workaroud until we can upgrade testing-library in v4 + // Temporary workaround until we can upgrade testing-library in v4 input.focus(); expect(queryAllByRole('option')).toHaveLength(2); @@ -82,7 +82,7 @@ describe('', () => { ); const input = getByLabelText('resources.posts.fields.tags'); - // Temporary workaroud until we can upgrade testing-library in v4 + // Temporary workaround until we can upgrade testing-library in v4 input.focus(); expect(queryAllByRole('option')).toHaveLength(2); @@ -108,7 +108,7 @@ describe('', () => { ); const input = getByLabelText('resources.posts.fields.tags'); - // Temporary workaroud until we can upgrade testing-library in v4 + // Temporary workaround until we can upgrade testing-library in v4 input.focus(); expect(queryAllByRole('option')).toHaveLength(2); @@ -134,7 +134,7 @@ describe('', () => { /> ); const input = getByLabelText('**resources.posts.fields.tags**'); - // Temporary workaroud until we can upgrade testing-library in v4 + // Temporary workaround until we can upgrade testing-library in v4 input.focus(); expect(queryAllByRole('option')).toHaveLength(2); @@ -162,7 +162,7 @@ describe('', () => { ); const input = getByLabelText('**resources.posts.fields.tags**'); - // Temporary workaroud until we can upgrade testing-library in v4 + // Temporary workaround until we can upgrade testing-library in v4 input.focus(); expect(queryAllByRole('option')).toHaveLength(2); @@ -184,7 +184,7 @@ describe('', () => { /> ); const input = getByLabelText('resources.posts.fields.tags'); - // Temporary workaroud until we can upgrade testing-library in v4 + // Temporary workaround until we can upgrade testing-library in v4 input.focus(); fireEvent.change(input, { target: { value: 'Te' } }); expect(queryAllByRole('option')).toHaveLength(0); @@ -240,7 +240,7 @@ describe('', () => { ); const input = getByLabelText('resources.posts.fields.tags'); - // Temporary workaroud until we can upgrade testing-library in v4 + // Temporary workaround until we can upgrade testing-library in v4 input.focus(); fireEvent.change(input, { target: { value: 'foo' } }); expect(queryAllByRole('option')).toHaveLength(0); @@ -251,7 +251,7 @@ describe('', () => { expect(queryAllByRole('option')).toHaveLength(1); }); - it('should not rerender searchtext while having focus and new choices arrive', () => { + it('should not rerender searchText while having focus and new choices arrive', () => { const optionText = jest.fn(); const { getByLabelText, queryAllByRole, rerender } = render(
', () => { 'resources.posts.fields.tags' ) as HTMLInputElement; - // Temporary workaroud until we can upgrade testing-library in v4 + // Temporary workaround until we can upgrade testing-library in v4 input.focus(); fireEvent.change(input, { target: { value: 'foo' } }); expect(queryAllByRole('option')).toHaveLength(0); @@ -348,7 +348,7 @@ describe('', () => { ); const input = getByLabelText('resources.posts.fields.tags'); - // Temporary workaroud until we can upgrade testing-library in v4 + // Temporary workaround until we can upgrade testing-library in v4 input.focus(); expect(queryAllByRole('option')).toHaveLength(2); }); @@ -369,7 +369,7 @@ describe('', () => { ); const input = getByLabelText('resources.posts.fields.tags'); - // Temporary workaroud until we can upgrade testing-library in v4 + // Temporary workaround until we can upgrade testing-library in v4 input.focus(); fireEvent.change(input, { target: { value: 'Technical' } }); fireEvent.click(getByRole('option')); @@ -471,7 +471,7 @@ describe('', () => { /> ); const input = getByLabelText('resources.posts.fields.tags'); - // Temporary workaroud until we can upgrade testing-library in v4 + // Temporary workaround until we can upgrade testing-library in v4 input.focus(); expect(getByLabelText('Technical')).not.toBeNull(); expect(getByLabelText('Programming')).not.toBeNull(); @@ -526,7 +526,7 @@ describe('', () => { /> ); const input = getByLabelText('resources.posts.fields.tags'); - // Temporary workaroud until we can upgrade testing-library in v4 + // Temporary workaround until we can upgrade testing-library in v4 input.focus(); input.blur(); @@ -552,7 +552,7 @@ describe('', () => { /> ); const input = getByLabelText('resources.posts.fields.tags'); - // Temporary workaroud until we can upgrade testing-library in v4 + // Temporary workaround until we can upgrade testing-library in v4 input.focus(); fireEvent.change(input, { target: { value: 'ab' } }); expect(queryAllByRole('option')).toHaveLength(2); @@ -583,7 +583,7 @@ describe('', () => { /> ); const input = getByLabelText('resources.posts.fields.tags'); - // Temporary workaroud until we can upgrade testing-library in v4 + // Temporary workaround until we can upgrade testing-library in v4 input.focus(); fireEvent.change(input, { target: { value: 'abc' } }); expect(queryAllByRole('option')).toHaveLength(1); @@ -609,7 +609,7 @@ describe('', () => { /> ); const input = getByLabelText('resources.posts.fields.tags'); - // Temporary workaroud until we can upgrade testing-library in v4 + // Temporary workaround until we can upgrade testing-library in v4 input.focus(); expect(getByLabelText('Me')).not.toBeNull(); @@ -632,7 +632,7 @@ describe('', () => { /> ); const input = getByLabelText('resources.posts.fields.tags'); - // Temporary workaroud until we can upgrade testing-library in v4 + // Temporary workaround until we can upgrade testing-library in v4 input.focus(); expect(queryAllByRole('option')).toHaveLength(1); }); diff --git a/packages/ra-ui-materialui/src/input/AutocompleteArrayInput.tsx b/packages/ra-ui-materialui/src/input/AutocompleteArrayInput.tsx index 68569fd9700..4ad778345a9 100644 --- a/packages/ra-ui-materialui/src/input/AutocompleteArrayInput.tsx +++ b/packages/ra-ui-materialui/src/input/AutocompleteArrayInput.tsx @@ -36,7 +36,7 @@ interface Options { * * By default, the options are built from: * - the 'id' property as the option value, - * - the 'name' property an the option text + * - the 'name' property as the option text * @example * const choices = [ * { id: 'M', name: 'Male' }, diff --git a/packages/ra-ui-materialui/src/input/AutocompleteInput.spec.tsx b/packages/ra-ui-materialui/src/input/AutocompleteInput.spec.tsx index e9a86f5fef4..18983ac37e4 100644 --- a/packages/ra-ui-materialui/src/input/AutocompleteInput.spec.tsx +++ b/packages/ra-ui-materialui/src/input/AutocompleteInput.spec.tsx @@ -213,7 +213,7 @@ describe('', () => { ); const input = getByLabelText('resources.users.fields.role'); - // Temporary workaroud until we can upgrade testing-library in v4 + // Temporary workaround until we can upgrade testing-library in v4 input.focus(); await wait(() => { expect(queryByText('foo')).not.toBeNull(); @@ -238,7 +238,7 @@ describe('', () => { ); const input = getByLabelText('resources.users.fields.role'); - // Temporary workaroud until we can upgrade testing-library in v4 + // Temporary workaround until we can upgrade testing-library in v4 input.focus(); await wait(() => { @@ -263,7 +263,7 @@ describe('', () => { const input = getByLabelText('resources.users.fields.role'); expect(input.value).toEqual(''); - // Temporary workaroud until we can upgrade testing-library in v4 + // Temporary workaround until we can upgrade testing-library in v4 input.focus(); rerender( @@ -296,19 +296,19 @@ describe('', () => { /> ); const input = getByLabelText('resources.users.fields.role'); - // Temporary workaroud until we can upgrade testing-library in v4 + // Temporary workaround until we can upgrade testing-library in v4 input.focus(); fireEvent.change(input, { target: { value: 'bar' } }); expect(queryByText('foo')).toBeNull(); - // Temporary workaroud until we can upgrade testing-library in v4 + // Temporary workaround until we can upgrade testing-library in v4 input.blur(); input.focus(); fireEvent.change(input, { target: { value: 'foo' } }); expect(queryByText('foo')).not.toBeNull(); }); - it('should not rerender searchtext while having focus and new choices arrive', () => { + it('should not rerender searchText while having focus and new choices arrive', () => { const { getByLabelText, rerender } = render( ', () => { /> ); const input = getByLabelText('resources.users.fields.role'); - // Temporary workaroud until we can upgrade testing-library in v4 + // Temporary workaround until we can upgrade testing-library in v4 input.focus(); fireEvent.change(input, { target: { value: 'bar' } }); - // Temporary workaroud until we can upgrade testing-library in v4 + // Temporary workaround until we can upgrade testing-library in v4 input.blur(); await waitForDomChange(); expect(input.value).toEqual('foo'); @@ -372,7 +372,7 @@ describe('', () => { ); const input = getByLabelText('resources.users.fields.role'); - // Temporary workaroud until we can upgrade testing-library in v4 + // Temporary workaround until we can upgrade testing-library in v4 input.focus(); rerender( @@ -468,7 +468,7 @@ describe('', () => { ); const input = getByLabelText('resources.users.fields.role'); - // Temporary workaroud until we can upgrade testing-library in v4 + // Temporary workaround until we can upgrade testing-library in v4 input.focus(); expect(queryByLabelText('bar')).not.toBeNull(); expect(queryByLabelText('foo')).not.toBeNull(); @@ -524,7 +524,7 @@ describe('', () => { /> ); const input = getByLabelText('resources.users.fields.role'); - // Temporary workaroud until we can upgrade testing-library in v4 + // Temporary workaround until we can upgrade testing-library in v4 input.focus(); input.blur(); @@ -579,7 +579,7 @@ describe('', () => { /> ); const input = getByLabelText('resources.users.fields.role'); - // Temporary workaroud until we can upgrade testing-library in v4 + // Temporary workaround until we can upgrade testing-library in v4 input.focus(); fireEvent.change(input, { target: { value: 'abc' } }); await wait(() => expect(queryAllByRole('option').length).toEqual(1)); @@ -595,7 +595,7 @@ describe('', () => { {...defaultProps} options={{ suggestionsContainerProps: { - 'aria-label': 'My Sugggestions Container', + 'aria-label': 'My Suggestions Container', }, }} choices={[ @@ -609,10 +609,10 @@ describe('', () => { ); const input = getByLabelText('resources.users.fields.role'); - // Temporary workaroud until we can upgrade testing-library in v4 + // Temporary workaround until we can upgrade testing-library in v4 input.focus(); - expect(getByLabelText('My Sugggestions Container')).not.toBeNull(); + expect(getByLabelText('My Suggestions Container')).not.toBeNull(); }); describe('Fix issue #4660', () => { diff --git a/packages/ra-ui-materialui/src/input/AutocompleteInput.tsx b/packages/ra-ui-materialui/src/input/AutocompleteInput.tsx index 2c77a3ebd2c..68a5c0e3ed2 100644 --- a/packages/ra-ui-materialui/src/input/AutocompleteInput.tsx +++ b/packages/ra-ui-materialui/src/input/AutocompleteInput.tsx @@ -39,7 +39,7 @@ interface Options { * * By default, the options are built from: * - the 'id' property as the option value, - * - the 'name' property an the option text + * - the 'name' property as the option text * @example * const choices = [ * { id: 'M', name: 'Male' }, diff --git a/packages/ra-ui-materialui/src/input/CheckboxGroupInput.tsx b/packages/ra-ui-materialui/src/input/CheckboxGroupInput.tsx index 5a379ad33eb..97a085374ad 100644 --- a/packages/ra-ui-materialui/src/input/CheckboxGroupInput.tsx +++ b/packages/ra-ui-materialui/src/input/CheckboxGroupInput.tsx @@ -46,7 +46,7 @@ const useStyles = makeStyles( * * By default, the options are built from: * - the 'id' property as the option value, - * - the 'name' property an the option text + * - the 'name' property as the option text * @example * const choices = [ * { id: 12, name: 'Ray Hakt' }, diff --git a/packages/ra-ui-materialui/src/input/RadioButtonGroupInput.spec.tsx b/packages/ra-ui-materialui/src/input/RadioButtonGroupInput.spec.tsx index 911ce844a55..c5a855efd6f 100644 --- a/packages/ra-ui-materialui/src/input/RadioButtonGroupInput.spec.tsx +++ b/packages/ra-ui-materialui/src/input/RadioButtonGroupInput.spec.tsx @@ -347,7 +347,7 @@ describe('', () => { expect(getByText('ra.validation.error')).not.toBeNull(); }); - it('should be displayed even with an helper Text', () => { + it('should be displayed even with a helper Text', () => { // This validator always returns an error const validate = () => 'ra.validation.error'; diff --git a/packages/ra-ui-materialui/src/input/RadioButtonGroupInput.tsx b/packages/ra-ui-materialui/src/input/RadioButtonGroupInput.tsx index 6b2c3afdd0d..8f71819cf06 100644 --- a/packages/ra-ui-materialui/src/input/RadioButtonGroupInput.tsx +++ b/packages/ra-ui-materialui/src/input/RadioButtonGroupInput.tsx @@ -36,7 +36,7 @@ const useStyles = makeStyles( * * By default, the options are built from: * - the 'id' property as the option value, - * - the 'name' property an the option text + * - the 'name' property as the option text * @example * const choices = [ * { id: 'M', name: 'Male' }, diff --git a/packages/ra-ui-materialui/src/input/SelectArrayInput.tsx b/packages/ra-ui-materialui/src/input/SelectArrayInput.tsx index 45b27951c65..bde80546c77 100644 --- a/packages/ra-ui-materialui/src/input/SelectArrayInput.tsx +++ b/packages/ra-ui-materialui/src/input/SelectArrayInput.tsx @@ -91,7 +91,7 @@ const useStyles = makeStyles( * * By default, the options are built from: * - the 'id' property as the option value, - * - the 'name' property an the option text + * - the 'name' property as the option text * @example * const choices = [ * { id: 'programming', name: 'Programming' }, diff --git a/packages/ra-ui-materialui/src/input/SelectInput.spec.tsx b/packages/ra-ui-materialui/src/input/SelectInput.spec.tsx index 10c197334a8..acd37606415 100644 --- a/packages/ra-ui-materialui/src/input/SelectInput.spec.tsx +++ b/packages/ra-ui-materialui/src/input/SelectInput.spec.tsx @@ -365,7 +365,7 @@ describe('', () => { expect(option2.getAttribute('data-value')).toEqual('rea'); }); - it('should displayed helperText if prop is present', () => { + it('should display helperText if prop is present', () => { const { getByText } = render( { const theme = createMuiTheme(); - // Use https://github.com/ericf/css-mediaquery as ponyfill. + // Use https://github.com/ericf/css-mediaquery as polyfill. const ssrMatchMedia = query => ({ matches: mediaQuery.match(query, { // The estimated CSS width of the browser. diff --git a/packages/ra-ui-materialui/src/list/datagrid/DatagridHeaderCell.spec.tsx b/packages/ra-ui-materialui/src/list/datagrid/DatagridHeaderCell.spec.tsx index 3ca385d293a..3afbccede17 100644 --- a/packages/ra-ui-materialui/src/list/datagrid/DatagridHeaderCell.spec.tsx +++ b/packages/ra-ui-materialui/src/list/datagrid/DatagridHeaderCell.spec.tsx @@ -103,7 +103,7 @@ describe('', () => { expect(getByTitle('ra.action.sort').dataset.order).toBe('ASC'); }); - it('should be disabled when field has no sortby and no source', () => { + it('should be disabled when field has no sortBy and no source', () => { const { queryAllByTitle } = render( diff --git a/packages/ra-ui-materialui/src/list/filter/FilterForm.spec.tsx b/packages/ra-ui-materialui/src/list/filter/FilterForm.spec.tsx index 6953103aab8..c587ab81158 100644 --- a/packages/ra-ui-materialui/src/list/filter/FilterForm.spec.tsx +++ b/packages/ra-ui-materialui/src/list/filter/FilterForm.spec.tsx @@ -135,7 +135,7 @@ describe('', () => { }); describe('mergeInitialValuesWithDefaultValues', () => { - it('should correctly merge initial values with the default values of the alwayson filters', () => { + it('should correctly merge initial values with the default values of the alwaysOn filters', () => { const initialValues = { title: 'initial title', };