Skip to content

Commit 034a267

Browse files
authored
docs: fix query preset config link (#12156)
<!-- Thank you for the PR! Please go through the checklist below and make sure you've completed all the steps. Please review the [CONTRIBUTING.md](https://github.com/payloadcms/payload/blob/main/CONTRIBUTING.md) document in this repository if you haven't already. The following items will ensure that your PR is handled as smoothly as possible: - PR Title must follow conventional commits format. For example, `feat: my new feature`, `fix(plugin-seo): my fix`. - Minimal description explained as if explained to someone not immediately familiar with the code. - Provide before/after screenshots or code diffs if applicable. - Link any related issues/discussions from GitHub or Discord. - Add review comments if necessary to explain to the reviewer the logic behind a change ### What? ### Why? ### How? Fixes # --> ### What? This PR fixes a link to the Payload config in the query presets docs, and adjusts the links to the edit view components in the collections and global config pages. ### Why? To direct users to the correct location. ### How? Changes to a few docs. Fixes #12199
1 parent 92380bf commit 034a267

File tree

3 files changed

+36
-34
lines changed

3 files changed

+36
-34
lines changed

docs/configuration/collections.mdx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -193,13 +193,13 @@ export const MyCollection: CollectionConfig = {
193193

194194
The following options are available:
195195

196-
| Option | Description |
197-
| ----------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
198-
| `SaveButton` | Replace the default Save Button within the Edit View. [Drafts](../versions/drafts) must be disabled. [More details](../custom-components/edit-view#save-button). |
199-
| `SaveDraftButton` | Replace the default Save Draft Button within the Edit View. [Drafts](../versions/drafts) must be enabled and autosave must be disabled. [More details](../custom-components/edit-view#save-draft-button). |
200-
| `PublishButton` | Replace the default Publish Button within the Edit View. [Drafts](../versions/drafts) must be enabled. [More details](../custom-components/edit-view#publish-button). |
201-
| `PreviewButton` | Replace the default Preview Button within the Edit View. [Preview](../admin/preview) must be enabled. [More details](../custom-components/edit-view#preview-button). |
202-
| `Upload` | Replace the default Upload component within the Edit View. [Upload](../upload/overview) must be enabled. [More details](../custom-components/edit-view#upload). |
196+
| Option | Description |
197+
| ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
198+
| `SaveButton` | Replace the default Save Button within the Edit View. [Drafts](../versions/drafts) must be disabled. [More details](../custom-components/edit-view#savebutton). |
199+
| `SaveDraftButton` | Replace the default Save Draft Button within the Edit View. [Drafts](../versions/drafts) must be enabled and autosave must be disabled. [More details](../custom-components/edit-view#savedraftbutton). |
200+
| `PublishButton` | Replace the default Publish Button within the Edit View. [Drafts](../versions/drafts) must be enabled. [More details](../custom-components/edit-view#publishbutton). |
201+
| `PreviewButton` | Replace the default Preview Button within the Edit View. [Preview](../admin/preview) must be enabled. [More details](../custom-components/edit-view#previewbutton). |
202+
| `Upload` | Replace the default Upload component within the Edit View. [Upload](../upload/overview) must be enabled. [More details](../custom-components/edit-view#upload). |
203203

204204
<Banner type="success">
205205
**Note:** For details on how to build Custom Components, see [Building Custom

docs/configuration/globals.mdx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -179,12 +179,12 @@ export const MyGlobal: SanitizedGlobalConfig = {
179179

180180
The following options are available:
181181

182-
| Option | Description |
183-
| ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
184-
| `SaveButton` | Replace the default Save Button with a Custom Component. [Drafts](../versions/drafts) must be disabled. [More details](../custom-components/edit-view#save-button). |
185-
| `SaveDraftButton` | Replace the default Save Draft Button with a Custom Component. [Drafts](../versions/drafts) must be enabled and autosave must be disabled. [More details](../custom-components/edit-view#save-draft-button). |
186-
| `PublishButton` | Replace the default Publish Button with a Custom Component. [Drafts](../versions/drafts) must be enabled. [More details](../custom-components/edit-view#publish-button). |
187-
| `PreviewButton` | Replace the default Preview Button with a Custom Component. [Preview](../admin/preview) must be enabled. [More details](../custom-components/edit-view#preview-button). |
182+
| Option | Description |
183+
| ----------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
184+
| `SaveButton` | Replace the default Save Button with a Custom Component. [Drafts](../versions/drafts) must be disabled. [More details](../custom-components/edit-view#savebutton). |
185+
| `SaveDraftButton` | Replace the default Save Draft Button with a Custom Component. [Drafts](../versions/drafts) must be enabled and autosave must be disabled. [More details](../custom-components/edit-view#savedraftbutton). |
186+
| `PublishButton` | Replace the default Publish Button with a Custom Component. [Drafts](../versions/drafts) must be enabled. [More details](../custom-components/edit-view#publishbutton). |
187+
| `PreviewButton` | Replace the default Preview Button with a Custom Component. [Preview](../admin/preview) must be enabled. [More details](../custom-components/edit-view#previewbutton). |
188188

189189
<Banner type="success">
190190
**Note:** For details on how to build Custom Components, see [Building Custom

docs/query-presets/overview.mdx

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ Adding custom access control rules requires:
117117
2. A set of fields to conditionally render when that option is selected
118118
3. A function that returns the access control rules for that option
119119

120-
To do this, use the `queryPresets.constraints` property in your [Payload Config](../configuration/payload-config).
120+
To do this, use the `queryPresets.constraints` property in your [Payload Config](../configuration/overview).
121121

122122
```ts
123123
import { buildConfig } from 'payload'
@@ -128,26 +128,28 @@ const config = buildConfig({
128128
// ...
129129
// highlight-start
130130
constraints: {
131-
read: {
132-
label: 'Specific Roles',
133-
value: 'specificRoles',
134-
fields: [
135-
{
136-
name: 'roles',
137-
type: 'select',
138-
hasMany: true,
139-
options: [
140-
{ label: 'Admin', value: 'admin' },
141-
{ label: 'User', value: 'user' },
142-
],
143-
},
144-
],
145-
access: ({ req: { user } }) => ({
146-
'access.read.roles': {
147-
in: [user?.roles],
148-
},
149-
}),
150-
},
131+
read: [
132+
{
133+
label: 'Specific Roles',
134+
value: 'specificRoles',
135+
fields: [
136+
{
137+
name: 'roles',
138+
type: 'select',
139+
hasMany: true,
140+
options: [
141+
{ label: 'Admin', value: 'admin' },
142+
{ label: 'User', value: 'user' },
143+
],
144+
},
145+
],
146+
access: ({ req: { user } }) => ({
147+
'access.read.roles': {
148+
in: [user?.roles],
149+
},
150+
}),
151+
},
152+
],
151153
// highlight-end
152154
},
153155
},

0 commit comments

Comments
 (0)