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

chore: merges #8208

Closed
wants to merge 241 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
241 commits
Select commit Hold shift + click to select a range
2a56f98
test: joins config
DanRibbens Jul 30, 2024
80b632f
feat: join field types
DanRibbens Jul 30, 2024
10b9aa7
test: fetch joins
DanRibbens Aug 1, 2024
e9acd94
feat(payload): populate joins
DanRibbens Aug 2, 2024
d1d7a1d
feat(payload): generate join types
DanRibbens Aug 2, 2024
6bebb5a
chore: generate joins graphql before change
DanRibbens Aug 2, 2024
0e4da64
feat(db-mongodb): support nested join fields
DanRibbens Aug 5, 2024
8604b36
chore: disambiguate path to schemaPath and on
DanRibbens Aug 6, 2024
4e67ad2
chore(ui): stub join field
DanRibbens Aug 6, 2024
75d858a
feat: scope publish specific locale
JessChowdhury Aug 8, 2024
fd270a4
feat: paginate and sort joins
DanRibbens Aug 8, 2024
caba54a
feat(db-mongodb): add joins to find function
DanRibbens Aug 9, 2024
02bdcd1
chore: add joins to sanitized collection config
DanRibbens Aug 9, 2024
a71ca31
chore: merge beta
DanRibbens Aug 14, 2024
99cdabc
chore: scaffold client components
DanRibbens Aug 14, 2024
ffbf541
poc
jacobsfletch Aug 15, 2024
13d6295
adds support to table for cell overrides
jacobsfletch Aug 15, 2024
eefd4e9
chore: adds lock icon
PatrikKozak Aug 15, 2024
41ed357
chore: adds new lockWhenEditing prop to collections & globals config
PatrikKozak Aug 15, 2024
1ae10b0
more
jacobsfletch Aug 15, 2024
6efa9c7
updates version cells to new shape
jacobsfletch Aug 15, 2024
b9fa144
adds back community fields
jacobsfletch Aug 15, 2024
57e254c
Merge branch 'beta' into feat/field-tables
jacobsfletch Aug 15, 2024
1956672
fetches data using the api and adds pagination
jacobsfletch Aug 15, 2024
ce52bf5
feat: add pagination to joins field
DanRibbens Aug 15, 2024
d698f09
adds limit
jacobsfletch Aug 16, 2024
0381b54
chore: test joins localization
DanRibbens Aug 16, 2024
ec043a2
Merge branch 'beta' into feat/join-field
DanRibbens Aug 16, 2024
cc0c3ce
chore(db-postgres): WIP joins
DanRibbens Aug 17, 2024
e2bc203
chore(db-postgres): fixes join relationName to have correct field name
DanRibbens Aug 17, 2024
e14264c
feat: adds payload-locks collection
PatrikKozak Aug 18, 2024
9fd3b65
feat: adds DocumentLockProvider & locks document when editing
PatrikKozak Aug 18, 2024
583520c
Merge branch 'beta' of https://github.com/payloadcms/payload into fea…
PatrikKozak Aug 18, 2024
f8414e3
chore(db-postgres): localized joins
DanRibbens Aug 19, 2024
b63a37a
chore: fix build error
DanRibbens Aug 20, 2024
905e91a
feat: adds document-locked & document-take-over modal
PatrikKozak Aug 20, 2024
6ec24ef
Merge branch 'beta' of https://github.com/payloadcms/payload into fea…
PatrikKozak Aug 20, 2024
fb0a2fa
chore(db-drizzle): abstract build order by to function
DanRibbens Aug 20, 2024
f59b7f7
chore: merge beta
DanRibbens Aug 20, 2024
7c7c571
chore: fix types after merge
DanRibbens Aug 20, 2024
8b094c1
Merge branch 'beta' into feat/join-field
jacobsfletch Aug 22, 2024
f69b51e
Merge branch 'feat/field-tables' into feat/join-field
jacobsfletch Aug 22, 2024
39a2ea3
renames to RelationshipTable component and moves to components dir
jacobsfletch Aug 22, 2024
7292cb3
wires relationship table component into join field
jacobsfletch Aug 22, 2024
9a124a8
adds support for beforeRows in table columns provider and renders col…
jacobsfletch Aug 22, 2024
3039aa6
chore: merge beta
DanRibbens Aug 22, 2024
f064743
wires default cell into relationship table
jacobsfletch Aug 22, 2024
e439fba
chore: locked-document progress
PatrikKozak Aug 22, 2024
a3c9278
supports join cells
jacobsfletch Aug 22, 2024
741f30a
sets proper depth param
jacobsfletch Aug 22, 2024
457dac6
adds compact appearance to table
jacobsfletch Aug 22, 2024
07d819e
fixes joins test config
jacobsfletch Aug 22, 2024
cc9c73d
feat: correctly fire to form-state on a 10 second interval
PatrikKozak Aug 22, 2024
1832d28
removes list drawer and adds column selector
jacobsfletch Aug 22, 2024
bd5234c
fixes api query
jacobsfletch Aug 22, 2024
b5f4bad
chore: simplify joins with afterRead field hook
DanRibbens Aug 22, 2024
4862443
Merge branch 'feat/join-field' of github.com:payloadcms/payload into …
DanRibbens Aug 22, 2024
58a5566
chore: fix drizzle build
DanRibbens Aug 22, 2024
07d1829
feat: renders take over modal only once new user starts editing
PatrikKozak Aug 23, 2024
8c096d1
chore: destructures state where getFormState is called
PatrikKozak Aug 23, 2024
495d12e
Merge branch 'beta' of https://github.com/payloadcms/payload into fea…
PatrikKozak Aug 23, 2024
811cce6
chore: fix build
DanRibbens Aug 23, 2024
7948755
Merge branch 'beta' into feat/join-field
jacobsfletch Aug 23, 2024
9b5b90b
wires column sort
jacobsfletch Aug 23, 2024
1004275
chore: add where support to joins
DanRibbens Aug 23, 2024
b60a388
Merge branch 'feat/join-field' of github.com:payloadcms/payload into …
DanRibbens Aug 23, 2024
86797ad
chore: revert simple approach
DanRibbens Aug 23, 2024
b5638ca
updates parent field when in drawer updates
jacobsfletch Aug 23, 2024
1cd3201
fixes cell props lookup
jacobsfletch Aug 23, 2024
7b3d7e5
chore: localized joins working in pg
jmikrut Aug 23, 2024
7fdae3f
extracts RenderCell component
jacobsfletch Aug 23, 2024
68eb05c
chore: merge
jmikrut Aug 23, 2024
3cff24e
chore: remove deprecated relationship objectid plugin
jmikrut Aug 23, 2024
2761b0c
chore: removes unused files
jmikrut Aug 23, 2024
a5a0d83
chore: initiates aggregate pagination for joins
jmikrut Aug 23, 2024
2e2ca0e
chore: wip join aggregation
DanRibbens Aug 23, 2024
bb714bd
prefills document drawer from relationship table
jacobsfletch Aug 26, 2024
c24b63f
closes drawer on create
jacobsfletch Aug 26, 2024
5211f58
feat: adds Locked component & translations for DocumentLocked comp & …
PatrikKozak Aug 26, 2024
184698e
feat: adds Locked comp and take over button to document-controls comp
PatrikKozak Aug 26, 2024
926d32c
feat: updates new collection name to payload-locked-documents
PatrikKozak Aug 26, 2024
2a4e429
feat: prevents locked documents from being selected in the list view
PatrikKozak Aug 26, 2024
7b8efde
Merge branch 'beta' of https://github.com/payloadcms/payload into fea…
PatrikKozak Aug 26, 2024
b726401
feat: adds editingTakenOver to translations for DocumentTakeOver modal
PatrikKozak Aug 26, 2024
2d278ff
Merge branch 'beta' of https://github.com/payloadcms/payload into fea…
PatrikKozak Aug 26, 2024
2ddee47
chore: wip aggregation
DanRibbens Aug 26, 2024
83c26b4
chore: wip aggregation
DanRibbens Aug 26, 2024
f8011cf
commits
jacobsfletch Aug 26, 2024
6dd4f71
fix move columns
jacobsfletch Aug 27, 2024
b7b9a75
Merge branch 'beta' into feat/join-field
jacobsfletch Aug 27, 2024
9acdb07
properly closes drawers on create and update
jacobsfletch Aug 27, 2024
2d55d81
removes loading overlay
jacobsfletch Aug 27, 2024
d66dd2f
adaptive chevron icon and condensed sort controls
jacobsfletch Aug 27, 2024
c647f67
collapses table borders
jacobsfletch Aug 27, 2024
00b114a
feat: handles global document locking
PatrikKozak Aug 27, 2024
0f16708
chore(db-mongodb): wip simple pagination
DanRibbens Aug 27, 2024
9fda6fd
Merge branch 'beta' of https://github.com/payloadcms/payload into fea…
PatrikKozak Aug 27, 2024
dc87a6e
removes unnecessary reassignLinkColumn loop from table columns provid…
jacobsfletch Aug 27, 2024
cb69a89
chore(db-mongodb): tests passing
DanRibbens Aug 27, 2024
b4cd256
chore: building again
DanRibbens Aug 27, 2024
6976742
## Description
DanRibbens Aug 27, 2024
58b8b5c
chore: fix relationship population promise
DanRibbens Aug 27, 2024
f2eab0e
chore: fix relationship population promise for uploads
DanRibbens Aug 27, 2024
e8d834a
restructures test suite and scaffolds initial e2e test
jacobsfletch Aug 27, 2024
c2c7c28
Merge branch 'beta' into feat/join-field
jacobsfletch Aug 27, 2024
06393fd
sanitizes joins from client collecton config
jacobsfletch Aug 28, 2024
85f8055
Merge branch 'beta' into feat/join-field
jacobsfletch Aug 28, 2024
0932014
chore: fix mongodb querying by object id
DanRibbens Aug 28, 2024
ed5c3b0
chore: fix traversefields tabs object
DanRibbens Aug 28, 2024
7d433ab
chore: fix relationship population error
DanRibbens Aug 28, 2024
f027e05
chore: relationship population type error
DanRibbens Aug 28, 2024
3827656
scaffolds more e2e tests
jacobsfletch Aug 28, 2024
5050db7
passing tests
jacobsfletch Aug 28, 2024
eeabfbc
Merge branch 'beta' into feat/join-field
jacobsfletch Aug 28, 2024
f6cfa31
restores moveColumn callback
jacobsfletch Aug 28, 2024
89612aa
feat: removes polling & updates user off of form-state in onChange call
PatrikKozak Aug 28, 2024
281ba92
Merge branch 'beta' of https://github.com/payloadcms/payload into fea…
PatrikKozak Aug 28, 2024
1fe4cff
nav icon sizing
jacobsfletch Aug 28, 2024
b615a29
adds test for relationship table sort
jacobsfletch Aug 28, 2024
a80112d
adds more e2e tests
jacobsfletch Aug 28, 2024
f2fc0d9
chore(db-mongodb): fix sanitizeQueryValue of array of ids
DanRibbens Aug 28, 2024
3b79faa
Merge branch 'beta' into feat/join-field
jacobsfletch Aug 28, 2024
b2e9db1
chore: update join names int test
DanRibbens Aug 28, 2024
1aee035
chore: fix sanitizeQueryValue to handle arrays of ids
DanRibbens Aug 28, 2024
f93b5e5
fixes query when creating new and adjusts tests
jacobsfletch Aug 28, 2024
543cbc4
adjusts e2e tests
jacobsfletch Aug 28, 2024
f46baf2
Merge branch 'beta' into feat/join-field
jacobsfletch Aug 29, 2024
3fe58f6
feat: more translations & updates to effects
PatrikKozak Aug 29, 2024
33c8a60
Merge branch 'beta' of https://github.com/payloadcms/payload into fea…
PatrikKozak Aug 29, 2024
c0239d5
Merge branch 'beta' into feat/join-field
jacobsfletch Aug 29, 2024
8ed8002
adds back env lookup for db uri in tests so they can connect in ci
jacobsfletch Aug 29, 2024
f168ef4
adds back website template lockfile
jacobsfletch Aug 29, 2024
a7ddc96
Merge branch 'beta' into feat/join-field
jacobsfletch Aug 29, 2024
dc65c29
uses deepmerge for cell props
jacobsfletch Aug 29, 2024
a805e14
Merge branch 'beta' into feat/join-field
jacobsfletch Aug 29, 2024
0d78577
Merge branch 'beta' into feat/join-field
jacobsfletch Aug 29, 2024
ab8b931
uses deepmergesimple
jacobsfletch Aug 29, 2024
6fc89e8
feat: locking and updating functionality & adds proper reset timer
PatrikKozak Aug 29, 2024
b402b81
Merge branch 'beta' of https://github.com/payloadcms/payload into fea…
PatrikKozak Aug 29, 2024
d6abec9
feat: disables document locking if lockWhenEditing is false
PatrikKozak Aug 29, 2024
74aeed1
prevents unnecessary api requests and wires pagination
jacobsfletch Aug 29, 2024
ee14b8b
chore: fix build
PatrikKozak Aug 29, 2024
8f872ef
Merge branch 'beta' of https://github.com/payloadcms/payload into fea…
PatrikKozak Aug 29, 2024
1f412f8
loads initial data client-side
jacobsfletch Aug 30, 2024
6ae7ffc
Merge branch 'beta' into feat/join-field
jacobsfletch Aug 30, 2024
3b58e44
regenerates lockfile
jacobsfletch Aug 30, 2024
9b004e3
resolves leftover merge conflicts
jacobsfletch Aug 30, 2024
e75980d
Merge branch 'beta' of https://github.com/payloadcms/payload into fea…
PatrikKozak Aug 30, 2024
3f5cd79
chore: merge beta
PatrikKozak Aug 30, 2024
e616a45
Merge branch 'beta' of https://github.com/payloadcms/payload into fea…
PatrikKozak Aug 30, 2024
4e100f3
chore: adds locked-documents test suite
PatrikKozak Aug 30, 2024
0db687f
chore: adds optional chaining to lockWhenEditing prop
PatrikKozak Aug 30, 2024
d71b3e2
Merge branch 'beta' of https://github.com/payloadcms/payload into fea…
PatrikKozak Aug 30, 2024
2a7aab0
chore: join postgres simple pagination
DanRibbens Aug 30, 2024
e115860
feat: simplifies document locking & unlocking handling
PatrikKozak Sep 2, 2024
8640fc7
Merge branch 'beta' of https://github.com/payloadcms/payload into fea…
PatrikKozak Sep 2, 2024
3404dc9
chore: undo lint fixes in db packages
PatrikKozak Sep 3, 2024
af543d4
Merge branch 'beta' of https://github.com/payloadcms/payload into fea…
PatrikKozak Sep 3, 2024
99412fe
feat: build publish single locale functionality
JessChowdhury Sep 3, 2024
b370181
Merge branch 'beta' of https://github.com/payloadcms/payload into fea…
PatrikKozak Sep 3, 2024
f957e4d
chore: merge beta
DanRibbens Sep 3, 2024
89c76bd
chore: remove page and pagination from joins JoinQuery type
DanRibbens Sep 3, 2024
9830f52
chore(db-postgres): handle where and limit for joins
DanRibbens Sep 3, 2024
35c7e3e
feat: prevent updating / deleting of documents using the local API wh…
PatrikKozak Sep 3, 2024
9543afc
Merge branch 'beta' of https://github.com/payloadcms/payload into fea…
PatrikKozak Sep 3, 2024
9267678
chore(db-mongodb): remove pagination from build join
DanRibbens Sep 3, 2024
ec2e262
chore: reverts buildConfigWithDefaults
PatrikKozak Sep 4, 2024
d2577a6
chore: fix version tests
JessChowdhury Sep 4, 2024
3d924a7
chore: merge conflicts
JessChowdhury Sep 4, 2024
8d61179
chore: reverts type updates for _community test suite
PatrikKozak Sep 4, 2024
103777f
chore(db-mongodb): limit saveVersion to 1 latestDocs query
DanRibbens Sep 4, 2024
ba27fba
chore(db-mongodb): fix updateMany latest query for createVersions
DanRibbens Sep 4, 2024
1af547d
chore: merge beta
DanRibbens Sep 4, 2024
31bba1f
chore: merge conflict
JessChowdhury Sep 4, 2024
b034291
feat: removes doc from payload-locked-documents after update
PatrikKozak Sep 4, 2024
32102fa
Merge branch 'beta' of https://github.com/payloadcms/payload into fea…
PatrikKozak Sep 4, 2024
9168a1e
chore(db-mongodb): fix relationship querying
DanRibbens Sep 4, 2024
859a72a
chore: more test updates
JessChowdhury Sep 4, 2024
505dd09
chore(db-mongodb): fix localized relationship sanitization
DanRibbens Sep 4, 2024
a6cb6cc
feat: handle global updating of locked documents
PatrikKozak Sep 4, 2024
a3d6256
chore: reintroduce editedAt date for DocumentLocked modal
PatrikKozak Sep 4, 2024
63dd6ad
chore: add next to traverseFields callback allowing skipping of subfi…
DanRibbens Sep 4, 2024
7ee7156
Merge branch 'beta' into feat/publish-single-locale
JessChowdhury Sep 5, 2024
4b4c267
chore: adds locked-documents e2e tests
PatrikKozak Sep 5, 2024
1e33397
Merge branch 'beta' of https://github.com/payloadcms/payload into fea…
PatrikKozak Sep 5, 2024
b824e95
chore: handles lock icon for light & dark mode
PatrikKozak Sep 6, 2024
7322e61
Merge branch 'beta' of https://github.com/payloadcms/payload into fea…
PatrikKozak Sep 6, 2024
08dcabe
chore: add wait to allow proper unlock in field-error-state test
PatrikKozak Sep 6, 2024
14272ce
chore: fixes bug in delete & update oeprations not properly deleting …
PatrikKozak Sep 6, 2024
042c1d8
feat: adds int tests for locked-documents
PatrikKozak Sep 6, 2024
a860019
Merge branch 'beta' of https://github.com/payloadcms/payload into fea…
PatrikKozak Sep 6, 2024
9b38350
chore: adds corresponding documentation
PatrikKozak Sep 6, 2024
185c38e
Merge branch 'beta' of https://github.com/payloadcms/payload into fea…
PatrikKozak Sep 6, 2024
7a72dc7
fix: renders version based on latest over updatedAt
JessChowdhury Sep 6, 2024
4f76459
Merge branch 'beta' into feat/publish-single-locale
JessChowdhury Sep 6, 2024
4979a4c
chore: fix version test
JessChowdhury Sep 6, 2024
eb41dc2
chore: fix version e2e test
JessChowdhury Sep 9, 2024
c13899a
Merge branch 'beta' into feat/publish-single-locale
JessChowdhury Sep 9, 2024
7e1b3e8
chore: update int test names for locked-documents
PatrikKozak Sep 9, 2024
ba8a19a
Merge branch 'beta' of https://github.com/payloadcms/payload into fea…
PatrikKozak Sep 9, 2024
bc2763f
chore: revert link button changes in richtext-slate
PatrikKozak Sep 9, 2024
8265bf7
fix: deletes docs using db operations
PatrikKozak Sep 10, 2024
df85ebd
fix: added handling for relationships where newCollectionPath was an …
PatrikKozak Sep 10, 2024
b2ab773
chore: cleans up int tests for locked-documents
PatrikKozak Sep 10, 2024
f6adba3
Merge branch 'beta' of https://github.com/payloadcms/payload into fea…
PatrikKozak Sep 10, 2024
55cb09c
chore: fix traverseFields undefined arrays
DanRibbens Sep 10, 2024
552d199
chore: merge beta
DanRibbens Sep 10, 2024
07052cf
resolves linting errors
jacobsfletch Sep 10, 2024
5bc4836
fixes build errors
jacobsfletch Sep 10, 2024
97f98be
chore: create checkDocumentLockStatus function
PatrikKozak Sep 11, 2024
af5ac4d
Merge branch 'beta' of https://github.com/payloadcms/payload into fea…
PatrikKozak Sep 11, 2024
a31ea87
chore: remove extra properties types from join field
DanRibbens Sep 11, 2024
630fbbe
chore: return early in checkDocumentLockStatus if locking is disabled
PatrikKozak Sep 11, 2024
b006beb
Merge branch 'beta' of https://github.com/payloadcms/payload into fea…
PatrikKozak Sep 11, 2024
e631c70
fix: queries with in operator for document value
PatrikKozak Sep 11, 2024
7a203ab
Merge branch 'beta' of https://github.com/payloadcms/payload into fea…
PatrikKozak Sep 11, 2024
9819380
Merge branch 'beta' into feat/join-field
jacobsfletch Sep 11, 2024
ae7f52f
chore: improve join sanitization error
DanRibbens Sep 12, 2024
7be0230
chore: casts id columns to text
PatrikKozak Sep 12, 2024
129b9e1
Merge branch 'beta' of https://github.com/payloadcms/payload into fea…
PatrikKozak Sep 12, 2024
207dead
chore: workaround for postgres and sqlite adapeters
PatrikKozak Sep 12, 2024
4728738
Merge branch 'beta' of https://github.com/payloadcms/payload into fea…
PatrikKozak Sep 12, 2024
c20abdc
chore: fix build
DanRibbens Sep 12, 2024
abdde4d
Merge branch 'feat/join-field' of github.com:payloadcms/payload into …
DanRibbens Sep 12, 2024
12c6f55
chore: joins default maxLimit 1
DanRibbens Sep 12, 2024
915e540
chore: remove hidden property for joins
DanRibbens Sep 12, 2024
863cc89
docs: joins
DanRibbens Sep 12, 2024
0e1e6b4
fix: polymorphic relationship querying with different relationTo ID t…
PatrikKozak Sep 12, 2024
09bbbcc
Merge branch 'beta' of https://github.com/payloadcms/payload into fea…
PatrikKozak Sep 12, 2024
626b8e3
Merge branch 'beta' into feat/join-field
jacobsfletch Sep 12, 2024
9c9afe2
Merge branch 'beta' of https://github.com/payloadcms/payload into fea…
PatrikKozak Sep 13, 2024
4c537c3
test: adds e2e test for list view bulk delete
PatrikKozak Sep 13, 2024
4533c01
chore: handle localized arrays traverse fields
DanRibbens Sep 13, 2024
6252ab2
chore(db-sqlite): add join field schema
DanRibbens Sep 13, 2024
107d4fe
Merge branch 'beta' into feat/join-field
DanRibbens Sep 13, 2024
964d1ea
chore: filter out collections that are not GraphQL enabled in buildOb…
PatrikKozak Sep 13, 2024
861c8ad
Merge branch 'beta' of https://github.com/payloadcms/payload into fea…
PatrikKozak Sep 13, 2024
20439ba
chore(db-mongodb): sanitize relationship object queries
DanRibbens Sep 13, 2024
7e6470f
Merge remote-tracking branch 'origin/feat/beta/locked-document' into …
DanRibbens Sep 13, 2024
a5d05ad
chore: merge feat/publish-single-locale
DanRibbens Sep 13, 2024
0374de4
chore: merge feat/join-field
DanRibbens Sep 13, 2024
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
1 change: 0 additions & 1 deletion .github/workflows/pr-title.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ jobs:
plugin-form-builder
plugin-nested-docs
plugin-redirects
plugin-relationship-object-ids
plugin-search
plugin-sentry
plugin-seo
Expand Down
7 changes: 7 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,13 @@
"request": "launch",
"type": "node-terminal"
},
{
"command": "node --no-deprecation test/dev.js locked-documents",
"cwd": "${workspaceFolder}",
"name": "Run Dev Locked Documents",
"request": "launch",
"type": "node-terminal"
},
{
"command": "node --no-deprecation test/dev.js uploads",
"cwd": "${workspaceFolder}",
Expand Down
3 changes: 2 additions & 1 deletion docs/configuration/collections.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,13 @@ The following options are available:
| **`custom`** | Extension point for adding custom data (e.g. for plugins) |
| **`disableDuplicate`** | When true, do not show the "Duplicate" button while editing documents within this Collection and prevent `duplicate` from all APIs. |
| **`defaultSort`** | Pass a top-level field to sort by default in the Collection List View. Prefix the name of the field with a minus symbol ("-") to sort in descending order. |
| **`dbName`** | Custom table or Collection name depending on the Database Adapter. Auto-generated from slug if not defined. |
| **`dbName`** | Custom table or Collection name depending on the Database Adapter. Auto-generated from slug if not defined. |
| **`endpoints`** | Add custom routes to the REST API. Set to `false` to disable routes. [More details](../rest-api/overview#custom-endpoints). |
| **`fields`** \* | Array of field types that will determine the structure and functionality of the data stored within this Collection. [More details](../fields/overview). |
| **`graphQL`** | An object with `singularName` and `pluralName` strings used in schema generation. Auto-generated from slug if not defined. Set to `false` to disable GraphQL. |
| **`hooks`** | Entry point for Hooks. [More details](../hooks/overview#collection-hooks). |
| **`labels`** | Singular and plural labels for use in identifying this Collection throughout Payload. Auto-generated from slug if not defined. |
| **`lockWhenEditing`** | Enables or disables the ability to lock documents while they are being edited. When set to `true` (default), the document is locked upon editing, preventing others from making changes until the lock is released. You can pass an object to this property to configure the `lockDuration` in seconds, which defines how long the document remains locked without user interaction. If no edits are made within the specified time (default: 300 seconds), the lock expires, allowing other users to edit or delete the document. Set to `false` to disable document locking entirely. |
| **`slug`** \* | Unique, URL-friendly string that will act as an identifier for this Collection. |
| **`timestamps`** | Set to false to disable documents' automatically generated `createdAt` and `updatedAt` timestamps. |
| **`typescript`** | An object with property `interface` as the text used in schema generation. Auto-generated from slug if not defined. |
Expand Down
31 changes: 16 additions & 15 deletions docs/configuration/globals.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -65,21 +65,22 @@ export const Nav: GlobalConfig = {

The following options are available:

| Option | Description |
| ------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **`access`** | Provide Access Control functions to define exactly who should be able to do what with this Global. [More details](../access-control/globals). |
| **`admin`** | The configuration options for the Admin Panel. [More details](../admin/globals). |
| **`custom`** | Extension point for adding custom data (e.g. for plugins) |
| **`dbName`** | Custom table or collection name for this Global depending on the Database Adapter. Auto-generated from slug if not defined. |
| **`description`** | Text or React component to display below the Global header to give editors more information. |
| **`endpoints`** | Add custom routes to the REST API. [More details](../rest-api/overview#custom-endpoints). |
| **`fields`** \* | Array of field types that will determine the structure and functionality of the data stored within this Global. [More details](../fields/overview). |
| **`graphQL.name`** | Text used in schema generation. Auto-generated from slug if not defined. |
| **`hooks`** | Entry point for Hooks. [More details](../hooks/overview#global-hooks). |
| **`label`** | Text for the name in the Admin Panel or an object with keys for each language. Auto-generated from slug if not defined. |
| **`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). |
| Option | Description |
| --------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **`access`** | Provide Access Control functions to define exactly who should be able to do what with this Global. [More details](../access-control/globals). |
| **`admin`** | The configuration options for the Admin Panel. [More details](../admin/globals). |
| **`custom`** | Extension point for adding custom data (e.g. for plugins) |
| **`dbName`** | Custom table or collection name for this Global depending on the Database Adapter. Auto-generated from slug if not defined. |
| **`description`** | Text or React component to display below the Global header to give editors more information. |
| **`endpoints`** | Add custom routes to the REST API. [More details](../rest-api/overview#custom-endpoints). |
| **`fields`** \* | Array of field types that will determine the structure and functionality of the data stored within this Global. [More details](../fields/overview). |
| **`graphQL.name`** | Text used in schema generation. Auto-generated from slug if not defined. |
| **`hooks`** | Entry point for Hooks. [More details](../hooks/overview#global-hooks). |
| **`label`** | Text for the name in the Admin Panel or an object with keys for each language. Auto-generated from slug if not defined. |
| **`lockWhenEditing`** | Enables or disables the ability to lock documents while they are being edited. When set to `true` (default), the document is locked upon editing, preventing others from making changes until the lock is released. You can pass an object to this property to configure the `lockDuration` in seconds, which defines how long the document remains locked without user interaction. If no edits are made within the specified time (default: 300 seconds), the lock expires, allowing other users to edit or delete the document. Set to `false` to disable document locking entirely. |
| **`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). |

_\* An asterisk denotes that a property is required._

Expand Down
140 changes: 140 additions & 0 deletions docs/fields/join.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
---
title: Join Field
label: Join
order: 140
desc: The Join field provides the ability to work on related documents. Learn how to use Join field, see examples and options.
keywords: join, relationship, junction, fields, config, configuration, documentation, Content Management System, cms, headless, javascript, node, react, nextjs
---

The Join Field is used to make Relationship fields in the opposite direction. It is used to show the relationship from
the other side. The field itself acts as a virtual field, in that no new data is stored on the collection with a Join
field. Instead, the Admin UI surfaces the related documents for a better editing experience and is surfaced by Payload's APIs.

The Join field is useful in scenarios including:

- To see related `Products` on an `Order`
- To view and edit `Posts` belonging to a `Category`
- To work with any bi-directional relationship data

For the Join field to work, you must have an existing [relationship](./relationship) field in the collection you are
joining. This will reference the collection and path of the field of the related documents.
To add a Relationship Field, set the `type` to `join` in your [Field Config](./overview):

```ts
import type { Field } from 'payload/types'

export const MyJoinField: Field = {
// highlight-start
name: 'relatedPosts',
type: 'join',
collection: 'posts',
on: 'category',
// highlight-end
}

// relationship field in another collection:
export const MyRelationshipField: Field = {
name: 'category',
type: 'relationship',
relationTo: 'categories',
}
```

In this example, the field is defined to show the related `posts` when added to a `category` collection. The `on` property is used to
specify the relationship field name of the field that relates to the collection document.

## Config Options

| Option | Description |
|------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **`name`** \* | To be used as the property name when retrieved from the database. [More](/docs/fields/overview#field-names) |
| **`collection`** \* | The `slug`s having the relationship field. |
| **`on`** \* | The relationship field name of the field that relates to collection document. Use dot notation for nested paths, like 'myGroup.relationName'. |
| **`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) |
| **`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). |
| **`localized`** | Enable localization for this field. Requires [localization to be enabled](/docs/configuration/localization) in the Base config. |
| **`required`** | Require this field to have a value. |
| **`admin`** | Admin-specific configuration. |
| **`custom`** | Extension point for adding custom data (e.g. for plugins) |
| **`typescriptSchema`** | Override field type generation with providing a JSON schema |

_\* An asterisk denotes that a property is required._

## Join Field Data

When a document is returned that for a Join field is populated with related documents. The structure returned is an object with:

- `docs` an array of related documents or only IDs if the depth is reached
- `hasNextPage` a boolean indicating if there are additional documents

```json
{
"id": "66e3431a3f23e684075aae9c",
"relatedPosts": {
"docs": [
{
"id": "66e3431a3f23e684075aaeb9",
// other fields...
"category": "66e3431a3f23e684075aae9c",
},
// { ... }
],
"hasNextPage": false
},
// other fields...
}
```

## Query Options

The Join Field supports custom queries to filter, sort, and limit the related documents that will be returned. In addition to the specific query options for each Join Field, you can pass `joins: false` to disable all Join Field from returning. This is useful for performance reasons when you don't need the related documents.

The following query options are supported:

| Property | Description |
|-------------|--------------------------------------------------------------|
| **`limit`** | The maximum related documents to be returned, default is 10. |
| **`where`** | An optional `Where` query to filter joined documents. |
| **`sort`** | A string used to order related results |

These can be applied to the local API, GraphQL, and REST API.

### Local API

By adding `joins` to the local API you can customize the request for each join field by the `name` of the field.

```js
const result = await db.findOne('categories', {
where: {
title: {
equals: 'My Category'
}
},
joins: {
relatedPosts: {
limit: 5,
where: {
title: {
equals: 'My Post'
}
},
sort: 'title'
}
}
})
```

### Rest API

The rest API supports the same query options as the local API. You can use the `joins` query parameter to customize the request for each join field by the `name` of the field. For example, an API call to get a document with the related posts limited to 5 and sorted by title:

`/api/categories/${id}?joins[relatedPosts][limit]=5&joins[relatedPosts][sort]=title`

You can specify as many `joins` parameters as needed for the same or different join fields for a single request.

### GraphQL

Coming soon.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
"build:plugin-form-builder": "turbo build --filter \"@payloadcms/plugin-form-builder\"",
"build:plugin-nested-docs": "turbo build --filter \"@payloadcms/plugin-nested-docs\"",
"build:plugin-redirects": "turbo build --filter \"@payloadcms/plugin-redirects\"",
"build:plugin-relationship-object-ids": "turbo build --filter \"@payloadcms/plugin-relationship-object-ids\"",
"build:plugin-search": "turbo build --filter \"@payloadcms/plugin-search\"",
"build:plugin-sentry": "turbo build --filter \"@payloadcms/plugin-sentry\"",
"build:plugin-seo": "turbo build --filter \"@payloadcms/plugin-seo\"",
Expand Down
3 changes: 2 additions & 1 deletion packages/db-mongodb/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,14 @@
"bson-objectid": "2.0.4",
"http-status": "1.6.2",
"mongoose": "6.12.3",
"mongoose-aggregate-paginate-v2": "1.0.6",
"mongoose-paginate-v2": "1.7.22",
"prompts": "2.4.2",
"uuid": "10.0.0"
},
"devDependencies": {
"@payloadcms/eslint-config": "workspace:*",
"@types/mongoose-aggregate-paginate-v2": "1.0.9",
"@types/mongoose-aggregate-paginate-v2": "1.0.6",
"mongodb": "4.17.1",
"mongodb-memory-server": "^9",
"payload": "workspace:*"
Expand Down
Loading
Loading