Compare commits

...

1342 Commits

Author SHA1 Message Date
Elliot DeNolf
e3ef443217 chore(release): db-postgres/0.1.2 2023-10-10 15:57:51 -04:00
Elliot DeNolf
a42e84bbb2 chore(eslint): prepare config for publishing 2023-10-10 15:10:22 -04:00
James Mikrut
470bdb72ff Merge pull request #3553 from payloadcms/fix/#3541
fix: #3541
2023-10-10 14:49:11 -04:00
James Mikrut
5c36be949c Merge pull request #3554 from payloadcms/fix/#3540
fix: #3540
2023-10-10 14:49:01 -04:00
James
2567ac58ba fix: #3540 2023-10-10 14:21:12 -04:00
Jacob Fletcher
9ff014bbfe fix: row field width (#3550) 2023-10-10 14:09:47 -04:00
James
e6f0d35985 fix: #3541 2023-10-10 14:07:26 -04:00
Alessio Gravili
b1e449e005 Merge pull request #3551 from payloadcms/fix/slate-toolbar
fix: Slate toolbar rendered even if it has no elements and leaves
2023-10-10 19:36:29 +02:00
Alessio Gravili
9ae585d23c fix: Slate toolbar rendered even if it has no elements and leaves 2023-10-10 19:22:08 +02:00
Elliot DeNolf
9de3320933 chore(release): richtext-lexical/0.1.5 2023-10-10 12:08:13 -04:00
Elliot DeNolf
5d429fa7ae chore(release): live-preview-react/0.1.2 2023-10-10 12:08:08 -04:00
Elliot DeNolf
dc8f1925f0 chore(release): live-preview/0.1.2 2023-10-10 12:07:40 -04:00
Jessica Chowdhury
15f650afde docs: adds build your own plugin page (#3184)
* docs: adds build your own plugin page

* chore(docs): adds npx command to plugin template doc

* docs: update plugin doc order values

* docs: update plugin admin compatibility to coming soon

---------

Co-authored-by: Elliot DeNolf <denolfe@gmail.com>
2023-10-10 11:37:53 -04:00
Jacob Fletcher
c945384d63 fix(live-preview-react): moves react to peer dependencies (#3545) 2023-10-10 11:36:44 -04:00
Jacob Fletcher
dfada1b238 chore(live-preview): removes react dependencies (#3544) 2023-10-10 11:07:18 -04:00
Elliot DeNolf
229bdda2c1 chore: rename publish script 2023-10-10 10:48:51 -04:00
Alessio Gravili
a1d51fb410 Merge pull request #3543 from payloadcms/fix/lexical-blocks-validation
fix(richtext-lexical): blocks: missing properties passed into validation calls
2023-10-10 16:41:39 +02:00
Alessio Gravili
46430f5598 chore: prefer config.collections over payload.collections for validations 2023-10-10 16:20:11 +02:00
Alessio Gravili
e41899cd27 fix(richtext-lexical): missing properties passed into validation functions 2023-10-10 16:06:39 +02:00
Elliot DeNolf
890af8be05 ci: optimize e2e and refactor workflow (#3530)
* ci: split e2e

* chore: 3 parts

* chore: use matrix

* chore: use playwright container, bump playwright

* chore: remove playwright container

* ci: move all packages into matrix

* ci: reusable action to restore build cache

* chore: revert custom action

* chore: cleanup logs
2023-10-09 23:43:34 -04:00
Tylan Davis
8bfae6b932 docs: removes MONGODB_URI (#3482) 2023-10-09 18:07:09 -04:00
Jacob Fletcher
ace3e577f6 fix: renders global label as page title (#3532) 2023-10-09 17:58:21 -04:00
Marcus R
9198245ad9 docs(configuration/collections): moves pagination options to admin config (#3533) 2023-10-09 17:55:34 -04:00
Jarrod Flesch
f0095937ba fix: increases document controls popup list button hitbox (#3529) 2023-10-09 16:44:57 -04:00
Jarrod Flesch
0bbd7137cd chore: properly clear cart with correct data shape (#3500) 2023-10-09 16:29:15 -04:00
Thomas Dudziak
ffed34cf27 chore(docs): corrects bundler package import paths (#3523) 2023-10-09 16:03:16 -04:00
Elliot DeNolf
040f3a34d1 chore(release): payload@2.0.3 2023-10-09 15:27:26 -04:00
Elliot DeNolf
0985825b08 fix(templates/website): account view query 2023-10-09 15:25:56 -04:00
Alessio Gravili
c18d3b5f0e Merge pull request #3522 from payloadcms/chore/lexical-heading-node-improvements
fix(richtext-lexical): respect enabledHeadingSizes for markdown transformers
2023-10-09 21:22:52 +02:00
Alessio Gravili
e9e25ceac9 fix(richtext-lexical): respect enabledHeadingSizes for markdown transformers 2023-10-09 21:21:37 +02:00
James
35aed59a1a Merge branch 'main' of github.com:payloadcms/payload 2023-10-09 14:44:27 -04:00
James
26002173b1 chore: streamlines args necessary for entityToJSONSchema 2023-10-09 14:42:29 -04:00
Elliot DeNolf
41d968771e chore(release): bundler-webpack@1.0.2 2023-10-09 14:36:39 -04:00
James
26c34541d2 chore: merge 2023-10-09 14:31:31 -04:00
James
263d40d169 chore: adds safety to type generation 2023-10-09 14:31:02 -04:00
James Mikrut
6ced11d44d Merge pull request #3519 from payloadcms/fix/#3494
fix: #3494
2023-10-09 14:25:10 -04:00
James
be049cea00 fix: #3494 2023-10-09 14:24:20 -04:00
Jacob Fletcher
491e50c236 docs(admin/components): removes duplicative link 2023-10-09 14:15:59 -04:00
Jacob Fletcher
ad253db691 chore(examples/redirect): removes build files 2023-10-09 14:13:16 -04:00
Elliot DeNolf
aff5fdff8a chore(release): richtext-lexical@0.1.4 2023-10-09 14:09:17 -04:00
Alessio Gravili
aa97bebbd4 Merge pull request #3518 from payloadcms/chore/export-more-richtext-lexical
chore(richtext-lexical): export utils
2023-10-09 20:07:42 +02:00
Alessio Gravili
a2410ea9fc chore(richtext-lexical): export utils 2023-10-09 20:07:07 +02:00
Jacob Fletcher
de20ef1e8d chore(examples/form-builder): migrates to 2.0 (#3516) 2023-10-09 14:03:39 -04:00
Jacob Fletcher
08f7497040 chore(examples/redirects): migrates to 2.0 (#3514) 2023-10-09 14:03:18 -04:00
James Mikrut
74e99ce251 Merge pull request #3517 from payloadcms/fix/#3504
fix: #3504
2023-10-09 14:03:02 -04:00
Jacob Fletcher
b5c56efb4b chore(examples/multi-tenant): migrates to 2.0 (#3512) 2023-10-09 14:02:44 -04:00
Jacob Fletcher
4ff6d63c94 chore(examples/custom-server): migrates to 2.0 (#3509) 2023-10-09 14:01:51 -04:00
James
c90d1faa7f fix: #3504 2023-10-09 14:01:12 -04:00
Jacob Fletcher
1848b120ce chore(examples/live-preview): pins payload to latest and regenerates types (#3507) 2023-10-09 14:01:08 -04:00
Jacob Fletcher
62679baa91 chore(examples/auth): migrates to 2.0 (#3506) 2023-10-09 14:00:38 -04:00
Jacob Fletcher
2de36550ae chore(examples/draft-preview): migrates to 2.0 (#3505) 2023-10-09 14:00:23 -04:00
James Mikrut
61ea5becbb Merge pull request #3515 from payloadcms/fix/#3513
fix: #3513, hasMany relationships unable to be cleared
2023-10-09 13:47:34 -04:00
James
5d9384f530 fix: #3513, hasMany relationships unable to be cleared 2023-10-09 13:46:41 -04:00
Elliot DeNolf
d75ffa0ea7 chore(release): richtext-lexical@0.1.3 2023-10-09 13:31:39 -04:00
Elliot DeNolf
26967fb924 docs: move payload script mention to top of migrations 2023-10-09 13:30:06 -04:00
Alessio Gravili
830d9867b6 chore(richtext-lexical): add build:clean script to package.json 2023-10-09 19:27:01 +02:00
Elliot DeNolf
2f86c196e1 docs: payload script in package.json 2023-10-09 13:18:01 -04:00
Alessio Gravili
86a35ed441 chore(richtext-lexical): improve handling of read-only lexical editors (#3510) 2023-10-09 18:47:09 +02:00
Jessica Boezwinkle
70e068b182 docs: updates required node version 2023-10-09 16:01:49 +01:00
Elliot DeNolf
4ac01a7fa3 chore(readme): add 2.0 announcement 2023-10-09 10:05:37 -04:00
Elliot DeNolf
8058a6d800 chore(readme): add migrating link 2023-10-09 09:26:57 -04:00
Elliot DeNolf
252b04097f chore(release): richtext-slate@1.0.1 2023-10-09 09:21:49 -04:00
Elliot DeNolf
23066aec71 chore(release): richtext-lexical@0.1.2 2023-10-09 09:21:37 -04:00
Elliot DeNolf
b9a595b00c chore(release): live-preview-react@0.1.1 2023-10-09 09:21:33 -04:00
Elliot DeNolf
ea49d74941 chore(release): live-preview@0.1.1 2023-10-09 09:21:27 -04:00
Elliot DeNolf
f5f41f929e chore(release): db-postgres@0.1.1 2023-10-09 09:21:17 -04:00
Elliot DeNolf
61151c9c5d chore(release): db-mongodb@1.0.2 2023-10-09 09:21:10 -04:00
Elliot DeNolf
c12c1a7472 chore(release): bundler-webpack@1.0.1 2023-10-09 09:21:04 -04:00
Elliot DeNolf
7afa1e999d chore(release): bundler-vite@0.1.2 2023-10-09 09:20:36 -04:00
Elliot DeNolf
71c41dbe03 chore: update main and types to dist 2023-10-09 09:16:46 -04:00
dependabot[bot]
a161dc7bb6 chore(deps): bump semver in /examples/live-preview/next-app (#3490)
Bumps [semver](https://github.com/npm/node-semver) from 6.3.0 to 6.3.1.
- [Release notes](https://github.com/npm/node-semver/releases)
- [Changelog](https://github.com/npm/node-semver/blob/v6.3.1/CHANGELOG.md)
- [Commits](https://github.com/npm/node-semver/compare/v6.3.0...v6.3.1)

---
updated-dependencies:
- dependency-name: semver
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-09 09:14:34 -04:00
Jacob Fletcher
6c17222a6a docs: improves custom views (#3499) 2023-10-09 09:14:09 -04:00
Elliot DeNolf
63bf7d9303 chore(release): payload@2.0.2 2023-10-09 09:04:44 -04:00
James Mikrut
f878135e8b Update CHANGELOG.md 2023-10-09 09:03:49 -04:00
James
11a77ae489 Merge branch 'main' of github.com:payloadcms/payload 2023-10-09 09:02:11 -04:00
James
e5d6a75449 fix: beforeOperation hooks now correctly only run once 2023-10-09 09:02:04 -04:00
Jessica Boezwinkle
3cb0d9c2ca docs: misc cleanup 2023-10-09 14:00:11 +01:00
Jacob Fletcher
229149a5a6 chore: removes console log 2023-10-09 08:56:08 -04:00
Elliot DeNolf
9006643102 chore(templates): fix website template error 2023-10-09 08:56:08 -04:00
Jacob Fletcher
25ae4a24f2 chore: consolidates admin view types 2023-10-09 08:56:08 -04:00
Alessio Gravili
501ec4464f chore(richtext-slate): export ElementButton, LeafButton and toggleElement 2023-10-09 14:50:19 +02:00
Elliot DeNolf
961505366a chore(release): payload@2.0.1 2023-10-09 08:20:21 -04:00
Elliot DeNolf
c54fb304e7 chore(release): richtext-lexical@0.1.1 2023-10-09 08:18:28 -04:00
Alessio Gravili
7679e3f0aa fix: richtext adapter types (#3497)
* fix: richtext adapter assignment types breaks in strict mode

* fix: generic type
2023-10-09 14:07:32 +02:00
Alessio Gravili
f7c35df6de docs(richtext): remove --save flag for install command 2023-10-09 14:06:11 +02:00
Jacob Fletcher
ca97f692c3 docs: updates live preview docs 2023-10-09 00:53:42 -04:00
James Mikrut
9244a2d25d Update CHANGELOG.md 2023-10-09 00:36:38 -04:00
Dan Ribbens
24f1965f69 Merge branch 'main' of github.com:payloadcms/payload 2023-10-09 00:33:47 -04:00
Dan Ribbens
d0c352cc62 chore: remove transaction logger warnings 2023-10-09 00:33:19 -04:00
Elliot DeNolf
c56e61023d chore: update changelog 2023-10-09 00:28:15 -04:00
James
ae03501753 Merge branch 'main' of github.com:payloadcms/payload 2023-10-09 00:23:06 -04:00
James
7b94fb75bb chore: shortens collection names in relationship test suite 2023-10-09 00:22:59 -04:00
Elliot DeNolf
e842c6624a chore(templates): use payload latest 2023-10-09 00:18:40 -04:00
Jacob Fletcher
2ddf15ce9a chore(examples/live-preview): adds live preview example (#3489) 2023-10-09 00:18:31 -04:00
James
7df1256bf6 docs: fixes label for rich text overview 2023-10-09 00:16:26 -04:00
Elliot DeNolf
c6e6f99868 chore(release): payload@2.0.0 2023-10-08 23:58:58 -04:00
Elliot DeNolf
fbbc0a3c67 chore(release): all remaining packages 2023-10-08 23:57:11 -04:00
Elliot DeNolf
ef24f430a2 chore(release): richtext-lexical@0.1.0 2023-10-08 23:57:11 -04:00
Elliot DeNolf
617ab76a22 chore(release): live-preview-react@0.1.0 2023-10-08 23:57:11 -04:00
Elliot DeNolf
9d9918e0fd chore(release): live-preview@0.1.0 2023-10-08 23:57:11 -04:00
Elliot DeNolf
e515712fcd chore(release): db-postgres@0.1.0 2023-10-08 23:57:11 -04:00
Elliot DeNolf
0ce08aab99 chore(release): bundler-vite@0.1.0 2023-10-08 23:57:11 -04:00
James
e398044442 docs: merge conflict 2023-10-08 23:56:50 -04:00
Dan Ribbens
7e5d322d6b chore(template): remove comments 2023-10-08 23:46:29 -04:00
Dan Ribbens
b04f6b2b5b Merge branch 'main' of github.com:payloadcms/payload 2023-10-08 23:45:25 -04:00
Dan Ribbens
36225d1455 chore(template): fix lint error in webpage template 2023-10-08 23:45:13 -04:00
Elliot DeNolf
c9fdcebb9e chore(templates): fix website template error 2023-10-08 23:38:20 -04:00
Dan Ribbens
5e6bec773f Merge branch 'main' of github.com:payloadcms/payload 2023-10-08 23:28:43 -04:00
Dan Ribbens
5ebe375743 chore (template): website template type error 2023-10-08 23:28:28 -04:00
Elliot DeNolf
25d20cf87b feat: 2.0 template updates (#3488)
* feat: update templates to 2.0 and support create-payload-app

* chore: rich text updates

* chore(templates): remove mongoURL

* chore: migrates rich text fields in website

* chore: manually aliases dotenv in templates

* chore: installs new beta in website template

* chore: type issues

* chore (template): add alias for fs to website template

* chore: more template updates

---------

Co-authored-by: James <james@trbl.design>
Co-authored-by: Dan Ribbens <dan.ribbens@gmail.com>
2023-10-08 23:23:51 -04:00
Elliot DeNolf
b32b156f9f chore: update README paths 2023-10-08 23:19:59 -04:00
Elliot DeNolf
fd38fa8209 chore: duplicate README to package dir 2023-10-08 23:15:27 -04:00
Elliot DeNolf
33bf4491a9 chore: update README 2023-10-08 23:11:43 -04:00
Elliot DeNolf
7ad9d777a2 chore(release): payload@2.0.0-beta.31 2023-10-08 22:45:11 -04:00
Alessio Gravili
92fdfbe333 chore(richtext-slate): export types 2023-10-09 04:38:14 +02:00
Alessio Gravili
27ba1fc79e docs(richtext): fix typos and other issues 2023-10-09 04:34:50 +02:00
Elliot DeNolf
bdbfc8c9af docs: remove mongoURL mentions 2023-10-08 22:26:40 -04:00
Elliot DeNolf
8c097ccaa7 chore(release): richtext-lexical@0.1.0-beta.7 2023-10-08 21:29:36 -04:00
Alessio Gravili
87d66dceb1 Merge pull request #3487 from payloadcms/chore/export-even-more-stuff
chore(richtext-lexical): export slash menu and floating toolbar-related stuff
2023-10-09 03:07:36 +02:00
Alessio Gravili
256fc6d178 chore(richtext-lexical): export slash menu and floating toolbar-related stuff 2023-10-09 03:06:50 +02:00
Dan Ribbens
74f8923922 fix: default rateLimit window changed from 1.5 to 15 minutes (#3486) 2023-10-08 20:37:32 -04:00
Elliot DeNolf
d9d4df22e5 chore(release): live-preview-react@1.0.0-beta.3 2023-10-08 20:13:06 -04:00
Elliot DeNolf
3161d3e552 chore(release): live-preview@1.0.0-beta.3 2023-10-08 20:13:06 -04:00
Elliot DeNolf
0acffa38eb chore(release): bundler-vite@0.1.0-beta.11 2023-10-08 20:13:05 -04:00
Elliot DeNolf
4503ce39fa chore(release): bundler-webpack@1.0.0-beta.6 2023-10-08 20:13:05 -04:00
Elliot DeNolf
0e407e05d7 chore(release): db-postgres@0.1.0-beta.20 2023-10-08 20:13:05 -04:00
Elliot DeNolf
d50049878d chore(release): db-mongodb@1.0.0-beta.9 2023-10-08 20:13:05 -04:00
Elliot DeNolf
26d56de572 chore(release): richtext-slate@1.0.0-beta.5 2023-10-08 20:13:05 -04:00
Elliot DeNolf
73f434e394 chore(release): richtext-lexical@0.1.0-beta.6 2023-10-08 20:13:05 -04:00
dependabot[bot]
13bc3e3681 chore(deps): bump postcss from 8.4.27 to 8.4.31 (#3484)
Bumps [postcss](https://github.com/postcss/postcss) from 8.4.27 to 8.4.31.
- [Release notes](https://github.com/postcss/postcss/releases)
- [Changelog](https://github.com/postcss/postcss/blob/main/CHANGELOG.md)
- [Commits](https://github.com/postcss/postcss/compare/8.4.27...8.4.31)

---
updated-dependencies:
- dependency-name: postcss
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-08 19:48:40 -04:00
Elliot DeNolf
b398c44bfe chore: update all references to main in docs, examples, and templates 2023-10-08 19:45:54 -04:00
Elliot DeNolf
aa443d9050 ci: update ci to main 2023-10-08 19:44:59 -04:00
Jacob Fletcher
f39ba60b08 docs: live preview config path 2023-10-08 19:39:50 -04:00
James
791f2051f3 Merge branch 'main' of github.com:payloadcms/payload 2023-10-08 19:38:34 -04:00
James
a37798b80d Merge branch '2.0' of github.com:payloadcms/payload into 2.0 2023-10-08 19:37:47 -04:00
James
077bd7fad3 chore: rich text docs 2023-10-08 19:37:41 -04:00
Jacob Fletcher
8255088f39 docs: custom views (#3483) 2023-10-08 19:34:23 -04:00
Dan Ribbens
5a969a2c4d chore: removes unused transaction utility function 2023-10-08 19:19:38 -04:00
Dan Ribbens
7c7e841af7 chore: fix delete user preferences 2023-10-08 19:19:03 -04:00
Alessio Gravili
13332f04ab Merge pull request #3481 from payloadcms/chore/export-more-stuff
chore(richtext-lexical): export nodes
2023-10-09 01:07:59 +02:00
Alessio Gravili
c1d28a7a07 chore(richtext-lexical): export nodes 2023-10-09 01:07:16 +02:00
dependabot[bot]
4eaa76a314 chore(deps): bump postcss in /packages/bundler-webpack (#3478)
Bumps [postcss](https://github.com/postcss/postcss) from 8.4.27 to 8.4.31.
- [Release notes](https://github.com/postcss/postcss/releases)
- [Changelog](https://github.com/postcss/postcss/blob/main/CHANGELOG.md)
- [Commits](https://github.com/postcss/postcss/compare/8.4.27...8.4.31)

---
updated-dependencies:
- dependency-name: postcss
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-08 18:13:51 -04:00
dependabot[bot]
8f98eff0d7 chore(deps): bump graphql from 16.8.0 to 16.8.1 in /examples/testing (#3479)
Bumps [graphql](https://github.com/graphql/graphql-js) from 16.8.0 to 16.8.1.
- [Release notes](https://github.com/graphql/graphql-js/releases)
- [Commits](https://github.com/graphql/graphql-js/compare/v16.8.0...v16.8.1)

---
updated-dependencies:
- dependency-name: graphql
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-08 18:13:29 -04:00
dependabot[bot]
f8dce28904 chore(deps): bump postcss from 8.4.29 to 8.4.31 in /examples/testing (#3480)
Bumps [postcss](https://github.com/postcss/postcss) from 8.4.29 to 8.4.31.
- [Release notes](https://github.com/postcss/postcss/releases)
- [Changelog](https://github.com/postcss/postcss/blob/main/CHANGELOG.md)
- [Commits](https://github.com/postcss/postcss/compare/8.4.29...8.4.31)

---
updated-dependencies:
- dependency-name: postcss
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-08 18:13:17 -04:00
Elliot DeNolf
09ee95087b chore(release): richtext-slate@1.0.0-beta.4 2023-10-08 17:42:17 -04:00
Elliot DeNolf
190a1ab5a0 chore(release): richtext-lexical@0.1.0-beta.5 2023-10-08 17:39:41 -04:00
Dan Ribbens
5e8b11b5d3 Merge branch '2.0' of github.com:payloadcms/payload into 2.0 2023-10-08 17:37:12 -04:00
Dan Ribbens
436250d594 Revert "chore: delete req.transactionID when committing payload operations"
This reverts commit 8e4cede62c.
2023-10-08 17:35:59 -04:00
James
09c94609b4 Merge branch '2.0' of github.com:payloadcms/payload into 2.0 2023-10-08 17:23:28 -04:00
James
6d012bff68 chore: properly runs duplication of locales one after another 2023-10-08 17:23:18 -04:00
Jacob Fletcher
f0af24d066 chore: merges README 2023-10-08 16:57:52 -04:00
Jacob Fletcher
360291c407 chore: merges examples 2023-10-08 16:57:52 -04:00
Jacob Fletcher
d8f6f86228 chore: merges templates 2023-10-08 16:57:52 -04:00
James
a0645bbae5 Merge branch '2.0' of github.com:payloadcms/payload into 2.0 2023-10-08 16:47:47 -04:00
James
999f2fba04 chore: live preview tests pass 2023-10-08 16:47:42 -04:00
Tylan Davis
6009b18f75 Merge branch '2.0' of github.com:payloadcms/payload into 2.0 2023-10-08 16:11:33 -04:00
Tylan Davis
f968b92968 fix: removes quotes in keywords 2023-10-08 16:10:35 -04:00
Tylan Davis
b51987d4ac chore: adds point field database disclaimer 2023-10-08 16:10:10 -04:00
Tylan Davis
2639d29b91 fix: removes unused page 2023-10-08 16:09:30 -04:00
Jacob Fletcher
3668f053b3 chore!: consolidates admin routes and views configs (#3458)
BREAKING CHANGE: If your config has a `admin.components.routes` array, you will need to key them into the `admin.components.views` object. The configuration options should remain unchanged.
2023-10-08 16:08:13 -04:00
Dan Ribbens
18da607f5b Merge branch '2.0' of github.com:payloadcms/payload into 2.0 2023-10-08 15:31:43 -04:00
Dan Ribbens
8e4cede62c chore: delete req.transactionID when committing payload operations 2023-10-08 15:30:33 -04:00
James
e0af6fea99 Merge branch '2.0' of github.com:payloadcms/payload into 2.0 2023-10-08 14:57:14 -04:00
James
27f861d725 chore: updates bundler docs 2023-10-08 14:57:05 -04:00
Dan Ribbens
bb0c997a87 chore: cleanup database adapter interface 2023-10-08 14:55:07 -04:00
Dan Ribbens
eb58d9e877 chore: removes indexes from collection config (#3476) 2023-10-08 14:48:14 -04:00
James
c9387eba27 Merge branch '2_0/docs/bundlers' of github.com:payloadcms/payload into 2.0 2023-10-08 14:37:14 -04:00
Jarrod Flesch
1c577d1d0c chore: removes placeholder vite
link
2023-10-08 14:33:44 -04:00
Jarrod Flesch
86802dd531 chore: add bundle doc page, update env and vite 2023-10-08 14:31:40 -04:00
James
1c3d969ef1 Merge branch '2.0' of github.com:payloadcms/payload into 2.0 2023-10-08 14:23:32 -04:00
James
b9aa4d96a3 chore: db docs 2023-10-08 14:23:18 -04:00
Jacob Fletcher
6c866773b2 chore: statically renders live preview toolbar (#3475) 2023-10-08 14:23:01 -04:00
Elliot DeNolf
1020b08fd1 chore: port publish script to ts 2023-10-08 13:20:43 -04:00
Elliot DeNolf
b5b451464c chore(release): db-mongodb@1.0.0-beta.8 2023-10-08 12:29:10 -04:00
Elliot DeNolf
b90796f48a chore(db-mongodb): drafts v1-v2 versions?.drafts 2023-10-08 12:28:58 -04:00
Elliot DeNolf
0e67ac9b6b chore(release): db-mongodb@1.0.0-beta.7 2023-10-08 12:12:06 -04:00
Elliot DeNolf
de79dca08f chore(release): payload@2.0.0-beta.30 2023-10-08 12:11:12 -04:00
Elliot DeNolf
74972cf4c9 chore: add predefined migration for version-v1-v2 2023-10-08 12:10:03 -04:00
Jarrod Flesch
595ba1b241 chore: simplifies webpack/server-code docs 2023-10-08 11:03:25 -04:00
PatrikKozak
022ef85d8c docs: removes generated type aliasing
Co-authored-by: Jacob Fletcher <jacobsfletch@gmail.com>
2023-10-08 10:13:03 -04:00
Elliot DeNolf
8e0c3602f9 Merge branch '2.0' of github.com:payloadcms/payload into 2.0 2023-10-08 10:00:30 -04:00
Jacob Fletcher
70d41407a8 docs: live preview (#3474) 2023-10-08 09:55:06 -04:00
James
be618ba79e chore: addtl protection against invalid ids 2023-10-08 09:34:11 -04:00
Elliot DeNolf
8f2cec2535 chore(release): richtext-lexical@0.1.0-beta.4 2023-10-08 07:42:43 -04:00
Elliot DeNolf
ad896e377b chore(release): payload@2.0.0-beta.29 2023-10-07 19:22:33 -04:00
Elliot DeNolf
9574444b57 chore: better handle retrieving migrations 2023-10-07 19:22:01 -04:00
Elliot DeNolf
450a648e7e chore(release): db-postgres@0.1.0-beta.19 2023-10-07 19:17:08 -04:00
Elliot DeNolf
940174f446 chore(db-postgres): improve error parsing 2023-10-07 19:16:36 -04:00
James
3600dbb3ab Merge branch '2.0' of github.com:payloadcms/payload into 2.0 2023-10-07 17:58:51 -04:00
James
a41a3c5ee7 chore: allows updateOne with where clause in postgres 2023-10-07 17:58:38 -04:00
James
6c0eef3ec2 chore: allows disabling of push 2023-10-07 17:58:17 -04:00
Elliot DeNolf
3a16eb90b6 chore(release): db-postgres@0.1.0-beta.18 2023-10-07 16:55:13 -04:00
James
2f8d5dc628 Merge branch '2.0' of github.com:payloadcms/payload into 2.0 2023-10-07 16:54:19 -04:00
James
e1f092410e chore: removes unique compound indexes 2023-10-07 16:54:00 -04:00
Elliot DeNolf
654561cf30 chore: reinstall script 2023-10-07 16:46:00 -04:00
Elliot DeNolf
77bb42d672 chore(release): db-postgres@0.1.0-beta.17 2023-10-07 16:33:21 -04:00
Elliot DeNolf
cdbe61875e chore(release): payload@2.0.0-beta.28 2023-10-07 16:32:17 -04:00
James
e5d3821a9e chore(release): db-postgres@0.1.0-beta.17 2023-10-07 15:54:30 -04:00
James
f70837ab11 chore: shortens relationships table name to rels 2023-10-07 15:53:56 -04:00
James
0dbcc2725e chore: login redirection 2023-10-07 14:55:06 -04:00
Jarrod Flesch
6efedc174a chore: updates admin/webpack, admin/overview. Adds admin/server-only. 2023-10-07 14:51:26 -04:00
Jacob Fletcher
c4f2a65e49 chore: cleans up custom collection and global view routing (#3459) 2023-10-07 13:31:41 -04:00
Alessio Gravili
5d1444e1bd fix(richtext-lexical): incorrect stacking of block's fields 2023-10-07 18:35:59 +02:00
Alessio Gravili
03c9a91ea9 chore(richtext-lexical): CSS rule to fix focus outline issue when using vite bundler 2023-10-07 18:11:43 +02:00
Alessio Gravili
f3d2060d8d fix: minor CSS margin issue for upload field buttons 2023-10-07 18:08:24 +02:00
Elliot DeNolf
eb069e4253 chore(release): payload@2.0.0-beta.27 2023-10-07 11:34:33 -04:00
Elliot DeNolf
27deeccd50 chore: move react-image-crop to proper package.json 2023-10-07 11:34:06 -04:00
Elliot DeNolf
59bd6abfc3 chore: stub out basic READMEs for all packages 2023-10-07 11:24:33 -04:00
Alessio Gravili
ad7c25685e chore(richtext-lexical): adjust node data formats, adjust population behavior, fix some validation issues 2023-10-07 15:52:12 +02:00
Alessio Gravili
7e9c7707ba chore: improve ID field validation, fixing 2.0 int tests (#3457)
* chore: WIP id type validation for richtext upload

* chore: fix richtext fields test ID placeholder replacements

* chore: use getIDType in relationship validation for consistency

* chore: make getIDType safer in case payload.db.defaultIDType is null

---------

Co-authored-by: Dan Ribbens <dan.ribbens@gmail.com>
2023-10-07 00:49:24 +02:00
Alessio Gravili
acfda5d8d4 chore(richtext-lexical): updated lexical incoming config API 2023-10-07 00:22:13 +02:00
Jacob Fletcher
b6de427f04 feat: supports live preview config inheritance (#3456) 2023-10-06 18:20:13 -04:00
Elliot DeNolf
88c84ad8d6 chore: move test deps to root package.json 2023-10-06 17:38:33 -04:00
Elliot DeNolf
00543f5e25 chore(release): db-postgres@0.1.0-beta.16 2023-10-06 17:18:12 -04:00
Elliot DeNolf
d2415a5af4 chore(release): db-mongodb@1.0.0-beta.6 2023-10-06 17:18:06 -04:00
Elliot DeNolf
75ae2456a8 chore(release): payload@2.0.0-beta.26 2023-10-06 17:17:07 -04:00
Elliot DeNolf
ace393ca46 chore(release): payload@2.0.0-beta.25 2023-10-06 17:16:44 -04:00
Elliot DeNolf
3fce97a6d2 chore: misc eslint 2023-10-06 17:16:13 -04:00
Elliot DeNolf
e55ec6329c chore: fix up fresh, refresh, and reset migration operations 2023-10-06 17:15:43 -04:00
Jarrod Flesch
fb07308dca feat: 2.0 upload enhancements (#3433) 2023-10-06 17:02:42 -04:00
Jacob Fletcher
5bc81031d1 chore: supports live preview url as function (#3455) 2023-10-06 16:52:47 -04:00
PatrikKozak
03538c0901 chore: renders id column as code cell (#3435)
Co-authored-by: Jacob Fletcher <jacobsfletch@gmail.com>
2023-10-06 15:58:02 -04:00
Jacob Fletcher
960fe42b93 chore: resolves ts errors in views (#3453) 2023-10-06 14:58:51 -04:00
Jacob Fletcher
64c405d0fc chore: hides dot nav when creating new 2023-10-06 14:07:51 -04:00
Jacob Fletcher
75ec46ad63 chore: adds title attribute to nav icon 2023-10-06 14:07:51 -04:00
Elliot DeNolf
345c606895 chore(release): payload@2.0.0-beta.24 2023-10-06 14:01:47 -04:00
Elliot DeNolf
06fe3f4ac8 chore(templates): move bundler under admin 2023-10-06 14:01:19 -04:00
James
6afdaefdcd chore(release): payload@2.0.0-beta.23 2023-10-06 13:35:12 -04:00
James
4d4db8065e Merge branch '2.0' of github.com:payloadcms/payload into 2.0 2023-10-06 13:34:54 -04:00
Jacob Fletcher
1ce9b28dce chore: passing live preview int tests 2023-10-06 13:34:45 -04:00
Jarrod Flesch
6a74173789 chore: merges existing docs with 2.0 docs (#3450) 2023-10-06 13:33:24 -04:00
James
877576119a chore(release): payload@2.0.0-beta.22 2023-10-06 13:29:38 -04:00
James Mikrut
50dd03853a Merge pull request #3452 from payloadcms/2_0/chore/nav-icon
chore: replaces current collapse icon
2023-10-06 13:27:46 -04:00
Elliot DeNolf
163cf631e8 chore(release): bundler-vite@0.1.0-beta.10 2023-10-06 13:25:22 -04:00
Elliot DeNolf
7690fa1b55 chore(release): payload@2.0.0-beta.21 2023-10-06 13:24:25 -04:00
James
11b51bca75 Merge branch '2.0' of github.com:payloadcms/payload into 2.0 2023-10-06 13:23:15 -04:00
James
85e64c9209 chore: passes payload config so it is picked up by vite hmr 2023-10-06 13:23:05 -04:00
James
4ad8a9f5bb chore: allows config to be passed to root 2023-10-06 13:19:12 -04:00
Jarrod Flesch
ba4656b966 Merge branch '2.0' into 2_0/chore/nav-icon 2023-10-06 13:17:57 -04:00
Jarrod Flesch
8df9d57a69 Merge branch '2.0' of https://github.com/payloadcms/payload into 2.0 2023-10-06 13:17:32 -04:00
Jarrod Flesch
ae436673cb chore: corrects merge data import path 2023-10-06 13:17:27 -04:00
Jacob Fletcher
7c1b3b9de3 chore: uses proper depth 2023-10-06 13:16:56 -04:00
Jarrod Flesch
83d6b3f652 chore: css tweaks 2023-10-06 13:04:35 -04:00
Elliot DeNolf
ae49403c45 chore(release): payload@2.0.0-beta.20 2023-10-06 12:43:01 -04:00
Elliot DeNolf
c8b843c819 chore: fix migrate args 2023-10-06 12:42:50 -04:00
Jarrod Flesch
48db3027c9 chore: x icon on mobile 2023-10-06 12:33:34 -04:00
Jacob Fletcher
5f4c38ce21 chore: builds live preview app (#3451) 2023-10-06 12:32:13 -04:00
Jarrod Flesch
4a91be1d62 chore: adjusts mobile line styles 2023-10-06 12:23:52 -04:00
Jarrod Flesch
ca5dbb5cd4 chore: adjusts collapse icon for collection navigation 2023-10-06 12:21:10 -04:00
Jessica Boezwinkle
a8ff06a134 docs: updates onInit options 2023-10-06 17:16:38 +01:00
Jessica Boezwinkle
01891bb8bc docs: updates config examples, oninit props, mongoDB references and adds warning to point field 2023-10-06 17:16:38 +01:00
Elliot DeNolf
0d2fe860e5 chore(release): db-postgres@0.1.0-beta.15 2023-10-06 11:58:58 -04:00
Elliot DeNolf
542dcb3226 chore(release): payload@2.0.0-beta.19 2023-10-06 11:58:26 -04:00
Elliot DeNolf
4e973c9389 chore: adjust logging on start and in connect warning prompts 2023-10-06 11:57:00 -04:00
Dan Ribbens
2b831a67b4 chore: changes postgres interface client arg to pool and adds poolOptions 2023-10-06 11:56:23 -04:00
Elliot DeNolf
a423c7fd60 chore(release): richtext-lexical@0.1.0-beta.3 2023-10-06 11:01:03 -04:00
Elliot DeNolf
c3b2b19dbe chore(release): payload@2.0.0-beta.17 2023-10-06 10:59:45 -04:00
Alessio Gravili
272f62f032 Merge pull request #3449 from payloadcms/feat/2.0-lexical-block-validations
BREAKING: config (SanitizedConfig) is now a new, mandatory property to be passed into .validate(, options) functions. In order to accommodate that, other functions which may call validate now also have a new, mandatory config property. These are:
* buildStateFromSchema
* addFieldStatePromise


feat: breaking: richtext-lexical: block node validations
2023-10-06 16:56:59 +02:00
Jarrod Flesch
d063c93394 chore: style adjustments for api tab (#3447) 2023-10-06 10:39:15 -04:00
James
d73596a670 Merge branch '2.0' of github.com:payloadcms/payload into 2.0 2023-10-06 10:20:51 -04:00
James
78d6643950 chore: docs stubbing 2023-10-06 10:20:44 -04:00
Alessio Gravili
cffb5663aa fix: custom fields of Upload and Link features not being sanitized (both Slate and Lexical) 2023-10-06 15:47:31 +02:00
Elliot DeNolf
02c165b71f chore(release): payload@2.0.0-beta.16 2023-10-06 09:28:52 -04:00
Elliot DeNolf
783072ef7c chore(release): live-preview-react@1.0.0-beta.2 2023-10-06 09:28:39 -04:00
Elliot DeNolf
72fe24b69e chore(release): live-preview@1.0.0-beta.2 2023-10-06 09:28:31 -04:00
Elliot DeNolf
81ed355bbc chore(release): richtext-slate@1.0.0-beta.3 2023-10-06 09:28:08 -04:00
Elliot DeNolf
08a114e0e0 chore(release): richtext-lexical@0.1.0-beta.2 2023-10-06 09:27:57 -04:00
Elliot DeNolf
c49bb14414 chore(release): db-mongodb@1.0.0-beta.5 2023-10-06 09:27:42 -04:00
Elliot DeNolf
2411cfbe13 chore(release): db-postgres@0.1.0-beta.14 2023-10-06 09:27:32 -04:00
Elliot DeNolf
c1439ae7da chore(release): bundler-webpack@1.0.0-beta.5 2023-10-06 09:27:20 -04:00
Elliot DeNolf
36e7e1d946 chore(release): bundler-vite@0.1.0-beta.9 2023-10-06 09:26:45 -04:00
Alessio Gravili
63bae989bb chore: upgrade turborepo 2023-10-06 14:39:09 +02:00
Alessio Gravili
528150c3f7 Merge remote-tracking branch 'origin/2.0' into feat/2.0-lexical-block-validations 2023-10-06 14:31:52 +02:00
Alessio Gravili
fa91d45ae6 chore: richtext-lexical: save block node's collapsed state in preferences instead of node data 2023-10-06 14:30:40 +02:00
Alessio Gravili
b545f62574 chore: richtext-lexical: various styling and validation improvements 2023-10-06 12:39:22 +02:00
Alessio Gravili
b6a778196d feat: richtext-lexical: blocks: nicely show errors in Block component 2023-10-06 12:10:20 +02:00
Alessio Gravili
9acc1e4c99 feat: block node validations 2023-10-06 11:30:18 +02:00
Dan Ribbens
dfd5151c4f chore: fix testSuiteDir arg 2023-10-06 03:38:39 -04:00
Dan Ribbens
605ba73c30 chore: fix build in bin migrate ts error 2023-10-06 03:33:34 -04:00
Elliot DeNolf
c4e4a5a3f7 ci: add live-preview-react build 2023-10-05 17:30:50 -04:00
Elliot DeNolf
82d9dd8a28 chore(release): live-preview-react@1.0.0-beta.1 2023-10-05 17:28:06 -04:00
Elliot DeNolf
8a2045e3e4 chore(db-postgres): remove schema col from migration table creation 2023-10-05 16:54:56 -04:00
Elliot DeNolf
cddde3e488 chore: migrate help flag 2023-10-05 16:50:53 -04:00
Elliot DeNolf
986ceea246 chore: nodemon stdin:false, -I flag 2023-10-05 16:49:58 -04:00
Elliot DeNolf
d638408399 chore(release): db-postgres@0.1.0-beta.13 2023-10-05 16:00:59 -04:00
Elliot DeNolf
a46a80bd52 chore(db-postgres): create migration prompts when no schema changes detected 2023-10-05 16:00:59 -04:00
James
c2a99c8edc Merge branch '2.0' of github.com:payloadcms/payload into 2.0 2023-10-05 16:00:21 -04:00
James
2fe7818f29 chore: semantics 2023-10-05 16:00:12 -04:00
James
0bb11ecf8b chore: ensures live preview hook always returns data 2023-10-05 15:57:26 -04:00
Elliot DeNolf
eafeea4dd8 chore(db-postgres): return early on migrate if no migration files 2023-10-05 15:45:28 -04:00
Elliot DeNolf
bbd410bcbe chore(release): live-preview@1.0.0-beta.1 2023-10-05 15:21:43 -04:00
Elliot DeNolf
d2fa65cb4f ci: add live-preview build 2023-10-05 15:21:15 -04:00
Jacob Fletcher
18472d0178 chore: properly sizes tab field when sidebar exists 2023-10-05 15:15:02 -04:00
Jarrod Flesch
7ee41b6a65 chore: default menu to open if pref not set (#3445) 2023-10-05 15:00:27 -04:00
Elliot DeNolf
0a895eee80 chore(release): db-postgres@0.1.0-beta.12 2023-10-05 14:51:18 -04:00
Elliot DeNolf
74d6ef0c31 chore(db-postgres): set updated_at on dev push migration 2023-10-05 14:50:57 -04:00
Jacob Fletcher
f77c41978b chore: resolves path to live preview module 2023-10-05 14:33:02 -04:00
Jarrod Flesch
3538c2132d fix: doc title not rendering in breadcrumbs (#3444) 2023-10-05 14:12:48 -04:00
Jacob Fletcher
fd9d98da9f chore: removes empty space in header left by non-localized configs 2023-10-05 14:09:31 -04:00
Dan Ribbens
1c22459107 Merge branch '2.0' of github.com:payloadcms/payload into 2.0 2023-10-05 14:08:35 -04:00
Dan Ribbens
2d084e19d3 chore: windows safe pattern match for swc ignore 2023-10-05 14:06:59 -04:00
Elliot DeNolf
80f2d417f2 chore: delete dev pushes from migrations on migrate:reset 2023-10-05 14:02:31 -04:00
Elliot DeNolf
cfb77e2f27 chore(db-postgres): show warning if dev pushes exist on migrate 2023-10-05 14:02:10 -04:00
Jarrod Flesch
deb5be5a9b chore(examples/testing): builds testing example (#3443) 2023-10-05 13:55:36 -04:00
Jarrod Flesch
9880880384 feat!: store array values as actual array value (#3442) 2023-10-05 13:16:30 -04:00
Jarrod Flesch
618ee991dc fix: secures the user response from the me auth route (#3424) 2023-10-05 12:54:53 -04:00
Jessica Chowdhury
374fb99571 fix: corrects greater than or equal filter key (#3307) 2023-10-05 12:32:13 -04:00
Jarrod Flesch
183414e6e8 feat: adds API for view on collection and globals (#3432) 2023-10-05 12:30:30 -04:00
Jacob Fletcher
b7d983f30a feat: builds live preview sdk (#3441) 2023-10-05 12:13:19 -04:00
Elliot DeNolf
617ca9f85f chore(release): db-postgres@0.1.0-beta.11 2023-10-05 12:03:55 -04:00
Elliot DeNolf
47206f9e6a chore(db-postgres): safely get migration snapshots 2023-10-05 12:03:32 -04:00
Elliot DeNolf
131157ba29 chore(db-postgres): write json snapshot to migrations dir 2023-10-05 11:38:26 -04:00
Elliot DeNolf
db28547a51 chore(db-postgres): push to migrations table on connect for dev 2023-10-05 11:37:25 -04:00
James
f0689d403d Merge branch '2.0' of github.com:payloadcms/payload into 2.0 2023-10-05 11:00:10 -04:00
James
c46ffbd7ae chore: corrects config reference from bin / build 2023-10-05 10:59:58 -04:00
Dan Ribbens
f935a54107 Merge branch '2.0' of github.com:payloadcms/payload into 2.0 2023-10-05 10:58:51 -04:00
Dan Ribbens
bfa16e418f chore: write migration schema json 2023-10-05 10:53:07 -04:00
Elliot DeNolf
6dbe80be2e chore(release): payload@2.0.0-beta.13 2023-10-05 10:46:44 -04:00
Elliot DeNolf
302185e473 chore(release): bundler-vite@0.1.0-beta.8 2023-10-05 10:46:12 -04:00
PatrikKozak
7d8ac3e6f2 Merge branch '2.0' of https://github.com/payloadcms/payload into 2.0 2023-10-05 10:37:14 -04:00
PatrikKozak
001b87a8c6 chore: adds emptyOutDir option to build in vite config 2023-10-05 10:37:06 -04:00
James
cd49a7a940 Merge branch '2.0' of github.com:payloadcms/payload into 2.0 2023-10-05 10:35:09 -04:00
James
9da6506622 chore: initializes payload before build 2023-10-05 10:34:56 -04:00
Jacob Fletcher
0ac36069bd chore: handles live preview data (#3440) 2023-10-05 10:14:57 -04:00
Jacob Fletcher
f989e02a85 chore: builds fieldSchemaToJSON utility 2023-10-05 10:02:43 -04:00
Alessio Gravili
15e6401d4e chore: gitignore pointer files 2023-10-05 15:43:58 +02:00
Alessio Gravili
3d61445cd0 chore: delete pointerfiles 2023-10-05 15:43:42 +02:00
Alessio Gravili
20a99ff2c7 chore(richtext-lexical): slash menu x Blocks feature improvements 2023-10-05 15:37:22 +02:00
Alessio Gravili
27ef3a01f8 feat(richtext-lexical): list all blocks in Slash menu 2023-10-05 14:31:40 +02:00
Alessio Gravili
0bc4276d87 Merge pull request #3439 from payloadcms/feat/2.0-lexical-improvements-2
feat: lexical improvements
2023-10-05 11:00:30 +02:00
Alessio Gravili
ab34f08169 feat(richtext-lexical): populate fields in blocks field 2023-10-05 10:59:38 +02:00
Alessio Gravili
0c57c89d83 chore(richtext-lexical): improve internal link label 2023-10-04 22:55:25 +02:00
Elliot DeNolf
12bf78f41b chore(script): pack_to_dest script 2023-10-04 16:48:18 -04:00
Jacob Fletcher
10bd20904a chore: removes pseudo element from mobile doc tabs 2023-10-04 16:47:36 -04:00
Alessio Gravili
c3abaf5f1d feat(richtext-lexical): remove button for block 2023-10-04 22:44:00 +02:00
Elliot DeNolf
9ecef40ee7 chore(release): bundler-vite@0.1.0-beta.7 2023-10-04 16:32:14 -04:00
Alessio Gravili
76c2fad94f chore(richtext-lexical): fields test default value 2023-10-04 22:31:23 +02:00
PatrikKozak
aff983f5a2 Merge branch '2.0' of https://github.com/payloadcms/payload into 2.0 2023-10-04 16:28:37 -04:00
PatrikKozak
bf2cd5aac4 chore: sets process.env to empty object in vite bundler config 2023-10-04 16:28:22 -04:00
Elliot DeNolf
9baf7e9a70 chore(release): payload@2.0.0-beta.12 2023-10-04 16:10:56 -04:00
PatrikKozak
e64928f03a chore: vite progress 2023-10-04 15:46:58 -04:00
Dan Ribbens
33c3a7a50a Merge branch '2.0' of github.com:payloadcms/payload into 2.0 2023-10-04 15:38:40 -04:00
Dan Ribbens
1cce3ebce9 chore: fix mongodb transactions 2023-10-04 15:37:53 -04:00
Alessio Gravili
1e71776f22 Merge pull request #3436 from payloadcms/feat/2.0-lexical-improvements
feat: various lexical improvements
2023-10-04 21:32:52 +02:00
Alessio Gravili
6a5ddd32ab chore(richtext-lexical): various style improvements 2023-10-04 21:28:41 +02:00
Alessio Gravili
4e8d4797e1 chore(richtext-lexical): improve slash menu positioning and styling 2023-10-04 21:01:59 +02:00
Elliot DeNolf
3ce9c9ef03 ci: create beta release script 2023-10-04 14:49:57 -04:00
Elliot DeNolf
d1cbe4aa4e chore(release): payload@2.0.0-beta.11 2023-10-04 14:48:22 -04:00
Elliot DeNolf
84702d8e31 chore(release): bundler-vite@0.1.0-beta.6 2023-10-04 14:48:04 -04:00
Elliot DeNolf
9d1bda070f chore(release): db-mongodb@1.0.0-beta.4 2023-10-04 14:46:20 -04:00
Elliot DeNolf
b6b1a8e65d chore(release): db-postgres@0.1.0-beta.10 2023-10-04 14:44:16 -04:00
Elliot DeNolf
ffc16f08b9 chore: update pointer files 2023-10-04 14:43:04 -04:00
Elliot DeNolf
4e97621619 chore: proper declare module for drizzle 2023-10-04 14:24:12 -04:00
James
3d0b125e0a chore: type fixes 2023-10-04 14:23:57 -04:00
James
029d031974 Merge branch '2.0' of github.com:payloadcms/payload into 2.0 2023-10-04 14:21:59 -04:00
James
812d1806f5 chore: revisions to local dev suite 2023-10-04 14:21:51 -04:00
Jacob Fletcher
fc364b2d02 chore: redirects after create first user 2023-10-04 14:20:08 -04:00
Dan Ribbens
a6880207cd chore(db-postgres): schema building implements collection indexes (#3429) 2023-10-04 14:14:47 -04:00
James
98b6108eab chore: better alias pattern for db adapters 2023-10-04 14:13:40 -04:00
Elliot DeNolf
aa3a997d4d chore(release): payload v2.0.0-beta.8 2023-10-04 13:38:26 -04:00
Dan Ribbens
5c5b661412 Merge branch '2.0' of github.com:payloadcms/payload into 2.0 2023-10-04 13:33:54 -04:00
Dan Ribbens
823681cc42 chore: remove replicaset warning for mongodb transactions 2023-10-04 13:33:18 -04:00
Elliot DeNolf
6226368841 chore: adjust eslint npm script 2023-10-04 13:28:09 -04:00
Elliot DeNolf
1107a1d7d1 chore: rename editors 2023-10-04 13:27:19 -04:00
Dan Ribbens
394c2bc23a chore(db-postgres): add name to all unique constraints 2023-10-04 11:48:45 -04:00
Dan Ribbens
825f9521bb chore: fix relationship preferences unique constraint prompt on pushSchema 2023-10-04 11:36:44 -04:00
Elliot DeNolf
c161f019af chore: disable prettier on json for now 2023-10-04 11:27:42 -04:00
Elliot DeNolf
f80dc6a668 chore(release): payload v2.0.0-beta.7 2023-10-04 11:11:46 -04:00
Elliot DeNolf
df69441a6a chore: update pnpm-lock.yaml 2023-10-04 11:09:50 -04:00
Elliot DeNolf
25672f5975 chore: find and load .env file in bin script 2023-10-04 11:09:41 -04:00
Alessio Gravili
99a5e78a66 chore(richtext-lexical): sanitize block fields 2023-10-04 17:02:45 +02:00
Elliot DeNolf
d48f0c1567 chore(release): bundler-vite 0.1.0-beta.4 2023-10-04 10:11:05 -04:00
Elliot DeNolf
bb385280cc chore(bundler-vite): copy entry.tsx, files key in package.json 2023-10-04 10:10:54 -04:00
Elliot DeNolf
cb3029583c chore(release): payload v2.0.0-beta.6 2023-10-04 10:10:17 -04:00
PatrikKozak
d5ab5e2afe chore: updates define in vite bundler config 2023-10-04 09:52:40 -04:00
PatrikKozak
46774b80f0 Merge branch '2.0' of https://github.com/payloadcms/payload into 2.0 2023-10-04 09:45:57 -04:00
PatrikKozak
299c29019f chore: adds disableDBConnect option to on init 2023-10-04 09:45:17 -04:00
Alessio Gravili
3092fd0843 chore: export sanitizeFields 2023-10-04 15:31:13 +02:00
Alessio Gravili
715ae79727 chore(richtext-lexical): Blocks feature improvements 2023-10-04 14:18:55 +02:00
Jacob Fletcher
2e0c0d0224 chore: renders LeaveWithoutSaving as modal (#3428) 2023-10-03 17:04:24 -04:00
Elliot DeNolf
5f28bcc25a chore(release): bundler-vite 0.1.0-beta.2 2023-10-03 16:55:23 -04:00
Elliot DeNolf
81a1ad288d chore(bundler-vite): add copyfiles, adjust joi validation 2023-10-03 16:37:58 -04:00
Jacob Fletcher
cbc1f3b3f1 chore: improves edit view types (#3427) 2023-10-03 15:41:15 -04:00
Jacob Fletcher
fdbb61fc43 chore: dynamic device sizing (#3426) 2023-10-03 13:47:41 -04:00
Elliot DeNolf
f5d7ff2eee chore(release): bundler-vite 0.1.0-beta.1 2023-10-03 13:02:37 -04:00
PatrikKozak
3c63f5148b feat: adds vite property to payload admin config options (#3425) 2023-10-03 12:56:58 -04:00
Elliot DeNolf
2ad94e48f7 chore: add stdin: true to all nodemon.json files 2023-10-03 12:42:22 -04:00
Elliot DeNolf
cf26155995 chore: sync logger for prompts, adjust nodemon 2023-10-03 12:34:48 -04:00
Elliot DeNolf
7349c82e28 chore: add json files to lint-staged 2023-10-02 22:16:57 -04:00
Elliot DeNolf
f94e20942b ci: add clean pipeline to turbo 2023-10-02 22:16:32 -04:00
Elliot DeNolf
fdcdabd3ed chore(release): all beta packages 2023-10-02 21:47:32 -04:00
Elliot DeNolf
8ba1274e2f chore: update clean script for all packages 2023-10-02 21:03:41 -04:00
Jacob Fletcher
baf2b6de30 chore: passing admin e2e tests 2023-10-02 17:57:10 -04:00
Alessio Gravili
426efcaa08 chore: unbreak vscode config launch command 2023-10-02 23:32:15 +02:00
Elliot DeNolf
4f405bbee6 chore: remove console.log 2023-10-02 17:19:53 -04:00
Elliot DeNolf
0c977511f6 chore(script): list latest package versions from registry 2023-10-02 17:19:40 -04:00
Elliot DeNolf
7abb2450ef chore: better typing 2023-10-02 17:05:26 -04:00
Elliot DeNolf
85bcf150a7 chore: more drizzle renames 2023-10-02 16:28:24 -04:00
Elliot DeNolf
05116dd667 chore: rename db.db to db.drizzle 2023-10-02 16:22:57 -04:00
James
8e0b57ea59 Merge branch '2.0' of github.com:payloadcms/payload into 2.0 2023-10-02 16:19:29 -04:00
James
1286ed4706 chore: types mongodb adapter 2023-10-02 16:19:18 -04:00
Jacob Fletcher
51b2ce9fe9 chore: lints live preview 2023-10-02 15:21:50 -04:00
Jacob Fletcher
0c6bea7388 chore: nests doc tab li in tab conditions 2023-10-02 15:15:43 -04:00
Jacob Fletcher
29aa6e1449 chore: renders collapse label in sidebar 2023-10-02 15:15:43 -04:00
Jacob Fletcher
2938ce0d09 chore: renders icon graphic in step nav 2023-10-02 15:15:43 -04:00
Elliot DeNolf
a52ebf5596 chore: add commit to .git-blame-ignore-revs 2023-10-02 15:04:21 -04:00
Elliot DeNolf
dfac7395fe chore: prettier fix 2023-10-02 15:03:09 -04:00
Elliot DeNolf
5b3fd4f6ab ci: add husky and lint-staged 2023-10-02 14:36:23 -04:00
Jacob Fletcher
5ea06c9ad0 chore: removes json-formatter-js dependency 2023-10-02 13:29:58 -04:00
Jacob Fletcher
e7aac41672 chore: fixes EditViewProps type 2023-10-02 13:29:28 -04:00
James
c1861eecc8 Merge branch '2.0' of github.com:payloadcms/payload into 2.0 2023-10-02 12:19:31 -04:00
James
63177b5d55 chore: comments out js thign 2023-10-02 12:00:41 -04:00
Elliot DeNolf
5464966d1a chore: migration dir to src, use process.cwd() 2023-10-02 11:59:01 -04:00
Jacob Fletcher
a53cbd146f feat: live preview (#3382) 2023-10-02 11:40:08 -04:00
Jacob Fletcher
ec0f5a77b7 feat: api view (#3420)
Co-authored-by: Jarrod Flesch <jarrodmflesch@gmail.com>
2023-10-02 11:38:14 -04:00
Elliot DeNolf
316702c253 chore: fix migrateDown args 2023-10-02 11:16:56 -04:00
Elliot DeNolf
029da71a83 chore: remove payload starting log 2023-10-02 11:09:40 -04:00
James
e5a95755da chore: returns generic to BasePayload to fix typing 2023-10-02 11:07:01 -04:00
James
eb988f1f19 Merge branch '2.0' of github.com:payloadcms/payload into 2.0 2023-10-02 10:46:37 -04:00
Alessio Gravili
45f23367c8 fix: 2.0 hotkey's pressed keys are not unset when window is not focused (#3401)
* fix: hotkey's pressed keys are not unset when window is not focused

* chore: re-order string list

* chore: add back removed comment
2023-10-02 16:46:12 +02:00
James
30e9ba67ed Merge branch '2.0' of github.com:payloadcms/payload into 2.0 2023-10-02 10:46:02 -04:00
Dan Ribbens
6d014cf748 Merge branch '2.0' of github.com:payloadcms/payload into 2.0 2023-10-02 10:45:36 -04:00
James
2e480d4c99 Merge branch '2.0' of github.com:payloadcms/payload into 2.0 2023-10-02 10:45:28 -04:00
Dan Ribbens
42ceafb942 chore: update all payload generated types imports to use payload redeclared types 2023-10-02 10:45:21 -04:00
James
fa4821adef chore: add declare pattern to generated types 2023-10-02 10:45:19 -04:00
Elliot DeNolf
5d6b82a2b4 chore: use console.log in connect until we can adjust our logger 2023-10-02 10:32:30 -04:00
James
e913d5c400 Merge branch '2.0' of github.com:payloadcms/payload into 2.0 2023-10-02 10:23:05 -04:00
James
9a6d650a13 chore: progress to type overrides 2023-10-02 10:22:59 -04:00
Elliot DeNolf
6aaa22b2b4 chore: fix outdated lockfile 2023-10-02 09:09:23 -04:00
Alessio Gravili
0de816591b chore(richtext-lexical): add additional exports 2023-10-02 12:42:36 +02:00
Alessio Gravili
fd9ca519d7 chore(richtext-lexical): export more functions 2023-10-02 11:26:29 +02:00
Elliot DeNolf
dbdd317af7 chore: add clean and prepublishOnly scripts to all packages 2023-10-01 22:14:39 -04:00
Elliot DeNolf
71b372211f chore: export migration args from top-level adapter export 2023-10-01 22:07:53 -04:00
James
ddc6cb927b chore: exports database adapter from base payload 2023-10-01 21:49:30 -04:00
Elliot DeNolf
85c81c3efe chore: adjust DatabaseAdapter export/import for declare module 2023-10-01 21:43:12 -04:00
James
bb9b4c9fa0 chore: misc fixes 2023-10-01 20:40:30 -04:00
James
237fa50255 Merge branch '2.0' of github.com:payloadcms/payload into 2.0 2023-10-01 18:55:12 -04:00
James
556620a94e chore: enables bundle analyzer in webpack 2023-10-01 18:55:01 -04:00
James
8f837f99ae chore: vite in production 2023-10-01 18:42:47 -04:00
Elliot DeNolf
32e30ca678 feat(bundler-webpack): adjust aliasing 2023-10-01 17:10:52 -04:00
Elliot DeNolf
6e07aee59a feat(richtext-slate): add copyfiles command 2023-10-01 16:23:27 -04:00
James
44b10cc9b4 chore: webpack published package bugs 2023-10-01 16:20:18 -04:00
James
2649ceaac6 Merge branch '2.0' of github.com:payloadcms/payload into 2.0 2023-10-01 15:47:20 -04:00
James
ee22a488c0 chore: able to select bundler in dev 2023-10-01 15:47:16 -04:00
Elliot DeNolf
40f4014920 feat(templates): add editor import and config lines 2023-10-01 15:40:59 -04:00
Elliot DeNolf
317104bb9f ci: add richtext-lexical build job 2023-10-01 15:19:34 -04:00
Alessio Gravili
eed2b699c8 chore: fix lexical package not building 2023-10-01 21:19:22 +02:00
Alessio Gravili
48591aa24c fix: error when trying to access id property in null value 2023-10-01 21:14:11 +02:00
James
f8d456d762 Merge branch '2.0' of github.com:payloadcms/payload into 2.0 2023-10-01 15:07:31 -04:00
James
e6a0ed5e1c chore: vite dev script 2023-10-01 15:07:21 -04:00
Alessio Gravili
9308c792e1 feat: Lexical richtext editor (#3359)
* chore: move slate stuff into packages/richtext-slate

* chore: fieldTypes stuff

* chore: fix richtext-slate tsconfig

* chore: add clean:unix command

* chore: fix up things

* chore: undo subpath imports being hoisted up

* chore: fix incorrect imports

* chore: improve AdapterArguments type

* chore: remove unused richTextToHTML and stringifyRichText files

* fix: core-dev scss imports

* chore: fix publishConfig exports for richtext-slate

* chore: adjust joi schema for richtext field

* chore: various fixes

* chore: handle afterRead population in richText adapter

* chore: handle more after-read promise stuff

* chore: fix joi validation

* chore: add richtext adapter to tests

* chore: merge adapter props with field props

* chore: index.tsx => index.ts

* chore: rename `adapter` to `editor`

* chore: fix e2e tests not running due to importing a constant from a file (`Tabs`) which imports createSlate.

This fails because createSlate imports React components.

* chore: remove unnecessary import

* chore: improve various typings

* chore: improve typings for List view Cell components

* feat: richText adapter cell component

* chore: add missing types packages for packages/richtext-slate

* chore: add new adapter interface properties to joi schema

* chore: withMergedProps utility which replaces getSlateCellComponent and getSlateFieldComponent

* feat: added config.defaultEditor property which is now required. field.editor is no longer required and overrides config.defaultEditor

* docs: mention editor and defaultEditor property in the docs

* chore: fix incorrectly formatted JSX in docs files breaking mdx parser

* feat: create base structure for lexical adapter

* chore: upgrade dependencies

* chore: improve package.json property order

* chore: undo unnecessary changes in core

* chore: initial, working lexical editor

* chore: utils

* chore: add license.md

* chore: work on Floating toolbar

* chore: floatingSelectToolbar extensibility

* chore: FloatingSelectToolbar format buttons

* chore: add functionality to format buttons

* chore: caret handling improvements

* chore: keep toolbar hidden during mousedown

* chore: keep carat centered unless at edge of container

* chore: placeholder, style improvements

* chore: DraggableBlock Handle

* chore: limit cell preview length

* chore: fix drag handle styling in light mode

* chore: remove unnecessary listener

* feat: add block handle

* chore: handle removal of handles properly

* chore: add HistoryPlugin

* chore: improve naming of format button properties

* chore: fix incorrect position of HistoryPlugin

* chore: serif font

* chore: improve opacity handling of FloatingSelectToolbar

* feat: slash menu

* feat: slash menu interface

* chore: fix mixed-up icon

* chore: add missing editorConfig?.feature dependency

* feat: sanitizedEditorConfig, slash menu grouping

* feat: interface for nodes

* feat: Plugin interface

* feat: working AddBlockHandlePlugin

* feat: headings

* chore: improve editor focus handling for add block handle's slash menu

* chore: improve handling of slash menu filtering

* fix: cloneDeep function not handling all data types well

* feat: markdown transformers for headings

* feat: proper dependency system

* feat: add remaining markdown transformers

* feat: order system for floating toolbar format buttons

* chore: customizable floating select toolbar sections system

* feat: WIP floatingSelectToolbar dropdown sections

* feat: working dropdown & misc improvements

* chore: fix dropdown top positioning after scrolling down

* chore: downgrade @types/react

* feat: treeview debug feature, & misc improvements

* feat: add TabIndentationPlugin by default

* fix: wrong key for treeviewfeature

* chore: handle plugin keys

* chore: simplify Heading Feature

* feat: Text Align

* feat: Indent

* chore: floating text toolbar section dividers

* feat: isEnabled for floating select toolbar, and isEnabled handling for decreaseIndent

* chore: add all missing icons

* feat: checklist, orderedlist, unorderedlist

* chore: improve lists by using lexical/react's ListPlugin

* chore: lists markdown transformers

* chore: improve key generation for plugins

* fix: add missing payload scss import

* fix: make default editorConfig null instead of defaultSanitizedEditorConfig for EditorConfigProvider. This fixes a bug where the editor would crash if some feature was using this EditorConfigProvider, as EditorConfigProvider needs the feature (due to the serialization process) and the Feature needing EditorConfigProvider (circular dependency)

* chore: allow positioning plugins under floatingAnchorElem

* feat: WIP: Link Feature

* chore: add box shadow to slash menu in light mode

* chore: CheckList => Check List

* chore: respect admin.readOnly setting

* chore: Simplify Link Feature

* chore: restructuring

* chore: prettier

* chore: scss-ify

* feat: wip: nicer draggable blocks

* chore: lots of block drag improvements

* helllll yea

* chore: just pure niceness

* fix: drag handle not working when scrolling down

* fix: "add" drag handle not working when scrolling down

* chore: remove unnecessary console log

* chore: fix slash menu positioning if there is not enough space below

* chore: increase animation speed of floating select toolbar

* chore: expect transforms for top-level editor nodes

* chore: move css rule to correct position

* chore: slightly animate target drag line

* chore: do not indicate drag-ability in un-dragable positions

* chore: explanatory comment

* chore: link editor styling

* chore: lots of link-related improvements

* chore: a lot of floating toolbar improvements

* chore: adjust link colors to be the same as in the website

* chore: prep work link extensibility

* chore: work on link plugin

* feat: fully-working link feature 🎉

* chore: add upload icon

* chore: merge in useful changes from playground & misc stuff

* feat: WIP relationship feature

* feat: Relationship Feature

* feat: BlockQuote Feature

* chore: base structure for Upload feature

* chore: fix types

* chore: WIP work on population and upload nodes

* chore: stuff

* fix: ensure uuid is only generated once

* chore: remove console.log's

* feat: link and relationship population

* fix: populate relationships at correct position

* chore: bunch of progress on upload node

* chore: working upload node!

* chore: various upload feature improvements

* chore: misc

* feat: working upload feature fields customization

* feat: WIP Blocks feature

* chore: fix incorrectly registered editor commands

* chore: get Block fields to render

* feat: functional blocks feature

* chore: improve functionality of blocks feature component (styling, collapsing)

* chore: disable console logs
2023-10-01 21:03:44 +02:00
Elliot DeNolf
8f14cd2c59 chore(release): db-mongodb 1.0.0-beta.0 2023-10-01 14:15:06 -04:00
Elliot DeNolf
4ac9f339e6 chore(db-mongodb): add files key to package.json 2023-10-01 14:13:31 -04:00
Elliot DeNolf
fd146fb9ac chore(release): bundler-webpack 1.0.0-beta.0 2023-10-01 14:08:07 -04:00
Elliot DeNolf
4debc50c36 chore(bunder-webpack): add files key to package.json 2023-10-01 14:06:20 -04:00
James
a73246f85b Merge branch '2.0' of github.com:payloadcms/payload into 2.0 2023-10-01 13:50:38 -04:00
James
7bccd40a95 chore: building packages 2023-10-01 13:50:28 -04:00
Elliot DeNolf
b990e98b89 chore: add missing type dep 2023-10-01 13:38:53 -04:00
Alessio Gravili
5767e5d61c chore: fix build errors 2023-09-29 23:31:30 +02:00
Jacob Fletcher
34e2dc8a79 chore: overflows step nav (#3415) 2023-09-29 17:11:27 -04:00
Jacob Fletcher
244db8d621 chore: refines doc controls (#3411) 2023-09-29 14:14:48 -04:00
Jacob Fletcher
9d9d20efd9 chore: overhauls main nav (#3410) 2023-09-29 13:10:37 -04:00
Elliot DeNolf
96844a5185 ci: add builds for bundlers and plugins 2023-09-29 12:26:50 -04:00
Elliot DeNolf
973b4edba9 chore(release): core 2.0.0-beta.0 2023-09-29 11:55:38 -04:00
Elliot DeNolf
4ae40f4a12 chore(release): db-postgres 0.1.0-beta 2023-09-29 11:49:44 -04:00
Elliot DeNolf
07f713f8e9 chore: update latest components output 2023-09-29 10:51:03 -04:00
Elliot DeNolf
1ca5c70ed6 chore: better migration failure message 2023-09-29 10:44:38 -04:00
Jarrod Flesch
6fa5866f99 feat: 2.0 popover style updates (#3404) 2023-09-29 09:05:02 -04:00
Elliot DeNolf
f723b0e0e9 docs: add disableOnInit 2023-09-28 16:03:40 -04:00
Elliot DeNolf
33aac93c6e chore: use copy of options for modification 2023-09-28 15:23:50 -04:00
Elliot DeNolf
719dd1f2ba chore: adjust when to run init, and use proper payload param in dev script 2023-09-28 15:02:59 -04:00
Elliot DeNolf
b8c36ea8c5 chore: reorder migrate status table columns 2023-09-28 13:45:17 -04:00
Elliot DeNolf
706f2b469f feat: add disableOnInit option 2023-09-28 13:44:50 -04:00
Dan Ribbens
806dc9c098 chore: postgres cleanup 2023-09-28 13:18:24 -04:00
Dan Ribbens
be09b9bbe6 chore: querying with not_equals works with nulls every test past! 2023-09-28 11:52:52 -04:00
Dan Ribbens
0c943be3be chore: optional chain req.transactionID 2023-09-28 11:46:00 -04:00
James
796469f7cc chore: defaultValues within group 2023-09-28 10:47:54 -04:00
James
8ea63421f0 chore: locale=all relationships 2023-09-28 09:41:00 -04:00
James
5d0bd25267 chore: streamlined fallback locale in local operations 2023-09-28 09:15:43 -04:00
James
5be49e1484 chore: threads through req so transactions are able to function accordingly 2023-09-27 16:52:20 -04:00
James
a73625edb9 Merge branch '2.0' of github.com:payloadcms/payload into 2.0 2023-09-27 16:32:20 -04:00
James
20da1c4a13 chore: bug with reading globals 2023-09-27 16:32:03 -04:00
Elliot DeNolf
506f82127b chore: add dotenv to root package.json 2023-09-27 16:29:40 -04:00
Elliot DeNolf
6ed6c5b5b0 chore: allow dev override to PAYLOAD_DROP_DATABASE 2023-09-27 16:29:40 -04:00
Elliot DeNolf
43daa8640a chore: handle unnamed migrations 2023-09-27 16:29:40 -04:00
Elliot DeNolf
97352f7ceb chore: adjust migration file naming 2023-09-27 16:29:40 -04:00
James
09883ee78c chore: passing field tests 2023-09-27 16:25:23 -04:00
Jacob Fletcher
aa94c00bc6 chore: misc css (#3391) 2023-09-27 13:18:29 -04:00
Jacob Fletcher
d61eef23d1 chore: fixes admin view types (#3398) 2023-09-27 10:56:15 -04:00
James
6e81fa68e8 Merge branch '2.0' of github.com:payloadcms/payload into 2.0 2023-09-26 17:11:59 -04:00
James
8e8ba82c6d chore: revises a few tests 2023-09-26 17:11:46 -04:00
Elliot DeNolf
74605e471d chore: add migrate down to template 2023-09-26 16:52:16 -04:00
James
4593d37815 chore: merge 2023-09-26 16:19:42 -04:00
James
6f5561e14f chore: builds postgres json querying 2023-09-26 16:17:13 -04:00
Dan Ribbens
db38499d41 Merge branch '2.0' of github.com:payloadcms/payload into 2.0 2023-09-26 15:44:22 -04:00
Dan Ribbens
a5f162e883 chore: fix verifyEmail missing update properties 2023-09-26 15:44:04 -04:00
Elliot DeNolf
65e080671d chore: use utilities dir 2023-09-26 15:33:24 -04:00
Elliot DeNolf
c5c15c4463 chore: reorg postgres adapter props 2023-09-26 15:33:23 -04:00
Elliot DeNolf
5572c69741 chore: migration table existence handling 2023-09-26 15:32:21 -04:00
Jacob Fletcher
eac4605c99 chore: wraps global view with edit depth provider 2023-09-26 13:00:52 -04:00
Dan Ribbens
a48d000b54 chore: sanitize dates queries postgres 2023-09-26 12:14:57 -04:00
Dan Ribbens
88030616d7 chore: fixes forgotPassword resetPassword for postgres 2023-09-26 12:14:39 -04:00
Dan Ribbens
826c8671c6 chore: windows exportPointerFiles fix 2023-09-26 12:07:09 -04:00
Dan Ribbens
81d294b065 chore: add missing transaction support to auth operations 2023-09-26 10:02:40 -04:00
Dan Ribbens
b214d7b7d3 chore: merges 2023-09-26 09:34:11 -04:00
Elliot DeNolf
9c0aadd046 chore: migration dir and migration template updates 2023-09-25 23:27:58 -04:00
Elliot DeNolf
a9f1dc02ca chore: rework pg migration creation 2023-09-25 23:27:58 -04:00
Elliot DeNolf
07dd353432 chore: postgres builds without jsonquery 2023-09-25 23:27:58 -04:00
Dan Ribbens
6a6094c1a7 chore: adds postgres destroy 2023-09-25 11:40:30 -04:00
Dan Ribbens
beb7647bc7 chore: mongodb destroy connections outside of tests 2023-09-25 11:39:22 -04:00
Jacob Fletcher
af3baee927 chore: adds creatingNewLabel translation 2023-09-25 10:54:37 -04:00
Jacob Fletcher
7f7d914b4e chore: conditionally renders global sidebar fields 2023-09-25 10:54:07 -04:00
Jacob Fletcher
43064f4900 chore: renders autosave and status 2023-09-25 00:39:02 -04:00
James
6fd3a896a1 chore: fixes syntax error 2023-09-24 18:02:07 -07:00
James
8e6e576cd0 chore: refactors transactions 2023-09-24 18:01:01 -07:00
Elliot DeNolf
ba4cd2b599 chore: await db calls, disable no-floating-promises as necessary 2023-09-24 16:44:31 -07:00
James
ad24a17bd5 chore: merge 2023-09-24 16:31:58 -07:00
James
4df19cbdf6 chore: converts anything that awaits many promises to sequential execution 2023-09-24 16:31:23 -07:00
Elliot DeNolf
67103a7059 chore: fix postgres adapter types 2023-09-24 15:52:46 -07:00
Dan Ribbens
4ba5d723f5 chore: fix call to db query 2023-09-24 18:02:30 -04:00
James
8155902476 chore: poc for how to type db adapters 2023-09-24 14:22:06 -07:00
Dan Ribbens
bf745d19ed Merge branch '2.0' of github.com:payloadcms/payload into 2.0 2023-09-24 15:53:22 -04:00
Dan Ribbens
ef51e0855f chore: wip transactions re-enabled 2023-09-24 15:53:02 -04:00
James
e437b41950 chore: misc bugs, types pattern 2023-09-24 10:51:21 -07:00
James
220e7a590d chore: bugs with hasMany select localized 2023-09-23 12:29:40 -07:00
James
bb7feddbff chore: improves semantics of transform write 2023-09-23 12:18:04 -07:00
James
74fcf2fc1f chore: bugs with array 2023-09-23 10:59:34 -07:00
James
a458375934 chore: passing versions tests 2023-09-23 10:07:29 -07:00
Dan Ribbens
e5ef842839 chore: split out updateVersion function 2023-09-23 12:22:23 -04:00
Dan Ribbens
0fbb8d1a32 Merge branch '2.0' of github.com:payloadcms/payload into 2.0 2023-09-23 12:18:23 -04:00
Dan Ribbens
1c2e74f0c9 chore: split out updateVersion function 2023-09-23 12:18:10 -04:00
James
e6e8ab6630 chore: adds updateGlobalVersion to mongo adapter 2023-09-23 09:02:59 -07:00
Dan Ribbens
d3bfb76783 merges 2023-09-23 11:38:39 -04:00
James
64e7c395ce chore: ensures globals can be found and updated 2023-09-23 08:35:23 -07:00
James
d886af32d9 chore: allows querying on relationTo 2023-09-23 08:26:40 -07:00
James
ee0bddf85b chore: progress to versions 2023-09-23 07:50:28 -07:00
Jacob Fletcher
7ea4fcde2c feat: custom document tabs (#3387) 2023-09-22 17:42:23 -04:00
James
0f6f26e4d1 chore: updates old versions when new is created 2023-09-22 17:41:26 -04:00
James
82d2d2350f chore: uploads test suite passes 2023-09-22 16:51:29 -04:00
Elliot DeNolf
1377f56f26 chore: handle nulls vs undefined 2023-09-22 16:44:51 -04:00
Elliot DeNolf
a112b98597 chore: handle querying for existing upload 2023-09-22 16:42:53 -04:00
James
95e428223f Merge branch '2.0' of github.com:payloadcms/payload into 2.0 2023-09-22 16:34:53 -04:00
James
5abd9e3372 chore: self joins are now aliased correctly in relationship queries 2023-09-22 16:34:25 -04:00
Dan Ribbens
0c0a11debb chore: postgres versions update to latest false 2023-09-22 15:43:35 -04:00
Elliot DeNolf
528fb47b0b chore: fix dev:generate-types 2023-09-22 15:13:57 -04:00
Elliot DeNolf
0d68216c4b chore: fix hooks test, array inside group 2023-09-22 14:54:02 -04:00
Dan Ribbens
6ee15c3571 Merge branch '2.0' of github.com:payloadcms/payload into 2.0 2023-09-22 14:51:12 -04:00
Dan Ribbens
575bd9436a chore: build query fixes 2023-09-22 14:31:23 -04:00
James
f3415bb13e chore: ensures relationships can be cleared 2023-09-22 14:11:18 -04:00
Alessio Gravili
8b715a8127 chore: revert setting default db to postgres 2023-09-22 02:05:57 +02:00
Dan Ribbens
ad82b99dc6 chore: save updatedAt with new values 2023-09-21 16:51:40 -04:00
Dan Ribbens
6aaaeaff98 chore: add postgres updateVersion 2023-09-21 16:07:40 -04:00
James
edf9dd7983 chore: misc cleanup 2023-09-21 13:52:01 -04:00
Dan Ribbens
9eca30f281 chore: add postgres findglobalversions 2023-09-21 12:57:04 -04:00
Dan Ribbens
67b347aaa3 chore: postgres disable unique constraints for version tables 2023-09-21 12:19:19 -04:00
Dan Ribbens
c02dc385cb chore: use db transactions in upsertRows 2023-09-21 12:18:10 -04:00
Dan Ribbens
44a2b1a98f Merge branch '2.0' of github.com:payloadcms/payload into 2.0 2023-09-21 11:29:18 -04:00
Dan Ribbens
c0dfeb4918 chore: postgres operations use db from session for transactions 2023-09-21 11:29:09 -04:00
Elliot DeNolf
17132b72ad ci: configure int tests with postgres (#3364)
* chore: configure postgres

* chore: adjust action and connection

* chore: export postgres url as env
2023-09-21 09:34:43 -04:00
James
1191a2851c chore: wires up a few versions methods 2023-09-20 14:37:14 -04:00
Dan Ribbens
caa56e6ef6 chore: postgres abstract find 2023-09-20 13:25:04 -04:00
Dan Ribbens
62421da6ad chore: fix missing transaction id bug 2023-09-20 06:58:40 -04:00
Dan Ribbens
cec16abea0 chore: postgres enforce notNullable on required fields 2023-09-20 06:57:15 -04:00
Elliot DeNolf
25be3a3c6f ci: cache build and run tests per db adapter (#3362)
* ci: cache entire build to share with future jobs

* chore: pnpm setup for tests job

* chore: use build cache in db adapter builds

* chore: troubleshoot db builds

* chore: add back db-mongodb

* chore: add back db-postgres, cleanup

* chore: separate type gen into separate job

* chore: run tests separately for each db adapter

* chore: use matrix for tests w/ db

* chore: explicit ip and port for postgres
2023-09-19 22:31:33 -04:00
James
4dd98396a7 chore: adds date field 2023-09-19 19:23:17 -04:00
James
0c101cd713 chore: revises field names being lost while creating indexes 2023-09-19 19:00:35 -04:00
James
2a282c7257 chore: builds select field 2023-09-19 17:39:35 -04:00
James
bbcdf32a90 chore: builds hasMany selects 2023-09-19 17:15:10 -04:00
Elliot DeNolf
db4aa1e8b6 ci: move int tests before e2e 2023-09-19 17:04:31 -04:00
Elliot DeNolf
7159bf2ff3 test: remove unused test/postgres dir 2023-09-19 17:04:31 -04:00
Dan Ribbens
07aaacaa55 chore: postgres radio field type 2023-09-19 17:01:07 -04:00
Dan Ribbens
274d062d6d Merge branch '2.0' of github.com:payloadcms/payload into 2.0 2023-09-19 16:37:53 -04:00
Dan Ribbens
53572bf933 chore: postgres checkbox type 2023-09-19 16:29:21 -04:00
Elliot DeNolf
7b6fd62895 feat(templates): update templates for 2.0 (#3358)
* chore: add reinstall script

* feat(templates): update blank template

* chore(templates): update website and ecommerce
2023-09-19 16:17:37 -04:00
James
32fb5e66f8 chore: builds select enum pattern 2023-09-19 15:52:40 -04:00
James
92275f909f chore: restores community test suite 2023-09-19 15:27:04 -04:00
James
3cfc51ecf4 chore: hasMany numbers 2023-09-19 15:26:08 -04:00
James
1ed8dad92d chore: test resolution 2023-09-19 14:13:33 -04:00
James
81df72b5c2 chore: merge 2023-09-19 13:27:24 -04:00
James
7b38bd1e52 chore: nested unnamed fields, like query constraint 2023-09-19 13:27:05 -04:00
Alessio Gravili
b1ec1f5f3f chore: undo setting e2e tests to postgres by default 2023-09-19 17:38:04 +02:00
Jarrod Flesch
1b3419cd12 chore: resolved console errors from checkbox inputs (#3356) 2023-09-19 11:16:53 -04:00
James
c3a357f893 chore: merge 2023-09-19 11:04:58 -04:00
Jacob Fletcher
5f0207d617 chore: comments out live preview tab 2023-09-19 11:01:47 -04:00
James
5bc8b29e79 chore: merge 2023-09-19 10:53:44 -04:00
James
7fdf77cf3e chore: bugs with sort, graphql tests with postgres 2023-09-19 10:50:04 -04:00
Jacob Fletcher
463a39e822 chore: improves document tab logic 2023-09-19 10:13:42 -04:00
Alessio Gravili
6338471287 chore: sort package.json keys of richtext-slate package 2023-09-19 12:02:42 +02:00
Alessio Gravili
c356b96913 chore: package.json improvements: order, duplicate scripts and packages 2023-09-19 11:51:56 +02:00
Alessio Gravili
fbe5f36b29 chore: add commit to .git-blame-ignore-revs 2023-09-19 11:43:25 +02:00
Alessio Gravili
cdaa0acd61 chore: run eslint & prettier, adjust perfectionist sorting for package.json and tsconfig.json in eslint configs 2023-09-19 11:41:56 +02:00
Alessio Gravili
4f68b722dc chore: fix imports in db-postgres adapter 2023-09-19 11:15:47 +02:00
Alessio Gravili
a81401cf77 feat: breaking: richtext adapter (#3311)
BREAKING: requires user to install @payloacms-richtext-slate and specify a `config.editor` property

* chore: move slate stuff into packages/richtext-slate

* chore: fieldTypes stuff

* chore: fix richtext-slate tsconfig

* chore: add clean:unix command

* chore: fix up things

* chore: undo subpath imports being hoisted up

* chore: fix incorrect imports

* chore: improve AdapterArguments type

* chore: remove unused richTextToHTML and stringifyRichText files

* fix: core-dev scss imports

* chore: fix publishConfig exports for richtext-slate

* chore: adjust joi schema for richtext field

* chore: various fixes

* chore: handle afterRead population in richText adapter

* chore: handle more after-read promise stuff

* chore: fix joi validation

* chore: add richtext adapter to tests

* chore: merge adapter props with field props

* chore: index.tsx => index.ts

* chore: rename `adapter` to `editor`

* chore: fix e2e tests not running due to importing a constant from a file (`Tabs`) which imports createSlate.

This fails because createSlate imports React components.

* chore: remove unnecessary import

* chore: improve various typings

* chore: improve typings for List view Cell components

* feat: richText adapter cell component

* chore: add missing types packages for packages/richtext-slate

* chore: add new adapter interface properties to joi schema

* chore: withMergedProps utility which replaces getSlateCellComponent and getSlateFieldComponent

* feat: added config.defaultEditor property which is now required. field.editor is no longer required and overrides config.defaultEditor

* docs: mention editor and defaultEditor property in the docs

* chore: fix incorrectly formatted JSX in docs files breaking mdx parser

* chore: fix various errors

* chore: auto-generated pointer files
2023-09-19 11:03:31 +02:00
Alessio Gravili
835efdf400 chore: fix issues with tests 2023-09-19 10:46:32 +02:00
Elliot DeNolf
7725c1fdc9 chore: webpack bundler aliasing 2023-09-18 17:17:37 -04:00
Elliot DeNolf
1efab0b6a3 chore: make bundlers use named exports (#3352) 2023-09-18 15:38:05 -04:00
Elliot DeNolf
53a80be6a0 Merge pull request #3351 from payloadcms/chore/2.0-prettier-templates
chore: prettier templates
2023-09-18 14:51:52 -04:00
Elliot DeNolf
05eabc7a9d chore: add template prettier commit to .git-blame-ignore-revs 2023-09-18 14:47:07 -04:00
Dan Ribbens
43451a629a Merge branch '2.0' of github.com:payloadcms/payload into 2.0 2023-09-18 14:45:08 -04:00
Dan Ribbens
8ab24a4513 chore: postgres chain selectCount query methods 2023-09-18 14:44:35 -04:00
Elliot DeNolf
75a428ddc4 chore: prettier on all templates 2023-09-18 14:43:51 -04:00
Dan Ribbens
b271936b64 chore: fix postgres updateOne 2023-09-18 14:38:59 -04:00
Dan Ribbens
c7744c5bf0 test: conditional geojson 2023-09-18 14:37:51 -04:00
Jacob Fletcher
320e4a47cd chore: responsifies document header 2023-09-18 14:25:28 -04:00
Jacob Fletcher
66859f4073 chore: responsifies document controls 2023-09-18 14:25:28 -04:00
Dan Ribbens
321e59705d chore: split paths for graphql 2023-09-18 13:53:07 -04:00
James
029e319c7b chore: wires up contains in pg, skips point tests 2023-09-18 13:00:00 -04:00
James
2442144c98 chore: fixes id types for graphql in database adapters 2023-09-18 11:42:59 -04:00
Dan Ribbens
a8418bffa2 Merge branch '2.0' of github.com:payloadcms/payload into 2.0 2023-09-18 11:11:57 -04:00
Dan Ribbens
025d647bf7 chore: wip postgres collections-graphql 2023-09-18 11:10:32 -04:00
Jacob Fletcher
718f51d8d8 chore: fixes hmr 2023-09-18 11:10:12 -04:00
James
3c92c55ca9 Merge branch '2.0' of github.com:payloadcms/payload into 2.0 2023-09-18 10:42:36 -04:00
James
128fe0119e chore: fixes e2e tests 2023-09-18 10:42:30 -04:00
Jacob Fletcher
9bd8f14ba8 chore: refines gutter and spacing 2023-09-18 10:22:25 -04:00
Dan Ribbens
998eb99003 chore: postgres query block fields (#3347) 2023-09-17 23:19:19 -04:00
James
6abe7f2569 chore: vite builds 2023-09-16 11:24:14 -04:00
James
9efd7c9ed2 chore: few fixes in build 2023-09-16 11:13:42 -04:00
James
d46e1837a1 Merge branch '2.0' of github.com:payloadcms/payload into 2.0 2023-09-16 11:02:48 -04:00
James
16a4de2df7 chore: merge bundlers 2023-09-16 11:02:42 -04:00
James
649cf57ea8 chore: reverts test suite back to webpack for now 2023-09-16 11:01:29 -04:00
James
5aa67cf98d chore: functioning vite 2023-09-16 10:59:58 -04:00
Jacob Fletcher
4df942529a chore: improves collection and global view routing (#3341) 2023-09-16 01:46:56 -04:00
Jacob Fletcher
dbaa1f7319 chore: abstracts filterFields from RenderFields (#3340) 2023-09-15 17:39:00 -04:00
Jacob Fletcher
85c8e4dc65 chore: overhauls admin navigation (#3339) 2023-09-15 17:33:28 -04:00
James
055c65f229 chore: passing mongodb tests 2023-09-15 17:26:50 -04:00
James
270ee3687b chore: merge 2023-09-15 17:12:32 -04:00
James
5292f41a3b chore: rectifies test issues 2023-09-15 17:12:13 -04:00
Dan Ribbens
5a56e18e7d Merge branch '2.0' of github.com:payloadcms/payload into 2.0 2023-09-15 17:11:22 -04:00
Elliot DeNolf
26955bb331 chore: fix up tests for globals, hooks, localization 2023-09-15 17:08:15 -04:00
Dan Ribbens
b8f831fd05 test: fix imports 2023-09-15 17:01:43 -04:00
Jacob Fletcher
81010311f9 chore: builds main menu modal (#3313) 2023-09-15 16:40:08 -04:00
Jacob Fletcher
4b514d4c94 chore: establishes pattern for custom collection and global views (#3312) 2023-09-15 16:38:23 -04:00
James
92b4490257 chore: merge 2023-09-15 16:32:40 -04:00
James
2a9946f788 chore: resolves some of the testing suite issues 2023-09-15 16:29:16 -04:00
Elliot DeNolf
dd0514bd2c ci: multiple jobs (#3337)
* ci: move playwright install to test:e2e script

* test: adjust test db names to avoid conflicts

* ci: clean up core job

* ci: add db-mongodb build job

* chore: add jest setup db adapter logging

* chore: install on mongodb job

* chore: adjust root deps

* chore: use turbo for db-mongodb to ensure build order

* chore: use turbo from .bin

* chore: add build script for db-postgres

* ci: add db-postgres build job

* chore: upgrade actions/checkout and actions/setup-node

* chore: rename github workflow file to main
2023-09-15 16:17:41 -04:00
James
a28b266716 chore: removes unused files 2023-09-15 14:00:00 -04:00
Dan Ribbens
09a455bb7b chore: remove temp test env var 2023-09-15 13:52:19 -04:00
Dan Ribbens
2c61ae8452 chore: merge db-adapters 2023-09-15 13:03:13 -04:00
James
0347d6a211 chore: successfully builds webpack bundler 2023-09-15 12:38:02 -04:00
James
b21b4719fc chore: ports webpack bundler over to monorepo package 2023-09-15 12:26:29 -04:00
Alessio Gravili
1fa636417f chore: disable prettier for docs, as prettier is not compatible with mdx version 2. See https://github.com/prettier/prettier/issues/12209 2023-09-15 14:42:50 +02:00
Elliot DeNolf
577f54fcf3 chore: adjust object sorting groups 2023-09-14 16:33:13 -04:00
Elliot DeNolf
abab0abca8 chore: sort all package.json files in a sane way 2023-09-14 16:32:37 -04:00
Dan Ribbens
8df2c888fe feat: postgres transactions 2023-09-14 15:39:58 -04:00
Dan Ribbens
a838274ae7 chore: merge 2023-09-14 14:52:16 -04:00
Dan Ribbens
16d314ff49 chore: fix imports postgres 2023-09-14 14:46:27 -04:00
Elliot DeNolf
79f9ef2481 chore: migration improvements (#3335)
* chore: better migrationDir handling

* chore: add .migrations to gitignore

* chore: migration cli debugging

* docs: stub out each migration command
2023-09-14 14:23:17 -04:00
Dan Ribbens
9575ec5319 merges postgres transactions 2023-09-14 13:13:59 -04:00
Elliot DeNolf
11c8804886 chore: add build script back to db-postgres/package.json 2023-09-14 12:27:38 -04:00
Elliot DeNolf
488c6651d9 chore: restore db-postgres from feat/db-adapters 2023-09-14 12:24:30 -04:00
Elliot DeNolf
744de9c706 chore: merge from 2.0 2023-09-14 12:10:36 -04:00
Dan Ribbens
1f1082c068 query exists false 2023-09-13 14:43:01 -04:00
Dan Ribbens
33e50f7d6b test: improve expects 2023-09-13 13:04:06 -04:00
Dan Ribbens
bb16ce965c query relationship by id 2023-09-13 13:02:22 -04:00
Dan Ribbens
8d98dea1b8 querying localized fields with all 2023-09-13 10:23:18 -04:00
Dan Ribbens
7cdda26e5d querying on poly relationTo ids 2023-09-12 16:26:06 -04:00
Dan Ribbens
cc1966020a querying localized has many relationship field 2023-09-12 13:43:31 -04:00
Jarrod Flesch
48398db28c chore: removes hmr prod plugin (#3320) 2023-09-12 13:12:50 -04:00
Dan Ribbens
33c15afa79 querying localized relationship field 2023-09-12 12:29:00 -04:00
Jarrod Flesch
2b7d776b26 fix(2.0): ensures relationTo as array fields load returned data from form correctly (#3318) 2023-09-12 11:53:21 -04:00
James
61098f96a8 chore: builds pattern to return constraints array 2023-09-12 10:14:09 -04:00
Dan Ribbens
8e16d825ff wip refactor joins for relationships 2023-09-12 09:54:53 -04:00
Elliot DeNolf
9f4fdc5bc4 chore: missing jest config 2023-09-12 08:20:18 -04:00
Elliot DeNolf
2ff41f7a50 chore: more tests commands to top level 2023-09-11 17:22:08 -04:00
Alessio Gravili
aad2389a20 chore: add back missing 'utf-8' flag for exportPointerFiles script 2023-09-11 23:18:49 +02:00
Alessio Gravili
58589021cc chore: add support for .scss pointer files 2023-09-11 23:17:26 +02:00
Elliot DeNolf
56a02975d1 chore: fix dev type gen 2023-09-11 16:57:33 -04:00
Elliot DeNolf
41347bef5f chore: fix components tests 2023-09-11 16:49:35 -04:00
Alessio Gravili
73fe11baf3 chore: improve handling of subpath exports for published package (#3310)
* chore: exportPointerFiles script

* chore: handle creation of subfolders which may not exist

* chore: add json to copyfiles

* chore: do not use exports property for publishConfig

* chore: add clean:unix command

* chore: modify clean:unix command to also delete any tsconfig.tsbuildinfo files

* chore: remove exports properties from db adapter packages
2023-09-11 22:20:12 +02:00
Dan Ribbens
af6b7592a1 postgres short circuit empty find results 2023-09-09 17:26:38 -04:00
Jarrod Flesch
1fc9ca1709 chore: corrects hasMany relationships within addFieldStatePromise (#3301) 2023-09-09 00:31:52 -04:00
Dan Ribbens
754efe00f6 optimize find to query docs and count concurrently, normalize pagination args 2023-09-08 11:21:22 -04:00
Alessio Gravili
df33323bc8 chore: add missing root packages for test suite to work 2023-09-07 23:06:04 +02:00
Alessio Gravili
e2df74bbff chore: fix e2e tests by not importing from ./config 2023-09-07 22:53:28 +02:00
Alessio Gravili
4aad563f58 chore: cleanup 2.0 tsconfigs, fix building types for db adapters (#3293)
* chore: cleanup tsconfigs and fix db-mongodb builds

* chore: make the db adapters depend on payload

* chore: fix tsconfig for test directory

* chore: fix packages/db-mongodb not building
2023-09-07 22:36:17 +02:00
Dan Ribbens
1f7b52497c postgres sanitize query value 2023-09-07 14:45:07 -04:00
Dan Ribbens
595173327e postgres operations buildQuery updates 2023-09-07 11:49:21 -04:00
Jarrod Flesch
abd983f421 chore: mirror changes from PR #3276 (#3284) 2023-09-07 11:06:57 -04:00
Jarrod Flesch
1092ae6f98 chore: mirror changes from PR #3279 (#3285) 2023-09-07 11:06:35 -04:00
Alessio Gravili
d52e265117 chore: add last lint & format commit to .git-blame-ignore-revs 2023-09-07 15:54:48 +02:00
Alessio Gravili
1fbda85cd0 chore: lint and format everything again 2023-09-07 15:53:48 +02:00
Alessio Gravili
9e4474be60 chore: fix eslint and prettier configs for test directory 2023-09-07 15:48:48 +02:00
Alessio Gravili
a51b5970dc chore: re-run prettier 2023-09-07 15:45:48 +02:00
Alessio Gravili
fd2290d6f7 chore: update lint-specific packages 2023-09-07 15:36:02 +02:00
Alessio Gravili
4e9b2b4b5e chore: add .git-blame-ignore-revs file 2023-09-07 15:26:34 +02:00
Alessio Gravili
bf673096e3 chore: add .vscode/settings.json 2023-09-07 15:23:16 +02:00
Dan Ribbens
2e086d95d9 chore: working simple where 2023-09-06 16:25:52 -04:00
Dan Ribbens
d07394d197 sorting on group nested field 2023-09-06 15:05:04 -04:00
Elliot DeNolf
8093eb46b3 chore: remove db-mongodb/tsconfig.tsbuildinfo 2023-09-06 11:30:22 -04:00
Elliot DeNolf
dbfcaded16 chore: update gitignore, ignore tsbuildinfo 2023-09-06 10:37:39 -04:00
Alessio Gravili
4c5673be23 chore: improve package.json script commands 2023-09-06 01:01:57 +02:00
Dan Ribbens
d33cff94e0 getTableColumnFromPath tabs 2023-09-05 17:27:43 -04:00
Dan Ribbens
5b620e77f4 wip getTableColumnFromPath 2023-09-05 16:36:32 -04:00
James
59fe015239 chore: chops up buildQuery 2023-09-05 13:57:08 -04:00
Dan Ribbens
73e2a03b6d wip changes to build query 2023-09-05 12:30:06 -04:00
Alessio Gravili
eea371b336 chore: hoist up testing-related packages 2023-09-01 21:57:59 +02:00
Alessio Gravili
bd7bd8faec chore: fix MongooseAdapter import 2023-09-01 21:52:40 +02:00
Alessio Gravili
16c1ac8d9a Merge pull request #3264 from payloadcms/fix/2.0-tests
chore: fix 2.0 tests and use swc for building
2023-09-01 21:44:53 +02:00
Alessio Gravili
f97da2a9b4 chore: fix scss import 2023-09-01 21:43:45 +02:00
Alessio Gravili
b93d2d89c7 chore: use swc instead of tsc to build 2023-09-01 21:41:12 +02:00
James
0f3b364e46 chore: hoists tests out of payload package 2023-09-01 14:45:41 -04:00
Alessio Gravili
893ca87225 fix: database alias 2023-09-01 18:31:55 +02:00
Alessio Gravili
934bae2d24 chore: dirty TypeScript bandaid fixes 2023-09-01 18:29:36 +02:00
Alessio Gravili
63d18beb10 chore: fix flaky tests due to missing or incorrect awaits 2023-09-01 17:51:02 +02:00
Alessio Gravili
c48f6a298c chore: upgrade jest and jest-environment-jsdom 2023-09-01 17:48:04 +02:00
Alessio Gravili
cacae16678 fix: deleting preferences 2023-09-01 17:47:02 +02:00
Alessio Gravili
3444525428 chore: dirty fix for circular dependency 2023-09-01 17:46:32 +02:00
Alessio Gravili
ae7d6f97d2 chore: formatting and linting (#3261)
* chore: lint packages/payload

* chore: lint packages/db-postgres

* chore: lint packages/db-mongodb

* chore: update eslintrc exclusion rules

* chore: update eslintrc exclusion rules

* chore: lint misc files

* chore: run prettier through packages

* chore: run eslint on payload again

* chore: prettier misc files

* chore: prettier docs
2023-09-01 17:39:44 +02:00
Dan Ribbens
5d7aa0d009 chore: wip traversePaths of sort and buildSearchParams 2023-09-01 11:26:36 -04:00
Alessio Gravili
5f7673d735 chore: update configuration files 2023-09-01 17:13:12 +02:00
Alessio Gravili
c3c13627f1 chore: update pnpm-lock.yaml 2023-09-01 17:00:28 +02:00
Alessio Gravili
373e89a6ba chore: eslint, turbo and various configs 2023-09-01 16:59:45 +02:00
James
6ba79de560 chore: merge 2023-08-30 12:55:45 -04:00
James
ba2f6ed9c3 chore: writes all locales 2023-08-30 12:55:07 -04:00
Dan Ribbens
f0ce57169d chore: begin using sort arg 2023-08-28 17:02:49 -04:00
James
ee89693691 chore: adds delete, queryDrafts, find operations 2023-08-27 17:50:05 -04:00
James
e9b6db6559 chore: removes unused dependency 2023-08-27 17:49:42 -04:00
James
a19ccbb359 feat: optimizes querying drafts 2023-08-27 17:21:02 -04:00
James
09260df134 chore: temporarily comments out versions until methods are stubbed out 2023-08-27 12:03:53 -04:00
James
00874a4406 chore: builds version tables 2023-08-27 11:53:01 -04:00
James
2a99e6b72a chore: adds global methods 2023-08-27 11:02:38 -04:00
James
126f7f1a5a chore: adds relationship tests 2023-08-26 23:48:58 -04:00
James
55a996af19 chore: localized groups 2023-08-26 23:34:04 -04:00
James
bf79211163 chore: localized arrays now save correctly 2023-08-26 22:56:32 -04:00
James
fe0487b336 chore: passing postgres tests 2023-08-26 22:42:29 -04:00
James
62e37802ca chore: progress to retaining array rows 2023-08-26 20:50:56 -04:00
James
4dd29bf4e8 chore: ensures blocks can be updated while saving additional locales 2023-08-26 16:24:35 -04:00
James
1ca81ac726 chore: working localized relationships 2023-08-26 11:59:33 -04:00
Alessio Gravili
7b72f887d1 chore: enable esModuleInterop 2023-08-26 00:30:14 +02:00
Alessio Gravili
53526490f8 chore: fix top-level package.json commands 2023-08-25 22:13:02 +00:00
Alessio Gravili
28eaafd9c7 chore: omg it finally works omgggg 2023-08-25 22:08:20 +00:00
Alessio Gravili
27c02abacd chore: upgrade typescript and @types/node 2023-08-25 21:42:17 +00:00
James
e350c72342 Merge branch 'feat/db-adapters' of github.com:payloadcms/payload into feat/db-adapters 2023-08-25 15:59:30 -04:00
James
f631e5bef3 chore: ensures transform read preserves all locales 2023-08-25 15:59:19 -04:00
Alessio Gravili
6f22b662ec fix: make it work 2023-08-25 19:17:37 +00:00
Dan Ribbens
61e675dd7b working config after master changes 2023-08-25 15:07:03 -04:00
Dan Ribbens
4c345d18ff remove unused imports 2023-08-25 14:06:27 -04:00
Elliot DeNolf
1a8ab3b7cd chore: fix types in db-postgres 2023-08-25 11:58:21 -04:00
Alessio Gravili
7a90a440a9 fix: package.json 2023-08-25 15:47:46 +00:00
Alessio Gravili
2fdbf1d212 chore: more work on imports and exports 2023-08-25 15:44:31 +00:00
Alessio Gravili
7a72e99896 chore: import and export more stuff 2023-08-25 15:34:41 +00:00
Alessio Gravili
1acc6f2adc chore: exports/versions.ts 2023-08-25 15:20:51 +00:00
Alessio Gravili
36f0f63d3e chore: export/utilities.ts 2023-08-25 15:17:58 +00:00
Alessio Gravili
759d36049d chore: more work on exports 2023-08-25 15:04:05 +00:00
Alessio Gravili
97fac77fa3 chore: export more stuff from databases 2023-08-25 14:58:55 +00:00
Alessio Gravili
d7a89d4098 chore: add .devcontainer to .gitignore 2023-08-25 14:57:04 +00:00
Alessio Gravili
370e38ae30 chore: work on imports 2023-08-25 14:56:42 +00:00
Alessio Gravili
2d2d9fa673 chore: npm publishConfig exports 2023-08-25 14:55:20 +00:00
Alessio Gravili
4ee83881cc chore: export stuff 2023-08-25 15:19:18 +02:00
Alessio Gravili
57e8c0756e fix: db-mongodb package tsconfig.json 2023-08-25 12:26:36 +00:00
Alessio Gravili
2d97d3bcb1 chore: move exports to exports folder 2023-08-25 12:16:46 +00:00
Alessio Gravili
65a22082d6 chore: initial tsconfig.json and package.json setup 2023-08-25 12:02:20 +00:00
Dan Ribbens
004f2ed045 fixes type error in db-mongodb 2023-08-23 21:18:15 -04:00
Dan Ribbens
b8b9d7b7a1 fixes operator validation regression 2023-08-23 20:33:29 -04:00
Alessio Gravili
52820d0111 chore: upgrade playwright and jest 2023-08-23 12:41:06 +02:00
Alessio Gravili
6fdd854cab chore: install packages via workspaces 2023-08-23 12:38:48 +02:00
Alessio Gravili
b5bca5412a chore: upgrade typescript 2023-08-23 12:38:09 +02:00
Alessio Gravili
a67278b29f chore: move to monorepo structure 2023-08-23 12:20:30 +02:00
Alessio Gravili
e24ad67168 chore: migrate to pnpm 2023-08-23 00:21:11 +02:00
Alessio Gravili
25a182f407 Merge branch 'feat/db-adapters' into 2.0 2023-08-22 23:47:26 +02:00
Alessio Gravili
b4578c10a4 feat: security improvements and features (#3214)
BREAKING CHANGE:
- Unhandled Errors are now omitted by default. This can be breaking if people depend on those error messages. Now, it will just say "Something went wrong.".

* chore: slightly improved testing of registration via graphql

Signed-off-by: Vsevolod Volkov <st.lyn4@gmail.com>

* chore: hiding details of internal errors from responses

Signed-off-by: Vsevolod Volkov <st.lyn4@gmail.com>

* feat: ability to remove authorization tokens from response bodies

Signed-off-by: Vsevolod Volkov <st.lyn4@gmail.com>

* chore: add section for design contributions in contributing.md

* feat: add afterOperation hook (#2697)

* feat: add afterOperation hook for Find operation

* docs: change #afterOperation to #afteroperation

* chore: extract afterOperation in function

* chore: implement afterChange in operations

* docs: use proper CollectionAfterOperationHook

* chore: remove outdated info

* chore: types afterOperation hook

* chore: improves afterOperation tests

* docs: updates description of afterOperation hook

* chore: improve typings

* chore: improve types

* chore: rename index.tsx => index.ts

---------

Co-authored-by: Jacob Fletcher <jacobsfletch@gmail.com>
Co-authored-by: Alessio Gravili <alessio@gravili.de>

* chore: remove swc version pin (#3179)

* fix: WhereBuilder component does not accept all valid Where queries (#3087)

* chore: add jsDocs for ListControls

* chore: add jsDocs for ListView

* chore: add jsDocs for WhereBuilder

* chore: add comment

* chore: remove unnecessary console log

* chore: improve operator type

* fix: transform where queries which aren't necessarily incorrect, and improve their validation

* chore: add type to import

* fix: do not merge existing old query params with new ones if the existing old ones got transformed and are not valid, as that would cause duplicates

* chore: sort imports and remove extra validation

* fix: transformWhereQuery logic

* chore: add back extra validation

* chore: add e2e tests

* chore(test): adds test to ensure relationship returns over 10 docs (#3181)

* chore(test): adds test to ensure relationship returns over 10 docs

* chore: remove unnecessary movieDocs variable

* fix: passes in height to resizeOptions upload option to allow height resize (#3171)

* docs: fixes syntax error in rich-text.mdx that was breaking build

* docs: removes auto-formatting from rich-text.mdx (#3188)

* feat: Improve admin dashboard accessibility (#3053)

Co-authored-by: Alessio Gravili <alessio@gravili.de>

* feat: improve field ops (#3172)

Co-authored-by: PatrikKozak <patrik@trbl.design>

* chore: file cleanup (#3190)

* chore(release): v1.14.0

* chore: improve ts typing in sanitization functions (#3194)

* chore(templates): default port on website

* chore(templates): safely handles bad network requests

* chore(templates): implements draft preview and on-demand revalidation

* chore(templates): renders static cart page fallback

* chore(examples): updates draft-preview next-app example to use revalidateTag (#3199)

* feat: query support for geo within and intersects + dynamic GraphQL operator types (#3183)

Co-authored-by: Lucas Blancas <lablancas@gmail.com>

* chore: improve checkboxes (#3191)

* chore: improve filtering for hasMany number field (#3193)

* chore: improve fiiltering for hasMany number field

* chore: add translation for 'items' and replace rows with items

* chore: new exceededLimit key

* Revert "chore: add translation for 'items' and replace rows with items"

This reverts commit 3a91dabdfd.

* chore: undo adding items key in translation schema

* chore: new limitReached key

* chore: remove unnecessary exceededLimit key

* chore: spelling improvements

* chore: update test build config import

---------

Signed-off-by: Vsevolod Volkov <st.lyn4@gmail.com>
Co-authored-by: Vsevolod Volkov <st.lyn4@gmail.com>
Co-authored-by: Jarrod Flesch <30633324+JarrodMFlesch@users.noreply.github.com>
2023-08-22 23:30:22 +02:00
Dan Ribbens
bb3dd62b4e fixes relationship validation for custom id text types 2023-08-22 16:27:12 -04:00
Dan Ribbens
48d51fbf08 Merge remote-tracking branch 'origin/2.0' into feat/db-adapters 2023-08-22 16:06:02 -04:00
Alessio Gravili
9467074fb9 chore: update 2.0 branch from master (#3207)
Co-authored-by: Jacob Fletcher <jacobsfletch@gmail.com>
Co-authored-by: Alessio Gravili <alessio@gravili.de>
Co-authored-by: PatrikKozak <patrik@trbl.design>
Co-authored-by: Lucas Blancas <lablancas@gmail.com>
Co-authored-by: Stef Gootzen <37367280+stefgootzen@users.noreply.github.com>
Co-authored-by: Jarrod Flesch <30633324+JarrodMFlesch@users.noreply.github.com>
Co-authored-by: Jessica Chowdhury <67977755+JessChowdhury@users.noreply.github.com>
Co-authored-by: PatrikKozak <35232443+PatrikKozak@users.noreply.github.com>
Co-authored-by: Greg Willard <Wickett06@gmail.com>
Co-authored-by: James Mikrut <james@payloadcms.com>
Co-authored-by: Dan Ribbens <dan.ribbens@gmail.com>
Co-authored-by: Elliot DeNolf <denolfe@gmail.com>
fix: WhereBuilder component does not accept all valid Where queries (#3087)
fix: passes in height to resizeOptions upload option to allow height resize (#3171)
2023-08-22 16:04:50 -04:00
Dan Ribbens
659d4e77b9 fixes updateOne ignoring id arg 2023-08-22 15:56:41 -04:00
Alessio Gravili
f911257cd9 feat: RTL Support (#3003)
Co-authored-by: Alessio Gravili <alessio@gravili.de>
Co-authored-by: ibr-hin95 <ibr.hin95@gmail.com>
Co-authored-by: Seied Ali Mirkarimi <dasmergo@gmail.com>
Co-authored-by: muathkhatib <mkhatib.dev@gmail.com>
Co-authored-by: ibr-hin95 <40246707+ibr-hin95@users.noreply.github.com>
fix: recursiveNestedPaths not merging existing fields when hoisting row/collapsible fields (#2769)
fix: exclude monaco code editor from ltr due to microsoft/monaco-editor#2371

BREAKING CHANGE:
- The admin hook for `useLocale` now returns a Locale object of the currently active locale. Previously this would only return the code as a string. Any custom components built which had `locale = useLocale()` should be replaced with `{ code: locale } = useLocale()` to maintain the same functionality.
- The property `localization.locales` of `SanitizedConfig` type has changed. This was an array of strings and is now an array of Locale objects having: `label: string`, `code: string` and `rtl: boolean`. If you are using localization.locales from the config you will need to adjust your project or plugin accordingly.
2023-08-22 12:18:15 -04:00
Dan Ribbens
0296c51324 testing rollback 2023-08-22 11:07:52 -04:00
Alessio Gravili
b29b83315d Merge branch 'feat/db-adapters' into 2.0 2023-08-22 14:06:02 +02:00
James
0732f00490 chore: flattens insert and upsert 2023-08-21 17:51:00 -04:00
James
e22ca1beff chore: working update for relationships, locales, base row 2023-08-21 17:37:28 -04:00
Alessio Gravili
635b2e9963 chore: upgrade pino (v6 => v8) and pino-pretty (v9 => v10) (#2698)
* feat: upgrade pino from v6 to v8

* chore: update pino and pino-pretty
2023-08-21 22:22:24 +02:00
Dan Ribbens
ddc692a966 wip: postgres transactions 2023-08-21 16:04:37 -04:00
James
640fd2843f Merge branch 'feat/db-adapters' of github.com:payloadcms/payload into feat/db-adapters 2023-08-21 15:44:59 -04:00
James
af13924d3f chore: handles date in upsertRow 2023-08-21 15:44:46 -04:00
Alessio Gravili
7c4dd5ec5e feat: option to disable auto pluralization for the mongoose adapter (#3153)
* chore: disable slug pluralization for versions model

* chore: disable slug pluralizations for globals version model

* chore: disable auto slug pluralization for globals collection

* feat: autoPluralization option for mongoose adapter
2023-08-21 18:05:39 +02:00
Dan Ribbens
e73cd26f10 merge master 2023-08-14 15:54:04 -04:00
Chingiz Mammadov
63e3063b9e feat: Added Azerbaijani language file (#3164)
Co-authored-by: Dan Ribbens <dan.ribbens@gmail.com>
2023-08-14 15:40:53 -04:00
rpfaeffle
942cfec286 feat: add support for hotkeys (#1821)
Co-authored-by: Jacob Fletcher <jacobsfletch@gmail.com>
Co-authored-by: Alessio Gravili <70709113+AlessioGr@users.noreply.github.com>
Co-authored-by: Alessio Gravili <alessio@gravili.de>
Co-authored-by: Jessica Boezwinkle <jessica@trbl.design>
2023-08-14 15:36:49 -04:00
Jarrod Flesch
35dfaab7c2 chore: works around changes in @swc/core 1.3.76 (#3170) 2023-08-14 14:32:42 -04:00
Elliot DeNolf
24aa1f27c1 feat: handle postgres numeric field for batch number comparison 2023-08-14 14:02:56 -04:00
Jordy Alcides
bad363882c feat: allow async relationship filter options (#2951)
* chore: improving relationship filter options;

Updating prop filterOptions from field type "relationship" to allow async functions;

* chore: add failing test case

* fix: translation followingFieldsInvalid_many not getting triggered

* docs: improve documentation

---------

Co-authored-by: Alessio Gravili <alessio@gravili.de>
2023-08-14 17:29:29 +02:00
Alessio Gravili
20a6ce8823 Merge pull request #3166 from payloadcms/fix/external-website-redirects
fix: do not allow redirects to external sites
2023-08-14 17:20:07 +02:00
Alessio Gravili
6797222733 chore: remove duplicate code 2023-08-14 17:19:19 +02:00
Jarrod Flesch
edcb3933cf fix: DatePicker showing only selected day by default (#3169) 2023-08-14 11:18:13 -04:00
Mark Barton
a0b13a5b01 feat: text alignment for richtext editor (#2803)
* Update isActive.tsx

This change allows us to define toggling of custom types in Slate. Specifically, this fixes the ability to toggle Alignment on nodes that use other active elements.

isElementActive(editor, format, TEXT_ALIGN_TYPES.includes(format) ? 'align' : 'type');

Type is the default for elements, allowing us to use a custom field lets us greater extend the functionality of Slate in Payload without causing any breaking changes

* Update toggle.tsx

Added to toggleElement public function

* Update isActive.tsx

* Update toggle.tsx

Added Rich Text Alignment, updated toggle function, added tests and doc updates

* added margin to void elements

* fix: list alignment

* removed textAlign from elements and added docs

* chore: fix typo

---------

Co-authored-by: Alessio Gravili <alessio@gravili.de>
2023-08-14 17:08:50 +02:00
Alessio Gravili
5744de7ec6 feat: make PAYLOAD_CONFIG_PATH optional (#2839)
* feat: make PAYLOAD_CONFIG_PATH optional

* hardcode common search paths

* docs: update docs regarding PAYLOAD_CONFIG_PATH

* make the tsConfig parser less prone to errors
2023-08-14 16:46:10 +02:00
Alessio Gravili
8a6cbf8a4d Merge pull request #2500 from Elliot67/feat/file-caching 2023-08-14 16:37:00 +02:00
Alessio Gravili
0a4730188b chore: update from master 2023-08-14 15:23:28 +02:00
Alessio Gravili
ea46fadc26 Merge remote-tracking branch 'origin/master' into pr/2500 2023-08-14 15:23:19 +02:00
Alessio Gravili
40db0d0462 chore: improve regex 2023-08-14 15:14:54 +02:00
Alessio Gravili
c0f05a1c38 fix: only allow redirects to /admin sub-routes 2023-08-13 16:25:14 +02:00
Elliot DeNolf
52de1f6ab0 chore(release): v1.13.4 2023-08-11 16:58:06 -04:00
Jarrod Flesch
479293fe6f chore: removes duplicative code for getting parent path (#3163) 2023-08-11 13:04:43 -04:00
Jarrod Flesch
3c60abd61a fix: correctly passes block path inside buildFieldSchemaMap (#3162) 2023-08-11 10:49:52 -04:00
Elliot DeNolf
f9807b5bd5 chore(release): v1.13.3 2023-08-11 09:27:27 -04:00
Jarrod Flesch
cb04d4a82a fix: unable to add arrays inside secondary named tabs (#3158) 2023-08-11 09:02:29 -04:00
James
5f7ea17717 chore(release): v1.13.2 2023-08-10 17:43:46 -04:00
Jarrod Flesch
608ae42eff chore: pins @swc/core to 1.3.75 2023-08-10 16:23:43 -04:00
Elliot DeNolf
791ed3be50 feat: conditionally use transactions 2023-08-10 13:54:04 -04:00
James
7345fa8fcd chore: cleanup 2023-08-09 19:33:07 -04:00
James
589fbba5aa chore: merge 2023-08-09 19:23:23 -04:00
James
237a91f0cc chore: ensures block and array locale relations are built properly 2023-08-09 19:22:19 -04:00
Elliot DeNolf
f8e6914f44 feat: proper type for createMigration func 2023-08-09 17:10:00 -04:00
Elliot DeNolf
cd447f1a9d feat: drizzle json generation 2023-08-09 17:07:51 -04:00
James
2f8549f331 chore: ports over find utilities 2023-08-09 16:41:21 -04:00
Jacob Fletcher
1da412a9bf chore(templates): fixes orders access control in ecommerce template (#3150) 2023-08-09 12:27:11 -04:00
Dan Ribbens
4f7d7a4d1b adds postgres findOne 2023-08-09 11:55:14 -04:00
Dan Ribbens
a7ad9903d7 Merge branch 'feat/db-adapters' of github.com:payloadcms/payload into feat/db-adapters 2023-08-09 07:15:46 -04:00
Dan Ribbens
9d7f88c8f7 adds pagination to find 2023-08-09 07:15:26 -04:00
Elliot DeNolf
0447dd3a33 chore: formatting 2023-08-08 16:36:55 -04:00
Elliot DeNolf
5bac50bca9 chore: apply schema changes before inserting into migrations table 2023-08-08 16:35:39 -04:00
James
353e851b29 chore: renames insertRow to upsertRow 2023-08-08 16:02:42 -04:00
Dan Ribbens
324b51e778 chore(release): v1.13.1 2023-08-08 16:00:52 -04:00
Jarrod Flesch
f5cf546e19 fix: updates addFieldRow and replaceFieldRow rowIndex insertion (#3145) 2023-08-08 15:35:59 -04:00
James
e25b77b411 chore: adds todo for update 2023-08-08 15:35:35 -04:00
James
84207d1e3b chore: cleanup 2023-08-08 15:06:56 -04:00
James
7e5f091e3a chore: inserts arrays within blocks 2023-08-08 14:38:48 -04:00
James
2f3f830de0 chore: merge 2023-08-08 14:27:43 -04:00
James
9500d94add chore: functional create 2023-08-08 14:25:28 -04:00
James
eea3cca28b chore: WIP - nested array insertion 2023-08-08 13:30:08 -04:00
Dan Ribbens
f6379e2117 Merge branch 'master' into feat/db-adapters 2023-08-08 12:58:43 -04:00
Dan Ribbens
510510cc66 chore: update changelog 2023-08-08 12:54:47 -04:00
Dan Ribbens
69cb015e0b chore(release): v1.13.0 2023-08-08 12:54:14 -04:00
Dan Ribbens
c6e0908076 feat: recursive saveToJWT field support (#3130) 2023-08-08 12:38:44 -04:00
Jarrod Flesch
8e188cfe61 fix: adding and replacing similarly shaped block configs (#3140) 2023-08-08 12:38:14 -04:00
Jessica Chowdhury
8ae98503f5 docs: adds images to each field page (#3137) 2023-08-08 10:00:21 -04:00
Jessica Chowdhury
1039f39c09 fix: absolute staticURL admin thumbnails (#3135) 2023-08-08 09:49:03 -04:00
Hristiyan Dodov
463d6bbec6 fix: setPreference() return type (#3125) 2023-08-08 09:17:17 -04:00
Dan Ribbens
57e25689a7 merge 2023-08-07 17:02:52 -04:00
Dan Ribbens
8ec4a70aa8 wip: build query 2023-08-07 17:00:46 -04:00
Jarrod Flesch
b117e73464 feat: radio and select fields are filterable by options (#3136) 2023-08-07 16:58:42 -04:00
Elliot DeNolf
8685ca6e94 feat: dev push migrations handling and prompt 2023-08-07 16:23:02 -04:00
James
72efd56302 chore: WIP create 2023-08-07 14:40:00 -04:00
PatrikKozak
fd0f078586 Merge pull request #3134 from leikoilja/fix-form-builder-example
fix: form-builder buildInitialFormState example
2023-08-07 11:14:20 -04:00
Dan Ribbens
89f759fa84 merge master 2023-08-07 09:22:19 -04:00
Ilja Leiko
0aa494b339 fix: fix form-builder buildInitialFormState example 2023-08-07 12:36:07 +02:00
Dan Ribbens
e8f05165eb feat: default tab labels from name (#3129) 2023-08-05 13:48:56 -04:00
Dan Ribbens
a776e06111 chore(release): v1.12.0 2023-08-04 14:06:10 -04:00
Dan Ribbens
02fc36e988 chore: update devDependencies for supply chain vulnerabilities (#3127) 2023-08-04 13:53:57 -04:00
Alessio Gravili
c5756ed4a1 feat: option to pre-fill login credentials automatically (#3021)
Co-authored-by: Dan Ribbens <dan.ribbens@gmail.com>
2023-08-04 13:41:08 -04:00
Dan Ribbens
356f174b9f feat: set JWT token field name with saveToJWT (#3126) 2023-08-04 13:22:05 -04:00
Jarrod Flesch
1c15868b50 chore(translations): removes extra keys from required 2023-08-04 12:59:12 -04:00
Jarrod Flesch
1180c795a3 chore: adds missing translations 2023-08-04 12:52:58 -04:00
Dan Ribbens
da27a8aadb fix: relationship field filter long titles (#3113) 2023-08-04 11:40:47 -04:00
Alessio Gravili
6a189c6548 fix: wrong links in verification and forgot password emails if serverURL not set (#3010) 2023-08-04 11:30:09 -04:00
Jessica Chowdhury
8c4d2514b0 fix: excludes useAsTitle field from searchableFields in collection view (#3105) 2023-08-04 11:27:52 -04:00
Alessio Gravili
a09c4ddc3b chore: improve flaky admin test suite (#3085) 2023-08-04 11:23:17 -04:00
James
6192c8623f chore: resolves conflict in relationship validation 2023-08-03 22:49:17 -04:00
James
cd322beba1 chore: progress to insert 2023-08-03 16:28:50 -04:00
James
e120d08282 chore: begins insert 2023-08-03 16:01:57 -04:00
Jarrod Flesch
5ca45987c4 chore: adds error and errors translations (#3121) 2023-08-03 15:14:34 -04:00
James
a9c4263646 chore: stubs out remaining field types 2023-08-03 14:21:40 -04:00
James
fd51903f02 chore: ensures parentID column type is set accordingly 2023-08-03 14:17:11 -04:00
James
221636027c chore: conflict 2023-08-03 13:30:28 -04:00
James
672e7e6ff3 chore: writes out todo migration plans 2023-08-03 13:29:57 -04:00
Jarrod Flesch
5b07e18ff5 chore: adds missing japanese translations (#3119) 2023-08-03 12:39:10 -04:00
Jessica Chowdhury
ea73e689ac feat: allows for upload relationship drawer to be opened (#3108) 2023-08-03 12:03:27 -04:00
Jacob Fletcher
456f29d689 chore: updates CONTRIBUTING.md (#3073) 2023-08-03 11:57:00 -04:00
Jacob Fletcher
50360b8769 chore: updates PULL_REQUEST_TEMPLATE.md (#3088) 2023-08-03 11:56:38 -04:00
Alessio Gravili
541e41293d chore: add RichTextAdapter interface type (#3117) 2023-08-03 11:31:21 -04:00
Elliot DeNolf
9022c8e22e feat: implement dropping of tables for postgres 2023-08-03 11:20:56 -04:00
Jarrod Flesch
a78c4631b4 feat: programmatic control over array and block rows inside the form (#3110) 2023-08-03 09:39:50 -04:00
Jarrod Flesch
da8ff20616 chore: prevent enter keypress from saving document (#3115) 2023-08-03 08:51:30 -04:00
James
bd464990ea chore: handles blocks 2023-08-02 21:37:06 -04:00
James
3ccdcc5c29 chore: builds enum pattern 2023-08-02 20:52:14 -04:00
James
dffb88e947 chore: working dynamic schema 2023-08-02 20:18:24 -04:00
James
a1388630d0 chore: adds postgres test suite 2023-08-02 19:57:22 -04:00
James
93352dd35e chore: merge 2023-08-02 17:21:58 -04:00
James
ee8f691073 chore: progress to init 2023-08-02 17:17:52 -04:00
Jacob Fletcher
037ccdd96e chore(examples): updates preview example (#3099) 2023-08-01 16:53:45 -04:00
Jacob Fletcher
b84496e5da chore(examples): updates auth example (#3100) 2023-08-01 16:53:31 -04:00
dependabot[bot]
62ecf54f85 chore(deps): bump semver in /examples/form-builder/nextjs (#3075)
Bumps [semver](https://github.com/npm/node-semver) from 6.3.0 to 6.3.1.
- [Release notes](https://github.com/npm/node-semver/releases)
- [Changelog](https://github.com/npm/node-semver/blob/v6.3.1/CHANGELOG.md)
- [Commits](https://github.com/npm/node-semver/compare/v6.3.0...v6.3.1)

---
updated-dependencies:
- dependency-name: semver
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-01 15:24:25 -04:00
Elliot DeNolf
6355d732be chore: drop pg database when PAYLOAD_DROP_DATABASE 2023-08-01 11:30:23 -04:00
James
71758b68f7 chore: renames postgres connection to db 2023-08-01 10:56:35 -04:00
James
b3b1146fe1 chore: local postgres db for testing 2023-08-01 10:50:59 -04:00
James
55ae20654c chore: pg connection 2023-08-01 10:48:34 -04:00
Sean Zubrickas
3fdaeb875e removes yarn lock from virtual fields example because of merge conflict 2023-08-01 09:26:47 -04:00
Sean Zubrickas
992be4af44 updates top banner copy 2023-08-01 09:25:17 -04:00
Josef Bredreck
144bb81721 feat: add support for sharp resize options (#2844)
* feat(ImageResize): add support for resize options

* fix(ImageUpload): reuse name for accidental duplicate

* fix(ImageResize): e2e tests for added media size

* chore: simplify fileExists method

* fix: typo

* feat(ImageResize): update name to be more transparent

* fix: use fileExists in file removal

* improve names, comments and clarity of needsResize function

* fix: jsDoc params

* fix: incorrect needsResize condition and add failing test case

* chore: improve comment

* fix: merge conflict error

---------

Co-authored-by: Alessio Gravili <70709113+AlessioGr@users.noreply.github.com>
2023-08-01 09:20:50 -04:00
Dan Ribbens
5ef20e3440 docs: mention virtual fields cannot be sorted (#3107) 2023-08-01 05:10:02 -04:00
James Mikrut
88b56d04f5 Update README.md 2023-07-31 18:31:33 -04:00
James
3a5851d28a chore: passing tests 2023-07-31 18:12:09 -04:00
James
af302e19ee chore: ensures passwords never make it to db 2023-07-31 17:04:53 -04:00
James
8d265ee368 chore: maintains internal sanitize fields for mongodb 2023-07-31 16:52:56 -04:00
James
872b38d378 chore: corrects remaining mongodb adapter paths 2023-07-31 15:57:59 -04:00
James
affd55f84e chore: merge 2023-07-31 15:28:44 -04:00
James
561f29454b chore: conflict 2023-07-31 15:28:15 -04:00
Elliot DeNolf
5763870938 feat: more import paths 2023-07-31 15:28:11 -04:00
James
f057e25ec7 chore: more path corrections 2023-07-31 15:27:55 -04:00
Dan Ribbens
aa7bad41e4 chore: import path cleanup continued 2023-07-31 15:27:37 -04:00
Dan Ribbens
e70754f417 chore: import path cleanup 2023-07-31 15:26:08 -04:00
James
be61f8ab96 chore: revises paths 2023-07-31 15:20:34 -04:00
James
948dae5b63 chore: path cleanup 2023-07-31 15:16:20 -04:00
James
a2e635d75c chore: path cleanup 2023-07-31 15:10:07 -04:00
James
1c2a5bc342 chore: merge conflicts 2023-07-31 15:01:59 -04:00
James
4b00850e41 chore(release): v1.11.8 2023-07-31 15:00:28 -04:00
James
badf2336ee chore: resolves type conflicts introduced with database folder 2023-07-31 14:55:23 -04:00
James
6220c3d6d9 chore: includes database files for adapter build 2023-07-31 14:46:28 -04:00
James
028872261b chore: path cleanup 2023-07-31 14:41:52 -04:00
Dan Ribbens
487eb00402 chore: move getLocalizedPaths to core 2023-07-31 14:32:50 -04:00
James
832c1069f1 chore: moves db adapters to top-level packages 2023-07-31 14:26:14 -04:00
James
f69e5949e1 chore: abstracts adapters to be their own package 2023-07-31 12:42:21 -04:00
James
f7ff894df4 chore: alternative typing for withBaseDatabaseAdapter 2023-07-31 10:21:15 -04:00
James
9050493c61 chore: abstracts dev / test suites to accept incoming database specification 2023-07-30 12:27:15 -04:00
James
06b1fe88ca chore: moves mongoose adapter 2023-07-29 11:24:35 -04:00
James
20179ba77b chore: merge master 2023-07-29 11:18:39 -04:00
Dan Ribbens
455b35dc1b chore: remove console log array field 2023-07-28 07:27:14 -04:00
Sean Zubrickas
b7299ab601 increases font size on top banner 2023-07-27 17:27:22 -04:00
Sean Zubrickas
174f83faf7 adds alternate github banner, removes cloud cta 2023-07-27 17:24:45 -04:00
Sean Zubrickas
5e41e0fb9e removes benefits banner & reverts to unordered list 2023-07-27 16:54:55 -04:00
James
129a9e7675 chore(release): v1.11.7 2023-07-26 21:24:27 -04:00
Sean Zubrickas
eb57c2280e removes benefits h3 in favor of benefits image, reorders helpful links 2023-07-26 18:48:58 -04:00
Sean Zubrickas
e2ad0baaaf refactors benefits list into h3 2023-07-26 17:41:56 -04:00
Jarrod Flesch
7542a92104 chore(tests): adds array row manipulation tests (#3086) 2023-07-26 16:34:13 -04:00
Corfitz
0a91950f05 fix: incorrect image rotation after being processed by sharp (#3081)
* Applying rotation fix for sharp image resizing

* fix: make sure original image is rotated correctly

* chore: explain why rotate() is needed in comments

---------

Co-authored-by: Alessio Gravili <alessio@gravili.de>
2023-07-26 20:57:36 +02:00
James
02809532b4 fix: #3062 2023-07-26 11:34:22 -04:00
Alessio Gravili
67ba131cc6 feat: ability to add context to payload's request object (#2796)
Co-authored-by: Dan Ribbens <dan.ribbens@gmail.com>
2023-07-26 09:07:49 -04:00
Jarrod Flesch
cf9795b8d8 fix: array row deletion (#3062) 2023-07-26 09:01:25 -04:00
James
a5f42e6a08 chore(release): v1.11.6 2023-07-25 17:14:59 -04:00
James Mikrut
23e718d4d1 Merge pull request #3068 from sannajammeh/master
fix(admin:upload): Enable adminThumbnail fn execution on all mime types
2023-07-25 17:01:50 -04:00
Sean Zubrickas
e8d9cab046 updates payload logos, updates top banner + cloud banner, adds line to benefits 2023-07-25 16:14:43 -04:00
Tylan Davis
d43c83dad1 fix: threads hasMaxRows into ArrayAction components within blocks and arrays (#3066) 2023-07-25 15:43:20 -04:00
Jarrod Flesch
916f04cba0 chore: better parity for initing admin routes between dev and build (#3074) 2023-07-25 14:27:01 -04:00
Jarrod Flesch
156c3eeb08 chore: adds updated yarn lock files for examples and templates folders 2023-07-25 14:22:53 -04:00
Jarrod Flesch
9755a55672 chore: sets payload to latest within templates and examples 2023-07-25 14:11:33 -04:00
Jacob Fletcher
774ffa14d3 chore: updates e-commerce template (#3072) 2023-07-25 12:47:08 -04:00
James
e30db30b07 chore(release): v1.11.5 2023-07-25 10:27:03 -04:00
Jarrod Flesch
e71866856f fix: admin route not mounting on production serve (#3071) 2023-07-25 10:16:55 -04:00
Elliot DeNolf
242dac5b8e chore(release): v1.11.4 2023-07-25 08:48:16 -04:00
Sanna Jammeh
dda9ff01ca docs(upload): Modify the note under adminThumbnail to reflect changes 2023-07-25 00:35:19 +00:00
Sanna Jammeh
5b7aac08f5 test(uploads): Add test case for adminThumbnail 2023-07-25 00:29:54 +00:00
Sanna Jammeh
2c74e9396a fix(collections:admin): Enable adminThumbnail fn execution on all types 2023-07-24 22:42:41 +00:00
Sean Zubrickas
62b73250b4 changes e-commerce and saas links to h3s, adds icons to each heading 2023-07-24 14:47:20 -04:00
Sean Zubrickas
9953e36f6b updates cloud cta, updates examples & tempaltes block, adds one-click tempaltes block 2023-07-24 14:17:19 -04:00
Sean Zubrickas
532f08c5b8 updates readme with new images, copy and layout 2023-07-24 13:29:04 -04:00
Jessica Boezwinkle
136298ac86 docs: fix useAuth code snippet on admin/react-hooks 2023-07-24 16:53:56 +01:00
Greg Willard
080e6195ef feat: improve keyboard focus styles (#3011)
* feat: Card: add keyboard focus outline

* feat: Button: add keyboard focus styles

* feat: links: add keyboard focus styles

* feat: CopyToClipboard: fix textarea tabbing issue, add keyboard focus style

* chore: fix text getting darker on keyboard focus

* feat: Pill: add keyboard focus styles

* feat: Paginator: fix disabled state, add keyboard focus styles

* feat: Nav: add keyboard focus styles

* feat: Table: add keyboard focus styles

* chore: add jsDocs to (s)css loaders

* fix: update dependency which fixes css bug

* chore: remove unnecessary Card style

* fix: use Button instead of button for DeleteDocument

* chore: override browser default outline

* chore: remove unnecessary outline rule

* fix: list drawer outline

---------

Co-authored-by: Alessio Gravili <alessio@gravili.de>
2023-07-24 17:04:12 +02:00
Jacob Fletcher
074abf4b7d chore: migrates ecommerce template to next.js app router (#2991) 2023-07-24 08:23:51 -04:00
Jarrod Flesch
08377cc5a7 fix: if arrayFieldType rows are undefined, page would crash (#3049) 2023-07-21 17:24:44 -04:00
Jarrod Flesch
641c765fb9 feat: solidifies bundler adapter pattern (#3044) 2023-07-21 17:20:51 -04:00
Dan Ribbens
f11ae6a162 wip: database docs 2023-07-21 16:16:39 -04:00
Dan Ribbens
8cfc2141cc export baseDatabaseAdapter for use in adapters 2023-07-21 15:44:50 -04:00
Dan Ribbens
cf83237a51 merge master 2023-07-21 14:19:59 -04:00
Dan Ribbens
8a681450d1 feat: add database transaction support(#2983) 2023-07-21 14:13:18 -04:00
Jacob Fletcher
9f06253321 chore: fixes ecommerce template .env.example (#3041) 2023-07-20 17:45:55 -04:00
Elliot DeNolf
5476cdfee2 chore: only needed dependabot security alerts enabled, not all deps 2023-07-20 17:44:03 -04:00
Elliot DeNolf
f232434b9a chore: add dependabot (#3027) 2023-07-20 17:12:05 -04:00
Jacob Fletcher
2a932ea28e chore: updates auth example (#3026) 2023-07-20 14:06:26 -04:00
Elliot DeNolf
41d3eee35f feat: bump mongoose and mongoose-paginate versions (#3025) 2023-07-20 12:51:30 -04:00
Elliot DeNolf
7aa57308be chore(release): v1.11.3 2023-07-19 17:54:16 -04:00
Elliot DeNolf
744a79f286 chore: pin mongoose-paginate-v2 2023-07-19 17:29:27 -04:00
Dominik Zogg
cd0bf68a61 feat: support logger destination (#2896)
* add-pino-destination-stream-support

* destinationStream => loggerDestination
2023-07-19 11:48:13 -04:00
Jarrod Flesch
a69c3ec476 chore: updates example folder mongodb uri's to work with node 18 2023-07-18 16:51:22 -04:00
Alessio Gravili
3ac910bf6d chore: improves datepicker styles and functionality (#2347)
Co-authored-by: Jarrod Flesch <jarrodmflesch@gmail.com>
2023-07-18 14:32:30 -04:00
Jarrod Flesch
60fca40780 fix: rich text link element not validating on create (#3014) 2023-07-18 08:54:22 -04:00
Alessio Gravili
733fc0b2d0 feat: auto-login in config capability (#3009)
This is useful when developing/testing, where logging after every change can be cumbersome.
2023-07-17 16:35:58 -04:00
Alessio Gravili
c8c22dad06 feat: work on database adapter (#3000) 2023-07-17 13:22:51 -04:00
Jacob Fletcher
2fc03f196e feat: returns queried user alongside refreshed token (#2813)
Co-authored-by: Dan Ribbens <dan.ribbens@gmail.com>
2023-07-17 09:35:34 -04:00
Jessica Chowdhury
7927dd485a docs: adds auth example for useAPIKey and disableLocalStrategy (#3007) 2023-07-17 09:30:30 -04:00
Jessica Chowdhury
42334263bb fix: adds backdrop blur to button (#3006) 2023-07-17 09:24:39 -04:00
James
75fbec21a9 chore(release): v1.11.2 2023-07-14 10:47:37 -04:00
Ritsu
281239db05 chore: fix typo error ua.json (#2995) 2023-07-13 16:11:20 -04:00
Jarrod Flesch
59bc002aed chore: fix protectRoles in auth example 2023-07-12 08:31:21 -04:00
Jarrod Flesch
70f3e6fc3e chore: explicitly import Tab type as type 2023-07-11 23:40:02 -04:00
Jarrod Flesch
4925f90b5f feat: adds array, collapsible, tab and group error states
Co-authored-by: Jessica Boezwinkle <jessica@trbl.design>
Co-authored-by: James <james@trbl.design>
2023-07-11 23:20:27 -04:00
Elliot DeNolf
f1e23b1cd0 chore: migration error handling 2023-07-11 14:30:24 -04:00
James
fafec05309 chore(release): v1.11.1 2023-07-11 10:13:40 -04:00
Jacob Fletcher
76a71c1af5 chore: adds use-client directive to label component (#2988) 2023-07-11 10:06:25 -04:00
James Mikrut
2854bfebf7 Merge pull request #2987 from payloadcms/fix/#2980
fix: #2980, locale=all was not iterating through arrays / blocks
2023-07-10 13:32:25 -04:00
James
d6bfba72a6 fix: #2980, locale=all was not iterating through arrays / blocks 2023-07-10 11:47:34 -04:00
PatrikKozak
2b0f65a27f docs: fixes admin panel table (#2986) 2023-07-10 10:16:25 -04:00
Jarrod Flesch
4b60845c67 chore: fix auth example protectRoles function 2023-07-07 12:42:27 -04:00
Jessica Boezwinkle
562cd18622 docs: adds authentication video 2023-07-07 17:05:35 +01:00
Jarrod Flesch
584d865d34 chore: improves error messaging for not found collections (#2982) 2023-07-07 11:56:14 -04:00
Elliot DeNolf
bac63f5204 fix: graphql and endpoint type issues 2023-07-07 11:37:56 -04:00
Jarrod Flesch
5b7756e266 chore: fixes auth example protectRoles function 2023-07-07 11:34:19 -04:00
Dan Ribbens
fc1f4c494f chore: cherry pick missing from migrations 2023-07-07 11:31:36 -04:00
Elliot DeNolf
2198445df9 Feat/migrations cli (#2940)
* feat: migrate cli call db adapter

* feat: mongoose adapter migrate:create

* feat: implement migrate command

* feat: use mongooseAdapter in test config

* feat: use filename as migration name

* feat: intelligently execute migrations, status table

* feat: implement migrate:down

* feat: implement migrate:reset

* feat: implement migrate:refresh

* feat: move common adapter operations to database/migrations dir

* feat: delete migrations instead of storing ran property

* feat: createMigration cleanup

* feat: clean up logging and add duration to output

* chore: export type, handle graphQL false

* chore: simplify getting latest batch number

* chore: remove existing migration logging noise

* feat: remove adapter export from top level

* chore: fix some db types
2023-07-07 11:02:56 -04:00
Jacob Fletcher
cfeeb9758f chore: adds eject script to custom server example (#2979) 2023-07-06 16:36:22 -04:00
Jacob Fletcher
51058f65e5 chore: builds auth example for next.js app router (#2976) 2023-07-06 14:15:28 -04:00
Jacob Fletcher
6bc4dde23c chore: builds preview example for next.js app router (#2718) 2023-07-06 13:18:31 -04:00
PatrikKozak
40d6fe0b09 chore: adjusts custom components docs (#2908) 2023-07-05 17:33:29 -04:00
Jacob Fletcher
9881d322f3 docs: fixes misc cloud typos (#2975) 2023-07-05 16:31:51 -04:00
Dan Ribbens
756fe197c2 Merge branch 'master' into feat/mongoose-adapter-merge 2023-07-05 16:30:19 -04:00
Dan Ribbens
1877d2247c fix: anchor Button component respect margins (#2648) 2023-07-05 16:20:25 -04:00
Dan Ribbens
1bf81f56ce chore(release): v1.11.0 2023-07-05 16:15:29 -04:00
Jarrod Flesch
606c3cf021 Merge branch 'master' of https://github.com/payloadcms/payload 2023-07-05 15:26:15 -04:00
Jarrod Flesch
d112159d93 docs: fix mdx formatting 2023-07-05 15:26:10 -04:00
Jacob Fletcher
79393e8cf0 fix: properly threads custom react-select props through relationship field (#2973) 2023-07-05 15:11:46 -04:00
Jarrod Flesch
5b79067cc1 fix: ensures fields within blocks respect field level access control (#2969) 2023-07-05 14:41:39 -04:00
Jessica Chowdhury
04851d0dc9 fix: ensures rows always have id's (#2968)
Co-authored-by: Jarrod Flesch <jarrodmflesch@gmail.com>
2023-07-05 14:40:50 -04:00
Dan Ribbens
23ea91ebe1 use db adapter in preferences 2023-07-05 14:19:12 -04:00
Dan Ribbens
ed82135d0d fix find version globals 2023-07-05 13:51:50 -04:00
Elliot DeNolf
7c47e4b0d3 feat: improve typing of ExtendableError and APIError (#2864) 2023-07-05 13:39:29 -04:00
Dan Ribbens
190cf2ddc9 remove unused file 2023-07-05 13:34:12 -04:00
Dan Ribbens
2c43db9461 correct sort used in findVersions 2023-07-05 13:33:17 -04:00
Alessio Gravili
b734a1c422 feat: narrow endpoint.method type (#1880)
Co-authored-by: Jarrod Flesch <jarrodmflesch@gmail.com>
2023-07-05 13:20:56 -04:00
Jacob Fletcher
9b22c4b654 docs: fixes misc links (#2971) 2023-07-05 12:02:56 -04:00
Elliot DeNolf
03c2b36b84 chore: move cross-env to runtime dep (#2970) 2023-07-05 11:58:19 -04:00
Elliot DeNolf
868823d9e1 chore(templates): change user collection to default access (#2972) 2023-07-05 11:58:07 -04:00
Jessica Boezwinkle
365b91e1b4 docs: misc cloud updates 2023-07-05 16:52:03 +01:00
Dan Ribbens
f85ba4a4a7 merges master 10.1.5 2023-07-05 11:50:17 -04:00
Jessica Chowdhury
221356f6b9 Merge pull request #2956 from payloadcms/docs/cloud
docs: adds Cloud docs
2023-07-05 16:22:26 +01:00
Jessica Boezwinkle
1db1de1116 docs: misc tweaks to cloud docs 2023-07-05 16:21:22 +01:00
Jessica Chowdhury
801f60939b fix: nested richtext bug and test (#2966)
* fix: nested richtext bug and test

* chore: fix accidentally deleted character
2023-07-05 09:06:02 -04:00
Tylan Davis
dfdd334d16 docs: adds Cloud docs 2023-06-30 19:07:48 -04:00
Jacob Fletcher
a8e47088bb chore: adds front-end to ecommerce template (#2942) 2023-06-30 17:36:58 -04:00
Alessio Gravili
29d8bf0927 fix: GraphQL type for number field (#2954) 2023-06-30 22:52:35 +02:00
Jacob Fletcher
8a32909dcd chore: fixes tsconfig and nodemon in custom server example (#2952) 2023-06-30 11:53:50 -04:00
James
c0eed02924 chore(release): v1.10.5 2023-06-30 10:29:45 -04:00
Alessio Gravili
1d4df99ea7 fix: improve versions test suite (#2941)
* fix: versions test

* fix: restore tests not being effective

* make tests better

* new test: should versions be in correct order
2023-06-30 15:35:59 +02:00
Jarrod Flesch
b36deb4640 fix: incorrect graphql type generation (#2898) 2023-06-30 08:54:19 -04:00
Alessio Gravili
0c2e41c4be fix: fields in drawer cannot be edited (#2949)
Fixes #2945
2023-06-30 14:43:47 +02:00
James
d9dd78ad00 chore(release): v1.10.4 2023-06-29 20:29:09 -04:00
James Mikrut
06711be846 Merge pull request #2939 from AlessioGr/locale-in-apiurl
feat: add locale to displayed API URL
2023-06-29 20:23:19 -04:00
James
bf0b114b70 chore(release): v1.10.3 2023-06-29 20:22:40 -04:00
James Mikrut
68b220ff73 Merge pull request #2943 from payloadcms/fix/#2937
fix: #2937, depth not being respected in graphql rich text fields
2023-06-29 20:13:32 -04:00
James
f84b4323e2 fix: #2937, depth not being respected in graphql rich text fields 2023-06-29 20:08:39 -04:00
Alessio Gravili
b9417a7e19 fix: limit 0 not working always, + typing 2023-06-29 19:48:22 +02:00
Dan Ribbens
682f8ecae4 wip merge master 2023-06-29 13:27:33 -04:00
Alessio Gravili
064af8acc7 add apiURL for globals 2023-06-29 17:42:49 +02:00
Alessio Gravili
b22d157bd2 feat: add locale to displayed API URL 2023-06-29 17:19:36 +02:00
Jacob Fletcher
0112f4c4ab chore: builds custom server example (#2920) 2023-06-28 16:35:41 -04:00
Jacob Fletcher
6670915323 chore: adds ecommerce template (#2929) 2023-06-28 12:51:17 -04:00
Jacob Fletcher
49f117e220 chore: adds website template (#2928) 2023-06-28 12:48:08 -04:00
James Mikrut
8df4b15116 Merge pull request #2927 from payloadcms/fix/show-updatedAt-date
fix: shows updatedAt date when selecting a version to compare
2023-06-28 12:03:37 -04:00
Jacob Fletcher
766b1b5286 chore: creates templates directory (#2921) 2023-06-28 11:20:59 -04:00
Tylan Davis
3c9dab3b9d fix: shows updatedAt date when selecting a version to compare from dropdown 2023-06-28 10:47:41 -04:00
Alessio Gravili
b4c049c745 feat: mongoose-adapter: findOne, sort direction, id => where and cleanup (#2918)
* chore: add jsDocs for buildQuery

* feat: where instead of id for updateOne and deleteOne

* feat: find => findOne

* sort order => sort direction

* fix: typing of Global buildQuery

* cleanup

* fix: init payload's i18n for error message

* fix: incorrect use of FindArgs in findByID

* move deleteOne call to adapter

* re-order

* deleteVersions

* versions stuff

* more version stuff

* moar version stuff

* global stuff

* global stuff

* move combineQueries inside the findGlobal

* global stuff

* fix type

* more global stuff

* move docWithFilenameExists to adapter pattern

* chore: remove unnecessary comments

* perf: make everything lean, disable virtuals, ++performance

* chore: remove unnecessary Model
2023-06-28 16:19:43 +02:00
James Mikrut
7d156ef555 Merge pull request #2910 from payloadcms/chore/error-messages
chore: improves error messaging in unlock/reset/forgot-password
2023-06-28 08:18:28 -04:00
Alessio Gravili
bc5aeb7840 feat: new sort for mongoose adapter (#2912)
* feat: new sort

* fix: undefined sort handling
2023-06-27 00:00:41 +02:00
James
1aa38f8fdd chore(release): v1.10.2 2023-06-26 17:58:23 -04:00
Jarrod Flesch
a2d9ef3ca6 fix: adjusts swc loader to only exclude non ts/tsx files - #2888 (#2907) 2023-06-26 13:53:08 -04:00
Jessica Boezwinkle
9fbd7476fb chore: improves error messaging in unlock/reset/forgot-password 2023-06-26 18:39:46 +01:00
Jarrod Flesch
f627277479 fix: correctly scopes data variable within bulk update - #2901 (#2904) 2023-06-26 11:56:53 -04:00
Alessio Gravili
696a215dd0 feat: move some stuff over to the new adapter pattern (#2880)
* chore: add jsdocs for limit

* moar jsdocs

* Replace find in deleteByID

* (check this:) add missing locale

* move findByID

* Make findByID return only one document

* _id => id

* _id => id

* Improve version types

* Improve sortOrder types

* move version stuff over

* version stuff

* fix: sort types

* fix params

* fix: findVersionByID generic

* fix: type error for versions

* remove unused value

* fix: Document import

* add todo

* feat: updateOne to mongoose

* remove unnecessary Model

* more update stuff

* remove unnecessary imports

* remove unnecessary function arguments

* fix: auth db update calls

* fix: bad updateByID which made tests fail

* fix: update returned docs to fix tests

* fix: update from version using mongoose directly even though the Model does not exist

* feat: implement deleteOne

* fix: assign verificationToken only when it exists - fixes test

* migrate saveVersion partly

* feat: make dev:generate-graphql-schema work even without specifying extra argument

* fix: this.db can be null

* chore: use destructured locale where possible

* chore: improve variable name

* fix: SanitizedConfig type

* feat: findGlobal database adapter

* fix: flaky e2e test

* chore: improve incorrect comment

* chore: undo diffs

* fix: id types

* fix: id typing
2023-06-26 17:45:52 +02:00
Jessica Chowdhury
0d17d4f38e Merge pull request #2903 from payloadcms/fix/autosave-localized-docs
fix: autosave on localized fields, adds test
2023-06-26 16:00:51 +01:00
Jessica Boezwinkle
7e98cf94f3 chore: remove comments from test 2023-06-26 16:00:21 +01:00
Jessica Boezwinkle
6893231f85 fix: autosave on localized fields, adds test 2023-06-26 15:27:30 +01:00
Elliot DeNolf
8206c0fe8b fix: safely check for tempFilePath when updating media document (#2899) 2023-06-23 15:35:12 -04:00
Teun Mooij
837dcccefe fix: broken export of entityToJSONSchema (#2894) 2023-06-22 16:21:37 -04:00
Dan Ribbens
3e05598b56 chore(release): v1.10.1 2023-06-22 14:38:28 -04:00
Dan Ribbens
8128de64df fix: Relationship hasMany and filterOptions fails above 10 items (#2891) 2023-06-22 14:28:03 -04:00
Jarrod Flesch
b83d788d3c fix: conditional fields perf bug - #2886 (#2890) 2023-06-22 13:51:24 -04:00
PatrikKozak
6e62aab66e Merge pull request #2817 from payloadcms/chore/api-keys-docs
Chore/api keys docs
2023-06-22 11:08:27 -04:00
PatrikKozak
5de3515fc8 chore: re-words portion of api key docs 2023-06-22 10:43:53 -04:00
PatrikKozak
65ac61f300 Merge branch 'master' of https://github.com/payloadcms/payload into chore/api-keys-docs 2023-06-22 10:10:28 -04:00
Jacob Fletcher
10b8d492b3 docs: vercel visual editing (#2883) 2023-06-21 17:56:54 -04:00
Dan Ribbens
b0b30f5aef mongoose adapter create operation (#2882) 2023-06-21 16:13:05 -04:00
James
7a0e085a1f chore: add todo for findGlobal 2023-06-21 11:36:32 -04:00
Jacob Fletcher
09c6cad3e8 fix: cutoff tooltips in relationship field (#2873) 2023-06-20 17:49:18 -04:00
Dan Ribbens
e4df1293d2 chore(release): v1.10.0 2023-06-20 17:19:31 -04:00
Dan Ribbens
ce84174554 fix: relationship field query pagination (#2871) 2023-06-20 17:03:40 -04:00
Jacob Fletcher
ba9d6336ac fix: mobile loading overlay width #2866 (#2867) 2023-06-20 16:05:48 -04:00
Jacob Fletcher
e90c2c4cb7 chore: simplifies relationship drawer field test (#2872) 2023-06-20 16:04:54 -04:00
Alessio Gravili
8f086e315c feat: hasMany for number field (#2517)
* added custom config extension points

* Added custom field to documentation

* fix: not building due to incorrect typings

* Upload dist

* point to number array test

* feat: hasMany for number field

* fix: types

* Fix: incorrectly styles input for hasMany

* Revert "point to number array test"

This reverts commit 5a5162a803.

* Revert "Merge branch 'production-with-custom' into number-hasmany-v2"

This reverts commit dfc3ac523e, reversing
changes made to a3b1b7dd67.

* test: adds test for numbers with hasMany

* test: add number field e2e

* Fix updated index.tsx

* Fix updated index.tsx

* chore: add jsDocs for hasMany property

* chore: rename isMultiText to isCreatable, as it makes more sense

* fix: incorrect double space in comments

* chore: rename onMultiTextChange to handleHasManyChange

* chore: improve ordering

* docs: add documentation for hasMany

* docs: add more jsdocs for number field

* fix: new value not transformed to number

* improve types

* fix: only allow numbers as input using filterOption

* fix: Option / value type breaking sortable selects

* fix: typings and add id for sorting

* add animation to react select

* undo transitions due to glitches

* fix: keyboard handler for select for empty input values

* fix: validation for hasMany numbers

* feat: perform validation in the filter as well

* attempt to fix duplicate key issue

* add todo

* remove console logs

* fix: stupid key warning

* fix: validation tests

* feat: add filterOption to keydown listener

* feat: numberOnly for react-select

* chore: improve variable naming

* fix: allow numbers for relationship value by stringifying those for sortable react-selects

* feat: generated types for hasMany number field

* graphql typings part 1

* graphql defaults type

* better typing for number in buildObjectType

* fix: default graphql type disregarding hasMany for relationship field

* feat: minRows and maxRows for hasMany numbers

* simplify joi schema

* working minRows and maxRows validation!

* jesus christ: fix incorrect translations for number & relationship fields for greaterThanMax and lessThanMin

* fix weird type error

* move validation tests to validations.spec.ts and fix them

* fix: make sure filterOption only passes a number array to validate function

* fix: adds missing dark-mode styles for version differences view (#2812)

Co-authored-by: Tylan Davis <tylan@Tylans-MacBook-Pro.local>

* fix: #2821 i18n ui field label (#2823)

* chore: version diff styles (#2824)

Co-authored-by: Tylan Davis <tylan@Tylans-MacBook-Pro.local>

* chore: remove --legacy-peer-deps from gh actions workflow (#2814)

* chore: removes cms text from instances of payload name (#2793)

* chore(release): v1.9.2

* chore: update changelog release notes v1.9.2

* chore: cleans up graphql-schema-gen test folder

* fix: adds custom property to ui field in joi validation (#2835)

* adjust validation

* improve isnumber function

* Update number.mdx

---------

Co-authored-by: Teun Mooij <tmooij@infinitaslearning.com>
Co-authored-by: Dan Ribbens <dan.ribbens@gmail.com>
Co-authored-by: Tylan Davis <89618855+tylandavis@users.noreply.github.com>
Co-authored-by: Tylan Davis <tylan@Tylans-MacBook-Pro.local>
Co-authored-by: Dan Ribbens <DanRibbens@users.noreply.github.com>
Co-authored-by: Jacob Fletcher <jacobsfletch@gmail.com>
Co-authored-by: Jarrod Flesch <jarrodmflesch@gmail.com>
Co-authored-by: Jarrod Flesch <30633324+JarrodMFlesch@users.noreply.github.com>
2023-06-20 20:21:27 +02:00
Alessio Gravili
542b5362d3 fix: drawer fields are read-only if opened from a hasMany relationship (#2843) 2023-06-20 11:22:49 -04:00
Jacob Fletcher
8626dc6b1a fix: fields in relationship drawer not usable #2815 (#2870) 2023-06-20 11:21:23 -04:00
Alessio Gravili
a110ba2dc0 fix: drawer close on backspace (#2869) 2023-06-20 10:10:29 -04:00
Dan Ribbens
3863959c53 chore: change db adapter args 2023-06-19 16:46:17 -04:00
James
85d2467d73 fix: #2831, persists payloadAPI through local operations that accept req 2023-06-19 15:57:04 -04:00
Dan Ribbens
99f38098dd fix: default sort with near operator (#2862) 2023-06-19 15:17:22 -04:00
James Mikrut
b1123a4978 Merge pull request #2856 from payloadcms/feat/conditional-logic-perf
feat: optimizes conditional logic performance
2023-06-19 15:03:50 -04:00
James
4af8d56479 chore: ensures conditions are run in all appropriate cases 2023-06-19 15:03:34 -04:00
digitaledge-git
16118960aa fix: near query sorting by distance and pagination (#2861) 2023-06-19 14:54:40 -04:00
James
2c5a737715 chore: fixes initial state for url field 2023-06-19 13:39:11 -04:00
James Mikrut
5fa77d40b9 Merge pull request #2858 from payloadcms/fix/#2842
fix: #2842, querying number custom ids with in
2023-06-19 11:18:58 -04:00
Alessio Gravili
e9106882f7 feat: automatically redirect a user back to their originally requested URL after login (#2838) 2023-06-19 11:15:58 -04:00
James Mikrut
42f0db4251 Merge pull request #2800 from AlessioGr/improve-error
chore: improve error message during webpack load
2023-06-19 11:13:42 -04:00
James Mikrut
c3533dac2a Merge pull request #2846 from dpnolte/chore/disable_eslint_for_generated_types
chore: disable eslint on generated types
2023-06-19 11:11:48 -04:00
James Mikrut
8d52e5f078 Merge pull request #2830 from payloadcms/chore/depth-docs
chore: updates depth docs with N + 1 concept
2023-06-19 11:10:08 -04:00
James
116e9ffe81 fix: #2842, querying number custom ids with in 2023-06-19 11:02:30 -04:00
James
967f217346 feat: optimizes conditional logic performance 2023-06-19 10:48:17 -04:00
James Mikrut
da2a94d0b2 Merge pull request #2850 from AlessioGr/fix-configToJSONSchema
fix: old entityToJSONSchema being exported
2023-06-19 10:28:02 -04:00
James Mikrut
6c2b726fe1 Merge pull request #2855 from payloadcms/fix/#2832
fix: #2832, slow like queries with lots of records
2023-06-19 10:18:49 -04:00
James
4dd703a6bf fix: slow like queries with lots of records 2023-06-19 10:13:47 -04:00
Dan Ribbens
c60886fe3e docs: preferences graphql 2023-06-18 22:56:30 -04:00
Alessio Gravili
762b572c51 configToJSONSchema 2023-06-18 17:24:58 +02:00
Dan Ribbens
c7f40dd860 chore: remove mongoose models from auth 2023-06-18 08:38:40 -04:00
Dan Ribbens
832c19c1f7 chore: lint fix 2023-06-18 07:42:13 -04:00
Derk Nolte
6ca371cb8b chore: disable eslint on generated types 2023-06-18 10:14:21 +02:00
Alessio Gravili
0d8d7f358d fix: deprecate min/max in exchange for minRows and maxRows for relationship field (#2826)
* fix: deprecate min/max in exchange for minRows and maxRows for relationship

* fix: update validations unit tests with minRows and maxRows

* fix: incorrect types

* move to sanitize
2023-06-18 02:09:30 +02:00
James
51c2ab1672 chore(release): v1.9.5 2023-06-16 17:41:40 -04:00
James
a88f86cc3f chore: ensures objectid within works properly 2023-06-16 17:37:15 -04:00
Dan Ribbens
25151ee191 chore: collection based preferences (#2820)
**BREAKING CHANGES**

Preferences have been overhauled to be abstracted as a Payload collection and no longer explicitly defined by Payload. They previously used the slug `_preferences` as a collection name and url route and are now

If any of the following are true you will need to take action:
- You have existing preferences you wish to keep for your admin users you must migrate data in the _preferences collection to the new shape. To migrate the preferences in the database you must update the shape of each _preferences document from:
```js
{
  user: ObjectId("abc"),
  userCollection: "users",
  /** other fields remain the same **/
}
```
to:
```js
{
  user: {
    value: 'abc',
    relationTo: 'users",
  }
  /** other fields remain the same **/
}
```
- You have code external of Payload or custom code within Payload using the API endpoint `api/_preferences`, you should update any applications to use `api/payload-preferences` instead.
- You were using the preferences GraphQL implementation. This was removed and is instead provided the same way as Payload handles any other. In this way the queries, mutation and schemas have changed. These are now generated as any other collection within your payload project.
- You were using the Payload's exported Preference type for your typescript code. Now you can instead import the generated type from your project.
2023-06-16 16:58:36 -04:00
James
451c8c7548 chore(release): v1.9.4 2023-06-16 16:43:40 -04:00
James Mikrut
528645d407 Merge pull request #2791 from no-heroes/fix/pagination-false-totaldocs
fix: totalDocs is always 1 when using payload.find({ pagination: false })
2023-06-16 16:37:50 -04:00
James
70cf8487e7 chore(release): v1.9.3 2023-06-16 16:17:34 -04:00
James
aa09e566e0 Merge branch 'master' of github.com:payloadcms/payload 2023-06-16 15:50:16 -04:00
James
c3d6e1b490 fix: ensures relations to object ids can be queried on 2023-06-16 15:50:09 -04:00
Jarrod Flesch
6580f43e53 chore: relocates configToJSON alongside entityToJSON and fieldsToJSON (#2827) 2023-06-16 12:42:59 -04:00
Jarrod Flesch
56d7745139 fix: adds custom property to ui field in joi validation (#2835) 2023-06-16 09:09:31 -04:00
PatrikKozak
ee1c7db915 chore: updates depth docs with N + 1 concept 2023-06-15 16:59:27 -04:00
Dan Ribbens
504f5190d5 chore: normalize payload collections and globals outside db adapter 2023-06-15 16:50:11 -04:00
Jarrod Flesch
b682c76dc7 chore: cleans up graphql-schema-gen test folder 2023-06-15 09:54:53 -04:00
James
6aabdd05be chore: adds mongoose mock 2023-06-14 17:41:49 -04:00
Dan Ribbens
0d035a9c23 chore: update changelog release notes v1.9.2 2023-06-14 11:33:07 -04:00
Dan Ribbens
8310950f7b chore(release): v1.9.2 2023-06-14 11:32:14 -04:00
Jacob Fletcher
120e2936fe chore: removes cms text from instances of payload name (#2793) 2023-06-14 10:31:29 -04:00
Alessio Gravili
884f7991c4 chore: remove --legacy-peer-deps from gh actions workflow (#2814) 2023-06-14 10:23:48 -04:00
Tylan Davis
9664e4b96f chore: version diff styles (#2824)
Co-authored-by: Tylan Davis <tylan@Tylans-MacBook-Pro.local>
2023-06-14 10:21:23 -04:00
Dan Ribbens
63cd7fbd0c fix: #2821 i18n ui field label (#2823) 2023-06-14 08:39:45 -04:00
Tylan Davis
346a48f871 fix: adds missing dark-mode styles for version differences view (#2812)
Co-authored-by: Tylan Davis <tylan@Tylans-MacBook-Pro.local>
2023-06-14 08:29:13 -04:00
Jessica Boezwinkle
8fe3e59e76 Merge branch 'docs/misc-updates' 2023-06-13 17:35:52 +01:00
Jessica Boezwinkle
74d6156e8d chore: adds credentials to rest api examples 2023-06-13 17:35:39 +01:00
PatrikKozak
e834424a4c Merge branch 'master' of https://github.com/payloadcms/payload into chore/api-keys-docs 2023-06-13 12:25:09 -04:00
PatrikKozak
465d8b0245 chore: updates authentication/api-keys docs 2023-06-13 12:25:02 -04:00
Jessica Boezwinkle
25e9c1a50a fix: adds async await to payload.init example 2023-06-13 17:02:35 +01:00
Jessica Boezwinkle
d601cdd29e fix: adds async await to payload.init example 2023-06-13 17:01:55 +01:00
Jessica Chowdhury
5646ce9d8f Merge pull request #2810 from payloadcms/docs/blocks-table
docs: fix blocks table
2023-06-13 09:28:56 +01:00
James
87ba8b1f58 chore: removes some findOnes 2023-06-12 22:07:24 -04:00
James
5433560f8d chore: bulk update 2023-06-12 21:44:01 -04:00
James
05ed6d9721 chore: stubs out global versions queries 2023-06-12 21:38:10 -04:00
James
f74ff8f6bf chore: stubs out find adapter method 2023-06-12 20:18:09 -04:00
James
41acf71013 chore: passing tests 2023-06-12 19:41:08 -04:00
James
03c004f3d8 chore: progress to simplifying buildQuery logic 2023-06-12 17:59:05 -04:00
James
2be33a0fca chore: improves types for mongoose adapter model handling 2023-06-12 17:39:26 -04:00
James
5762d80945 Merge branch 'feat/mongoose-adapter' of github.com:payloadcms/payload into feat/mongoose-adapter 2023-06-12 16:50:11 -04:00
James Mikrut
a72d6fcb13 Merge pull request #2789 from payloadcms/chore/abstract-query-validation-complete
chore: refactor query validation outside of mongoose
2023-06-12 16:49:56 -04:00
James
4073c63cec chore: stubs out query drafts 2023-06-12 16:49:10 -04:00
James
2737fd400f chore: begins adapter 2023-06-12 16:36:13 -04:00
Jessica Boezwinkle
f7cacbe932 docs: fix blocks table 2023-06-12 17:27:18 +01:00
Alessio Gravili
abe38520aa fix: user can be created without having to specify an email - #2801 2023-06-12 17:35:06 +02:00
Jarrod Flesch
46a5f41721 fix: sanitize reset password result - #2805 (#2808) 2023-06-12 11:23:24 -04:00
Alessio Gravili
2aea4150a0 improve error message 2023-06-10 21:53:30 +02:00
James
4b2b4c3f9f chore(release): v1.9.1 2023-06-09 16:18:47 -04:00
PatrikKozak
b655809903 Merge pull request #2797 from payloadcms/feat/customize-upload-filename
Feat/customize upload filename
2023-06-09 14:58:06 -04:00
PatrikKozak
2e60830f6a Merge branch 'master' of https://github.com/payloadcms/payload into feat/customize-upload-filename 2023-06-09 14:41:45 -04:00
PatrikKozak
752b5456b9 chore: updates test/uploads test to check for value not text 2023-06-09 14:28:27 -04:00
PatrikKozak
35f7677d48 chore: updates test/fields uploads test to check for value not text 2023-06-09 13:34:24 -04:00
PatrikKozak
a3b7da25bc Merge branch 'master' of https://github.com/payloadcms/payload into feat/customize-upload-filename 2023-06-09 12:39:01 -04:00
PatrikKozak
596eea1f0a feat: adds option to customize filename on upload 2023-06-09 12:38:53 -04:00
Jarrod Flesch
725aa3183d chore: stubs out config for field perf testing 2023-06-09 11:27:18 -04:00
Jarrod Flesch
cf49f53809 Merge remote-tracking branch 'origin' into feat/array-rows 2023-06-09 11:03:41 -04:00
Jarrod Flesch
20c7e37345 chore: block array fixes 2023-06-08 11:49:54 -04:00
Alessio Gravili
38e962f2cb feat: collection list view custom components: BeforeList, BeforeListTable, AfterListTable, AfterList (#2792) 2023-06-08 09:33:16 -04:00
Jarrod Flesch
3efb651589 chore: simplifies get/set doc prefs 2023-06-07 22:47:56 -04:00
Jarrod Flesch
589eb3fa15 chore: removes console logs, accounts for initCollapsed 2023-06-07 22:31:36 -04:00
Jarrod Flesch
87554e9b16 chore: builds rows on init, refactors preferences for documents 2023-06-07 22:21:08 -04:00
Richard van Heuven van Staereling
2e73938534 fix: incorrectly return totalDocs=1 instead of the correct count when pagination=false 2023-06-07 23:36:59 +02:00
Richard van Heuven van Staereling
acf2564c73 chore: adds test to check totalDocs count when querying with pagination=false 2023-06-07 23:36:51 +02:00
Dan Ribbens
91dba7be88 chore(release): v1.9.0 2023-06-07 16:59:38 -04:00
Dan Ribbens
e020e7598a cleanup imports 2023-06-07 16:47:30 -04:00
Elliot DeNolf
b49591c236 docs: add troubleshooting section, CORS troubleshoot (#2790) 2023-06-07 16:40:34 -04:00
Dan Ribbens
cecea07b4d validate query handle nested version paths 2023-06-07 16:26:29 -04:00
Dan Ribbens
8ca3f3c53c allow hidden fields to query with overrideAccess 2023-06-07 15:10:45 -04:00
Dan Ribbens
4e617abf08 validate query sanitize _id 2023-06-07 14:50:32 -04:00
Dan Ribbens
e2cba16698 validate query use versionFields in query drafts 2023-06-07 14:40:49 -04:00
Dan Ribbens
49eac7368e validate query for poly relationships 2023-06-07 14:40:23 -04:00
Jarrod Flesch
8458a98eff feat: custom type interfaces (#2709)
* feat: ability to hoist type interfaces and reuse them

* docs: organizes ts and gql docs, adds section for field interfaces on both
2023-06-07 12:48:41 -04:00
Dan Ribbens
a518480292 chore(release): v1.8.6 2023-06-07 09:36:32 -04:00
Dan Ribbens
8908ac4646 validate nested paths 2023-06-07 07:09:07 -04:00
Dan Ribbens
47fd704630 execute access before validate query 2023-06-07 00:35:08 -04:00
Dan Ribbens
38d1a98193 prevent reassigning global version fields 2023-06-06 23:31:17 -04:00
Jarrod Flesch
a324feae9d chore: fixes graphql overview mdx file 2023-06-06 21:37:41 -04:00
Jarrod Flesch
551f1bd09f Merge remote-tracking branch 'origin/master' into feat/array-rows 2023-06-06 17:12:28 -04:00
Elliot DeNolf
d5dfe4224d test: entityToJSONSchema test for optional arrays with required fields 2023-06-06 16:35:36 -04:00
Dan Ribbens
aa848eef90 chore: separate query validation from build query 2023-06-06 16:35:34 -04:00
James
f1fc305ac4 fix: improperly typing optional arrays with required fields as required 2023-06-06 16:22:06 -04:00
Dan Ribbens
12e9cd5db1 chore: refactor getLocalizedPaths 2023-06-06 15:39:56 -04:00
Dan Ribbens
23dddc2e04 chore: refactor buildQuery to remove paramParser class 2023-06-06 15:36:43 -04:00
Dan Ribbens
1ea83f6349 chore: refactor parsePathOrRelation 2023-06-06 15:36:43 -04:00
Dan Ribbens
07a5801798 chore: separate parsePathOrRelation and buildAndOrConditions from buildQuery 2023-06-06 15:36:43 -04:00
Dan Ribbens
db71774fc2 chore: separate buildSearchParams from buildQuery 2023-06-06 15:36:43 -04:00
Dan Ribbens
2b80ad2bb4 chore: refactor getLocalizedPaths 2023-06-06 15:36:41 -04:00
Dan Ribbens
37ca5d827b chore: updated yarn lock 2023-06-06 15:20:14 -04:00
Jacob Fletcher
1aa257df4b chore: uses discord vanity urls (#2786) 2023-06-06 15:07:24 -04:00
Dan Ribbens
e4843061f0 Merge branch 'master' of github.com:payloadcms/payload 2023-06-06 14:50:33 -04:00
Alessio Gravili
3c72f3303c fix: read-only Auth fields (#2781) 2023-06-06 14:50:15 -04:00
Alessio Gravili
60f5522e67 fix: read-only Auth fields (#2781) 2023-06-06 14:50:03 -04:00
Dan Ribbens
576af01b6f fix: #2711 index sortable field global versions fields (#2775) 2023-06-06 14:46:14 -04:00
Dan Ribbens
8b767a166a fix: #2771 relationship field not querying all collections (#2774) 2023-06-06 14:26:13 -04:00
Jarrod Flesch
684c1a81a4 chore: exposes all operator in ts type (#2777) 2023-06-06 13:47:45 -04:00
Dan Ribbens
7a72f2f88d Merge branch 'master' of github.com:payloadcms/payload 2023-06-06 11:32:46 -04:00
James Mikrut
21ddcf07f7 Merge pull request #2779 from payloadcms/fix/#2767-bulk-operation-locales
fix: #2778 bulk operations missing locales in admin requests
2023-06-06 11:17:41 -04:00
James Mikrut
03b1ee0896 chore: remove passport local mongoose (#2713) 2023-06-06 10:07:47 -04:00
Dan Ribbens
e30871a96f fix: #2767 bulk operations missing locales in admin requests 2023-06-05 17:26:08 -04:00
Jacob Fletcher
3677cf688d fix: flattens relationships in the update operation for globals #2766 (#2776) 2023-06-05 17:22:57 -04:00
Jacob Fletcher
863be3d852 fix: adjusts activation constraint of draggable nodes (#2773) 2023-06-05 14:22:40 -04:00
Jarrod Flesch
2b4cf08f3a chore: combines array and block row state into array field attribute 2023-06-05 12:35:20 -04:00
Alessio Gravili
bd017bf56b chore: update launch config (#2772) 2023-06-05 12:22:58 -04:00
Alessio Gravili
ce7acff6d6 chore: add alternative vscode launch config (#2759) 2023-06-05 12:01:51 -04:00
Jarrod Flesch
536d7017ee fix: recursiveNestedPaths not merging existing fields when hoisting row/collapsible fields (#2769) 2023-06-04 08:49:23 -04:00
James
7c03e5510c chore(release): v1.8.5 2023-06-02 17:22:37 -07:00
James
ceb9b87783 Merge branch 'master' of github.com:payloadcms/payload 2023-06-02 17:02:29 -07:00
James
42afa6b48a feat: allows objectid through relationship validation 2023-06-02 17:02:10 -07:00
Dan Ribbens
3c7d57a73b chore: update changelog 2023-06-02 15:10:13 -04:00
Dan Ribbens
dcfd06c425 chore(release): v1.8.4 2023-06-02 15:08:08 -04:00
Alessio Gravili
23be263dd2 fix: RichText link custom fields (#2756)
Co-authored-by: Dan Ribbens <dan.ribbens@gmail.com>
2023-06-02 13:55:46 -04:00
Jarrod Flesch
f978299868 fix: graphql where types on rows and collapsible's (#2758)
Co-authored-by: Kári Yngvason <kari@hugsmidjan.is>
Co-authored-by: NikolaGanchev <62907292+NikolaGanchev@users.noreply.github.com>
Co-authored-by: James <james@trbl.design>
2023-06-02 13:50:19 -04:00
Jacob Fletcher
dbb0137ea0 chore: updates README 2023-06-02 12:12:29 -04:00
NikolaGanchev
51108c02ea feat: Add Bulgarian translation (#2753) 2023-06-01 18:43:17 -04:00
Alessio Gravili
69b97bbc59 fix: mongoose connection (#2754) 2023-06-01 12:03:47 -04:00
Dan Ribbens
f2399bc05a chore: fix bad merge 2023-05-31 15:56:57 -04:00
Dan Ribbens
93a85dd937 chore: allow custom mongourl during test (#2743)
Co-authored-by: swenzel <swen.wenzel@thearc.de>
Co-authored-by: PatrikKozak <patrik@trbl.design>
2023-05-31 15:51:49 -04:00
Jessica Chowdhury
8ee9724277 fix: fix locale popup overflow (#2737)
* fix: fix locale popup overflow

* chore: refines locale selector css

---------

Co-authored-by: Jarrod Flesch <jarrodmflesch@gmail.com>
2023-05-30 15:49:30 -04:00
PatrikKozak
7c446ec71a Merge pull request #2636 from AlessioGr/test-console-log-admin-url
fix: console log correct admin URL for tests
2023-05-30 15:07:28 -04:00
Jessica Chowdhury
f2451d03c1 chore: formats filesize to KB in upload collection list view (#2734) 2023-05-30 14:45:12 -04:00
Jarrod Flesch
0986282f13 fix: adds timestamps to global schemas (#2738) 2023-05-30 14:37:43 -04:00
Jessica Chowdhury
d3638bcb24 Merge pull request #2730 from StLyn4/typing-fixes
fix: typing of sendEmail function
2023-05-30 18:45:39 +01:00
Jessica Chowdhury
f386d1caad Merge pull request #2731 from payloadcms/fix/2729-code-editor-options
fix: adjusts code field joi schema to allow editorOptions
2023-05-30 18:30:37 +01:00
Jacob Fletcher
480c7b3e21 Merge pull request #2736 from payloadcms/fix/use-as-title
fix: searches on correct useAsTitle field in polymorphic list drawers
2023-05-30 13:11:03 -04:00
Jacob Fletcher
908d5747a8 chore: allows super-admins to view as tenant in multi-tenant example (#2719) 2023-05-30 13:10:14 -04:00
Jacob Fletcher
9ec2a40274 fix: searches on correct useAsTitle field in polymorphic list drawers #2710 2023-05-30 12:41:28 -04:00
James Mikrut
a080a6294c Merge pull request #2733 from payloadcms/chore/ui-field-doc
chore: updates ui field docs to show admin.components.Field is required
2023-05-30 12:05:05 -04:00
PatrikKozak
9be854a1a4 chore: updates ui field docs to show admin.components.Field is required 2023-05-30 12:01:33 -04:00
Jacob Fletcher
c76dc77e64 chore: writes e2e test for list drawer useAsTitle search 2023-05-30 11:28:26 -04:00
Elliot DeNolf
a42f17ca41 chore: use Discord vanity URL 2023-05-30 09:57:02 -04:00
Jarrod Flesch
ed136fbc51 fix: adjusts code field joi schema to allow editorOptions 2023-05-30 08:56:37 -04:00
Vsevolod Volkov
e3ff4c46cb fix: typing of sendMail function
Signed-off-by: Vsevolod Volkov <st.lyn4@gmail.com>
2023-05-30 14:31:19 +03:00
Jacob Fletcher
6125b66286 fix: removes payload dependency inception (#2717) 2023-05-26 16:24:10 -04:00
Jarrod Flesch
8285bac2f5 fix: corrects relationship field schema from pr #2696 (#2714) 2023-05-26 11:03:02 -04:00
James Mikrut
61bb0fae53 fix: username / email inconsistency when creating new users
Fixed UserExistsError error message
2023-05-25 20:47:05 -04:00
Jessica Chowdhury
47b9af970b Merge pull request #2665 from payloadcms/example/emails
example: email
2023-05-25 18:22:45 +01:00
Jarrod Flesch
731c85337b chore: stop tests from re-running when a PR body is edited (#2712) 2023-05-25 09:28:02 -04:00
James Mikrut
4b59fda56f Merge pull request #2708 from payloadcms/jmikrut-patch-1
Update overview.mdx
2023-05-24 15:16:53 -04:00
James Mikrut
2361221198 Update overview.mdx 2023-05-24 15:16:14 -04:00
Dan Ribbens
d931ba9b50 chore: update changelog 2023-05-24 13:12:53 -04:00
Dan Ribbens
51fd1db4eb chore(release): v1.8.3 2023-05-24 12:00:55 -04:00
Dan Ribbens
dbd4dd215a chore: yarn lock 2023-05-24 11:44:31 -04:00
Jarrod Flesch
c716954e89 fix: adds credentials to doc access request (#2705) 2023-05-24 10:39:03 -04:00
TomDo1234
5be247da0a Merge branch 'master' of https://github.com/TomDo1234/payload 2023-05-24 07:18:27 +10:00
TomDo1234
b47e84369c fixed UserExistsError message to say email instead of username 2023-05-24 07:12:58 +10:00
TomDo1234
fe7ddf3e0f Merge branch 'master' of https://github.com/TomDo1234/payload 2023-05-24 06:42:46 +10:00
Jacob Fletcher
2fc9288870 feat: builds multi-tenant example (#2689)
* feat: builds multi-tenant example

* chore: updates seed script logic
2023-05-23 16:40:18 -04:00
Jarrod Flesch
f9de807daa Fix: correct graphql param types (#2696)
* chore: colocates gql schema field types with operators
* chore: adds missing `json` gql field schema
* fix: corrects graphql `id` type from JSON to String
2023-05-23 15:27:35 -04:00
Jacob Fletcher
e85ce4eaf2 Merge pull request #2694 from payloadcms/fix/rel-drawer-save
fix: add new relationship drawer onSave handling
2023-05-23 15:24:22 -04:00
Jacob Fletcher
5fc36333b9 Merge pull request #2699 from payloadcms/fix/mobile-rel
fix: unable to clear relationships or open relationship drawer on mobile
2023-05-23 15:24:01 -04:00
Jacob Fletcher
2809cb910c chore: fixes broken test for externally updated relationships 2023-05-23 10:37:52 -04:00
Jacob Fletcher
782f8ca047 fix: unable to clear relationships or open relationship drawer on mobile #2691 #2692 2023-05-23 10:08:16 -04:00
Quentin Beauperin
8bdbd6b073 docs: fix global hooks intro anchor links (#2695) 2023-05-23 09:31:22 -04:00
James Mikrut
7fbd5adaa2 Merge pull request #2687 from payloadcms/chore/install-doc-mongo-uri-secret
chore: updates installation doc to use envs in server.ts example
2023-05-23 08:46:20 -04:00
James Mikrut
324ca171a3 Merge pull request #2693 from payloadcms/fix/2685-graphql-relations
Fix/2685 graphql relations
2023-05-23 08:37:53 -04:00
Jacob Fletcher
bbf114b822 chore: writes e2e test for relationships created using the document drawer 2023-05-22 23:59:09 -04:00
Jacob Fletcher
a2a8ac9549 fix: prevents add new relationship modal from adding duplicative values to the parent doc #2688 2023-05-22 18:01:23 -04:00
Jacob Fletcher
ae384306eb chore: threads operation through the default edit view onSave handler 2023-05-22 17:13:35 -04:00
James Mikrut
9c4e003315 Merge pull request #2690 from payloadcms/fix/#2662
fix: #2662, draft=true querying by id
2023-05-22 16:43:41 -04:00
James
9bb5470342 fix: #2685, graphql querying relationships with custom id 2023-05-22 16:40:24 -04:00
Elliot DeNolf
2f209e3e9b chore: recreate issue in test dir 2023-05-22 16:14:28 -04:00
James
314ddbd44c chore: tests 2023-05-22 15:50:54 -04:00
James
3b78ab04c7 fix: #2662, draft=true querying by id 2023-05-22 15:46:04 -04:00
Dan Ribbens
bb21f51f74 Merge branch 'fix/safely-validate-relationships' 2023-05-22 13:58:47 -04:00
Dan Ribbens
666c2383ba chore: lint fix 2023-05-22 13:58:25 -04:00
James
2703853edb fix: safely validates null relations 2023-05-22 13:46:11 -04:00
PatrikKozak
f728fca036 chore: updates installation doc to use envs in server.ts example 2023-05-22 11:29:41 -04:00
Dan Ribbens
368103d76d Merge branch 'master' of github.com:payloadcms/payload 2023-05-20 05:00:08 -04:00
Quentin Beauperin
3a2462baba docs: add missing admin.group property in configuration/globals (#2684) 2023-05-20 04:35:50 -04:00
Jessica Boezwinkle
bd2bfbbb93 docs: spacing fix on graphql docs 2023-05-19 16:59:23 +01:00
Jessica Boezwinkle
1300fc864c docs: additional params for find operation rest-api 2023-05-19 15:10:24 +01:00
Jessica Boezwinkle
ef2d17922b docs: adds rest-api examples for real this time 2023-05-19 14:49:06 +01:00
Dan Ribbens
b63dd40512 chore: release-it config update to include pre release on github 2023-05-18 12:00:49 -04:00
Quy Luong
fb82567f03 chore: fix and improve Vietnamese translation (#2651) 2023-05-18 11:57:22 -04:00
James Mikrut
b2c443e866 fix: #2647, slate not reinitializing after row change (#2653) 2023-05-18 11:56:25 -04:00
Jacob Fletcher
07d0324a6d Merge pull request #2677 from payloadcms/docs/node-version
docs: node version
2023-05-17 17:13:47 -04:00
Jacob Fletcher
c1e92ad27d fix: modal overflow caused by unused button tooltips (#2676) 2023-05-17 17:13:04 -04:00
Jacob Fletcher
28e481c2e2 Merge pull request #2656 from payloadcms/feat/peer-dep-conflicts
fix: peer dependencies
2023-05-17 17:12:39 -04:00
Jacob Fletcher
1ceea645b6 chore: replaces instances of the text Mongo with MongoDB 2023-05-17 16:35:55 -04:00
Jacob Fletcher
578e5e7e58 docs: updates node version requirement to v14 in installation docs 2023-05-17 16:29:03 -04:00
Jacob Fletcher
463d00732f chore: removes unused peer dependencies 2023-05-17 15:32:23 -04:00
Jacob Fletcher
698a8abe6e chore: fixes failing e2e test when searching within a relationship field 2023-05-17 12:25:24 -04:00
Roody
776877291f chore: Spelling and Grammar Fixes in German Translations (#2667) 2023-05-17 11:04:11 -04:00
Jacob Fletcher
1c25d965ac fix: react-select styles 2023-05-16 12:03:58 -04:00
Jessica Boezwinkle
bc41f81303 example: adds email example 2023-05-16 11:07:33 +01:00
Jarrod Flesch
648c38414e fix: disabled select fields 2023-05-15 16:49:40 -04:00
PatrikKozak
02b972e1ed fix: corrects sendEmail error logger (#2663) 2023-05-15 16:11:33 -04:00
Jacob Fletcher
dd38a08746 chore: bumps @trbl/eslint-config to v3.0.1 2023-05-12 17:50:29 -04:00
Jacob Fletcher
315b0059da chore: migrates to react-select v5.7.3 2023-05-12 17:50:24 -04:00
James
4d3ea70d2b chore: resolves all peer dep conflicts besides react-select 2023-05-12 11:50:05 -04:00
Dan Ribbens
29a0dcffc7 chore(release): v1.8.2 2023-05-10 18:44:00 -04:00
Dan Ribbens
1732bb877c fix: react webpack alias 2023-05-10 18:35:01 -04:00
Dan Ribbens
fc1fac08c8 chore(release): v1.8.1 2023-05-10 18:25:54 -04:00
Dan Ribbens
1d03de333c Revert "Merge pull request #2572 from wesdimiceli/fix/provide-plugin-package-resolution"
This reverts commit 4f5b811383, reversing
changes made to 776cad427d.
2023-05-10 18:12:39 -04:00
Dan Ribbens
74f086a460 Merge branch 'master' of github.com:payloadcms/payload 2023-05-10 15:00:02 -04:00
Dan Ribbens
6e93e3e25d chore: release v1.8.0 2023-05-10 14:45:42 -04:00
Jessica Boezwinkle
d53d0cb439 chore: updates payload version on example repos 2023-05-10 15:56:57 +01:00
Paul
3f185cb18b feat: export additional graphql types (#2610)
* Add paginatedType to graphQL on collections types

* Refactor config query and mutation extension into a reusable type

* Export paginatedListType and payload's version of graphql

* Revert prettier's automatic changes

* Fix requested changes

* Add additional documentation for extending GraphQL

* Add information about the resolver's first argument
2023-05-10 08:53:46 -04:00
Paul
7963e7540f fix: add dotenv.config() to test/dev.ts (#2646) 2023-05-10 08:47:22 -04:00
Angelo Bartolome
85316879cd feat: allow users to manipulate images without needing to resize them (#2574)
* Refactor imageResizer.ts to allow for keeping original size in certain cases

* revert new property for keeping desired size

* add unit tests for maintained image size feature
2023-05-10 08:44:53 -04:00
Jacob Fletcher
69c4760f37 chore: migrates react-router-dom to v5.1 (#2637) 2023-05-09 10:35:37 -04:00
Dan Ribbens
7d04cf14fb feat: add Arabic translations (#2641) 2023-05-09 10:15:23 -04:00
Quentin Beauperin
9072096495 fix: softens columns and filters pill colors (#2642) 2023-05-08 17:59:41 -04:00
Elliot DeNolf
f6cfe15807 Merge pull request #2639 from payloadcms/chore/eslint-config
chore: migrate eslint config
2023-05-08 17:03:29 -04:00
Elliot DeNolf
e1bad04279 chore: lint fix 2023-05-08 16:49:13 -04:00
Elliot DeNolf
dda3341537 chore: upgrade rules to latest eslint-plugin-jest 2023-05-08 16:33:58 -04:00
Elliot DeNolf
6e27795756 chore: migrate @trbl/eslint-config inline 2023-05-08 16:33:19 -04:00
Dennis Snijder
54fac4a5d7 fix: Row groups in tabs vertical alignment (#2593)
* fix: removes top padding from group in row

---------

Co-authored-by: PatrikKozak <patrik@trbl.design>
2023-05-08 15:55:12 -04:00
Alessio Gravili
2697974694 fix: fix tests by hard-coding the URL in the logger 2023-05-08 19:23:09 +02:00
Elliot Lintz
a9b5dffa00 feat: allow full URL in staticURL (#2562)
* feat: support full URL for upload.staticURL

* feat: Update documentation about upload.staticURL property

* feat: Add reproduction test for absolute staticURL
2023-05-08 13:17:16 -04:00
Alessio Gravili
095ccf7194 chore: set serverURL for tests 2023-05-08 19:04:27 +02:00
James Mikrut
4f5b811383 Merge pull request #2572 from wesdimiceli/fix/provide-plugin-package-resolution
fix: resolve process/browser package in webpack config
2023-05-08 12:52:55 -04:00
James Mikrut
776cad427d Merge pull request #2635 from payloadcms/fix/2611-nested-querying
fix: ensures nested querying works when querying across collections
2023-05-08 12:49:55 -04:00
Jarrod Flesch
d365ba5303 chore: fixes test 2023-05-08 12:24:24 -04:00
Jarrod Flesch
31c0ab7ab7 chore: strengthens int test 2023-05-08 12:22:08 -04:00
Jarrod Flesch
09974fa686 fix: ensures nested querying works when querying across collections 2023-05-08 12:20:06 -04:00
James Mikrut
03cbab6c08 Merge pull request #2548 from payloadcms/docs/upload-example
chore: adds export and fields to upload example
2023-05-08 11:51:44 -04:00
James Mikrut
bbe5bff389 Merge pull request #2625 from payloadcms/fix/#2608-custom-id-text-query
fix: query custom text id fields
2023-05-08 11:51:04 -04:00
James Mikrut
f857da964b Merge pull request #2632 from payloadcms/fix/graphql-type
fix: correct casing on graphql type
2023-05-08 11:50:42 -04:00
James Mikrut
d36916b400 Merge pull request #2631 from payloadcms/fix/uploading-webp
fix: webp upload formatting
2023-05-08 11:50:22 -04:00
James Mikrut
c0568f92e4 Merge pull request #2634 from payloadcms/fix/queryHiddenFields
Fix/query hidden fields
2023-05-08 11:49:22 -04:00
James Mikrut
b17891c170 Merge pull request #2633 from payloadcms/fix/upload-schema
fix: defaultValue missing from Upload field schema
2023-05-08 11:49:04 -04:00
James
164d6e93d0 Merge branch 'master' of github.com:payloadcms/payload 2023-05-08 10:27:04 -04:00
James
733ca324d2 chore: force aliases react to avoid invalid hook call 2023-05-08 10:26:57 -04:00
PatrikKozak
fb4f822d34 fix: removes queryHiddenFields from example Find operation 2023-05-08 09:56:32 -04:00
Jessica Boezwinkle
7b21eaf12d fix: defaultValue missing from Upload field schema 2023-05-08 14:55:51 +01:00
PatrikKozak
02a4e17e41 Merge branch 'master' of https://github.com/payloadcms/payload into fix/queryHiddenFields 2023-05-08 09:53:34 -04:00
PatrikKozak
5f30dbb1a5 fix: removes deprecated queryHiddenFIelds from local API docs 2023-05-08 09:53:27 -04:00
Jessica Boezwinkle
219f50b0bc fix: correct casing on graphql type 2023-05-08 14:45:42 +01:00
Jessica Boezwinkle
ccd6ca298e fix: webp upload formatting 2023-05-08 13:15:18 +01:00
Dan Ribbens
967f2ace0e fix: query custom text id fields 2023-05-06 21:25:41 -04:00
Dan Ribbens
2c36468431 chore(release): v1.7.5 2023-05-04 16:55:46 -04:00
Hristiyan Dodov
8dbf0a2bd8 fix: make incrementName match multiple digits (#2609) 2023-05-04 16:35:55 -04:00
Michel v. Varendorff
967899229f feat: collection admin.enableRichTextLink property (#2560) 2023-05-04 16:31:40 -04:00
Jarrod Flesch
1d58007606 feat: custom admin buttons (#2618)
Co-authored-by: Dan Ribbens <dan.ribbens@gmail.com>
2023-05-04 16:04:06 -04:00
Jarrod Flesch
56a1dee3d6 docs: fix ui field example code block config 2023-05-04 09:33:28 -04:00
Quentin Beauperin
28572a978e docs: add hideAPIURL to the collections and globals admin options (#2614)
* fix: add the missing `hideAPIURL` admin option in the collections docs

* fix: add the missing `hideAPIURL` admin option in the globals docs
2023-05-03 19:11:56 -04:00
Jarrod Flesch
acfb9bca45 Feat/custom admin buttons (#2613) 2023-05-03 17:21:38 -04:00
Jacob Fletcher
6f82cefdc5 chore: adds cloud messaging to example READMEs (#2612) 2023-05-03 11:14:11 -04:00
James
d0ea57120c chore(release): v1.7.4 2023-05-01 22:45:37 -04:00
Elliot DeNolf
277beb6587 chore: release-it verbose logging 2023-05-01 22:19:07 -04:00
Elliot DeNolf
802deaca03 fix: properly import SwcMinifyWebpackPlugin (#2600) 2023-05-01 22:00:56 -04:00
Dan Ribbens
3c6461f757 chore(release): v1.7.3 2023-05-01 17:27:29 -04:00
James Mikrut
a0bb13a412 fix: #2592, allows usage of hidden fields within access query constraints (#2599)
Co-authored-by: Dan Ribbens <dan.ribbens@gmail.com>
2023-05-01 17:15:14 -04:00
Elliot DeNolf
870838e756 feat: adjust stack trace for api error (#2598) 2023-05-01 16:50:48 -04:00
Jarrod Flesch
8f6f13dc93 fix: addds workaround for slate isBlock function issue (#2596) 2023-05-01 16:30:01 -04:00
Harrison-Blair
13179a9498 chore: misc documentation updates (#2589)
* chore: ensures example configs are being exported when necessary
* chore: adds note regarding updating of hidden fields

---------

Co-authored-by: Jessica Boezwinkle <jessica@trbl.design>
2023-05-01 16:28:13 -04:00
Dan Ribbens
0ba22c3aaf fix: query on id throws 500 (#2587) 2023-05-01 14:36:26 -04:00
Seied Ali Mirkarimi
311f77dd25 chore: translations fa.json (#2590)
Co-authored-by: Dan Ribbens <dan.ribbens@gmail.com>
2023-05-01 13:52:27 -04:00
Dan Ribbens
8382faa0af fix: bulk operations result type (#2588) 2023-05-01 13:46:17 -04:00
Dan Ribbens
9c5107e86d fix: timestamp queries (#2583) 2023-05-01 13:45:51 -04:00
Elliot DeNolf
14a6b40bcc chore: bump swc-minify-webpack-plugin (#2571) 2023-05-01 11:50:10 -04:00
Jarrod Flesch
07506ae4d9 Merge branch 'master' of https://github.com/payloadcms/payload 2023-04-28 10:17:45 -04:00
Jarrod Flesch
6abcca1215 chore: adds github-stars md file 2023-04-28 10:17:39 -04:00
Wes DiMiceli
02f27f3de6 fix: resolve process/browser package in webpack config 2023-04-27 12:38:49 -04:00
Paul
fbf3a2a1b4 feat: Add new translation for romanian language (#2556)
Co-authored-by: Dan Ribbens <dan.ribbens@gmail.com>
2023-04-26 17:18:09 -04:00
Seied Ali Mirkarimi
c80f68af94 feat: add persian translations (#2553)
Co-authored-by: Dan Ribbens <dan.ribbens@gmail.com>
2023-04-26 16:12:11 -04:00
Perry
85b3d579d3 feat: supports collection compound indexes (#2529)
Co-authored-by: Perry Li <yuanping.li@moblab.com>
Co-authored-by: Dan Ribbens <dan.ribbens@gmail.com>
2023-04-26 11:11:01 -04:00
Michel v. Varendorff
bf6522898d feat: allow customizing the link fields (#2559) 2023-04-26 11:08:47 -04:00
Jarrod Flesch
ddb34c3d83 chore: recreates yarn lock file 2023-04-25 19:13:48 -04:00
Jessica Boezwinkle
e942a18e5a chore: adds export and fields to upload example 2023-04-24 15:32:52 +01:00
Elliot67
56d48885e1 :feat: Improve admin panel file's caching 2023-04-16 00:55:27 +02:00
TomDoFuture
5f620a2325 Upgraded the packages to latest minor versions where non breaking 2023-01-15 11:23:42 +11:00
TomDoFuture
01d1f43d45 Upgraded the packages to latest patch versions where non breaking 2023-01-15 11:20:10 +11:00
4496 changed files with 347833 additions and 127881 deletions

View File

@@ -19,3 +19,7 @@ indent_size = 2
[*.mdx]
indent_style = space
indent_size = 2
[*.json]
indent_style = space
indent_size = 2

10
.eslintignore Normal file
View File

@@ -0,0 +1,10 @@
.tmp
**/.git
**/.hg
**/.pnp.*
**/.svn
**/.yarn/**
**/build
**/dist/**
**/node_modules
**/temp

38
.eslintrc.cjs Normal file
View File

@@ -0,0 +1,38 @@
module.exports = {
extends: ['@payloadcms'],
overrides: [
{
extends: ['plugin:@typescript-eslint/disable-type-checked'],
files: ['*.js', '*.cjs', '*.json', '*.md', '*.yml', '*.yaml'],
},
{
files: ['packages/eslint-config-payload/**'],
rules: {
'perfectionist/sort-objects': 'off',
},
},
{
files: ['package.json', 'tsconfig.json'],
rules: {
'perfectionist/sort-array-includes': 'off',
'perfectionist/sort-astro-attributes': 'off',
'perfectionist/sort-classes': 'off',
'perfectionist/sort-enums': 'off',
'perfectionist/sort-exports': 'off',
'perfectionist/sort-imports': 'off',
'perfectionist/sort-interfaces': 'off',
'perfectionist/sort-jsx-props': 'off',
'perfectionist/sort-keys': 'off',
'perfectionist/sort-maps': 'off',
'perfectionist/sort-named-exports': 'off',
'perfectionist/sort-named-imports': 'off',
'perfectionist/sort-object-types': 'off',
'perfectionist/sort-objects': 'off',
'perfectionist/sort-svelte-attributes': 'off',
'perfectionist/sort-union-types': 'off',
'perfectionist/sort-vue-attributes': 'off',
},
},
],
root: true,
}

View File

@@ -1,104 +0,0 @@
module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2020,
sourceType: 'module',
ecmaFeatures: {
jsx: true,
},
},
plugins: [
'@typescript-eslint',
],
extends: [
'@trbl',
],
settings: {
'import/resolver': {
node: {
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},
},
},
overrides: [
{
files: ['test/**/int.spec.ts'],
rules: {
'@typescript-eslint/no-use-before-define': 'off',
'@typescript-eslint/consistent-type-imports': 'warn',
'jest/prefer-strict-equal': 'off',
}
},
{
files: ['test/**/e2e.spec.ts'],
extends: [
'plugin:playwright/playwright-test'
],
rules: {
'jest/consistent-test-it': 'off',
'jest/require-top-level-describe': 'off',
'jest/no-test-callback': 'off',
'jest/prefer-strict-equal': 'off',
'jest/expect-expect': 'off',
'jest-dom/prefer-to-have-attribute': 'off',
}
},
{
files: ['*.ts', '*.tsx'],
parser: '@typescript-eslint/parser',
extends: [
'plugin:@typescript-eslint/recommended',
],
rules: {
'no-shadow': 'off',
'@typescript-eslint/no-shadow': ['error'],
'import/no-unresolved': [
2,
{
ignore: [
'payload-config',
'payload/generated-types',
],
},
],
},
},
{
files: ['*.spec.ts'],
rules: {
'@typescript-eslint/no-use-before-define': 'off',
},
},
{
files: ['*.e2e.ts'],
rules: {
'@typescript-eslint/no-use-before-define': 'off',
'jest/expect-expect': 'off',
},
},
],
rules: {
'import/no-extraneous-dependencies': ['error', { packageDir: './' }],
'react/jsx-filename-extension': [2, { extensions: ['.js', '.jsx', '.ts', '.tsx'] }],
'import/prefer-default-export': 'off',
'react/prop-types': 'off',
'react/require-default-props': 'off',
'react/no-unused-prop-types': 'off',
'no-console': 'warn',
'no-sparse-arrays': 'off',
'no-underscore-dangle': 'off',
'no-use-before-define': 'off',
'arrow-body-style': 0,
'@typescript-eslint/no-use-before-define': 'off',
'import/extensions': [
'error',
'ignorePackages',
{
js: 'never',
jsx: 'never',
ts: 'never',
tsx: 'never',
},
],
},
};

12
.git-blame-ignore-revs Normal file
View File

@@ -0,0 +1,12 @@
# lint and format
ae7d6f97d205491390f15850e5104c7abded1550
1fbda85cd04a774cb978778b0f813001664c53dd
# prettier all templates
75a428ddc4672903455998eaba7ae9f9d710bf85
# re-run prettier and eslint everywhere again
cdaa0acd61d3001407609915bd573b78565d5571
# prettier write again
dfac7395fed95fc5d8ebca21b786ce70821942bb

View File

@@ -1,6 +1,6 @@
name: Bug Report
description: Create a bug report for the Payload CMS
labels: ["possible-bug"]
description: Create a bug report for Payload
labels: ['possible-bug']
body:
- type: markdown
attributes:
@@ -10,7 +10,7 @@ body:
id: reproduction-link
attributes:
label: Link to reproduction
description: Please add a link to a reproduction. See the fork [reproduction-guide](https://github.com/payloadcms/payload/blob/master/.github/reproduction-guide.md) for more information.
description: Please add a link to a reproduction. See the fork [reproduction-guide](https://github.com/payloadcms/payload/blob/main/.github/reproduction-guide.md) for more information.
validations:
required: true
- type: textarea
@@ -31,6 +31,11 @@ body:
description: What version of Payload are you running?
validations:
required: true
- type: input
id: adapters-plugins
attributes:
label: Adapters and Plugins
description: What adapters and plugins are you using? ie. db-mongodb, db-postgres, bundler-webpack, etc.
- type: markdown
attributes:
value: Before submitting the issue, go through the steps you've written down to make sure the steps provided are detailed and clear.

View File

@@ -2,15 +2,18 @@
<!-- Please include a summary of the pull request and any related issues it fixes. Please also include relevant motivation and context. -->
- [ ] I have read and understand the CONTRIBUTING.md document in this repository
- [ ] I have read and understand the [CONTRIBUTING.md](../CONTRIBUTING.md) document in this repository.
## Type of change
<!-- Please delete options that are not relevant. -->
- [ ] Chore (non-breaking change which does not add functionality)
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] Change to the [templates](../templates/) directory (does not affect core functionality)
- [ ] Change to the [examples](../examples/) directory (does not affect core functionality)
- [ ] This change requires a documentation update
## Checklist:

View File

@@ -9,6 +9,7 @@
**NOTE:** The goal is to isolate the problem by reducing the number of `collections/globals/fields` you add to the `test/_community` folder. This folder is _not_ meant for you to copy your project into, but rather recreate the issue you are experiencing with minimal config.
## Example test directory file tree
```text
.
├── config.ts
@@ -27,16 +28,18 @@ The directory split up in this way specifically to reduce friction when creating
<br />
## Testing is optional but encouraged
An issue does not need to have failing tests — reproduction steps with your forked repo are enough at this point. Some people like to dive deeper and we want to give you the guidance/tools to do so. Read more below:
### Running integration tests (Payload API tests)
First install [Jest Runner for VSVode](https://marketplace.visualstudio.com/items?itemName=firsttris.vscode-jest-runner).
There are a couple ways run integration tests:
- **Granularly** - you can run individual tests in vscode by installing the Jest Runner plugin and using that to run individual tests. Clicking the `debug` button will run the test in debug mode allowing you to set break points.
<img src="https://raw.githubusercontent.com/payloadcms/payload/master/src/admin/assets/images/github/int-debug.png" />
<img src="https://raw.githubusercontent.com/payloadcms/payload/main/packages/payload/src/admin/assets/images/github/int-debug.png" />
- **Manually** - you can run all int tests in the `/test/_community/int.spec.ts` file by running the following command:
@@ -45,14 +48,16 @@ There are a couple ways run integration tests:
```
### Running E2E tests (Admin Panel UI tests)
The easiest way to run E2E tests is to install
- [Playwright Test for VSCode](https://marketplace.visualstudio.com/items?itemName=ms-playwright.playwright)
- [Playwright Runner](https://marketplace.visualstudio.com/items?itemName=ortoni.ortoni)
Once they are installed you can open the `testing` tab in vscode sidebar and drill down to the test you want to run, i.e. `/test/_community/e2e.spec.ts`
<img src="https://raw.githubusercontent.com/payloadcms/payload/master/src/admin/assets/images/github/e2e-debug.png" />
<img src="https://raw.githubusercontent.com/payloadcms/payload/main/packages/payload/src/admin/assets/images/github/e2e-debug.png" />
#### Notes
- It is recommended to add the test credentials (located in `test/credentials.ts`) to your autofill for `localhost:3000/admin` as this will be required on every nodemon restart. The default credentials are `dev@payloadcms.com` as email and `test` as password.

208
.github/workflows/main.yml vendored Normal file
View File

@@ -0,0 +1,208 @@
name: build
on:
pull_request:
types: [opened, reopened, synchronize]
push:
branches: ['main']
jobs:
core-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 25
- name: Use Node.js 18
uses: actions/setup-node@v3
with:
node-version: 18
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8
run_install: false
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
- run: pnpm install
- run: pnpm run build
- name: Cache build
uses: actions/cache@v3
with:
path: ./*
key: ${{ github.sha }}-${{ github.run_number }}
tests:
runs-on: ubuntu-latest
needs: core-build
strategy:
fail-fast: false
matrix:
database: [mongoose, postgres]
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: payloadtests
steps:
- name: Use Node.js 18
uses: actions/setup-node@v3
with:
node-version: 18
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8
run_install: false
- name: Restore build
uses: actions/cache@v3
with:
path: ./*
key: ${{ github.sha }}-${{ github.run_number }}
- name: Start PostgreSQL
uses: CasperWA/postgresql-action@v1.2
with:
postgresql version: '14' # See https://hub.docker.com/_/postgres for available versions
postgresql db: ${{ env.POSTGRES_DB }}
postgresql user: ${{ env.POSTGRES_USER }}
postgresql password: ${{ env.POSTGRES_PASSWORD }}
if: matrix.database == 'postgres'
- run: sleep 30
- name: Configure PostgreSQL
run: |
psql "postgresql://$POSTGRES_USER:$POSTGRES_PASSWORD@localhost:5432/$POSTGRES_DB" -c "CREATE ROLE runner SUPERUSER LOGIN;"
psql "postgresql://$POSTGRES_USER:$POSTGRES_PASSWORD@localhost:5432/$POSTGRES_DB" -c "SELECT version();"
echo "POSTGRES_URL=postgresql://$POSTGRES_USER:$POSTGRES_PASSWORD@localhost:5432/$POSTGRES_DB" >> $GITHUB_ENV
if: matrix.database == 'postgres'
- name: Component Tests
run: pnpm test:components
- name: Integration Tests
run: pnpm test:int
env:
PAYLOAD_DATABASE: ${{ matrix.database }}
POSTGRES_URL: ${{ env.POSTGRES_URL }}
tests-e2e:
runs-on: ubuntu-latest
needs: core-build
strategy:
fail-fast: false
matrix:
part: [1/4, 2/4, 3/4, 4/4]
steps:
- name: Use Node.js 18
uses: actions/setup-node@v3
with:
node-version: 18
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8
run_install: false
- name: Restore build
uses: actions/cache@v3
with:
path: ./*
key: ${{ github.sha }}-${{ github.run_number }}
- name: E2E Tests
run: pnpm test:e2e --part ${{ matrix.part }} --bail
- uses: actions/upload-artifact@v3
if: always()
with:
name: test-results
path: test-results/
retention-days: 1
tests-type-generation:
runs-on: ubuntu-latest
needs: core-build
steps:
- name: Use Node.js 18
uses: actions/setup-node@v3
with:
node-version: 18
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8
run_install: false
- name: Restore build
uses: actions/cache@v3
with:
path: ./*
key: ${{ github.sha }}-${{ github.run_number }}
- name: Generate Payload Types
run: pnpm dev:generate-types fields
- name: Generate GraphQL schema file
run: pnpm dev:generate-graphql-schema graphql-schema-gen
build-packages:
name: Build Packages
runs-on: ubuntu-latest
needs: core-build
strategy:
fail-fast: false
matrix:
pkg:
- db-mongodb
- db-postgres
- bundler-webpack
- bundler-vite
- richtext-slate
- richtext-lexical
- live-preview
- live-preview-react
steps:
- name: Use Node.js 18
uses: actions/setup-node@v3
with:
node-version: 18
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8
run_install: false
- name: Restore build
uses: actions/cache@v3
with:
path: ./*
key: ${{ github.sha }}-${{ github.run_number }}
- name: Build ${{ matrix.pkg }}
run: pnpm turbo run build --filter=${{ matrix.pkg }}

View File

@@ -1,88 +0,0 @@
name: build
on:
pull_request:
types: [opened, reopened, edited, synchronize]
push:
branches: ["master"]
jobs:
build_yarn:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x, 16.x, 18.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
registry-url: https://registry.npmjs.org
scope: "@payloadcms"
always-auth: true
- name: Cache node modules
uses: actions/cache@v1
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- run: yarn
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- run: yarn build
- name: Component Tests
run: yarn test:components
- name: Integration Tests
run: yarn test:int
- name: Generate Payload Types
run: yarn dev:generate-types fields
- name: Generate GraphQL schema file
run: yarn dev:generate-graphql-schema
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- name: E2E Tests
run: yarn test:e2e --bail
- uses: actions/upload-artifact@v3
if: always()
with:
name: test-results
path: test-results/
retention-days: 30
install_npm:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
registry-url: https://registry.npmjs.org
scope: "@payloadcms"
always-auth: true
- name: Cache node modules
uses: actions/cache@v1
with:
path: ~/.npm
key: ${{ runner.os }}-node-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-${{ env.cache-name }}-
${{ runner.os }}-npm-
${{ runner.os }}-
- run: npm install --legacy-peer-deps
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

236
.gitignore vendored
View File

@@ -3,11 +3,15 @@ package-lock.json
dist
.idea
test-results
.devcontainer
/migrations
# Created by https://www.gitignore.io/api/node,macos,windows,webstorm,sublimetext,visualstudiocode
# Created by https://www.toptal.com/developers/gitignore/api/node,macos,windows,webstorm,sublimetext,visualstudiocode
# Edit at https://www.toptal.com/developers/gitignore?templates=node,macos,windows,webstorm,sublimetext,visualstudiocode
### macOS ###
*.DS_Store
# General
.DS_Store
.AppleDouble
.LSOverride
@@ -30,6 +34,10 @@ Network Trash Folder
Temporary Items
.apdisk
### macOS Patch ###
# iCloud generated files
*.icloud
### Node ###
# Logs
logs
@@ -37,6 +45,11 @@ logs
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*
# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
# Runtime data
pids
@@ -49,11 +62,12 @@ lib-cov
# Coverage directory used by tools like istanbul
coverage
*.lcov
# nyc test coverage
.nyc_output
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# Bower dependency directory (https://bower.io/)
@@ -62,15 +76,18 @@ bower_components
# node-waf configuration
.lock-wscript
# Compiled binary addons (http://nodejs.org/api/addons.html)
# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release
# Dependency directories
node_modules/
jspm_packages/
# Typescript v1 declaration files
typings/
# Snowpack dependency directory (https://snowpack.dev/)
web_modules/
# TypeScript cache
*.tsbuildinfo
# Optional npm cache directory
.npm
@@ -78,6 +95,15 @@ typings/
# Optional eslint cache
.eslintcache
# Optional stylelint cache
.stylelintcache
# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/
# Optional REPL history
.node_repl_history
@@ -87,34 +113,87 @@ typings/
# Yarn Integrity file
.yarn-integrity
# Yarn Berry
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
# dotenv environment variable files
.env
.env.development.local
.env.test.local
.env.production.local
.env.local
# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache
# Next.js build output
.next
out
# Nuxt.js build / generate output
.nuxt
dist
# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public
# vuepress build output
.vuepress/dist
# vuepress v2.x temp and cache directory
.temp
# Docusaurus cache and generated files
.docusaurus
# Serverless directories
.serverless/
# FuseBox cache
.fusebox/
# DynamoDB Local files
.dynamodb/
# TernJS port file
.tern-port
# Stores VSCode versions used for testing VSCode extensions
.vscode-test
# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*
# dotenv environment variables file
.env
### Node Patch ###
# Serverless Webpack directories
.webpack/
# Optional stylelint cache
# SvelteKit build / generate output
.svelte-kit
### SublimeText ###
# cache files for sublime text
# Cache files for Sublime Text
*.tmlanguage.cache
*.tmPreferences.cache
*.stTheme.cache
# workspace files are user-specific
# Workspace files are user-specific
*.sublime-workspace
# project files should be checked into the repository, unless a significant
# proportion of contributors will probably not be using SublimeText
# Project files should be checked into the repository, unless a significant
# proportion of contributors will probably not be using Sublime Text
# *.sublime-project
# sftp configuration file
# SFTP configuration file
sftp-config.json
sftp-config-alt*.json
# Package control specific files
Package Control.last-run
@@ -134,46 +213,77 @@ GitHub.sublime-settings
### VisualStudioCode ###
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
!.vscode/*.code-snippets
# Local History for Visual Studio Code
.history/
# Built Visual Studio Code Extensions
*.vsix
### VisualStudioCode Patch ###
# Ignore all local history of files
.history
.ionide
### WebStorm ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
# User-specific stuff:
# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/dictionaries
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf
# Sensitive or high-churn files:
# AWS User-specific
.idea/**/aws.xml
# Generated files
.idea/**/contentModel.xml
# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.xml
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml
# Gradle:
# Gradle
.idea/**/gradle.xml
.idea/**/libraries
# CMake
cmake-build-debug/
# Gradle and Maven with auto-import
# When using Gradle or Maven with auto-import, you should exclude module files,
# since they will be recreated, and may cause churn. Uncomment if using
# auto-import.
# .idea/artifacts
# .idea/compiler.xml
# .idea/jarRepositories.xml
# .idea/modules.xml
# .idea/*.iml
# .idea/modules
# *.iml
# *.ipr
# Mongo Explorer plugin:
# CMake
cmake-build-*/
# Mongo Explorer plugin
.idea/**/mongoSettings.xml
## File-based project format:
# File-based project format
*.iws
## Plugin-specific files:
# IntelliJ
/out/
out/
# mpeltonen/sbt-idea plugin
.idea_modules/
@@ -184,8 +294,8 @@ atlassian-ide-plugin.xml
# Cursive Clojure plugin
.idea/replstate.xml
# Ruby plugin and RubyMine
/.rakeTasks
# SonarLint plugin
.idea/sonarlint/
# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
@@ -193,6 +303,12 @@ crashlytics.properties
crashlytics-build.properties
fabric.properties
# Editor-based Rest Client
.idea/httpRequests
# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser
### WebStorm Patch ###
# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721
@@ -202,16 +318,43 @@ fabric.properties
# *.ipr
# Sonarlint plugin
.idea/sonarlint
# https://plugins.jetbrains.com/plugin/7973-sonarlint
.idea/**/sonarlint/
# SonarQube Plugin
# https://plugins.jetbrains.com/plugin/7238-sonarqube-community-plugin
.idea/**/sonarIssues.xml
# Markdown Navigator plugin
# https://plugins.jetbrains.com/plugin/7896-markdown-navigator-enhanced
.idea/**/markdown-navigator.xml
.idea/**/markdown-navigator-enh.xml
.idea/**/markdown-navigator/
# Cache file creation bug
# See https://youtrack.jetbrains.com/issue/JBR-2257
.idea/$CACHE_FILE$
# CodeStream plugin
# https://plugins.jetbrains.com/plugin/12206-codestream
.idea/codestream.xml
# Azure Toolkit for IntelliJ plugin
# https://plugins.jetbrains.com/plugin/8053-azure-toolkit-for-intellij
.idea/**/azureSettings.xml
### Windows ###
# Windows thumbnail cache files
Thumbs.db
Thumbs.db:encryptable
ehthumbs.db
ehthumbs_vista.db
# Dump file
*.stackdump
# Folder config file
Desktop.ini
[Dd]esktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/
@@ -219,26 +362,13 @@ $RECYCLE.BIN/
# Windows Installer files
*.cab
*.msi
*.msix
*.msm
*.msp
# Windows shortcuts
*.lnk
# End of https://www.gitignore.io/api/node,macos,windows,webstorm,sublimetext,visualstudiocode
# End of https://www.toptal.com/developers/gitignore/api/node,macos,windows,webstorm,sublimetext,visualstudiocode
# Ignore all uploads
demo/upload
demo/media
demo/files
# Ignore build folder
build
# Ignore built components
components/index.js
components/styles.css
# Ignore generated
demo/generated-types.ts
demo/generated-schema.graphql
/build

4
.husky/pre-commit Executable file
View File

@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"
pnpm run lint-staged --quiet

View File

@@ -1 +1 @@
v16.14.2
v18.17.1

2
.npmrc Normal file
View File

@@ -0,0 +1,2 @@
symlink=true
node-linker=isolated # due to a typescript bug, isolated mode requires @types/express-serve-static-core, terser and monaco-editor to be installed https://github.com/microsoft/TypeScript/issues/47663#issuecomment-1519138189 along with two other changes in the code which I've marked with (tsbugisolatedmode) in the code

2
.nvmrc
View File

@@ -1 +1 @@
v16.14.2
v18.17.1

11
.prettierignore Normal file
View File

@@ -0,0 +1,11 @@
.tmp
**/.git
**/.hg
**/.pnp.*
**/.svn
**/.yarn/**
**/build
**/dist/**
**/node_modules
**/temp
**/docs/**

6
.prettierrc.json Normal file
View File

@@ -0,0 +1,6 @@
{
"singleQuote": true,
"trailingComma": "all",
"printWidth": 100,
"semi": false
}

View File

@@ -1,4 +1,5 @@
{
"verbose": true,
"git": {
"commitMessage": "chore(release): v${version}",
"requireCleanWorkingDir": true
@@ -10,7 +11,7 @@
"skipChecks": true
},
"hooks": {
"before:init": ["yarn", "yarn clean", "yarn test"]
"before:init": ["pnpm i", "pnpm clean", "pnpm test"]
},
"plugins": {
"@release-it/conventional-changelog": {

View File

@@ -1,4 +1,5 @@
{
"verbose": true,
"git": {
"requireCleanWorkingDir": false,
"commit": false,
@@ -6,14 +7,14 @@
"tag": false
},
"github": {
"release": false
"release": true
},
"npm": {
"skipChecks": true,
"tag": "canary"
},
"hooks": {
"before:init": ["yarn", "yarn clean", "yarn test"]
"before:init": ["pnpm i", "pnpm clean", "pnpm test"]
},
"plugins": {
"@release-it/conventional-changelog": {

3
.vscode/extensions.json vendored Normal file
View File

@@ -0,0 +1,3 @@
{
"recommendations": ["esbenp.prettier-vscode", "dbaeumer.vscode-eslint"]
}

151
.vscode/launch.json vendored
View File

@@ -1,21 +1,146 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"command": "pnpm run dev _community",
"cwd": "${workspaceFolder}",
"name": "Run Dev Community",
"request": "launch",
"name": "Launch Program",
"runtimeArgs": [
"-r",
"ts-node/register"
],
"args": [
"${workspaceFolder}/test/dev.ts",
"fields"
]
"type": "node-terminal"
},
]
{
"command": "pnpm run dev fields",
"cwd": "${workspaceFolder}",
"name": "Run Dev Fields",
"request": "launch",
"type": "node-terminal"
},
{
"command": "pnpm run dev:postgres fields",
"cwd": "${workspaceFolder}",
"name": "Run Dev Postgres",
"request": "launch",
"type": "node-terminal"
},
{
"command": "pnpm run dev versions",
"cwd": "${workspaceFolder}",
"name": "Run Dev Versions",
"request": "launch",
"type": "node-terminal"
},
{
"command": "PAYLOAD_BUNDLER=vite pnpm run dev fields",
"cwd": "${workspaceFolder}",
"name": "Run Dev Fields (Vite)",
"request": "launch",
"type": "node-terminal",
"env": {
"NODE_ENV": "production"
}
},
{
"command": "ts-node ./packages/payload/src/bin/index.ts build",
"env": {
"PAYLOAD_CONFIG_PATH": "test/fields/config.ts",
"PAYLOAD_BUNDLER": "vite",
"DISABLE_SWC": "true" // SWC messes up debugging the bin scripts
},
"name": "Build CLI - Vite",
"outputCapture": "std",
"request": "launch",
"type": "node-terminal"
},
{
"command": "ts-node ./packages/payload/src/bin/index.ts build",
"env": {
"PAYLOAD_CONFIG_PATH": "test/fields/config.ts",
"PAYLOAD_ANALYZE_BUNDLE": "true",
"DISABLE_SWC": "true" // SWC messes up debugging the bin scripts
},
"name": "Build CLI - Webpack",
"outputCapture": "std",
"request": "launch",
"type": "node-terminal"
},
{
"command": "ts-node ./packages/payload/src/bin/index.ts generate:types",
"env": {
"PAYLOAD_CONFIG_PATH": "test/_community/config.ts",
"DISABLE_SWC": "true" // SWC messes up debugging the bin scripts
},
"name": "Generate Types CLI",
"outputCapture": "std",
"request": "launch",
"type": "node-terminal"
},
{
"command": "ts-node ./packages/payload/src/bin/index.ts migrate:status",
"env": {
"PAYLOAD_CONFIG_PATH": "test/migrations-cli/config.ts",
"PAYLOAD_DATABASE": "postgres",
"DISABLE_SWC": "true" // SWC messes up debugging the bin scripts
// "PAYLOAD_DROP_DATABASE": "true",
},
"name": "Migrate CLI - status",
"outputCapture": "std",
"request": "launch",
"type": "node-terminal"
},
{
"command": "ts-node ./packages/payload/src/bin/index.ts migrate:create yass",
"env": {
"PAYLOAD_CONFIG_PATH": "test/migrations-cli/config.ts",
"PAYLOAD_DATABASE": "postgres",
"DISABLE_SWC": "true" // SWC messes up debugging the bin scripts
// "PAYLOAD_DROP_DATABASE": "true",
},
"name": "Migrate CLI - create",
"outputCapture": "std",
"request": "launch",
"type": "node-terminal"
},
{
"command": "ts-node ./packages/payload/src/bin/index.ts migrate:down",
"env": {
"PAYLOAD_CONFIG_PATH": "test/migrations-cli/config.ts",
"PAYLOAD_DATABASE": "mongoose",
"DISABLE_SWC": "true" // SWC messes up debugging the bin scripts
// "PAYLOAD_DROP_DATABASE": "true",
},
"name": "Migrate CLI - down",
"outputCapture": "std",
"request": "launch",
"type": "node-terminal"
},
{
"command": "ts-node ./packages/payload/src/bin/index.ts migrate:reset",
"env": {
"PAYLOAD_CONFIG_PATH": "test/migrations-cli/config.ts",
"PAYLOAD_DATABASE": "mongoose",
"DISABLE_SWC": "true" // SWC messes up debugging the bin scripts
// "PAYLOAD_DROP_DATABASE": "true",
},
"name": "Migrate CLI - reset",
"outputCapture": "std",
"request": "launch",
"type": "node-terminal"
},
{
"command": "ts-node ./packages/payload/src/bin/index.ts migrate:refresh",
"env": {
"PAYLOAD_CONFIG_PATH": "test/migrations-cli/config.ts",
"PAYLOAD_DATABASE": "mongoose",
"DISABLE_SWC": "true" // SWC messes up debugging the bin scripts
// "PAYLOAD_DROP_DATABASE": "true",
},
"name": "Migrate CLI - refresh",
"outputCapture": "std",
"request": "launch",
"type": "node-terminal"
}
],
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0"
}

39
.vscode/settings.json vendored Normal file
View File

@@ -0,0 +1,39 @@
{
"npm.packageManager": "pnpm",
"editor.defaultFormatter": "esbenp.prettier-vscode",
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
}
},
"[typescriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
}
},
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
}
},
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true
},
"[jsonc]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true
},
"editor.formatOnSaveMode": "file",
// All ESLint rules to 'warn' to differentate from TypeScript's 'error' level
"eslint.rules.customizations": [{ "rule": "*", "severity": "warn" }],
"typescript.tsdk": "node_modules/typescript/lib",
// Load .git-blame-ignore-revs file
"gitlens.advanced.blame.customArguments": ["--ignore-revs-file", ".git-blame-ignore-revs"]
}

View File

@@ -1,37 +1,624 @@
## [2.0.0](https://github.com/payloadcms/payload/releases/tag/v2.0.0) (2023-10-09)
### Features
- New [database adapter pattern](https://payloadcms.com/docs/database/overview)
- Official [Postgres adapter](https://payloadcms.com/docs/database/postgres) released, built on [Drizzle ORM](https://orm.drizzle.team)
- Database [transactions](https://payloadcms.com/docs/database/transactions) added
- Full, first-party [migration support](https://payloadcms.com/docs/database/migrations) added
- The admin UI has been redesigned to be more extensible and offer more horizontal real estate
- Admin UI sidebar is now collapsible
- [Live preview](https://payloadcms.com/docs/live-preview/overview) added to admin UI, including usable frontend hooks
- New "Views" API added, which allows for custom sub-views on List and Edit views within Admin UI
- New [bundler adapter pattern](https://payloadcms.com/docs/admin/bundlers) released
- Official [Vite bundler](https://payloadcms.com/docs/admin/vite) released
- Offical [Lexical rich text adapter](https://payloadcms.com/docs/rich-text/lexical) released
- Lexical rich text editor now supports drag and drop of rich text elements
- Lexical rich text now supports Payload blocks directly within rich text editor
- Upload image cropping added
- Upload "focal point" controls added
- New "API" view added to Edit view(s), allowing for quick and customizable references to API response
- MongoDB draft querying has been significantly improved and is now much faster
- Arabic / RTL UI support added
- Locales can now be further configured to accept settings like `rtl`, human-friendly labels, etc.
- The `tsconfig` `path` pointing to your generated Payload types is no longer required for types to work
### BREAKING CHANGES
### ⚠️ You now need to provide your Payload config with a database, a bundler, and a rich text adapter
Here's an example of a barebones Payload config, set up to work as 1.0 did:
```ts
import { mongooseAdapter } from "@payloadcms/db-mongodb";
import { slateEditor } from "@payloadcms/richtext-slate";
import { webpackBundler } from "@payloadcms/bundler-webpack";
import { buildConfig } from "payload/config";
export default buildConfig({
admin: {
bundler: webpackBundler(),
},
editor: slateEditor({}),
collections: [
// your collections here
],
db: mongooseAdapter({
url: process.env.DATABASE_URI,
}),
});
```
These new properties are all now required for Payload to function, and you will have to install each separate adapter that you use. Feel free to swap out any of the adapters with your choice (Lexical, Postgres, Vite, etc.)
Make sure to install the packages that you need. In the above example, you would need to install the following:
```bash
npm install --save @payloadcms/db-mongodb @payloadcms/richtext-slate @payloadcms/bundler-webpack
```
### ⚠️ Draft versions now require a `latest: true` property to be set on the most recent draft in your `_versions` collections(s)
We have a ready-to-go migration script for your versions from v1 to v2, and to use it, all you have to do is run the following commands:
**1. First, make sure you have a `payload` npm script in your `package.json`**
```json
{
"scripts": {
"payload": "cross-env PAYLOAD_CONFIG_PATH=src/payload.config.ts payload"
}
}
```
Adjust the `PAYLOAD_CONFIG_PATH` to point to your Payload config file if necessary.
**2. Create a migration, using the new Payload migration API**
```bash
npm run payload migrate:create --file @payloadcms/db-mongodb/versions-v1-v2
```
The above command will output a migration file into your `./src/migrations` folder (default migrations location). It contains a migration script to automatically add a `latest: true` flag to each of your newest drafts, for all draft-enabled collections. It works out of the box!
**3. Run migrations**
From there, you need to run migrations. Run the following command to execute your new migration:
```bash
npm run payload migrate
```
And you'll be all good!
### ⚠️ Array and block field validations now accept the full array of field data as their validation argument instead of the value.length
This change should only affect you if you have a custom array / block validation defined.
### ⚠️ For MongoDB, all models have been moved from the Payload object to the database adapter
For example, if you are leveraging Mongoose models directly, in 1.0, you would have accessed them via `payload.collections[myCollectionSlug].Model`. Now, you can access the Mongoose model from `payload.db.collections[myCollectionSlug]`.
Version models can be accessed from `payload.db.versions[myEntitySlug]`, and the global model can be accessed via `payload.db.globals`.
### ⚠️ User preferences data shape has changed, and you will lose preferences unless you manually migrate them to the new shape
We don't have a migration ready to go yet for user preferences, and this typically wouldn't be a big deal for most Payload projects. So don't let it stop you from updating unless you have a serious amount of user preferences that you'd like to keep. If so, we'll come up with a migration script for you and hook you up. Just reach out to us on Discord to ask for this.
### ⚠️ Node 16 is now the minimum required node version and Node 14 is no longer supported
Pretty self-explanatory on this one. Node 14 is old.
### ⚠️ The Pino logger has been updated, which may require you to make changes to your Pino config if you have a custom one
If you don't have anything custom with the Pino logger, this does not apply to you.
### ⚠️ Transactions are now enabled by default if your database supports them
MongoDB requires a replica set for transactions to work, so they likely are not going to work for you unless you do indeed have a replica set configured. But if you do, transactions will now instantly work for all internal Payload operations.
This means that in some fringe cases, if you are creating a doc and then instantly trying to update it within an `afterChange` hook, the newly created doc may not truly exist yet. This should not cause any problems for 99% of projects, but if you think this applies to you, might be good to double-check through your code.
To avoid any issues, you can pass the `req.transactionID` through to your Local API calls, so that your Local API calls are included as part of the parent transaction.
### ⚠️ Admin panel CSS classes may have changed
The revisions we've made in 2.0 required changes to both HTML and CSS within the admin panel. For this reason, if you were loading custom CSS into the admin panel to customize the look and feel, your stylesheets may need to be updated. If your CSS is targeting elements on the page using HTML selectors or class names, you may need to update these selectors based on the current markup. It may also be necessary to update your style definitions if the core Payload component you are targeting has undergone significant change.
In many cases, our classnames and structure have remained the same, but technically, this could be a breaking change.
### ⚠️ Custom admin views API has changed
These changes only affect apps that are using custom views via the `admin.components.routes` config.
The type `AdminRoute` was renamed to `AdminViewConfig`. Simply update your instances with this new type and it will continue to work as expected. The properties of this type have not changed.
The `admin.components.routes` config has been merged with `admin.components.views`. Simply move your custom views to the `views` object. The properties of the config have not changed. Here is an example:
Previous:
```ts
admin: {
components: {
routes: [
{
Component: MyCustomView,
path: "/custom-view",
},
];
}
}
```
Current:
```ts
admin: {
components: {
views: {
MyCustomView: {
Component: MyCustomView,
path: '/custom-view'
}
}]
}
}
```
### ⚠️ Rich text admin properties have moved
If you have customized the Slate rich text editor via `admin.elements` or `admin.leaves` properties, you now need to add your customizations to a `slateEditor({ admin: {} })` property. The signatures are all the same, but you might have to move some properties around.
Previous:
```ts
const myRichTextField: Field = {
name: "content",
type: "richText",
admin: {
elements: [
"h1",
"link",
// etc
],
},
};
```
Current:
```ts
import { slateEditor } from "@payloadcms/richtext-slate";
const myRichTextField: Field = {
name: "content",
type: "richText",
editor: slateEditor({
// Move the admin property as shown below
admin: {
elements: [
"h1",
"link",
// etc
],
},
}),
};
```
### ⚠️ MongoDB connection options have been removed from `payload.init`
To pass connection options for MongoDB, you now need to pass them to `db: mongooseAdapter({})` instead of passing them to `payload.init()`.
### ⚠️ Some types have changed locations
If you are importing types from Payload, some of their locations may have changed. An example would be Slate-specific types being no longer exported from Payload itself—they are now exported from the `@payloadcms/richtext-slate` package.
### Recap
That's it! Most of these changes will be instantly apparent to you thanks to TypeScript, and many may not apply to you at all. But this list should be comprehensive and we will do our best to keep everything up-to-date here accordingly. There are inevitably some types that have changed locations, and similar things like that, but overall, you should be able to swing the breaking changes and get updated.
If you need a hand, reach out on Discord and we will hook you up!
## [1.14.0](https://github.com/payloadcms/payload/compare/v1.13.4...v1.14.0) (2023-08-16)
### Bug Fixes
- DatePicker showing only selected day by default ([#3169](https://github.com/payloadcms/payload/issues/3169)) ([edcb393](https://github.com/payloadcms/payload/commit/edcb3933cfb4532180c822135ea6a8be928e0fdc))
- only allow redirects to /admin sub-routes ([c0f05a1](https://github.com/payloadcms/payload/commit/c0f05a1c38fb9c958de920fabb698b5ecfb661f0))
- passes in height to resizeOptions upload option to allow height resize ([#3171](https://github.com/payloadcms/payload/issues/3171)) ([7963d04](https://github.com/payloadcms/payload/commit/7963d04a27888eb5a12d0ab37f2082cd33638abd))
- WhereBuilder component does not accept all valid Where queries ([#3087](https://github.com/payloadcms/payload/issues/3087)) ([fdfdfc8](https://github.com/payloadcms/payload/commit/fdfdfc83f36a958971f8e4e4f9f5e51560cb26e0))
### Features
- add afterOperation hook ([#2697](https://github.com/payloadcms/payload/issues/2697)) ([33686c6](https://github.com/payloadcms/payload/commit/33686c6db8373a16d7f6b0192e0701bf15881aa4))
- add support for hotkeys ([#1821](https://github.com/payloadcms/payload/issues/1821)) ([942cfec](https://github.com/payloadcms/payload/commit/942cfec286ff050e13417b037cca64b9d757d868))
- Added Azerbaijani language file ([#3164](https://github.com/payloadcms/payload/issues/3164)) ([63e3063](https://github.com/payloadcms/payload/commit/63e3063b9ecc1afd62d7a287a798d41215008f2a))
- allow async relationship filter options ([#2951](https://github.com/payloadcms/payload/issues/2951)) ([bad3638](https://github.com/payloadcms/payload/commit/bad363882c9d00d3c73547ca3329eba988e728ff))
- Improve admin dashboard accessibility ([#3053](https://github.com/payloadcms/payload/issues/3053)) ([e03a8e6](https://github.com/payloadcms/payload/commit/e03a8e6b030e82a17e1cdae5b4032433cf9c75a4))
- improve field ops ([#3172](https://github.com/payloadcms/payload/issues/3172)) ([d91b44c](https://github.com/payloadcms/payload/commit/d91b44cbb3fd526caca2a6f4bd30fd06ede3a5da))
- make PAYLOAD_CONFIG_PATH optional ([#2839](https://github.com/payloadcms/payload/issues/2839)) ([5744de7](https://github.com/payloadcms/payload/commit/5744de7ec63e3f17df7e02a7cc827818a79dbbb8))
- text alignment for richtext editor ([#2803](https://github.com/payloadcms/payload/issues/2803)) ([a0b13a5](https://github.com/payloadcms/payload/commit/a0b13a5b01fa0d7f4c4dffd1895bfe507e5c676d))
## [1.13.4](https://github.com/payloadcms/payload/compare/v1.13.3...v1.13.4) (2023-08-11)
### Bug Fixes
- correctly passes block path inside buildFieldSchemaMap ([#3162](https://github.com/payloadcms/payload/issues/3162)) ([3c60abd](https://github.com/payloadcms/payload/commit/3c60abd61aaf24d49712c80bcbd0f1113c22b85a))
## [1.13.3](https://github.com/payloadcms/payload/compare/v1.13.2...v1.13.3) (2023-08-11)
### Bug Fixes
- unable to add arrays inside secondary named tabs ([#3158](https://github.com/payloadcms/payload/issues/3158)) ([cb04d4a](https://github.com/payloadcms/payload/commit/cb04d4a82a68a764330582b93882d422b32c2527))
## [1.13.2](https://github.com/payloadcms/payload/compare/v1.13.1...v1.13.2) (2023-08-10)
## [1.13.1](https://github.com/payloadcms/payload/compare/v1.13.0...v1.13.1) (2023-08-08)
### Bug Fixes
- updates addFieldRow and replaceFieldRow rowIndex insertion ([#3145](https://github.com/payloadcms/payload/issues/3145)) ([f5cf546](https://github.com/payloadcms/payload/commit/f5cf546e1918de66998d5f0e5410bfbc1f054567))
# [1.13.0](https://github.com/payloadcms/payload/compare/v1.12.0...v1.13.0) (2023-08-08)
### Bug Fixes
- `setPreference()` return type ([#3125](https://github.com/payloadcms/payload/issues/3125)) ([463d6bb](https://github.com/payloadcms/payload/commit/463d6bbec66e61523bae3869df88bd98e7617390))
- absolute staticURL admin thumbnails ([#3135](https://github.com/payloadcms/payload/issues/3135)) ([1039f39](https://github.com/payloadcms/payload/commit/1039f39c09260537616b22228080466e8df6e981))
- adding and replacing similarly shaped block configs ([#3140](https://github.com/payloadcms/payload/issues/3140)) ([8e188cf](https://github.com/payloadcms/payload/commit/8e188cfe61db808c94d726967affdadf2e5abb9f))
### Features
- default tab labels from name ([#3129](https://github.com/payloadcms/payload/issues/3129)) ([e8f0516](https://github.com/payloadcms/payload/commit/e8f05165eb3a28c00deb11931db01ad1f8c75c74))
- radio and select fields are filterable by options ([#3136](https://github.com/payloadcms/payload/issues/3136)) ([b117e73](https://github.com/payloadcms/payload/commit/b117e7346434bfc8edbfa92f5db45f63c57bab08))
- recursive saveToJWT field support ([#3130](https://github.com/payloadcms/payload/issues/3130)) ([c6e0908](https://github.com/payloadcms/payload/commit/c6e09080767dad2ab8128ba330b2b344bb25ac6f))
# [1.12.0](https://github.com/payloadcms/payload/compare/v1.11.8...v1.12.0) (2023-08-04)
### Bug Fixes
- excludes useAsTitle field from searchableFields in collection view ([#3105](https://github.com/payloadcms/payload/issues/3105)) ([8c4d251](https://github.com/payloadcms/payload/commit/8c4d2514b0f195e0059c6063346199785979c70c))
- relationship field filter long titles ([#3113](https://github.com/payloadcms/payload/issues/3113)) ([da27a8a](https://github.com/payloadcms/payload/commit/da27a8aadbb103c5f6fe0ccc62c032876851b88f))
- wrong links in verification and forgot password emails if serverURL not set ([#3010](https://github.com/payloadcms/payload/issues/3010)) ([6a189c6](https://github.com/payloadcms/payload/commit/6a189c6548b233aba64598af8804a56ec47e45f0))
### Features
- add support for sharp resize options ([#2844](https://github.com/payloadcms/payload/issues/2844)) ([144bb81](https://github.com/payloadcms/payload/commit/144bb81721814c19eb4957d4c8fcc845c73e2aa4))
- allows for upload relationship drawer to be opened ([#3108](https://github.com/payloadcms/payload/issues/3108)) ([ea73e68](https://github.com/payloadcms/payload/commit/ea73e689ac46f2a7ba3b6c34e7a190944b5d5868))
- option to pre-fill login credentials automatically ([#3021](https://github.com/payloadcms/payload/issues/3021)) ([c5756ed](https://github.com/payloadcms/payload/commit/c5756ed4a13b46bc73ae7b23309d6e9980fc81bf))
- programmatic control over array and block rows inside the form ([#3110](https://github.com/payloadcms/payload/issues/3110)) ([a78c463](https://github.com/payloadcms/payload/commit/a78c4631b4aabb5b57448ab21ef98749b1cf1935))
- set JWT token field name with saveToJWT ([#3126](https://github.com/payloadcms/payload/issues/3126)) ([356f174](https://github.com/payloadcms/payload/commit/356f174b9ff601facb0062d0b65db18803ef2aa2))
## [1.11.8](https://github.com/payloadcms/payload/compare/v1.11.7...v1.11.8) (2023-07-31)
## [1.11.7](https://github.com/payloadcms/payload/compare/v1.11.6...v1.11.7) (2023-07-27)
### Bug Fixes
- [#3062](https://github.com/payloadcms/payload/issues/3062) ([0280953](https://github.com/payloadcms/payload/commit/02809532b484d9018c6528cfbbbb43abfd55a540))
- array row deletion ([#3062](https://github.com/payloadcms/payload/issues/3062)) ([cf9795b](https://github.com/payloadcms/payload/commit/cf9795b8d8b53c48335ff4c32c6c51b3de4f7bc9))
- incorrect image rotation after being processed by sharp ([#3081](https://github.com/payloadcms/payload/issues/3081)) ([0a91950](https://github.com/payloadcms/payload/commit/0a91950f052ce40427801e6561a0f676354a2ca4))
### Features
- ability to add context to payload's request object ([#2796](https://github.com/payloadcms/payload/issues/2796)) ([67ba131](https://github.com/payloadcms/payload/commit/67ba131cc61f3d3b30ef9ef7fc150344ca82da2f))
## [1.11.6](https://github.com/payloadcms/payload/compare/v1.11.5...v1.11.6) (2023-07-25)
### Bug Fixes
- **collections:admin:** Enable adminThumbnail fn execution on all types ([2c74e93](https://github.com/payloadcms/payload/commit/2c74e9396a216a033e2bacdf189b7f28a0f97505))
- threads hasMaxRows into ArrayAction components within blocks and arrays ([#3066](https://github.com/payloadcms/payload/issues/3066)) ([d43c83d](https://github.com/payloadcms/payload/commit/d43c83dad1bab5b05f4fcbae7d41de369905797c))
## [1.11.5](https://github.com/payloadcms/payload/compare/v1.11.4...v1.11.5) (2023-07-25)
### Bug Fixes
- admin route not mounting on production serve ([#3071](https://github.com/payloadcms/payload/issues/3071)) ([e718668](https://github.com/payloadcms/payload/commit/e71866856fffefcfb61dd3d29135cccb66939a62))
## [1.11.4](https://github.com/payloadcms/payload/compare/v1.11.3...v1.11.4) (2023-07-25)
### Bug Fixes
- if arrayFieldType rows are undefined, page would crash ([#3049](https://github.com/payloadcms/payload/issues/3049)) ([08377cc](https://github.com/payloadcms/payload/commit/08377cc5a7ea9d02350177e2e1d69390ee97af78))
### Features
- bump mongoose and mongoose-paginate versions ([#3025](https://github.com/payloadcms/payload/issues/3025)) ([41d3eee](https://github.com/payloadcms/payload/commit/41d3eee35f3855798a5c3372f8ad7c742a7810f7))
- improve keyboard focus styles ([#3011](https://github.com/payloadcms/payload/issues/3011)) ([080e619](https://github.com/payloadcms/payload/commit/080e6195ef39ec858fbb115e8f554a8dfc436438))
- solidifies bundler adapter pattern ([#3044](https://github.com/payloadcms/payload/issues/3044)) ([641c765](https://github.com/payloadcms/payload/commit/641c765fb921e162c98f09218929348037dd0f88))
## [1.11.3](https://github.com/payloadcms/payload/compare/v1.11.2...v1.11.3) (2023-07-19)
### Bug Fixes
- adds backdrop blur to button ([#3006](https://github.com/payloadcms/payload/issues/3006)) ([4233426](https://github.com/payloadcms/payload/commit/42334263bbc6219be92c5728f1a4ac6c8d2d1306))
- rich text link element not validating on create ([#3014](https://github.com/payloadcms/payload/issues/3014)) ([60fca40](https://github.com/payloadcms/payload/commit/60fca40780d4ddd8e684a455de55c566ec91e223))
### Features
- auto-login in config capability ([#3009](https://github.com/payloadcms/payload/issues/3009)) ([733fc0b](https://github.com/payloadcms/payload/commit/733fc0b2d0cf0f2d58c8a28e84776f883774b0e0))
- returns queried user alongside refreshed token ([#2813](https://github.com/payloadcms/payload/issues/2813)) ([2fc03f1](https://github.com/payloadcms/payload/commit/2fc03f196e4e5fa0ad3369ec976c0b6889ebda88))
- support logger destination ([#2896](https://github.com/payloadcms/payload/issues/2896)) ([cd0bf68](https://github.com/payloadcms/payload/commit/cd0bf68a6150b1adbdb9ee318ac0a06c4476aa4d))
## [1.11.2](https://github.com/payloadcms/payload/compare/v1.11.1...v1.11.2) (2023-07-14)
### Features
- adds array, collapsible, tab and group error states ([4925f90](https://github.com/payloadcms/payload/commit/4925f90b5f5c8fb8092bf4e8d88d5e0c1846b094))
## [1.11.1](https://github.com/payloadcms/payload/compare/v1.11.0...v1.11.1) (2023-07-11)
### Bug Fixes
- [#2980](https://github.com/payloadcms/payload/issues/2980), locale=all was not iterating through arrays / blocks ([d6bfba7](https://github.com/payloadcms/payload/commit/d6bfba72a6b1a84bc5bb9dd14c7ce31d7afcbc1c))
- anchor Button component respect margins ([#2648](https://github.com/payloadcms/payload/issues/2648)) ([1877d22](https://github.com/payloadcms/payload/commit/1877d2247c89ca5c8e1f0e1f989154d54768fed8))
# [1.11.0](https://github.com/payloadcms/payload/compare/v1.10.5...v1.11.0) (2023-07-05)
### Bug Fixes
- ensures fields within blocks respect field level access control ([#2969](https://github.com/payloadcms/payload/issues/2969)) ([5b79067](https://github.com/payloadcms/payload/commit/5b79067cc14874abbd1e1a5b6e619d41571b187f))
- ensures rows always have id's ([#2968](https://github.com/payloadcms/payload/issues/2968)) ([04851d0](https://github.com/payloadcms/payload/commit/04851d0dc99e4a3df0a1ac642e9a4b9a3c06d8a1))
- GraphQL type for number field ([#2954](https://github.com/payloadcms/payload/issues/2954)) ([29d8bf0](https://github.com/payloadcms/payload/commit/29d8bf0927038d2305218e5a6b811e0c4039d617))
- nested richtext bug and test ([#2966](https://github.com/payloadcms/payload/issues/2966)) ([801f609](https://github.com/payloadcms/payload/commit/801f60939b1bb4e33fbabe1f9a3c4a04a47912db))
- properly threads custom react-select props through relationship field ([#2973](https://github.com/payloadcms/payload/issues/2973)) ([79393e8](https://github.com/payloadcms/payload/commit/79393e8cf0b79b31fa711536e0bc22b1a251468a))
### Features
- improve typing of ExtendableError and APIError ([#2864](https://github.com/payloadcms/payload/issues/2864)) ([7c47e4b](https://github.com/payloadcms/payload/commit/7c47e4b0d3c63f6f7800daaf424935d6067ffcc4))
- narrow endpoint.method type ([#1880](https://github.com/payloadcms/payload/issues/1880)) ([b734a1c](https://github.com/payloadcms/payload/commit/b734a1c422d200cad1085b7e92f8540df4238e32))
## [1.10.5](https://github.com/payloadcms/payload/compare/v1.10.4...v1.10.5) (2023-06-30)
### Bug Fixes
- fields in drawer cannot be edited ([#2949](https://github.com/payloadcms/payload/issues/2949)) ([0c2e41c](https://github.com/payloadcms/payload/commit/0c2e41c4bef9333c47a9b1db0de807696b3f3872)), closes [#2945](https://github.com/payloadcms/payload/issues/2945)
- improve versions test suite ([#2941](https://github.com/payloadcms/payload/issues/2941)) ([1d4df99](https://github.com/payloadcms/payload/commit/1d4df99ea78c5f682074ae824dcd8dea18b774e0))
- incorrect graphql type generation ([#2898](https://github.com/payloadcms/payload/issues/2898)) ([b36deb4](https://github.com/payloadcms/payload/commit/b36deb4640cad4f494a12ab74b4e4d9a918cd94b))
## [1.10.4](https://github.com/payloadcms/payload/compare/v1.10.3...v1.10.4) (2023-06-30)
### Features
- add locale to displayed API URL ([b22d157](https://github.com/payloadcms/payload/commit/b22d157bd2f1c1a857e2d42bdc5b893549e3db9e))
## [1.10.3](https://github.com/payloadcms/payload/compare/v1.10.2...v1.10.3) (2023-06-30)
### Bug Fixes
- [#2937](https://github.com/payloadcms/payload/issues/2937), depth not being respected in graphql rich text fields ([f84b432](https://github.com/payloadcms/payload/commit/f84b4323e2fce57e2e14b181e486ed72cc09ded5))
- shows updatedAt date when selecting a version to compare from dropdown ([3c9dab3](https://github.com/payloadcms/payload/commit/3c9dab3b9d5302d8bdf5792f0384cd5aeeb13839))
## [1.10.2](https://github.com/payloadcms/payload/compare/v1.10.1...v1.10.2) (2023-06-26)
### Bug Fixes
- adjusts swc loader to only exclude non ts/tsx files - [#2888](https://github.com/payloadcms/payload/issues/2888) ([#2907](https://github.com/payloadcms/payload/issues/2907)) ([a2d9ef3](https://github.com/payloadcms/payload/commit/a2d9ef3ca618934df58102a7e02e86dbe0ed63da))
- autosave on localized fields, adds test ([6893231](https://github.com/payloadcms/payload/commit/6893231f85f702189089a6d78d3f3af63aaa0d82))
- broken export of entityToJSONSchema ([#2894](https://github.com/payloadcms/payload/issues/2894)) ([837dccc](https://github.com/payloadcms/payload/commit/837dcccefeffe7bb6e674713b4184c4eb92db8dc))
- correctly scopes data variable within bulk update - [#2901](https://github.com/payloadcms/payload/issues/2901) ([#2904](https://github.com/payloadcms/payload/issues/2904)) ([f627277](https://github.com/payloadcms/payload/commit/f627277479e6a4a847e79f54c545712a7186abb9))
- safely check for tempFilePath when updating media document ([#2899](https://github.com/payloadcms/payload/issues/2899)) ([8206c0f](https://github.com/payloadcms/payload/commit/8206c0fe8be78a5e0f7c8e64996d73d135b1fcc2))
## [1.10.1](https://github.com/payloadcms/payload/compare/v1.10.0...v1.10.1) (2023-06-22)
### Bug Fixes
- conditional fields perf bug - [#2886](https://github.com/payloadcms/payload/issues/2886) ([#2890](https://github.com/payloadcms/payload/issues/2890)) ([b83d788](https://github.com/payloadcms/payload/commit/b83d788d3cfe12f87dcd63a9df20b939a6f4681e))
- cutoff tooltips in relationship field ([#2873](https://github.com/payloadcms/payload/issues/2873)) ([09c6cad](https://github.com/payloadcms/payload/commit/09c6cad3e8462dc3d8b1b6424aafd336c1d7828c))
- Relationship hasMany and filterOptions fails above 10 items ([#2891](https://github.com/payloadcms/payload/issues/2891)) ([8128de6](https://github.com/payloadcms/payload/commit/8128de64dff98fdbcf053faef9de3c3f9a733071))
# [1.10.0](https://github.com/payloadcms/payload/compare/v1.9.5...v1.10.0) (2023-06-20)
### Bug Fixes
- [#2831](https://github.com/payloadcms/payload/issues/2831), persists payloadAPI through local operations that accept req ([85d2467](https://github.com/payloadcms/payload/commit/85d2467d73582a372ee34e3ce93403847a1f0689))
- [#2842](https://github.com/payloadcms/payload/issues/2842), querying number custom ids with in ([116e9ff](https://github.com/payloadcms/payload/commit/116e9ffe81f44c4b40fa578b4a8fe4bb70fd110c))
- default sort with near operator ([#2862](https://github.com/payloadcms/payload/issues/2862)) ([99f3809](https://github.com/payloadcms/payload/commit/99f38098dd4a386437c469becc975ca86c54601f))
- deprecate min/max in exchange for minRows and maxRows for relationship field ([#2826](https://github.com/payloadcms/payload/issues/2826)) ([0d8d7f3](https://github.com/payloadcms/payload/commit/0d8d7f358d390184f6f888d77858b4a145e94214))
- drawer close on backspace ([#2869](https://github.com/payloadcms/payload/issues/2869)) ([a110ba2](https://github.com/payloadcms/payload/commit/a110ba2dc09cd0824a9b1eb8e011604388277bd8))
- drawer fields are read-only if opened from a hasMany relationship ([#2843](https://github.com/payloadcms/payload/issues/2843)) ([542b536](https://github.com/payloadcms/payload/commit/542b5362d3ec8741aff6b1672fab7d2250e7b854))
- fields in relationship drawer not usable [#2815](https://github.com/payloadcms/payload/issues/2815) ([#2870](https://github.com/payloadcms/payload/issues/2870)) ([8626dc6](https://github.com/payloadcms/payload/commit/8626dc6b1a926143e7ba505f3edd924432168675))
- mobile loading overlay width [#2866](https://github.com/payloadcms/payload/issues/2866) ([#2867](https://github.com/payloadcms/payload/issues/2867)) ([ba9d633](https://github.com/payloadcms/payload/commit/ba9d6336acc779cfec0db312c8e2da912ce58cd4))
- near query sorting by distance and pagination ([#2861](https://github.com/payloadcms/payload/issues/2861)) ([1611896](https://github.com/payloadcms/payload/commit/16118960aa6d63f7a429f168ff4305f336b1b1e6))
- relationship field query pagination ([#2871](https://github.com/payloadcms/payload/issues/2871)) ([ce84174](https://github.com/payloadcms/payload/commit/ce84174554d9d828cbaaaa9548e5defc0feb4e2b))
- slow like queries with lots of records ([4dd703a](https://github.com/payloadcms/payload/commit/4dd703a6bff0ab7d06af234baa975553bd62f176))
### Features
- automatically redirect a user back to their originally requested URL after login ([#2838](https://github.com/payloadcms/payload/issues/2838)) ([e910688](https://github.com/payloadcms/payload/commit/e9106882f721d43bcc05a1690bda7754b450404e))
- hasMany for number field ([#2517](https://github.com/payloadcms/payload/issues/2517)) ([8f086e3](https://github.com/payloadcms/payload/commit/8f086e315cb30be9d399fd3022c16952fb81cb2e)), closes [#2812](https://github.com/payloadcms/payload/issues/2812) [#2821](https://github.com/payloadcms/payload/issues/2821) [#2823](https://github.com/payloadcms/payload/issues/2823) [#2824](https://github.com/payloadcms/payload/issues/2824) [#2814](https://github.com/payloadcms/payload/issues/2814) [#2793](https://github.com/payloadcms/payload/issues/2793) [#2835](https://github.com/payloadcms/payload/issues/2835)
- optimizes conditional logic performance ([967f217](https://github.com/payloadcms/payload/commit/967f21734600de1fec8c1227a354ef5a417e54c5))
## [1.9.5](https://github.com/payloadcms/payload/compare/v1.9.4...v1.9.5) (2023-06-16)
## [1.9.4](https://github.com/payloadcms/payload/compare/v1.9.3...v1.9.4) (2023-06-16)
### Bug Fixes
- incorrectly return totalDocs=1 instead of the correct count when pagination=false ([2e73938](https://github.com/payloadcms/payload/commit/2e7393853447d2da41ddef79f73e9026719a674b))
## [1.9.3](https://github.com/payloadcms/payload/compare/v1.9.2...v1.9.3) (2023-06-16)
### Bug Fixes
- adds custom property to ui field in joi validation ([#2835](https://github.com/payloadcms/payload/issues/2835)) ([56d7745](https://github.com/payloadcms/payload/commit/56d7745139e31c5d42c5191477f409f12589a952))
- ensures relations to object ids can be queried on ([c3d6e1b](https://github.com/payloadcms/payload/commit/c3d6e1b490a69f0aadb00e54e46a8774732e6658))
## [1.9.2](https://github.com/payloadcms/payload/compare/v1.9.1...v1.9.2) (2023-06-14)
### Bug Fixes
- [#2821](https://github.com/payloadcms/payload/issues/2821) i18n ui field label ([#2823](https://github.com/payloadcms/payload/issues/2823)) ([63cd7fb](https://github.com/payloadcms/payload/commit/63cd7fbd0c91bbf5120e95fd33388a38e593b341))
- adds missing dark-mode styles for version differences view ([#2812](https://github.com/payloadcms/payload/issues/2812)) ([346a48f](https://github.com/payloadcms/payload/commit/346a48f871e09a3d5e25b7ff9e45689a104b0f9f))
- sanitize reset password result - [#2805](https://github.com/payloadcms/payload/issues/2805) ([#2808](https://github.com/payloadcms/payload/issues/2808)) ([46a5f41](https://github.com/payloadcms/payload/commit/46a5f417217313b049f4b412abb3319634f27262))
- user can be created without having to specify an email - [#2801](https://github.com/payloadcms/payload/issues/2801) ([abe3852](https://github.com/payloadcms/payload/commit/abe38520aaaefdfaea4c47130eea04a42a82627b))
## [1.9.1](https://github.com/payloadcms/payload/compare/v1.9.0...v1.9.1) (2023-06-09)
### Features
- adds option to customize filename on upload ([596eea1](https://github.com/payloadcms/payload/commit/596eea1f0a42628464e5269c496360b808c35f97))
- collection list view custom components: BeforeList, BeforeListTable, AfterListTable, AfterList ([#2792](https://github.com/payloadcms/payload/issues/2792)) ([38e962f](https://github.com/payloadcms/payload/commit/38e962f2cbcaf9eaa72276969289efdbf670c7c7))
# [1.9.0](https://github.com/payloadcms/payload/compare/v1.8.6...v1.9.0) (2023-06-07)
### Features
- custom type interfaces ([#2709](https://github.com/payloadcms/payload/issues/2709)) ([8458a98](https://github.com/payloadcms/payload/commit/8458a98eff0eedf1abfd9ec065a084955a9b8149))
## [1.8.6](https://github.com/payloadcms/payload/compare/v1.8.5...v1.8.6) (2023-06-07)
### Bug Fixes
- [#2711](https://github.com/payloadcms/payload/issues/2711) index sortable field global versions fields ([#2775](https://github.com/payloadcms/payload/issues/2775)) ([576af01](https://github.com/payloadcms/payload/commit/576af01b6f81d24621d522e8d8b9c496eafa6df0))
- [#2767](https://github.com/payloadcms/payload/issues/2767) bulk operations missing locales in admin requests ([e30871a](https://github.com/payloadcms/payload/commit/e30871a96ff25f12401a3cc3bc5e12c064eeff3f))
- [#2771](https://github.com/payloadcms/payload/issues/2771) relationship field not querying all collections ([#2774](https://github.com/payloadcms/payload/issues/2774)) ([8b767a1](https://github.com/payloadcms/payload/commit/8b767a166aa16659d8880cc68da546251725b20b))
- adjusts activation constraint of draggable nodes ([#2773](https://github.com/payloadcms/payload/issues/2773)) ([863be3d](https://github.com/payloadcms/payload/commit/863be3d852af6c6a76021695f895badf23e776ae))
- flattens relationships in the update operation for globals [#2766](https://github.com/payloadcms/payload/issues/2766) ([#2776](https://github.com/payloadcms/payload/issues/2776)) ([3677cf6](https://github.com/payloadcms/payload/commit/3677cf688d0e456c42068b4eab0086e64407d938))
- improperly typing optional arrays with required fields as required ([f1fc305](https://github.com/payloadcms/payload/commit/f1fc305ac443ecb247622bc89067b129e96146fc))
- read-only Auth fields ([#2781](https://github.com/payloadcms/payload/issues/2781)) ([3c72f33](https://github.com/payloadcms/payload/commit/3c72f3303c57e88256266c343225157e0b081bba))
- read-only Auth fields ([#2781](https://github.com/payloadcms/payload/issues/2781)) ([60f5522](https://github.com/payloadcms/payload/commit/60f5522e67acb353e6d5ce05f0012241c192d4b4))
- recursiveNestedPaths not merging existing fields when hoisting row/collapsible fields ([#2769](https://github.com/payloadcms/payload/issues/2769)) ([536d701](https://github.com/payloadcms/payload/commit/536d7017eebd5a8e14b2936c55a7fccc90d3f530))
## [1.8.5](https://github.com/payloadcms/payload/compare/v1.8.4...v1.8.5) (2023-06-03)
### Features
- allows objectid through relationship validation ([42afa6b](https://github.com/payloadcms/payload/commit/42afa6b48aa924fa0dfc9defadf08ddb029da6c1))
## [1.8.4](https://github.com/payloadcms/payload/compare/v1.8.3...v1.8.4) (2023-06-02)
### Features
- Add Bulgarian translation ([#2753](https://github.com/payloadcms/payload/issues/2753)) ([51108c0](https://github.com/payloadcms/payload/commit/51108c02ea346fd41c1b94ef7c339feec8383dd1))
### Bug Fixes
- group row hoisting ([#2683](https://github.com/payloadcms/payload/issues/2683)) ([1626e17](https://github.com/payloadcms/payload/commit/1626e173b7eced83c59e8eb4f70b0bb68fdb0e7a))
- graphql where types on rows and collapsible's ([#2758](https://github.com/payloadcms/payload/issues/2758)) ([f978299](https://github.com/payloadcms/payload/commit/f978299868bf352e147070afdf556bf1153bac56))
- RichText link custom fields ([#2756](https://github.com/payloadcms/payload/issues/2756)) ([23be263](https://github.com/payloadcms/payload/commit/23be263dd2e75dca448019b1c66d7f6dd3558b37))
- adds timestamps to global schemas ([#2738](https://github.com/payloadcms/payload/issues/2738)) ([0986282](https://github.com/payloadcms/payload/commit/0986282f13d8a3b5596c4a241b4da35e6fac6aa1))
- adjusts code field joi schema to allow editorOptions ([ed136fb](https://github.com/payloadcms/payload/commit/ed136fbc5146889cd30c641d4947da58b66dfb2f))
- fix locale popup overflow ([#2737](https://github.com/payloadcms/payload/issues/2737)) ([8ee9724](https://github.com/payloadcms/payload/commit/8ee9724277d419de78b27a8ffa22f3a599361251))
- fix tests by hard-coding the URL in the logger ([2697974](https://github.com/payloadcms/payload/commit/2697974694112440bf1737c4ce535ba77bf4b194))
- mongoose connection ([#2754](https://github.com/payloadcms/payload/issues/2754)) ([69b97bb](https://github.com/payloadcms/payload/commit/69b97bbc590c62fffbcd03a42f0e9737e3f7ca01))
- removes payload dependency inception ([#2717](https://github.com/payloadcms/payload/issues/2717)) ([6125b66](https://github.com/payloadcms/payload/commit/6125b66286e5315725ca0ae365c81a04c1c1a54c))
- searches on correct useAsTitle field in polymorphic list drawers [#2710](https://github.com/payloadcms/payload/issues/2710) ([9ec2a40](https://github.com/payloadcms/payload/commit/9ec2a40274ea9b3a32e43cb992df3897baf62e63))
- typing of sendMail function ([e3ff4c4](https://github.com/payloadcms/payload/commit/e3ff4c46cbecf731c9a3c688682bcb33012cb234))
- corrects relationship field schema from pr [#2696](https://github.com/payloadcms/payload/issues/2696) ([#2714](https://github.com/payloadcms/payload/issues/2714)) ([8285bac](https://github.com/payloadcms/payload/commit/8285bac2f5eb443b6af160b21726edf3f828a52f))
## [1.8.3](https://github.com/payloadcms/payload/compare/v1.8.3...v1.8.3) (2023-05-24)
### Bug Fixes
- [#2662](https://github.com/payloadcms/payload/issues/2662), draft=true querying by id ([3b78ab0](https://github.com/payloadcms/payload/commit/3b78ab04c7a68e39afa9936ac692169ed2c8fb74))
- [#2685](https://github.com/payloadcms/payload/issues/2685), graphql querying relationships with custom id ([9bb5470](https://github.com/payloadcms/payload/commit/9bb54703423b3f0fdb242a5e63f322d346323b06))
- adds credentials to doc access request ([#2705](https://github.com/payloadcms/payload/issues/2705)) ([c716954](https://github.com/payloadcms/payload/commit/c716954e89b0aef976cbcbef9ece981ec9bab233))
- prevents add new relationship modal from adding duplicative values to the parent doc [#2688](https://github.com/payloadcms/payload/issues/2688) ([a2a8ac9](https://github.com/payloadcms/payload/commit/a2a8ac9549bd67e6ab578772689684fd2bc64872))
- unable to clear relationships or open relationship drawer on mobile [#2691](https://github.com/payloadcms/payload/issues/2691) [#2692](https://github.com/payloadcms/payload/issues/2692) ([782f8ca](https://github.com/payloadcms/payload/commit/782f8ca047178cadb4214702854a0e0cb2d9eaab))
## [1.8.2](https://github.com/payloadcms/payload/compare/v1.8.1...v1.8.2) (2023-05-10)
### Bug Fixes
- react webpack alias ([1732bb8](https://github.com/payloadcms/payload/commit/1732bb877ca9688fc87cf44fbf63d05b6be23de2))
## [1.8.1](https://github.com/payloadcms/payload/compare/v1.8.0...v1.8.1) (2023-05-10)
### Bug Fixes
- add dotenv.config() to test/dev.ts ([#2646](https://github.com/payloadcms/payload/issues/2646)) ([7963e75](https://github.com/payloadcms/payload/commit/7963e7540f4899c16a49b47cf5145f46ea0c71cf))
### Features
- allow users to manipulate images without needing to resize them ([#2574](https://github.com/payloadcms/payload/issues/2574)) ([8531687](https://github.com/payloadcms/payload/commit/85316879cd97933ed34588b0cee72798964de281))
- export additional graphql types ([#2610](https://github.com/payloadcms/payload/issues/2610)) ([3f185cb](https://github.com/payloadcms/payload/commit/3f185cb18b9677654b92921267ffef408388d0d1))
# [1.8.0](https://github.com/payloadcms/payload/compare/v1.7.5...v1.8.0) (2023-05-09)
### Bug Fixes
- correct casing on graphql type ([219f50b](https://github.com/payloadcms/payload/commit/219f50b0bc7a520655a5ae4f1d8b08fd04c8a3dd))
- defaultValue missing from Upload field schema ([7b21eaf](https://github.com/payloadcms/payload/commit/7b21eaf12da64778568b45e56fa8d39e81f11c29))
- ensures nested querying works when querying across collections ([09974fa](https://github.com/payloadcms/payload/commit/09974fa68677586c727943cc234311f87bf6da75))
- query custom text id fields ([967f2ac](https://github.com/payloadcms/payload/commit/967f2ace0ea1a65570f69e85920f2f55626efde0))
- removes deprecated queryHiddenFIelds from local API docs ([5f30dbb](https://github.com/payloadcms/payload/commit/5f30dbb1a5b7c7ab6752c114710f92c159319d3d))
- removes queryHiddenFields from example Find operation ([fb4f822](https://github.com/payloadcms/payload/commit/fb4f822d34d0235a537f96515073e2662680412f))
- resolve process/browser package in webpack config ([02f27f3](https://github.com/payloadcms/payload/commit/02f27f3de6fdaf5dd0023298fc671a8ae9a1b758))
- Row groups in tabs vertical alignment ([#2593](https://github.com/payloadcms/payload/issues/2593)) ([54fac4a](https://github.com/payloadcms/payload/commit/54fac4a5d793b534e25600d2f9470c449f40df1d))
- softens columns and filters pill colors ([#2642](https://github.com/payloadcms/payload/issues/2642)) ([9072096](https://github.com/payloadcms/payload/commit/90720964953d392d85982052b3a4843a5450681e))
- webp upload formatting ([ccd6ca2](https://github.com/payloadcms/payload/commit/ccd6ca298e69faf04709535df3fcb18eb3d40f1b))
### Features
- add Arabic translations ([#2641](https://github.com/payloadcms/payload/issues/2641)) ([7d04cf1](https://github.com/payloadcms/payload/commit/7d04cf14fb0587f2208745bb77ed4fd17e99c8d5))
- allow full URL in staticURL ([#2562](https://github.com/payloadcms/payload/issues/2562)) ([a9b5dff](https://github.com/payloadcms/payload/commit/a9b5dffa00623eb48302d51b88c3449920c10f46))
## [1.7.5](https://github.com/payloadcms/payload/compare/v1.7.4...v1.7.5) (2023-05-04)
### Bug Fixes
- make incrementName match multiple digits ([#2609](https://github.com/payloadcms/payload/issues/2609)) ([8dbf0a2](https://github.com/payloadcms/payload/commit/8dbf0a2bd88db1b361ce16bb730613de489f2ed2))
### Features
- collection admin.enableRichTextLink property ([#2560](https://github.com/payloadcms/payload/issues/2560)) ([9678992](https://github.com/payloadcms/payload/commit/967899229f458d06a3931d086bcc49299dc310b7))
- custom admin buttons ([#2618](https://github.com/payloadcms/payload/issues/2618)) ([1d58007](https://github.com/payloadcms/payload/commit/1d58007606fa7e34007f2a56a3ca653d2cd3404d))
## [1.7.4](https://github.com/payloadcms/payload/compare/v1.7.3...v1.7.4) (2023-05-02)
### Bug Fixes
- properly import SwcMinifyWebpackPlugin ([#2600](https://github.com/payloadcms/payload/issues/2600)) ([802deac](https://github.com/payloadcms/payload/commit/802deaca03f8506fa4a7adb8fc008205c2c4f013))
## [1.7.3](https://github.com/payloadcms/payload/compare/v1.7.2...v1.7.3) (2023-05-01)
### Bug Fixes
- [#2592](https://github.com/payloadcms/payload/issues/2592), allows usage of hidden fields within access query constraints ([#2599](https://github.com/payloadcms/payload/issues/2599)) ([a0bb13a](https://github.com/payloadcms/payload/commit/a0bb13a4123b51d770b364ddaee3dde1c5a3da53))
- addds workaround for slate isBlock function issue ([#2596](https://github.com/payloadcms/payload/issues/2596)) ([8f6f13d](https://github.com/payloadcms/payload/commit/8f6f13dc93f49f5ba5384a9168ced5baec85e1fb))
- bulk operations result type ([#2588](https://github.com/payloadcms/payload/issues/2588)) ([8382faa](https://github.com/payloadcms/payload/commit/8382faa0afc8118f4fb873c657a52c48abb2a6ad))
- query on id throws 500 ([#2587](https://github.com/payloadcms/payload/issues/2587)) ([0ba22c3](https://github.com/payloadcms/payload/commit/0ba22c3aafca67be78814357edc668ed11ec4a97))
- timestamp queries ([#2583](https://github.com/payloadcms/payload/issues/2583)) ([9c5107e](https://github.com/payloadcms/payload/commit/9c5107e86d70e36ac181c9d3ad51edacf9fc529a))
### Features
- Add new translation for romanian language ([#2556](https://github.com/payloadcms/payload/issues/2556)) ([fbf3a2a](https://github.com/payloadcms/payload/commit/fbf3a2a1b4633e704e467d9aec05f3ae0b900bae))
- add persian translations ([#2553](https://github.com/payloadcms/payload/issues/2553)) ([c80f68a](https://github.com/payloadcms/payload/commit/c80f68af943c730996c9cdad87cf84d4d06a5777))
- adjust stack trace for api error ([#2598](https://github.com/payloadcms/payload/issues/2598)) ([870838e](https://github.com/payloadcms/payload/commit/870838e7563b6767c53f4dc0288119087e3f9486))
- allow customizing the link fields ([#2559](https://github.com/payloadcms/payload/issues/2559)) ([bf65228](https://github.com/payloadcms/payload/commit/bf6522898db353e75db11525ea5a1b58243333d8))
- supports collection compound indexes ([#2529](https://github.com/payloadcms/payload/issues/2529)) ([85b3d57](https://github.com/payloadcms/payload/commit/85b3d579d3054aad2de793957cf6454332361327))
## [1.7.2](https://github.com/payloadcms/payload/compare/v1.7.1...v1.7.2) (2023-04-25)
### Bug Fixes
* [#2521](https://github.com/payloadcms/payload/issues/2521), graphql AND not working with drafts ([e67ca20](https://github.com/payloadcms/payload/commit/e67ca2010831c14938d3f639fcb5374ca62747ba))
* document drawer access control [#2545](https://github.com/payloadcms/payload/issues/2545) ([439caf8](https://github.com/payloadcms/payload/commit/439caf815fc99538f14b3a59835dcf49185759dc))
* prevent floating point number in image sizes ([#1935](https://github.com/payloadcms/payload/issues/1935)) ([7fcde11](https://github.com/payloadcms/payload/commit/7fcde11fa0b232537de606e44c0af68b122daed2))
* prevent sharp toFormat settings fallthrough by using clone ([#2547](https://github.com/payloadcms/payload/issues/2547)) ([90dab3c](https://github.com/payloadcms/payload/commit/90dab3c445d4bdbab0eff286a2b66861d04f2a93))
* query localized fields without localization configured ([12edb1c](https://github.com/payloadcms/payload/commit/12edb1cc4b2675d9b0948fb7f3439f61c6e2015d))
* read-only styles ([823d022](https://github.com/payloadcms/payload/commit/823d0228c949fe58a7e0f11f95354b240c3ea876))
- [#2521](https://github.com/payloadcms/payload/issues/2521), graphql AND not working with drafts ([e67ca20](https://github.com/payloadcms/payload/commit/e67ca2010831c14938d3f639fcb5374ca62747ba))
- document drawer access control [#2545](https://github.com/payloadcms/payload/issues/2545) ([439caf8](https://github.com/payloadcms/payload/commit/439caf815fc99538f14b3a59835dcf49185759dc))
- prevent floating point number in image sizes ([#1935](https://github.com/payloadcms/payload/issues/1935)) ([7fcde11](https://github.com/payloadcms/payload/commit/7fcde11fa0b232537de606e44c0af68b122daed2))
- prevent sharp toFormat settings fallthrough by using clone ([#2547](https://github.com/payloadcms/payload/issues/2547)) ([90dab3c](https://github.com/payloadcms/payload/commit/90dab3c445d4bdbab0eff286a2b66861d04f2a93))
- query localized fields without localization configured ([12edb1c](https://github.com/payloadcms/payload/commit/12edb1cc4b2675d9b0948fb7f3439f61c6e2015d))
- read-only styles ([823d022](https://github.com/payloadcms/payload/commit/823d0228c949fe58a7e0f11f95354b240c3ea876))
### Features
* add rich-text blockquote element, change quote node type to blockquote ([ed230a4](https://github.com/payloadcms/payload/commit/ed230a42e0315dc2492b4a26e3bf8b5334e89380))
* add user to field conditional logic ([274edc7](https://github.com/payloadcms/payload/commit/274edc74a70202e8c771c5111507b585c3f69377))
* exposes id in conditional logic ([c117b32](https://github.com/payloadcms/payload/commit/c117b321474b8318c3a0ddf544e49568e461f0d8))
* **imageresizer:** add trim options ([#2073](https://github.com/payloadcms/payload/issues/2073)) ([0406548](https://github.com/payloadcms/payload/commit/0406548fe6127e091db9926ee42e59f9158eff5a))
- add rich-text blockquote element, change quote node type to blockquote ([ed230a4](https://github.com/payloadcms/payload/commit/ed230a42e0315dc2492b4a26e3bf8b5334e89380))
- add user to field conditional logic ([274edc7](https://github.com/payloadcms/payload/commit/274edc74a70202e8c771c5111507b585c3f69377))
- exposes id in conditional logic ([c117b32](https://github.com/payloadcms/payload/commit/c117b321474b8318c3a0ddf544e49568e461f0d8))
- **imageresizer:** add trim options ([#2073](https://github.com/payloadcms/payload/issues/2073)) ([0406548](https://github.com/payloadcms/payload/commit/0406548fe6127e091db9926ee42e59f9158eff5a))
## [1.7.1](https://github.com/payloadcms/payload/compare/v1.7.0...v1.7.1) (2023-04-18)
### Bug Fixes
* adds 'use client' for next 13 compatibility ([5e02985](https://github.com/payloadcms/payload/commit/5e029852060d6475eccada35ffbcdd0178d5e690))
* graphql variables not being passed properly ([72be80a](https://github.com/payloadcms/payload/commit/72be80abc4082013e052aef1152a5de749a6f3c4))
- adds 'use client' for next 13 compatibility ([5e02985](https://github.com/payloadcms/payload/commit/5e029852060d6475eccada35ffbcdd0178d5e690))
- graphql variables not being passed properly ([72be80a](https://github.com/payloadcms/payload/commit/72be80abc4082013e052aef1152a5de749a6f3c4))
### Features
* configuration extension points ([023719d](https://github.com/payloadcms/payload/commit/023719d77554a70493d779ba94bf55058d4caf98))
- configuration extension points ([023719d](https://github.com/payloadcms/payload/commit/023719d77554a70493d779ba94bf55058d4caf98))
## [1.7.0](https://github.com/payloadcms/payload/compare/v1.6.32...v1.7.0) (2023-04-17)
@@ -409,47 +996,43 @@ We are pulling off a bandaid here and enforcing that `payload.init` is now async
To migrate, you need to convert your code everywhere that you run `payload.init` to be asynchronous instead. For example, here is an example of a traditional `payload.init` call which needs to be migrated:
```js
const express = require("express");
const payload = require("payload");
const express = require('express')
const payload = require('payload')
const app = express();
const app = express()
payload.init({
secret: "SECRET_KEY",
mongoURL: "mongodb://localhost/payload",
secret: 'SECRET_KEY',
mongoURL: 'mongodb://localhost/payload',
express: app,
});
})
app.listen(3000, async () => {
console.log(
"Express is now listening for incoming connections on port 3000."
);
});
console.log('Express is now listening for incoming connections on port 3000.')
})
```
Your `payload.init` call will need to be converted into the following:
```js
const express = require("express");
const payload = require("payload");
const express = require('express')
const payload = require('payload')
const app = express();
const app = express()
const start = async () => {
await payload.init({
secret: "SECRET_KEY",
mongoURL: "mongodb://localhost/payload",
secret: 'SECRET_KEY',
mongoURL: 'mongodb://localhost/payload',
express: app,
});
})
app.listen(3000, async () => {
console.log(
"Express is now listening for incoming connections on port 3000."
);
});
};
console.log('Express is now listening for incoming connections on port 3000.')
})
}
start();
start()
```
Notice that all we've done is wrapped the `payload.init` and `app.listen` calls with a `start` function that is asynchronous.
@@ -460,18 +1043,18 @@ Before this release, the Local API methods were configured as generics. For exam
```ts
const post = await payload.findByID<Post>({
collection: "posts",
id: "id-of-post-here",
});
collection: 'posts',
id: 'id-of-post-here',
})
```
Now, you don't need to pass your types and Payload will automatically infer them for you, as well as significantly improve typing throughout the local API. Here's an example:
```ts
const post = await payload.findByID({
collection: "posts", // this is now auto-typed
id: "id-of-post-here",
});
collection: 'posts', // this is now auto-typed
id: 'id-of-post-here',
})
// `post` will be automatically typed as `Post`
```
@@ -507,7 +1090,7 @@ If not already defined, add the following to your `compilerOptions`:
#### ✋ Versions may need to be migrated
This release includes a substantial simplification / optimization of how Versions work within Payload. They are now significantly more performant and easier to understand behind-the-scenes. We've removed ~600 lines of code and have ensured that Payload can be compatible with all flavors of Mongo - including versions earlier than 4.0, Azure Cosmos MongoDB, AWS' DocumentDB and more.
This release includes a substantial simplification / optimization of how Versions work within Payload. They are now significantly more performant and easier to understand behind-the-scenes. We've removed ~600 lines of code and have ensured that Payload can be compatible with all flavors of MongoDB - including versions earlier than 4.0, Azure Cosmos MongoDB, AWS' DocumentDB and more.
But, some of your draft-enabled documents may need to be migrated.
@@ -518,11 +1101,11 @@ To migrate, create this file within the root of your Payload project:
**migrateVersions.ts**
```ts
const payload = require("payload");
const payload = require('payload')
require("dotenv").config();
require('dotenv').config()
const { PAYLOAD_SECRET, MONGODB_URI } = process.env;
const { PAYLOAD_SECRET, MONGODB_URI } = process.env
// This function ensures that there is at least one corresponding version for any document
// within each of your draft-enabled collections.
@@ -535,7 +1118,7 @@ const ensureAtLeastOneVersion = async () => {
secret: PAYLOAD_SECRET,
mongoURL: MONGODB_URI,
local: true,
});
})
// For each collection
await Promise.all(
@@ -546,14 +1129,14 @@ const ensureAtLeastOneVersion = async () => {
collection: slug,
limit: 0,
depth: 0,
locale: "all",
});
locale: 'all',
})
const VersionsModel = payload.versions[slug];
const existingCollectionDocIds: Array<string> = [];
const VersionsModel = payload.versions[slug]
const existingCollectionDocIds: Array<string> = []
await Promise.all(
docs.map(async (doc) => {
existingCollectionDocIds.push(doc.id);
existingCollectionDocIds.push(doc.id)
// Find at least one version for the doc
const versionDocs = await VersionsModel.find(
{
@@ -561,8 +1144,8 @@ const ensureAtLeastOneVersion = async () => {
updatedAt: { $gte: doc.updatedAt },
},
null,
{ limit: 1 }
).lean();
{ limit: 1 },
).lean()
// If there are no corresponding versions,
// we need to create one
@@ -574,39 +1157,37 @@ const ensureAtLeastOneVersion = async () => {
autosave: Boolean(versions?.drafts?.autosave),
updatedAt: doc.updatedAt,
createdAt: doc.createdAt,
});
})
} catch (e) {
console.error(
`Unable to create version corresponding with collection ${slug} document ID ${doc.id}`,
e?.errors || e
);
e?.errors || e,
)
}
console.log(
`Created version corresponding with ${slug} document ID ${doc.id}`
);
console.log(`Created version corresponding with ${slug} document ID ${doc.id}`)
}
})
);
}),
)
const versionsWithoutParentDocs = await VersionsModel.deleteMany({
parent: { $nin: existingCollectionDocIds },
});
})
if (versionsWithoutParentDocs.deletedCount > 0) {
console.log(
`Removing ${versionsWithoutParentDocs.deletedCount} versions for ${slug} collection - parent documents no longer exist`
);
`Removing ${versionsWithoutParentDocs.deletedCount} versions for ${slug} collection - parent documents no longer exist`,
)
}
}
})
);
}),
)
console.log("Done!");
process.exit(0);
};
console.log('Done!')
process.exit(0)
}
ensureAtLeastOneVersion();
ensureAtLeastOneVersion()
```
Make sure your environment variables match the script's values above and then run `PAYLOAD_CONFIG_PATH=src/payload.config.ts npx ts-node -T migrateVersions.ts` in your terminal. Make sure that you point the command to your Payload config.
@@ -948,32 +1529,32 @@ Any future slugs after updating will be used as-is.
// Before
const ExampleCollection: CollectionConfig = {
slug: "case-studies",
slug: 'case-studies',
labels: {
// Before Payload used `labels.singular` to generate types/graphQL schema
singular: "Project",
plural: "Projects",
singular: 'Project',
plural: 'Projects',
},
};
}
// After
const ExampleCollection: CollectionConfig = {
// Now Payload uses `slug` to generate types/graphQL schema
slug: "case-studies",
slug: 'case-studies',
labels: {
singular: "Project",
plural: "Projects",
singular: 'Project',
plural: 'Projects',
},
// To override the usage of slug in graphQL schema generation
graphQL: {
singularName: "Project",
pluralName: "Projects",
singularName: 'Project',
pluralName: 'Projects',
},
// To override the usage of slug in type file generation
typescript: {
interface: "Project",
interface: 'Project',
},
};
}
```
- **Globals:** are affected if you have a `label` defined that differs from your global slug.
@@ -983,25 +1564,25 @@ Any future slugs after updating will be used as-is.
// Before
const ExampleGlobal: GlobalConfig = {
slug: "footer",
slug: 'footer',
// Before Payload used `label` to generate types/graphQL schema
label: "Page Footer",
};
label: 'Page Footer',
}
// After
const ExampleGlobal: GlobalConfig = {
// Now Payload uses `slug` to generate types/graphQL schema
slug: "footer",
label: "Page Footer",
slug: 'footer',
label: 'Page Footer',
// To override the usage of slug in graphQL schema generation
graphQL: {
name: "PageFooter",
name: 'PageFooter',
},
// To override the usage of slug in type file generation
typescript: {
interface: "PageFooter",
interface: 'PageFooter',
},
};
}
```
- **Block Fields:** are affected if you have a `label` defined that differs from your block slug.
@@ -2274,25 +2855,25 @@ Now, configs will be sanitized **_before_** plugins are executed **_as well as_*
So, where your plugin may have been typed like this before:
```ts
import { SanitizedConfig } from "payload/config";
import { SanitizedConfig } from 'payload/config'
const plugin = (config: SanitizedConfig): SanitizedConfig => {
return {
...config,
};
};
}
}
```
It can now be written like this:
```ts
import { Config } from "payload/config";
import { Config } from 'payload/config'
const plugin = (config: Config): Config => {
return {
...config,
};
};
}
}
```
### Features
@@ -2524,24 +3105,24 @@ For example, if you have a `pages` collection with no existing access control, a
```js
const Page = {
slug: "pages",
slug: 'pages',
access: {
// No `read` access control was set
},
};
}
```
To:
```js
const Page = {
slug: "pages",
slug: 'pages',
access: {
// Now we explicitly allow public read access
// to this collection's documents
read: () => true,
},
};
}
```
If none of your collections or globals should be publicly exposed, you don't need to do anything to upgrade.
@@ -3102,4 +3683,4 @@ If none of your collections or globals should be publicly exposed, you don't nee
- add blind index for encrypting API Keys ([9a1c1f6](https://github.com/payloadcms/payload/commit/9a1c1f64c0ea0066b679195f50e6cb1ac4bf3552))
- add license key to access routej ([2565005](https://github.com/payloadcms/payload/commit/2565005cc099797a6e3b8995e0984c28b7837e82))
## [0.0.137](https://github.com/payloadcms/payload/commit/5c1e2846a2694a80cc8707703406c2ac1bb6af8a) (2020-11-12)
## [0.0.137](https://github.com/payloadcms/payload/commit/5c1e2846a2694a80cc8707703406c2ac1bb6af8a) (2020-11-12)

91
CONTRIBUTING.md Normal file
View File

@@ -0,0 +1,91 @@
# Contributing to Payload
Below you'll find a set of guidelines for how to contribute to Payload.
## Opening issues
Before you submit an issue, please check all existing [open and closed issues](https://github.com/payloadcms/payload/issues) to see if your issue has previously been resolved or is already known. If there is already an issue logged, feel free to upvote it by adding a :thumbsup: [reaction](https://github.com/blog/2119-add-reactions-to-pull-requests-issues-and-comments). If you would like to submit a new issue, please fill out our Issue Template to the best of your ability so we can accurately understand your report.
## Security issues & vulnerabilities
If you come across an issue related to security, or a potential attack vector within Payload or one of its dependencies, please DO NOT create a publicly viewable issue. Instead, please contact us directly at [`dev@payloadcms.com`](mailto:dev@payloadcms.com). We will do everything we can to respond to the issue as soon as possible.
If you find a vulnerability within the core Payload repository, and we determine that it is remediable and of significant nature, we will be happy to pay you a reward for your findings and diligence. [`Contact us`](mailto:dev@payloadcms.com) to find out more.
## Documentation edits
Payload documentation can be found directly within its codebase and you can feel free to make changes / improvements to any of it through opening a PR. We utilize these files directly in our website and will periodically deploy documentation updates as necessary.
## Building additional features
If you're an incredibly awesome person and want to help us make Payload even better through new features or additions, we would be thrilled to work with you.
## Design Contributions
When it comes to design-related changes or additions, it's crucial for us to ensure a cohesive user experience and alignment with our broader design vision. Before embarking on any implementation that would affect the design or UI/UX, we ask that you **first share your design proposal** with us for review and approval.
Our design review ensures that proposed changes fit seamlessly with other components, both existing and planned. This step is meant to prevent unintentional design inconsistencies and to save you from investing time in implementing features that might need significant design alterations later.
### Before Starting
To help us work on new features, you can create a new feature request post in [GitHub Discussion](https://github.com/payloadcms/payload/discussions) or discuss it in our [Discord](https://discord.com/invite/payload). New functionality often has large implications across the entire Payload repo, so it is best to discuss the architecture and approach before starting work on a pull request.
### Code
Most new functionality should keep testing in mind. With 1.0, testability of new features has been vastly improved. All top-level directories within the `test/` directory are for testing a specific category: `fields`, `collections`, etc.
If it makes sense to add your feature to an existing test directory, please do so.
A typical directory with `test/` will be structured like this:
```text
.
├── config.ts
├── int.spec.ts
├── e2e.spec.ts
└── payload-types.ts
```
- `config.ts` - This is the _granular_ Payload config for testing. It should be as lightweight as possible. Reference existing configs for an example
- `int.spec.ts` - This is the test file run by jest. Any test file must have a `*int.spec.ts` suffix.
- `e2e.spec.ts` - This is the end-to-end test file that will load up the admin UI using the above config and run Playwright tests. These tests are typically only needed if a large change is being made to the Admin UI.
- `payload-types.ts` - Generated types from `config.ts`. Generate this file by running `pnpm dev:generate-types my-test-dir`.
The directory split up in this way specifically to reduce friction when creating tests and to add the ability to boot up Payload with that specific config.
The following command will start Payload with your config: `pnpm dev my-test-dir`. This command will start up Payload using your config and refresh a test database on every restart.
By default, it will automatically log you in 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`.
If you wish to use to your own Mongo database for the `test` directory instead of using the in memory database, all you need to do is add the following env vars to the `test/dev.ts` file:
- `process.env.NODE_ENV`
- `process.env.PAYLOAD_TEST_MONGO_URL`
- Simply set `process.env.NODE_ENV` to `test` and set `process.env.PAYLOAD_TEST_MONGO_URL` to your mongo url e.g. `mongodb://127.0.0.1/your-test-db`.
NOTE: It is recommended to add the test credentials (located in `test/credentials.ts`) to your autofill for `localhost:3000/admin` as this will be required on every nodemon restart. The default credentials are `dev@payloadcms.com` as E-Mail and `test` as password.
### Commits
We use [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) for our commit messages. Please follow this format when creating commits. Here are some examples:
- `feat: adds new feature`
- `fix: fixes bug`
- `docs: adds documentation`
- `chore: does chore`
Here's a breakdown of the format. At the top-level, we use the following types to categorize our commits:
- `feat`: new feature that adds functionality. These are automatically added to the changelog when creating new releases.
- `fix`: a fix to an existing feature. These are automatically added to the changelog when creating new releases.
- `docs`: changes to [docs](./docs) only. These do not appear in the changelog.
- `chore`: changes to code that is neither a fix nor a feature (e.g. refactoring, adding tests, etc.). These do not appear in the changelog.
If you are committing to [templates](./templates) or [examples](./examples), use the `chore` type with the proper scope, like this:
- `chore(templates): adds feature to template`
- `chore(examples): fixes bug in example`
## Pull Requests
For all Pull Requests, you should be extremely descriptive about both your problem and proposed solution. If there are any affected open or closed issues, please leave the issue number in your PR message.

View File

@@ -6,9 +6,10 @@ To report an issue, please follow the steps below:
2. Add necessary collections/globals/fields to the `test/_community` directory to recreate the issue you are experiencing
3. Create an issue and add a link to your forked repo
**The goal is to isolate the problem by reducing the number of fields/collections you add to the test/_community folder. This folder is not meant for you to copy your project into, but to recreate the issue you are experiencing with minimal config.**
**The goal is to isolate the problem by reducing the number of fields/collections you add to the test/\_community folder. This folder is not meant for you to copy your project into, but to recreate the issue you are experiencing with minimal config.**
## Test directory file tree explanation
```text
.
├── config.ts
@@ -20,45 +21,49 @@ To report an issue, please follow the steps below:
- `config.ts` - This is the _granular_ Payload config for testing. It should be as lightweight as possible. Reference existing configs for an example
- `int.spec.ts` [Optional] - This is the test file run by jest. Any test file must have a `*int.spec.ts` suffix.
- `e2e.spec.ts` [Optional] - This is the end-to-end test file that will load up the admin UI using the above config and run Playwright tests.
- `payload-types.ts` - Generated types from `config.ts`. Generate this file by running `yarn dev:generate-types _community`.
- `payload-types.ts` - Generated types from `config.ts`. Generate this file by running `pnpm dev:generate-types _community`.
The directory split up in this way specifically to reduce friction when creating tests and to add the ability to boot up Payload with that specific config. You should modify the files in `test/_community` to get started.
## How to start test collection admin UI
To start the admin panel so you can manually recreate your issue, you can run the following command:
```bash
# This command will start up Payload using your config
# NOTE: it will wipe the test database on restart
yarn dev _community
```
```bash
# This command will start up Payload using your config
# NOTE: it will wipe the test database on restart
pnpm dev _community
```
## Testing is optional but encouraged
An issue does not need to have failing tests — reproduction steps with your forked repo are enough at this point. Some people like to dive deeper and we want to give you the guidance/tools to do so. Read more below.
### How to run integration tests (Payload API tests)
There are a couple ways to do this:
- **Granularly** - you can run individual tests in vscode by installing the Jest Runner plugin and using that to run individual tests. Clicking the `debug` button will run the test in debug mode allowing you to set break points.
<img src="https://raw.githubusercontent.com/payloadcms/payload/master/src/admin/assets/images/github/int-debug.png" />
<img src="https://raw.githubusercontent.com/payloadcms/payload/main/src/admin/assets/images/github/int-debug.png" />
- **Manually** - you can run all int tests in the `/test/_community/int.spec.ts` file by running the following command:
```bash
yarn test:int _community
pnpm test:int _community
```
### How to run E2E tests (Admin Panel UI tests)
The easiest way to run E2E tests is to install
- [Playwright Test for VSCode](https://marketplace.visualstudio.com/items?itemName=ms-playwright.playwright)
- [Playwright Runner](https://marketplace.visualstudio.com/items?itemName=ortoni.ortoni)
Once they are installed you can open the `testing` tab in vscode sidebar and drill down to the test you want to run, i.e. `/test/_community/e2e.spec.ts`
<img src="https://raw.githubusercontent.com/payloadcms/payload/master/src/admin/assets/images/github/e2e-debug.png" />
<img src="https://raw.githubusercontent.com/payloadcms/payload/main/src/admin/assets/images/github/e2e-debug.png" />
#### Notes
- It is recommended to add the test credentials (located in `test/credentials.ts`) to your autofill for `localhost:3000/admin` as this will be required on every nodemon restart. The default credentials are `dev@payloadcms.com` as email and `test` as password.

129
README.md
View File

@@ -1,38 +1,14 @@
<p style="border: none; margin-bottom:0; padding-bottom: 0;" align="center">
<a href="https://payloadcms.com">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/payloadcms/payload/master/src/admin/assets/images/payload-logo-light.svg">
<img width="350" alt="payload cms logo" src="https://raw.githubusercontent.com/payloadcms/payload/master/src/admin/assets/images/payload-logo-dark.svg">
</picture>
</a>
</p>
<h3 align="center">The most powerful TypeScript CMS</h3>
<p align="center">Code-first Headless CMS that bridges the gap between CMS and application framework</p>
<h3 align="center">
<a target="_blank" href="https://payloadcms.com/docs/getting-started/what-is-payload" rel="dofollow"><strong>Explore the docs</strong></a>
·
<a target="_blank" href="https://demo.payloadcms.com/" rel="dofollow"><strong>Try Live Demo</strong></a>
<br />
</h3>
<a href="https://payloadcms.com">
<img width="100%" src="https://github.com/payloadcms/payload/blob/main/packages/payload/src/admin/assets/images/github-banner-alt.jpg?raw=true" alt="Payload headless CMS Admin panel built with React" />
</a>
<br />
<p align="center">
<a href="https://opensource.org/licenses/MIT">
<img src="https://img.shields.io/badge/License-MIT-blue.svg?style=flat-square" />
</a>
&nbsp;
<br />
<p align="left">
<a href="https://github.com/payloadcms/payload/actions">
<img alt="GitHub Workflow Status" src="https://img.shields.io/github/actions/workflow/status/payloadcms/payload/tests.yml?style=flat-square">
<img alt="GitHub Workflow Status" src="https://img.shields.io/github/actions/workflow/status/payloadcms/payload/main.yml?style=flat-square">
</a>
&nbsp;
<a href="https://github.com/payloadcms/payload/commits">
<img src="https://img.shields.io/github/commit-activity/m/payloadcms/payload?style=flat-square" alt="git commit activity"/>
</a>
&nbsp;
<a href="https://discord.com/invite/r6sCXqVk3v">
<a href="https://discord.gg/payload">
<img alt="Discord" src="https://img.shields.io/discord/967097582721572934?label=Discord&color=7289da&style=flat-square" />
</a>
&nbsp;
@@ -41,28 +17,60 @@
</a>
&nbsp;
<a href="https://twitter.com/payloadcms">
<img src="https://img.shields.io/badge/follow-payloadcms-1DA1F2?logo=twitter&style=flat-square" alt="Payload CMS Twitter" />
<img src="https://img.shields.io/badge/follow-payloadcms-1DA1F2?logo=twitter&style=flat-square" alt="Payload Twitter" />
</a>
</p>
<hr/>
<h4>
<a target="_blank" href="https://payloadcms.com/docs/getting-started/what-is-payload" rel="dofollow"><strong>Explore the Docs</strong></a>&nbsp;·&nbsp;<a target="_blank" href="https://payloadcms.com/community-help" rel="dofollow"><strong>Community Help</strong></a>&nbsp;·&nbsp;<a target="_blank" href="https://demo.payloadcms.com/" rel="dofollow"><strong>Try Live Demo</strong></a>&nbsp;·&nbsp;<a target="_blank" href="https://github.com/payloadcms/payload/discussions/1539" rel="dofollow"><strong>Roadmap</strong></a>&nbsp;·&nbsp;<a target="_blank" href="https://www.g2.com/products/payload-cms/reviews#reviews" rel="dofollow"><strong>View G2 Reviews</strong></a>
</h4>
<hr/>
<br />
### 🎉 Payload 2.0 is now available! Read more in the [announcement post](https://payloadcms.com/blog/payload-2-0).
<a href="https://payloadcms.com">
<img src="https://cms.payloadcms.com/media/payload-github-header.jpg" alt="Payload headless CMS Admin panel built with React" />
</a>
<h3>Benefits over a regular CMS</h3>
<ul>
<li>Dont hit some third-party SaaS API, hit your own API</li>
<li>Use your own database and own your data</li>
<li>It's just Express - do what you want outside of Payload</li>
<li>No need to learn how Payload works - if you know JS, you know Payload</li>
<li>No vendor lock-in</li>
<li>Avoid microservices hell - get everything (even auth) in one place</li>
<li>Never touch ancient WP code again</li>
<li>Build faster, never hit a roadblock</li>
<li>Both admin and backend are 100% extensible</li>
</ul>
<br />
## ☁️ Deploy instantly with Payload Cloud.
## ⭐ Why Payload?
Create a cloud account, connect your GitHub, and [deploy in minutes](https://payloadcms.com/new).
Payload is a CMS that has been designed for developers from the ground up to deliver them what they need to build great digital products. If you know JavaScript, you know Payload. It's a _code-first_ CMS, which allows us to do a lot of things right:
## 🚀 Get started by self-hosting completely free, forever.
- Payload gives you everything you need, but then steps back and lets you build what you want in JavaScript or TypeScript - with no unnecessary complexity brought by GUIs. You'll understand how your CMS works because you will have written it exactly how you want it.
- Bring your own Express server and do whatever you need on top of Payload. Payload doesn't impose anything on you or your app.
- Completely control the Admin panel by using your own React components. Swap out fields or even entire views with ease.
- Use your data however and wherever you need thanks to auto-generated, yet fully extensible REST, GraphQL, and Local Node APIs.
Before beginning to work with Payload, make sure you have all of the [required software](https://payloadcms.com/docs/getting-started/installation).
<a target="_blank" href="https://payloadcms.com/" rel="dofollow"><strong>Read more on our website</strong></a>
```text
npx create-payload-app
```
Alternatively, it only takes about five minutes to [create an app from scratch](https://payloadcms.com/docs/getting-started/installation#from-scratch).
## 🖱️ One-click templates
Jumpstart your next project by starting with a pre-made template. These are production-ready, end-to-end solutions designed to get you to market as fast as possible.
### [🛒 E-Commerce](https://github.com/payloadcms/payload/tree/main/templates/ecommerce)
Eliminate the need to combine Shopify and a CMS, and instead do it all with Payload + Stripe. Comes with a beautiful, fully functional front-end complete with shopping cart, checkout, orders, and much more.
### [🌐 Website](https://github.com/payloadcms/payload/tree/main/templates/website)
Build any kind of website, blog, or portfolio from small to enterprise. Comes with a beautiful, fully functional front-end complete with posts, projects, comments, and much more.
We're constantly adding more templates to our [Templates Directory](https://github.com/payloadcms/payload/tree/main/templates). If you maintain your own template, consider adding the `payload-template` topic to your GitHub repository for others to find.
- [Official Templates](https://github.com/payloadcms/payload/tree/main/templates)
- [Community Templates](https://github.com/topics/payload-template)
## ✨ Features
@@ -85,33 +93,40 @@ Payload is a CMS that has been designed for developers from the ground up to del
- Highly secure thanks to HTTP-only cookies, CSRF protection, and more
<a target="_blank" href="https://github.com/payloadcms/payload/discussions"><strong>Request Feature</strong></a>
## 🚀 Quick Start
Before beginning to work with Payload, make sure you have all of the [required software](https://payloadcms.com/docs/getting-started/installation).
From there, the easiest way to get started with Payload is to use the `create-payload-app` package:
```text
npx create-payload-app
```
Alternatively, it only takes about five minutes to [create an app from scratch](https://payloadcms.com/docs/getting-started/installation#from-scratch).
## 🗒️ Documentation
Check out the [Payload website](https://payloadcms.com/docs/getting-started/what-is-payload) to find in-depth documentation for everything that Payload offers.
Migrating from v1 to v2? Check out the [2.0 Release Notes](https://github.com/payloadcms/payload/releases/tag/v2.0.0) on how to do it.
## 🙋 Contributing
If you want to add contributions to this repository, please follow the instructions in [contributing.md](./contributing.md).
If you want to add contributions to this repository, please follow the instructions in [contributing.md](./CONTRIBUTING.md).
## 📚 Examples
The [Examples Directory](./examples) is a great resource for learning how to setup Payload in a variety of different ways, but you can also find great examples in our blog and throughout our social media.
- [Examples Directory](./examples)
- [Payload Blog](https://payloadcms.com/blog)
- [Payload YouTube](https://www.youtube.com/@payloadcms)
## 🔌 Plugins
Payload is highly extensible and allows you to install or distribute plugins that add or remove functionality. There are both officially-supported and community-supported plugins available. If you maintain your own plugin, consider adding the `payload-plugin` topic to your GitHub repository for others to find.
- [Official Plugins](https://github.com/orgs/payloadcms/repositories?q=topic%3Apayload-plugin)
- [Community Plugins](https://github.com/topics/payload-plugin)
## 🚨 Need help?
There are lots of good conversations and resources in our Github Discussions board & our Discord Server. If you're struggling with something, chances are, someone's already solved what you're up against. :point_down:
There are lots of good conversations and resources in our Github Discussions board and our Discord Server. If you're struggling with something, chances are, someone's already solved what you're up against. :point_down:
- [GitHub Discussions](https://github.com/payloadcms/payload/discussions)
- [GitHub Issues](https://github.com/payloadcms/payload/issues)
- [Discord](https://t.co/30APlsQUPB)
- [Community Help](https://payloadcms.com/community-help)
## ⭐ Like what we're doing? Give us a star

1
auth.d.ts vendored
View File

@@ -1 +0,0 @@
export * from './dist/auth';

View File

@@ -1 +0,0 @@
module.exports = require('./dist/auth');

2
bin.js
View File

@@ -1,2 +0,0 @@
#!/usr/bin/env node
require('./dist/bin');

View File

@@ -1,5 +0,0 @@
exports.Button = require('../dist/admin/components/elements/Button').default;
exports.Card = require('../dist/admin/components/elements/Card').default;
exports.Eyebrow = require('../dist/admin/components/elements/Eyebrow').default;
exports.Nav = require('../dist/admin/components/elements/Nav').default;
exports.Gutter = require('../dist/admin/components/elements/Gutter').Gutter;

View File

@@ -1,5 +0,0 @@
export { default as Button } from '../dist/admin/components/elements/Button';
export { default as Card } from '../dist/admin/components/elements/Card';
export { default as Eyebrow } from '../dist/admin/components/elements/Eyebrow';
export { default as Nav } from '../dist/admin/components/elements/Nav';
export { Gutter } from '../dist/admin/components/elements/Gutter';

View File

@@ -1 +0,0 @@
export type { Props } from '../../dist/admin/components/forms/field-types/Array/types';

View File

@@ -1 +0,0 @@
export type { Props } from '../../dist/admin/components/forms/field-types/Blocks/types';

View File

@@ -1 +0,0 @@
export type { Props } from '../../dist/admin/components/views/collections/List/Cell/types';

View File

@@ -1 +0,0 @@
export type { Props } from '../../dist/admin/components/forms/field-types/Checkbox/types';

View File

@@ -1 +0,0 @@
export type { Props } from '../../dist/admin/components/forms/field-types/Code/types';

View File

@@ -1 +0,0 @@
export type { Props } from '../../dist/admin/components/forms/field-types/DateTime/types';

View File

@@ -1 +0,0 @@
export type { Props } from '../../dist/admin/components/forms/field-types/Email/types';

View File

@@ -1 +0,0 @@
export type { Props } from '../../dist/admin/components/forms/field-types/Group/types';

View File

@@ -1 +0,0 @@
export type { Props } from '../../dist/admin/components/forms/field-types/JSON/types';

View File

@@ -1 +0,0 @@
export type { Props } from '../../dist/admin/components/forms/field-types/Number/types';

View File

@@ -1 +0,0 @@
export type { Props } from '../../dist/admin/components/forms/field-types/Password/types';

View File

@@ -1 +0,0 @@
export type { Props } from '../../../dist/admin/components/forms/field-types/RadioGroup/RadioInput/types';

View File

@@ -1 +0,0 @@
export type { Props } from '../../../dist/admin/components/forms/field-types/RadioGroup/types';

View File

@@ -1 +0,0 @@
export type { Props, Option, ValueWithRelation } from '../../dist/admin/components/forms/field-types/Relationship/types';

View File

@@ -1 +0,0 @@
export type { Props } from '../../dist/admin/components/forms/field-types/RichText/types';

View File

@@ -1 +0,0 @@
export type { Props } from '../../dist/admin/components/forms/field-types/Row/types';

View File

@@ -1 +0,0 @@
export type { Props } from '../../dist/admin/components/forms/field-types/Select/types';

View File

@@ -1 +0,0 @@
export type { Props } from '../../dist/admin/components/forms/field-types/Text/types';

View File

@@ -1 +0,0 @@
export type { Props } from '../../dist/admin/components/forms/field-types/Textarea/types';

View File

@@ -1 +0,0 @@
export type { Props } from '../../dist/admin/components/forms/field-types/Upload/types';

View File

@@ -1,42 +0,0 @@
exports.useForm = require('../dist/admin/components/forms/Form/context').useForm;
/**
* @deprecated useWatchForm is no longer preferred. If you need all form fields, prefer `useAllFormFields`.
*/
exports.useWatchForm = require('../dist/admin/components/forms/Form/context').useWatchForm;
exports.useFormFields = require('../dist/admin/components/forms/Form/context').useFormFields;
exports.useAllFormFields = require('../dist/admin/components/forms/Form/context').useAllFormFields;
exports.useFormSubmitted = require('../dist/admin/components/forms/Form/context').useFormSubmitted;
exports.useFormProcessing = require('../dist/admin/components/forms/Form/context').useFormProcessing;
exports.useFormModified = require('../dist/admin/components/forms/Form/context').useFormModified;
exports.useField = require('../dist/admin/components/forms/useField').default;
/**
* @deprecated This method is now called useField. The useFieldType alias will be removed in an upcoming version.
*/
exports.useFieldType = require('../dist/admin/components/forms/useField').default;
exports.Form = require('../dist/admin/components/forms/Form').default;
exports.Text = require('../dist/admin/components/forms/field-types/Text').default;
exports.TextInput = require('../dist/admin/components/forms/field-types/Text/Input').default;
exports.Group = require('../dist/admin/components/forms/field-types/Group').default;
exports.Select = require('../dist/admin/components/forms/field-types/Select').default;
exports.SelectInput = require('../dist/admin/components/forms/field-types/Select/Input').default;
exports.Checkbox = require('../dist/admin/components/forms/field-types/Checkbox').default;
exports.Submit = require('../dist/admin/components/forms/Submit').default;
exports.Label = require('../dist/admin/components/forms/Label').default;
exports.reduceFieldsToValues = require('../dist/admin/components/forms/Form/reduceFieldsToValues').default;
exports.getSiblingData = require('../dist/admin/components/forms/Form/getSiblingData').default;
exports.withCondition = require('../dist/admin/components/forms/withCondition').default;

View File

@@ -1,38 +0,0 @@
export {
useForm,
/**
* @deprecated useWatchForm is no longer preferred. If you need all form fields, prefer `useAllFormFields`.
*/
useWatchForm,
useFormFields,
useAllFormFields,
useFormSubmitted,
useFormProcessing,
useFormModified,
} from '../dist/admin/components/forms/Form/context';
export { default as useField } from '../dist/admin/components/forms/useField';
/**
* @deprecated This method is now called useField. The useFieldType alias will be removed in an upcoming version.
*/
export { default as useFieldType } from '../dist/admin/components/forms/useField';
export { default as Form } from '../dist/admin/components/forms/Form';
export { default as Text } from '../dist/admin/components/forms/field-types/Text';
export { default as TextInput } from '../dist/admin/components/forms/field-types/Text/Input';
export { default as Group } from '../dist/admin/components/forms/field-types/Group';
export { default as Select } from '../dist/admin/components/forms/field-types/Select';
export { default as SelectInput } from '../dist/admin/components/forms/field-types/Select/Input';
export { default as Checkbox } from '../dist/admin/components/forms/field-types/Checkbox';
export { default as Submit } from '../dist/admin/components/forms/Submit';
export { default as Label } from '../dist/admin/components/forms/Label';
export { default as reduceFieldsToValues } from '../dist/admin/components/forms/Form/reduceFieldsToValues';
export { default as getSiblingData } from '../dist/admin/components/forms/Form/getSiblingData';
export { default as withCondition } from '../dist/admin/components/forms/withCondition';

View File

@@ -1 +0,0 @@
exports.useStepNav = require('../dist/admin/components/elements/StepNav').useStepNav;

View File

@@ -1 +0,0 @@
export { useStepNav } from '../dist/admin/components/elements/StepNav';

View File

@@ -1,2 +0,0 @@
exports.Chevron = require('../dist/admin/components/icons/Chevron').default;
exports.X = require('../dist/admin/components/icons/X').default;

View File

@@ -1,2 +0,0 @@
export { default as Chevron } from '../dist/admin/components/icons/Chevron';
export { default as X } from '../dist/admin/components/icons/X';

View File

@@ -1 +0,0 @@
export * from '../dist/admin/components';

View File

@@ -1 +0,0 @@
exports.usePreferences = require('../dist/admin/components/utilities/Preferences').usePreferences;

View File

@@ -1 +0,0 @@
export { usePreferences } from '../dist/admin/components/utilities/Preferences';

View File

@@ -1,3 +0,0 @@
exports.LeafButton = require('../dist/admin/components/forms/field-types/RichText/leaves/Button').default;
exports.ElementButton = require('../dist/admin/components/forms/field-types/RichText/elements/Button').default;
exports.toggleElement = require('../dist/admin/components/forms/field-types/RichText/elements/toggle').default;

View File

@@ -1,3 +0,0 @@
export { default as LeafButton } from '../dist/admin/components/forms/field-types/RichText/leaves/Button';
export { default as ElementButton } from '../dist/admin/components/forms/field-types/RichText/elements/Button';
export { default as toggleElement } from '../dist/admin/components/forms/field-types/RichText/elements/toggle';

View File

@@ -1,2 +0,0 @@
exports.DefaultTemplate = require('../dist/admin/components/templates/Default').default;
exports.MinimalTemplate = require('../dist/admin/components/templates/Minimal').default;

View File

@@ -1,2 +0,0 @@
export { default as DefaultTemplate } from '../dist/admin/components/templates/Default';
export { default as MinimalTemplate } from '../dist/admin/components/templates/Minimal';

View File

@@ -1,7 +0,0 @@
exports.Meta = require('../dist/admin/components/utilities/Meta').default;
exports.useLocale = require('../dist/admin/components/utilities/Locale').useLocale;
exports.useDocumentInfo = require('../dist/admin/components/utilities/DocumentInfo').useDocumentInfo;
exports.useConfig = require('../dist/admin/components/utilities/Config').useConfig;
exports.useAuth = require('../dist/admin/components/utilities/Auth').useAuth;
exports.useEditDepth = require('../dist/admin/components/utilities/EditDepth').useEditDepth;
exports.useTheme = require('../dist/admin/components/utilities/Theme').useTheme;

View File

@@ -1,6 +0,0 @@
export { default as Meta } from '../dist/admin/components/utilities/Meta';
export { useLocale } from '../dist/admin/components/utilities/Locale';
export { useDocumentInfo } from '../dist/admin/components/utilities/DocumentInfo';
export { useConfig } from '../dist/admin/components/utilities/Config';
export { useAuth } from '../dist/admin/components/utilities/Auth';
export { useEditDepth } from '../dist/admin/components/utilities/EditDepth';

View File

@@ -1 +0,0 @@
exports.Cell = require('../../dist/admin/components/views/collections/List/Cell').default;

View File

@@ -1,2 +0,0 @@
export { default as Cell } from '../../dist/admin/components/views/collections/List/Cell';
export type { Props } from '../../dist/admin/components/views/collections/List/Cell/types';

View File

@@ -1 +0,0 @@
exports.Dashboard = required('../../dist/admin/components/views/Dashboard/Default').default;

View File

@@ -1,3 +0,0 @@
export { default as Dashboard } from '../../dist/admin/components/views/Dashboard/Default';
export type { Props } from '../../dist/admin/components/views/Dashboard/types';

View File

@@ -1 +0,0 @@
exports.Edit = require('../../dist/admin/components/views/collections/Edit/Default').default;

View File

@@ -1,2 +0,0 @@
export { default as Edit } from '../../dist/admin/components/views/collections/Edit/Default';
export type { Props } from '../../dist/admin/components/views/collections/Edit/types';

View File

@@ -1 +0,0 @@
exports.List = require('../../dist/admin/components/views/collections/List/Default').default;

View File

@@ -1,2 +0,0 @@
export { default as List } from '../../dist/admin/components/views/collections/List/Default';
export type { Props } from '../../dist/admin/components/views/collections/Edit/types';

2
config.d.ts vendored
View File

@@ -1,2 +0,0 @@
export { buildConfig } from './dist/config/build';
export * from './dist/config/types';

View File

@@ -1 +0,0 @@
exports.buildConfig = require('./dist/config/build').buildConfig;

View File

@@ -1,56 +0,0 @@
# Contributing to Payload CMS
Below you'll find a set of guidelines for how to contribute to Payload CMS.
## Opening issues
Before you submit an issue, please check all existing [open and closed issues](https://github.com/payloadcms/payload/issues) to see if your issue has previously been resolved or is already known. If there is already an issue logged, feel free to upvote it by adding a :thumbsup: [reaction](https://github.com/blog/2119-add-reactions-to-pull-requests-issues-and-comments). If you would like to submit a new issue, please fill out our Issue Template to the best of your ability so we can accurately understand your report.
## Security issues & vulnerabilities
If you come across an issue related to security, or a potential attack vector within Payload or one of its dependencies, please DO NOT create a publicly viewable issue. Instead, please contact us directly at [`dev@payloadcms.com`](mailto:dev@payloadcms.com). We will do everything we can to respond to the issue as soon as possible.
If you find a vulnerability within the core Payload repository, and we determine that it is remediable and of significant nature, we will be happy to pay you a reward for your findings and diligence. [`Contact us`](mailto:dev@payloadcms.com) to find out more.
## Documentation edits
Payload documentation can be found directly within its codebase and you can feel free to make changes / improvements to any of it through opening a PR. We utilize these files directly in our website and will periodically deploy documentation updates as necessary.
## Building additional features
If you're an incredibly awesome person and want to help us make Payload even better through new features or additions, we would be thrilled to work with you.
### Before Starting
To help us work on new features, you can create a new feature request post in [GitHub Discussion](https://github.com/payloadcms/payload/discussions) or discuss it in our [Discord](https://discord.com/invite/r6sCXqVk3v). New functionality often has large implications across the entire Payload repo, so it is best to discuss the architecture and approach before starting work on a pull request.
### Code
Most new functionality should keep testing in mind. With 1.0, testability of new features has been vastly improved. All top-level directories within the `test/` directory are for testing a specific category: `fields`, `collections`, etc.
If it makes sense to add your feature to an existing test directory, please do so.
A typical directory with `test/` will be structured like this:
```text
.
├── config.ts
├── int.spec.ts
├── e2e.spec.ts
└── payload-types.ts
```
- `config.ts` - This is the _granular_ Payload config for testing. It should be as lightweight as possible. Reference existing configs for an example
- `int.spec.ts` - This is the test file run by jest. Any test file must have a `*int.spec.ts` suffix.
- `e2e.spec.ts` - This is the end-to-end test file that will load up the admin UI using the above config and run Playwright tests. These tests are typically only needed if a large change is being made to the Admin UI.
- `payload-types.ts` - Generated types from `config.ts`. Generate this file by running `yarn dev:generate-types my-test-dir`.
The directory split up in this way specifically to reduce friction when creating tests and to add the ability to boot up Payload with that specific config.
The following command will start Payload with your config: `yarn dev my-test-dir`. This command will start up Payload using your config and refresh a test database on every restart.
NOTE: It is recommended to add the test credentials (located in `test/credentials.ts`) to your autofill for `localhost:3000/admin` as this will be required on every nodemon restart. The default credentials are `dev@payloadcms.com` as E-Mail and `test` as password.
## Pull Requests
For all Pull Requests, you should be extremely descriptive about both your problem and proposed solution. If there are any affected open or closed issues, please leave the issue number in your PR message.

View File

@@ -10,27 +10,28 @@ You can define Collection-level Access Control within each Collection's `access`
## Available Controls
| Function | Allows/Denies Access |
| ------------------------ | -------------------- |
| **[`create`](#create)** | Used in the `create` operation |
| **[`read`](#read)** | Used in the `find` and `findByID` operations |
| **[`update`](#update)** | Used in the `update` operation |
| **[`delete`](#delete)** | Used in the `delete` operation |
| Function | Allows/Denies Access |
| ----------------------- | -------------------------------------------- |
| **[`create`](#create)** | Used in the `create` operation |
| **[`read`](#read)** | Used in the `find` and `findByID` operations |
| **[`update`](#update)** | Used in the `update` operation |
| **[`delete`](#delete)** | Used in the `delete` operation |
#### Auth-enabled Controls
If a Collection supports [`Authentication`](/docs/authentication/overview), the following Access Controls become available:
| Function | Allows/Denies Access |
| ----------------------- | -------------------- |
| **[`admin`](#admin)** | Used to restrict access to the Payload Admin panel |
| Function | Allows/Denies Access |
| ----------------------- | -------------------------------------------------------------- |
| **[`admin`](#admin)** | Used to restrict access to the Payload Admin panel |
| **[`unlock`](#unlock)** | Used to restrict which users can access the `unlock` operation |
**Example Collection config:**
```ts
import { CollectionConfig } from 'payload/types';
const Posts: CollectionConfig = {
export const Posts: CollectionConfig = {
slug: "posts",
// highlight-start
access: {
@@ -42,8 +43,6 @@ const Posts: CollectionConfig = {
},
// highlight-end
};
export default Posts;
```
### Create
@@ -52,10 +51,10 @@ Returns a boolean which allows/denies access to the `create` request.
**Available argument properties:**
| Option | Description |
| ---------- | ----------- |
| Option | Description |
| ---------- | -------------------------------------------------------------------------- |
| **`req`** | The Express `request` object containing the currently authenticated `user` |
| **`data`** | The data passed to create the document with. |
| **`data`** | The data passed to create the document with. |
**Example:**
@@ -79,20 +78,20 @@ Read access functions can return a boolean result or optionally return a [query
**Available argument properties:**
| Option | Description |
| --------- | ----------- |
| Option | Description |
| --------- | -------------------------------------------------------------------------- |
| **`req`** | The Express `request` object containing the currently authenticated `user` |
| **`id`** | `id` of document requested, if within `findByID` |
| **`id`** | `id` of document requested, if within `findByID` |
**Example:**
```ts
import { Access } from 'payload/config';
import { Access } from 'payload/config'
const canReadPage: Access = ({ req: { user } }) => {
// allow authenticated users
if (user) {
return true;
return true
}
// using a query constraint, guest users can access when a field named 'isPublic' is set to true
return {
@@ -101,7 +100,7 @@ const canReadPage: Access = ({ req: { user } }) => {
equals: true,
},
}
};
}
```
### Update
@@ -110,25 +109,25 @@ Update access functions can return a boolean result or optionally return a [quer
**Available argument properties:**
| Option | Description |
| ---------- | ----------- |
| Option | Description |
| ---------- | -------------------------------------------------------------------------- |
| **`req`** | The Express `request` object containing the currently authenticated `user` |
| **`id`** | `id` of document requested to update |
| **`data`** | The data passed to update the document with |
| **`id`** | `id` of document requested to update |
| **`data`** | The data passed to update the document with |
**Example:**
```ts
import { Access } from 'payload/config';
import { Access } from 'payload/config'
const canUpdateUser: Access = ({ req: { user }, id }) => {
// allow users with a role of 'admin'
if (user.roles && user.roles.some(role => role === 'admin')) {
return true;
if (user.roles && user.roles.some((role) => role === 'admin')) {
return true
}
// allow any other users to update only oneself
return user.id === id;
};
return user.id === id
}
```
### Delete
@@ -137,10 +136,10 @@ Similarly to the Update function, returns a boolean or a [query constraint](/doc
**Available argument properties:**
| Option | Description |
| --------- | ----------- |
| Option | Description |
| --------- | --------------------------------------------------------------------------------------------------- |
| **`req`** | The Express `request` object with additional `user` property, which is the currently logged in user |
| **`id`** | `id` of document requested to delete |
| **`id`** | `id` of document requested to delete |
**Example:**
@@ -150,7 +149,7 @@ import { Access } from 'payload/config'
const canDeleteCustomer: Access = async ({ req, id }) => {
if (!id) {
// allow the admin UI to show controls to delete since it is indeterminate without the id
return true;
return true
}
// query another collection using the id
const result = await req.payload.find({
@@ -160,10 +159,10 @@ const canDeleteCustomer: Access = async ({ req, id }) => {
where: {
customer: { equals: id },
},
});
})
return result.totalDocs === 0;
};
return result.totalDocs === 0
}
```
### Admin
@@ -172,8 +171,8 @@ If the Collection is [used to access the Payload Admin panel](/docs/admin/overvi
**Available argument properties:**
| Option | Description |
| --------- | ----------- |
| Option | Description |
| --------- | -------------------------------------------------------------------------- |
| **`req`** | The Express `request` object containing the currently authenticated `user` |
### Unlock
@@ -182,6 +181,6 @@ Determines which users can [unlock](/docs/authentication/operations#unlock) othe
**Available argument properties:**
| Option | Description |
| --------- | ----------- |
| Option | Description |
| --------- | -------------------------------------------------------------------------- |
| **`req`** | The Express `request` object containing the currently authenticated `user` |

View File

@@ -10,17 +10,18 @@ Field Access Control is specified with functions inside a field's config. All fi
## Available Controls
| Function | Purpose |
| ------------------------ | ------- |
| **[`create`](#create)** | Allows or denies the ability to set a field's value when creating a new document |
| **[`read`](#read)** | Allows or denies the ability to read a field's value |
| **[`update`](#update)** | Allows or denies the ability to update a field's value |
| Function | Purpose |
| ----------------------- | -------------------------------------------------------------------------------- |
| **[`create`](#create)** | Allows or denies the ability to set a field's value when creating a new document |
| **[`read`](#read)** | Allows or denies the ability to read a field's value |
| **[`update`](#update)** | Allows or denies the ability to update a field's value |
**Example Collection config:**
```ts
import { CollectionConfig } from 'payload/types';
const Posts: CollectionConfig = {
export const Posts: CollectionConfig = {
slug: 'posts',
fields: [
{
@@ -44,11 +45,11 @@ Returns a boolean which allows or denies the ability to set a field's value when
**Available argument properties:**
| Option | Description |
| ----------------- | ----------- |
| Option | Description |
| ----------------- | -------------------------------------------------------------------------- |
| **`req`** | The Express `request` object containing the currently authenticated `user` |
| **`data`** | The full data passed to create the document. |
| **`siblingData`** | Immediately adjacent field data passed to create the document. |
| **`data`** | The full data passed to create the document. |
| **`siblingData`** | Immediately adjacent field data passed to create the document. |
### Read
@@ -56,23 +57,25 @@ Returns a boolean which allows or denies the ability to read a field's value. If
**Available argument properties:**
| Option | Description |
| ----------------- | ----------- |
| Option | Description |
| ----------------- | -------------------------------------------------------------------------- |
| **`req`** | The Express `request` object containing the currently authenticated `user` |
| **`id`** | `id` of the document being read |
| **`doc`** | The full document data. |
| **`siblingData`** | Immediately adjacent field data of the document being read. |
| **`id`** | `id` of the document being read |
| **`doc`** | The full document data. |
| **`siblingData`** | Immediately adjacent field data of the document being read. |
### Update
Returns a boolean which allows or denies the ability to update a field's value. If `false` is returned, any passed values will be discarded.
If `false` is returned and you attempt to update the field's value, the operation will **not** throw an error however the field will be omitted from the update operation and the value will remain unchanged.
**Available argument properties:**
| Option | Description |
| ----------------- | ----------- |
| Option | Description |
| ----------------- | -------------------------------------------------------------------------- |
| **`req`** | The Express `request` object containing the currently authenticated `user` |
| **`id`** | `id` of the document being updated |
| **`data`** | The full data passed to update the document. |
| **`siblingData`** | Immediately adjacent field data passed to update the document with. |
| **`doc`** | The full document data, before the update is applied. |
| **`id`** | `id` of the document being updated |
| **`data`** | The full data passed to update the document. |
| **`siblingData`** | Immediately adjacent field data passed to update the document with. |
| **`doc`** | The full document data, before the update is applied. |

View File

@@ -8,30 +8,35 @@ keywords: globals, access control, permissions, documentation, Content Managemen
You can define Global-level Access Control within each Global's `access` property. All Access Control functions accept one `args` argument.
**Available argument properties:
\*\*Available argument properties:
## Available Controls
| Function | Allows/Denies Access |
| ------------------------ | -------------------- |
| **[`read`](#read)** | Used in the `findOne` Global operation |
| **[`update`](#update)** | Used in the `update` Global operation |
| Function | Allows/Denies Access |
| ----------------------- | -------------------------------------- |
| **[`read`](#read)** | Used in the `findOne` Global operation |
| **[`update`](#update)** | Used in the `update` Global operation |
**Example Global config:**
```ts
import { GlobalConfig } from 'payload/types';
import { GlobalConfig } from 'payload/types'
const Header: GlobalConfig = {
slug: "header",
slug: 'header',
// highlight-start
access: {
read: ({ req: { user } }) => { /* */ },
update: ({ req: { user } }) => { /* */ },
read: ({ req: { user } }) => {
/* */
},
update: ({ req: { user } }) => {
/* */
},
},
// highlight-end
};
}
export default Header;
export default Header
```
### Read
@@ -40,8 +45,8 @@ Returns a boolean result or optionally a [query constraint](/docs/queries/overvi
**Available argument properties:**
| Option | Description |
| --------- | ----------- |
| Option | Description |
| --------- | -------------------------------------------------------------------------- |
| **`req`** | The Express `request` object containing the currently authenticated `user` |
### Update
@@ -50,7 +55,7 @@ Returns a boolean result or optionally a [query constraint](/docs/queries/overvi
**Available argument properties:**
| Option | Description |
| ---------- | ----------- |
| Option | Description |
| ---------- | -------------------------------------------------------------------------- |
| **`req`** | The Express `request` object containing the currently authenticated `user` |
| **`data`** | The data passed to update the global with. |
| **`data`** | The data passed to update the global with. |

View File

@@ -8,10 +8,7 @@ keywords: overview, access control, permissions, documentation, Content Manageme
Access control within Payload is extremely powerful while remaining easy and intuitive to manage. Declaring who should have access to what documents is no more complex than writing a simple JavaScript function that either returns a `boolean` or a [`query`](/docs/queries/overview) constraint to restrict which documents users can interact with.
<YouTube
id="DoPLyXG26Dg"
title="Overview of Payload Access Control"
/>
<YouTube id="DoPLyXG26Dg" title="Overview of Payload Access Control" />
**Example use cases:**
@@ -32,13 +29,18 @@ Access control within Payload is extremely powerful while remaining easy and int
const defaultPayloadAccess = ({ req: { user } }) => {
// Return `true` if a user is found
// and `false` if it is undefined or null
return Boolean(user);
return Boolean(user)
}
```
<Banner type="success">
<strong>Note:</strong><br/>
In the Local API, all Access Control functions are skipped by default, allowing your server to do whatever it needs. But, you can opt back in by setting the option <strong>overrideAccess</strong> to <strong>true</strong>.
<strong>Note:</strong>
<br />
In the Local API, all Access Control functions are skipped by default, allowing your server to do
whatever it needs. But, you can opt back in by setting the option <strong>
overrideAccess
</strong>{' '}
to <strong>false</strong>.
</Banner>
### Access Control Types
@@ -49,12 +51,13 @@ You can manage access within Payload on three different levels:
- [Fields](/docs/access-control/fields)
- [Globals](/docs/access-control/globals)
### When Access Control is Executed
<Banner type="success">
<strong>Note:</strong><br/>
Access control functions are utilized in two places. It's important to understand how and when your access control is executed.
<strong>Note:</strong>
<br />
Access control functions are utilized in two places. It's important to understand how and when
your access control is executed.
</Banner>
#### As you execute operations
@@ -70,8 +73,11 @@ To accomplish this, Payload ships with an `Access` operation, which is executed
### Argument Availability
<Banner type="warning">
<strong>Important:</strong><br/>
When your access control functions are executed via the <strong>access</strong> operation, the <strong>id</strong> and <strong>data</strong> arguments will be <strong>undefined</strong>, because Payload is executing your functions without referencing a specific document.
<strong>Important:</strong>
<br />
When your access control functions are executed via the <strong>access</strong> operation, the{' '}
<strong>id</strong> and <strong>data</strong> arguments will be <strong>undefined</strong>,
because Payload is executing your functions without referencing a specific document.
</Banner>
If you use `id` or `data` within your access control functions, make sure to check that they are defined first. If they are not, then you can assume that your access control is being executed via the `access` operation, to determine solely what the user can do within the Admin UI.

54
docs/admin/bundlers.mdx Normal file
View File

@@ -0,0 +1,54 @@
---
title: Bundlers
label: Bundlers
order: 60
desc: Bundlers are used to bundle the code that serves Payload's Admin Panel.
---
Payload has two official bundlers, the [Webpack Bundler](/docs/admin/webpack) and the [Vite Bundler](/docs/admin/vite). You must install a bundler to use the admin panel.
##### Install a bundler
Webpack (recommended):
```text
yarn add @payloadcms/bundler-webpack
```
Vite (beta):
```text
yarn add @payloadcms/bundler-vite
```
##### Configure the bundler
```ts
// payload.config.ts
import { buildConfig } from 'payload/config'
import { webpackBundler } from '@payloadcms/bundler-webpack'
// import { viteBundler } from '@payloadcms/bundler-vite'
export default buildConfig({
// highlight-start
admin: {
bundler: webpackBundler() // or viteBundler()
},
// highlight-end
})
```
### What are bundlers?
At their core, a bundler's main goal is to take a bunch of files and turn them into a few optimized files that you ship to the browser. The admin UI has a root `index.html` entry point, and from there the bundler traverses the dependency tree, bundling all of the files that are required from that point on.
Since the bundled file is sent to the browser, it can't include any server-only code. You will need to remove any server-only code from your admin UI before bundling it. You can learn more about [excluding server code](/docs/admin/excluding-server-code) section.
<Banner type="warning">
<strong>Using environment variables in the admin UI</strong>
<br />
Bundles should not contain sensitive information. By default, Payload
excludes env variables from the bundle. If you need to use env variables in your payload config,
you need to prefix them with `PAYLOAD_PUBLIC_` to make them available to the client-side code.
</Banner>

View File

@@ -6,44 +6,43 @@ desc: Fully customize your Admin Panel by swapping in your own React components.
keywords: admin, components, custom, documentation, Content Management System, cms, headless, javascript, node, react, express
---
While designing the Payload Admin panel, we determined it should be as minimal and straightforward as possible to allow easy customization and control. There are many times where you may want to completely control how a whole view or a field works. You might even want to add in your own routes entirely. In order for Payload to support that level of customization without introducing versioning / future-proofing issues, Payload provides for a pattern to supply your own React components via your Payload config.
While designing the Payload Admin panel, we determined it should be as minimal and straightforward as possible to allow easy customization and control. There are many times where you may want to completely control how a whole view or a field works. You might even want to add in new views entirely. In order for Payload to support this level of customization without introducing versioning / future-proofing issues, Payload provides for a pattern to supply your own React components via your Payload config.
To swap in your own React component, first, consult the list of available component overrides below. Determine the scope that corresponds to what you are trying to accomplish, and then author your React component accordingly.
<Banner type="success">
<strong>Tip:</strong>
<br />
Custom components will automatically be provided with all props that the
default component would accept.
Custom components will automatically be provided with all props that the default component normally
accepts.
</Banner>
### Base Component Overrides
You can override a set of admin panel-wide components by providing a component to your base Payload config's `admin.components` property. The following options are available:
| Path | Description |
| ---------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **`Nav`** | Contains the sidebar and mobile Nav in its entirety. |
| **`logout.Button`** | A custom React component.
| **`BeforeDashboard`** | Array of components to inject into the built-in Dashboard, _before_ the default dashboard contents. |
| **`AfterDashboard`** | Array of components to inject into the built-in Dashboard, _after_ the default dashboard contents. [Demo](https://github.com/payloadcms/payload/tree/master/test/admin/components/AfterDashboard/index.tsx) |
| **`BeforeLogin`** | Array of components to inject into the built-in Login, _before_ the default login form. |
| **`AfterLogin`** | Array of components to inject into the built-in Login, _after_ the default login form. |
| **`BeforeNavLinks`** | Array of components to inject into the built-in Nav, _before_ the links themselves. |
| **`AfterNavLinks`** | Array of components to inject into the built-in Nav, _after_ the links. |
| **`views.Account`** | The Account view is used to show the currently logged in user's Account page. |
| **`views.Dashboard`** | The main landing page of the Admin panel. |
| **`graphics.Icon`** | Used as a graphic within the `Nav` component. Often represents a condensed version of a full logo. |
| **`graphics.Logo`** | The full logo to be used in contexts like the `Login` view. |
| **`routes`** | Define your own routes to add to the Payload Admin UI. [More](#custom-routes) |
| **`providers`** | Define your own provider components that will wrap the Payload Admin UI. [More](#custom-providers) |
| Path | Description |
| --------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **`Nav`** | Contains the sidebar / mobile menu in its entirety. |
| **`BeforeNavLinks`** | Array of components to inject into the built-in Nav, _before_ the links themselves. |
| **`AfterNavLinks`** | Array of components to inject into the built-in Nav, _after_ the links. |
| **`BeforeDashboard`** | Array of components to inject into the built-in Dashboard, _before_ the default dashboard contents. |
| **`AfterDashboard`** | Array of components to inject into the built-in Dashboard, _after_ the default dashboard contents. [Demo](https://github.com/payloadcms/payload/tree/main/test/admin/components/AfterDashboard/index.tsx) |
| **`BeforeLogin`** | Array of components to inject into the built-in Login, _before_ the default login form. |
| **`AfterLogin`** | Array of components to inject into the built-in Login, _after_ the default login form. |
| **`logout.Button`** | A custom React component. |
| **`graphics.Icon`** | Used as a graphic within the `Nav` component. Often represents a condensed version of a full logo. |
| **`graphics.Logo`** | The full logo to be used in contexts like the `Login` view. |
| **`providers`** | Define your own provider components that will wrap the Payload Admin UI. [More](#custom-providers) |
| **`views`** | Override or create new views within the Payload Admin UI. [More](#views) |
#### Full example:
Here is a full example showing how to swap some of these components for your own.
`payload.config.js`
```ts
import { buildConfig } from "payload/config";
import { buildConfig } from 'payload/config'
import {
MyCustomNav,
MyCustomLogo,
@@ -51,7 +50,7 @@ import {
MyCustomAccount,
MyCustomDashboard,
MyProvider,
} from "./customComponents";
} from './customComponents'
export default buildConfig({
admin: {
@@ -68,27 +67,344 @@ export default buildConfig({
providers: [MyProvider],
},
},
});
})
```
#### Views
You can easily swap entire views with your own by using the `admin.components.views` property. At the root level, Payload renders the following views dy default, all of which can be overridden:
| Property | Description |
| ------------------ | ---------------------------------------------------------------------------------------------------------------------------- |
| **`Account`** | The Account view is used to show the currently logged in user's Account page. |
| **`Dashboard`** | The main landing page of the Admin panel. |
To swap out any of these views, simply pass in your custom component to the `admin.components.views` property of your Payload config. For example:
```ts
// payload.config.ts
{
// ...
admin: {
components: {
views: {
Account: MyCustomAccountView,
Dashboard: MyCustomDashboardView,
},
},
},
}
```
For more granular control, pass a configuration object instead. Payload exposes all of the properties of `<Route />` component in [React Router v5](https://v5.reactrouter.com):
| Property | Description |
| ------------------ | ---------------------------------------------------------------------------------------------------------------------------- |
| **`Component`** \* | Pass in the component that should be rendered when a user navigates to this route. |
| **`path`** \* | React Router `path`. [See the React Router docs](https://v5.reactrouter.com/web/api/Route/path-string-string) for more info. |
| **`exact`** | React Router `exact` property. [More](https://v5.reactrouter.com/web/api/Route/exact-bool) |
| **`strict`** | React Router `strict` property. [More](https://v5.reactrouter.com/web/api/Route/strict-bool) |
| **`sensitive`** | React Router `sensitive` property. [More](https://v5.reactrouter.com/web/api/Route/sensitive-bool) |
_\* An asterisk denotes that a property is required._
#### Adding new views
To add a _new_ view to the Admin Panel, simply add another key to the `views` object with at least a `path` and `Component` property. For example:
```ts
// payload.config.ts
{
// ...
admin: {
components: {
views: {
MyCustomView: {
Component: MyCustomView,
path: '/my-custom-view',
},
},
},
},
}
```
_For more examples regarding how to customize components, look at the following [examples](https://github.com/payloadcms/payload/tree/master/test/admin/components)._
For help on how to build your own custom view components, see [building a custom view component](#building-a-custom-view-component).
### Collections
You can override components on a Collection-by-Collection basis via each Collection's `admin` property.
You can override components on a collection-by-collection basis via their `admin` property.
| Path | Description |
| ---------------- | ------------------------------------------------------------------------------------------------ |
| **`views.Edit`** | Used while a document within this Collection is being edited. |
| **`views.List`** | The `List` view is used to render a paginated, filterable table of Documents in this Collection. |
| Path | Description |
| -------------------------- | ---------------------------------------------------------------------------------------------------------------------- |
| **`BeforeList`** | Array of components to inject _before_ the built-in List view |
| **`BeforeListTable`** | Array of components to inject _before_ the built-in List view's table |
| **`AfterList`** | Array of components to inject _after_ the built-in List view |
| **`AfterListTable`** | Array of components to inject _after_ the built-in List view's table |
| **`edit.SaveButton`** | Replace the default `Save` button with a custom component. Drafts must be disabled |
| **`edit.SaveDraftButton`** | Replace the default `Save Draft` button with a custom component. Drafts must be enabled and autosave must be disabled. |
| **`edit.PublishButton`** | Replace the default `Publish` button with a custom component. Drafts must be enabled. |
| **`edit.PreviewButton`** | Replace the default `Preview` button with a custom component. |
| **`views`** | Override or create new views within the Payload Admin UI. [More](#collection-views) |
Here is a full example showing how to swap some of these components for your own:
`Collection.ts`
```tsx
import * as React from 'react'
import {
CustomSaveButtonProps,
CustomSaveDraftButtonProps,
CustomPublishButtonProps,
CustomPreviewButtonProps,
} from 'payload/types'
export const CustomSaveButton: CustomSaveButtonProps = ({ DefaultButton, label }) => {
return <DefaultButton label={label} />
}
export const CustomSaveDraftButton: CustomSaveDraftButtonProps = ({
DefaultButton,
disabled,
label,
saveDraft,
}) => {
return <DefaultButton label={label} disabled={disabled} saveDraft={saveDraft} />
}
export const CustomPublishButton: CustomPublishButtonProps = ({
DefaultButton,
disabled,
label,
publish,
}) => {
return <DefaultButton label={label} disabled={disabled} publish={publish} />
}
export const CustomPreviewButton: CustomPreviewButtonProps = ({
DefaultButton,
disabled,
label,
preview,
}) => {
return <DefaultButton label={label} disabled={disabled} preview={preview} />
}
export const MyCollection: SanitizedCollectionConfig = {
slug: 'my-collection',
admin: {
components: {
edit: {
SaveButton: CustomSaveButton,
SaveDraftButton: CustomSaveDraftButton,
PublishButton: CustomPublishButton,
PreviewButton: CustomPreviewButton,
},
},
}
}
```
#### Collection views
To swap out entire views on collections, you can use the `admin.components.views` property on the collection's config. Payload renders the following views dy default, all of which can be overridden:
| Property | Description |
| ------------------ | ---------------------------------------------------------------------------------------------------------------------------- |
| **`Edit`** | The Edit view is used to edit a single document for a given collection. |
| **`List`** | The List view is used to show a list of documents for a given collection. |
To swap out any of these views, simply pass in your custom component to the `admin.components.views` property of your Payload config. This will replace the entire view, including the page breadcrumbs, title, tabs, etc, _as well as all nested routes_.
```ts
// Collection.ts
{
// ...
admin: {
components: {
views: {
Edit: MyCustomEditView,
List: MyCustomListView,
},
},
},
}
```
_For help on how to build your own custom view components, see [building a custom view component](#building-a-custom-view-component)._
To swap specific _nested_ views within the parent `Edit` view, you can use the `admin.components.views.Edit` property on the globals's config. This will only replace the nested view, leaving the page breadcrumbs, title, tabs, etc intact.
```ts
// Collection.ts
{
// ...
admin: {
components: {
views: {
Edit: {
Default: MyCustomDefaultTab,
},
},
},
},
}
```
You can also add _new_ tabs to the `Edit` view by adding another key to the `components.views.Edit[key]` object with a `path` and `Component` property. See [Custom Tabs](#custom-tabs) for more information.
### Globals
As with Collections, You can override components on a global-by-global basis via their `admin` property.
As with Collections, you can override components on a global-by-global basis via their `admin` property.
| Path | Description |
| ---------------- | --------------------------------------- |
| **`views.Edit`** | Used while this Global is being edited. |
| Path | Description |
| -------------------------- | ---------------------------------------------------------------------------------------------------------------------- |
| **`edit.SaveButton`** | Replace the default `Save` button with a custom component. Drafts must be disabled |
| **`edit.SaveDraftButton`** | Replace the default `Save Draft` button with a custom component. Drafts must be enabled and autosave must be disabled. |
| **`edit.PublishButton`** | Replace the default `Publish` button with a custom component. Drafts must be enabled. |
| **`edit.PreviewButton`** | Replace the default `Preview` button with a custom component. |
| **`views`** | Override or create new views within the Payload Admin UI. [More](#global-views) |
#### Global views
To swap out views for globals, you can use the `admin.components.views` property on the global's config. Payload renders the following views dy default, all of which can be overridden:
| Property | Description |
| ------------------ | ---------------------------------------------------------------------------------------------------------------------------- |
| **`Edit`** | The Edit view is used to edit a single document for a given Global. |
To swap out any of these views, simply pass in your custom component to the `admin.components.views` property of your Payload config. This will replace the entire view, including the page breadcrumbs, title, and tabs, _as well as all nested views_.
```ts
// Global.ts
{
// ...
admin: {
components: {
views: {
Edit: MyCustomEditView,
},
},
},
}
```
_For help on how to build your own custom view components, see [building a custom view component](#building-a-custom-view-component)._
To swap specific _nested_ views within the parent `Edit` view, you can use the `admin.components.views.Edit` property on the globals's config. This will only replace the nested view, leaving the page breadcrumbs, title, and tabs intact.
```ts
// Global.ts
{
// ...
admin: {
components: {
views: {
Edit: {
Default: MyCustomDefaultTab,
},
},
},
},
}
```
You can also add _new_ tabs to the `Edit` view by adding another key to the `components.views.Edit[key]` object with a `path` and `Component` property. See [Custom Tabs](#custom-tabs) for more information.
### Custom Tabs
You can easily swap individual collection or global edit views. To do this, pass an _object_ to the `admin.components.views.Edit` property of the config. Payload renders the following views dy default, all of which can be overridden:
| Property | Description |
| ------------------ | ---------------------------------------------------------------------------------------------------------------------------- |
| **`Default`** | The Default view is the primary view in which your document is edited. |
| **`Versions`** | The Versions view is used to view the version history of a single document. [More details](../versions) |
| **`Version`** | The Version view is used to view a single version of a single document for a given collection. [More details](../versions). |
| **`API`** | The API view is used to display the REST API JSON response for a given document. |
| **`LivePreview`** | The LivePreview view is used to display the Live Preview interface. [More details](../live-preview) |
Here is an example:
```ts
// Collection.ts or Global.ts
export const MyCollection: SanitizedCollectionConfig = {
slug: 'my-collection',
admin: {
components: {
views: {
Edit: { // You can also define `components.views.Edit` as a component, this will override _all_ nested views
Default: MyCustomDefaultTab,
Versions: MyCustomVersionsTab,
Version: MyCustomVersionTab,
API: MyCustomAPITab,
LivePreview: MyCustomLivePreviewTab,
},
},
},
},
}
```
To add a _new_ tab to the `Edit` view, simply add another key to `components.views.Edit[key]` with at least a `path` and `Component` property. For example:
```ts
// `Collection.ts` or `Global.ts`
export const MyCollection: SanitizedCollectionConfig = {
slug: 'my-collection',
admin: {
components: {
views: {
Edit: {
MyCustomTab: {
Component: MyCustomTab,
path: '/my-custom-tab',
// You an swap the entire tab component out for your own
Tab: MyCustomTab
},
AnotherCustomView: {
Component: AnotherCustomView,
path: '/another-custom-view',
// Or you can use the default tab component and just pass in your own label and href
Tab: {
label: 'Another Custom View',
href: '/another-custom-view',
}
},
},
},
},
},
}
```
### Building a custom view component
Your custom view components will be given all the props that a React Router `<Route />` typically would receive, as well as two props from Payload:
| Prop | Description |
| ----------------------- | ---------------------------------------------------------------------------- |
| **`user`** | The currently logged in user. Will be `null` if no user is logged in. |
| **`canAccessAdmin`** \* | If the currently logged in user is allowed to access the admin panel or not. |
<Banner type="warning">
<strong>Note:</strong>
<br />
It's up to you to secure your custom views. If your view requires a user to be logged in or to
have certain access rights, you should handle that within your view component yourself.
</Banner>
#### Example
You can find examples of custom views in the [Payload source code `/test/admin/components/views` folder](https://github.com/payloadcms/payload/tree/master/test/admin/components/views). There, you'll find two custom views:
1. A custom view that uses the `DefaultTemplate`, which is the built-in Payload template that displays the sidebar and "eyebrow nav"
1. A custom view that uses the `MinimalTemplate` - which is just a centered template used for things like logging in or out
To see how to pass in your custom views to create custom views of your own, take a look at the `admin.components.views` property of the [Payload test admin config](https://github.com/payloadcms/payload/blob/master/test/admin/config.ts).
### Fields
@@ -97,10 +413,9 @@ All Payload fields support the ability to swap in your own React components. So,
<Banner type="success">
<strong>Tip:</strong>
<br />
Don't see a built-in field type that you need? Build it! Using a combination
of custom validation and custom components, you can override the entirety of
how a component functions within the admin panel and effectively create your
own field type.
Don't see a built-in field type that you need? Build it! Using a combination of custom validation
and custom components, you can override the entirety of how a component functions within the admin
panel and effectively create your own field type.
</Banner>
**Fields support the following custom components:**
@@ -126,15 +441,15 @@ These are the props that will be passed to your custom Cell to use in your own c
#### Example
```tsx
import React from "react";
import "./index.scss";
const baseClass = "custom-cell";
import React from 'react'
import './index.scss'
const baseClass = 'custom-cell'
const CustomCell: React.FC<Props> = (props) => {
const { field, colIndex, collection, cellData, rowData } = props;
const { field, colIndex, collection, cellData, rowData } = props
return <span className={baseClass}>{cellData}</span>;
};
return <span className={baseClass}>{cellData}</span>
}
```
## Field Component
@@ -146,75 +461,31 @@ When writing your own custom components you can make use of a number of hooks to
When swapping out the `Field` component, you'll be responsible for sending and receiving the field's `value` from the form itself. To do so, import the `useField` hook as follows:
```tsx
import { useField } from "payload/components/forms";
import { useField } from 'payload/components/forms'
type Props = { path: string };
type Props = { path: string }
const CustomTextField: React.FC<Props> = ({ path }) => {
// highlight-start
const { value, setValue } = useField<Props>({ path });
const { value, setValue } = useField<Props>({ path })
// highlight-end
return (
<input onChange={(e) => setValue(e.target.value)} value={value.path} />
);
};
return <input onChange={(e) => setValue(e.target.value)} value={value.path} />
}
```
<Banner type="success">
For more information regarding the hooks that are available to you while you
build custom components, including the <strong>useField</strong> hook, <a href="/docs/admin/hooks" style={{ color: "black" }}>click here</a>.
For more information regarding the hooks that are available to you while you build custom
components, including the <strong>useField</strong> hook, [click here](/docs/admin/hooks).
</Banner>
## Custom routes
You can easily add your own custom routes to the Payload Admin panel using the `admin.components.routes` property. Payload currently uses the extremely powerful React Router v5.x and custom routes support all the properties of the React Router `<Route />` component.
**Custom routes support the following properties:**
| Property | Description |
| ------------------ | ---------------------------------------------------------------------------------------------------------------------------- |
| **`Component`** \* | Pass in the component that should be rendered when a user navigates to this route. |
| **`path`** \* | React Router `path`. [See the React Router docs](https://v5.reactrouter.com/web/api/Route/path-string-string) for more info. |
| **`exact`** | React Router `exact` property. [More](https://v5.reactrouter.com/web/api/Route/exact-bool) |
| **`strict`** | React Router `strict` property. [More](https://v5.reactrouter.com/web/api/Route/strict-bool) |
| **`sensitive`** | React Router `sensitive` property. [More](https://v5.reactrouter.com/web/api/Route/sensitive-bool) |
_\* An asterisk denotes that a property is required._
#### Custom route components
Your custom route components will be given all the props that a React Router `<Route />` typically would receive, as well as two props from Payload:
| Prop | Description |
| ----------------------- | ---------------------------------------------------------------------------- |
| **`user`** | The currently logged in user. Will be `null` if no user is logged in. |
| **`canAccessAdmin`** \* | If the currently logged in user is allowed to access the admin panel or not. |
<Banner type="warning">
<strong>Note:</strong>
<br />
It's up to you to secure your custom routes. If your route requires a user to
be logged in or to have certain access rights, you should handle that within
your route component yourself.
</Banner>
#### Example
You can find examples of custom route views in the [Payload source code `/test/admin/components/views` folder](https://github.com/payloadcms/payload/tree/master/test/admin/components/views). There, you'll find two custom routes:
1. A custom view that uses the `DefaultTemplate`, which is the built-in Payload template that displays the sidebar and "eyebrow nav"
1. A custom view that uses the `MinimalTemplate` - which is just a centered template used for things like logging in or out
To see how to pass in your custom views to create custom routes of your own, take a look at the `admin.components.routes` property of the [Payload test admin config](https://github.com/payloadcms/payload/blob/master/test/admin/config.ts).
## Custom providers
As your admin customizations gets more complex you may want to share state between fields or other components. You can add custom providers to do add your own context to any Payload app for use in other custom components within the admin panel. Within your config add `admin.components.providers`, these can be used to share context or provide other custom functionality. Read the [React context](https://reactjs.org/docs/context.html) docs to learn more.
<Banner type="warning">
<strong>Reminder:</strong> Don't forget to pass the **children** prop through
the provider component for the admin UI to show
<strong>Reminder:</strong> Don't forget to pass the **children** prop through the provider
component for the admin UI to show
</Banner>
### Styling Custom Components
@@ -232,41 +503,42 @@ To make use of Payload SCSS variables / mixins to use directly in your own compo
When developing custom components you can support multiple languages to be consistent with Payload's i18n support. The best way to do this is to add your translation resources to the [i18n configuration](https://payloadcms.com/docs/configuration/i18n) and import `useTranslation` from `react-i18next` in your components.
For example:
```tsx
import { useTranslation } from 'react-i18next';
import { useTranslation } from 'react-i18next'
const CustomComponent: React.FC = () => {
// highlight-start
const { t, i18n } = useTranslation('namespace1');
const { t, i18n } = useTranslation('namespace1')
// highlight-end
return (
<ul>
<li>{ t('key', { variable: 'value' }) }</li>
<li>{ t('namespace2:key', { variable: 'value' }) }</li>
<li>{ i18n.language }</li>
<li>{t('key', { variable: 'value' })}</li>
<li>{t('namespace2:key', { variable: 'value' })}</li>
<li>{i18n.language}</li>
</ul>
);
};
)
}
```
### Getting the current locale
In any custom component you can get the selected locale with the `useLocale` hook. Here is a simple example:
In any custom component you can get the selected locale with `useLocale` hook. `useLocale` returns the full locale object, consisting of a `label`, `rtl`(right-to-left) property, and then `code`. Here is a simple example:
```tsx
import { useLocale } from "payload/components/utilities";
import { useLocale } from 'payload/components/utilities'
const Greeting: React.FC = () => {
// highlight-start
const locale = useLocale();
const locale = useLocale()
// highlight-end
const trans = {
en: "Hello",
es: "Hola",
};
en: 'Hello',
es: 'Hola',
}
return <span> {trans[locale]} </span>;
};
return <span> {trans[locale.code]} </span>
}
```

View File

@@ -13,15 +13,16 @@ You can add your own CSS by providing your base Payload config with a path to yo
To do so, provide your base Payload config with a path to your own stylesheet. It can be either a CSS or SCSS file.
**Example in payload.config.js:**
```ts
import { buildConfig } from 'payload/config';
import path from 'path';
import { buildConfig } from 'payload/config'
import path from 'path'
const config = buildConfig({
admin: {
css: path.resolve(__dirname, 'relative/path/to/stylesheet.scss'),
},
});
admin: {
css: path.resolve(__dirname, 'relative/path/to/stylesheet.scss'),
},
})
```
### Overriding built-in styles
@@ -30,7 +31,7 @@ To make it as easy as possible for you to override our styles, Payload uses [BEM
In addition to adding your own style definitions, you can also override Payload's built-in CSS variables. We use as much as possible behind the scenes, and you can override any of them that you'd like to.
You can find the built-in Payload CSS variables within [`./src/admin/scss/app.scss`](https://github.com/payloadcms/payload/blob/master/src/admin/scss/app.scss) and [`./src/admin/scss/colors.scss`](https://github.com/payloadcms/payload/blob/master/src/admin/scss/colors.scss). The following variables are defined and can be overridden:
You can find the built-in Payload CSS variables within [`./src/admin/scss/app.scss`](https://github.com/payloadcms/payload/blob/main/packages/payload/src/admin/scss/app.scss) and [`./src/admin/scss/colors.scss`](https://github.com/payloadcms/payload/blob/main/packages/payload/src/admin/scss/colors.scss). The following variables are defined and can be overridden:
- Breakpoints
- Base color shades (white to black by default)
@@ -43,7 +44,8 @@ You can find the built-in Payload CSS variables within [`./src/admin/scss/app.sc
#### Dark mode
<Banner type="warning">
If you're overriding colors or theme elevations, make sure to consider how your changes will affect dark mode.
If you're overriding colors or theme elevations, make sure to consider how your changes will
affect dark mode.
</Banner>
By default, Payload automatically overrides all `--theme-elevation`s and inverts all success / warning / error shades to suit dark mode. We also update some base theme variables like `--theme-bg`, `--theme-text`, etc.

View File

@@ -0,0 +1,27 @@
---
title: Environment Variables in Admin UI
label: Environment Variables
order: 100
desc: NEEDS TO BE WRITTEN
---
## Admin environment vars
<Banner type="warning">
<strong>Important:</strong>
<br />
Be careful about what variables you provide to your client-side code. Analyze every single one to
make sure that you're not accidentally leaking anything that an attacker could exploit. Only keys
that are safe for anyone to read in plain text should be provided to your Admin panel.
</Banner>
By default, `env` variables are **not** provided to the Admin panel for security and safety reasons.
But, Payload provides you with a way to still provide `env` vars to your frontend code.
**Payload will automatically supply any present `env` variables that are prefixed with `PAYLOAD_PUBLIC_` directly to the Admin panel.**
For example, if you've got the following environment variable:
`PAYLOAD_PUBLIC_STRIPE_PUBLISHABLE_KEY=pk_test_XXXXXXXXXXXXXXXXXX`
This key will automatically be made available to the Payload bundle and can be referenced in your Admin component code as `process.env.PAYLOAD_PUBLIC_STRIPE_PUBLISHABLE_KEY`.

View File

@@ -0,0 +1,131 @@
---
title: Excluding server-only code from admin UI
label: Excluding server code
order: 70
desc: Learn how to exclude server-only code from the Payload Admin UI bundle
---
Because the Admin Panel browser bundle includes your Payload Config file, files using server-only modules need to be excluded.
It's common for your config to rely on server only modules to perform logic in access control functions, hooks, and other contexts.
Any file that imports a server-only module such as `fs`, `stripe`, `authorizenet`, `nodemailer`, etc. **cannot** be included in the browser bundle.
#### Example Scenario
Say we have a collection called `Subscriptions` that has a `beforeChange` hook that creates a Stripe subscription whenever a Subscription document is created in Payload.
**Collection config**:
```ts
// collections/Subscriptions/index.ts
import { CollectionConfig } from 'payload/types'
import createStripeSubscription from './hooks/createStripeSubscription'
export const Subscription: CollectionConfig = {
slug: 'subscriptions',
hooks: {
beforeChange: [createStripeSubscription],
},
fields: [
{
name: 'stripeSubscriptionID',
type: 'text',
required: true,
},
],
}
```
**Collection hook**:
```ts
// collections/Subscriptions/hooks/createStripeSubscription.ts
// highlight-start
import Stripe from 'stripe' // <-- server-only module
// highlight-end
const stripe = new Stripe(process.env.STRIPE_SECRET_KEY)
export const createStripeSubscription = async ({ data, operation }) => {
if (operation === 'create') {
const dataWithStripeID = { ...data }
// use Stripe to create a Stripe subscription
const subscription = await stripe.subscriptions.create({
// Configure the subscription accordingly
})
// Automatically add the Stripe subscription ID
// to the data that will be saved to this Subscription doc
dataWithStripeID.stripeSubscriptionID = subscription.id
return dataWithStripeID
}
return data
}
```
<Banner type="error">
<strong>Warning:</strong>
<br />
The above code is NOT production-ready and should not be referenced to create Stripe
subscriptions. Although creating a beforeChange hook is a completely valid spot to do things like
create subscriptions, the code above is incomplete and insecure, meant for explanation purposes
only.
</Banner>
**As-is, this collection will prevent your Admin panel from bundling or loading correctly, because Stripe relies on some Node-only packages.**
#### How to fix this
You need to make sure that you use `alias`es to tell your bundler to import "safe" files vs. attempting to import any server-side code that you need to get rid of. Depending on your bundler (Webpack, Vite, etc.) the steps involved may be slightly different.
The basic idea is to create a file that exports an empty object, and then alias import paths of any files that import server-only modules to that empty object file.
This way when your bundler goes to import a file that contains server-only modules, it will instead import the empty object file, which will not break the browser bundle.
### Aliasing server-only modules
To remove files that contain server-only modules from your bundle, you can use an `alias`.
First create new file that exports an empty object:
```js
// mocks/emptyObject.js
export default {}
```
Then, in your Payload config, you can alias the file containing the server-only module to the mock module. For example, here's how you'd do this in Webpack:
```ts
// payload.config.ts
import { buildConfig } from 'payload/config'
import { webpackBundler } from '@payloadcms/bundler-webpack'
const mockModulePath = path.resolve(__dirname, 'mocks/emptyObject.js')
const pathToFileWithServerOnlyModule = path.resolve(__dirname, 'hooks/syncStripeCustomer.ts')
export default buildConfig({
admin: {
bundler: webpackBundler(),
webpack: (config) => {
return {
...config,
resolve: {
...config.resolve,
// highlight-start
alias: {
...config.resolve.alias,
[pathToFileWithServerOnlyModule]: mockModulePath,
},
// highlight-end
},
}
},
},
})
```

View File

@@ -24,7 +24,7 @@ const CustomTextField: React.FC<Props> = ({ path }) => {
const { value, setValue } = useField<string>({ path })
// highlight-end
return <input onChange={e => setValue(e.target.value)} value={value.path} />
return <input onChange={(e) => setValue(e.target.value)} value={value.path} />
}
```
@@ -57,7 +57,8 @@ const {
There are times when a custom field component needs to have access to data from other fields, and you have a few options to do so. The `useFormFields` hook is a powerful and highly performant way to retrieve a form's field state, as well as to retrieve the `dispatchFields` method, which can be helpful for setting other fields' form states from anywhere within a form.
<Banner type="success">
<strong>This hook is great for retrieving only certain fields from form state</strong> because it ensures that it will only cause a rerender when the items that you ask for change.
<strong>This hook is great for retrieving only certain fields from form state</strong> because it
ensures that it will only cause a rerender when the items that you ask for change.
</Banner>
Thanks to the awesome package [`use-context-selector`](https://github.com/dai-shi/use-context-selector), you can retrieve a specific field's state easily. This is ideal because you can ensure you have an up-to-date field state, and your component will only re-render when _that field's state_ changes.
@@ -65,21 +66,19 @@ Thanks to the awesome package [`use-context-selector`](https://github.com/dai-sh
You can pass a Redux-like selector into the hook, which will ensure that you retrieve only the field that you want. The selector takes an argument with type of `[fields: Fields, dispatch: React.Dispatch<Action>]]`.
```tsx
import { useFormFields } from 'payload/components/forms';
import { useFormFields } from 'payload/components/forms'
const MyComponent: React.FC = () => {
// Get only the `amount` field state, and only cause a rerender when that field changes
const amount = useFormFields(([fields, dispatch]) => fields.amount);
const amount = useFormFields(([fields, dispatch]) => fields.amount)
// Do the same thing as above, but to the `feePercentage` field
const feePercentage = useFormFields(([fields, dispatch]) => fields.feePercentage);
const feePercentage = useFormFields(([fields, dispatch]) => fields.feePercentage)
if (typeof amount?.value !== 'undefined' && typeof feePercentage?.value !== 'undefined') {
return (
<span>The fee is ${(amount.value * feePercentage.value) / 100}</span>
);
return <span>The fee is ${(amount.value * feePercentage.value) / 100}</span>
}
};
}
```
### useAllFormFields
@@ -117,7 +116,7 @@ If you are building a custom component, then you should use `setValue` which is
You can send the following actions to the `dispatchFields` function.
| Action | Description |
|------------------------|----------------------------------------------------------------------------|
| ---------------------- | -------------------------------------------------------------------------- |
| **`ADD_ROW`** | Adds a row of data (useful in array / block field data) |
| **`DUPLICATE_ROW`** | Duplicates a row of data (useful in array / block field data) |
| **`MODIFY_CONDITION`** | Updates a field's conditional logic result (true / false) |
@@ -127,43 +126,521 @@ You can send the following actions to the `dispatchFields` function.
| **`REPLACE_STATE`** | Completely replaces form state |
| **`UPDATE`** | Update any property of a specific field's state |
To see types for each action supported within the `dispatchFields` hook, check out the Form types [here](https://github.com/payloadcms/payload/blob/master/src/admin/components/forms/Form/types.ts).
To see types for each action supported within the `dispatchFields` hook, check out the Form types [here](https://github.com/payloadcms/payload/blob/main/packages/payload/src/admin/components/forms/Form/types.ts).
### useForm
The `useForm` hook can be used to interact with the form itself, and sends back many methods that can be used to reactively fetch form state without causing rerenders within your components each time a field is changed. This is useful if you have action-based callbacks that your components fire, and need to interact with form state _based on a user action_.
<Banner type="warning">
<strong>Warning:</strong><br/>
This hook is optimized to avoid causing rerenders when fields change, and as such, its `fields` property will be out of date. You should only leverage this hook if you need to perform actions against the form in response to your users' actions. Do not rely on its returned "fields" as being up-to-date. They will be removed from this hook's response in an upcoming version.
<strong>Warning:</strong>
<br />
This hook is optimized to avoid causing rerenders when fields change, and as such, its `fields`
property will be out of date. You should only leverage this hook if you need to perform actions
against the form in response to your users' actions. Do not rely on its returned "fields" as being
up-to-date. They will be removed from this hook's response in an upcoming version.
</Banner>
The `useForm` hook returns an object with the following properties:
The `useForm` hook returns an object with the following properties: |
| Action | Description |
|----------------------|---------------------------------------------------------------------|
| **`fields`** | Deprecated. This property cannot be relied on as up-to-date. |
| **`submit`** | Method to trigger the form to submit |
| **`dispatchFields`** | Dispatch actions to the form field state |
| **`validateForm`** | Trigger a validation of the form state |
| **`createFormData`** | Create a `multipart/form-data` object from the current form's state |
| **`disabled`** | Boolean denoting whether or not the form is disabled |
| **`getFields`** | Gets all fields from state |
| **`getField`** | Gets a single field from state by path |
| **`getData`** | Returns the data stored in the form |
| **`getSiblingData`** | Returns form sibling data for the given field path |
| **`setModified`** | Set the form's `modified` state |
| **`setProcessing`** | Set the form's `processing` state |
| **`setSubmitted`** | Set the form's `submitted` state |
| **`formRef`** | The ref from the form HTML element |
| **`reset`** | Method to reset the form to its initial state |
<TableWithDrawers
columns={[
'Action',
'Description',
'Example',
]}
rows={[
[
{
value: <strong><code>fields</code></strong>,
},
{
value: "Deprecated. This property cannot be relied on as up-to-date.",
},
{
value: ''
}
],
[
{
value: <strong><code>submit</code></strong>,
},
{
value: "Method to trigger the form to submit",
},
{
value: ''
}
],
[
{
value: <strong><code>dispatchFields</code></strong>,
},
{
value: "Dispatch actions to the form field state",
},
{
value: ''
}
],
[
{
value: <strong><code>validateForm</code></strong>,
},
{
value: "Trigger a validation of the form state",
},
{
value: ''
}
],
[
{
value: <strong><code>createFormData</code></strong>,
},
{
value: <>Create a <code>multipart/form-data</code> object from the current form's state</>,
},
{
value: ''
}
],
[
{
value: <strong><code>disabled</code></strong>,
},
{
value: "Boolean denoting whether or not the form is disabled",
},
{
value: ''
}
],
[
{
value: <strong><code>getFields</code></strong>,
},
{
value: 'Gets all fields from state',
},
{
value: '',
}
],
[
{
value: <strong><code>getField</code></strong>,
},
{
value: 'Gets a single field from state by path',
},
{
value: '',
},
],
[
{
value: <strong><code>getData</code></strong>,
},
{
value: 'Returns the data stored in the form',
},
{
value: '',
},
],
[
{
value: <strong><code>getSiblingData</code></strong>,
},
{
value: 'Returns form sibling data for the given field path',
},
{
value: '',
},
],
[
{
value: <strong><code>setModified</code></strong>,
},
{
value: <>Set the form\'s <code>modified</code> state</>,
},
{
value: '',
},
],
[
{
value: <strong><code>setProcessing</code></strong>,
},
{
value: <>Set the form\'s <code>processing</code> state</>,
},
{
value: '',
},
],
[
{
value: <strong><code>setSubmitted</code></strong>,
},
{
value: <>Set the form\'s <code>submitted</code> state</>,
},
{
value: '',
},
],
[
{
value: <strong><code>formRef</code></strong>,
},
{
value: 'The ref from the form HTML element',
},
{
value: '',
},
],
[
{
value: <strong><code>reset</code></strong>,
},
{
value: 'Method to reset the form to its initial state',
},
{
value: '',
},
],
[
{
value: <strong><code>addFieldRow</code></strong>,
},
{
value: "Method to add a row on an array or block field",
},
{
drawerTitle: 'addFieldRow',
drawerDescription: 'A useful method to programtically add a row to an array or block field.',
drawerSlug: 'addFieldRow',
drawerContent: (
<>
<TableWithDrawers
columns={[
'Prop',
'Description',
]}
rows={[
[
{
value: <strong><code>path</code></strong>,
},
{
value: "The path to the array or block field",
},
],
[
{
value: <strong><code>rowIndex</code></strong>,
},
{
value: "The index of the row to add",
},
],
[
{
value: <strong><code>data</code></strong>,
},
{
value: "The data to add to the row",
},
],
]}
/>
{' '}
<br />
{' '}
<pre>
{`import { useForm } from "payload/components/forms";
export const CustomArrayManager = () => {
const { addFieldRow } = useForm()
return (
<button
type="button"
onClick={() => {
addFieldRow({
path: "arrayField",
rowIndex: 0,
data: {
textField: "text",
// blockType: "yourBlockSlug",
// ^ if managing a block array, you need to specify the block type
},
})
}}
>
Add Row
</button>
)
}`}
</pre>
<p>An example config to go along with the custom component</p>
<pre>
{`const ExampleCollection = {
slug: "example-collection",
fields: [
{
name: "arrayField",
type: "array",
fields: [
{
name: "textField",
type: "text",
},
],
},
{
type: "ui",
name: "customArrayManager",
admin: {
components: {
Field: CustomArrayManager,
},
},
},
],
}`}
</pre>
</>
)
}
],
[
{
value: <strong><code>removeFieldRow</code></strong>,
},
{
value: "Method to remove a row from an array or block field",
},
{
drawerTitle: 'removeFieldRow',
drawerDescription: 'A useful method to programtically remove a row from an array or block field.',
drawerSlug: 'removeFieldRow',
drawerContent: (
<>
<TableWithDrawers
columns={[
'Prop',
'Description',
]}
rows={[
[
{
value: <strong><code>path</code></strong>,
},
{
value: "The path to the array or block field",
},
],
[
{
value: <strong><code>rowIndex</code></strong>,
},
{
value: "The index of the row to remove",
},
],
]}
/>
{' '}
<br />
{' '}
<pre>
{`import { useForm } from "payload/components/forms";
export const CustomArrayManager = () => {
const { removeFieldRow } = useForm()
return (
<button
type="button"
onClick={() => {
removeFieldRow({
path: "arrayField",
rowIndex: 0,
})
}}
>
Remove Row
</button>
)
}`}
</pre>
<p>An example config to go along with the custom component</p>
<pre>
{`const ExampleCollection = {
slug: "example-collection",
fields: [
{
name: "arrayField",
type: "array",
fields: [
{
name: "textField",
type: "text",
},
],
},
{
type: "ui",
name: "customArrayManager",
admin: {
components: {
Field: CustomArrayManager,
},
},
},
],
}`}
</pre>
</>
)
}
],
[
{
value: <strong><code>replaceFieldRow</code></strong>,
},
{
value: "Method to replace a row from an array or block field",
},
{
drawerTitle: 'replaceFieldRow',
drawerDescription: 'A useful method to programtically replace a row from an array or block field.',
drawerSlug: 'replaceFieldRow',
drawerContent: (
<>
<TableWithDrawers
columns={[
'Prop',
'Description',
]}
rows={[
[
{
value: <strong><code>path</code></strong>,
},
{
value: "The path to the array or block field",
},
],
[
{
value: <strong><code>rowIndex</code></strong>,
},
{
value: "The index of the row to replace",
},
],
[
{
value: <strong><code>data</code></strong>,
},
{
value: "The data to replace within the row",
},
],
]}
/>
{' '}
<br />
{' '}
<pre>
{`import { useForm } from "payload/components/forms";
export const CustomArrayManager = () => {
const { replaceFieldRow } = useForm()
return (
<button
type="button"
onClick={() => {
replaceFieldRow({
path: "arrayField",
rowIndex: 0,
data: {
textField: "updated text",
// blockType: "yourBlockSlug",
// ^ if managing a block array, you need to specify the block type
},
})
}}
>
Replace Row
</button>
)
}`}
</pre>
<p>An example config to go along with the custom component</p>
<pre>
{`const ExampleCollection = {
slug: "example-collection",
fields: [
{
name: "arrayField",
type: "array",
fields: [
{
name: "textField",
type: "text",
},
],
},
{
type: "ui",
name: "customArrayManager",
admin: {
components: {
Field: CustomArrayManager,
},
},
},
],
}`}
</pre>
</>
)
}
],
]}
/>
### useDocumentInfo
The `useDocumentInfo` hook provides lots of information about the document currently being edited, including the following:
| Property | Description |
|---------------------------|--------------------------------------------------------------------------------------------------------------------| |
|---------------------------|--------------------------------------------------------------------------------------------------------------------|
| **`collection`** | If the doc is a collection, its collection config will be returned |
| **`global`** | If the doc is a global, its global config will be returned |
| **`id`** | If the doc is a collection, its ID will be returned |
@@ -178,47 +655,45 @@ The `useDocumentInfo` hook provides lots of information about the document curre
**Example:**
```tsx
import { useDocumentInfo } from 'payload/components/utilities';
import { useDocumentInfo } from 'payload/components/utilities'
const LinkFromCategoryToPosts: React.FC = () => {
// highlight-start
const { id } = useDocumentInfo();
const { id } = useDocumentInfo()
// highlight-end
// id will be undefined on the create form
if (!id) {
return null;
return null
}
return (
<a href={`/admin/collections/posts?where[or][0][and][0][category][in][0]=[${id}]`} >
<a href={`/admin/collections/posts?where[or][0][and][0][category][in][0]=[${id}]`}>
View posts
</a>
)
};
}
```
### useLocale
In any custom component you can get the selected locale with the `useLocale` hook. Here is a simple example:
In any custom component you can get the selected locale object with the `useLocale` hook. `useLocale`gives you the full locale object, consisting of a `label`, `rtl`(right-to-left) property, and then `code`. Here is a simple example:
```tsx
import { useLocale } from 'payload/components/utilities';
import { useLocale } from 'payload/components/utilities'
const Greeting: React.FC = () => {
// highlight-start
const locale = useLocale();
const locale = useLocale()
// highlight-end
const trans = {
en: 'Hello',
es: 'Hola',
};
}
return (
<span> { trans[locale] } </span>
);
};
return <span> {trans[locale.code]} </span>
}
```
### useAuth
@@ -226,7 +701,7 @@ const Greeting: React.FC = () => {
Useful to retrieve info about the currently logged in user as well as methods for interacting with it. It sends back an object with the following properties:
| Property | Description |
|--------------------------|-----------------------------------------------------------------------------------------|
| ------------------------ | --------------------------------------------------------------------------------------- |
| **`user`** | The currently logged in user |
| **`logOut`** | A method to log out the currently logged in user |
| **`refreshCookie`** | A method to trigger the silent refreshing of a user's auth token |
@@ -236,18 +711,16 @@ Useful to retrieve info about the currently logged in user as well as methods fo
| **`permissions`** | The permissions of the current user |
```tsx
import { useAuth } from 'payload/components/utilities';
import { User } from '../payload-types.ts';
import { useAuth } from 'payload/components/utilities'
import { User } from '../payload-types.ts'
const Greeting: React.FC = () => {
// highlight-start
const { user } = useConfig<User>();
const { user } = useAuth<User>()
// highlight-end
return (
<span>Hi, {user.email}!</span>
);
};
return <span>Hi, {user.email}!</span>
}
```
### useConfig
@@ -255,17 +728,15 @@ const Greeting: React.FC = () => {
Used to easily fetch the full Payload config.
```tsx
import { useConfig } from 'payload/components/utilities';
import { useConfig } from 'payload/components/utilities'
const MyComponent: React.FC = () => {
// highlight-start
const config = useConfig();
const config = useConfig()
// highlight-end
return (
<span>{config.serverURL}</span>
);
};
return <span>{config.serverURL}</span>
}
```
### useEditDepth
@@ -273,16 +744,14 @@ const MyComponent: React.FC = () => {
Sends back how many editing levels "deep" the current component is. Edit depth is relevant while adding new documents / editing documents in modal windows and other cases.
```tsx
import { useEditDepth } from 'payload/components/utilities';
import { useEditDepth } from 'payload/components/utilities'
const MyComponent: React.FC = () => {
// highlight-start
const editDepth = useEditDepth();
const editDepth = useEditDepth()
// highlight-end
return (
<span>My component is {editDepth} levels deep</span>
)
return <span>My component is {editDepth} levels deep</span>
}
```

View File

@@ -8,35 +8,43 @@ keywords: admin, components, custom, customize, documentation, Content Managemen
Payload dynamically generates a beautiful, fully functional React admin panel to manage your data. It's extremely powerful and can be customized / extended upon easily by swapping in your own React components. You can add additional views, modify how built-in views look / work, swap out Payload branding for your client's, build your own field types and much more.
The Payload Admin panel is built with Webpack, code-split, highly performant (even with 100+ fields), and written fully in TypeScript.
The Payload Admin panel can be bundled with our officially supported [Vite](/docs/admin/vite) and [webpack](/docs/admin/webpack) bundlers or you can integrate another bundler following our adapter pattern approach.
When bundled, it is code-split, highly performant (even with 100+ fields), and written fully in TypeScript.
<Banner type="success">
The Admin panel is meant to be simple enough to give you a starting point but
not bring too much complexity, so that you can easily customize it to suit the
needs of your application and your editors.
The Admin panel is meant to be simple enough to give you a starting point but not bring too much
complexity, so that you can easily customize it to suit the needs of your application and your
editors.
</Banner>
![Payload's Admin panel built in React](https://payloadcms.com/images/docs/admin.jpg)
_Screenshot of the Admin panel while editing a document from an example `AllFields` collection_
<LightDarkImage
srcLight="https://payloadcms.com/images/docs/admin.jpg"
srcDark="https://payloadcms.com/images/docs/admin-dark.jpg"
alt="Admin panel with collapsible sidebar"
caption="Redesigned admin panel with a collapsible sidebar that's open by default, providing greater extensibility and enhanced horizontal real estate."
/>
## Admin Options
All options for the Admin panel are defined in your base Payload config file.
| Option | Description |
| --------------------- | -------------------------------------------------------------------------------------------------- |
| --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `user` | The `slug` of a Collection that you want be used to log in to the Admin dashboard. [More](/docs/admin/overview#the-admin-user-collection) |
| `buildPath` | Specify an absolute path for where to store the built Admin panel bundle used in production. Defaults to `path.resolve(process.cwd(), 'build')`. |
| `meta` | Base meta data to use for the Admin panel. Included properties are `titleSuffix`, `ogImage`, and `favicon`. |
| `disable` | If set to `true`, the entire Admin panel will be disabled. |
| `indexHTML` | Optionally replace the entirety of the `index.html` file used by the Admin panel. Reference the [base index.html file](https://github.com/payloadcms/payload/blob/master/src/admin/index.html) to ensure your replacement has the appropriate HTML elements. |
| `indexHTML` | Optionally replace the entirety of the `index.html` file used by the Admin panel. Reference the [base index.html file](https://github.com/payloadcms/payload/blob/main/packages/payload/src/admin/index.html) to ensure your replacement has the appropriate HTML elements. |
| `css` | Absolute path to a stylesheet that you can use to override / customize the Admin panel styling. [More](/docs/admin/customizing-css). |
| `scss` | Absolute path to a Sass variables / mixins stylesheet meant to override Payload styles to make for an easy re-skinning of the Admin panel. [More](/docs/admin/customizing-css#overriding-scss-variables). |
| `dateFormat` | Global date format that will be used for all dates in the Admin panel. Any valid [date-fns](https://date-fns.org/) format pattern can be used. |
| `avatar` | Set account profile picture. Options: `gravatar`, `default` or a custom React component. |
| `autoLogin` | Used to automate admin log-in for dev and demonstration convenience. [More](/docs/authentication/config). |
| `livePreview` | Enable real-time editing for instant visual feedback of your front-end application. [More](/docs/live-preview/overview). |
| `components` | Component overrides that affect the entirety of the Admin panel. [More](/docs/admin/components) |
| `webpack` | Customize the Webpack config that's used to generate the Admin panel. [More](/docs/admin/webpack) | |
| `webpack` | Customize the Webpack config that's used to generate the Admin panel. [More](/docs/admin/webpack) |
| `vite` | Customize the Vite config that's used to generate the Admin panel. [More](/docs/admin/vite) |
| **`bundler`** | The bundler that you would like to use to bundle the admin panel. Officially supported bundlers: [Webpack](/docs/admin/webpack) and [Vite](/docs/admin/vite). |
| **`logoutRoute`** | The route for the `logout` page. |
| **`inactivityRoute`** | The route for the `logout` inactivity page. |
@@ -45,8 +53,8 @@ All options for the Admin panel are defined in your base Payload config file.
<Banner type="warning">
<strong>Important:</strong>
<br />
The Payload Admin panel can only be used by one Collection that supports{" "}
<a href="/docs/authentication/overview">Authentication</a>.
The Payload Admin panel can only be used by one Collection that supports
[Authentication](/docs/authentication/overview).
</Banner>
To specify which Collection to use to log in to the Admin panel, pass the `admin` options a `user` key equal to the slug of the Collection that you'd like to use.
@@ -54,13 +62,13 @@ To specify which Collection to use to log in to the Admin panel, pass the `admin
`payload.config.js`:
```ts
import { buildConfig } from "payload/config";
import { buildConfig } from 'payload/config'
const config = buildConfig({
admin: {
user: "admins", // highlight-line
user: 'admins', // highlight-line
},
});
})
```
By default, if you have not specified a Collection, Payload will automatically provide you with a `User` Collection which will be used to access the Admin panel. You can customize or override the fields and settings of the default `User` Collection by passing your own collection using `users` as its `slug` to Payload. When this is done, Payload will use your provided `User` Collection instead of its default version.

View File

@@ -15,8 +15,10 @@ Out of the box, Payload handles the persistence of your users' preferences in a
1. The "collapsed" state of blocks, on a document level, as users edit or interact with documents
<Banner type="warning">
<strong>Important:</strong><br/>
All preferences are stored on an individual user basis. Payload automatically recognizes the user that is reading or setting a preference via all provided authentication methods.
<strong>Important:</strong>
<br />
All preferences are stored on an individual user basis. Payload automatically recognizes the user
that is reading or setting a preference via all provided authentication methods.
</Banner>
### Use cases
@@ -30,17 +32,17 @@ This API is used significantly for internal operations of the Admin panel, as me
### Database
Payload automatically creates an internally used `_preferences` collection that stores user preferences. Each document in the `_preferences` collection contains the following shape:
Payload automatically creates an internally used `payload-preferences` collection that stores user preferences. Each document in the `payload-preferences` collection contains the following shape:
| Key | Value |
| -------------------- | -------------|
| `id` | A unique ID for each preference stored. |
| `key` | A unique `key` that corresponds to the preference. |
| `user` | The ID of the `user` that is storing its preference. |
| `userCollection` | The `slug` of the collection that the `user` is logged in as. |
| `value` | The value of the preference. Can be any data shape that you need. |
| `createdAt` | A timestamp of when the preference was created. |
| `updatedAt` | A timestamp set to the last time the preference was updated.
| Key | Value |
| ----------------- | ----------------------------------------------------------------- |
| `id` | A unique ID for each preference stored. |
| `key` | A unique `key` that corresponds to the preference. |
| `user.value` | The ID of the `user` that is storing its preference. |
| `user.relationTo` | The `slug` of the collection that the `user` is logged in as. |
| `value` | The value of the preference. Can be any data shape that you need. |
| `createdAt` | A timestamp of when the preference was created. |
| `updatedAt` | A timestamp set to the last time the preference was updated. |
### APIs

82
docs/admin/vite.mdx Normal file
View File

@@ -0,0 +1,82 @@
---
title: Vite
label: Vite
order: 90
desc: NEEDS TO BE WRITTEN
---
Payload has a Vite bundler that you can install and bundle the Admin Panel with. This is an alternative to the [Webpack](/docs/admin/webpack) bundler and might give some performance boosts to your development workflow.
To use Vite as your bundler, first you need to install the package:
```bash
yarn add @payloadcms/bundler-vite
```
<Banner>
The Vite bundler is currently in beta. If you would like to help us test this package, we'd love to hear if you find any bugs or issues!
</Banner>
Vite works fundamentally differently than Webpack. In development mode, it will first pre-bundle any of your dependencies that are CommonJS-only, and then it'll leverage ESM directly in your browser for a better HMR experience.
It then uses Rollup to create production builds of your admin UI. With Vite, you should see a decent performance boost—especially after your first cold start. However, that first cold start might take a few more seconds.
<Banner type="warning">
In most cases, Vite should work out of the box. But existing Payload plugins may need to make compatibility changes to support Vite.
</Banner>
This is because Vite aliases work fundamentally differently than Webpack aliases, and Payload relies on aliasing server-only code out of the Payload config to ensure that the bundled admin JS works within your browser.
Here are the main differences between how Vite aliases work and how Webpack aliases work.
**Vite aliases do not work with absolute paths.**
In Vite, an alias will only match if the `find` property _exactly matches_ how you are importing your server-only file. So if you are importing a file with a relative path, i.e. `'../../my-module'`, and your alias is absolute, your alias will not work.
**Vite aliases do not get applied to pre-bundled dependencies.**
This especially affects plugins, as plugins will be pre-bundled by Vite using `esbuild`. To get around this and support Vite, plugin authors need to configure an alias to their plugin at the top level, so that the alias will work accordingly.
Here's an example. Say your plugin is called `payload-plugin-cool`. It's imported as follows:
```ts
import { myCoolPlugin } from 'payload-plugin-cool'
```
That plugin should create an alias to support Vite as follows:
```ts
{
// aliases go here
'payload-plugin-cool': path.resolve(__dirname, './my-admin-plugin.js')
}
```
This will effectively alias the entire plugin and work with Vite. If the plugin requires admin-specific code, then the `./my-admin-plugin.js` alias target file should reflect any changes necessary to the admin UI that the main server-side plugin performs.
### Extending the Vite config
The Payload config supports a new property for plugins to be able to extend the Vite config specifically. That property exists on the main Payload config under `admin.vite`.
It's a function that takes a Vite config, and returns an updated Vite config. Here's an example:
```ts
export const buildConfig({
collections: [],
admin: {
vite: (incomingViteConfig) => ({
...incomingViteConfig,
resolve: {
...incomingViteConfig.resolve,
// Do whatever you need here
}
})
}
})
```
Even though there is a new property for Vite configs specifically, we have implemented some "compatibility" between Webpack and Vite out-of-the-box.
If your config specifies Webpack aliases, we attempt to leverage them automatically within the Vite config. They are merged into the Vite alias configuration seamlessly and may work out-of-the-box.

View File

@@ -1,178 +1,67 @@
---
title: Webpack
label: Webpack
order: 60
order: 80
desc: The Payload admin panel uses Webpack 5 and supports many common functionalities such as SCSS and Typescript out of the box to give you more freedom.
keywords: admin, webpack, documentation, Content Management System, cms, headless, javascript, node, react, express
---
Payload uses Webpack 5 to build the Admin panel. It comes with support for many common functionalities such as SCSS and Typescript out of the box, but there are many cases where you may need to add support for additional functionalities.
Payload has a Webpack (v5) bundler that you can build the Admin panel with. For now, we recommended using it because it is stable. If you are feeling a bit more adventurous you can give the [Vite](/docs/admin/vite) bundler a shot.
To extend the Webpack config, add the `webpack` key to your base Payload config, and provide a function that accepts the default Webpack config as its only argument:
Out of the box, the Webpack bundler supports common functionalities such as SCSS and Typescript, but there are many cases where you may need to add support for additional functionalities.
#### Installation
```bash
yarn add @payloadcms/bundler-webpack
```
#### Import the bundler
`payload.config.ts`
```ts
import { buildConfig } from 'payload/config';
// payload.config.ts
import { buildConfig } from 'payload/config'
import { webpackBundler } from '@payloadcms/bundler-webpack'
export default buildConfig({
admin: {
// highlight-start
webpack: (config) => {
// Do something with the config here
return config;
}
// highlight-end
}
});
// highlight-start
admin: {
bundler: webpackBundler()
},
// highlight-end
})
```
### Aliasing server-only modules
### Extending Webpack
A common use case for extending the Payload config is to alias server-only modules, thus preventing them from inclusion into the browser JavaScript bundle.
If you need to extend the Webpack config, you can do so by passing a function to the `admin.webpack` property on your Payload config.
The function will receive the Webpack config as an argument and should return the modified config.
As the Payload config is used in both server **and** client contexts, you may find yourself writing code in your Payload config that may be incompatible with browser environments.
Examples of **non** browser-friendly packages:
- `fs`
- `stripe`
- `authorizenet`
- `nodemailer`
You may rely on server-only packages such as the above to perform logic in access control functions, hooks, and other contexts (which is great!) but when you boot up your Payload app and try to view it in the browser, you'll likely run into missing dependency issues or other general incompatibilities.
<Banner type="success">
<strong>Tip:</strong><br/>
To avoid problems with server code making it to your Webpack bundle, you can use the <strong>alias</strong> Webpack feature to tell Webpack to avoid importing the modules you want to restrict to server-only.
</Banner>
<strong>For example, let's say that you have a Collection called `Subscriptions` which relies on Stripe:</strong>
<br/><br/>
`collections/Subscriptions/index.js`
```ts
import { CollectionConfig } from 'payload/types';
import createStripeSubscription from './hooks/createStripeSubscription';
// payload.config.ts
const Subscription: CollectionConfig = {
slug: 'subscriptions',
hooks: {
beforeChange: [
createStripeSubscription,
]
},
fields: [
{
name: 'stripeSubscriptionID',
type: 'text',
required: true,
}
]
};
export default Subscription;
```
The collection above features a `beforeChange` hook that creates a Stripe subscription whenever a Subscription document is created in Payload.
<strong>That hook might look something like this:</strong>
<br/><br/>
`collections/Subscriptions/hooks/createStripeSubscription.js`
```js
import Stripe from 'stripe';
const stripe = new Stripe(process.env.STRIPE_SECRET_KEY);
const createStripeSubscription = async ({ data, operation }) => {
if (operation === 'create') {
const dataWithStripeID = {...data};
// use Stripe to create a Stripe subscription
const subscription = await stripe.subscriptions.create({
// Configure the subscription accordingly
});
// Automatically add the Stripe subscription ID
// to the data that will be saved to this Subscription doc
dataWithStripeID.stripeSubscriptionID = subscription.id;
return dataWithStripeID
}
return data;
}
export default createStripeSubscription;
```
<Banner type="error">
<strong>Warning:</strong><br/>
The above code is NOT production-ready and should not be referenced to create Stripe subscriptions. Although creating a beforeChange hook is a completely valid spot to do things like create subscriptions, the code above is incomplete and insecure, meant for explanation purposes only.
</Banner>
**As-is, this collection will prevent your Admin panel from bundling or loading correctly, because Stripe relies on some Node-only packages.**
To remedy this issue you can extend the Payload Webpack config to alias your entire `createStripeSubscription` hook to a separate, empty mock file.
Example in `payload.config.js`:
```js
import { buildConfig } from 'payload/config';
import path from 'path';
import Subscription from './collections/Subscription';
const createStripeSubscriptionPath = path.resolve(__dirname, 'collections/Subscription/hooks/createStripeSubscription.js');
const mockModulePath = path.resolve(__dirname, 'mocks/emptyObject.js');
import { buildConfig } from 'payload/config'
import { webpackBundler } from '@payloadcms/bundler-webpack'
export default buildConfig({
collections: [
Subscription
],
admin: {
webpack: (config) => ({
...config,
resolve: {
...config.resolve,
alias: {
...config.resolve.alias,
[createStripeSubscriptionPath]: mockModulePath,
}
}
})
}
});
admin: {
bundler: webpackBundler()
// highlight-start
webpack: (config) => {
// full control of the Webpack config
return config
},
// highlight-end
},
})
```
The above code will alias the file at path `createStripeSubscriptionPath` to a mocked module, which might look like this:
`mocks/emptyObject.js`
```js
export default {};
```
Now, when Webpack sees that you're attempting to import your `createStripeSubscriptionPath` file, it'll disregard that actual file and load your mock file instead. Not only will your Admin panel now bundle successfully, you will have optimized its filesize by removing unnecessary code! And you might have learned something about Webpack, too.
<Banner type="success">
<strong>Tip:</strong><br/>
If changes to your Webpack aliases are not surfacing, they might be [cached](https://webpack.js.org/configuration/cache/) in `node_modules/.cache/webpack`. Try deleting that folder and restarting your server.
<strong>Tip:</strong>
<br />
If changes to your Webpack aliases are not surfacing, they might be
[cached](https://webpack.js.org/configuration/cache/) in `node_modules/.cache/webpack`. Try
deleting that folder and restarting your server.
</Banner>
## Admin environment vars
<Banner type="warning">
<strong>Important:</strong><br />
Be careful about what variables you provide to your client-side code. Analyze every single one to make sure that you're not accidentally leaking anything that an attacker could exploit. Only keys that are safe to be available to everyone in plain text should be provided to your Admin panel.
</Banner>
By default, `env` variables are **not** provided to the Admin panel for security and safety reasons. But, Payload provides you with a way to still provide `env` vars to your frontend code.
**Payload will automatically supply any present `env` variables that are prefixed with `PAYLOAD_PUBLIC_` directly to the Admin panel.**
For example, if you've got the following environment variable:
`PAYLOAD_PUBLIC_STRIPE_PUBLISHABLE_KEY=pk_test_XXXXXXXXXXXXXXXXXX`
This key will automatically be made available to the Payload bundle and can be referenced in your Admin component code as `process.env.PAYLOAD_PUBLIC_STRIPE_PUBLISHABLE_KEY`.

View File

@@ -17,7 +17,7 @@ To enable Authentication on a collection, define an `auth` property and set it t
| **`useAPIKey`** | Payload Authentication provides for API keys to be set on each user within an Authentication-enabled Collection. [More](/docs/authentication/config#api-keys) |
| **`tokenExpiration`** | How long (in seconds) to keep the user logged in. JWTs and HTTP-only cookies will both expire at the same time. |
| **`maxLoginAttempts`** | Only allow a user to attempt logging in X amount of times. Automatically locks out a user from authenticating if this limit is passed. Set to `0` to disable. |
| **`lockTime`** | Set the time (in milliseconds) that a user should be locked out if they fail authentication more times than `maxLoginAttempts` allows for. |
| **`lockTime`** | Set the time (in milliseconds) that a user should be locked out if they fail authentication more times than `maxLoginAttempts` allows for. |
| **`depth`** | How many levels deep a `user` document should be populated when creating the JWT and binding the `user` to the express `req`. Defaults to `0` and should only be modified if absolutely necessary, as this will affect performance. |
| **`cookies`** | Set cookie options, including `secure`, `sameSite`, and `domain`. For advanced users. |
| **`forgotPassword`** | Customize the way that the `forgotPassword` operation functions. [More](/docs/authentication/config#forgot-password) |
@@ -29,34 +29,54 @@ To enable Authentication on a collection, define an `auth` property and set it t
To integrate with third-party APIs or services, you might need the ability to generate API keys that can be used to identify as a certain user within Payload.
In Payload, users are essentially documents within a collection. Just like you can authenticate as a user with an email and password, which is considered as our default local auth strategy, you can also authenticate as a user with an API key. API keys are generated on a user-by-user basis, similar to email and passwords, and are meant to represent a single user.
For example, if you have a third-party service or external app that needs to be able to perform protected actions at its discretion, you have two options:
1. Create a user for the third-party app, and log in each time to receive a token before you attempt to access any protected actions
1. Enable API key support for the Collection, where you can generate a non-expiring API key per user in the collection
1. Enable API key support for the Collection, where you can generate a non-expiring API key per user in the collection. This is particularly useful as you can create a "user" that reflects an integration with a specific external service and assign a "role" or specific access only needed by that service/integration. Alternatively, you could create a "super admin" user and assign an API key to that user so that any requests made with that API key are considered as being made by that super user.
Technically, both of these options will work for third-party integrations but the second option with API key is simpler, because it reduces the amount of work that your integrations need to do to be authenticated properly.
To enable API keys on a collection, set the `useAPIKey` auth option to `true`. From there, a new interface will appear in the Admin panel for each document within the collection that allows you to generate an API key for each user in the Collection.
<Banner type="success">
User API keys are encrypted within the database, meaning that if your database
is compromised, your API keys will not be.
User API keys are encrypted within the database, meaning that if your database is compromised,
your API keys will not be.
</Banner>
#### Authenticating via API Key
To authenticate REST or GraphQL API requests using an API key, set the `Authorization` header. The header is case-sensitive and needs the slug of the `auth.useAPIKey` enabled collection, then " API-Key ", followed by the `apiKey` that has been assigned. Payload's built-in middleware will then assign the user document to `req.user` and handle requests with the proper access control.
To authenticate REST or GraphQL API requests using an API key, set the `Authorization` header. The header is case-sensitive and needs the slug of the `auth.useAPIKey` enabled collection, then " API-Key ", followed by the `apiKey` that has been assigned. Payload's built-in middleware will then assign the user document to `req.user` and handle requests with the proper access control. By doing this, Payload recognizes the request being made as a request by the user associated with that API key.
**For example, using Fetch:**
```ts
import User from '../collections/User';
import User from '../collections/User'
const response = await fetch("http://localhost:3000/api/pages", {
const response = await fetch('http://localhost:3000/api/pages', {
headers: {
Authorization: `${User.slug} API-Key ${YOUR_API_KEY}`,
},
});
})
```
Payload ensures that the same, uniform access control is used across all authentication strategies. This enables you to utilize your existing access control configurations with both API keys and the standard email/password authentication. This consistency can aid in maintaining granular control over your API keys.
#### API Key _Only_ Authentication
If you want to use API keys as the only authentication method for a collection, you can disable the default local strategy by setting `disableLocalStrategy` to `true` on the collection's `auth` property. This will disable the ability to authenticate with email and password, and will only allow for authentication via API key.
```ts
import { CollectionConfig } from 'payload/types'
export const Customers: CollectionConfig = {
slug: 'customers',
auth: {
useAPIKey: true,
disableLocalStrategy: true,
},
}
```
### Forgot Password
@@ -70,26 +90,25 @@ Function that accepts one argument, containing `{ req, token, user }`, that allo
<Banner type="success">
<strong>Tip:</strong>
<br />
HTML templating can be used to create custom email templates, inline CSS
automatically, and more. You can make a reusable function that standardizes
all email sent from Payload, which makes sending custom emails more DRY.
Payload doesn't ship with an HTML templating engine, so you are free to choose
your own.
HTML templating can be used to create custom email templates, inline CSS automatically, and more.
You can make a reusable function that standardizes all email sent from Payload, which makes
sending custom emails more DRY. Payload doesn't ship with an HTML templating engine, so you are
free to choose your own.
</Banner>
Example:
```ts
import { CollectionConfig } from 'payload/types';
import { CollectionConfig } from 'payload/types'
const Customers: CollectionConfig = {
export const Customers: CollectionConfig = {
slug: 'customers',
auth: {
forgotPassword: {
// highlight-start
generateEmailHTML: ({ req, token, user }) => {
// Use the token provided to allow your user to reset their password
const resetPasswordURL = `https://yourfrontend.com/reset-password?token=${token}`;
const resetPasswordURL = `https://yourfrontend.com/reset-password?token=${token}`
return `
<!doctype html>
@@ -103,22 +122,21 @@ const Customers: CollectionConfig = {
</p>
</body>
</html>
`;
}
`
},
// highlight-end
}
}
};
},
},
}
```
<Banner type="warning">
<strong>Important:</strong>
<br />
If you specify a different URL to send your users to for resetting their
password, such as a page on the frontend of your app or similar, you need to
handle making the call to the Payload REST or GraphQL reset-password operation
yourself on your frontend, using the token that was provided for you. Above,
it was passed via query parameter.
If you specify a different URL to send your users to for resetting their password, such as a page
on the frontend of your app or similar, you need to handle making the call to the Payload REST or
GraphQL reset-password operation yourself on your frontend, using the token that was provided for
you. Above, it was passed via query parameter.
</Banner>
**`generateEmailSubject`**
@@ -153,34 +171,32 @@ Function that accepts one argument, containing `{ req, token, user }`, that allo
Example:
```ts
import { CollectionConfig } from 'payload/types';
import { CollectionConfig } from 'payload/types'
const Customers: CollectionConfig = {
export const Customers: CollectionConfig = {
slug: 'customers',
auth: {
verify: {
// highlight-start
generateEmailHTML: ({ req, token, user }) => {
// Use the token provided to allow your user to verify their account
const url = `https://yourfrontend.com/verify?token=${token}`;
const url = `https://yourfrontend.com/verify?token=${token}`
return `Hey ${user.email}, verify your email by clicking here: ${url}`;
}
return `Hey ${user.email}, verify your email by clicking here: ${url}`
},
// highlight-end
}
}
};
},
},
}
```
<Banner type="warning">
<strong>Important:</strong>
<br />
If you specify a different URL to send your users to for email verification,
such as a page on the frontend of your app or similar, you need to handle
making the call to the Payload REST or GraphQL verification operation yourself
on your frontend, using the token that was provided for you. Above, it was
passed via query parameter.
If you specify a different URL to send your users to for email verification, such as a page on the
frontend of your app or similar, you need to handle making the call to the Payload REST or GraphQL
verification operation yourself on your frontend, using the token that was provided for you.
Above, it was passed via query parameter.
</Banner>
**`generateEmailSubject`**
@@ -211,9 +227,8 @@ As of Payload `1.0.0`, you can add additional authentication strategies to Paylo
Behind the scenes, Payload uses PassportJS to power its local authentication strategy, so most strategies listed on the PassportJS website will work seamlessly. Combined with adding custom components to the admin panel's `Login` view, you can create advanced authentication strategies directly within Payload.
<Banner type="warning">
This is an advanced feature, so only attempt this if you are an experienced
developer. Otherwise, just let Payload's built-in authentication handle user
auth for you.
This is an advanced feature, so only attempt this if you are an experienced developer. Otherwise,
just let Payload's built-in authentication handle user auth for you.
</Banner>
The `strategies` property is an array that takes objects with the following properties:
@@ -229,3 +244,42 @@ If you pass a strategy to the `strategy` property directly, the `name` property
However, if you pass a function to `strategy`, `name` is a required property.
In either case, Payload will prefix the strategy name with the collection `slug` that the strategy is passed to.
### Admin autologin
For testing and demo purposes you may want to skip forcing the admin user to login in order to access the panel.
The `admin.autologin` property is used to configure the how visitors are handled when accessing the admin panel.
The default is that all users will have to login and this should not be enabled for environments where data needs to protected.
#### autoLogin Options
| Option | Description |
| ----------------- | --------------------------------------------------------------------------------------------------------------- |
| **`email`** | The email address of the user to login as |
| **`password`** | The password of the user to login as |
| **`prefillOnly`** | If set to true, the login credentials will be prefilled but the user will still need to click the login button. |
The recommended way to use this feature is behind an environment variable to ensure it is disabled when in production.
**Example:**
```ts
export default buildConfig({
admin: {
user: 'users',
// highlight-start
autoLogin:
process.env.PAYLOAD_PUBLIC_ENABLE_AUTOLOGIN === 'true'
? {
email: 'test@example.com',
password: 'test',
prefillOnly: true,
}
: false,
// highlight-end
},
collections: [
/** */
],
})
```

View File

@@ -17,6 +17,7 @@ The Access operation returns what a logged in user can and can't do with the col
`GET http://localhost:3000/api/access`
Example response:
```ts
{
canAccessAdmin: true,
@@ -77,6 +78,7 @@ Returns either a logged in user with token or null when there is no logged in us
`GET http://localhost:3000/api/[collection-slug]/me`
Example response:
```ts
{
user: { // The JWT "payload" ;) from the logged in user
@@ -108,6 +110,7 @@ query {
Accepts an `email` and `password`. On success, it will return the logged in user as well as a token that can be used to authenticate. In the GraphQL and REST APIs, this operation also automatically sets an HTTP-only cookie including the user's token. If you pass an Express `res` to the Local API operation, Payload will set a cookie there as well.
**Example REST API login**:
```ts
const res = await fetch('http://localhost:3000/api/[collection-slug]/login', {
method: 'POST',
@@ -117,10 +120,10 @@ const res = await fetch('http://localhost:3000/api/[collection-slug]/login', {
body: JSON.stringify({
email: 'dev@payloadcms.com',
password: 'this-is-not-our-password...or-is-it?',
})
}),
})
const json = await res.json();
const json = await res.json()
// JSON will be equal to the following:
/*
@@ -168,6 +171,7 @@ const result = await payload.login({
As Payload sets HTTP-only cookies, logging out cannot be done by just removing a cookie in JavaScript, as HTTP-only cookies are inaccessible by JS within the browser. So, Payload exposes a `logout` operation to delete the token in a safe way.
**Example REST API logout**:
```ts
const res = await fetch('http://localhost:3000/api/[collection-slug]/logout', {
method: 'POST',
@@ -194,6 +198,7 @@ This operation requires a non-expired token to send back a new one. If the user'
If successful, this operation will automatically renew the user's HTTP-only cookie and will send back the updated token in JSON.
**Example REST API token refresh**:
```ts
const res = await fetch('http://localhost:3000/api/[collection-slug]/refresh-token', {
method: 'POST',
@@ -202,7 +207,7 @@ const res = await fetch('http://localhost:3000/api/[collection-slug]/refresh-tok
},
})
const json = await res.json();
const json = await res.json()
// JSON will be equal to the following:
/*
@@ -233,7 +238,10 @@ mutation {
```
<Banner type="success">
The Refresh operation will automatically find the user's token in either a JWT header or the HTTP-only cookie. But, you can specify the token you're looking to refresh by providing the REST API with a `token` within the JSON body of the request, or by providing the GraphQL resolver a `token` arg.
The Refresh operation will automatically find the user's token in either a JWT header or the
HTTP-only cookie. But, you can specify the token you're looking to refresh by providing the REST
API with a `token` within the JSON body of the request, or by providing the GraphQL resolver a
`token` arg.
</Banner>
### Verify by Email
@@ -241,13 +249,14 @@ mutation {
If your collection supports email verification, the Verify operation will be exposed which accepts a verification token and sets the user's `_verified` property to `true`, thereby allowing the user to authenticate with the Payload API.
**Example REST API user verification**:
```ts
const res = await fetch(`http://localhost:3000/api/[collection-slug]/verify/${TOKEN_HERE}`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
});
})
```
**Example GraphQL Mutation**:
@@ -274,6 +283,7 @@ If a user locks themselves out and you wish to deliberately unlock them, you can
To restrict who is allowed to unlock users, you can utilize the [`unlock`](/docs/access-control/overview#unlock) access control function.
**Example REST API unlock**:
```ts
const res = await fetch(`http://localhost:3000/api/[collection-slug]/unlock`, {
method: 'POST',
@@ -308,6 +318,7 @@ The link to reset the user's password contains a token which is what allows the
By default, the Forgot Password operations send users to the Payload Admin panel 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/config#forgot-password).
**Example REST API Forgot Password**:
```ts
const res = await fetch(`http://localhost:3000/api/[collection-slug]/forgot-password`, {
method: 'POST',
@@ -317,7 +328,7 @@ const res = await fetch(`http://localhost:3000/api/[collection-slug]/forgot-pass
body: JSON.stringify({
email: 'dev@payloadcms.com',
}),
});
})
```
**Example GraphQL Mutation**:
@@ -336,13 +347,18 @@ const token = await payload.forgotPassword({
data: {
email: 'dev@payloadcms.com',
},
disableEmail: false // you can disable the auto-generation of email via local API
});
disableEmail: false, // you can disable the auto-generation of email via local API
})
```
<Banner type="success">
<strong>Tip:</strong><br/>
You can stop the reset-password email from being sent via using the local API. This is helpful if you need to create user accounts programmatically, but not set their password for them. This effectively generates a reset password token which you can then use to send to a page you create, allowing a user to "complete" their account by setting their password. In the background, you'd use the token to "reset" their password.
<strong>Tip:</strong>
<br />
You can stop the reset-password email from being sent via using the local API. This is helpful if
you need to create user accounts programmatically, but not set their password for them. This
effectively generates a reset password token which you can then use to send to a page you create,
allowing a user to "complete" their account by setting their password. In the background, you'd
use the token to "reset" their password.
</Banner>
### Reset Password
@@ -350,6 +366,7 @@ const token = await payload.forgotPassword({
After a user has "forgotten" their password and a token is generated, that token can be used to send to the reset password operation along with a new password which will allow the user to reset their password securely.
**Example REST API Reset Password**:
```ts
const res = await fetch(`http://localhost:3000/api/[collection-slug]/reset-password`, {
method: 'POST',

View File

@@ -6,14 +6,20 @@ desc: Payload provides highly secure user Authentication out of the box, and you
keywords: authentication, config, configuration, overview, documentation, Content Management System, cms, headless, javascript, node, react, express
---
<YouTube
id="CT4KafeJjTI"
title="Simplified Authentication for Headless CMS: Unlocking Reusability in One Line"
/>
<Banner>
Payload provides for highly secure and customizable user Authentication out of the box, which allows for users to identify themselves to Payload.
Payload provides for highly secure and customizable user Authentication out of the box, which
allows for users to identify themselves to Payload.
</Banner>
Authentication is used within the Payload Admin panel itself as well as throughout your app(s) themselves however you determine necessary.
![Authentication admin panel functionality](https://payloadcms.com/images/docs/auth-admin.jpg)
*Admin panel screenshot depicting an Admins Collection with Auth enabled*
_Admin panel screenshot depicting an Admins Collection with Auth enabled_
**Here are some common use cases of Authentication outside of Payload's dashboard itself:**
@@ -33,10 +39,10 @@ Every Payload Collection can opt-in to supporting Authentication by specifying t
Simple example collection:
```ts
import { CollectionConfig } from 'payload/types';
import { CollectionConfig } from 'payload/types'
const Admins: CollectionConfig = {
slug:
export const Admins: CollectionConfig = {
slug: 'admins',
// highlight-start
auth: {
tokenExpiration: 7200, // How many seconds to keep the user logged in
@@ -57,7 +63,7 @@ const Admins: CollectionConfig = {
'editor',
'developer',
],
}
},
],
}
```
@@ -78,9 +84,14 @@ Once enabled, each document that is created within the Collection can be thought
Successfully logging in returns a `JWT` (JSON web token) which is how a user will identify themselves to Payload. By providing this JWT via either an HTTP-only cookie or an `Authorization` header, Payload will automatically identify the user and add its user JWT data to the Express `req`, which is available throughout Payload including within access control, hooks, and more.
You can specify what data gets encoded to the JWT token by setting `saveToJWT` to true in your auth collection fields. If you wish to use a different key other than the field `name`, you can provide it to `saveToJWT` as a string. It is also possible to use `saveToJWT` on fields that are nested in inside groups and tabs. If a group has a `saveToJWT` set it will include the object with all sub-fields in the token. You can set `saveToJWT: false` for any fields you wish to omit. If a field inside a group has `saveToJWT` set, but the group does not, the field will be included at the top level of the token.
<Banner type="success">
<strong>Tip:</strong><br/>
You can access the logged in user from access control functions and hooks via the Express <strong>req</strong>. The logged in user is automatically added as the <strong>user</strong> property.
<strong>Tip:</strong>
<br />
You can access the logged-in user from access control functions and hooks via the Express{' '}
<strong>req</strong>. The logged-in user is automatically added as the <strong>user</strong>{' '}
property.
</Banner>
### HTTP-only cookies
@@ -100,16 +111,19 @@ Fetch example, including credentials:
```ts
const response = await fetch('http://localhost:3000/api/pages', {
credentials: 'include',
});
})
const pages = await response.json();
const pages = await response.json()
```
For more about how to automatically include cookies in requests from your app to your Payload API, [click here](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch#Sending_a_request_with_credentials_included).
<Banner type="success">
<strong>Tip:</strong><br/>
To make sure you have a Payload cookie set properly in your browser after logging in, you can use Chrome's Developer Tools - Application - Cookies - [your-domain-here]. The Chrome Developer tools will still show HTTP-only cookies, even when JavaScript running on the page can't.
<strong>Tip:</strong>
<br />
To make sure you have a Payload cookie set properly in your browser after logging in, you can use
Chrome's Developer Tools - Application - Cookies - [your-domain-here]. The Chrome Developer tools
will still show HTTP-only cookies, even when JavaScript running on the page can't.
</Banner>
### CSRF Protection
@@ -121,28 +135,33 @@ For example, let's say you have a very popular app running at coolsite.com. This
So, if a user of coolsite.com is logged in and just browsing around on the internet, they might stumble onto a page with bad intentions. That bad page might automatically make requests to all sorts of sites to see if they can find one that they can log into - and coolsite.com might be on their list. If your user was logged in while they visited that evil site, the attacker could do whatever they wanted as if they were your coolsite.com user by just sending requests to the coolsite API (which would automatically include the auth cookie). They could send themselves a bunch of money from your user's account, change the user's password, etc. This is what a CSRF attack is.
<Banner type="warning">
<strong>To protect against CSRF attacks, Payload only accepts cookie-based authentication from domains that you explicitly whitelist.</strong>
<strong>
To protect against CSRF attacks, Payload only accepts cookie-based authentication from domains
that you explicitly whitelist.
</strong>
</Banner>
To define domains that should allow users to identify themselves via the Payload HTTP-only cookie, use the `csrf` option on the base Payload config to whitelist domains that you trust.
`payload.config.ts`:
```ts
import { buildConfig } from 'payload/config';
import { buildConfig } from 'payload/config'
const config = buildConfig({
collections: [
// collections here
],
// highlight-start
csrf: [ // whitelist of domains to allow cookie auth from
csrf: [
// whitelist of domains to allow cookie auth from
'https://your-frontend-app.com',
'https://your-other-frontend-app.com',
],
// highlight-end
});
})
export default config;
export default config
```
### Identifying users via the Authorization Header
@@ -150,11 +169,12 @@ export default config;
In addition to authenticating via an HTTP-only cookie, you can also identify users via the `Authorization` header on an HTTP request.
Example:
```ts
const request = await fetch('http://localhost:3000', {
headers: {
Authorization: `JWT ${token}`
}
Authorization: `JWT ${token}`,
},
})
```

View File

@@ -11,46 +11,46 @@ Because Payload uses your existing Express server, you are free to add whatever
This approach has a ton of benefits - it's great for isolation of concerns and limiting scope, but it also means that your additional routes won't have access to Payload's user authentication.
<Banner type="success">
You can make full use of Payload's built-in authentication within your own
custom Express endpoints by adding Payload's authentication middleware.
You can make full use of Payload's built-in authentication within your own custom Express
endpoints by adding Payload's authentication middleware.
</Banner>
<Banner type="warning">
Payload must be initialized before the `payload.authenticate` middleware can
be used. This is done by calling `payload.init()` prior to adding the
middleware.
Payload must be initialized before the `payload.authenticate` middleware can be used. This is done
by calling `payload.init()` prior to adding the middleware.
</Banner>
Example in `server.js`:
```ts
import express from "express";
import payload from "payload";
import express from 'express'
import payload from 'payload'
const app = express();
const app = express()
payload.init({
secret: "PAYLOAD_SECRET_KEY",
mongoURL: "mongodb://localhost/payload",
express: app,
});
const start = async () => {
await payload.init({
secret: 'PAYLOAD_SECRET_KEY',
express: app,
})
const router = express.Router();
const router = express.Router()
// Note: Payload must be initialized before the `payload.authenticate` middleware can be used
router.use(payload.authenticate); // highlight-line
// Note: Payload must be initialized before the `payload.authenticate` middleware can be used
router.use(payload.authenticate) // highlight-line
router.get("/", (req, res) => {
if (req.user) {
return res.send(`Authenticated successfully as ${req.user.email}.`);
}
router.get('/', (req, res) => {
if (req.user) {
return res.send(`Authenticated successfully as ${req.user.email}.`)
}
return res.send("Not authenticated");
});
return res.send('Not authenticated')
})
app.use("/some-route-here", router);
app.use('/some-route-here', router)
app.listen(3000, async () => {
payload.logger.info(`listening on ${3000}...`);
});
app.listen(3000)
}
start()
```

View File

@@ -0,0 +1,61 @@
---
title: Project Configuration
label: Configuration
order: 20
desc: Quickly configure and deploy your Payload Cloud project in a few simple steps.
keywords: configuration, config, settings, project, cloud, payload cloud, deploy, deployment
---
### Select your plan
Once you have created a project, you will need to select your plan. This will determine the resources that are allocated to your project and the features that are available to you.
<Banner type="success">
Note: All Payload Cloud teams that deploy a project require a card on file. This helps us prevent
fraud and abuse on our platform. If you select a plan with a free trial, you will not be charged
until your trial period is over. Well remind you 7 days before your trial ends and you can cancel
anytime.
</Banner>
### Project Details
| Option | Description |
| ---------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Region** | Select the region closest to your audience. This will ensure the fastest communication between your data and your client. |
| **Project Name** | A name for your project. You can change this at any time. |
| **Project Slug** | Choose a unique slug to identify your project. This needs to be unique for your team and you can change it any time. |
| **Team** | Select the team you want to create the project under. If this is your first project, a personal team will be created for you automatically. You can modify your team settings and invite new members at any time from the Team Settings page. |
### Build Settings
If you are deploying a new project from a template, the following settings will be automatically configured for you. If you are using your own repository, you need to make sure your build settings are accurate for your project to deploy correctly.
| Option | Description |
| -------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Root Directory** | The folder where your `package.json` file lives. |
| **Install Command** | The command used to install your modules, for example: `yarn install` or `npm install` |
| **Build Command** | The command used to build your application, for example: `yarn build` or `npm run build` |
| **Serve Command** | The command used to serve your application, for example: `yarn serve` or `npm run serve` |
| **Branch to Deploy** | Select the branch of your repository that you want to deploy from. This is the branch that will be used to build your project when you commit new changes. |
| **Default Domain** | Set a default domain for your project. This must be unique and you will not able to change it. You can always add a custom domain later in your project settings. |
### Environment Variables
Any of the features in Payload Cloud that require environment variables will automatically be provided to your application. If your app requires any custom environment variables, you can set them here.
<Banner type="warning">
Note: For security reasons, any variables you wish to provide to the Admin panel must be prefixed
with `PAYLOAD_PUBLIC_`.  Learn more
[here](https://payloadcms.com/docs/admin/webpack#admin-environment-vars).
</Banner>
### Payment
Payment methods can be set per project and can be updated any time. You can use teams default payment method, or add a new one. Modify your payment methods in your Project settings / Team settings.
<Banner type="success">
<strong>Note:</strong> All Payload Cloud teams that deploy a project require a card on file. This
helps us prevent fraud and abuse on our platform. If you select a plan with a free trial, you will
not be charged until your trial period is over. Well remind you 7 days before your trial ends and
you can cancel anytime.
</Banner>

View File

@@ -0,0 +1,51 @@
---
title: Getting Started
label: Getting Started
order: 10
desc: Get started with Payload Cloud, a deployment solution specifically designed for Node + MongoDB applications.
keywords: cloud, hosted, database, storage, email, deployment, serverless, node, mongodb, s3, aws, cloudflare, atlas, resend, payload, cms
---
A deployment solution specifically designed for Node.js + MongoDB applications, offering seamless deployment of your entire stack in one place. You can get started in minutes with a one-click template or bring your own codebase with you.
Payload Cloud offers various plans tailored to meet your specific needs, including a MongoDB Atlas database, S3 file storage, and email delivery powered by [Resend](https://resend.com). To see a full breakdown of features and plans, see our [Cloud Pricing page](https://payloadcms.com/cloud-pricing).
To get started, you first need to create an account. Head over to [the login screen](https://payloadcms.com/login) and **Register for Free**.
<Banner type="success">
To create your first project, you can either select [a template](#starting-from-a-template) or
[import an existing project](#importing-from-an-existing-codebase) from GitHub.
</Banner>
## Starting from a Template
Templates come preconfigured and provide a one-click solution to quickly deploy a new application.
![Screen for creating a new project from a template](https://payloadcms.com/images/docs/cloud/create-from-template.jpg)
_Creating a new project from a template._
After creating an account, select your desired template from the Projects page. At this point, you need to connect to authorize the Payload Cloud application with your GitHub account. Click Continue with GitHub and follow the prompts to authorize the app.
Next, select your `GitHub Scope`. If you belong to multiple organizations, they will show up here. If you do not see the organization you are looking for, you may need to adjust your GitHub app permissions.
After selecting your scope, create a unique `repository name` and select whether you want your repository to be public or private on GitHub.
<Banner type="warning">
<strong>Note:</strong> Public repositories can be accessed by anyone online, while private
repositories grant access only to you and anyone you explicitly authorize.
</Banner>
Once you are ready, click **Create Project**. This will clone the selected template to a new repository in your GitHub account, and take you to the configuration page to set up your project for deployment.
## Importing from an Existing Codebase
Payload Cloud works for any Node.js + MongoDB app. From the New Project page, select **import an existing Git codebase**. Choose the organization and select the repository you want to import. From here, you will be taken to the configuration page to set up your project for deployment.
![Screen for creating a new project from an existing repository](https://payloadcms.com/images/docs/cloud/create-from-existing.jpg)
_Creating a new project from an existing repository._
<Banner type="warning">
<strong>Note:</strong> In order to make use of the features of Payload Cloud in your own codebase,
you will need to add the [Cloud Plugin](https://github.com/payloadcms/plugin-cloud) to your
Payload app.
</Banner>

109
docs/cloud/projects.mdx Normal file
View File

@@ -0,0 +1,109 @@
---
title: Cloud Projects
label: Projects
order: 40
desc: Manage your Payload Cloud projects.
keywords: cloud, payload cloud, projects, project, overview, database, file storage, build settings, environment variables, custom domains, email, developing locally
---
### Overview
<Banner>
The overview tab shows your most recent deployment, along with build and deployment logs. From
here, you can see your live URL, deployment details like timestamps and commit hash, as well as
the status of your deployment. You can also trigger a redeployment manually, which will rebuild
your project using the current configuration.
</Banner>
![Payload Cloud Overview Page](https://payloadcms.com/images/docs/cloud/overview-page.jpg)
_A screenshot of the Overview page for a Cloud project._
### Database
Your Payload Cloud project comes with a MongoDB serverless Atlas DB instance or a Dedicated Atlas cluster, depending on your plan. To interact with your cloud database, you will be provided with a MongoDB connection string. This can be found under the **Database** tab of your project.
`mongodb+srv://your_connection_string`
### File Storage
Payload Cloud gives you S3 file storage backed by Cloudflare as a CDN, and this plugin extends Payload so that all of your media will be stored in S3 rather than locally.
AWS Cognito is used for authentication to your S3 bucket. The [Payload Cloud Plugin](https://github.com/payloadcms/plugin-cloud) will automatically pick up these values. These values are only if you'd like to access your files directly, outside of Payload Cloud.
### Build Settings
You can update settings from your Projects Settings tab. Changes to your build settings will trigger a redeployment of your project.
### Environment Variables
From the Environment Variables page of the Settings tab, you can add, update and delete variables for use in your project. Like build settings, these changes will trigger a redeployment of your project.
<Banner>
Note: For security reasons, any variables you wish to provide to the Admin panel must be prefixed
with `PAYLOAD_PUBLIC_`.  Learn more
[here](https://payloadcms.com/docs/admin/webpack#admin-environment-vars).
</Banner>
### Custom Domains
With Payload Cloud, you can add custom domain names to your project. To do so, first go to the Domains page of the Settings tab of your project. Here you can see your default domain. To add a new domain, type in the domain name you wish to use.
<Banner>
Note: do not include the protocol (http:// or https://) or any paths (/page). Only include the
domain name and extension, and optionally a subdomain. - your-domain.com - backend.your-domain.com
</Banner>
Once you click save, a DNS record will be generated for your domain name to point to your live project. Add this record into your DNS providers records, and once the records are resolving properly (this can take 1hr to 48hrs in some cases), your domain will now to point to your live project.
You will also need to configure your Payload project to use your specified domain. In your `payload.config.ts` file, specify your `serverURL` with your domain:
```ts
export default buildConfig({
serverURL: 'https://example.com',
// the rest of your config,
})
```
### Email
Powered by [Resend](https://resend.com), Payload Cloud comes with integrated email support out of the box. No configuration is needed, and you can use `payload.sendEmail()` to send email right from your Payload app. To learn more about sending email with Payload, checkout the [Email Configuration](https://payloadcms.com/docs/email/overview) overview.
If you are on the Pro or Enterprise plan, you can add your own custom Email domain name. From the Email page of your projects Settings, add the domain you wish to use for email delivery. This will generate a set of DNS records. Add these records to your DNS provider and click verify to check that your records are resolving properly. Once verified, your emails will now be sent from your custom domain name.
### Developing Locally
To make changes to your project, you will need to clone the repository defined in your project settings to your local machine. In order to run your project locally, you will need configure your local environment first. Refer to your repositorys `README.md` file to see the steps needed for your specific template.
From there, you are ready to make updates to your project. When you are ready to make your changes live, commit your changes to the branch you specified in your Project settings, and your application will automatically trigger a redeploy and build from your latest commit.
### Cloud Plugin
Projects generated from a template will come pre-configured with the official Cloud Plugin, but if you are using your own repository you will need to add this into your project. To do so, add the plugin to your Payload config:
`yarn add @payloadcms/plugin-cloud`
```js
import { payloadCloud } from '@payloadcms/plugin-cloud'
import { buildConfig } from 'payload/config'
export default buildConfig({
plugins: [payloadCloud()],
// rest of config
})
```
<Banner type="warning">
**Note:** If your Payload config already has an email with transport, this will take precedence
over Payload Cloud's email service.
</Banner>
##### **Optional configuration**
If you wish to opt-out of any Payload cloud features, the plugin also accepts options to do so.
```js
payloadCloud({
storage: false, // Disable file storage
email: false, // Disable email delivery
})
```

35
docs/cloud/teams.mdx Normal file
View File

@@ -0,0 +1,35 @@
---
title: Cloud Teams
label: Teams
order: 30
desc: Manage your Payload Cloud team and billing settings.
keywords: team, teams, billing, subscription, payment, plan, plans, cloud, payload cloud
---
<Banner>
Within Payload Cloud, the team management feature offers you the ability to manage your
organization, team members, billing, and subscription settings.
</Banner>
![Payload Cloud Team Settings](https://payloadcms.com/images/docs/cloud/team-settings.jpg)
_A screenshot of the Team Settings page._
### Members
Each team has members that can interact with your projects. You can invite multiple people to your team and each individual can belong to more than one team. You can assign them either `owner` or `user` permissions. Owners are able to make admin-only changes, such as deleting projects, and editing billing information.
### Adding Members
To add a new member to your team, visit your Teams Settings page, and click “Invite Teammate”. You can then add their email address, and assign their role. Press “Save” to send the invitations, which will send an email to the invited team member where they can create a new account.
### Billing
Users can update billing settings and subscriptions for any teams where they are designated as an `owner`. To make updates to the teams payment methods, visit the Billing page under the Team Settings tab. You can add new cards, delete cards, and set a payment method as a default. The default payment method will be used in the event that another payment method fails.
### Subscriptions
From the Subscriptions page, a team owner can see all current plans for their team. From here, you can see the price of each plan, if there is an active trial, and when you will be billed next.
### Invoices
The Invoices page will you show you the invoices for your account, as well as the status on their payment.

View File

@@ -6,83 +6,92 @@ desc: Structure your Collections for your needs by defining fields, adding slugs
keywords: collections, config, configuration, documentation, Content Management System, cms, headless, javascript, node, react, express
---
Payload Collections are defined through configs of their own, and you can define as many as your application needs. Each Collection will scaffold a MongoDB collection automatically based on fields that you define.
Payload Collections are defined through configs of their own, and you can define as many as your application needs. Each
Collection will scaffold a new collection automatically in your database of choice, based on fields that you define.
It's often best practice to write your Collections in separate files and then import them into the main Payload config.
## Options
| Option | Description |
|--------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **`slug`** * | Unique, URL-friendly string that will act as an identifier for this Collection. |
| **`fields`** * | Array of field types that will determine the structure and functionality of the data stored within this Collection. [Click here](/docs/fields/overview) for a full list of field types as well as how to configure them. |
| **`labels`** | Singular and plural labels for use in identifying this Collection throughout Payload. Auto-generated from slug if not defined. |
| **`admin`** | Admin-specific configuration. See below for [more detail](#admin-options). |
| **`hooks`** | Entry points to "tie in" to Collection actions at specific points. [More](/docs/hooks/overview#collection-hooks) |
| **`access`** | Provide access control functions to define exactly who should be able to do what with Documents in this Collection. [More](/docs/access-control/overview/#collections) |
| **`auth`** | Specify options if you would like this Collection to feature authentication. For more, consult the [Authentication](/docs/authentication/config) documentation. |
| **`upload`** | Specify options if you would like this Collection to support file uploads. For more, consult the [Uploads](/docs/upload/overview) documentation. |
| **`timestamps`** | Set to false to disable documents' automatically generated `createdAt` and `updatedAt` timestamps. |
| **`versions`** | Set to true to enable default options, or configure with object properties. [More](/docs/versions/overview#collection-config) |
| **`endpoints`** | Add custom routes to the REST API. [More](/docs/rest-api/overview#custom-endpoints) |
| **`graphQL`** | An object with `singularName` and `pluralName` strings used in schema generation. Auto-generated from slug if not defined. |
| **`typescript`** | An object with property `interface` as the text used in schema generation. Auto-generated from slug if not defined. |
| **`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. |
| **`pagination`** | Set pagination-specific options for this collection. [More](#pagination) |
| **`custom`** | Extension point for adding custom data (e.g. for plugins) |
| Option | Description |
|-------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **`slug`** \* | Unique, URL-friendly string that will act as an identifier for this Collection. |
| **`fields`** \* | Array of field types that will determine the structure and functionality of the data stored within this Collection. [Click here](/docs/fields/overview) for a full list of field types as well as how to configure them. |
| **`labels`** | Singular and plural labels for use in identifying this Collection throughout Payload. Auto-generated from slug if not defined. |
| **`admin`** | Admin-specific configuration. See below for [more detail](#admin-options). |
| **`hooks`** | Entry points to "tie in" to Collection actions at specific points. [More](/docs/hooks/overview#collection-hooks) |
| **`access`** | Provide access control functions to define exactly who should be able to do what with Documents in this Collection. [More](/docs/access-control/overview/#collections) |
| **`auth`** | Specify options if you would like this Collection to feature authentication. For more, consult the [Authentication](/docs/authentication/config) documentation. |
| **`upload`** | Specify options if you would like this Collection to support file uploads. For more, consult the [Uploads](/docs/upload/overview) documentation. |
| **`timestamps`** | Set to false to disable documents' automatically generated `createdAt` and `updatedAt` timestamps. |
| **`versions`** | Set to true to enable default options, or configure with object properties. [More](/docs/versions/overview#collection-config) |
| **`endpoints`** | Add custom routes to the REST API. Set to `false` to disable routes. [More](/docs/rest-api/overview#custom-endpoints) |
| **`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. |
| **`typescript`** | An object with property `interface` as the text used in schema generation. Auto-generated from slug if not defined. |
| **`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. |
| **`custom`** | Extension point for adding custom data (e.g. for plugins) |
*\* An asterisk denotes that a property is required.*
_\* An asterisk denotes that a property is required._
#### Simple collection example
```ts
import { CollectionConfig } from 'payload/types';
import { CollectionConfig } from 'payload/types'
const Orders: CollectionConfig = {
slug: 'orders',
fields: [
{
name: 'total',
type: 'number',
required: true,
},
{
name: 'placedBy',
type: 'relationship',
relationTo: 'customers',
required: true,
}
]
};
export const Orders: CollectionConfig = {
slug: 'orders',
fields: [
{
name: 'total',
type: 'number',
required: true,
},
{
name: 'placedBy',
type: 'relationship',
relationTo: 'customers',
required: true,
},
],
}
```
#### More collection config examples
You can find an assortment of [example collection configs](https://github.com/payloadcms/public-demo/tree/master/src/collections) in the Public Demo source code on GitHub.
You can find an assortment
of [example collection configs](https://github.com/payloadcms/public-demo/tree/master/src/collections) in the Public
Demo source code on GitHub.
### Admin options
You can customize the way that the Admin panel behaves on a collection-by-collection basis by defining the `admin` property on a collection's config.
You can customize the way that the Admin panel behaves on a collection-by-collection basis by defining the `admin`
property on a collection's config.
| Option | Description |
|------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `group` | Text used as a label for grouping collection links together in the navigation. |
| `group` | Text used as a label for grouping collection and global links together in the navigation. |
| `hidden` | Set to true or a function, called with the current user, returning true to exclude this collection from navigation and admin routing. |
| `hooks` | Admin-specific hooks for this collection. [More](#admin-hooks) |
| `useAsTitle` | Specify a top-level field to use for a document title throughout the Admin panel. If no field is defined, the ID of the document is used as the title. |
| `description` | Text or React component to display below the Collection label in the List view to give editors more information. |
| `defaultColumns` | Array of field names that correspond to which columns to show by default in this collection's List view. |
| `disableDuplicate ` | Disables the "Duplicate" button while editing documents within this collection. |
| `hideAPIURL` | Hides the "API URL" meta field while editing documents within this collection. |
| `enableRichTextLink` | The [Rich Text](/docs/fields/rich-text) field features a `Link` element which allows for users to automatically reference related documents within their rich text. Set to `true` by default. |
| `enableRichTextRelationship` | The [Rich Text](/docs/fields/rich-text) field features a `Relationship` element which allows for users to automatically reference related documents within their rich text. Set to `true` by default. |
| `preview` | Function to generate preview URLS within the Admin panel that can point to your app. [More](#preview). |
| `livePreview` | Enable real-time editing for instant visual feedback of your front-end application. [More](/docs/live-preview/overview). |
| `components` | Swap in your own React components to be used within this collection. [More](/docs/admin/components#collections) |
| `listSearchableFields` | Specify which fields should be searched in the List search view. [More](#list-searchable-fields) |
| **`pagination`** | Set pagination-specific options for this collection. [More](#pagination) |
### Preview
Collection `admin` options can accept a `preview` function that will be used to generate a link pointing to the frontend of your app to preview data.
Collection `admin` options can accept a `preview` function that will be used to generate a link pointing to the frontend
of your app to preview data.
If the function is specified, a Preview button will automatically appear in the corresponding collection's Edit view. Clicking the Preview button will link to the URL that is generated by the function.
If the function is specified, a Preview button will automatically appear in the corresponding collection's Edit view.
Clicking the Preview button will link to the URL that is generated by the function.
**The preview function accepts two arguments:**
@@ -92,59 +101,70 @@ If the function is specified, a Preview button will automatically appear in the
**Example collection with preview function:**
```ts
import { CollectionConfig } from 'payload/types';
import { CollectionConfig } from 'payload/types'
const Posts: CollectionConfig = {
slug: 'posts',
fields: [
{
name: 'slug',
type: 'text',
required: true,
},
],
admin: {
preview: (doc, { locale }) => {
if (doc?.slug) {
return `https://bigbird.com/preview/posts/${doc.slug}?locale=${locale}`;
}
export const Posts: CollectionConfig = {
slug: 'posts',
fields: [
{
name: 'slug',
type: 'text',
required: true,
},
],
admin: {
preview: (doc, { locale }) => {
if (doc?.slug) {
return `https://bigbird.com/preview/posts/${doc.slug}?locale=${locale}`
}
return null;
},
},
};
return null
},
},
}
```
### Pagination
Here are a few options that you can specify options for pagination on a collection-by-collection basis:
| Option | Description |
| --------------------------- | -------------|
| `defaultLimit` | Integer that specifies the default per-page limit that should be used. Defaults to 10. |
| `limits` | Provide an array of integers to use as per-page options for admins to choose from in the List view. |
| Option | Description |
|----------------|-----------------------------------------------------------------------------------------------------|
| `defaultLimit` | Integer that specifies the default per-page limit that should be used. Defaults to 10. |
| `limits` | Provide an array of integers to use as per-page options for admins to choose from in the List view. |
### Access control
You can specify extremely granular access control (what users can do with documents in a collection) on a collection by collection basis. To learn more, go to the [Access Control](/docs/access-control/overview) docs.
You can specify extremely granular access control (what users can do with documents in a collection) on a collection by
collection basis. To learn more, go to the [Access Control](/docs/access-control/overview) docs.
### Hooks
Hooks are a powerful way to extend collection functionality and execute your own logic, and can be defined on a collection by collection basis. To learn more, go to the [Hooks](/docs/hooks/overview) documentation.
Hooks are a powerful way to extend collection functionality and execute your own logic, and can be defined on a
collection by collection basis. To learn more, go to the [Hooks](/docs/hooks/overview) documentation.
### Field types
Collections support all field types that Payload has to offer—including simple fields like text and checkboxes all the way to more complicated layout-building field groups like Blocks. [Click here](/docs/fields/overview) to learn more about field types.
Collections support all field types that Payload has to offer—including simple fields like text and checkboxes all the
way to more complicated layout-building field groups like Blocks. [Click here](/docs/fields/overview) to learn more
about field types.
### List Searchable Fields
In the List view, there is a "search" box that allows you to quickly find a document with a search. By default, it searches on the ID field. If you have `admin.useAsTitle` defined, the list search will use that field. However, you can define more than one field to search to make it easier on your admin editors to find the data they need.
In the List view, there is a "search" box that allows you to quickly find a document with a search. By default, it
searches on the ID field. If you have `admin.useAsTitle` defined, the list search will use that field. However, you can
define more than one field to search to make it easier on your admin editors to find the data they need.
For example, let's say you have a Posts collection with `title`, `metaDescription`, and `tags` fields - and you want all three of those fields to be searchable in the List view. You can simply add `admin.listSearchableFields: ['title', 'metaDescription', 'tags']` - and the admin UI will automatically search on those three fields plus the ID field.
For example, let's say you have a Posts collection with `title`, `metaDescription`, and `tags` fields - and you want all
three of those fields to be searchable in the List view. You can simply
add `admin.listSearchableFields: ['title', 'metaDescription', 'tags']` - and the admin UI will automatically search on
those three fields plus the ID field.
<Banner type="warning">
<strong>Note:</strong><br/>
If you are adding <strong>listSearchableFields</strong>, make sure you index each of these fields so your admin queries can remain performant.
<strong>Note:</strong>
<br />
If you are adding <strong>listSearchableFields</strong>, make sure you index each of these fields
so your admin queries can remain performant.
</Banner>
### Admin Hooks
@@ -153,29 +173,32 @@ In addition to collection hooks themselves, Payload provides for admin UI-specif
**`beforeDuplicate`**
The `beforeDuplicate` hook is an async function that accepts an object containing the data to duplicate, as well as the locale of the doc to duplicate. Within this hook, you can modify the data to be duplicated, which is useful in cases where you have unique fields that need to be incremented or similar, as well as if you want to automatically modify a document's `title`.
The `beforeDuplicate` hook is an async function that accepts an object containing the data to duplicate, as well as the
locale of the doc to duplicate. Within this hook, you can modify the data to be duplicated, which is useful in cases
where you have unique fields that need to be incremented or similar, as well as if you want to automatically modify a
document's `title`.
Example:
```ts
import { BeforeDuplicate, CollectionConfig } from 'payload/types';
import { BeforeDuplicate, CollectionConfig } from 'payload/types'
// Your auto-generated Page type
import { Page } from '../payload-types.ts';
import { Page } from '../payload-types.ts'
const beforeDuplicate: BeforeDuplicate<Page> = ({ data }) => {
return {
...data,
title: `${data.title} Copy`,
uniqueField: data.uniqueField ? `${data.uniqueField}-copy` : '',
};
};
}
}
export const Page: CollectionConfig = {
slug: 'pages',
admin: {
hooks: {
beforeDuplicate,
}
},
},
fields: [
{
@@ -186,8 +209,8 @@ export const Page: CollectionConfig = {
name: 'uniqueField',
type: 'text',
unique: true,
}
]
},
],
}
```
@@ -196,14 +219,14 @@ export const Page: CollectionConfig = {
You can import collection types as follows:
```ts
import { CollectionConfig } from 'payload/types';
import { CollectionConfig } from 'payload/types'
// This is the type used for incoming collection configs.
// Only the bare minimum properties are marked as required.
```
```ts
import { SanitizedCollectionConfig } from 'payload/types';
import { SanitizedCollectionConfig } from 'payload/types'
// This is the type used after an incoming collection config is fully sanitized.
// Generally, this is only used internally by Payload.

Some files were not shown because too many files have changed in this diff Show More