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

[Doc] Fix anchors and typos #9054

Merged
merged 1 commit into from
Jun 28, 2023
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 docs/EditTutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ React-admin supports the most common validation strategies:

* [per field validators](./Validation.md#per-input-validation-built-in-field-validators),
* [form validation](./Validation.md#global-validation),
* [validation schema powered by yup or zod](./Validation.html#schema-validation),
* [validation schema powered by yup or zod](./Validation.md#schema-validation),
* [server-side validation](./Validation.md#server-side-validation).

![Validation example](./img/validation.png)
Expand Down
12 changes: 6 additions & 6 deletions docs/Features.md
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ const SongList = () => (
);
```

Check [the Saved Queries Tutorial](./FilteringTutorial.md##saved-queries-let-users-save-filter-and-sort) to learn more.
Check [the Saved Queries Tutorial](./FilteringTutorial.md#saved-queries-let-users-save-filter-and-sort) to learn more.

Finally, react-admin offers low-level components and hooks to **build your own search UI**:

Expand Down Expand Up @@ -486,7 +486,7 @@ React-admin offers, out of the box, several form layouts:
- [`<AccordionForm>`](./AccordionForm.md) for long forms with collapsible sections
- [`<LongForm>`](./LongForm.md) for long forms with a navigation sidebar
- [`<WizardForm>`](./WizardForm.md) for multi-step forms
- [`<EditInDialog>`](./EditInDialog.md) for sub-forms in a modal dialog
- [`<EditDialog>`](./EditDialog.md) for sub-forms in a modal dialog
- and [`Form`](./Form.md), a headless component to use as a base for your custom layouts

### Input Components
Expand All @@ -506,7 +506,7 @@ Inside forms, you can use specialize [input components](./Inputs.md), designed f
| Date | `'2022-10-23'` | [`<DateInput>`](./DateInput.md) |
| Time | `'14:30:00'` | [`<TimeInput>`](./TimeInput.md) |
| Date & time | `'2022-10-24T19:40:28.003Z'` | [`<DateTimeInput>`](./DateTimeInput.md) |
| Object | `{ foo: 'bar' }` | All inputs (see [ `source`](#source)) |
| Object | `{ foo: 'bar' }` | All inputs (see [ `source`](./Inputs.md#source)) |
| Enum | `'foo'` | [`<SelectInput>`](./SelectInput.md), [`<AutocompleteInput>`](./AutocompleteInput.md), [`<RadioButtonGroupInput>`](./RadioButtonGroupInput.md) |
| Foreign key | `42` | [`<ReferenceInput>`](./ReferenceInput.md) |
| Array of objects | `[{ item: 'jeans', qty: 3 }, { item: 'shirt', qty: 1 }]` | [`<ArrayInput>`](./ArrayInput.md) |
Expand Down Expand Up @@ -566,7 +566,7 @@ React-admin forms support the most common validation strategies:

* [per field validators](./Validation.md#per-input-validation-built-in-field-validators),
* [form validation](./Validation.md#global-validation),
* [validation schema powered by yup or zod](./Validation.html#schema-validation),
* [validation schema powered by yup or zod](./Validation.md#schema-validation),
* [server-side validation](./Validation.md#server-side-validation).

Here is an example of per-field validation:
Expand Down Expand Up @@ -804,7 +804,7 @@ To learn more about authentication, roles, and permissions, check out the follow
- [`WithPermissions`](./WithPermissions.md)
- [`useAuthProvider`](./useAuthProvider.md)
- [`useAuthenticated`](./useAuthenticated.md)
- [`useAuthstate`](./useAuthstate.md)
- [`useAuthstate`](./useAuthState.md)
- [`useGetIdentity`](./useGetIdentity.md)
- [`useLogin`](./useLogin.md)
- [`useLogout`](./useLogout.md)
Expand Down Expand Up @@ -974,7 +974,7 @@ These building blocks include:
And if you want to create your building blocks, you can use any of the [75+ hooks](./Reference.md#hooks) that carry **headless, reusable logic**. To name a few of them:

- [`useRecordContext`](./useRecordContext.md) to get the current record anywhere in the app
- [`useWarnWhenUnsavedChanges`](./useWarnWhenUnsavedChanges.md) to warn the user when he tries to leave a page with unsaved changes
- [`useWarnWhenUnsavedChanges`](./EditTutorial.md#warning-about-unsaved-changes) to warn the user when he tries to leave a page with unsaved changes
- [`useSaveContext`](./useSaveContext.md) to tweak form submission
- [`useTheme`](./Theming.md#changing-the-theme-programmatically) to change the theme programmatically

Expand Down
2 changes: 1 addition & 1 deletion docs/Routing.md
Original file line number Diff line number Diff line change
Expand Up @@ -239,4 +239,4 @@ If there are duplicates, you need to make sure to use only the same version as r
}
```

This may also happen inside a [Remix](https://remix.run/) application. See [Setting up react-admin for Remix](./Remix.md#setting-up-react-admin) for instructions to overcome that problem.
This may also happen inside a [Remix](https://remix.run/) application. See [Setting up react-admin for Remix](./Remix.md#setting-up-react-admin-in-remix) for instructions to overcome that problem.
2 changes: 1 addition & 1 deletion docs/Show.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ That's enough to display the post show view:
* `className`: passed to the root component
* [`children`](#layout): the components that render the record fields
* [`component`](#component): overrides the root component
* [`disableAuthentication`](#`disableauthentication`): disable the authentication check
* [`disableAuthentication`](#disableauthentication): disable the authentication check
* [`emptyWhileLoading`](#loading-state)
* [`queryOptions`](#queryoptions): options to pass to the react-query client
* [`sx`](#sx-css-api): Override the styles
Expand Down
2 changes: 1 addition & 1 deletion docs/SimpleForm.md
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ Before building your own custom layout, take a look at the existing form layout
- [`AccordionForm`](./AccordionForm.md) for long forms with collapsible sections
- [`LongForm`](./LongForm.md) for long forms with a navigation sidebar
- [`WizardForm`](./WizardForm.md) for multi-step forms
- [`EditInDialog`](./EditInDialog.md) for sub-forms in a modal dialog
- [`EditDialog`](./EditDialog.md) for sub-forms in a modal dialog
- and [`Form`](./Form.md), a headless component to use as a base for your custom layouts

## Subscribing To Form Changes
Expand Down
4 changes: 2 additions & 2 deletions docs/StackedFilters.md
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ With the configuration above, the possible filter keys are:

## Internationalization

React-admin uses the keys of the filter configuration to display the field names. Each key goes through the standard [resource and field name translation system](./Translation.md#translating-resource-and-field-names), so you can customize them using a translation file.
React-admin uses the keys of the filter configuration to display the field names. Each key goes through the standard [resource and field name translation system](./Translation.md#translation-files), so you can customize them using a translation file.

```jsx
// in i18n/en.js
Expand Down Expand Up @@ -295,4 +295,4 @@ export default {
},
},
};
```
```
2 changes: 1 addition & 1 deletion docs/TabbedForm.md
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ export const PostCreate = () => (
```
{% endraw %}

**Tip:** If you want to customize the _content_ of the tabs instead, for example to limit the width of the form, you should rather add an `sx` prop to the [`<TabbedForm.Tab>` component](#formtab).
**Tip:** If you want to customize the _content_ of the tabs instead, for example to limit the width of the form, you should rather add an `sx` prop to the [`<TabbedForm.Tab>` component](#tabbedformtab).

## `sanitizeEmptyValues`

Expand Down
2 changes: 1 addition & 1 deletion docs/addRefreshAuthToAuthProvider.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ title: "addRefreshAuthToAuthProvider"

# `addRefreshAuthToAuthProvider`

This helper function wraps an existing [`authProvider`]('./Authentication.md') to support authentication token refreshing mechanisms.
This helper function wraps an existing [`authProvider`](./Authentication.md) to support authentication token refreshing mechanisms.

## Usage

Expand Down
2 changes: 1 addition & 1 deletion docs/useSubscribeToRecord.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ You can provide the resource and record id explicitly if you are not in such con
useSubscribeToRecord(event => { /* ... */ }, 'posts', 123);
```

**Tip**: If your reason to subscribe to events on a record is to keep the record up to date, you should use [the `useGetOneLive` hook](#usegetonelive) instead.
**Tip**: If your reason to subscribe to events on a record is to keep the record up to date, you should use [the `useGetOneLive` hook](./useGetOneLive.md) instead.

## Parameters

Expand Down
2 changes: 1 addition & 1 deletion docs/useSubscribeToRecordList.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ The `options` object can contain the following properties:
- `once`: Whether to unsubscribe after the first event. Defaults to `false`.
- `unsubscribeOnUnmount`: Whether to unsubscribe on unmount. Defaults to `true`.

See [`useSubscribe`](#usesubscribe) for more details.
See [`useSubscribe`](./useSubscribe.md) for more details.

## `resource`

Expand Down
2 changes: 1 addition & 1 deletion packages/ra-core/src/auth/useAuthState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ const useAuthState = (
// If the data is undefined and the query isn't loading anymore, it means the query failed.
// In that case, we set authenticated to false unless there's no authProvider.
authenticated:
result.data ?? result.isLoading ? true : authProvider == null, // Optimisic
result.data ?? result.isLoading ? true : authProvider == null, // Optimistic
isLoading: result.isLoading,
error: result.error,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ const useRoutesAndResourcesFromChildren = (
): [RoutesAndResources, AdminRouterStatus] => {
// Gather custom routes and resources that were declared as direct children of CoreAdminRouter
// e.g. Not returned from the child function (if any)
// We need to know right away wether some resources were declared to correctly
// We need to know right away whether some resources were declared to correctly
// initialize the status at the next stop
const doLogout = useLogout();
const [
Expand Down
2 changes: 1 addition & 1 deletion packages/ra-core/src/dataProvider/useInfiniteGetList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import { useDataProvider } from './useDataProvider';
*
* @example
*
* import { useInfinteGetList } from 'react-admin';
* import { useInfiniteGetList } from 'react-admin';
*
* const LatestNews = () => {
* const { data, total, isLoading, error, hasNextPage, fetchNextPage } = useInfiniteGetList(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ import {
* - The callbacks are not executed in a transaction. In case of error,
* the backend may be left in an inconsistent state.
* - When calling the API directly using fetch or another client,
* the callbacks will not be executed, leaving the backend in a possiblly inconsistent state.
* the callbacks will not be executed, leaving the backend in a possibly inconsistent state.
* - If a callback triggers the query it's listening to, this will lead to a infinite loop.
*
* @example
Expand Down
2 changes: 1 addition & 1 deletion packages/ra-core/src/store/useRemoveFromStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { useStoreContext } from './useStoreContext';
* const ResetDatagridPrefs = () {
* const removeItem = useRemoveFromStore();
*
* const hancleClick = () => {
* const handleClick = () => {
* removeItem('datagrid.prefs');
* };
*
Expand Down
2 changes: 1 addition & 1 deletion packages/ra-core/src/store/useRemoveItemsFromStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { useStoreContext } from './useStoreContext';
* const ResetDatagridPrefs = () {
* const removeItems = useRemoveItemsFromStore();
*
* const hancleClick = () => {
* const handleClick = () => {
* removeItems('datagrid.prefs');
* };
*
Expand Down
2 changes: 1 addition & 1 deletion packages/ra-core/src/util/getFieldLabelTranslationArgs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ const getSourceParts = (source: string) => {
// remove digits, e.g. 'book.authors.2.categories.3.identifier.name' => 'book.authors.categories.identifier.name'
const sourceWithoutDigits = source.replace(/\.\d+\./g, '.');
// get final part, e.g. 'book.authors.2.categories.3.identifier.name' => 'identifier.name'
// we're not using a regexp here to avoid code sacnning alert "Polynomial regular expression used on uncontrolled data"
// we're not using a regexp here to avoid code scanning alert "Polynomial regular expression used on uncontrolled data"
const parts = source.split('.');
let lastPartWithDigits;
parts.forEach((part, index) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/ra-ui-materialui/src/layout/Menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ Menu.propTypes = {
hasDashboard: PropTypes.bool,
};

// re-export MenuItem commponents for convenience
// re-export MenuItem components for convenience
Menu.Item = MenuItemLink;
Menu.DashboardItem = DashboardMenuItem;
Menu.ResourceItem = ResourceMenuItem;
Expand Down
2 changes: 1 addition & 1 deletion packages/ra-ui-materialui/src/list/Count.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { Link } from '../Link';
*
* Relies on dataProvider.getList() returning a total property
*
* @example // Display the number of recorfds in the current resource (based on RezsourceContext)
* @example // Display the number of records in the current resource (based on ResourceContext)
* <Count />
*
* @example // Display the number of posts
Expand Down
Loading