diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6a517ab7c..3d7b71a98 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -63,7 +63,7 @@ Each test directory is split up in this way specifically to reduce friction when The following command will start Payload with your config: `pnpm dev my-test-dir`. Example: `pnpm dev fields` for the test/`fields` test suite. This command will start up Payload using your config and refresh a test database on every restart. If you're using VS Code, the most common run configs are automatically added to your editor - you should be able to find them in your VS Code launch tab. -By default, payload will [automatically log you in](https://payloadcms.com/docs/authentication/overview#admin-autologin) with the default credentials. To disable that, you can either pass in the --no-auto-login flag (example: `pnpm dev my-test-dir --no-auto-login`) or set the `PAYLOAD_PUBLIC_DISABLE_AUTO_LOGIN` environment variable to `false`. +By default, payload will [automatically log you in](https://payloadcms.com/docs/authentication/overview#auto-login) with the default credentials. To disable that, you can either pass in the --no-auto-login flag (example: `pnpm dev my-test-dir --no-auto-login`) or set the `PAYLOAD_PUBLIC_DISABLE_AUTO_LOGIN` environment variable to `false`. The default credentials are `dev@payloadcms.com` as E-Mail and `test` as password. These are used in the auto-login. diff --git a/docs/access-control/collections.mdx b/docs/access-control/collections.mdx index f7e5836f0..0c5465e76 100644 --- a/docs/access-control/collections.mdx +++ b/docs/access-control/collections.mdx @@ -261,7 +261,7 @@ The following arguments are provided to the `delete` function: If the Collection is used to access the [Admin Panel](../admin/overview#the-admin-user-collection), the `Admin` Access Control function determines whether or not the currently logged in user can access the admin UI. -To add Admin Access Control to a Collection, use the `admin` property in the [Collection Config](../collections/overview): +To add Admin Access Control to a Collection, use the `admin` property in the [Collection Config](../configuration/collections): ```ts import type { CollectionConfig } from 'payload' diff --git a/docs/admin/components.mdx b/docs/admin/components.mdx index ebf58c3c6..07b2ccb00 100644 --- a/docs/admin/components.mdx +++ b/docs/admin/components.mdx @@ -185,7 +185,7 @@ Each Custom Component receives the following props by default: **Reminder:** - All Custom Components also receive various other props that are specific component being rendered. See [Root Components](#root-components), [Collection Components](../configuration/collections#custom-components), [Global Components](../configuraiton/globals#custom-components), or [Field Components](../fields/overview#custom-components) for a complete list of all default props per component. + All Custom Components also receive various other props that are specific component being rendered. See [Root Components](#root-components), [Collection Components](../configuration/collections#custom-components), [Global Components](../configuration/globals#custom-components), or [Field Components](../fields/overview#custom-components) for a complete list of all default props per component. ### Custom Props @@ -511,7 +511,7 @@ The following options are available: As you add more and more Custom Components to your [Admin Panel](./overview), you may find it helpful to add additional [React Context](https://react.dev/learn/scaling-up-with-reducer-and-context)(s). Payload allows you to inject your own context providers in your app so you can export your own custom hooks, etc. -To add a Custom Provider, use the `admin.components.providers` property in your [Payload Config](../getting-started/overview): +To add a Custom Provider, use the `admin.components.providers` property in your [Payload Config](../configuration/overview): ```ts import { buildConfig } from 'payload' @@ -546,5 +546,5 @@ export const useMyCustomContext = () => useContext(MyCustomContext) ``` - **Reminder:**React Context exists only within Client Components. This means they must include the `use client` directive at the top of their files and cannot contain server-only code. To use a Server Component here, simply _wrap_ your Client Component with it. + **Reminder:** React Context exists only within Client Components. This means they must include the `use client` directive at the top of their files and cannot contain server-only code. To use a Server Component here, simply _wrap_ your Client Component with it. diff --git a/docs/authentication/operations.mdx b/docs/authentication/operations.mdx index 7f3a02b57..a2895361c 100644 --- a/docs/authentication/operations.mdx +++ b/docs/authentication/operations.mdx @@ -312,7 +312,7 @@ Payload comes with built-in forgot password functionality. Submitting an email a The link to reset the user's password contains a token which is what allows the user to securely reset their password. -By default, the Forgot Password operations send users to the [Admin Panel](../admin/overview) to reset their password, but you can customize the generated email to send users to the frontend of your app instead by [overriding the email HTML](/docs/authentication/overview#forgot-password). +By default, the Forgot Password operations send users to the [Admin Panel](../admin/overview) to reset their password, but you can customize the generated email to send users to the frontend of your app instead by [overriding the email HTML](/docs/authentication/email#forgot-password). **Example REST API Forgot Password**: @@ -348,7 +348,9 @@ const token = await payload.forgotPassword({ }) ``` -**Note:** if you do not have a `config.serverURL` set, Payload will attempt to create one for you if the `forgot-password` operation was triggered via REST or GraphQL by looking at the incoming `req`. But this is not supported if you are calling `payload.forgotPassword()` via the Local API. If you do not have a `serverURL` set, you may want to override your `auth.forgotPassword.generateEmailHTML` function to provide a full URL to link the user to a proper reset-password page. + + **Note:** if you do not have a `config.serverURL` set, Payload will attempt to create one for you if the `forgot-password` operation was triggered via REST or GraphQL by looking at the incoming `req`. But this is not supported if you are calling `payload.forgotPassword()` via the Local API. If you do not have a `serverURL` set, you may want to override your `auth.forgotPassword.generateEmailHTML` function to provide a full URL to link the user to a proper reset-password page. + **Tip:** diff --git a/docs/authentication/overview.mdx b/docs/authentication/overview.mdx index ef6260d7f..593221258 100644 --- a/docs/authentication/overview.mdx +++ b/docs/authentication/overview.mdx @@ -132,7 +132,7 @@ If set to `true`, an email address is required when creating a new user. If set For testing and demo purposes you may want to skip forcing the user to login in order to access your application. Typically, all users should be required to login, however, you can speed up local development time by enabling auto-login. -To enable auto-login, set the `autoLogin` property in the [Admin Config](../configuration/admin): +To enable auto-login, set the `autoLogin` property in the [Payload Config](../admin/overview#admin-options): ```ts import { buildConfig } from 'payload' diff --git a/docs/configuration/collections.mdx b/docs/configuration/collections.mdx index 8293eb544..e484626d5 100644 --- a/docs/configuration/collections.mdx +++ b/docs/configuration/collections.mdx @@ -32,7 +32,7 @@ export default buildConfig({ ## Config Options -It's often best practice to write your Collections in separate files and then import them into the main [Payload Config](../overview). +It's often best practice to write your Collections in separate files and then import them into the main [Payload Config](./overview). Here is what a simple Collection Config might look like: @@ -95,7 +95,7 @@ Fields define the schema of the Documents within a Collection. To learn more, go ## Admin Options -The behavior of Collections within the [Admin Panel](../admin/overview) can be fully customized to fit the needs of your application. This includes grouping or hiding their navigation links, adding [Custom Components](./components), selecting which fields to display in the List View, and more. +The behavior of Collections within the [Admin Panel](../admin/overview) can be fully customized to fit the needs of your application. This includes grouping or hiding their navigation links, adding [Custom Components](../admin/components), selecting which fields to display in the List View, and more. To configure Admin Options for Collections, use the `admin` property in your Collection Config: diff --git a/docs/configuration/globals.mdx b/docs/configuration/globals.mdx index 94ed8c11d..7f3db0792 100644 --- a/docs/configuration/globals.mdx +++ b/docs/configuration/globals.mdx @@ -80,7 +80,7 @@ The following options are available: | **`lockDocuments`** | Enables or disables document locking. By default, document locking is enabled. Set to an object to configure, or set to `false` to disable locking. [More details](../admin/locked-documents). | | **`slug`** * | Unique, URL-friendly string that will act as an identifier for this Global. | | **`typescript`** | An object with property `interface` as the text used in schema generation. Auto-generated from slug if not defined. | -| **`versions`** | Set to true to enable default options, or configure with object properties. [More details](../versions/overview#globals-config). | +| **`versions`** | Set to true to enable default options, or configure with object properties. [More details](../versions/overview#global-config). | _* An asterisk denotes that a property is required._ diff --git a/docs/configuration/overview.mdx b/docs/configuration/overview.mdx index 64c421f21..acb4c1fb8 100644 --- a/docs/configuration/overview.mdx +++ b/docs/configuration/overview.mdx @@ -24,7 +24,7 @@ The Payload Config is strongly typed and ties directly into Payload's TypeScript **Tip:** - The location of your Payload Config can be customized. [More details](#customizing--automating-config-location-detection). + The location of your Payload Config can be customized. [More details](#customizing-the-config-location). ## Config Options @@ -73,7 +73,7 @@ The following options are available: | **`collections`** | An array of Collections for Payload to manage. [More details](./collections). | | **`compatibility`** | Compatibility flags for earlier versions of Payload. [More details](#compatibility-flags). | | **`globals`** | An array of Globals for Payload to manage. [More details](./globals). | -| **`cors`** | Cross-origin resource sharing (CORS) is a mechanism that accept incoming requests from given domains. You can also customize the `Access-Control-Allow-Headers` header. [More details](#cross-origin-resource-sharing-cors). | +| **`cors`** | Cross-origin resource sharing (CORS) is a mechanism that accept incoming requests from given domains. You can also customize the `Access-Control-Allow-Headers` header. [More details](#cors). | | **`localization`** | Opt-in to translate your content into multiple locales. [More details](./localization). | | **`logger`** | Logger options, logger options with a destination stream, or an instantiated logger instance. [More details](https://getpino.io/#/docs/api?id=options). | | **`loggingLevels`** | An object to override the level to use in the logger for Payload's errors. | @@ -181,7 +181,7 @@ If none was in either location, Payload will finally check the `dist` directory. ### Customizing the Config Location -In addition to the above automated detection, you can specify your own location for the Payload Config. This can be useful in situations where your config is not in a standard location, or you wish to switch between multiple configurations. To do this, Payload exposes an [Environment Variable](..environment-variables) to bypass all automatic config detection. +In addition to the above automated detection, you can specify your own location for the Payload Config. This can be useful in situations where your config is not in a standard location, or you wish to switch between multiple configurations. To do this, Payload exposes an [Environment Variable](./environment-variables) to bypass all automatic config detection. To use a custom config location, set the `PAYLOAD_CONFIG_PATH` environment variable: diff --git a/docs/database/migrations.mdx b/docs/database/migrations.mdx index 55f700e52..46b32a947 100644 --- a/docs/database/migrations.mdx +++ b/docs/database/migrations.mdx @@ -274,5 +274,5 @@ export default buildConfig({ Passing your migrations as shown above will tell Payload, in production only, to execute any migrations that need to be run prior to completing the initialization of Payload. This is ideal for long-running services where Payload will only be initialized at startup. - Warning - if Payload is instructed to run migrations in production, this may slow down serverless cold starts on platforms such as Vercel. Generally, this option should only be used for long-running servers / containers. + **Warning:** if Payload is instructed to run migrations in production, this may slow down serverless cold starts on platforms such as Vercel. Generally, this option should only be used for long-running servers / containers. diff --git a/docs/database/postgres.mdx b/docs/database/postgres.mdx index e6acf7f90..88a7cc557 100644 --- a/docs/database/postgres.mdx +++ b/docs/database/postgres.mdx @@ -52,7 +52,7 @@ export default buildConfig({ **Note:** - If you're using `vercelPostgresAdapter` your `process.env.POSTGRES_URL` or `pool.connectionString` points to a local database (e.g hostname has `localhost` or `127.0.0.1`) we use the `pg` module for pooling instead of `@vercel/postgres`. This is because `@vercel/postgres` doesn't work with local databases, if you want to disable that behavior, you can pass `forceUseVercelPostgres: true` to adapter's 'args and follow [Vercel guide](https://vercel.com/docs/storage/vercel-postgres/local-development#option-2:-local-postgres-instance-with-docker) for a Docker Neon DB setup. + If you're using `vercelPostgresAdapter` your `process.env.POSTGRES_URL` or `pool.connectionString` points to a local database (e.g hostname has `localhost` or `127.0.0.1`) we use the `pg` module for pooling instead of `@vercel/postgres`. This is because `@vercel/postgres` doesn't work with local databases, if you want to disable that behavior, you can pass `forceUseVercelPostgres: true` to the adapter's args and follow [Vercel guide](https://vercel.com/docs/storage/vercel-postgres/local-development#option-2:-local-postgres-instance-with-docker) for a Docker Neon DB setup. ## Options diff --git a/docs/fields/array.mdx b/docs/fields/array.mdx index 79ebf04c2..4febd8509 100644 --- a/docs/fields/array.mdx +++ b/docs/fields/array.mdx @@ -84,7 +84,7 @@ The Array Field inherits all of the default options from the base [Field Admin C | Option | Description | | ------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | | **`initCollapsed`** | Set the initial collapsed state | -| **`components.RowLabel`** | React component to be rendered as the label on the array row. [Example](#example-of-a-custom-rowlabel-component) | +| **`components.RowLabel`** | React component to be rendered as the label on the array row. [Example](#row-label) | | **`isSortable`** | Disable order sorting by setting this value to `false` | ## Example diff --git a/docs/fields/join.mdx b/docs/fields/join.mdx index e108deec1..cd370d2a1 100644 --- a/docs/fields/join.mdx +++ b/docs/fields/join.mdx @@ -123,11 +123,11 @@ powerful Admin UI. | Option | Description | |------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| **`name`** * | To be used as the property name when retrieved from the database. [More](./overview#field-names) | -| **`collection`** * | The `slug`s having the relationship field. | -| **`on`** * | The name of the relationship or upload field that relates to the collection document. Use dot notation for nested paths, like 'myGroup.relationName'. | +| **`name`** * | To be used as the property name when retrieved from the database. [More](./overview#field-names) | +| **`collection`** * | The `slug`s having the relationship field. | +| **`on`** * | The name of the relationship or upload field that relates to the collection document. Use dot notation for nested paths, like 'myGroup.relationName'. | | **`where`** | A `Where` query to hide related documents from appearing. Will be merged with any `where` specified in the request. | -| **`maxDepth`** | Default is 1, Sets a maximum population depth for this field, regardless of the remaining depth when this field is reached. [Max Depth](/docs/getting-started/concepts#field-level-max-depth). | +| **`maxDepth`** | Default is 1, Sets a maximum population depth for this field, regardless of the remaining depth when this field is reached. [Max Depth](../queries/depth#max-depth). | | **`label`** | Text used as a field label in the Admin Panel or an object with keys for each language. | | **`hooks`** | Provide Field Hooks to control logic for this field. [More details](../hooks/fields). | | **`access`** | Provide Field Access Control to denote what users can see and do with this field's data. [More details](../access-control/fields). | diff --git a/docs/fields/overview.mdx b/docs/fields/overview.mdx index 3565f5c08..5fdadc4d9 100644 --- a/docs/fields/overview.mdx +++ b/docs/fields/overview.mdx @@ -10,7 +10,7 @@ Fields are the building blocks of Payload. They define the schema of the Documen There are many [Field Types](#field-types) to choose from, ranging anywhere from simple text strings to nested arrays and blocks. Most fields save data to the database, while others are strictly presentational. Fields can have [Custom Validations](#validation), [Conditional Logic](./overview#conditional-logic), [Access Control](#field-level-access-control), [Hooks](#field-level-hooks), and so much more. -Fields can be endlessly customized in their appearance and behavior without affecting their underlying data structure. Fields are designed to withstand heavy modification or even complete replacement through the use of [Custom Field Components](../admin/components#custom-components). +Fields can be endlessly customized in their appearance and behavior without affecting their underlying data structure. Fields are designed to withstand heavy modification or even complete replacement through the use of [Custom Field Components](#custom-components). To configure fields, use the `fields` property in your [Collection](../configuration/collections) or [Global](../configuration/globals) config: @@ -154,7 +154,7 @@ The following field names are forbidden and cannot be used: ### Field-level Hooks -In addition to being able to define [Hooks](.../admin/hooks/overview) on a document-level, you can define extremely granular logic field-by-field. +In addition to being able to define [Hooks](../hooks/overview) on a document-level, you can define extremely granular logic field-by-field. To define Field-level Hooks, use the `hooks` property in your Field Config: @@ -172,7 +172,7 @@ export const MyField: Field = { } ``` -For full details on Field-level Hooks, see the [Field Hooks](.../admin/hooks/fields) documentation. +For full details on Field-level Hooks, see the [Field Hooks](../hooks/fields) documentation. ### Field-level Access Control diff --git a/docs/getting-started/concepts.mdx b/docs/getting-started/concepts.mdx index 93f4f9e1a..76ed21950 100644 --- a/docs/getting-started/concepts.mdx +++ b/docs/getting-started/concepts.mdx @@ -50,7 +50,7 @@ Everything Payload does (create, read, update, delete, login, logout, etc.) is e - [Local API](#local-api) - Extremely fast, direct-to-database access - [REST API](#rest-api) - Standard HTTP endpoints for querying and mutating data -- [GraphQL](#graphql) - A full GraphQL API with a GraphQL Playground +- [GraphQL](#graphql-api) - A full GraphQL API with a GraphQL Playground **Note:** @@ -157,7 +157,7 @@ All of Payload's GraphQL functionality is abstracted into a separate package. Pa This is the UI library that Payload's Admin Panel uses. All components are exported from this package and can be re-used as you build extensions to the Payload admin UI, or want to use Payload components in your own React apps. Some exports are server components and some are client components. -`@payloadcms/db-postgres`, `@payloadcms/db-vercel-postgres`, `@payloadcms/db-mongodb` +`@payloadcms/db-postgres`, `@payloadcms/db-vercel-postgres`, `@payloadcms/db-mongodb`, `@payloadcms/db-sqlite` You can choose which Database Adapter you'd like to use for your project, and no matter which you choose, the entire data layer for Payload is contained within these packages. You can only use one at a time for any given project. diff --git a/docs/graphql/overview.mdx b/docs/graphql/overview.mdx index e64db13c8..0e4b48ec2 100644 --- a/docs/graphql/overview.mdx +++ b/docs/graphql/overview.mdx @@ -94,7 +94,7 @@ const Header: GlobalConfig = { ## Preferences -User [preferences](/docs/admin/overview#preferences) for the [Admin Panel](../admin/overview) are also available to GraphQL the same way as other collection schemas are generated. To query preferences you must supply an authorization token in the header and only the preferences of that user will be accessible. +User [preferences](../admin/preferences) for the [Admin Panel](../admin/overview) are also available to GraphQL the same way as other collection schemas are generated. To query preferences you must supply an authorization token in the header and only the preferences of that user will be accessible. **Payload will open the following query:** diff --git a/docs/hooks/fields.mdx b/docs/hooks/fields.mdx index d040d13c5..bd883d322 100644 --- a/docs/hooks/fields.mdx +++ b/docs/hooks/fields.mdx @@ -27,7 +27,7 @@ All Field Hooks accept an array of synchronous or asynchronous functions. These **Important:** - Due to GraphQL's typed nature, changing the type of data that you return from a field will produce errors in the [GraphQL API](../graphql/overview). If you need to change the shape or type of data, consider [Collection Hooks](./collections) or [Global Hooks](./hooks) instead. + Due to GraphQL's typed nature, changing the type of data that you return from a field will produce errors in the [GraphQL API](../graphql/overview). If you need to change the shape or type of data, consider [Collection Hooks](./collections) or [Global Hooks](./globals) instead. To add hooks to a Field, use the `hooks` property in your [Field Config](../fields/overview): diff --git a/docs/local-api/overview.mdx b/docs/local-api/overview.mdx index d2943b977..4bba92774 100644 --- a/docs/local-api/overview.mdx +++ b/docs/local-api/overview.mdx @@ -19,7 +19,7 @@ Here are some common examples of how you can use the Local API: - Fetching Payload data within React Server Components - Seeding data via Node seed scripts that you write and maintain - Opening custom Next.js route handlers which feature additional functionality but still rely on Payload -- Within [Access Control](../access-control) and [Hooks](../hooks/overview) +- Within [Access Control](../access-control/overview) and [Hooks](../hooks/overview) ## Accessing Payload diff --git a/docs/queries/select.mdx b/docs/queries/select.mdx index 36d7bc560..7b5b5c5ae 100644 --- a/docs/queries/select.mdx +++ b/docs/queries/select.mdx @@ -138,7 +138,7 @@ export const Pages: CollectionConfig<'pages'> = { ``` - Important: + **Important:** When using `defaultPopulate` on a collection with [Uploads](/docs/fields/upload) enabled and you want to select the `url` field, it is important to specify `filename: true` as well, otherwise Payload will not be able to construct the correct file URL, instead returning `url: null`.