Compare commits

...

1928 Commits

Author SHA1 Message Date
Elliot DeNolf
e5d6cdae38 chore(release): db-postgres/0.8.9 [skip ci] 2024-10-18 15:37:39 -04:00
Elliot DeNolf
218f2ead03 chore(release): payload/2.30.3 [skip ci] 2024-10-18 15:36:55 -04:00
Sasha
e9c1222182 fix(db-postgres): migrate:create errors with previous schemas (#8786)
Fixes https://github.com/payloadcms/payload/issues/8782
2024-10-18 14:04:23 -04:00
Sasha
c8ed6454a7 fix: duplicate with select hasMany fields (#8734)
Fixes https://github.com/payloadcms/payload/issues/6522 by not sending
`id` of the _current_ document to the `post` / `patch` payload. It
caused issues with Postgres and select `hasMany: true`
2024-10-17 16:31:39 -04:00
Elliot DeNolf
4077598777 chore(release): richtext-lexical/0.11.4 [skip ci] 2024-10-17 09:18:09 -04:00
Elliot DeNolf
65d7d54ba3 chore(release): db-postgres/0.8.8 [skip ci] 2024-10-17 09:17:59 -04:00
Elliot DeNolf
6690c37c4e chore(release): payload/2.30.2 [skip ci] 2024-10-17 09:16:23 -04:00
Sasha
0efc610210 fix(db-postgres): select hasMany nested to array + tab/group (#8739) 2024-10-16 21:57:44 -04:00
Jarrod Flesch
cc99c3a619 chore: improves getLatestCollectionVersion where constraints (#8747) 2024-10-16 14:12:38 -04:00
Elliot DeNolf
24a8dc7aa3 ci: disable nissuer until can be reworked 2024-10-16 09:04:24 -04:00
Elliot DeNolf
90764efa9a ci: auto-close issues without repro, auto-label (#8725)
Implement Nissuer to auto-close issues without valid reproduction and
auto-label based upon selections.

**NOTE:** This does not exempt Payload team members from having a valid
reproduction link.
2024-10-15 23:37:24 -04:00
Sasha
d05e3b0411 fix(db-postgres): build indexes for relationships (#8446)
Fixes https://github.com/payloadcms/payload/issues/8413 for 2.0, builds
indexes for `_rels` tables by default.
Does not port `unique: true` from
https://github.com/payloadcms/payload/pull/8432 because could be a
breaking change if someone has incosistent unique data in the database.
2024-10-10 15:26:54 -04:00
Germán Jabloñski
e4bc281fc2 chore: add instructions to run the examples to the readme (#8622) 2024-10-10 09:50:36 -04:00
Patrik
9d05b82dc6 fix: calculates correct aspect ratio dimensions on sharp based files (#8510)
Fixes #8317 

Sharp based images are auto-oriented based on the EXIF data i.e.
`.rotate()`.

This can be problematic when resizing images as the
`originalAspectRatio` calculation we do in the `imageResizer` can become
incorrect if the files dimensions are rotated from sharp.

For example, uploading an `ios` based image with dimensions of 3024 x
4032 will be auto rotated to 4032 x 3024 because the exif data gives the
image an orientation of `6` - which means it needs to be rotated 90
degrees clockwise.

As a result, the original aspect ratio goes from being `0.75` to
`1.3333` - which is incorrect.

This PR preserves the original aspect ratio to properly resize images
based on the original dimensions - not the sharp based dimensions.
2024-10-08 14:45:07 -04:00
Patrik
f2284f3d1b fix: applies resize after cropping if resizeOptions are defined (#8535)
V3 PR [here](https://github.com/payloadcms/payload/pull/8528)
2024-10-08 14:42:10 -04:00
Sasha
1347b6cc36 fix(db-postgres): port many various fixes from 3.0 (#8468)
This fixes many various issues that are already fixed in 3.0. Updates
Drizzle to match beta to fix some issues
https://github.com/payloadcms/payload/issues/4673
https://github.com/payloadcms/payload/issues/6845
https://github.com/payloadcms/payload/issues/6266, prev Drizzle update
PR https://github.com/payloadcms/payload/pull/7460/

Ported PRs:
- https://github.com/payloadcms/payload/pull/6158
- https://github.com/payloadcms/payload/pull/7900
- https://github.com/payloadcms/payload/pull/7962 (does include
duplication fixes for blocks / arrays with specific for 2.0 method)
- https://github.com/payloadcms/payload/pull/8355
- https://github.com/payloadcms/payload/pull/8456
- https://github.com/payloadcms/payload/pull/8331 (not in the commits
list, as it was a clean merge)
- https://github.com/payloadcms/payload/pull/8369
- https://github.com/payloadcms/payload/pull/7749
- https://github.com/payloadcms/payload/pull/8539

---------

Co-authored-by: Dan Ribbens <dan.ribbens@gmail.com>
Co-authored-by: James Mikrut <james@payloadcms.com>
2024-10-08 10:57:42 -04:00
Elliot DeNolf
0a56d50334 chore(release): plugin-cloud-storage/1.2.0 [skip ci] 2024-10-08 10:54:04 -04:00
Dan Ribbens
02999a5659 feat(plugin-cloud-storage): add credentials to connect to azure (#7781)
Co-authored-by: Elliot DeNolf <denolfe@gmail.com>
2024-10-08 10:43:59 -04:00
Patrik
365127bee4 docs: clarifies distinction between official and community plugins in docs (#8584)
Updated the plugins overview page to better differentiate between
official Payload plugins and community plugins.

Clarified that only official plugins are maintained and supported by the
Payload team, while community plugins may have varying levels of
support.
2024-10-07 12:24:49 -04:00
Patrik
b67e97aa7f docs: specifies defaultLocale as a required property for localization (#8586) 2024-10-07 12:07:15 -04:00
Thomas Mills
61e8ce1743 fix(richtext-lexical): add target _blank for new-tab in linkFeature (#8571)
FIxes #8569 

Matches the fixes in commit 23df60dba5
(plugin-form-builder) and e0b201c810 (v3)

Adds target="_blank" where the link should be in a new tab
2024-10-06 23:17:24 -03:00
Chris Bailey
034aa68cd4 docs: fixes typo in website template README (#8565) 2024-10-06 21:32:51 -04:00
Elliot DeNolf
268e6c485e chore(release): db-mongodb/1.7.3 [skip ci] 2024-10-01 23:21:47 -04:00
Elliot DeNolf
4c1a5dca44 chore(release): payload/2.30.1 [skip ci] 2024-10-01 23:20:20 -04:00
dependabot[bot]
a12d1f4755 chore(deps): bump the production-deps group with 16 updates (#8492)
Bumps the production-deps group with 16 updates:

| Package | From | To |
| --- | --- | --- |
| [postcss](https://github.com/postcss/postcss) | `8.4.31` | `8.4.47` |
| [swc-loader](https://github.com/swc-project/pkgs) | `0.2.3` | `0.2.6`
|
|
[swc-minify-webpack-plugin](https://github.com/guoyunhe/swc-minify-webpack-plugin)
| `2.1.2` | `2.1.3` |
|
[terser-webpack-plugin](https://github.com/webpack-contrib/terser-webpack-plugin)
| `5.3.9` | `5.3.10` |
|
[eslint-plugin-react-hooks](https://github.com/facebook/react/tree/HEAD/packages/eslint-plugin-react-hooks)
| `4.6.0` | `4.6.2` |
| [@faceless-ui/modal](https://github.com/faceless-ui/modal) | `2.0.1` |
`2.0.2` |
| [@faceless-ui/window-info](https://github.com/faceless-ui/window-info)
| `2.1.1` | `2.1.2` |
| [body-parser](https://github.com/expressjs/body-parser) | `1.20.2` |
`1.20.3` |
|
[@types/body-parser](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/body-parser)
| `1.19.2` | `1.19.5` |
| [deep-equal](https://github.com/inspect-js/node-deep-equal) | `2.2.2`
| `2.2.3` |
| [jsonwebtoken](https://github.com/auth0/node-jsonwebtoken) | `9.0.1` |
`9.0.2` |
|
[@types/jsonwebtoken](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/jsonwebtoken)
| `8.5.9` | `9.0.7` |
| [nodemailer](https://github.com/nodemailer/nodemailer) | `6.9.9` |
`6.9.15` |
|
[@types/nodemailer](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/nodemailer)
| `6.4.14` | `6.4.16` |
|
[scheduler](https://github.com/facebook/react/tree/HEAD/packages/scheduler)
| `0.23.0` | `0.23.2` |
|
[react-error-boundary](https://github.com/bvaughn/react-error-boundary)
| `4.0.12` | `4.0.13` |

Updates `postcss` from 8.4.31 to 8.4.47
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/postcss/postcss/releases">postcss's
releases</a>.</em></p>
<blockquote>
<h2>8.4.47</h2>
<ul>
<li>Removed debug code.</li>
</ul>
<h2>8.4.46</h2>
<ul>
<li>Fixed <code>Cannot read properties of undefined (reading
'before')</code>.</li>
</ul>
<h2>8.4.45</h2>
<ul>
<li>Removed unnecessary fix which could lead to infinite loop.</li>
</ul>
<h2>8.4.44</h2>
<ul>
<li>Another way to fix <code>markClean is not a function</code>
error.</li>
</ul>
<h2>8.4.43</h2>
<ul>
<li>Fixed <code>markClean is not a function</code> error.</li>
</ul>
<h2>8.4.42</h2>
<ul>
<li>Fixed CSS syntax error on long minified files (by <a
href="https://github.com/varpstar"><code>@​varpstar</code></a>).</li>
</ul>
<h2>8.4.41</h2>
<ul>
<li>Fixed types (by <a
href="https://github.com/nex3"><code>@​nex3</code></a> and <a
href="https://github.com/querkmachine"><code>@​querkmachine</code></a>).</li>
<li>Cleaned up RegExps (by <a
href="https://github.com/bluwy"><code>@​bluwy</code></a>).</li>
</ul>
<h2>8.4.40</h2>
<ul>
<li>Moved to getter/setter in nodes types to help Sass team (by <a
href="https://github.com/nex3"><code>@​nex3</code></a>).</li>
</ul>
<h2>8.4.39</h2>
<ul>
<li>Fixed <code>CssSyntaxError</code> types (by <a
href="https://github.com/romainmenke"><code>@​romainmenke</code></a>).</li>
</ul>
<h2>8.4.38</h2>
<ul>
<li>Fixed <code>endIndex: 0</code> in errors and warnings (by <a
href="https://github.com/romainmenke"><code>@​romainmenke</code></a>).</li>
</ul>
<h2>8.4.37</h2>
<ul>
<li>Fixed <code>original.column are not numbers</code> error in another
case.</li>
</ul>
<h2>8.4.36</h2>
<ul>
<li>Fixed <code>original.column are not numbers</code> error on broken
previous source map.</li>
</ul>
<h2>8.4.35</h2>
<ul>
<li>Avoid <code>!</code> in <code>node.parent.nodes</code> type.</li>
<li>Allow to pass <code>undefined</code> to node adding method to
simplify types.</li>
</ul>
<h2>8.4.34</h2>
<ul>
<li>Fixed <code>AtRule#nodes</code> type (by <a
href="https://github.com/tim-we"><code>@​tim-we</code></a>).</li>
<li>Cleaned up code (by <a
href="https://github.com/DrKiraDmitry"><code>@​DrKiraDmitry</code></a>).</li>
</ul>
<h2>8.4.33</h2>
<ul>
<li>Fixed <code>NoWorkResult</code> behavior difference with normal mode
(by <a
href="https://github.com/romainmenke"><code>@​romainmenke</code></a>).</li>
<li>Fixed <code>NoWorkResult</code> usage conditions (by <a
href="https://github.com/ahmdammarr"><code>@​ahmdammarr</code></a>).</li>
</ul>
<h2>8.4.32</h2>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/postcss/postcss/blob/main/CHANGELOG.md">postcss's
changelog</a>.</em></p>
<blockquote>
<h2>8.4.47</h2>
<ul>
<li>Removed debug code.</li>
</ul>
<h2>8.4.46</h2>
<ul>
<li>Fixed <code>Cannot read properties of undefined (reading
'before')</code>.</li>
</ul>
<h2>8.4.45</h2>
<ul>
<li>Removed unnecessary fix which could lead to infinite loop.</li>
</ul>
<h2>8.4.44</h2>
<ul>
<li>Another way to fix <code>markClean is not a function</code>
error.</li>
</ul>
<h2>8.4.43</h2>
<ul>
<li>Fixed <code>markClean is not a function</code> error.</li>
</ul>
<h2>8.4.42</h2>
<ul>
<li>Fixed CSS syntax error on long minified files (by <a
href="https://github.com/varpstar"><code>@​varpstar</code></a>).</li>
</ul>
<h2>8.4.41</h2>
<ul>
<li>Fixed types (by <a
href="https://github.com/nex3"><code>@​nex3</code></a> and <a
href="https://github.com/querkmachine"><code>@​querkmachine</code></a>).</li>
<li>Cleaned up RegExps (by <a
href="https://github.com/bluwy"><code>@​bluwy</code></a>).</li>
</ul>
<h2>8.4.40</h2>
<ul>
<li>Moved to getter/setter in nodes types to help Sass team (by <a
href="https://github.com/nex3"><code>@​nex3</code></a>).</li>
</ul>
<h2>8.4.39</h2>
<ul>
<li>Fixed <code>CssSyntaxError</code> types (by <a
href="https://github.com/romainmenke"><code>@​romainmenke</code></a>).</li>
</ul>
<h2>8.4.38</h2>
<ul>
<li>Fixed <code>endIndex: 0</code> in errors and warnings (by <a
href="https://github.com/romainmenke"><code>@​romainmenke</code></a>).</li>
</ul>
<h2>8.4.37</h2>
<ul>
<li>Fixed <code>original.column are not numbers</code> error in another
case.</li>
</ul>
<h2>8.4.36</h2>
<ul>
<li>Fixed <code>original.column are not numbers</code> error on broken
previous source map.</li>
</ul>
<h2>8.4.35</h2>
<ul>
<li>Avoid <code>!</code> in <code>node.parent.nodes</code> type.</li>
<li>Allow to pass <code>undefined</code> to node adding method to
simplify types.</li>
</ul>
<h2>8.4.34</h2>
<ul>
<li>Fixed <code>AtRule#nodes</code> type (by Tim Weißenfels).</li>
<li>Cleaned up code (by Dmitry Kirillov).</li>
</ul>
<h2>8.4.33</h2>
<ul>
<li>Fixed <code>NoWorkResult</code> behavior difference with normal mode
(by Romain Menke).</li>
<li>Fixed <code>NoWorkResult</code> usage conditions (by <a
href="https://github.com/ahmdammarr"><code>@​ahmdammarr</code></a>).</li>
</ul>
<h2>8.4.32</h2>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="5e6fd1302d"><code>5e6fd13</code></a>
Release 8.4.47 version</li>
<li><a
href="714bc10258"><code>714bc10</code></a>
Typo</li>
<li><a
href="439d20e651"><code>439d20e</code></a>
Release 8.4.46 version</li>
<li><a
href="b93582f68e"><code>b93582f</code></a>
Update dependencies</li>
<li><a
href="c51e46767d"><code>c51e467</code></a>
Fix error on inserting node without raws in some cases</li>
<li><a
href="829ae47d6b"><code>829ae47</code></a>
Update dependencies</li>
<li><a
href="5aaaec2214"><code>5aaaec2</code></a>
Update remaining workflow jobs to use latest version of actions (<a
href="https://redirect.github.com/postcss/postcss/issues/1968">#1968</a>)</li>
<li><a
href="448c4f34d6"><code>448c4f3</code></a>
Release 8.4.45 version</li>
<li><a
href="1c77d2e333"><code>1c77d2e</code></a>
Update unnecessary check</li>
<li><a
href="f38b329323"><code>f38b329</code></a>
Try to fix CI</li>
<li>Additional commits viewable in <a
href="https://github.com/postcss/postcss/compare/8.4.31...8.4.47">compare
view</a></li>
</ul>
</details>
<br />

Updates `swc-loader` from 0.2.3 to 0.2.6
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/swc-project/pkgs/commits">compare view</a></li>
</ul>
</details>
<br />

Updates `swc-minify-webpack-plugin` from 2.1.2 to 2.1.3
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/guoyunhe/swc-minify-webpack-plugin/releases">swc-minify-webpack-plugin's
releases</a>.</em></p>
<blockquote>
<h2>2.1.3</h2>
<ul>
<li>Fixed Buffer data handling</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/guoyunhe/swc-minify-webpack-plugin/blob/main/CHANGELOG.md">swc-minify-webpack-plugin's
changelog</a>.</em></p>
<blockquote>
<h2>2.1.3 - 2024-08-22</h2>
<ul>
<li>Fixed Buffer data handling</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="83ad732d1a"><code>83ad732</code></a>
2.1.3</li>
<li><a
href="d59a7963a6"><code>d59a796</code></a>
changelog</li>
<li><a
href="1a2cea1a82"><code>1a2cea1</code></a>
Merge pull request <a
href="https://redirect.github.com/guoyunhe/swc-minify-webpack-plugin/issues/12">#12</a>
from martinjlowm/fix/pass-string-to-swc</li>
<li><a
href="60e294f610"><code>60e294f</code></a>
Ensure a string is passed to SWC</li>
<li>See full diff in <a
href="https://github.com/guoyunhe/swc-minify-webpack-plugin/compare/v2.1.2...v2.1.3">compare
view</a></li>
</ul>
</details>
<br />

Updates `terser-webpack-plugin` from 5.3.9 to 5.3.10
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/webpack-contrib/terser-webpack-plugin/releases">terser-webpack-plugin's
releases</a>.</em></p>
<blockquote>
<h2>v5.3.10</h2>
<h3><a
href="https://github.com/webpack-contrib/terser-webpack-plugin/compare/v5.3.9...v5.3.10">5.3.10</a>
(2023-12-28)</h3>
<h3>Bug Fixes</h3>
<ul>
<li>bump terser to the latest stable version (<a
href="https://redirect.github.com/webpack-contrib/terser-webpack-plugin/issues/587">#587</a>)
(<a
href="f650fa3ca7">f650fa3</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/webpack-contrib/terser-webpack-plugin/blob/master/CHANGELOG.md">terser-webpack-plugin's
changelog</a>.</em></p>
<blockquote>
<h3><a
href="https://github.com/webpack-contrib/terser-webpack-plugin/compare/v5.3.9...v5.3.10">5.3.10</a>
(2023-12-28)</h3>
<h3>Bug Fixes</h3>
<ul>
<li>bump terser to the latest stable version (<a
href="https://redirect.github.com/webpack-contrib/terser-webpack-plugin/issues/587">#587</a>)
(<a
href="f650fa3ca7">f650fa3</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="c87ade2a08"><code>c87ade2</code></a>
chore(release): 5.3.10</li>
<li><a
href="f650fa3ca7"><code>f650fa3</code></a>
fix: bump terser to the latest stable version (<a
href="https://redirect.github.com/webpack-contrib/terser-webpack-plugin/issues/587">#587</a>)</li>
<li><a
href="0403c772ef"><code>0403c77</code></a>
chore(deps-dev): bump <code>@​babel/traverse</code> from 7.22.17 to
7.23.6 (<a
href="https://redirect.github.com/webpack-contrib/terser-webpack-plugin/issues/586">#586</a>)</li>
<li><a
href="174d197ba8"><code>174d197</code></a>
chore: update dependencies to the latest version (<a
href="https://redirect.github.com/webpack-contrib/terser-webpack-plugin/issues/577">#577</a>)</li>
<li><a
href="1831a49183"><code>1831a49</code></a>
chore: update github action/setup-node (<a
href="https://redirect.github.com/webpack-contrib/terser-webpack-plugin/issues/584">#584</a>)</li>
<li><a
href="25d014707a"><code>25d0147</code></a>
chore: update github actions/checkout (<a
href="https://redirect.github.com/webpack-contrib/terser-webpack-plugin/issues/576">#576</a>)</li>
<li><a
href="fa86955aeb"><code>fa86955</code></a>
chore(deps-dev): bump word-wrap from 1.2.3 to 1.2.5 (<a
href="https://redirect.github.com/webpack-contrib/terser-webpack-plugin/issues/575">#575</a>)</li>
<li><a
href="086767314b"><code>0867673</code></a>
chore: update dependencies to the latest version (<a
href="https://redirect.github.com/webpack-contrib/terser-webpack-plugin/issues/574">#574</a>)</li>
<li><a
href="b8cfb07910"><code>b8cfb07</code></a>
chore: upgrade dependencies to the latest version (<a
href="https://redirect.github.com/webpack-contrib/terser-webpack-plugin/issues/572">#572</a>)</li>
<li><a
href="ce5a518fb0"><code>ce5a518</code></a>
refactor: code (<a
href="https://redirect.github.com/webpack-contrib/terser-webpack-plugin/issues/569">#569</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/webpack-contrib/terser-webpack-plugin/compare/v5.3.9...v5.3.10">compare
view</a></li>
</ul>
</details>
<br />

Updates `eslint-plugin-react-hooks` from 4.6.0 to 4.6.2
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/facebook/react/blob/main/packages/eslint-plugin-react-hooks/CHANGELOG.md">eslint-plugin-react-hooks's
changelog</a>.</em></p>
<blockquote>
<h2>5.0.0 (next release)</h2>
<ul>
<li><strong>New Violations:</strong> Component names now need to start
with an uppercase letter instead of a non-lowercase letter. This means
<code>_Button</code> or <code>_component</code> are no longer valid. (<a
href="https://github.com/kassens"><code>@​kassens</code></a>) in <a
href="https://redirect.github.com/facebook/react/pull/25162">#25162</a></li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/facebook/react/commits/HEAD/packages/eslint-plugin-react-hooks">compare
view</a></li>
</ul>
</details>
<details>
<summary>Maintainer changes</summary>
<p>This version was pushed to npm by <a
href="https://www.npmjs.com/~react-bot">react-bot</a>, a new releaser
for eslint-plugin-react-hooks since your current version.</p>
</details>
<br />

Updates `@faceless-ui/modal` from 2.0.1 to 2.0.2
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/faceless-ui/modal/releases"><code>@​faceless-ui/modal</code>'s
releases</a>.</em></p>
<blockquote>
<h2>v2.0.2</h2>
<h2>What's Changed</h2>
<ul>
<li>chore: adds use client directive by <a
href="https://github.com/jacobsfletch"><code>@​jacobsfletch</code></a>
in <a
href="https://redirect.github.com/faceless-ui/modal/pull/54">faceless-ui/modal#54</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/faceless-ui/modal/compare/v2.0.1...v2.0.2">https://github.com/faceless-ui/modal/compare/v2.0.1...v2.0.2</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="64d66fb950"><code>64d66fb</code></a>
chore: adds use client directive (<a
href="https://redirect.github.com/faceless-ui/modal/issues/54">#54</a>)</li>
<li>See full diff in <a
href="https://github.com/faceless-ui/modal/compare/v2.0.1...v2.0.2">compare
view</a></li>
</ul>
</details>
<br />

Updates `@faceless-ui/window-info` from 2.1.1 to 2.1.2
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/faceless-ui/window-info/releases"><code>@​faceless-ui/window-info</code>'s
releases</a>.</em></p>
<blockquote>
<h2>v2.1.2</h2>
<h2>What's Changed</h2>
<ul>
<li>chore: adds use client directive by <a
href="https://github.com/jacobsfletch"><code>@​jacobsfletch</code></a>
in <a
href="https://redirect.github.com/faceless-ui/window-info/pull/28">faceless-ui/window-info#28</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/faceless-ui/window-info/compare/v2.1.1...v2.1.2">https://github.com/faceless-ui/window-info/compare/v2.1.1...v2.1.2</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="89eba57c5f"><code>89eba57</code></a>
2.1.2</li>
<li><a
href="caa30698f5"><code>caa3069</code></a>
chore: adds use client directive (<a
href="https://redirect.github.com/faceless-ui/window-info/issues/28">#28</a>)</li>
<li>See full diff in <a
href="https://github.com/faceless-ui/window-info/compare/v2.1.1...v2.1.2">compare
view</a></li>
</ul>
</details>
<br />

Updates `body-parser` from 1.20.2 to 1.20.3
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/expressjs/body-parser/releases">body-parser's
releases</a>.</em></p>
<blockquote>
<h2>1.20.3</h2>
<h2>What's Changed</h2>
<h3>Important</h3>
<ul>
<li>deps: qs@6.13.0</li>
<li>add <code>depth</code> option to customize the depth level in the
parser</li>
<li><strong>IMPORTANT:</strong> The default <code>depth</code> level for
parsing URL-encoded data is now <code>32</code> (previously was
<code>Infinity</code>). <a
href="1752951367/README.md (depth)">Documentation</a></li>
</ul>
<h3>Other changes</h3>
<ul>
<li>chore: add support for OSSF scorecard reporting by <a
href="https://github.com/inigomarquinez"><code>@​inigomarquinez</code></a>
in <a
href="https://redirect.github.com/expressjs/body-parser/pull/522">expressjs/body-parser#522</a></li>
<li>ci: fix errors in ci github action for node 8 and 9 by <a
href="https://github.com/inigomarquinez"><code>@​inigomarquinez</code></a>
in <a
href="https://redirect.github.com/expressjs/body-parser/pull/523">expressjs/body-parser#523</a></li>
<li>fix: pin to node@22.4.1 by <a
href="https://github.com/wesleytodd"><code>@​wesleytodd</code></a> in <a
href="https://redirect.github.com/expressjs/body-parser/pull/527">expressjs/body-parser#527</a></li>
<li>deps: qs@6.12.3 by <a
href="https://github.com/melikhov-dev"><code>@​melikhov-dev</code></a>
in <a
href="https://redirect.github.com/expressjs/body-parser/pull/521">expressjs/body-parser#521</a></li>
<li>Add OSSF Scorecard badge by <a
href="https://github.com/bjohansebas"><code>@​bjohansebas</code></a> in
<a
href="https://redirect.github.com/expressjs/body-parser/pull/531">expressjs/body-parser#531</a></li>
<li>Linter by <a
href="https://github.com/UlisesGascon"><code>@​UlisesGascon</code></a>
in <a
href="https://redirect.github.com/expressjs/body-parser/pull/534">expressjs/body-parser#534</a></li>
<li>Release: 1.20.3 by <a
href="https://github.com/UlisesGascon"><code>@​UlisesGascon</code></a>
in <a
href="https://redirect.github.com/expressjs/body-parser/pull/535">expressjs/body-parser#535</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a
href="https://github.com/inigomarquinez"><code>@​inigomarquinez</code></a>
made their first contribution in <a
href="https://redirect.github.com/expressjs/body-parser/pull/522">expressjs/body-parser#522</a></li>
<li><a
href="https://github.com/melikhov-dev"><code>@​melikhov-dev</code></a>
made their first contribution in <a
href="https://redirect.github.com/expressjs/body-parser/pull/521">expressjs/body-parser#521</a></li>
<li><a
href="https://github.com/bjohansebas"><code>@​bjohansebas</code></a>
made their first contribution in <a
href="https://redirect.github.com/expressjs/body-parser/pull/531">expressjs/body-parser#531</a></li>
<li><a
href="https://github.com/UlisesGascon"><code>@​UlisesGascon</code></a>
made their first contribution in <a
href="https://redirect.github.com/expressjs/body-parser/pull/534">expressjs/body-parser#534</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/expressjs/body-parser/compare/1.20.2...1.20.3">https://github.com/expressjs/body-parser/compare/1.20.2...1.20.3</a></p>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/expressjs/body-parser/blob/master/HISTORY.md">body-parser's
changelog</a>.</em></p>
<blockquote>
<h1>1.20.3 / 2024-09-10</h1>
<ul>
<li>deps: qs@6.13.0</li>
<li>add <code>depth</code> option to customize the depth level in the
parser</li>
<li>IMPORTANT: The default <code>depth</code> level for parsing
URL-encoded data is now <code>32</code> (previously was
<code>Infinity</code>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="1752951367"><code>1752951</code></a>
1.20.3</li>
<li><a
href="39744cfe2a"><code>39744cf</code></a>
chore: linter (<a
href="https://redirect.github.com/expressjs/body-parser/issues/534">#534</a>)</li>
<li><a
href="b2695c4450"><code>b2695c4</code></a>
Merge commit from fork</li>
<li><a
href="ade0f3f82f"><code>ade0f3f</code></a>
add scorecard to readme (<a
href="https://redirect.github.com/expressjs/body-parser/issues/531">#531</a>)</li>
<li><a
href="99a1bd6245"><code>99a1bd6</code></a>
deps: qs@6.12.3 (<a
href="https://redirect.github.com/expressjs/body-parser/issues/521">#521</a>)</li>
<li><a
href="9478591605"><code>9478591</code></a>
fix: pin to node@22.4.1</li>
<li><a
href="83db46a1e5"><code>83db46a</code></a>
ci: fix errors in ci github action for node 8 and 9 (<a
href="https://redirect.github.com/expressjs/body-parser/issues/523">#523</a>)</li>
<li><a
href="9d4e2125b5"><code>9d4e212</code></a>
chore: add support for OSSF scorecard reporting (<a
href="https://redirect.github.com/expressjs/body-parser/issues/522">#522</a>)</li>
<li>See full diff in <a
href="https://github.com/expressjs/body-parser/compare/1.20.2...1.20.3">compare
view</a></li>
</ul>
</details>
<details>
<summary>Maintainer changes</summary>
<p>This version was pushed to npm by <a
href="https://www.npmjs.com/~ulisesgascon">ulisesgascon</a>, a new
releaser for body-parser since your current version.</p>
</details>
<br />

Updates `@types/body-parser` from 1.19.2 to 1.19.5
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/body-parser">compare
view</a></li>
</ul>
</details>
<br />

Updates `deep-equal` from 2.2.2 to 2.2.3
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/inspect-js/node-deep-equal/blob/main/CHANGELOG.md">deep-equal's
changelog</a>.</em></p>
<blockquote>
<h2><a
href="https://github.com/inspect-js/node-deep-equal/compare/v2.2.2...v2.2.3">v2.2.3</a>
- 2023-11-08</h2>
<h3>Fixed</h3>
<ul>
<li>[readme] remove performance comment and highlight robustness instead
<a
href="https://redirect.github.com/inspect-js/node-deep-equal/issues/76"><code>[#76](https://github.com/inspect-js/node-deep-equal/issues/76)</code></a>
<a
href="https://redirect.github.com/inspect-js/node-deep-equal/issues/106"><code>[#106](https://github.com/inspect-js/node-deep-equal/issues/106)</code></a></li>
</ul>
<h3>Commits</h3>
<ul>
<li>Merge tag 'v1.1.2' <a
href="c90525fe83"><code>c90525f</code></a></li>
<li>[Tests] port tests from main; only diff should be true/falses <a
href="e02cadb650"><code>e02cadb</code></a></li>
<li>[Dev Deps] update <code>@ljharb/eslint-config</code>,
<code>auto-changelog</code>, <code>aud</code>, <code>eslint</code>,
<code>set-publish-latest</code>, <code>tape</code> <a
href="11bd45b639"><code>11bd45b</code></a></li>
<li>[Tests] update <code>.github</code> from default branch <a
href="58885d3280"><code>58885d3</code></a></li>
<li>[readme] update readme from default branch <a
href="b0bca9a115"><code>b0bca9a</code></a></li>
<li>[Tests] add <code>nyc</code> for coverage <a
href="e25bc3716c"><code>e25bc37</code></a></li>
<li>[readme] update badge URLs, fix line breaking <a
href="1d58c6ecba"><code>1d58c6e</code></a></li>
<li>[Tests] use <code>Buffer.from</code> when available <a
href="f0d4a42fb8"><code>f0d4a42</code></a></li>
<li>[Tests] use <code>has-proto</code> <a
href="0263fb9170"><code>0263fb9</code></a></li>
<li>[Deps] update <code>is-arguments</code>,
<code>is-date-object</code>, <code>is-regex</code>,
<code>object-is</code>, <code>regexp.prototype.flags</code> <a
href="80c15cae82"><code>80c15ca</code></a></li>
<li>[meta] add missing <code>engines.node</code> <a
href="e1d08a818f"><code>e1d08a8</code></a></li>
<li>[meta] use <code>npmignore</code> to autogenerate an npmignore file
<a
href="e0770e594e"><code>e0770e5</code></a></li>
<li>[Deps] update <code>is-date-object</code>, <code>is-regex</code>,
<code>object-is</code>, <code>regexp.prototype.flags</code> <a
href="e4fb8c6459"><code>e4fb8c6</code></a></li>
<li>[Tests] handle ported test failures in iojs v2 <a
href="3798ff4902"><code>3798ff4</code></a></li>
<li>[Deps] update <code>call-bind</code>,
<code>regexp.prototype.flags</code>, <code>which-typed-array</code> <a
href="540e3a119d"><code>540e3a1</code></a></li>
<li>[Dev Deps] update <code>eslint</code>,
<code>@ljharb/eslint-config</code>, <code>tape</code> <a
href="0f8ca7575e"><code>0f8ca75</code></a></li>
<li>[Tests] handle some additional test differences in node &lt;= 0.10
<a
href="197a2203f0"><code>197a220</code></a></li>
<li>[Dev Deps] update <code>object.getownpropertydescriptors</code>,
<code>tape</code> <a
href="21851a62cd"><code>21851a6</code></a></li>
<li>[Dev Deps] update <code>semver</code>, <code>tape</code> <a
href="dd440b2267"><code>dd440b2</code></a></li>
<li>[meta] add missing <code>engines.node</code> <a
href="e158993fcf"><code>e158993</code></a></li>
<li>[meta] update <code>.gitignore</code> from default branch <a
href="6ee186bd39"><code>6ee186b</code></a></li>
<li>[Deps] update <code>get-intrinsic</code> <a
href="6da4b86e4d"><code>6da4b86</code></a></li>
<li>[Dev Deps] update <code>tape</code> <a
href="6ada1ab7f9"><code>6ada1ab</code></a></li>
<li>[Dev Deps] update <code>tape</code> <a
href="270d34b484"><code>270d34b</code></a></li>
<li>[meta] fix URLs <a
href="a269c183bc"><code>a269c18</code></a></li>
<li>[readme] update default branch name <a
href="030a63f40a"><code>030a63f</code></a></li>
<li>[Deps] update <code>which-typed-array</code> <a
href="2f0c327eaa"><code>2f0c327</code></a></li>
<li>[Tests] only use <code>Buffer.from</code> when it has a length of
&gt; 1 <a
href="f7e577622d"><code>f7e5776</code></a></li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="48d3bb5b7f"><code>48d3bb5</code></a>
v2.2.3</li>
<li><a
href="c90525fe83"><code>c90525f</code></a>
Merge tag 'v1.1.2'</li>
<li><a
href="be5f0362c9"><code>be5f036</code></a>
v1.1.2</li>
<li><a
href="197a2203f0"><code>197a220</code></a>
[Tests] handle some additional test differences in node &lt;= 0.10</li>
<li><a
href="e1d08a818f"><code>e1d08a8</code></a>
[meta] add missing <code>engines.node</code></li>
<li><a
href="e158993fcf"><code>e158993</code></a>
[meta] add missing <code>engines.node</code></li>
<li><a
href="3798ff4902"><code>3798ff4</code></a>
[Tests] handle ported test failures in iojs v2</li>
<li><a
href="6da4b86e4d"><code>6da4b86</code></a>
[Deps] update <code>get-intrinsic</code></li>
<li><a
href="6ada1ab7f9"><code>6ada1ab</code></a>
[Dev Deps] update <code>tape</code></li>
<li><a
href="e02cadb650"><code>e02cadb</code></a>
[Tests] port tests from main; only diff should be true/falses</li>
<li>Additional commits viewable in <a
href="https://github.com/inspect-js/node-deep-equal/compare/v2.2.2...v2.2.3">compare
view</a></li>
</ul>
</details>
<br />

Updates `jsonwebtoken` from 9.0.1 to 9.0.2
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/auth0/node-jsonwebtoken/blob/master/CHANGELOG.md">jsonwebtoken's
changelog</a>.</em></p>
<blockquote>
<h2>9.0.2 - 2023-08-30</h2>
<ul>
<li>security: updating semver to 7.5.4 to resolve CVE-2022-25883, closes
<a
href="https://redirect.github.com/auth0/node-jsonwebtoken/issues/921">#921</a>.</li>
<li>refactor: reduce library size by using lodash specific dependencies,
closes <a
href="https://redirect.github.com/auth0/node-jsonwebtoken/issues/878">#878</a>.</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="bc28861f1f"><code>bc28861</code></a>
Release 9.0.2 (<a
href="https://redirect.github.com/auth0/node-jsonwebtoken/issues/935">#935</a>)</li>
<li><a
href="96b89060cf"><code>96b8906</code></a>
refactor: use specific lodash packages (<a
href="https://redirect.github.com/auth0/node-jsonwebtoken/issues/933">#933</a>)</li>
<li><a
href="ed35062239"><code>ed35062</code></a>
security: Updating semver to 7.5.4 to resolve CVE-2022-25883 (<a
href="https://redirect.github.com/auth0/node-jsonwebtoken/issues/932">#932</a>)</li>
<li>See full diff in <a
href="https://github.com/auth0/node-jsonwebtoken/compare/v9.0.1...v9.0.2">compare
view</a></li>
</ul>
</details>
<details>
<summary>Maintainer changes</summary>
<p>This version was pushed to npm by <a
href="https://www.npmjs.com/~charlesrea">charlesrea</a>, a new releaser
for jsonwebtoken since your current version.</p>
</details>
<br />

Updates `@types/jsonwebtoken` from 8.5.9 to 9.0.7
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/jsonwebtoken">compare
view</a></li>
</ul>
</details>
<br />

Updates `nodemailer` from 6.9.9 to 6.9.15
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/nodemailer/nodemailer/releases">nodemailer's
releases</a>.</em></p>
<blockquote>
<h2>v6.9.15</h2>
<h2><a
href="https://github.com/nodemailer/nodemailer/compare/v6.9.14...v6.9.15">6.9.15</a>
(2024-08-08)</h2>
<h3>Bug Fixes</h3>
<ul>
<li>Fix memory leak (<a
href="https://redirect.github.com/nodemailer/nodemailer/issues/1667">#1667</a>)
(<a
href="baa28f6596">baa28f6</a>)</li>
<li><strong>mime:</strong> Added GeoJSON closes <a
href="https://redirect.github.com/nodemailer/nodemailer/issues/1637">#1637</a>
(<a
href="https://redirect.github.com/nodemailer/nodemailer/issues/1665">#1665</a>)
(<a
href="79b8293ad5">79b8293</a>)</li>
</ul>
<h2>v6.9.14</h2>
<h2><a
href="https://github.com/nodemailer/nodemailer/compare/v6.9.13...v6.9.14">6.9.14</a>
(2024-06-19)</h2>
<h3>Bug Fixes</h3>
<ul>
<li><strong>api:</strong> Added support for Ethereal authentication (<a
href="56b22052a9">56b2205</a>)</li>
<li><strong>services.json:</strong> Add Email Services Provider Feishu
Mail (CN) (<a
href="https://redirect.github.com/nodemailer/nodemailer/issues/1648">#1648</a>)
(<a
href="e9e9ecc99b">e9e9ecc</a>)</li>
<li><strong>services.json:</strong> update Mailtrap host and port in
well known (<a
href="https://redirect.github.com/nodemailer/nodemailer/issues/1652">#1652</a>)
(<a
href="fc2c9ea0b4">fc2c9ea</a>)</li>
<li><strong>well-known-services:</strong> Add Loopia in well known
services (<a
href="https://redirect.github.com/nodemailer/nodemailer/issues/1655">#1655</a>)
(<a
href="21a28a18fc">21a28a1</a>)</li>
</ul>
<h2>v6.9.13</h2>
<h2><a
href="https://github.com/nodemailer/nodemailer/compare/v6.9.12...v6.9.13">6.9.13</a>
(2024-03-20)</h2>
<h3>Bug Fixes</h3>
<ul>
<li><strong>tls:</strong> Ensure servername for SMTP (<a
href="d66fdd3dcc">d66fdd3</a>)</li>
</ul>
<h2>v6.9.12</h2>
<h2><a
href="https://github.com/nodemailer/nodemailer/compare/v6.9.11...v6.9.12">6.9.12</a>
(2024-03-08)</h2>
<h3>Bug Fixes</h3>
<ul>
<li><strong>message-generation:</strong> Escape single quote in address
names (<a
href="4ae5fadeaa">4ae5fad</a>)</li>
</ul>
<h2>v6.9.11</h2>
<h2><a
href="https://github.com/nodemailer/nodemailer/compare/v6.9.10...v6.9.11">6.9.11</a>
(2024-02-29)</h2>
<h3>Bug Fixes</h3>
<ul>
<li><strong>headers:</strong> Ensure that Content-type is the bottom
header (<a
href="c7cf97e5ec">c7cf97e</a>)</li>
</ul>
<h2>v6.9.10</h2>
<h2><a
href="https://github.com/nodemailer/nodemailer/compare/v6.9.9...v6.9.10">6.9.10</a>
(2024-02-22)</h2>
<h3>Bug Fixes</h3>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/nodemailer/nodemailer/blob/master/CHANGELOG.md">nodemailer's
changelog</a>.</em></p>
<blockquote>
<h2><a
href="https://github.com/nodemailer/nodemailer/compare/v6.9.14...v6.9.15">6.9.15</a>
(2024-08-08)</h2>
<h3>Bug Fixes</h3>
<ul>
<li>Fix memory leak (<a
href="https://redirect.github.com/nodemailer/nodemailer/issues/1667">#1667</a>)
(<a
href="baa28f6596">baa28f6</a>)</li>
<li><strong>mime:</strong> Added GeoJSON closes <a
href="https://redirect.github.com/nodemailer/nodemailer/issues/1637">#1637</a>
(<a
href="https://redirect.github.com/nodemailer/nodemailer/issues/1665">#1665</a>)
(<a
href="79b8293ad5">79b8293</a>)</li>
</ul>
<h2><a
href="https://github.com/nodemailer/nodemailer/compare/v6.9.13...v6.9.14">6.9.14</a>
(2024-06-19)</h2>
<h3>Bug Fixes</h3>
<ul>
<li><strong>api:</strong> Added support for Ethereal authentication (<a
href="56b22052a9">56b2205</a>)</li>
<li><strong>services.json:</strong> Add Email Services Provider Feishu
Mail (CN) (<a
href="https://redirect.github.com/nodemailer/nodemailer/issues/1648">#1648</a>)
(<a
href="e9e9ecc99b">e9e9ecc</a>)</li>
<li><strong>services.json:</strong> update Mailtrap host and port in
well known (<a
href="https://redirect.github.com/nodemailer/nodemailer/issues/1652">#1652</a>)
(<a
href="fc2c9ea0b4">fc2c9ea</a>)</li>
<li><strong>well-known-services:</strong> Add Loopia in well known
services (<a
href="https://redirect.github.com/nodemailer/nodemailer/issues/1655">#1655</a>)
(<a
href="21a28a18fc">21a28a1</a>)</li>
</ul>
<h2><a
href="https://github.com/nodemailer/nodemailer/compare/v6.9.12...v6.9.13">6.9.13</a>
(2024-03-20)</h2>
<h3>Bug Fixes</h3>
<ul>
<li><strong>tls:</strong> Ensure servername for SMTP (<a
href="d66fdd3dcc">d66fdd3</a>)</li>
</ul>
<h2><a
href="https://github.com/nodemailer/nodemailer/compare/v6.9.11...v6.9.12">6.9.12</a>
(2024-03-08)</h2>
<h3>Bug Fixes</h3>
<ul>
<li><strong>message-generation:</strong> Escape single quote in address
names (<a
href="4ae5fadeaa">4ae5fad</a>)</li>
</ul>
<h2><a
href="https://github.com/nodemailer/nodemailer/compare/v6.9.10...v6.9.11">6.9.11</a>
(2024-02-29)</h2>
<h3>Bug Fixes</h3>
<ul>
<li><strong>headers:</strong> Ensure that Content-type is the bottom
header (<a
href="c7cf97e5ec">c7cf97e</a>)</li>
</ul>
<h2><a
href="https://github.com/nodemailer/nodemailer/compare/v6.9.9...v6.9.10">6.9.10</a>
(2024-02-22)</h2>
<h3>Bug Fixes</h3>
<ul>
<li><strong>data-uri:</strong> Do not use regular expressions for
parsing data URI schemes (<a
href="12e65e975d">12e65e9</a>)</li>
<li><strong>data-uri:</strong> Moved all data-uri regexes to use the
non-regex parseDataUri method (<a
href="edd5dfe5ce">edd5dfe</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="81de9ebaeb"><code>81de9eb</code></a>
chore(master): release 6.9.15 [skip-ci] (<a
href="https://redirect.github.com/nodemailer/nodemailer/issues/1668">#1668</a>)</li>
<li><a
href="79b8293ad5"><code>79b8293</code></a>
fix(mime): Added GeoJSON closes <a
href="https://redirect.github.com/nodemailer/nodemailer/issues/1637">#1637</a>
(<a
href="https://redirect.github.com/nodemailer/nodemailer/issues/1665">#1665</a>)</li>
<li><a
href="baa28f6596"><code>baa28f6</code></a>
fix: Fix memory leak (<a
href="https://redirect.github.com/nodemailer/nodemailer/issues/1667">#1667</a>)</li>
<li><a
href="f9a92ed5cb"><code>f9a92ed</code></a>
chore(master): release 6.9.14 [skip-ci] (<a
href="https://redirect.github.com/nodemailer/nodemailer/issues/1649">#1649</a>)</li>
<li><a
href="56b22052a9"><code>56b2205</code></a>
fix(api): Added support for Ethereal authentication</li>
<li><a
href="21a28a18fc"><code>21a28a1</code></a>
fix(well-known-services): Add Loopia in well known services (<a
href="https://redirect.github.com/nodemailer/nodemailer/issues/1655">#1655</a>)</li>
<li><a
href="fc2c9ea0b4"><code>fc2c9ea</code></a>
fix(services.json): update Mailtrap host and port in well known (<a
href="https://redirect.github.com/nodemailer/nodemailer/issues/1652">#1652</a>)</li>
<li><a
href="e9e9ecc99b"><code>e9e9ecc</code></a>
fix(services.json): Add Email Services Provider Feishu Mail (CN) (<a
href="https://redirect.github.com/nodemailer/nodemailer/issues/1648">#1648</a>)</li>
<li><a
href="fa63b52d8a"><code>fa63b52</code></a>
chore(master): release 6.9.13 [skip-ci] (<a
href="https://redirect.github.com/nodemailer/nodemailer/issues/1635">#1635</a>)</li>
<li><a
href="ea0d32f114"><code>ea0d32f</code></a>
Merge branch 'master' of github.com:nodemailer/nodemailer</li>
<li>Additional commits viewable in <a
href="https://github.com/nodemailer/nodemailer/compare/v6.9.9...v6.9.15">compare
view</a></li>
</ul>
</details>
<br />

Updates `@types/nodemailer` from 6.4.14 to 6.4.16
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/nodemailer">compare
view</a></li>
</ul>
</details>
<br />

Updates `scheduler` from 0.23.0 to 0.23.2
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/facebook/react/commits/HEAD/packages/scheduler">compare
view</a></li>
</ul>
</details>
<details>
<summary>Maintainer changes</summary>
<p>This version was pushed to npm by <a
href="https://www.npmjs.com/~react-bot">react-bot</a>, a new releaser
for scheduler since your current version.</p>
</details>
<br />

Updates `react-error-boundary` from 4.0.12 to 4.0.13
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/bvaughn/react-error-boundary/releases">react-error-boundary's
releases</a>.</em></p>
<blockquote>
<h2>4.0.13</h2>
<p>Removed references to ESLint config <code>kcd-scripts</code> from
<code>package.json</code></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="15f1ba2868"><code>15f1ba2</code></a>
Update README.md (<a
href="https://redirect.github.com/bvaughn/react-error-boundary/issues/180">#180</a>)</li>
<li><a
href="ed6d112ce8"><code>ed6d112</code></a>
ci(eslint): use eslint+prettier with ci strictly (<a
href="https://redirect.github.com/bvaughn/react-error-boundary/issues/165">#165</a>)</li>
<li>See full diff in <a
href="https://github.com/bvaughn/react-error-boundary/compare/4.0.12...4.0.13">compare
view</a></li>
</ul>
</details>
<br />


Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore <dependency name> major version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's major version (unless you unignore this specific
dependency's major version or upgrade to it yourself)
- `@dependabot ignore <dependency name> minor version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's minor version (unless you unignore this specific
dependency's minor version or upgrade to it yourself)
- `@dependabot ignore <dependency name>` will close this group update PR
and stop Dependabot creating any more for the specific dependency
(unless you unignore this specific dependency or upgrade to it yourself)
- `@dependabot unignore <dependency name>` will remove all of the ignore
conditions of the specified dependency
- `@dependabot unignore <dependency name> <ignore condition>` will
remove the ignore condition of the specified dependency and ignore
conditions


</details>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Elliot DeNolf <denolfe@gmail.com>
2024-09-30 21:14:00 -04:00
Elliot DeNolf
d55be73992 chore(dependabot): exclude drizzle packages 2024-09-30 16:06:43 -04:00
Elliot DeNolf
b9f236ae50 chore(deps): bump nodemailer (#8453)
Bumped nodemailer to latest
2024-09-30 16:00:18 -04:00
Dan Ribbens
1d38e6d5d5 fix: sorting by id incorrectly orders by version.id (#8450)
Same as fix in beta https://github.com/payloadcms/payload/pull/8442
2024-09-30 13:24:15 -04:00
Elliot DeNolf
2f3c994cea chore(dependabot): add weekly bump for patch versions on main 2024-09-27 23:17:06 -04:00
Patrik
0586f236bb fix: properly filters out number field values with the exists operator filter (#8415)
Fixes #8181
2024-09-27 21:53:46 -04:00
Elliot DeNolf
d582619ead chore(release): payload/2.30.0 [skip ci] 2024-09-27 12:33:19 -04:00
Paul
17fc2d13d0 chore: export toast from react toastify in payload (#8438)
Export `toast` from `react-toastify` directly as to avoid situations
where there could be a module mismatch when trying to use `toast` in
custom components.

This will make toast usable from

```ts
import { toast } from 'payload/components/elements'
```
2024-09-27 09:44:58 -06:00
Elliot DeNolf
800ffd2611 ci: exclude 'status: awaiting-reply' from issue locking 2024-09-25 13:22:58 -04:00
Elliot DeNolf
661ca74364 chore(release): db-postgres/0.8.7 [skip ci] 2024-09-25 11:40:18 -04:00
Elliot DeNolf
ec73b461a8 chore(release): payload/2.29.0 [skip ci] 2024-09-25 11:38:25 -04:00
Elliot DeNolf
94885f3c65 chore(deps): bump express (#8408)
Bump express to 4.21.0
2024-09-25 11:31:13 -04:00
Patrik
31d0b309fe fix: treat empty strings as null / undefined for exists queries (#8336)
Fixes #7714
2024-09-20 15:26:50 -04:00
Sasha
c86526b5c8 fix(db-postgres): localized items in arrays with versions (#8334)
Port of https://github.com/payloadcms/payload/pull/8331 to 2.0

Previosuly, trying to append a new item to an array that contains
another array with localized items and enabled versions led to a unique
`_locale` and `_parent_id` error
```ts
{
  name: 'nestedArrayLocalized',
  type: 'array',
  fields: [
    {
      type: 'array',
      name: 'array',
      fields: [
        {
          name: 'text',
          type: 'text',
          localized: true,
        },
      ],
    },
  ],
}
```
2024-09-20 12:15:00 -04:00
Jessica Chowdhury
28a065072f feat: add new option to disable JOI validation (#8067)
Adds new option `joiValidation: boolean` to the payload config per
client request.

`joiValidation` defaults to `true`, when set to `false` it will bypass
the JOI validation for all collections, globals, fields etc.

NOTE: This change is not required for v3.
2024-09-12 08:59:36 -04:00
Elliot DeNolf
efc0bc9ec9 chore: clarify pull request verbiage 2024-09-10 22:24:00 -04:00
Elliot DeNolf
ade1d27c95 chore: make pull request template less verbose, utilize md comments 2024-09-10 22:22:55 -04:00
Elliot DeNolf
1040731e32 ci(release-commenter): update tests for lock/unlock feature 2024-09-10 22:07:08 -04:00
Elliot DeNolf
30f28898b6 ci(release-commenter): post-release trigger on published, no prereleasd 2024-09-10 21:38:34 -04:00
Sasha
6cb0470906 fix(cpa): detect package manager from command execution environment (#8088)
## Description

Port of https://github.com/payloadcms/payload/pull/8087 to 2.0

- [x] I have read and understand the
[CONTRIBUTING.md](https://github.com/payloadcms/payload/blob/main/CONTRIBUTING.md)
document in this repository.

## Type of change

<!-- Please delete options that are not relevant. -->
- [x] Bug fix (non-breaking change which fixes an issue)

## Checklist:

- [x] Existing test suite passes locally with my changes
2024-09-10 18:40:39 +03:00
Sasha
170ea5badc fix(db-postgres): querying on array within a relationship field (#8153)
## Description

Fixes https://github.com/payloadcms/payload/issues/6037
2.0 port of https://github.com/payloadcms/payload/pull/8152

- [x] I have read and understand the
[CONTRIBUTING.md](https://github.com/payloadcms/payload/blob/main/CONTRIBUTING.md)
document in this repository.

## Type of change

<!-- Please delete options that are not relevant. -->

- [x] Bug fix (non-breaking change which fixes an issue)
## Checklist:

- [x] I have added tests that prove my fix is effective or that my
feature works
- [x] Existing test suite passes locally with my changes
2024-09-10 08:45:02 -04:00
Elliot DeNolf
cfb56589eb ci(release-commenter): include compiled 2024-09-09 16:25:45 -04:00
Elliot DeNolf
f312bac065 ci(release-commenter): fix duplicate comment 2024-09-09 16:25:13 -04:00
Elliot DeNolf
3dd3f5b135 ci(release-commenter): unlock issue in order to comment 2024-09-08 18:55:14 -04:00
Elliot DeNolf
59f4d125ab ci: adjust lock-issues cron to nightly 2024-09-08 18:53:35 -04:00
Elliot DeNolf
b2b2ee3338 ci: adjust changes filter 2024-09-08 18:53:14 -04:00
Elliot DeNolf
7308abaabd ci(release-commenter): safely create comments 2024-09-08 17:24:38 -04:00
Elliot DeNolf
9b1d0b2d0f ci: increase lock-issues cron to every hour until caught up 2024-09-06 16:54:34 -04:00
Elliot DeNolf
9014f1fa63 ci: lock-issues log output 2024-09-06 16:25:09 -04:00
Elliot DeNolf
ba75d876e3 ci: add lock-issues workflow 2024-09-06 16:23:18 -04:00
Elliot DeNolf
f2b2e5cda9 ci: enable release comments for beta releases 2024-09-06 15:44:12 -04:00
Kendell Joseph
f751f69239 chore: adds docs for collection db operations (#8097)
## Description

Adds documentation for collection db operations

## Type of change
- [x] Chore (non-breaking change which does not add functionality)
- [x] This change requires a documentation update

## Checklist:
- [x] I have made corresponding changes to the documentation
2024-09-06 15:18:54 -04:00
Kendell Joseph
f7ac9ff52a chore: adds docs for collection operations 2024-09-06 14:54:12 -04:00
Sasha
ba7a043a99 fix(db-postgres): sanitize tab/group path for table name (#8010)
## Description

Fixes https://github.com/payloadcms/payload/issues/7109
Copy of https://github.com/payloadcms/payload/pull/8009 to 2.0

<!-- Please include a summary of the pull request and any related issues
it fixes. Please also include relevant motivation and context. -->

- [x] I have read and understand the
[CONTRIBUTING.md](https://github.com/payloadcms/payload/blob/main/CONTRIBUTING.md)
document in this repository.

## Type of change

<!-- Please delete options that are not relevant. -->

- [x] Bug fix (non-breaking change which fixes an issue)

## Checklist:

- [x] I have added tests that prove my fix is effective or that my
feature works
- [x] Existing test suite passes locally with my changes
2024-09-06 11:57:48 -04:00
Elliot DeNolf
b149180db4 ci: remove unnecessary checkout ref 2024-09-06 01:55:56 -04:00
Elliot DeNolf
4efb9dd867 ci: release comment mod (#8084)
Release commenter to comment on PRs/issues that have had an associated
release.

NOTE: Commenting is currently disabled. Will be keeping an eye on the CI
output as to when to enable.

Heavily modified version of
[apexskier/github-release-commenter](https://github.com/apexskier/github-release-commenter).

Updates:
- Filters to closed PRs only
- Adds tag filter to support non-linear releases
- Better logging
- Moved to pnpm
- Uses @vercel/ncc for packaging
2024-09-05 22:53:11 -04:00
Elliot DeNolf
7002ca78b9 ci: add workflow_dispatch to post-release for debugging 2024-09-05 13:28:36 -04:00
Elliot DeNolf
44ca3a4073 ci: post-release commenter 2024-09-05 11:26:59 -04:00
Elliot DeNolf
dc7c952ace chore(release): db-postgres/0.8.6 [skip ci] 2024-09-04 17:08:44 -04:00
Elliot DeNolf
c8a659cd39 chore(release): payload/2.28.0 [skip ci] 2024-09-04 17:06:53 -04:00
Kendell Joseph
6ba293c0f8 feat: collections can use custom database operations (#7675)
## Description
Adds option to override default database operations for a collection

```ts
import { CollectionConfig } from 'payload/types';

export const Collection: CollectionConfig = {
  slug: 'example-collection',
  // Database operations for this collection  
  db: {
    create: () => {},
    deleteMany: () => {},
    deleteOne: () => {},
    find: () => {},
    findOne: () => {},
    updateOne: () => {}
  },
  fields: [
    {
      name: 'someField',
      type: 'text',
    },
  ],
}
```
Co-authored-by: Dan Ribbens <dan.ribbens@gmail.com>
2024-09-04 16:44:40 -04:00
Sasha
96a624ad5c fix(db-postgres): query hasMany text/number in array/blocks (#8033)
## Description

Fixes https://github.com/payloadcms/payload/issues/7671
Copy of https://github.com/payloadcms/payload/pull/8003 to 2.0

- [x] I have read and understand the
[CONTRIBUTING.md](https://github.com/payloadcms/payload/blob/main/CONTRIBUTING.md)
document in this repository.

## Type of change

<!-- Please delete options that are not relevant. -->
- [x] Bug fix (non-breaking change which fixes an issue)
## Checklist:

- [x] I have added tests that prove my fix is effective or that my
feature works
- [x] Existing test suite passes locally with my changes
2024-09-04 11:52:40 -04:00
Himanshu
545949dafc docs: fix typo (modifing => modifying) (#7846) 2024-09-01 18:58:41 -04:00
Bruno Crosier
d9f61bbdc8 chore: update incorrect plurality in Italian translations (#7866)
Currently the `{{label}}` in `noResults` translation is a plural.

In the italian translation, the words around `{{label}}` imply that it
would be singular.

This fixes it so that the translation works for a pluralized label

Before (incorrect)

<img width="1140" alt="image"
src="https://github.com/user-attachments/assets/40c62d79-4bc6-4523-9f7c-c07808e7e79f">

ChatGPT confirming it's currently incorrect:
https://chatgpt.com/share/477a3d53-d988-4416-afbf-eab4455779e2
2024-09-01 18:57:52 -04:00
DragnovDC
be06579b3e chore(templates): change import in ecommerce template to be type-only (#8019)
Linter Error: Import 'Header' conflicts with local value, so must be
declared with a type-only import when 'isolatedModules' is
enabled.ts(2865)
2024-09-01 18:51:01 -04:00
Jayce Pulsipher
25e9bc62db fix(db-postgres): migration exit codes (#7873)
## Description

Fixes #7031 for v2

- [X] I have read and understand the
[CONTRIBUTING.md](https://github.com/payloadcms/payload/blob/main/CONTRIBUTING.md)
document in this repository.

## Type of change

- [X] Bug fix (non-breaking change which fixes an issue)

## Checklist:

- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] Existing test suite passes locally with my changes
- [ ] I have made corresponding changes to the documentation

Co-authored-by: Jayce Pulsipher <jpulsipher@nav.com>
2024-08-30 12:15:17 -04:00
Elliot DeNolf
aca567634b chore(release): plugin-cloud/3.0.2 [skip ci] 2024-08-28 12:34:20 -04:00
Elliot DeNolf
1f0934877c fix(plugin-cloud): better logging on static handler (#7924)
Better logging on static handler.
2024-08-28 12:28:47 -04:00
Elliot DeNolf
61da010991 chore: update v3 issue template (#7901)
Mention `payload info` command when providing versions, which is now a
textarea.

Note: that individual version fields are now gone and are no longer
required/enforced. We may need to come up with a better solution if
issues are being submitted without this info.
2024-08-27 22:48:11 -04:00
Elliot DeNolf
ab9074220a chore(release): payload/2.27.0 [skip ci] 2024-08-26 14:01:47 -04:00
Paul
afa90a4362 chore: update docs for stripe plugin webhook (#7763)
Closes https://github.com/payloadcms/payload/issues/7740
2024-08-19 13:12:24 -06:00
Elliot DeNolf
bc0516da90 chore(dependabot): add .github/actions dir 2024-08-14 22:20:42 -04:00
Elliot DeNolf
46daf473c8 chore(dependabot): add .github/workflows dir 2024-08-14 22:02:01 -04:00
Elliot DeNolf
337b8ccbf3 chore: add packageManager property for dependabot 2024-08-14 21:52:06 -04:00
Elliot DeNolf
ba2e4c278f chore: remove explicit dependabot versioning-strategy 2024-08-14 21:23:02 -04:00
Elliot DeNolf
3196036ae9 chore: dependabot time format 2024-08-14 21:19:43 -04:00
Elliot DeNolf
9bc3ad5159 chore: add dependabot.yml 2024-08-14 21:17:28 -04:00
Alessio Gravili
94d18e8d74 feat: upgrade react-toastify dependency, and upgrade to pnpm v9 in our monorepo (#7667) 2024-08-14 20:05:04 -04:00
Patrik
c624eea0d8 fix: update state of field if either valid status or errorMessage changes (#7632)
## Description

Fixes #6413 

- [x] I have read and understand the
[CONTRIBUTING.md](https://github.com/payloadcms/payload/blob/main/CONTRIBUTING.md)
document in this repository.

## Type of change

- [x] Bug fix (non-breaking change which fixes an issue)

## Checklist:

- [x] Existing test suite passes locally with my changes
2024-08-13 11:23:51 -04:00
Paul
f97627092c feat: add support for custom image size file names (#7637)
Add support for custom file names in images sizes

```ts
{
  name: 'thumbnail',
  width: 400,
  height: 300,
  generateImageName: ({ height, sizeName, extension, width }) => {
    return `custom-${sizeName}-${height}-${width}.${extension}`
  },
}
```
2024-08-12 14:36:09 -06:00
Elliot DeNolf
f00183029e chore(release): richtext-lexical/0.11.3 [skip ci] 2024-08-09 09:39:40 -04:00
Elliot DeNolf
b6c5aaa966 chore(release): db-mongodb/1.7.2 [skip ci] 2024-08-09 09:39:18 -04:00
Elliot DeNolf
517aaa0665 chore(release): payload/2.26.0 [skip ci] 2024-08-09 09:37:40 -04:00
Jarrod Flesch
2c2ffe406f chore: allow password to be mutated by hooks (#7537)
Fixes https://github.com/payloadcms/payload/issues/7531

Allows passwords to be updated in hooks.
2024-08-09 09:27:09 -04:00
James Mikrut
7f39afa192 feat: adds classnames to edit, list views (#7595)
## Description

Adds classnames to List and Edit views to be able to more easily target
individual entity views via CSS / similar.

- [x] I have read and understand the
[CONTRIBUTING.md](https://github.com/payloadcms/payload/blob/main/CONTRIBUTING.md)
document in this repository.

## Type of change

- [x] New feature (non-breaking change which adds functionality)

## Checklist:

- [x] Existing test suite passes locally with my changes
2024-08-08 19:44:09 -04:00
Patrik
fc4d24aa88 fix: render singular label for ArrayCell when length is 1 (#7585)
## Description

Fixes #6099

![Screenshot 2024-08-08 at 2 40
25 PM](https://github.com/user-attachments/assets/0a7ac732-adfe-456b-80c6-1e4b6ce4c4c8)

- [x] I have read and understand the
[CONTRIBUTING.md](https://github.com/payloadcms/payload/blob/main/CONTRIBUTING.md)
document in this repository.

## Type of change

- [x] Bug fix (non-breaking change which fixes an issue)

## Checklist:

- [x] Existing test suite passes locally with my changes
2024-08-08 15:44:35 -04:00
Patrik
efa56cefc1 fix: filtering by non-poly relationships with not_equals operator (#7573)
## Description

Fixes #5212

Fixes #6278 

- [x] I have read and understand the
[CONTRIBUTING.md](https://github.com/payloadcms/payload/blob/main/CONTRIBUTING.md)
document in this repository.

## Type of change

- [x] Bug fix (non-breaking change which fixes an issue)

## Checklist:

- [x] I have added tests that prove my fix is effective or that my
feature works
- [x] Existing test suite passes locally with my changes
2024-08-08 11:22:47 -04:00
Patrik
907d7d1d3a fix: filtering by polymorphic relationships with drafts enabled (#7565)
## Description

Fixes #6880 

- [x] I have read and understand the
[CONTRIBUTING.md](https://github.com/payloadcms/payload/blob/main/CONTRIBUTING.md)
document in this repository.

## Type of change

- [x] Bug fix (non-breaking change which fixes an issue)

## Checklist:

- [x] I have added tests that prove my fix is effective or that my
feature works
- [x] Existing test suite passes locally with my changes
2024-08-07 15:31:47 -04:00
Patrik
eca1517237 fix: deprecated inflight package (#6558)
Fixes #6492
2024-08-07 10:32:17 -04:00
Patrik
9865ae998b fix: enable relationship & upload field population in versions (#7533) 2024-08-06 12:09:53 -04:00
Patrik
1a0ef4824b fix: prevents hasMany text going outside of input boundaries (#7454)
## Description

Fixes #6034

`Before`:
![Screenshot 2024-07-31 at 12 26
25 PM](https://github.com/user-attachments/assets/df2cfcda-d81e-42cf-a97d-9552a420b9e8)

`After`:
![Screenshot 2024-07-31 at 12 26
10 PM](https://github.com/user-attachments/assets/fa7c369f-efc3-4aff-95ad-3e2b2525d3c3)

- [x] I have read and understand the
[CONTRIBUTING.md](https://github.com/payloadcms/payload/blob/main/CONTRIBUTING.md)
document in this repository.

## Type of change

- [x] Bug fix (non-breaking change which fixes an issue)

## Checklist:

- [x] Existing test suite passes locally with my changes
2024-08-05 17:09:29 -04:00
Radosław Kłos
39e110e633 feat: adds upload's relationship thumbnail (#5015)
## Description

I've made an implementation of the feature requested here:
https://github.com/payloadcms/payload/discussions/3407

Before:
![CleanShot 2024-02-07 at 00 39
47](https://github.com/payloadcms/payload/assets/34719093/4b182118-41bd-47f7-af03-a0b739f7e407)

After:
![CleanShot 2024-02-07 at 00 40
17](https://github.com/payloadcms/payload/assets/34719093/d813de81-bab5-40b2-b31c-5a7ee107dabd)


- [x] I have read and understand the
[CONTRIBUTING.md](https://github.com/payloadcms/payload/blob/main/CONTRIBUTING.md)
document in this repository.

## Type of change

<!-- Please delete options that are not relevant. -->

- [x] New feature (non-breaking change which adds functionality)

## Checklist:

- [x] I have added tests that prove my fix is effective or that my
feature works
- [x] Existing test suite passes locally with my changes
2024-08-01 15:09:59 +01:00
Paul
3e780b9815 feat(ui): expose custom errors in delete many (#7439)
Exposes any custom errors out to the delete many toast as well.
Closes https://github.com/payloadcms/payload/issues/7214


![image](https://github.com/user-attachments/assets/e5d1fc92-3f22-4906-b09c-e94caf82eb64)
2024-07-31 17:25:23 -04:00
Dan Ribbens
a308d6384f fix(db-postgres): localized array inside blocks field (#7458)
fixes #5240
Copy of https://github.com/payloadcms/payload/pull/7457
2024-07-31 16:31:19 -04:00
Jarrod Flesch
492ed30cb8 chore: fix generic usage, fixes CI (#7421) 2024-07-29 16:28:15 -04:00
Francisco Lourenço
fca5a404db fix: previousValue missing from ValidateOptions type (#6931) 2024-07-29 11:49:19 -04:00
Jason Toups
b13f7e8843 chore: updates all of the Readme localhost:3000 Code to Links (#7252) 2024-07-29 11:22:50 -04:00
Ante
25dfdb66cd chore: croatian translation improvements (#7377) 2024-07-29 11:20:40 -04:00
Patrik
9c9e6896a5 fix(payload): retained date milliseconds (#7393)
## Description

Fixes #6108 

Defaults `milliseconds` to `0` for date field picker.

`Before`:
![Screenshot 2024-07-26 at 3 56
45 PM](https://github.com/user-attachments/assets/1806801a-b457-476e-ad84-bcfe3248b61e)


`After`:
![Screenshot 2024-07-26 at 3 54
14 PM](https://github.com/user-attachments/assets/ad92a106-df95-4184-9de2-666d08b636ab)

- [x] I have read and understand the
[CONTRIBUTING.md](https://github.com/payloadcms/payload/blob/main/CONTRIBUTING.md)
document in this repository.

## Type of change

- [x] Bug fix (non-breaking change which fixes an issue)

## Checklist:

- [x] Existing test suite passes locally with my changes
2024-07-26 16:16:45 -04:00
Elliot DeNolf
a3085435ef chore(release): db-mongodb/1.7.1 [skip ci] 2024-07-26 11:38:00 -04:00
Elliot DeNolf
1466657e8f chore(release): payload/2.25.0 [skip ci] 2024-07-26 11:36:14 -04:00
James Mikrut
1348483648 fix: preserves objectids in deepCopyObject (#7385)
## Description

The `deepCopyObject` function was cannibalizing ObjectIDs, which
conflicted with the ability to surface them from the MongoDB adapter.
Now, the `deepCopyObject` function will simply pass through ObjectIDs
rather than break them.
2024-07-26 11:10:16 -04:00
Patrik
5321098d7e fix(payload): properly handles 0 value number fields in list view (#7364)
## Description

Fixes #5510 

- [x] I have read and understand the
[CONTRIBUTING.md](https://github.com/payloadcms/payload/blob/main/CONTRIBUTING.md)
document in this repository.

## Type of change

- [x] Bug fix (non-breaking change which fixes an issue)

## Checklist:

- [x] Existing test suite passes locally with my changes
2024-07-25 15:35:35 -04:00
Kendell Joseph
c57591bc4f fix: supports null values in query strings (#5241)
Fixes issue where null values were not being handled properly from client/server

---------

Co-authored-by: Jarrod Flesch <jarrodmflesch@gmail.com>
2024-07-25 13:25:06 -04:00
Patrik
9750bc217e fix(db-mongodb): adds new optional collation feature flag behind mongodb collation option (#7359)
## Description

Fixes #7349 

Adds new `collation` prop to the mongodb adapter config to allow for
enabling the `mongodb` collation feature.

- [x] I have read and understand the
[CONTRIBUTING.md](https://github.com/payloadcms/payload/blob/main/CONTRIBUTING.md)
document in this repository.

## Type of change

- [x] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [x] This change requires a documentation update

## Checklist:

- [x] Existing test suite passes locally with my changes
- [x] I have made corresponding changes to the documentation
2024-07-25 12:37:41 -04:00
Jarrod Flesch
468e5441f1 fix: relaxes equality check for relationship options in filter (#7344)
Fixes https://github.com/payloadcms/payload/issues/7103

When extracting the value from the querystring, it is always a string.
We were using a strict equality check which would cause the filter
options to never find the correct option. This caused an infinite loop
when using PG as ID's are numbers by default.
2024-07-24 15:53:09 -04:00
Patrik
3c5cce4c6f feat(payload): allows metadata to be appended to the file of the output media (#7295)
## Description

V3 PR [here](https://github.com/payloadcms/payload/pull/7293)

`Feat`: Adds new prop `withMetadata` to `uploads` config that allows the
user to allow media metadata to be appended to the file of the output
media.

- [x] I have read and understand the
[CONTRIBUTING.md](https://github.com/payloadcms/payload/blob/main/CONTRIBUTING.md)
document in this repository.

## Type of change

- [x] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [x] This change requires a documentation update

## Checklist:

- [x] I have added tests that prove my fix is effective or that my
feature works
- [x] Existing test suite passes locally with my changes
- [x] I have made corresponding changes to the documentation
2024-07-24 15:32:54 -04:00
Elliot DeNolf
9f0f94893d chore(release): db-mongodb/1.7.0 [skip ci] 2024-07-24 14:17:35 -04:00
Elliot DeNolf
03b7892fc9 chore(release): payload/2.24.2 [skip ci] 2024-07-24 14:16:09 -04:00
James Mikrut
f96cf593ce feat: add jsonParse flag to mongooseAdapter that preserves existing, untracked MongoDB data types (#7338)
## Description

Preserves external data structures stored in MongoDB by avoiding the use
of `JSON.parse(JSON.stringify(mongooseDoc))`.

- [x] I have read and understand the
[CONTRIBUTING.md](https://github.com/payloadcms/payload/blob/main/CONTRIBUTING.md)
document in this repository.

## Type of change

- [x] New feature (non-breaking change which adds functionality)

## Checklist:

- [x] I have added tests that prove my fix is effective or that my
feature works
- [x] Existing test suite passes locally with my changes
2024-07-24 14:02:06 -04:00
Jarrod Flesch
8259611ce6 fix: fetches and sets permissions before setting user (#7337)
Fixes https://github.com/payloadcms/payload/issues/7330

Ensures permissions are always present before setting the user.
2024-07-24 12:30:10 -04:00
Jacob Fletcher
a3ed25a253 chore(live-preview): ensures dev points to src (#7340) 2024-07-24 12:17:03 -04:00
Jarrod Flesch
69e7b7a158 fix: allow autosave relationship drawers to function properly (#7325)
Fixes https://github.com/payloadcms/payload/issues/6887

Collections with autosave enabled would open and immediately close when
they were edited inside a relationship field. This PR threads onSave
through to autosave and checks the current drawer depth to determine if
it should call the onSave function or if it should redirect the user to
the doc page when autosave is triggered.
2024-07-23 17:00:27 -04:00
Jacob Fletcher
c6da99b4d1 fix(plugin-stripe): properly types async webhooks (#7316) 2024-07-23 13:56:29 -04:00
dependabot[bot]
ebd23caa56 chore(deps): bump ws from 7.5.9 to 7.5.10 in /examples/auth/payload (#7288) 2024-07-22 22:04:48 -04:00
dependabot[bot]
faa9b21824 chore(deps): bump nodemailer from 6.9.4 to 6.9.14 in /examples/email (#7289) 2024-07-22 22:04:31 -04:00
dependabot[bot]
1690560f11 chore(deps): bump braces from 3.0.2 to 3.0.3 in /examples/auth/next-app (#7286) 2024-07-22 22:04:12 -04:00
Patrik
0058660b3f fix(db-mongodb): removes precedence of regular chars over international chars in sort (#6923)
## Description

Fixes #6719 

- [x] I have read and understand the
[CONTRIBUTING.md](https://github.com/payloadcms/payload/blob/main/CONTRIBUTING.md)
document in this repository.

## Type of change

- [x] Bug fix (non-breaking change which fixes an issue)

## Checklist:

- [x] I have added tests that prove my fix is effective or that my
feature works
- [x] Existing test suite passes locally with my changes
2024-07-22 16:55:35 -04:00
Elliot DeNolf
6d7ef919cb chore(release): payload/2.24.1 [skip ci] 2024-07-22 15:59:08 -04:00
Yosuf Ali
abffa37d85 chore(templates): fixes bug in e-commerce (#7258)
## Description

When following the documentation to run the E Commerce template locally,
you are asked to run `yarn stripe:webhooks` to work with webhooks.

However, when checking out your cart and a webhook is triggered, your
terminal receives the following error:

```
[ERROR] Failed to POST: Post "http://localhost:8000/stripe/webhooks": dial tcp 127.0.0.1:8000: connect: connection refused
```

I believe this is because the port is wrong, and it should be port
`3000`. There is no reference to a port `8000` anywhere in the code base
for this template, including in the docker-compose.yml file.

Making this changes allows webhook requests to be forwarded correctly:

```
--> customer.created [evt_...]
<-- [200] POST http://localhost:3000/stripe/webhooks [evt_...]
```

This PR makes this small change.

<!-- Please include a summary of the pull request and any related issues
it fixes. Please also include relevant motivation and context. -->

- [x] I have read and understand the
[CONTRIBUTING.md](https://github.com/payloadcms/payload/blob/main/CONTRIBUTING.md)
document in this repository.

## Type of change

<!-- Please delete options that are not relevant. -->

- [x] Bug fix (non-breaking change which fixes an issue)
- [x] Change to the
[templates](https://github.com/payloadcms/payload/tree/main/templates)
directory (does not affect core functionality)

## Checklist:

- [x] Existing test suite passes locally with my changes
2024-07-22 13:43:29 -04:00
Patrik
1b208c7add fix: resizes images first before applying focal point (#7278)
## Description

V3 (original) PR [here](https://github.com/payloadcms/payload/pull/7277)

- [x] I have read and understand the
[CONTRIBUTING.md](https://github.com/payloadcms/payload/blob/main/CONTRIBUTING.md)
document in this repository.

## Type of change

- [x] Bug fix (non-breaking change which fixes an issue)

## Checklist:

- [x] Existing test suite passes locally with my changes
2024-07-22 12:28:55 -04:00
Rafał Nawojczyk
2840632161 docs: add warning about forbidden chars in custom ID field (#7059)
## Description

Add a warning text for users in DOCs, that will notify them about
forbidden characters while using `text` as a custom ID.
It resolves #7021 

- [x] I have read and understand the
[CONTRIBUTING.md](https://github.com/payloadcms/payload/blob/main/CONTRIBUTING.md)
document in this repository.

## Type of change

<!-- Please delete options that are not relevant. -->

- [x] 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](https://github.com/payloadcms/payload/tree/main/templates)
directory (does not affect core functionality)
- [ ] Change to the
[examples](https://github.com/payloadcms/payload/tree/main/examples)
directory (does not affect core functionality)
- [ ] This change requires a documentation update

## Checklist:

- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] Existing test suite passes locally with my changes
- [x] I have made corresponding changes to the documentation
2024-07-21 22:23:03 -04:00
Patrik
0841d5a35e fix: uploads from drawer and focal point positioning (#7244)
## Description

V3 PR [here](https://github.com/payloadcms/payload/pull/7117)

- [x] I have read and understand the
[CONTRIBUTING.md](https://github.com/payloadcms/payload/blob/main/CONTRIBUTING.md)
document in this repository.

## Type of change

- [x] Bug fix (non-breaking change which fixes an issue)

## Checklist:

- [x] I have added tests that prove my fix is effective or that my
feature works
- [x] Existing test suite passes locally with my changes
2024-07-19 15:01:06 -04:00
Jessica Chowdhury
bd19fcf259 chore(docs): expand on reserved field names (#7242)
## Description

Closes #6640

Note: Only updated for v2 as the v3 docs cover this topic already.

- [X] I have read and understand the
[CONTRIBUTING.md](https://github.com/payloadcms/payload/blob/main/CONTRIBUTING.md)
document in this repository.

## Type of change

- [X] Chore (non-breaking change which does not add functionality)
2024-07-19 12:32:34 -04:00
Jacob Fletcher
18645771c8 fix: exports fallback hook types to ensure backwards compatibility (#7217) 2024-07-18 12:34:59 -04:00
Isak ✏ ⇝
20377bb22c fix: aliases AfterMe, AfterLogout, and AfterRefresh hook types (#7146)
Co-authored-by: Jacob Fletcher <jacobsfletch@gmail.com>
2024-07-18 10:56:56 -04:00
Elliot DeNolf
7daaf3d780 chore(release): db-mongodb/1.6.0 [skip ci] 2024-07-16 14:33:42 -04:00
Elliot DeNolf
667d3dc885 chore(release): payload/2.24.0 [skip ci] 2024-07-16 14:31:53 -04:00
James Mikrut
51474fa661 feat: allows mongoose schemaOptions to be configured (#7099)
## Description

This PR adds the ability to configure Mongoose's `schemaOptions`, which exposes more control about how Mongoose operates internally. For example, you can now disable `strict` mode in Mongoose to be able to preserve / surface data in MongoDB that is not reflected in Payload schemas.

- [x] I have read and understand the
[CONTRIBUTING.md](https://github.com/payloadcms/payload/blob/main/CONTRIBUTING.md)
document in this repository.

## Type of change

- [x] New feature (non-breaking change which adds functionality)

## Checklist:

- [x] I have added tests that prove my fix is effective or that my
feature works
- [x] Existing test suite passes locally with my changes
- [ ] I have made corresponding changes to the documentation
2024-07-16 12:58:55 -04:00
Jessica Chowdhury
d475b16790 chore(docs): minor change to uploads overview (#7147)
## Description

Updates upload overview to remove point about the upload gallery.

- [X] I have read and understand the
[CONTRIBUTING.md](https://github.com/payloadcms/payload/blob/main/CONTRIBUTING.md)
document in this repository.
2024-07-15 10:58:09 -04:00
Konsequanzheng
4d0befb67a Correct stripe plugin documentation local use webhook url (#7144)
## Description
The stripe plugin documentation has an error in the forwarding URL for
local development (`/stripe/webhooks` instead of `/api/stripe/webhooks`)

Spent a day debugging my application because the URL in the docs is
wrong. Hoping to save others some time with this correction.

<!-- Please include a summary of the pull request and any related issues
it fixes. Please also include relevant motivation and context. -->

- [x] I have read and understand the
[CONTRIBUTING.md](https://github.com/payloadcms/payload/blob/main/CONTRIBUTING.md)
document in this repository.

## Type of change

<!-- Please delete options that are not relevant. -->

- [x] Documentation correction
2024-07-15 10:01:03 -04:00
Patrik
84d214f992 feat: adds ability to upload files from a remote url (#7087)
Adds new button to uploads labeled `Paste URL` 

![Screenshot 2024-07-08 at 10 46
14 AM](https://github.com/payloadcms/payload/assets/35232443/5024fc20-c860-48e5-bdc8-b69ac3c9cc53)

Upon clicking it, a modal with an input field will appear to where one
can input a remote url of an image.

![Screenshot 2024-07-08 at 10 46
22 AM](https://github.com/payloadcms/payload/assets/35232443/5ea67977-f118-4d34-9dfb-d270b3578262)
2024-07-12 11:41:50 -04:00
Jarrod Flesch
51cd5942fa chore: revert changed localization test suite (#7089) 2024-07-10 08:19:34 -04:00
Mark Aloo
74105d8ee5 feat(templates): add import alias to tsconfig.json (#7051) 2024-07-08 11:39:16 -04:00
Federico Di Luca
1cc61ddab6 docs: update unlock examples to include email parameter (#6920) 2024-06-30 14:02:36 -04:00
Adarsh-Raj-Jaiswal
99397a0bdb fix(docs): small typo in custom components documentation (#6973) 2024-06-30 13:58:45 -04:00
Jarrod Flesch
a5492afad6 fix: ensures access query runs with locale when present (#6981)
Fixes https://github.com/payloadcms/payload/issues/6915
2024-06-28 16:19:34 -04:00
Elliot DeNolf
6c1156e2e4 chore(release): payload/2.23.1 [skip ci] 2024-06-28 12:43:13 -04:00
James Mikrut
77e8ce980e Chore/remove unused refresh arg (#6976)
## Description

The `refresh` operation was accepting a `token` argument, but it was not
being used at all. This PR cleans up that unused logic.
2024-06-28 10:52:41 -04:00
Elliot DeNolf
39e34ce94e chore(release): richtext-lexical/0.11.2 [skip ci] 2024-06-28 09:25:51 -04:00
Elliot DeNolf
2aa2971fb9 chore(release): payload/2.23.0 [skip ci] 2024-06-28 09:24:22 -04:00
James Mikrut
c82d2caa29 feat: adds me and refresh hooks (#6968)
## Description

Duplicate of https://github.com/payloadcms/payload/pull/6965 for 2.x
2024-06-28 09:06:27 -04:00
Alessio Gravili
cf52d64d98 fix(richtext-lexical): html converters unnecessarily growing over time (#6963)
Fixes https://github.com/payloadcms/payload/issues/6962
2024-06-27 11:57:23 -04:00
Elliot DeNolf
320dcc0a08 chore(release): payload/2.22.2 [skip ci] 2024-06-26 14:31:58 -04:00
Elliot DeNolf
ea18735d3b fix: return exp and strategy from auth (#6943)
Expiration and strategy were not being properly sent using the useAuth
hook.
2024-06-26 14:26:17 -04:00
Jacob Fletcher
4baa0e3221 docs: fixes syntax error in access control overview (#6924) 2024-06-25 15:51:21 -04:00
Elliot DeNolf
2d35d695ea chore(release): payload/2.22.1 [skip ci] 2024-06-25 15:21:11 -04:00
James Mikrut
bb911cc7ec fix(payload): #6800, #5108 - graphql query concurrency issues (#6857)
Fixes #6800 and #5108 by improving the `isolateObjectProperty` utility
function and flattening `req.transactionID` and
`req.transactionIDPromise` to a single `req.transactionID` property.
2024-06-25 14:57:50 -04:00
Patrik
874774375f fix: sends cropped image pixel values to server instead of percent values (#6852)
## Description

Fixes #6824 

- [x] I have read and understand the
[CONTRIBUTING.md](https://github.com/payloadcms/payload/blob/main/CONTRIBUTING.md)
document in this repository.

## Type of change

- [x] Bug fix (non-breaking change which fixes an issue)

## Checklist:

- [x] Existing test suite passes locally with my changes
2024-06-24 11:28:37 -04:00
Elliot DeNolf
d337c5b523 chore(release): db-mongodb/1.5.2 [skip ci] 2024-06-20 10:22:42 -04:00
Elliot DeNolf
dab632388e chore(release): plugin-cloud-storage/1.1.3 [skip ci] 2024-06-20 10:21:05 -04:00
Elliot DeNolf
6f63e724e3 chore(release): db-postgres/0.8.5 [skip ci] 2024-06-20 10:19:28 -04:00
Elliot DeNolf
b230da33ce chore(release): payload/2.22.0 [skip ci] 2024-06-20 10:17:26 -04:00
Jarrod Flesch
58427ffae3 fix: adjust json field schema for defaultValue (#6872) 2024-06-20 09:45:39 -04:00
Naoto Ikeno
9ecc6c8899 fix(db-postgres): cascade delete FKs on hasMany relationships (#6735)
## Description

This PR fixes https://github.com/payloadcms/payload/issues/6485.

- [x] I have read and understand the
[CONTRIBUTING.md](https://github.com/payloadcms/payload/blob/main/CONTRIBUTING.md)
document in this repository.

## Type of change

- [x] Bug fix (non-breaking change which fixes an issue)

## Checklist:

- [x] I have added tests that prove my fix is effective or that my
feature works
- [x] Existing test suite passes locally with my changes
2024-06-19 09:52:11 -04:00
Francisco Lourenço
336438506c fix: cannot use empty string in defaultValue on text-like fields (#6842)
## Description

This changes allows empty strings (`''`) to be used as defaultValue for fields of types:
`'text'`; `'textarea'`; `'email'`; `'code'`. This can be useful when you
want to ensure the value is always a `string` instead of
`null`/`undefined`.


- [x] I have read and understand the
[CONTRIBUTING.md](https://github.com/payloadcms/payload/blob/main/CONTRIBUTING.md)
document in this repository.

## Type of change

- [x] New feature (non-breaking change which adds functionality)

## Checklist:

- [x] I have added tests that prove my fix is effective or that my
feature works
- [x] Existing test suite passes locally with my changes
2024-06-19 09:35:23 -04:00
Patrik
025306f9e6 fix: unflattening json objects containing keys with periods (#6834)
## Description

Fixes #5378 

Fixes an issue where the `unflatten` function would also unflatten json
objects when they contained a `.` in one of their keys

- [x] I have read and understand the
[CONTRIBUTING.md](https://github.com/payloadcms/payload/blob/main/CONTRIBUTING.md)
document in this repository.

## Type of change

- [x] Bug fix (non-breaking change which fixes an issue)

## Checklist:

- [x] I have added tests that prove my fix is effective or that my
feature works
- [x] Existing test suite passes locally with my changes
2024-06-18 17:09:19 -04:00
Jacob Fletcher
b1c9dee840 chore(deps): regenerates lockfile 2024-06-18 09:53:34 -04:00
Jacob Fletcher
9a17d6614c Revert "chore(deps): bump nodemailer from 6.9.8 to 6.9.9 in /packages/payload (#4977)"
This reverts commit 074a3f0e14.
2024-06-18 09:26:40 -04:00
dependabot[bot]
28a6d14a9a chore(deps): bump nodemailer from 6.9.8 to 6.9.9 in /packages/plugin-cloud (#4978) 2024-06-18 09:15:55 -04:00
dependabot[bot]
074a3f0e14 chore(deps): bump nodemailer from 6.9.8 to 6.9.9 in /packages/payload (#4977) 2024-06-18 09:15:27 -04:00
Jarrod Flesch
0a51de7623 feat: passes prev value through to validate functions (#6805)
Passes `previousValue` through to validate functions.
2024-06-18 09:14:07 -04:00
dependabot[bot]
e2004e525d chore(deps): bump next from 13.5.4 to 14.1.1 in /test/live-preview/next-app (#6295) 2024-06-18 09:13:28 -04:00
dependabot[bot]
4014b124ca chore(deps): bump next from 13.5.6 to 14.1.1 in /examples/custom-server (#6296) 2024-06-18 09:13:19 -04:00
dependabot[bot]
ca2ccc6614 chore(deps): bump next from 13.5.6 to 14.1.1 in /examples/nested-docs/next-app (#6297) 2024-06-18 09:13:10 -04:00
dependabot[bot]
7fd716188b chore(deps): bump next from 13.5.6 to 14.1.1 in /examples/nested-docs/next-pages (#6298) 2024-06-18 09:12:55 -04:00
dependabot[bot]
02e0e6fff8 chore(deps): bump next from 13.5.6 to 14.1.1 in /examples/auth/next-app (#6299) 2024-06-18 09:12:35 -04:00
dependabot[bot]
dfa0afe7b3 chore(deps): bump next from 13.5.6 to 14.1.1 in /examples/auth/next-pages (#6300) 2024-06-18 09:12:29 -04:00
dependabot[bot]
e1b8e6fe02 chore(deps): bump next from 13.5.6 to 14.1.1 in /examples/form-builder/next-pages (#6302) 2024-06-18 09:12:02 -04:00
dependabot[bot]
c2c5ac5a1c chore(deps): bump next from 13.5.6 to 14.1.1 in /examples/draft-preview/next-app (#6303) 2024-06-18 09:11:56 -04:00
dependabot[bot]
f597cdfcfd chore(deps): bump next from 13.5.6 to 14.1.1 in /examples/draft-preview/next-pages (#6304) 2024-06-18 09:11:48 -04:00
dependabot[bot]
967bd941e5 chore(deps): bump next from 13.5.6 to 14.1.1 in /examples/redirects/next-pages (#6306) 2024-06-18 09:11:25 -04:00
D. Kasi Pavan Kumar
5f1c47130d docs: removes unwanted word from custom providers doc (#6822) 2024-06-18 09:03:38 -04:00
Alessio Gravili
e8165b79c5 chore: pin @swc/cli version. Versions higher than 0.2 are breaking (#6814) 2024-06-17 14:09:24 -04:00
Alessio Gravili
1c986a9832 fix: upgrade swc, fixing swc issues on linux (#6809)
Fixes https://github.com/payloadcms/payload/issues/6611
2024-06-17 11:58:42 -04:00
Paul
fb4ef6fc0f fix(templates): pass PORT into next in custom servers (#6807)
Closes https://github.com/payloadcms/payload/issues/4800

- [x] Chore (non-breaking change which does not add functionality)
2024-06-17 11:14:34 -04:00
Alessio Gravili
015aafda75 fix(plugin-cloud-storage): missing error handling for invalid plugin config, leading to unexpected webpack errors (#6786) 2024-06-15 00:33:36 -04:00
Jarrod Flesch
dae56e60ee fix: corrects redirect with lonely slash on login (#6784)
Fixes https://github.com/payloadcms/payload/issues/5120
2024-06-14 16:43:55 -04:00
Jessica Chowdhury
9f0aaf066e fix(ui): withinCollapsible always false from useCollapsible provider (#6783)
## Description

Closes #6760 

The `withinCollapsible` prop from the `useCollapsible()` provider is
always returning false.

This bug originated from [this
change](https://github.com/payloadcms/payload/pull/6666) from me - in a
previous issue, the provider was always returning `withinCollapsible:
true`.

Previous fix was not correct, the `withinCollapsible` should be `false`
when creating the initial context, and then be `true` when it is
de-structured in the provider. Tested with tabs, arrays, and groups. All
working as expected now.

- [X] I have read and understand the
[CONTRIBUTING.md](https://github.com/payloadcms/payload/blob/main/CONTRIBUTING.md)
document in this repository.

## Type of change

- [X] Bug fix (non-breaking change which fixes an issue)

## Checklist:

- [X] Existing test suite passes locally with my changes
2024-06-14 16:19:59 -04:00
Patrik
f6ba3befae fix(payload, db-mongodb): querying relationships with in & not_in (#6773)
## Description

Fixes #6741 

- [x] I have read and understand the
[CONTRIBUTING.md](https://github.com/payloadcms/payload/blob/main/CONTRIBUTING.md)
document in this repository.

## Type of change

- [x] Bug fix (non-breaking change which fixes an issue)

## Checklist:

- [x] I have added tests that prove my fix is effective or that my
feature works
- [x] Existing test suite passes locally with my changes
2024-06-14 16:16:59 -04:00
Jarrod Flesch
68ea693a88 fix: array row validation messages (#6780)
Fixes https://github.com/payloadcms/payload/issues/4886

Array row validation singular and plural labels were incorrect.
2024-06-14 15:46:40 -04:00
Elliot DeNolf
62fa22cb24 chore(release): payload/2.21.0 [skip ci] 2024-06-14 15:37:16 -04:00
Sjoert
3b4bb3065a fix(login): use correct time for isLocked check (#6052)
Fixes #4950
 
The time given to the `isLocked` function is an ISO string because of
the implementation of the [`incrementLoginAttempts`
function](d78df36d9b/packages/payload/src/auth/strategies/local/incrementLoginAttempts.ts (L47)),
even though it expects milliseconds since epoch. For this reason the
`isLocked` function will never return `true`.
2024-06-14 14:49:36 -04:00
Jarrod Flesch
4e0725f7c6 chore: fixes view height (#6779)
Fixes issue where view height was not 100% by default. Regression from
https://github.com/payloadcms/payload/pull/4769
2024-06-14 12:53:26 -04:00
Jarrod Flesch
ff70fd9813 feat: draft validation (#6746)
Allows draft validation to be enabled at the config level.

You can enable this by:

```ts
// ...collectionConfig
versions: {
  drafts: {
    validate: true // defaults to false
  }
}
```
2024-06-13 11:08:04 -04:00
Patrik
e40570bd0d fix: unable to save animated file types with undefined image sizes (#6733)
## Description

Fixes #6727 

- [x] I have read and understand the
[CONTRIBUTING.md](https://github.com/payloadcms/payload/blob/main/CONTRIBUTING.md)
document in this repository.

## Type of change

- [x] Bug fix (non-breaking change which fixes an issue)

## Checklist:

- [x] I have added tests that prove my fix is effective or that my
feature works
- [x] Existing test suite passes locally with my changes
2024-06-13 09:41:24 -04:00
Jessica Chowdhury
b7e852993b fix: adjust version status pill when unpublished (#6744)
## Description

Versions that have been published then unpublished still showed the
`current published version` pill - these need to be `previously
published`.

- [X] I have read and understand the
[CONTRIBUTING.md](https://github.com/payloadcms/payload/blob/main/CONTRIBUTING.md)
document in this repository.

## Type of change

- [X] Bug fix (non-breaking change which fixes an issue)

## Checklist:

- [X] Existing test suite passes locally with my changes
2024-06-12 13:24:35 -04:00
Elliot DeNolf
ab97590879 chore(release): payload/2.20.0 [skip ci] 2024-06-11 19:00:22 -04:00
Jessica Chowdhury
ed86b15242 feat(ui): updates draft/published version pills (#6732) 2024-06-11 18:18:32 -04:00
Elliot DeNolf
d58631c12c chore: add v2 tag to issue template 2024-06-11 16:08:11 -04:00
Jessica Chowdhury
37c8386a51 fix: withinCollapsible should be undefined by default (#6666)
## Description

Closes #6658

`withinCollapsible` from the collapsible provider is `true` by default,
should be undefined.
2024-06-11 15:48:46 -04:00
Patrik
2f9ed34d13 fix: only use metadata.pages for height if animated (#6729)
## Description

### Issue: 

Non-animated webp / gif files were using `metadata.pages` to calculate
it's resized heights for `imageSizes` or `cropping`.

### Fix: 

It should only use this to calculate it's height if the file's
`metadata` contains `metadata.pages`. Non-animated webps and gifs would
not have this.

- [x] I have read and understand the
[CONTRIBUTING.md](https://github.com/payloadcms/payload/blob/main/CONTRIBUTING.md)
document in this repository.

## Type of change

- [x] Bug fix (non-breaking change which fixes an issue)

## Checklist:

- [x] Existing test suite passes locally with my changes
2024-06-11 13:46:12 -04:00
Patrik
921a5c065d fix: create sharp file for fileHasAdjustments files or fileIsAnimated files (#6710)
## Description

V3 PR [here](https://github.com/payloadcms/payload/pull/6708)

- [x] I have read and understand the
[CONTRIBUTING.md](https://github.com/payloadcms/payload/blob/main/CONTRIBUTING.md)
document in this repository.

## Type of change

- [x] Bug fix (non-breaking change which fixes an issue)

## Checklist:

- [x] Existing test suite passes locally with my changes
2024-06-11 10:57:59 -04:00
Patrik
e3003b443f fix: adds multi select inputs for number & text fields in where builder (#6662)
## Description

### Issue: 
The `in` & `not_in` operators were not properly working for `number` &
`text` fields as this operator requires an `array` of values for it's
input.

### Fix: 
Conditionally renders a multi select input for `number` & `text` fields
when filtering by `in` & `not_in` operators.

Also, improves the UX of the where builder by now clearing the `params`
from the where query when a user clears the `value` from the filter
value input or when updating the `operator` in the operator dropdown.
2024-06-10 16:08:25 -04:00
Patrik
8a622984e7 fix: handles localized nested relationship fields in versions (#6679)
## Description

### Issue: 

When `localization` is `true` and a `relationship` field is nested, in
versions the title of the relationship field was returning as `[Object
object]` instead of the correct locale version.

Before:
![Screenshot 2024-06-07 at 3 45
32 PM](https://github.com/payloadcms/payload/assets/35232443/fe5df9fd-f16b-4231-8ad4-b76eb795f6bf)

### Fix:

Recursively loop through fields and find the desired field regardless of
its nesting level.

After:
![Screenshot 2024-06-07 at 3 45
48 PM](https://github.com/payloadcms/payload/assets/35232443/d5fc942f-b26f-4bd9-a679-6b77b3e7ec75)

- [x] I have read and understand the
[CONTRIBUTING.md](https://github.com/payloadcms/payload/blob/main/CONTRIBUTING.md)
document in this repository.

## Type of change

- [x] Bug fix (non-breaking change which fixes an issue)

## Checklist:

- [x] Existing test suite passes locally with my changes
2024-06-10 16:04:52 -04:00
Patrik
507e0954b2 fix: removes array & blocks & group fields from sort (#6574)
## Description

Fixes #6469 

- [x] I have read and understand the
[CONTRIBUTING.md](https://github.com/payloadcms/payload/blob/main/CONTRIBUTING.md)
document in this repository.

## Type of change

- [x] Bug fix (non-breaking change which fixes an issue)

## Checklist:

- [x] Existing test suite passes locally with my changes
2024-06-10 14:08:48 -04:00
wkd
63bc6ae52f fix: enable SaveDraft button when creating new documents (#6672)
## Description

Fixes #6671, which looks like a regression introduced in v2.19.0 that
disables the "save draft" button when creating new documents.


8f03cd7c78 (diff-b7c978f47b1f3beff95c78ad95078e600624cbcd7ac10f9378cc4ad6803db244L75-R79)
2024-06-10 13:38:37 -04:00
Elliot DeNolf
d016fbd2a5 chore(templates): update lock files (#6707)
Update template lock files

Fixes #6692
2024-06-10 11:00:46 -04:00
Jacob Fletcher
9525511e8b fix: live preview device position when using zoom (#6667) 2024-06-07 09:47:35 -04:00
Elliot DeNolf
1e834e58a4 chore(release): payload/2.19.3 [skip ci] 2024-06-07 09:44:02 -04:00
Jarrod Flesch
373cb00139 fix: scopes uploadEdits to documents, hoists action to doc provider (#6664)
Fixes https://github.com/payloadcms/payload/issues/6545

### Description
Correctly scopes upload edits to a single doc, previously they were
stored on the top level document.

- Removes formQueryParams in favor of an upload edit provider.
- Hoists the document `action` up to the doc provider
2024-06-07 09:12:19 -04:00
Elliot DeNolf
558b298bf0 chore(release): payload/2.19.2 [skip ci] 2024-06-06 12:08:04 -04:00
Jacob Fletcher
cd24e2bb3c docs: adds live preview csp troubleshooting tips (#6656) 2024-06-06 11:04:53 -04:00
Jarrod Flesch
ac8c2096af fix: cascade draft arg when querying globals with graphql (#6651) 2024-06-06 10:36:33 -04:00
Patrik
626be15578 fix: filtered out disableListColumn fields reappeared after toggling other fields (#6636)
## Description

There was an issue with fields w/ the `admin.disableListColumn` prop
reappearing in the column selector after toggling other fields in the
column selector.

This PR makes sure fields with `admin.disableListColumn` set to `true`
do not reappear under any circumstance.

- [x] I have read and understand the
[CONTRIBUTING.md](https://github.com/payloadcms/payload/blob/main/CONTRIBUTING.md)
document in this repository.

## Type of change

- [x] Bug fix (non-breaking change which fixes an issue)

## Checklist:

- [x] I have added tests that prove my fix is effective or that my
feature works
- [x] Existing test suite passes locally with my changes
2024-06-05 11:17:34 -04:00
Patrik
67c0b0e6e0 fix: resizing animated images (#6621)
Fixes #2181 #6146
2024-06-04 13:56:21 -04:00
Elliot DeNolf
11239103a6 chore(release): bundler-webpack/1.0.7 [skip ci] 2024-06-04 11:14:40 -04:00
Elliot DeNolf
4998ef8c9b chore(release): payload/2.19.1 [skip ci] 2024-06-04 11:13:38 -04:00
Alessio Gravili
e44ce819ce fix: override ajv dependency version to 8.14.0 wherever possible (#6618)
ajv issue: https://github.com/ajv-validator/ajv/issues/2446

This also removes css-minimizer-webpack-plugin which is not used within
bundler-webpack
2024-06-04 10:54:42 -04:00
Elliot DeNolf
b700208b98 chore(release): payload/2.19.0 [skip ci] 2024-06-03 22:49:24 -04:00
Alessio Gravili
4a54aa7776 fix: pin ajv to 8.14.0, as 8.15.0 is broken (#6607) 2024-06-03 20:22:24 -04:00
hasanbeder
4fddea86eb feat(translations): update Turkish translations (#5738)
chore(i18n): This commit enriches the application by integrating Turkish
language support, enhancing accessibility and user experience for
Turkish-speaking audiences. 🇹🇷

Co-authored-by: Elliot DeNolf <denolfe@users.noreply.github.com>
2024-05-30 12:36:26 -04:00
Jan Jakub Sasinka
547acfe876 fix: pagination on polymorphic relationship field requesting entries with page parameter set to NaN (#5366)
## Description
Fixes [5362](https://github.com/payloadcms/payload/issues/5362)

- [x] I have read and understand the
[CONTRIBUTING.md](https://github.com/payloadcms/payload/blob/main/CONTRIBUTING.md)
document in this repository.

## Type of change
- [x] Bug fix (non-breaking change which fixes an issue)

## Checklist:

- [x] I have added tests that prove my fix is effective or that my
feature works
- [x] Existing test suite passes locally with my changes
2024-05-30 11:51:56 -04:00
Patrik
56c6700cf2 fix: adds new userEmailAlreadyRegistered translations (#6549)
## Description

Fixes #6535 

- [x] I have read and understand the
[CONTRIBUTING.md](https://github.com/payloadcms/payload/blob/main/CONTRIBUTING.md)
document in this repository.

## Type of change

- [x] Bug fix (non-breaking change which fixes an issue)

## Checklist:

- [x] Existing test suite passes locally with my changes
2024-05-30 09:36:18 -04:00
Patrik
a352ebc552 fix: adjusts sizing of remove/add buttons to be same size (#6527)
## Description

Fixes #6098 

`Remove` / `Add` buttons are a bit different in size and different
viewpoints.

Before:
![Screenshot 2024-05-28 at 9 06
44 AM](https://github.com/payloadcms/payload/assets/35232443/483b6773-5877-4da2-96d7-43ba701cc138)

![Screenshot 2024-05-28 at 9 06
33 AM](https://github.com/payloadcms/payload/assets/35232443/3a0f55ed-dd83-4ba9-8dc3-58d7378eb7f5)


After:
![Screenshot 2024-05-28 at 9 07
20 AM](https://github.com/payloadcms/payload/assets/35232443/3986544d-ab4c-405c-871a-1fa94b5a49ae)



- [x] I have read and understand the
[CONTRIBUTING.md](https://github.com/payloadcms/payload/blob/main/CONTRIBUTING.md)
document in this repository.

## Type of change

- [x] Bug fix (non-breaking change which fixes an issue)

## Checklist:

- [x] Existing test suite passes locally with my changes
2024-05-30 09:35:20 -04:00
Jessica Chowdhury
312b4a94c3 docs: adds sentry to plugin docs 2024-05-29 15:11:36 -04:00
Jacob Fletcher
cb3dbed127 docs: renames vercel visual editing to vercel content link (#6556) 2024-05-29 13:34:29 -04:00
Elliot DeNolf
3a73a9696f ci: stale workflow evals assigned [skip ci] 2024-05-29 13:14:26 -04:00
Elliot DeNolf
d587441e80 ci: update create by with usernames 2024-05-29 13:13:59 -04:00
Elliot DeNolf
fcfc3c593f fix: focalPoint undefined handling (#6552)
Better undefined handling on incoming focalPoint
2024-05-29 12:44:58 -04:00
Elliot DeNolf
baf945b1ea ci: remove needs-triage on issue assigned 2024-05-28 15:20:16 -04:00
Patrik
4f9d78df5e fix: safely evaluates field.admin in WhereBuilder (#6534)
## Description

Safely evaluates `field.admin` in WhereBuilder

- [x] I have read and understand the
[CONTRIBUTING.md](https://github.com/payloadcms/payload/blob/main/CONTRIBUTING.md)
document in this repository.

## Type of change

- [x] Bug fix (non-breaking change which fixes an issue)

## Checklist:

- [x] Existing test suite passes locally with my changes
2024-05-28 11:18:54 -04:00
Dan Ribbens
f07783a279 chore: move db-example to examples (#6532)
- Moved to examples
- Removed unnecessary dependencies
- Improved the readme with instructions for writing the db adapter
2024-05-28 10:28:18 -04:00
Patrik
eeddeceda9 fix: ui field validation error with admin.disableListColumn property (#6530)
## Description

Fixes #6521 

- [x] I have read and understand the
[CONTRIBUTING.md](https://github.com/payloadcms/payload/blob/main/CONTRIBUTING.md)
document in this repository.

## Type of change

- [x] Bug fix (non-breaking change which fixes an issue)
- [x] This change requires a documentation update

## Checklist:

- [x] Existing test suite passes locally with my changes
- [x] I have made corresponding changes to the documentation
2024-05-28 10:25:40 -04:00
Elliot DeNolf
4c832ad984 ci: update status labels on issue change 2024-05-26 22:00:26 -04:00
Elliot DeNolf
81bc777dfe chore: update v2 issue template to use new tag 2024-05-26 08:04:20 -04:00
Patrik
a757635bc7 chore: db-example (#6495)
## Description

Adds `db-example` repo

- [x] I have read and understand the
[CONTRIBUTING.md](https://github.com/payloadcms/payload/blob/main/CONTRIBUTING.md)
document in this repository.

## Type of change

- [x] Chore (non-breaking change which does not add functionality)

## Checklist:

- [x] Existing test suite passes locally with my changes

---------

Co-authored-by: Elliot DeNolf <denolfe@gmail.com>
2024-05-24 12:16:34 -04:00
Elliot DeNolf
80bf0a3067 chore: label updates [skip ci] 2024-05-24 09:31:51 -04:00
Elliot DeNolf
a06c06415c ci: increase stale operations-per-run 2024-05-23 09:09:50 -04:00
Elliot DeNolf
2dd7e82fdc ci: add stale workflow in debug mode 2024-05-22 16:43:17 -04:00
Donovan Glover
63e04e2ae0 fix(editorconfig): use off for max_line_length (#4713)
Fixes "invalid value for option max_line_length: null"

See:
https://github.com/editorconfig/editorconfig/wiki/EditorConfig-Properties#max_line_length
2024-05-22 15:28:14 -04:00
Elliot DeNolf
e71888a625 chore: add label-author.yml 2024-05-21 23:03:14 -04:00
Patrik
c5514f1441 chore(bundler-webpack): updates webpack-dev-middleware dependency (#6446)
## Description

`pnpm audit` of `bundler-webpack` showed a high severity security issue
with the `webpack-dev-middleware` package

Updated package to latest to resolve.

- [x] I have read and understand the
[CONTRIBUTING.md](https://github.com/payloadcms/payload/blob/main/CONTRIBUTING.md)
document in this repository.

## Type of change

- [x] Bug fix (non-breaking change which fixes an issue)

## Checklist:

- [x] Existing test suite passes locally with my changes
2024-05-21 16:08:00 -04:00
Elliot DeNolf
23e2fe643e chore: v3 bug template ids update 2024-05-21 11:56:17 -04:00
Elliot DeNolf
bdef2f1bc7 chore: add v3 bug template 2024-05-21 11:54:26 -04:00
Jessica Chowdhury
8f03cd7c78 fix(ui): blocks browser save dialog from opening when hotkey used with no changes (#6365)
## Description

Related issue
[#214](https://github.com/payloadcms/payload-3.0-demo/issues/214) (3.0).

Using the `cmd+s` hotkey in the Edit Document view was opening the
_browser_ save dialogue when no changes had been made.

This change triggers a toast info banner with `No changes to save` and
adds translated string for other languages.

PR for 3.0 is [here](https://github.com/payloadcms/payload/pull/6366).

- [X] I have read and understand the
[CONTRIBUTING.md](https://github.com/payloadcms/payload/blob/main/CONTRIBUTING.md)
document in this repository.

## Type of change

- [X] Chore (non-breaking change which does not add functionality)

## Checklist:

- [X] Existing test suite passes locally with my changes
2024-05-21 14:07:47 +01:00
Anders Semb Hermansen
c0092191a6 fix: separate sort and search fields when looking up relationship. (#5964)
## Description

Default sort is used as searching field which is causing unexpected
behaviour described in #4815 and #5222 This bugfix separates which field
is used for sorting and which is used for searching.

Fixes: #4815 #5222

- [X] I have read and understand the
[CONTRIBUTING.md](https://github.com/payloadcms/payload/blob/main/CONTRIBUTING.md)
document in this repository.

## Type of change

- [X] Bug fix (non-breaking change which fixes an issue)

## Checklist:

- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] Existing test suite passes locally with my changes
- [ ] I have made corresponding changes to the documentation
2024-05-20 15:59:54 -04:00
Elliot DeNolf
b9854ed60a chore(release): db-postgres/0.8.4 [skip ci] 2024-05-17 14:36:02 -04:00
Elliot DeNolf
576ee14976 chore(release): payload/2.18.3 [skip ci] 2024-05-17 14:33:14 -04:00
Dan Ribbens
bf77cec7e9 fix(db-postgres): query with like on id columns (#6416)
copy of https://github.com/payloadcms/payload/pull/6414 to main
2024-05-17 14:07:57 -04:00
Patrik
ab8b2f3fb8 fix: nested disableListColumn in rows (#6412)
## Description

Fixes #6407 

- [x] I have read and understand the
[CONTRIBUTING.md](https://github.com/payloadcms/payload/blob/main/CONTRIBUTING.md)
document in this repository.

## Type of change

- [x] Bug fix (non-breaking change which fixes an issue)

## Checklist:

- [x] I have added tests that prove my fix is effective or that my
feature works
- [x] Existing test suite passes locally with my changes
2024-05-17 14:01:08 -04:00
Patrik
db5f3f3ccd fix(db-postgres): uuid custom db name (#6409)
## Description

Fixes an issue with creating versions when using custom DB names,
`uuid`, and drafts.

v3 PR [here](https://github.com/payloadcms/payload/pull/6408)

- [x] I have read and understand the
[CONTRIBUTING.md](https://github.com/payloadcms/payload/blob/main/CONTRIBUTING.md)
document in this repository.

## Type of change

- [x] Bug fix (non-breaking change which fixes an issue)

## Checklist:

- [x] Existing test suite passes locally with my changes
2024-05-17 13:58:08 -04:00
Francis Turmel
cece39957f chore(i18n): French translation improvements (#6035)
## Description

see #6406 for the changes against `beta`

* The apostrophe character `’` should be used instead of the single
quote `'`
* Gender corrections: "L’adresse e-mail fourni**e**", "Vérification
échoué**e**"
* Lowercase: "Supprimer le **té**léversement"
* Dark and light theme: I think it makes more sense to use "Sombre" and
"Clair" here to identify the theme. Day/Night modes imply a hue/warmth
correction and are different features altogether. Reference:
https://fr.wikipedia.org/wiki/Mode_sombre#Mode_sombre_et_mode_nuit_ou_chaud
* Fix accent: "Mis à jour avec succ**è**s"
* "Bienvenue" I think would be the correct standalone greeting form.
Reference:
https://www.projet-voltaire.fr/question-orthographe/orthographe-bienvenu-bienvenue-chez-moi/
* "Recadrer" is the correct word for "crop". "Récolte" means "crop" in
the sense of "harvest", so this was probably a bad literal Google
Translate that slipped through.
* Correct all "Es-tu sûr ?" to the proper formal "Êtes-vous sûr ?" for
consistency
* Use _article défini_ since we will enumerate the values: "Ce champ
contient **les** sélections invalides suivantes :"
* Space before question marks

---

<!-- Please include a summary of the pull request and any related issues
it fixes. Please also include relevant motivation and context. -->

- [x] I have read and understand the
[CONTRIBUTING.md](https://github.com/payloadcms/payload/blob/main/CONTRIBUTING.md)
document in this repository.

## Type of change

<!-- Please delete options that are not relevant. -->

- [x] 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](https://github.com/payloadcms/payload/tree/main/templates)
directory (does not affect core functionality)
- [ ] Change to the
[examples](https://github.com/payloadcms/payload/tree/main/examples)
directory (does not affect core functionality)
- [ ] This change requires a documentation update

## Checklist:

- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] Existing test suite passes locally with my changes
- [ ] I have made corresponding changes to the documentation
2024-05-17 13:51:47 -03:00
Elliot DeNolf
157fff0417 chore(release): payload/2.18.2 [skip ci] 2024-05-17 10:09:35 -04:00
Elliot DeNolf
88e113a545 fix: allow focal point when no sizes defined (#6397)
Allow focal points to be saved even when no imageSizes are defined.
Expands upon #6364 .
2024-05-17 09:06:42 -04:00
Elliot DeNolf
d33afe48fe chore(release): payload/2.18.1 [skip ci] 2024-05-16 15:46:23 -04:00
Elliot DeNolf
e76df32f09 fix: add back explicit crop x and y values (#6391)
Cropping x and y values pulling from the UI were unintentionally removed
in #6364
2024-05-16 15:32:36 -04:00
Elliot DeNolf
b068f30f51 chore(release): richtext-lexical/0.11.1 [skip ci] 2024-05-16 14:05:28 -04:00
Elliot DeNolf
82bd5c656f chore(release): db-postgres/0.8.3 [skip ci] 2024-05-16 14:05:16 -04:00
Elliot DeNolf
afe8992ca6 chore(release): payload/2.18.0 [skip ci] 2024-05-16 14:04:05 -04:00
Alessio Gravili
48a410e294 fix(richtext-lexical): upload, relationship and block node insertion fails sometimes (#6390)
Backport of https://github.com/payloadcms/payload/pull/6389
2024-05-16 13:34:43 -04:00
Elliot DeNolf
82b88a315f feat: store focal point on uploads (#6364)
Store focal point data on uploads as `focalX` and `focalY`

Addresses https://github.com/payloadcms/payload/discussions/4082
2024-05-16 11:58:49 -04:00
Patrik
cc94078607 fix: filter with ID not_in AND queries - postgres (#6358)
## Description

Fixes #5151 

`Issue`: With `Postgres`, when filtering by two queries with `AND`, if
the first query involved `ID` and the `not_in` operator, the second
query in the filter would never be evaluated.

- [x] I have read and understand the
[CONTRIBUTING.md](https://github.com/payloadcms/payload/blob/main/CONTRIBUTING.md)
document in this repository.

## Type of change

- [x] Bug fix (non-breaking change which fixes an issue)

## Checklist:

- [x] I have added tests that prove my fix is effective or that my
feature works
- [x] Existing test suite passes locally with my changes
2024-05-15 15:09:53 -04:00
Elliot DeNolf
1c30ad73b6 chore(release): richtext-lexical/0.11.0 [skip ci] 2024-05-15 11:35:05 -04:00
Elliot DeNolf
d9442dcce3 chore(release): payload/2.17.0 [skip ci] 2024-05-15 11:33:53 -04:00
Patrik
de92c50847 fix: safely access cookie header for uploads (#6367)
## Description

Issue with editing and changing the crop or focal point of an image

`Error`:

```
ERROR (payload): FileRetrievalError: There was a problem while uploading the file. Cannot read properties of undefined (reading 'cookie')
    at generateFileData (/node_modules/payload/src/uploads/generateFileData.ts:86:15)
```
(`payload v2.16.1` and `plugin-cloud v3.0.1`)

Fix: add optional chaing to safely access `cookie` header when fetching
image

- [x] I have read and understand the
[CONTRIBUTING.md](https://github.com/payloadcms/payload/blob/main/CONTRIBUTING.md)
document in this repository.

## Type of change

- [x] Bug fix (non-breaking change which fixes an issue)

## Checklist:

- [x] Existing test suite passes locally with my changes
2024-05-15 10:50:14 -04:00
Jacob Fletcher
b7f5f932f6 fix(examples/live-preview): regenerates yarn lockfiles (#6356) 2024-05-14 15:27:51 -04:00
Jessica Chowdhury
bc9e591e37 chore: removes letter spacing in loading overlay for script languages (#4769) 2024-05-14 16:51:34 +01:00
Jessica Chowdhury
ad38011348 chore: fix api preview indentation (#6152) 2024-05-14 16:09:17 +01:00
Patrik
d02b1fb084 fix: step-nav breadcrumbs ellipsis (#6345) 2024-05-14 11:08:59 -04:00
Jessica Chowdhury
51efe4f39b fix: collection labels with locales not working when creating new doc (#5995) 2024-05-14 10:45:39 -04:00
Jessica Chowdhury
30e535b5b9 feat: adds misc translations to API view and react select (#6138) 2024-05-13 08:52:12 -04:00
Jessica Chowdhury
4bd3bb9400 chore: adds translations for checkbox field in collection view (#6167) 2024-05-13 12:31:36 +01:00
Patrik
69c93d3c62 fix: appends editDepth value to radio & checkbox IDs when inside drawer (#6181) 2024-05-10 11:24:21 -04:00
Elliot DeNolf
78aa957043 fix(plugin-object-ids): add webpack to dev deps 2024-05-10 11:02:29 -04:00
Patrik
cd06c022c0 feat(plugin-relationship-object-ids): adds plugin-relationship-object-ids package (#6044) 2024-05-10 10:39:47 -04:00
Jacob Fletcher
8299e9fc33 docs(examples): adds examples docs (#6312) 2024-05-10 10:22:22 -04:00
Alessio Gravili
9df5ab8a10 feat(richtext-lexical)!: remove LexicalBlock, RichTextFieldRequiredEditor and FieldWithRichTextRequiredEditor types (#6279)
BREAKING:

`LexicalBlock`, `RichTextFieldRequiredEditor` and `FieldWithRichTextRequiredEditor` types have been removed. Instead of `LexicalBlock`, use `Block`. Instead of `RichTextFieldRequiredEditor`, use `RichTextField`. And instead of `FieldWithRichTextRequiredEditor`, use `Field`.
2024-05-09 09:46:03 -04:00
Elliot DeNolf
6979f5a1b1 ci: register release-canary workflow 2024-05-09 09:22:18 -04:00
Elliot DeNolf
723791b94f chore(release): richtext-lexical/0.10.0 [skip ci] 2024-05-07 15:53:11 -04:00
Elliot DeNolf
aa3833ec83 chore(release): payload/2.16.1 [skip ci] 2024-05-07 15:52:06 -04:00
Dan Ribbens
2972af2af1 chore: add index to version status field (#6256) 2024-05-07 15:47:55 -04:00
Alessio Gravili
857b9a4ac3 feat(richtext-lexical): add maxDepth property to various lexical features (#6250)
Backports #6242
2024-05-07 09:39:48 -04:00
Alessio Gravili
f829b084ba fix(richtext-lexical): export missing HorizontalRuleFeature (#6236) 2024-05-06 13:54:49 -04:00
Elliot DeNolf
6ae682698d chore(release): payload/2.16.0 [skip ci] 2024-05-06 12:47:28 -04:00
Francisco Lourenço
622cdb0440 fix: hide drag handles when admin.isSortable: false (#6225)
Co-authored-by: Kendell Joseph <kendelljoseph@gmail.com>
2024-05-06 12:21:35 -04:00
Jarrod Flesch
cac52da638 fix: graphql upload relations returning null (#6233) 2024-05-06 11:58:48 -04:00
DracoBlue
3cb3c1aceb docs(plugin-cloud): Fix link to local-dev.md (#6222) 2024-05-05 22:27:26 -04:00
Patrik
db4aacebb8 feat: adds disableListColumn, disableListFilter to fields admin props (#6188) 2024-05-03 16:49:06 -04:00
Paul
b735d6aa16 fix(plugin-form-builder): hook overrides not working as intended (#6203) 2024-05-03 17:36:03 -03:00
Elliot DeNolf
fbec3a33e0 chore(release): richtext-slate/1.5.2 [skip ci] 2024-05-03 11:23:16 -04:00
Elliot DeNolf
034be89bdb chore(release): richtext-lexical/0.9.3 [skip ci] 2024-05-03 11:23:00 -04:00
Elliot DeNolf
1f2af0963b chore(release): plugin-cloud/3.0.1 [skip ci] 2024-05-03 11:22:42 -04:00
Elliot DeNolf
20f1ece2d7 chore(release): payload/2.15.0 [skip ci] 2024-05-03 11:21:26 -04:00
Jessica Chowdhury
2be5ad0eba fix: hide unusable fields from collection filter select (#6135) 2024-05-03 11:01:47 -04:00
Kendell Joseph
5c58bd322d feat: add isSortable to arrays and blocks (#5962) 2024-05-03 10:38:02 -04:00
Dan Ribbens
23f3eb1cf0 feat: use filterOptions in list relationship filter (#6156) 2024-05-03 10:26:49 -04:00
Patrik
af67749e49 fix: incorrect localesNotSaved translation (#5996) 2024-05-03 10:22:06 -04:00
Patrik
43dab5c705 fix: sanitizes fields in default edit view for drawer content (#6175) 2024-05-03 10:16:24 -04:00
Patrik
9b7e62dc20 fix: properly adds readonly styles to disabled radio fields (#6176) 2024-05-03 10:07:52 -04:00
Patrik
6e38cc2bcf fix: resets filter state when param state change within route (#6169) 2024-05-02 13:21:51 -04:00
Tylan Davis
83551bfcaa docs: adjust line breaks in code blocks - v2 (#6002) 2024-05-01 15:58:15 -04:00
Francisco Lourenço
7b44d9d28a docs: fix outdated #aliasing-server-only-modules urls (#5014) 2024-05-01 15:52:18 -04:00
ovalice
182d5db6de docs: Fix RowLabel code snippet that causes compilation error (#4947)
Co-authored-by: smarten <user@example.com>
2024-05-01 15:42:43 -04:00
Mina Sameh
93109ec84a docs: edit code of generate email subject in verify auth section (#4607) 2024-05-01 15:31:24 -04:00
Take Weiland
4d9e0f35f0 docs: clarify docs around direction transaction access (#3648) 2024-05-01 15:22:48 -04:00
Carlo Taleon
19327c8d6d docs: slate linebreak serialization in 'Generating HTML' example (#3804) 2024-05-01 15:21:03 -04:00
Elliot DeNolf
831f1ff5be fix(plugin-cloud): purge cache for all sizes (#5301) 2024-05-01 15:15:16 -04:00
Jarrod Flesch
a8ac8b4633 fix: cascade draft arg in nested GraphQL relationship queries (#6141) 2024-04-30 14:19:20 -04:00
Alessio Gravili
36b1f5a763 fix(richtext-lexical): floating toolbar caret positioned incorrectly for some line heights (#6151) 2024-04-30 12:06:02 -04:00
Alessio Gravili
24f697219b fix(richtext-lexical): drag and add block handles disappear too quickly for smaller screen sizes. (#6145) 2024-04-30 10:52:37 -04:00
Jarrod Flesch
3fccd34abe fix: GraphQL nested relationships not respecting req locale (#6117) 2024-04-29 16:32:33 -04:00
Friggo
a38f8e93a6 chore: Czech translation improvement (#6079) 2024-04-28 07:57:47 -04:00
Dan Ribbens
84570e6e3b fix: bulk publish from collection list (#6063) 2024-04-28 07:30:37 -04:00
Friggo
5ad8e0edcb chore: Czech translation improvements (#6077) 2024-04-28 07:27:26 -04:00
Jarrod Flesch
91bac9c0aa fix: version restoration (#6039) 2024-04-26 16:15:14 -04:00
Elliot DeNolf
33f6edc9d5 chore(release): richtext-slate/1.5.1 [skip ci] 2024-04-26 16:05:01 -04:00
Elliot DeNolf
e1f91f5170 chore(release): richtext-lexical/0.9.2 [skip ci] 2024-04-26 16:04:37 -04:00
Elliot DeNolf
0e75dfb5c1 chore(release): plugin-stripe/0.0.17 [skip ci] 2024-04-26 16:04:29 -04:00
Elliot DeNolf
1300e264be chore(release): plugin-seo/2.3.2 [skip ci] 2024-04-26 16:04:21 -04:00
Elliot DeNolf
5600125de7 chore(release): plugin-search/1.1.1 [skip ci] 2024-04-26 16:04:14 -04:00
Elliot DeNolf
22e270f89c chore(release): plugin-redirects/1.0.2 [skip ci] 2024-04-26 16:04:06 -04:00
Elliot DeNolf
593f82bcba chore(release): plugin-form-builder/1.2.2 [skip ci] 2024-04-26 16:03:58 -04:00
Elliot DeNolf
cbf3da1144 chore(release): bundler-vite/0.1.7 [skip ci] 2024-04-26 16:03:49 -04:00
Elliot DeNolf
1a2aab4126 chore(release): payload/2.14.2 [skip ci] 2024-04-26 16:01:09 -04:00
Jacob Fletcher
d0ba694c80 fix(deps): dedupes react (#6058) 2024-04-26 11:43:14 -04:00
Elliot DeNolf
d78df36d9b ci(scripts): safer package details retrieval 2024-04-25 14:50:01 -04:00
Elliot DeNolf
02572d945a chore(release): db-postgres/0.8.2 [skip ci] 2024-04-25 14:39:37 -04:00
Elliot DeNolf
f05a433320 chore(release): richtext-lexical/0.9.1 [skip ci] 2024-04-25 14:38:56 -04:00
Elliot DeNolf
9ce3b3ab29 chore(release): db-mongodb/1.5.1 [skip ci] 2024-04-25 14:38:44 -04:00
Elliot DeNolf
ade637befb chore(release): payload/2.14.1 [skip ci] 2024-04-25 14:37:27 -04:00
Dan Ribbens
c31b8dcaa0 fix(db-postgres): cummulative updates (#6033) 2024-04-25 13:05:49 -04:00
Dan Ribbens
0ffdcc685f fix: disable api key checkbox does not remove api key (#6017) 2024-04-25 09:39:09 -04:00
James Mikrut
881119ba3a Update README.md (#6028) 2024-04-25 09:35:41 -04:00
Alessio Gravili
60372faf36 fix(richtext-lexical): minimize the amount of times sanitizeFields is called (#6018) 2024-04-24 17:51:14 -04:00
Elliot DeNolf
8bca0b0b86 chore(release): db-postgres/0.8.1 [skip ci] 2024-04-24 15:41:48 -04:00
Elliot DeNolf
87a1d698b2 chore(release): payload/2.14.0 [skip ci] 2024-04-24 15:40:04 -04:00
Dan Ribbens
c11600aac3 fix: bulk publish (#6006) 2024-04-24 15:04:50 -04:00
Elliot DeNolf
ad01c6784d fix: header filters (#5997) 2024-04-24 11:01:24 -04:00
Elliot DeNolf
62601c54a7 chore: update .vscode/settings.json 2024-04-24 08:59:45 -04:00
Elliot DeNolf
4a144ddc44 ci: register pr-title workflow 2024-04-23 23:31:13 -04:00
Patrik
9152a238d2 fix(db-postgres): row table names were not being built properly - v2 (#5961) 2024-04-22 16:56:03 -04:00
Mike Keefe
fc8b835264 docs: fix typo in admin custom components docs (#5944) 2024-04-21 20:39:32 -04:00
Elliot DeNolf
28ee5e34c3 chore(readme): add 3.0 beta announcement [skip ci] 2024-04-21 16:54:26 -04:00
Ricardo Domingues
e25886649f fix(db-postgres): Fixes nested groups inside nested blocks (#5882)
Co-authored-by: Dan Ribbens <dan.ribbens@gmail.com>
2024-04-21 00:18:25 -04:00
Rafał Nawojczyk
985796be54 fix: min/max attributes missing from number input (#5779) 2024-04-20 23:36:32 -04:00
Dan Ribbens
bd8b5123b0 fix(db-postgres): extra version suffix added to table names (#5939) 2024-04-20 23:23:31 -04:00
Ritsu
c380deee4a feat: add count operation to collections (#5936) 2024-04-20 23:05:37 -04:00
Elliot DeNolf
0b12aac895 ci: bump actions node version (#5103) 2024-04-20 08:54:12 -04:00
Christian Gil
90d3f178ab feat(live-preview-vue): Vue Hook for Live Preview (#5925) 2024-04-20 06:45:18 -04:00
Patrik
a8c9625cde fix: removes equals & not_equals operators from fields with hasMany (#5885) 2024-04-19 11:41:39 -04:00
Elliot DeNolf
938d069523 chore(release): plugin-seo/2.3.1 [skip ci] 2024-04-19 11:38:41 -04:00
Elliot DeNolf
1a337ec223 chore(release): richtext-lexical/0.9.0 [skip ci] 2024-04-19 11:38:09 -04:00
Elliot DeNolf
08f372e6c2 chore(release): db-postgres/0.8.0 [skip ci] 2024-04-19 11:37:56 -04:00
Elliot DeNolf
2994269f22 chore(release): db-mongodb/1.5.0 [skip ci] 2024-04-19 11:37:43 -04:00
Elliot DeNolf
8d1a706928 chore(release): payload/2.13.0 [skip ci] 2024-04-19 11:36:17 -04:00
Pan
fcb29bb1c6 feat(plugin-seo): add Chinese translation (#5429) 2024-04-19 11:13:26 -04:00
Kendell Joseph
2c402cc65c feat: json field schemas (#5726) 2024-04-19 10:45:40 -04:00
Elliot DeNolf
ad38f76011 fix: properly handle drafts in bulk update (#5872)
Co-authored-by: Dan Ribbens <dan.ribbens@gmail.com>
2024-04-19 10:08:26 -04:00
Jessica Chowdhury
b974a2c042 chore(i18n): adds document translation key (#5889) 2024-04-18 10:17:35 +01:00
Dan Ribbens
cb8d562132 fix(db-mongodb): ignore end session errors (#5904) 2024-04-17 16:44:15 -04:00
Patrik
1f0036054a fix: adds type error validations for email and password in login operation (#4852) 2024-04-17 16:31:35 -04:00
Elliot DeNolf
aaa4397351 ci: cut down on codeowners noise [skip ci] 2024-04-16 22:10:44 -04:00
Dan Ribbens
6185f8a5d8 fix(db-postgres): query hasMany fields with in (#5881) 2024-04-16 17:09:53 -04:00
Jacob Fletcher
e47e544364 fix(plugin-seo): uses correct key for ukrainian translation (#5873) 2024-04-16 11:16:33 -04:00
Bohdan Kucheriavyi
2e80350a5a chore(plugin-seo): adds Ukrainian translations (#5843)
Signed-off-by: Bohdan Kucheriavyi <bohdan.kucheriavyi@zapal.tech>
2024-04-16 09:31:18 -04:00
Ritsu
4c4f924e90 fix(db-postgres): validateExistingBlockIsIdentical localized (#5839) 2024-04-15 16:49:43 -04:00
Elliot DeNolf
170957c380 feat: allow configuration for setting headers on external file fetch (#5865) 2024-04-15 15:09:00 -04:00
Elliot DeNolf
9061ae05e7 docs: add externalFileHeaderFilter 2024-04-15 15:08:03 -04:00
Dan Ribbens
fe0028c899 fix(db-mongodb): version fields indexSortableFields (#5863) 2024-04-15 14:46:06 -04:00
Elliot DeNolf
ec1ad0b662 feat: allow configuration for setting headers on external file fetch 2024-04-15 14:40:55 -04:00
Tylan Davis
e5f32562a3 docs: adds missing tick marks (#5858) 2024-04-15 13:06:17 -04:00
Tylan Davis
ba6100cbe8 docs: adds missing tick marks 2024-04-15 13:03:44 -04:00
Alessio Gravili
c08c8b5628 ci: add weird tune linux network step which seems to reduce flakes (#5857) 2024-04-15 12:38:38 -04:00
James Mikrut
9e918831d1 fix: number ids were not sanitized to number in rest api (#5794) 2024-04-15 11:02:36 -04:00
Patrik
25c9a145be fix: passes parent id instead of incoming id to saveVersion (#5831) 2024-04-15 10:42:36 -04:00
Alessio Gravili
3b1d331316 fix(richtext-lexical): use correct nodeType on HorizontalRule feature HTML converter (#5805) 2024-04-11 16:10:55 -04:00
Alessio Gravili
5aa68b5e5d feat(richtext-lexical): add HorizontalRuleFeature, improve block handle positioning (#5804) 2024-04-11 15:54:56 -04:00
Alessio Gravili
d8e9084db2 feat(richtext-lexical): add HorizontalRuleFeature 2024-04-11 15:37:45 -04:00
Dan Ribbens
65690a675c fix(db-postgres): relationship query pagination (#5802) 2024-04-11 15:37:19 -04:00
PatrikKozak
9530d28a67 fix: updates var 2024-04-11 15:08:24 -04:00
PatrikKozak
509ec677c4 fix: uses find instead of fieldIndex for custom ID check 2024-04-11 14:19:45 -04:00
Alessio Gravili
a00439ea89 fix(richtext-lexical): limit unnecessary floating handle positioning updates 2024-04-11 14:12:59 -04:00
Alessio Gravili
0055a8eb36 feat(richtext-lexical): improve floating handle y-positioning by positioning it in the center for smaller elements. 2024-04-11 13:50:24 -04:00
Alessio Gravili
de5d6cc4bd fix(richtext-lexical): incorrect floating handle y-position calculation next to certain kinds of HTML elements like HR 2024-04-11 12:29:49 -04:00
PatrikKozak
51f84a4fcf fix: number ids were not sanitized to number in rest api 2024-04-11 12:23:57 -04:00
Paul
c0ba6cc19a fix: use isolateObjectProperty function in createLocalReq (#5748) 2024-04-11 09:27:42 -04:00
Patrik
5fa99fb060 fix(db-mongodb): failing contains query with special chars (#5774) 2024-04-11 09:23:05 -04:00
Patrik
e3c3ddac34 fix: avoids getting and setting doc preferences when creating new (#5757) 2024-04-10 11:20:02 -04:00
Alessio Gravili
6186493246 fix(richtext-lexical)!: do not allow omitting editor prop for sub-richtext fields within lexical defined in the payload config (#5766)
**BREAKING:** Modifies fields types which are allowed to be passed in to upload, link, and blocks lexical features. Can break your types even if no sub-richText editor is passed in
2024-04-10 11:14:32 -04:00
Alessio Gravili
9b44296092 fix(richtext-lexical): catch errors that may occur during HTML generation (#5754) 2024-04-09 15:58:34 -04:00
Paul
cbd03ed2f8 fix: req.collection being lost when querying a global inside a collection (#5727) 2024-04-08 15:16:37 -03:00
Alessio Gravili
cf135fd1e4 fix(richtext-lexical): pass through config for schema generation. Makes it more robust (#5700) 2024-04-05 15:55:51 -04:00
Dan Ribbens
e7608f5507 fix: block field type missing dbName (#5695) 2024-04-05 15:52:06 -04:00
Alessio Gravili
608d6d0a87 fix(db-postgres): hasMany relationship query contains operator (#4212)
Co-authored-by: Dan Ribbens <dan.ribbens@gmail.com>
2024-04-05 13:59:00 -04:00
Dan Ribbens
9bbacc4fb1 feat: custom db table and enum names (#5045)
Co-authored-by: Ritsu <enjoythepain1337@gmail.com>
2024-04-05 11:22:46 -04:00
Patrik
7df7bf448b fix: updates type name of CustomPublishButtonProps to CustomPublishButtonType (#5644)
* fix: updates type name from CustomPublishButtonProps to CustomPublishButtonType

* fix: maps old name to new name
2024-04-04 16:55:18 -04:00
Paul
44599cbc7b fix(db-postgres): issue querying by localised relationship not respecting locale as constraint (#5666)
* fix: add table join for querying on a localised field in relationship fields

* chore: add int tests in relationships
2024-04-04 16:07:11 -03:00
Patrik
373787de31 fix: duplicate document multiple times in quick succession (#5642) 2024-04-04 14:06:29 -04:00
Patrik
c1c86009a5 fix: missing date locales (#5656) 2024-04-04 13:55:07 -04:00
Paul
6cf6ca3ea8 fix(website template): archiveBlock being populated with draft items by default, causing an error for graphql in the frontend (#5643)
* fix(website template): archiveBlock being populated with draft items by default, causing an error for graphql in the frontend
2024-04-03 19:34:36 -03:00
Elliot DeNolf
6706bdb140 chore(release): db-mongodb/1.4.4 [skip ci] 2024-04-03 14:54:53 -04:00
Elliot DeNolf
5caaa032bb chore(release): payload/2.12.1 [skip ci] 2024-04-03 14:37:42 -04:00
Elliot DeNolf
4cf8c5bd78 Merge pull request #5637 from payloadcms/chore/release-2.12.0
chore(release): 2.12.0
2024-04-03 14:34:55 -04:00
Elliot DeNolf
d6afee662b chore(release): db-postgres/0.7.1 [skip ci] 2024-04-03 14:27:20 -04:00
Elliot DeNolf
0fc62446b8 chore(release): richtext-slate/1.5.0 [skip ci] 2024-04-03 14:26:11 -04:00
Elliot DeNolf
823fde07c3 chore(release): richtext-lexical/0.8.0 [skip ci] 2024-04-03 14:25:56 -04:00
Elliot DeNolf
fe35b7d32c chore(release): plugin-seo/2.3.0 [skip ci] 2024-04-03 14:25:47 -04:00
Elliot DeNolf
3b45b0d085 chore(release): payload/2.12.0 [skip ci] 2024-04-03 14:24:24 -04:00
Yunsup Sim
742a7af93d fix: Skip parsing if operator is 'exist' (#5404) 2024-04-03 13:50:28 -04:00
Patrik
a7e7c92768 fix: updates colors of tooltip in light mode (#5632) 2024-04-03 13:47:08 -04:00
Patrik
e10d5df0b2 fix: sets beforeValidateHook req type to required (#5608) 2024-04-03 13:42:05 -04:00
Patrik
3023118b71 chore: updates comment in globals afterchange hook example (#5606) 2024-04-03 13:36:17 -04:00
Patrik
80375d1798 docs: updates incorrect rate limit from 90000 to 900000 (#5630) 2024-04-03 13:36:01 -04:00
Jørgen Kalsnes Hagen
589b492b2e feat(plugin-seo): adds Norwegian translation (#5621) 2024-04-03 13:27:17 -04:00
Elliot DeNolf
bdeef377ea ci: docker compose v2, v1 no longer supported on gh runner (#5623) 2024-04-03 11:28:47 -04:00
Elliot DeNolf
b76c5c8c11 chore: update all package.json repository urls 2024-04-03 11:06:42 -04:00
dependabot[bot]
58c9fecbae chore(deps): bump es5-ext in /examples/whitelabel (#5185)
Bumps [es5-ext](https://github.com/medikoo/es5-ext) from 0.10.62 to 0.10.64.
- [Release notes](https://github.com/medikoo/es5-ext/releases)
- [Changelog](https://github.com/medikoo/es5-ext/blob/main/CHANGELOG.md)
- [Commits](https://github.com/medikoo/es5-ext/compare/v0.10.62...v0.10.64)

---
updated-dependencies:
- dependency-name: es5-ext
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-03 10:01:57 -04:00
dependabot[bot]
e88de5db60 chore(deps): bump express from 4.18.2 to 4.19.2 in /templates/ecommerce (#5533)
Bumps [express](https://github.com/expressjs/express) from 4.18.2 to 4.19.2.
- [Release notes](https://github.com/expressjs/express/releases)
- [Changelog](https://github.com/expressjs/express/blob/master/History.md)
- [Commits](https://github.com/expressjs/express/compare/4.18.2...4.19.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-03 10:01:09 -04:00
dependabot[bot]
ce75fab4fc chore(deps): bump express from 4.18.2 to 4.19.2 in /examples/testing (#5541)
Bumps [express](https://github.com/expressjs/express) from 4.18.2 to 4.19.2.
- [Release notes](https://github.com/expressjs/express/releases)
- [Changelog](https://github.com/expressjs/express/blob/master/History.md)
- [Commits](https://github.com/expressjs/express/compare/4.18.2...4.19.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-03 10:00:26 -04:00
dependabot[bot]
5b57f1411a chore(deps): bump express from 4.18.2 to 4.19.2 in /examples/email (#5535)
Bumps [express](https://github.com/expressjs/express) from 4.18.2 to 4.19.2.
- [Release notes](https://github.com/expressjs/express/releases)
- [Changelog](https://github.com/expressjs/express/blob/master/History.md)
- [Commits](https://github.com/expressjs/express/compare/4.18.2...4.19.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-03 10:00:20 -04:00
dependabot[bot]
11ff2042f3 chore(deps): bump express from 4.18.2 to 4.19.2 in /templates/website (#5537)
Bumps [express](https://github.com/expressjs/express) from 4.18.2 to 4.19.2.
- [Release notes](https://github.com/expressjs/express/releases)
- [Changelog](https://github.com/expressjs/express/blob/master/History.md)
- [Commits](https://github.com/expressjs/express/compare/4.18.2...4.19.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-03 10:00:14 -04:00
dependabot[bot]
8f9481f8a7 chore(deps): bump express in /examples/redirects/payload (#5544)
Bumps [express](https://github.com/expressjs/express) from 4.18.2 to 4.19.2.
- [Release notes](https://github.com/expressjs/express/releases)
- [Changelog](https://github.com/expressjs/express/blob/master/History.md)
- [Commits](https://github.com/expressjs/express/compare/4.18.2...4.19.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-03 10:00:05 -04:00
dependabot[bot]
5de32b2534 chore(deps): bump es5-ext from 0.10.62 to 0.10.64 in /examples/hierarchy (#5198)
Bumps [es5-ext](https://github.com/medikoo/es5-ext) from 0.10.62 to 0.10.64.
- [Release notes](https://github.com/medikoo/es5-ext/releases)
- [Changelog](https://github.com/medikoo/es5-ext/blob/main/CHANGELOG.md)
- [Commits](https://github.com/medikoo/es5-ext/compare/v0.10.62...v0.10.64)

---
updated-dependencies:
- dependency-name: es5-ext
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-03 09:59:37 -04:00
dependabot[bot]
dbcffc688f chore(deps): bump es5-ext in /examples/draft-preview/payload (#5192)
Bumps [es5-ext](https://github.com/medikoo/es5-ext) from 0.10.62 to 0.10.64.
- [Release notes](https://github.com/medikoo/es5-ext/releases)
- [Changelog](https://github.com/medikoo/es5-ext/blob/main/CHANGELOG.md)
- [Commits](https://github.com/medikoo/es5-ext/compare/v0.10.62...v0.10.64)

---
updated-dependencies:
- dependency-name: es5-ext
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-03 09:59:31 -04:00
dependabot[bot]
17cf179d16 chore(deps): bump es5-ext in /examples/auth/payload (#5191)
Bumps [es5-ext](https://github.com/medikoo/es5-ext) from 0.10.62 to 0.10.64.
- [Release notes](https://github.com/medikoo/es5-ext/releases)
- [Changelog](https://github.com/medikoo/es5-ext/blob/main/CHANGELOG.md)
- [Commits](https://github.com/medikoo/es5-ext/compare/v0.10.62...v0.10.64)

---
updated-dependencies:
- dependency-name: es5-ext
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-03 09:59:26 -04:00
dependabot[bot]
1dc86aa6e6 chore(deps): bump es5-ext from 0.10.62 to 0.10.64 in /templates/website (#5190)
Bumps [es5-ext](https://github.com/medikoo/es5-ext) from 0.10.62 to 0.10.64.
- [Release notes](https://github.com/medikoo/es5-ext/releases)
- [Changelog](https://github.com/medikoo/es5-ext/blob/main/CHANGELOG.md)
- [Commits](https://github.com/medikoo/es5-ext/compare/v0.10.62...v0.10.64)

---
updated-dependencies:
- dependency-name: es5-ext
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-03 09:59:19 -04:00
dependabot[bot]
d8e0824547 chore(deps): bump es5-ext in /examples/multi-tenant (#5189)
Bumps [es5-ext](https://github.com/medikoo/es5-ext) from 0.10.62 to 0.10.64.
- [Release notes](https://github.com/medikoo/es5-ext/releases)
- [Changelog](https://github.com/medikoo/es5-ext/blob/main/CHANGELOG.md)
- [Commits](https://github.com/medikoo/es5-ext/compare/v0.10.62...v0.10.64)

---
updated-dependencies:
- dependency-name: es5-ext
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-03 09:59:09 -04:00
dependabot[bot]
1453547e35 chore(deps): bump es5-ext from 0.10.62 to 0.10.64 in /templates/blank (#5188)
Bumps [es5-ext](https://github.com/medikoo/es5-ext) from 0.10.62 to 0.10.64.
- [Release notes](https://github.com/medikoo/es5-ext/releases)
- [Changelog](https://github.com/medikoo/es5-ext/blob/main/CHANGELOG.md)
- [Commits](https://github.com/medikoo/es5-ext/compare/v0.10.62...v0.10.64)

---
updated-dependencies:
- dependency-name: es5-ext
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-03 09:59:01 -04:00
dependabot[bot]
4c6874449a chore(deps): bump es5-ext in /examples/custom-server (#5187)
Bumps [es5-ext](https://github.com/medikoo/es5-ext) from 0.10.62 to 0.10.64.
- [Release notes](https://github.com/medikoo/es5-ext/releases)
- [Changelog](https://github.com/medikoo/es5-ext/blob/main/CHANGELOG.md)
- [Commits](https://github.com/medikoo/es5-ext/compare/v0.10.62...v0.10.64)

---
updated-dependencies:
- dependency-name: es5-ext
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-03 09:58:50 -04:00
dependabot[bot]
332c9b3a98 chore(deps): bump es5-ext in /templates/ecommerce (#5186)
Bumps [es5-ext](https://github.com/medikoo/es5-ext) from 0.10.62 to 0.10.64.
- [Release notes](https://github.com/medikoo/es5-ext/releases)
- [Changelog](https://github.com/medikoo/es5-ext/blob/main/CHANGELOG.md)
- [Commits](https://github.com/medikoo/es5-ext/compare/v0.10.62...v0.10.64)

---
updated-dependencies:
- dependency-name: es5-ext
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-03 09:58:36 -04:00
dependabot[bot]
73544b5b5e chore(deps): bump es5-ext from 0.10.62 to 0.10.64 in /examples/email (#5184)
Bumps [es5-ext](https://github.com/medikoo/es5-ext) from 0.10.62 to 0.10.64.
- [Release notes](https://github.com/medikoo/es5-ext/releases)
- [Changelog](https://github.com/medikoo/es5-ext/blob/main/CHANGELOG.md)
- [Commits](https://github.com/medikoo/es5-ext/compare/v0.10.62...v0.10.64)

---
updated-dependencies:
- dependency-name: es5-ext
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-03 09:58:28 -04:00
dependabot[bot]
e03302160a chore(deps): bump es5-ext from 0.10.62 to 0.10.64 in /examples/testing (#5193)
Bumps [es5-ext](https://github.com/medikoo/es5-ext) from 0.10.62 to 0.10.64.
- [Release notes](https://github.com/medikoo/es5-ext/releases)
- [Changelog](https://github.com/medikoo/es5-ext/blob/main/CHANGELOG.md)
- [Commits](https://github.com/medikoo/es5-ext/compare/v0.10.62...v0.10.64)

---
updated-dependencies:
- dependency-name: es5-ext
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-03 09:57:09 -04:00
dependabot[bot]
edb530fc64 chore(deps): bump es5-ext in /examples/live-preview/payload (#5194)
Bumps [es5-ext](https://github.com/medikoo/es5-ext) from 0.10.62 to 0.10.64.
- [Release notes](https://github.com/medikoo/es5-ext/releases)
- [Changelog](https://github.com/medikoo/es5-ext/blob/main/CHANGELOG.md)
- [Commits](https://github.com/medikoo/es5-ext/compare/v0.10.62...v0.10.64)

---
updated-dependencies:
- dependency-name: es5-ext
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-03 09:57:04 -04:00
dependabot[bot]
064b4baed8 chore(deps): bump es5-ext in /examples/form-builder/payload (#5195)
Bumps [es5-ext](https://github.com/medikoo/es5-ext) from 0.10.62 to 0.10.64.
- [Release notes](https://github.com/medikoo/es5-ext/releases)
- [Changelog](https://github.com/medikoo/es5-ext/blob/main/CHANGELOG.md)
- [Commits](https://github.com/medikoo/es5-ext/compare/v0.10.62...v0.10.64)

---
updated-dependencies:
- dependency-name: es5-ext
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-03 09:56:59 -04:00
dependabot[bot]
4cb8259b8b chore(deps): bump es5-ext in /examples/redirects/payload (#5196)
Bumps [es5-ext](https://github.com/medikoo/es5-ext) from 0.10.62 to 0.10.64.
- [Release notes](https://github.com/medikoo/es5-ext/releases)
- [Changelog](https://github.com/medikoo/es5-ext/blob/main/CHANGELOG.md)
- [Commits](https://github.com/medikoo/es5-ext/compare/v0.10.62...v0.10.64)

---
updated-dependencies:
- dependency-name: es5-ext
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-03 09:56:53 -04:00
dependabot[bot]
34b2451b3b chore(deps): bump es5-ext in /examples/nested-docs/payload (#5197)
Bumps [es5-ext](https://github.com/medikoo/es5-ext) from 0.10.62 to 0.10.64.
- [Release notes](https://github.com/medikoo/es5-ext/releases)
- [Changelog](https://github.com/medikoo/es5-ext/blob/main/CHANGELOG.md)
- [Commits](https://github.com/medikoo/es5-ext/compare/v0.10.62...v0.10.64)

---
updated-dependencies:
- dependency-name: es5-ext
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-03 09:56:48 -04:00
dependabot[bot]
29ccd06553 chore(deps): bump follow-redirects in /examples/testing (#5349)
Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.15.4 to 1.15.6.
- [Release notes](https://github.com/follow-redirects/follow-redirects/releases)
- [Commits](https://github.com/follow-redirects/follow-redirects/compare/v1.15.4...v1.15.6)

---
updated-dependencies:
- dependency-name: follow-redirects
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-03 09:56:37 -04:00
dependabot[bot]
a5971c12b3 chore(deps): bump express from 4.18.2 to 4.19.2 in /examples/whitelabel (#5531)
Bumps [express](https://github.com/expressjs/express) from 4.18.2 to 4.19.2.
- [Release notes](https://github.com/expressjs/express/releases)
- [Changelog](https://github.com/expressjs/express/blob/master/History.md)
- [Commits](https://github.com/expressjs/express/compare/4.18.2...4.19.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-03 09:56:15 -04:00
dependabot[bot]
0900baf8f9 chore(deps): bump express from 4.18.2 to 4.19.2 in /templates/blank (#5532)
Bumps [express](https://github.com/expressjs/express) from 4.18.2 to 4.19.2.
- [Release notes](https://github.com/expressjs/express/releases)
- [Changelog](https://github.com/expressjs/express/blob/master/History.md)
- [Commits](https://github.com/expressjs/express/compare/4.18.2...4.19.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-03 09:56:07 -04:00
dependabot[bot]
d1a9a3e4d5 chore(deps): bump express in /examples/multi-tenant (#5534)
Bumps [express](https://github.com/expressjs/express) from 4.18.2 to 4.19.2.
- [Release notes](https://github.com/expressjs/express/releases)
- [Changelog](https://github.com/expressjs/express/blob/master/History.md)
- [Commits](https://github.com/expressjs/express/compare/4.18.2...4.19.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-03 09:55:59 -04:00
dependabot[bot]
d27a33dc1d chore(deps): bump express in /examples/custom-server (#5536)
Bumps [express](https://github.com/expressjs/express) from 4.18.2 to 4.19.2.
- [Release notes](https://github.com/expressjs/express/releases)
- [Changelog](https://github.com/expressjs/express/blob/master/History.md)
- [Commits](https://github.com/expressjs/express/compare/4.18.2...4.19.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-03 09:55:52 -04:00
dependabot[bot]
d01c586a90 chore(deps): bump express in /examples/draft-preview/payload (#5538)
Bumps [express](https://github.com/expressjs/express) from 4.18.2 to 4.19.2.
- [Release notes](https://github.com/expressjs/express/releases)
- [Changelog](https://github.com/expressjs/express/blob/master/History.md)
- [Commits](https://github.com/expressjs/express/compare/4.18.2...4.19.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-03 09:55:42 -04:00
dependabot[bot]
caa0d7cf0d chore(deps): bump express in /examples/auth/payload (#5539)
Bumps [express](https://github.com/expressjs/express) from 4.18.2 to 4.19.2.
- [Release notes](https://github.com/expressjs/express/releases)
- [Changelog](https://github.com/expressjs/express/blob/master/History.md)
- [Commits](https://github.com/expressjs/express/compare/4.18.2...4.19.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-03 09:55:36 -04:00
dependabot[bot]
c40b5a1784 chore(deps): bump express in /examples/live-preview/payload (#5542)
Bumps [express](https://github.com/expressjs/express) from 4.18.2 to 4.19.2.
- [Release notes](https://github.com/expressjs/express/releases)
- [Changelog](https://github.com/expressjs/express/blob/master/History.md)
- [Commits](https://github.com/expressjs/express/compare/4.18.2...4.19.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-03 09:55:29 -04:00
dependabot[bot]
b0869ea0ed chore(deps): bump express in /examples/form-builder/payload (#5543)
Bumps [express](https://github.com/expressjs/express) from 4.18.2 to 4.19.2.
- [Release notes](https://github.com/expressjs/express/releases)
- [Changelog](https://github.com/expressjs/express/blob/master/History.md)
- [Commits](https://github.com/expressjs/express/compare/4.18.2...4.19.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-03 09:55:22 -04:00
dependabot[bot]
00faebed4b chore(deps): bump express in /examples/nested-docs/payload (#5547)
Bumps [express](https://github.com/expressjs/express) from 4.18.2 to 4.19.2.
- [Release notes](https://github.com/expressjs/express/releases)
- [Changelog](https://github.com/expressjs/express/blob/master/History.md)
- [Commits](https://github.com/expressjs/express/compare/4.18.2...4.19.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-03 09:55:07 -04:00
dependabot[bot]
638a35a2e7 chore(deps): bump express from 4.18.2 to 4.19.2 in /examples/hierarchy (#5552)
Bumps [express](https://github.com/expressjs/express) from 4.18.2 to 4.19.2.
- [Release notes](https://github.com/expressjs/express/releases)
- [Changelog](https://github.com/expressjs/express/blob/master/History.md)
- [Commits](https://github.com/expressjs/express/compare/4.18.2...4.19.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-03 09:54:58 -04:00
Alessio Gravili
44bca2ed36 Merge pull request #5622 from payloadcms/fix/lexical-html-conversion 2024-04-03 09:53:30 -04:00
Alessio Gravili
fa90cec758 docs(richtext-lexical): clarify that HTML generation has to happen on the server 2024-04-03 09:52:31 -04:00
Alessio Gravili
2164dcc594 fix(richtext-lexical): disable instanceof HTMLImageElement check as it causes issues when used on the server 2024-04-03 09:50:46 -04:00
Jessica Chowdhury
a3ae416085 fix: number field with hasMany accept defaultValue array (#5618) 2024-04-03 08:05:17 -04:00
Alessio Gravili
02d2c51717 feat(richtext-*): add ability to provide custom Field and Error components (#5574) 2024-03-31 20:57:30 -04:00
Alessio Gravili
b3503e3dce docs(richtext-slate): update outdated code example (#5572) 2024-03-31 17:49:17 -04:00
Alessio Gravili
2e5400fa7a fix(richtext-lexical): checklist html converter incorrectly outputting children (#5570) 2024-03-31 16:23:40 -04:00
Alessio Gravili
48dc116f57 fix(richtext-lexical): properly center add- and drag-block handles (#5568) 2024-03-31 16:03:51 -04:00
Dan Ribbens
9b2ba7cc0e chore: fix test config defaultValue typo (#5562) 2024-03-29 17:56:21 -04:00
Dan Ribbens
916923071a fix(db-postgres): error on delete having joins (#5459)
* chore(db-postgres): reduce duplicate lines of code

* chore(db-postgres): fix deleteOne regression

* chore(db-postgres): missing await
2024-03-26 14:00:46 -04:00
Dan Ribbens
3ceb6efd32 fix: regression of filterOptions using different transaction (#5169) 2024-03-25 11:13:49 -04:00
Dan Ribbens
8184e0005a fix: image resize tiff files (#5415) 2024-03-25 10:50:02 -04:00
Tylan Davis
1c0d43c61a fix(docs): broken links (#5340)
* fix: broken links

* fix: another broken link
2024-03-15 10:35:25 -04:00
Alessio Gravili
0eb7b44735 chore(eslint-config-payload): improve @typescript-eslint/no-unused-vars rule (#4793) 2024-03-12 12:44:36 -04:00
geisterfurz007
c038acb3a4 chore: fix typescript hallucinations (#4559)
* chore: fix typescript halluzinations

* chore: remove another unused ts-expect-error directive
2024-03-10 01:30:01 -05:00
Jarrod Flesch
f8c2ccf6b1 chore(examples/multi-tenant): updates readme, fixes payload.init 2024-03-10 00:38:51 -05:00
Akhil Naidu
e6092fd36c docs: improve naming for afterForgotPassword hook example code (#5062) 2024-03-10 00:22:58 -05:00
Max Morozov
e0eae77758 docs: fix typo (#5052) 2024-03-10 00:12:29 -05:00
mhjmaas
0780ff22bb chore(translations): NL mistranslation of crop from "gewas" to "bijsnijden" 2024-03-07 22:58:08 -05:00
Alessio Gravili
e7f6bfbe9d fix(richtext-lexical): Blocks: generated output schema is not fully correct (#5259) 2024-03-07 13:27:27 -05:00
Fabian Aggeler
23df60dba5 fix(richtext-lexical): Link: add open-in-new-tab to html converter 2024-03-07 13:22:02 -05:00
Dan Ribbens
8919b86571 chore(ecommerce-template): fix duplicate cart update calls (#5228) 2024-03-05 10:51:50 -05:00
dependabot[bot]
8104fac5ed chore(deps): bump ip from 2.0.0 to 2.0.1 in /examples/whitelabel (#5128)
Bumps [ip](https://github.com/indutny/node-ip) from 2.0.0 to 2.0.1.
- [Commits](https://github.com/indutny/node-ip/compare/v2.0.0...v2.0.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-26 11:25:00 -05:00
dependabot[bot]
59ef1263a5 chore(deps): bump ip from 2.0.0 to 2.0.1 in /examples/auth/payload (#5134)
Bumps [ip](https://github.com/indutny/node-ip) from 2.0.0 to 2.0.1.
- [Commits](https://github.com/indutny/node-ip/compare/v2.0.0...v2.0.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-26 11:24:53 -05:00
dependabot[bot]
813e3dbc98 chore(deps): bump ip from 2.0.0 to 2.0.1 in /examples/redirects/payload (#5138)
Bumps [ip](https://github.com/indutny/node-ip) from 2.0.0 to 2.0.1.
- [Commits](https://github.com/indutny/node-ip/compare/v2.0.0...v2.0.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-26 11:24:45 -05:00
dependabot[bot]
12a23092e1 chore(deps): bump ip from 1.1.8 to 1.1.9 in /examples/email (#5127)
Bumps [ip](https://github.com/indutny/node-ip) from 1.1.8 to 1.1.9.
- [Commits](https://github.com/indutny/node-ip/compare/v1.1.8...v1.1.9)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-26 11:24:23 -05:00
dependabot[bot]
4a49beb552 chore(deps): bump ip from 2.0.0 to 2.0.1 in /templates/blank (#5129)
Bumps [ip](https://github.com/indutny/node-ip) from 2.0.0 to 2.0.1.
- [Commits](https://github.com/indutny/node-ip/compare/v2.0.0...v2.0.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-26 11:24:14 -05:00
dependabot[bot]
80530c666e chore(deps): bump ip from 2.0.0 to 2.0.1 in /examples/multi-tenant (#5130)
Bumps [ip](https://github.com/indutny/node-ip) from 2.0.0 to 2.0.1.
- [Commits](https://github.com/indutny/node-ip/compare/v2.0.0...v2.0.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-26 11:24:09 -05:00
dependabot[bot]
f53e2df951 chore(deps): bump ip from 2.0.0 to 2.0.1 in /templates/website (#5131)
Bumps [ip](https://github.com/indutny/node-ip) from 2.0.0 to 2.0.1.
- [Commits](https://github.com/indutny/node-ip/compare/v2.0.0...v2.0.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-26 11:24:01 -05:00
dependabot[bot]
db58e2bab2 chore(deps): bump ip from 2.0.0 to 2.0.1 in /examples/custom-server (#5132)
Bumps [ip](https://github.com/indutny/node-ip) from 2.0.0 to 2.0.1.
- [Commits](https://github.com/indutny/node-ip/compare/v2.0.0...v2.0.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-26 11:23:56 -05:00
dependabot[bot]
d88e97e123 chore(deps): bump ip in /examples/draft-preview/payload (#5133)
Bumps [ip](https://github.com/indutny/node-ip) from 2.0.0 to 2.0.1.
- [Commits](https://github.com/indutny/node-ip/compare/v2.0.0...v2.0.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-26 11:23:48 -05:00
dependabot[bot]
bb72e506e6 chore(deps): bump ip from 2.0.0 to 2.0.1 in /examples/testing (#5135)
Bumps [ip](https://github.com/indutny/node-ip) from 2.0.0 to 2.0.1.
- [Commits](https://github.com/indutny/node-ip/compare/v2.0.0...v2.0.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-26 11:23:40 -05:00
dependabot[bot]
b1f727fd6a chore(deps): bump ip in /examples/live-preview/payload (#5136)
Bumps [ip](https://github.com/indutny/node-ip) from 2.0.0 to 2.0.1.
- [Commits](https://github.com/indutny/node-ip/compare/v2.0.0...v2.0.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-26 11:23:33 -05:00
dependabot[bot]
72af18229b chore(deps): bump ip in /examples/form-builder/payload (#5137)
Bumps [ip](https://github.com/indutny/node-ip) from 2.0.0 to 2.0.1.
- [Commits](https://github.com/indutny/node-ip/compare/v2.0.0...v2.0.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-26 11:23:27 -05:00
dependabot[bot]
af52b526c8 chore(deps): bump ip in /examples/nested-docs/payload (#5139)
Bumps [ip](https://github.com/indutny/node-ip) from 2.0.0 to 2.0.1.
- [Commits](https://github.com/indutny/node-ip/compare/v2.0.0...v2.0.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-26 11:23:17 -05:00
dependabot[bot]
60525623bf chore(deps): bump ip from 2.0.0 to 2.0.1 in /examples/hierarchy (#5140)
Bumps [ip](https://github.com/indutny/node-ip) from 2.0.0 to 2.0.1.
- [Commits](https://github.com/indutny/node-ip/compare/v2.0.0...v2.0.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-26 11:23:11 -05:00
dependabot[bot]
0fba582926 chore(deps): bump ip from 2.0.0 to 2.0.1 in /templates/ecommerce (#5126)
Bumps [ip](https://github.com/indutny/node-ip) from 2.0.0 to 2.0.1.
- [Commits](https://github.com/indutny/node-ip/compare/v2.0.0...v2.0.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-26 11:22:49 -05:00
Elliot DeNolf
5d1cad3adb chore(release): db-postgres/0.7.0 [skip ci] 2024-02-23 14:31:55 -05:00
Elliot DeNolf
e31f72da8e chore(release): plugin-nested-docs/1.0.12 [skip ci] 2024-02-23 14:31:26 -05:00
Elliot DeNolf
7aa058d604 chore(release): db-mongodb/1.4.3 [skip ci] 2024-02-23 14:31:11 -05:00
Elliot DeNolf
64e80d242e chore(release): payload/2.11.2 [skip ci] 2024-02-23 14:29:37 -05:00
Dan Ribbens
e8f2ca484e feat(db-postgres): configurable custom schema to use (#5047)
* feat(db-postgres): configurable custom schema to use

* test(db-postgres): use public schema

* chore(db-postgres): simplify drop schema

* chore: add postgres-custom-schema test to ci

* chore: add custom schema to postgres ci

* chore(db-postgres): custom schema in migrate

* chore: ci postgres wait condition
2024-02-23 12:48:06 -05:00
Dan Ribbens
ceca5c4e97 fix(db-postgres): set _parentID for array nested localized fields (#5117)
* fix(db-postgres): find missing path for nested arrays

* fix(db-postgres): set _parentID for array nested localized fields

* fix: afterRead fallbackLocale causing locale data loss

* chore(richtext-lexical): updated args to match payload type change

* test: simplify localization e2e duplicate
2024-02-23 12:44:30 -05:00
Dan Ribbens
ee13736288 chore(plugin-nested-docs): payload added to peerDependencies (#5143) 2024-02-23 12:37:42 -05:00
Dan Ribbens
815bdfac0b fix(db-mongodb): unique sparse for not required fields (#5114)
* fix(db-mongodb): unique sparse for not required fields

* chore(db-mongodb): cleanup sparse index condition

* test: indexed field fix
2024-02-23 12:36:34 -05:00
Dan Ribbens
7a7f0ed7e8 fix: disabling API Key does not remove the key (#5145)
* fix: disabling API Key does not remove the key

* chore: encryptKey hook return null

* chore: fix auth e2e test setup
2024-02-23 12:31:14 -05:00
Dan Ribbens
ad42d541b3 fix: transaction error from access endpoint (#5156)
* fix: transaction error from access endpoint

* chore: fix async race condition in getEntityPolicies
2024-02-23 12:28:43 -05:00
Elliot DeNolf
32ed95e1ee fix: handle thrown errors in config-level afterError hook (#5147) 2024-02-21 16:44:16 -05:00
Yunsup Sim
70e57fef18 fix: Add Context Provider in EditMany Component (#5005)
* fix: Add  Context Provider in EditMany Component

* test: Fix e2e test error
2024-02-21 16:39:34 -05:00
Jarrod Flesch
0a07f607b9 fix: only replace the drawer content with full edit component if it exists (#5144) 2024-02-21 15:44:09 -05:00
Piotr Rogowski
3918fc7c21 chore(plugin-seo): add pl translations (#5021) 2024-02-21 15:01:38 -05:00
Martin Chełminiak
13f71ac475 chore: console error for missing script when running npm run payload (#5078) 2024-02-19 10:13:50 -05:00
Ben Regenspan
07720e777a docs: Reword Hooks Overview re: server-only execution (#5070) 2024-02-19 09:56:55 -05:00
Sondre Ørland
efff47e400 chore: translation for image cropping in norwegian bokmål (#5113) 2024-02-19 09:47:32 -05:00
Elliot DeNolf
453ac218ea chore: reorder changelog 2024-02-17 01:38:13 -05:00
Elliot DeNolf
d4b09bd9cd chore(release): richtext-lexical/0.7.0 [skip ci] 2024-02-16 15:00:13 -05:00
Elliot DeNolf
dd67e03fc1 chore(release): plugin-search/1.1.0 [skip ci] 2024-02-16 15:00:03 -05:00
Elliot DeNolf
548de80bee chore(release): db-postgres/0.6.0 [skip ci] 2024-02-16 14:59:51 -05:00
Elliot DeNolf
2c05fbbb5e chore(release): plugin-form-builder/1.2.1 [skip ci] 2024-02-16 14:59:15 -05:00
Elliot DeNolf
9b54659818 chore(release): db-mongodb/1.4.2 [skip ci] 2024-02-16 14:58:57 -05:00
Elliot DeNolf
e9f550406e chore(release): payload/2.11.1 [skip ci] 2024-02-16 14:57:28 -05:00
Dan Ribbens
98b87e2278 feat(plugin-search): add req to beforeSync args for transactions (#5068)
* feat(plugin-search): pass `req` to beforeSync to support using transactions

* fix(plugin-search): hooks do not respect transactions

* chore(plugin-search): await hooks

* chore: remove eslint disable comments
2024-02-16 14:20:40 -05:00
Dan Ribbens
5f3d0169be fix: filterOptions errors cause transaction to abort (#5079)
* fix: filterOptions errors cause transaction to abort

* fix(db-mongodb): uncaught abortTransaction race condition

* chore: remove test that is not adding value

* chore: limit options on errors in filterOptions

* chore: limit options when an error occurs in filterOptions
2024-02-16 13:33:40 -05:00
Dan Ribbens
35c2a085ef fix(db-postgres): query using blockType (#5044)
* fix(db-postgres): query using blockType

* chore: cleanup commented lines
2024-02-16 13:30:26 -05:00
Dan Ribbens
1ac943ed5e fix: remove collection findByID caching (#5034) 2024-02-16 13:23:57 -05:00
Elliot DeNolf
25cee8bb10 fix(uploads): account for serverURL when retrieving external file (#5102) 2024-02-16 13:11:18 -05:00
Elliot DeNolf
419aef452d chore: add .localstack to gitignore 2024-02-16 12:53:28 -05:00
Elliot DeNolf
ea52489126 Merge pull request #4295 from payloadcms/test/plugin-cloud-storage-emulators
test(plugin-cloud-storage): use localstack for tests
2024-02-16 12:47:13 -05:00
Elliot DeNolf
e80c70acae test: cleanup 2024-02-16 12:33:07 -05:00
Elliot DeNolf
70b0064d0b test: adjust adapter log message 2024-02-16 11:32:00 -05:00
Elliot DeNolf
9636bf6efd test: rename .env -> .env.emulated, safely assert bucket contents 2024-02-16 11:31:14 -05:00
Elliot DeNolf
8f4d0da4e0 test: conditionally run plugin-cloud-storage 2024-02-16 11:31:14 -05:00
Elliot DeNolf
f0f1dbdcb0 ci: pnpm docker:start 2024-02-16 11:31:14 -05:00
Elliot DeNolf
a895aee8b1 ci: add localstack aws envs 2024-02-16 11:31:14 -05:00
Elliot DeNolf
aa1dac08c1 ci: add localstack setup 2024-02-16 11:31:14 -05:00
Elliot DeNolf
b8cd1c6ba4 test(plugin-cloud-storage): add test against localstack 2024-02-16 11:31:12 -05:00
Elliot DeNolf
6344464bc6 test(plugin-cloud-storage): add single docker compose for all emulators 2024-02-16 11:30:55 -05:00
Dan Ribbens
5d4022f144 fix(db-mongodb): find versions pagination (#5091) 2024-02-15 16:14:01 -05:00
Dan Ribbens
bf942fdfa6 feat(db-postgres): reconnect after disconnection from database (#5086) 2024-02-15 16:09:17 -05:00
Dan Ribbens
d6c25783cf feat(db-postgres): adds idType to use uuid or serial id columns (#3864)
* feat(db-postgres): WIP adds idType to use uuid or serial id columns

* chore: add postgres-uuid test ci

* chore: add postgres-uuid env vars

* chore: sanitizeQueryValue prevent invalid types

* fix(db-postgres): invalid parentID of nested arrays
2024-02-15 16:06:37 -05:00
Dan Ribbens
82e9d31127 fix(plugin-form-builder): hooks do not respect transactions (#5069)
* fix(plugin-form-builder): hooks do not respect transactions

* chore(plugin-form-builder): linting and cleanup
2024-02-15 15:55:42 -05:00
Elliot DeNolf
399e606b34 chore: use ref for pnpm overrides (#5081) 2024-02-13 12:37:43 -05:00
Alessio Gravili
0d18822062 feat(richtext-lexical)!: Update lexical from 0.12.6 to 0.13.1, port over all useful changes from playground (#5066)
* feat(richtext-lexical): Update lexical from 0.12.6 to 0.13.1, port over all useful changes from playground

* chore: upgrade lexical version used in monorepo
2024-02-12 17:54:50 +01:00
Alessio Gravili
00fc0343da feat(richtext-lexical): AddBlock handle for all nodes, even if they aren't empty paragraphs (#5063) 2024-02-12 16:11:41 +01:00
Alessio Gravili
6323965c65 fix(richtext-lexical): do not remove adjacent paragraph node when inserting certain nodes in empty editor (#5061) 2024-02-12 14:27:58 +01:00
Máté Tallósi
6d6823c3e5 feat(richtext-lexical): add justify aligment to AlignFeature (#4035) (#4868) 2024-02-12 14:27:12 +01:00
Alessio Gravili
ca70298436 chore: upgrade nodemon versions (#5059) 2024-02-12 14:11:57 +01:00
Elliot DeNolf
4f565759f6 chore(release): payload/2.11.0 [skip ci] 2024-02-09 16:12:03 -05:00
Jarrod Flesch
df39602758 feat: exposes collapsible provider with more functionality (#5043) 2024-02-09 10:38:30 -05:00
Elliot DeNolf
6ea6172afa chore(release): db-postgres/0.5.2 [skip ci] 2024-02-09 09:06:15 -05:00
Elliot DeNolf
486774796d chore(release): db-mongodb/1.4.1 [skip ci] 2024-02-09 09:06:06 -05:00
Elliot DeNolf
1cd1c38764 chore(release): payload/2.10.1 [skip ci] 2024-02-09 09:04:42 -05:00
Elliot DeNolf
f6d7da7510 fix: clearable cells handle null values (#5038) 2024-02-09 08:59:38 -05:00
Elliot DeNolf
cdc4cb971b fix(db-mongodb): handle null values with exists (#5037) 2024-02-09 08:58:10 -05:00
Elliot DeNolf
e0191b54e1 chore(release): richtext-lexical/0.6.1 [skip ci] 2024-02-08 11:49:02 -05:00
Alessio Gravili
2315781f18 fix(richtext-lexical): make editor reactive to initialValue changes (#5010) 2024-02-08 15:30:21 +01:00
Elliot DeNolf
a0a58e7fd2 fix: query relationships by explicit id field (#5022) 2024-02-07 14:18:13 -05:00
Jessica Chowdhury
e1813fb884 fix: ensures docs with the same id are shown in relationship field select (#4859) 2024-02-07 14:04:03 -05:00
Elliot DeNolf
da184d40ec fix(db-postgres): handle nested docs with drafts (#5012) 2024-02-06 21:27:33 -05:00
Elliot DeNolf
ca8675f89d chore(release): plugin-seo/2.2.1 [skip ci] 2024-02-06 15:41:58 -05:00
Elliot DeNolf
e8c6c9338d chore(release): db-postgres/0.5.1 [skip ci] 2024-02-06 15:41:35 -05:00
Elliot DeNolf
558534aff8 chore(release): richtext-lexical/0.6.0 [skip ci] 2024-02-06 15:41:04 -05:00
Elliot DeNolf
29c901ba9b chore(release): payload/2.10.0 [skip ci] 2024-02-06 15:38:33 -05:00
Elliot DeNolf
f3876c2a39 fix(db-postgres): localized field sort count (#4997)
* fix(db-postgres): localized field sort count

* test: localized sort doc count
2024-02-06 11:44:54 -05:00
Elliot DeNolf
c3a3942969 fix(db-postgres): filtering relationships with drafts enabled (#4998)
* fix(db-postgres): filtering relationships with drafts enabled

* test: draft relationship filtering
2024-02-06 11:16:27 -05:00
Paul
23b135b963 fix(templates): fix conflicting routes with Nextjs (#4725)
* Updated templates and readme to note conflicting routes

* Move information in readmes to blockquotes and move next-api to just next

* Remove unnecessary notes
2024-02-06 10:56:20 -05:00
Daniel Kirchhof
e3c8105cc2 feat: use deletion success message from server if provided (#4966) 2024-02-06 10:17:53 -05:00
Jarrod Flesch
2c71aaef75 chore: standardize req passed through the local API (#4994) 2024-02-05 15:43:59 -05:00
brachypelma
922fb9b7fa docs: added link to JSON field type (#4989) 2024-02-05 13:13:28 -05:00
Elliot DeNolf
0740d5095e fix(migrations): safely create migration file when no name passed (#4995) 2024-02-05 10:43:19 -05:00
Jacob Fletcher
b392d656fe chore(examples/multi-tentant): resets lastLoggedInTenant when none found (#4984) 2024-02-02 15:50:12 -05:00
Elliot DeNolf
c0eef90cdc ci: supabase (#4983)
* ci: supabase

* test: add supabase to adapter record

* test: adjust index tests conditional
2024-02-02 15:26:18 -05:00
Dan Ribbens
db22cbdf21 fix(plugin-seo): tabbedUI with email field causes duplicate field (#4944)
* fix(plugin-seo): tabbedUI with email field causes duplicate field

* chore(plugin-seo): code comment
2024-02-02 14:53:51 -05:00
Dan Ribbens
1e8a6b7899 feat: extend transactions to cover after and beforeOperation hooks (#4960)
* feat: extend transactions to cover after and beforeOperation hooks

* feat: use transactions in refresh operation

* docs: add req to beforeOperation and afterOperation args
2024-02-02 14:53:14 -05:00
Dan Ribbens
5d934ba02d feat: previousValue and previousSiblingDoc args added to beforeChange field hooks (#4958)
* feat: previousValue and previousSiblingDoc args added to beforeChange field hooks

* chore: fieldHook type docs
2024-02-02 13:59:11 -05:00
Elliot DeNolf
f651665f2f chore(deps): add pnpm overrides for common packages (#4980)
* chore(deps): add pnpm overrides for common packages

* chore(deps): bump @swc/core for compat w/ latest typescript
2024-02-02 13:21:57 -05:00
Elliot DeNolf
5d3659d48a fix(db-postgres): handle schema changes with supabase (#4968)
* fix(db-postgres): handle schema changes with supabase

* chore(deps): bump drizzle-orm for test suite
2024-02-02 11:29:32 -05:00
Dan Ribbens
47106d5a1a fix(db-postgres): indexes not creating for relationships, arrays, hasmany and blocks (#4976) 2024-02-02 11:16:21 -05:00
Jarrod Flesch
afa2b942e0 fix: ensures docPermissions fallback to collection permissions on create (#4969) 2024-02-01 16:54:52 -05:00
Dan Ribbens
20ddd0de5b chore: add indexes to preferences for performance (#4965) 2024-02-01 15:31:31 -05:00
Dan Ribbens
64f705c3c9 fix(db-postgres): indexes not created for non unique field names (#4967) 2024-02-01 15:21:15 -05:00
Daniel Shamburger
b30ea8aa6b docs: typo (#4948) 2024-01-31 15:40:55 -05:00
Mark Paolo Libunao
471d2113a7 feat: re-use existing logger instance passed to payload.init (#3124) 2024-01-31 15:40:14 -05:00
Alessio Gravili
8725d41164 feat: add more options to addFieldStatePromise so that it can be used for field flattening (#4799) 2024-01-30 23:02:58 +01:00
Dan Ribbens
0bd81aa25a fix(templates-ecommerce): hook errors for non-string ids (#4946) 2024-01-30 13:28:14 -05:00
Dan Ribbens
8c09ca9be5 examples: fix multi-tenant hooks to use transactions (#4955) 2024-01-30 13:26:13 -05:00
Alessio Gravili
90d7ee3e65 feat(richtext-lexical): Blocks: generate type definitions for blocks fields (#4529) 2024-01-30 16:51:18 +01:00
Kendell Joseph
58bbd8c00f chore(examples/hierarchy): adds hierarchy example (#4923) 2024-01-26 16:17:11 -05:00
Elliot DeNolf
003ad065c3 chore(release): plugin-cloud-storage/1.1.2 [skip ci] 2024-01-26 13:58:13 -05:00
Elliot DeNolf
70715926a8 chore(release): richtext-slate/1.4.0 [skip ci] 2024-01-26 13:57:45 -05:00
Elliot DeNolf
b3a6bfacf2 chore(release): db-postgres/0.5.0 [skip ci] 2024-01-26 13:57:34 -05:00
Elliot DeNolf
e1d9accb27 chore(release): db-mongodb/1.4.0 [skip ci] 2024-01-26 13:57:23 -05:00
Elliot DeNolf
f2f55a84cc chore(release): payload/2.9.0 [skip ci] 2024-01-26 13:55:20 -05:00
Dan Ribbens
eba53ba60a feat: forceAcceptWarning migration arg added to accept prompts (#4874)
* chore: gitignore test migrations

* feat: `forceAcceptWarning` migration args added to accept prompts

* chore: migrationDir env variable fallback

* chore: migrationDir testSuiteDir fallback

* chore: migrationDir testSuiteDir fallback fix

* chore: skip migrate down test
2024-01-26 13:48:53 -05:00
Dan Ribbens
f73d503fec fix(plugin-cloud-storage): slow get file performance large collections (#4927) 2024-01-26 13:43:55 -05:00
Dan Ribbens
6930c4e9f2 fix: upload input drawer does not show draft versions (#4903)
* chore: add field classname to upload field

* fix: upload input drawer does not show draft versions
2024-01-26 13:42:32 -05:00
Dan Ribbens
3eb681e847 fix: afterLogin hook write conflicts (#4904)
* fix: afterLogin hook conflict

* test: afterLogin hook returns for assertion

* chore: commit increment login attempt
2024-01-26 13:39:45 -05:00
Jarrod Flesch
cb4638cfa1 chore: make default views callable (#4928) 2024-01-26 13:38:36 -05:00
Dan Ribbens
b40e9f85a2 chore: use transactions in tests running mongoDB memory server (#4750)
* chore: use transactions in tests running mongoDB memory server

* chore: relationship test async setup changes

* chore: async test fix

* chore: flaky e2e localization test
2024-01-23 19:18:55 -05:00
Dan Ribbens
e5a7907a72 fix: remove No Options dropdown from hasMany fields (#4899) 2024-01-23 10:00:16 -05:00
Jarrod Flesch
3f25d1ca84 chore: re-orders request language detection (#4890) 2024-01-22 11:53:01 -05:00
Timothy Choi
d5720bea7b chore: add fieldIsGroupType type guard helper (#4872) 2024-01-19 14:19:35 -05:00
Jesse Sivonen
8ce15c8b07 fix(db-postgres): query unset relation (#4862) 2024-01-19 13:35:58 -05:00
Timothy Choi
9f5efef78f chore: lint #4766 (#4801)
* fix: import location for config test

* fix: linting fix
2024-01-18 09:25:52 -05:00
Dan Ribbens
dfba5222f3 fix(db-postgres): migrate down error (#4861) 2024-01-17 13:55:57 -05:00
Dan Ribbens
b99d24fcfa fix: migrate down missing filter for latest batch (#4860) 2024-01-17 13:54:30 -05:00
Elliot DeNolf
836ed77568 chore: update changelog [skip ci] 2024-01-16 16:39:42 -05:00
Elliot DeNolf
1c5d5b07c8 chore(release): plugin-seo/2.2.0 [skip ci] 2024-01-16 16:33:53 -05:00
Elliot DeNolf
da5f1f2240 chore(release): plugin-form-builder/1.2.0 [skip ci] 2024-01-16 16:33:44 -05:00
Elliot DeNolf
c84c58c7b4 chore(release): db-postgres/0.4.0 [skip ci] 2024-01-16 16:33:21 -05:00
Elliot DeNolf
1c1b8f3cec chore(release): db-mongodb/1.3.2 [skip ci] 2024-01-16 16:32:52 -05:00
Elliot DeNolf
3f69f83180 chore(release): payload/2.8.2 [skip ci] 2024-01-16 16:31:39 -05:00
beezee
371353f153 feat(db-postgres): support drizzle logging config (#4809) 2024-01-16 15:45:17 -05:00
Dan Ribbens
a92c6334b6 chore(db-postgres): update drizzle-kit to 0.20.5-608ae62 and drizzle-orm to latest (#4772) 2024-01-16 13:35:07 -05:00
Paul
eb9e771a9c fix(db-postgres): Remove duplicate keys from response (#4747)
* Remove duplicate keys from response

* Update to delete duplicates at a higher level and remove '_order' from array rows too
2024-01-16 13:22:08 -05:00
Patrik
ee5390aaca fix: removes max-width from field-types class & correctly sets it on uploads (#4829) 2024-01-16 13:12:58 -05:00
Paul
a861311c5a fix(db-mongodb): mongodb versions creating duplicates (#4825)
* Fixes the issue with mongodb versions

* Update other methods to use options too
2024-01-16 12:20:45 -05:00
James Mikrut
74c3fe1bb2 Merge pull request #4806 from payloadcms/fix/#4775-postgres-block-validation-arrays
fix(db-postgres): validateExistingBlockIsIdentical with arrays
2024-01-15 15:04:47 -05:00
James Mikrut
a2be50279e Merge pull request #4804 from payloadcms/fix/#4802-transaction-options-false
fix(db-mongodb): transactionOptions=false typeErrors
2024-01-15 15:04:01 -05:00
James Mikrut
403eb06acf Merge pull request #4723 from payloadcms/fix/4548-fix-missing-spread
fix(plugin-seo):Fix missing spread operator in URL generator function
2024-01-15 15:02:45 -05:00
James Mikrut
f5c2cd74cc Merge pull request #4695 from payloadcms/feat/4539-seo-plugin-allow-field-and-interface-overrides
feat(plugin-seo): Add support for interfaceName and fieldOverrides
2024-01-15 15:02:14 -05:00
Paul Popus
a6a1963ec6 Merge branch 'main' into feat/4539-seo-plugin-allow-field-and-interface-overrides 2024-01-15 16:29:49 -03:00
Dan Ribbens
0647c870f1 fix(db-postgres): validateExistingBlockIsIdentical with other tables 2024-01-13 22:46:05 -05:00
Dan Ribbens
3b88adc7d0 fix(db-postgres): validateExistingBlockIsIdentical with arrays 2024-01-13 22:40:30 -05:00
Dan Ribbens
82383a5b5f fix(db-mongodb): transactionOptions=false typeErrors 2024-01-13 14:59:16 -05:00
James Mikrut
f9dda628b2 Merge pull request #4730 from payloadcms/feat/4471-add-validation-for-form-submission
feat(plugin-form-builder):Add validation for form ID when creating a form submissions
2024-01-12 15:39:35 -05:00
Elliot DeNolf
93eb0e4a31 chore: update bug report template to renamed possible-bug label 2024-01-12 14:19:43 -05:00
Elliot DeNolf
2e362f44f4 chore(release): payload/2.8.1 [skip ci] 2024-01-12 12:44:15 -05:00
Jarrod Flesch
775502b161 fix: corrects config usage in build bin script (#4796) 2024-01-12 12:40:08 -05:00
Elliot DeNolf
84d75ce6ca chore(release): plugin-form-builder/1.1.2 [skip ci] 2024-01-12 10:47:08 -05:00
Elliot DeNolf
175cf229c0 chore(release): richtext-lexical/0.5.2 [skip ci] 2024-01-12 10:41:55 -05:00
Elliot DeNolf
bb40bd3efb chore(release): db-postgres/0.3.1 [skip ci] 2024-01-12 10:41:46 -05:00
Elliot DeNolf
3d74c133aa chore(release): db-mongodb/1.3.1 [skip ci] 2024-01-12 10:41:37 -05:00
Elliot DeNolf
0f6b6ca970 chore(release): bundler-webpack/1.0.6 [skip ci] 2024-01-12 10:41:29 -05:00
Elliot DeNolf
8e1692ef10 chore(release): bundler-vite/0.1.6 [skip ci] 2024-01-12 10:41:21 -05:00
Elliot DeNolf
1d1ee913fc chore(release): plugin-seo/2.1.0 [skip ci] 2024-01-12 10:40:45 -05:00
Elliot DeNolf
beca43341f chore(release): payload/2.8.0 [skip ci] 2024-01-12 10:39:41 -05:00
Patrik
84818469ea fix(plugin-form-builder): replaces curly brackets with lexical editor (#4753)
* chore: scaffolds fix for replacing curly brackets in email with lexical editor

* fix: submissionData not passed to nested fields

* chore: adds int test for lexical serializer

---------

Co-authored-by: Alessio Gravili <alessio@bonfireleads.com>
2024-01-12 10:37:01 -05:00
Patrik
0a259d27b5 fix: passes draft=true in fetch for relationships (#4784)
* fix: passes draft=true to fetch for relationships

* chore: removes unnecessary delay on field click in e2e test
2024-01-12 10:36:45 -05:00
Nico Bohne
e2e56a4d58 fix: text hasMany validation (#4789) 2024-01-11 23:16:52 -05:00
Patrik
d0f7677d5f fix: prioritizes value key when filtering / querying for relationships (#4727)
* fix: object equality query by prioritizing value key in relationship queries

* chore: adds e2e & int test

* chore: updates test for REST querying on poly relationships
2024-01-11 15:56:07 -05:00
Yuri Koshiishi
35956eb837 chore: use consistent param name in useField's setValue (#4710) 2024-01-11 14:25:48 -05:00
Timothy Choi
d92af295eb feat: allow custom config properties in blocks (#4766) 2024-01-11 13:57:32 -05:00
Marvin
493fde5ccc feat(logger): show local time (#4663) 2024-01-11 11:51:11 -05:00
David Oliver
c6bd20ef33 docs: improve email docs SMTP info (#4698) 2024-01-11 11:45:25 -05:00
Paul
6d5ac1de1e fix: allow a custom ID field to be nested inside unnamed tabs and rows (#4701)
* Adds a check for the first tab and e2e test for custom ID

* Add support for ids in any order inside an unnamed tab

* Update tests for rows

* Minor fixes and remove dead commented code
2024-01-11 10:17:24 -05:00
Dan Ribbens
fa3b3dd62d fix: migration regression (#4777) 2024-01-10 22:40:00 -05:00
Jarrod Flesch
1115387744 fix: build payload without initializing (#4028) 2024-01-10 20:40:46 -05:00
Elliot DeNolf
53e8690feb Merge pull request #4773 from payloadcms/fix/limit-zero
fix: limit=0 returns all docs
2024-01-10 17:00:07 -05:00
Maxime Marty-Dessus
4319fe1c6e feat(plugin-seo): add fr translations (#4774) 2024-01-10 16:48:07 -05:00
Elliot DeNolf
2fee0c0d44 docs: update pagination 2024-01-10 16:45:42 -05:00
Elliot DeNolf
7923edd7bc test: fix limit=0 test 2024-01-10 16:45:34 -05:00
Elliot DeNolf
5702b83e82 fix(db-postgres): totalPages value when limit=0 2024-01-10 16:45:07 -05:00
Elliot DeNolf
63e5c43fe6 fix(db-mongodb): limit=0 returns unpaginated 2024-01-10 16:44:57 -05:00
kiwagu
04f2888135 chore(examples/form-builder): removes legacyBehavior flags from next/link (#4764) 2024-01-10 16:26:50 -05:00
Elliot DeNolf
0f69b9c2f8 chore(templates): remove jackspeak resolutions 2024-01-10 13:06:50 -05:00
Elliot DeNolf
f1bb2f8151 feat(templates): bump plugin-cloud (#4770) 2024-01-10 13:03:50 -05:00
Elliot DeNolf
ea528b8c10 chore(release): eslint-config-payload/1.1.1 [skip ci] 2024-01-10 12:49:11 -05:00
Elliot DeNolf
0053e40404 chore(eslint): object-shorthand warn 2024-01-10 12:45:51 -05:00
Elliot DeNolf
605c0be43c chore(release): plugin-seo/2.0.0 [skip ci] 2024-01-10 12:41:02 -05:00
Elliot DeNolf
3152b4c4c5 chore: revert plugin-seo version bump 2024-01-10 12:40:37 -05:00
Elliot DeNolf
a64b80babc chore(release): plugin-cloud/3.0.0 [skip ci] 2024-01-10 12:34:02 -05:00
Elliot DeNolf
5cfde542b1 feat(plugin-cloud): use resend smtp instead of custom transport (#4746) 2024-01-10 12:22:02 -05:00
Patrik
772020963e fix(examples): bumps next to v13.5.1 (#4763) 2024-01-10 12:17:51 -05:00
Alessio Gravili
5e083689d0 feat(plugin-seo)!: remove support for payload <2.7.0 (#4765) 2024-01-10 17:29:29 +01:00
Taís Massaro
911764a490 chore: export useTheme and add documentation (#4718)
* chore(react-hooks): export useTheme hook

* docs(react-hooks): add useTheme documentation
2024-01-10 10:39:00 -05:00
Alessio Gravili
e3b81d913d chore(plugin-seo): remove test script from package.json (#4762) 2024-01-10 14:38:13 +01:00
Alessio Gravili
41b3b17911 chore(plugin-seo): add to CI, minor package.json improvements (#4761)
* chore: add plugin-seo to CI

* chore(plugin-seo): minor package.json improvements
2024-01-10 14:27:30 +01:00
Yunsup Sim
e9860b36f3 chore(plugin-seo): build command fix (#4756)
* chore(plugin-seo): build command fix

* chore: fix build script

---------

Co-authored-by: Alessio Gravili <alessio@bonfireleads.com>
2024-01-10 14:20:50 +01:00
Alessio Gravili
14b39fbc85 chore: eslint improvements (#4739)
* chore: add @typescript-eslint/prefer-ts-expect-error rule

* chore: fix @typescript-eslint/prefer-ts-expect-error rule

* chore: disable useless class-methods-use-this eslint rule

* chore: only warn for no-unused-vars rule

* remove unused ts-expect-error

* undo admin changes
2024-01-10 11:31:00 +01:00
Elliot DeNolf
d08e85d08c chore(release): plugin-nested-docs/1.0.11 [skip ci] 2024-01-09 16:32:02 -05:00
Elliot DeNolf
abcbf9974d chore(release): plugin-form-builder/1.1.1 [skip ci] 2024-01-09 16:31:52 -05:00
Elliot DeNolf
d01437d212 chore(release): plugin-seo/1.1.0 [skip ci] 2024-01-09 16:31:01 -05:00
Elliot DeNolf
06729a0a73 chore(release): db-postgres/0.3.0 [skip ci] 2024-01-09 16:30:49 -05:00
Elliot DeNolf
2bd7822a16 chore(release): db-mongodb/1.3.0 [skip ci] 2024-01-09 16:30:37 -05:00
Elliot DeNolf
bc7daf6b49 chore(release): payload/2.7.0 [skip ci] 2024-01-09 16:28:34 -05:00
James Mikrut
feab679ef7 Merge pull request #4615 from payloadcms/fix/relationship-field-number-ids-untitled
fix: relations with number based ids (postgres) show untitled ID: x
2024-01-09 15:30:41 -05:00
James Mikrut
be39ed4317 Merge pull request #4633 from payloadcms/fix/#3839-postgres-exist-json
fix(db-postgres): incorrect results querying json field using exists
2024-01-09 15:27:22 -05:00
James Mikrut
570e192eb4 Merge pull request #4741 from payloadcms/fix/#4591-migrate-down-batches
fix(db-postgres): migrate down not limited to latest batch
2024-01-09 13:50:45 -05:00
James Mikrut
22f4967dd4 Merge pull request #4726 from payloadcms/feat/migration-transactions
feat: improve transaction support by passing req to migrations
2024-01-09 13:50:00 -05:00
James Mikrut
4873c36129 Merge pull request #4722 from payloadcms/fix/#4719-migration-transaction-options
fix(db-mongodb): migration errors with transactionOptions false
2024-01-09 13:46:06 -05:00
James Mikrut
f0ec21cdda Merge pull request #4624 from payloadcms/fix/#3692-plugin-nested-docs-overrides
fix(plugin-nested-docs): custom overrides of breadcrumb and parent fields
2024-01-09 13:45:46 -05:00
dependabot[bot]
da737bdf8e chore(deps): bump follow-redirects in /examples/testing (#4735)
Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.15.2 to 1.15.4.
- [Release notes](https://github.com/follow-redirects/follow-redirects/releases)
- [Commits](https://github.com/follow-redirects/follow-redirects/compare/v1.15.2...v1.15.4)

---
updated-dependencies:
- dependency-name: follow-redirects
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-09 13:18:29 -05:00
dependabot[bot]
40508880c1 chore(deps): bump follow-redirects in /templates/blank (#4736)
Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.15.2 to 1.15.4.
- [Release notes](https://github.com/follow-redirects/follow-redirects/releases)
- [Commits](https://github.com/follow-redirects/follow-redirects/compare/v1.15.2...v1.15.4)

---
updated-dependencies:
- dependency-name: follow-redirects
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-09 13:18:18 -05:00
dependabot[bot]
8f420d841a chore(deps): bump follow-redirects in /templates/website (#4737)
Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.15.3 to 1.15.4.
- [Release notes](https://github.com/follow-redirects/follow-redirects/releases)
- [Commits](https://github.com/follow-redirects/follow-redirects/compare/v1.15.3...v1.15.4)

---
updated-dependencies:
- dependency-name: follow-redirects
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-09 13:18:08 -05:00
dependabot[bot]
9022e27308 chore(deps): bump follow-redirects in /templates/ecommerce (#4734)
Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.15.3 to 1.15.4.
- [Release notes](https://github.com/follow-redirects/follow-redirects/releases)
- [Commits](https://github.com/follow-redirects/follow-redirects/compare/v1.15.3...v1.15.4)

---
updated-dependencies:
- dependency-name: follow-redirects
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-09 13:17:59 -05:00
Patrik
acf2e41312 docs: updates verify to verifyEmail in local api (#4728) 2024-01-09 13:15:31 -05:00
Dan Ribbens
6acfae8ee7 fix(db-postgres): migrate down only runs latest batch size 2024-01-09 10:21:45 -05:00
Alessio Gravili
20bdd91da4 chore: upgrade @types/nodemailer from v6.4.8 to v6.4.14 (#4733) 2024-01-09 14:19:45 +01:00
Alessio Gravili
50502834c9 chore(richtext-lexical): upgrade lexical from v0.12.5 to v0.12.6 (#4732)
* chore(richtext-lexical): upgrade all lexical packages from 0.12.5 to 0.12.6

* fix(richtext-lexical): fix TypeScript errors

* fix indenting
2024-01-09 09:35:18 +01:00
Paul Popus
2b731c1088 feat(plugin-form-builder):Add validation for form ID when creating a submission 2024-01-08 20:35:52 -03:00
Dan Ribbens
983733ad74 merge main 2024-01-08 17:12:02 -05:00
Dan Ribbens
555d02769a feat(db-postgres): improve transaction support by passing req to migrations 2024-01-08 15:50:22 -05:00
Dan Ribbens
682eca2186 feat(db-mongodb): improve transaction support by passing req to migrations 2024-01-08 15:50:09 -05:00
Paul Popus
6affa1c304 Removed fallback for interfaceName 2024-01-08 15:27:17 -03:00
Dan Ribbens
1d14d9f8b8 feat: improve transaction support by passing req to migrations 2024-01-08 12:34:55 -05:00
Dan Ribbens
0abaddc2ef chore: remove payload migration endpoints 2024-01-08 12:24:53 -05:00
Paul Popus
57dc93da5d Fix missing spread operator in generator function 2024-01-08 14:07:35 -03:00
Dan Ribbens
21b9453cf4 fix(db-mongodb): migration error calling beginTransaction with transactionOptions false 2024-01-08 12:03:45 -05:00
Alessio Gravili
136993ec2b chore: undo adding DocumentInfo state to ActionsProvider (#4707) 2024-01-05 22:58:16 +01:00
Dan Ribbens
63bc4cabe1 fix(db-mongodb): querying plan for collections ignoring indexes (#4655)
* fix(db-mongodb): querying plan for collections ignoring indexes

* chore(db-mongodb): improve index hint comment
2024-01-05 16:21:19 -05:00
Alessio Gravili
6a8a6e4ef4 feat: provide document info to ActionsProvider (#4696) 2024-01-05 21:12:21 +01:00
Jessica Chowdhury
9828772890 fix: prevents row overflow (#4704) 2024-01-05 15:04:30 -05:00
Jessica Chowdhury
6116573164 docs: corrects type in useField example (#4705) 2024-01-05 15:03:38 -05:00
Dan Ribbens
cab6babd60 fix(db-postgres): validation prevents group fields in blocks (#4699)
* fix(db-postgres): validation prevents using group fields within blocks

* fix(db-postgres): validation of non-matching blocks in reverse order
2024-01-05 15:03:08 -05:00
Paul
55399424a1 fix(plugin-nested-docs): children wrongly publishing draft data (#4692)
* fix(plugin-nested-docs): handles child parent doc publishing

* Add tests

* Fix error failing on save hook

---------

Co-authored-by: Jessica Chowdhury <jessica@trbl.design>
2024-01-05 15:02:15 -05:00
Paul Popus
28d3f73c2a Fix integration test 2024-01-05 15:23:57 -03:00
Jessica Chowdhury
28a30120dd fix(plugin-form-builder): slate serializer should replace curly braces in links (#4703) 2024-01-05 13:01:03 -05:00
Elliot DeNolf
40a0921597 docs: update 'accessing files outside of payload cloud' 2024-01-05 11:53:51 -05:00
Paul Popus
7eae86bcb3 Add changes from previous branch and update docs 2024-01-05 12:45:03 -03:00
Paul
0b80e4a403 chore: bump the mongodb-memory-server dependency to 9.x (#4693) 2024-01-05 09:35:35 -05:00
Seied Ali Mirkarimi
b378532ddf chore: rtl locale selector and sidebar button (#4684)
* chore: rtl locale popup selector and sidebar button

* chore(plugin-seo): add persian translation
2024-01-04 21:45:39 -05:00
Patrik
d419275fb5 fix: adds objectID validation to isValidID if of type text (#4689)
* fix: adds updated object-id validation to isValidID

* chore: adds check to see if value is of type string or object

* chore: needs to return false if value not of type object or string
2024-01-04 15:08:55 -05:00
Jessica Chowdhury
0fb3a9ca89 fix: allow json field to be saved empty and reflect value changes (#4687)
* fix: allow json field to be saved empty and reflect value changes

* fix: reverts change to json field validation

* chore: wraps more JSON field logic with a try/catch
2024-01-04 14:47:10 -05:00
Gokulsck
f43cf185d4 feat: hasMany property for text fields (#4605)
* fix for supporting hasMany property in text field

* Updated docs

* handle text case types for schema and graphql schema

* fix unit test for required failing

* add unit test for has many text field

* add end to end test for has many on text field creation

* support has many feature for text field on postgres

---------

Co-authored-by: Chris Heinz <chrisi.heinz@web.de>
2024-01-04 14:45:00 -05:00
Dan Ribbens
5d15955f83 fix: custom ids in versions (#4680)
* chore: scaffolds out fix for postgres issues with custom ids in versions

* fix(db-postgres): queryDrafts returns undefined doc.id

* chore(db-postgres): fix build

* fix: removes extra custom id field from  versions buildCollectionFields

* chore: comments test/versions seeding back in

* fix buildCollectionFields version group fields

* fix: id field can be edited after saving a document with custom ids

* chore: updates versions custom ID test

---------

Co-authored-by: PatrikKozak <patrik@payloadcms.com>
2024-01-04 13:05:10 -05:00
Elliot DeNolf
2d35e06667 ci(templates): generate types in ci (#4685) 2024-01-04 10:04:44 -05:00
Elliot DeNolf
d2de6db449 chore(release): eslint-config-payload/1.1.0 2024-01-04 09:56:42 -05:00
Alessio Gravili
a3e78161b5 fix: non-boolean condition result causes infinite looping (#4579) 2024-01-04 09:51:08 -05:00
Hulpoi George-Valentin
d543665995 fix: unlock user condition always passes due to seconds conversion (#4610)
* fix: unlock condition is always true

* test: extra call for locking user, therefor won't be a condition issue
2024-01-04 09:43:10 -05:00
Alessio Gravili
db7dddf1c5 chore: commit intellij run configurations (#4653)
* chore: update .gitignore

* chore: update .gitignore

* chore: commit IntelliJ run configurations
2024-01-04 09:35:01 -05:00
Paul
3027a03ad1 feat(plugin-seo): add i18n (#4665)
* Add i18n to plugin SEO

* Add new translations and e2e tests for the SEO plugin

* Update e2e tests to utilise a shared page ID from a create function
2024-01-04 09:18:09 -05:00
Paul
85e38b7cfd fix: sidebar fields not disabled by access permissions (#4682)
* Pass operation to sidebar fields too

* Add a test for sidebar field update permission
2024-01-03 20:04:40 -05:00
Elliot DeNolf
9090540ece chore(release): richtext-lexical/0.5.1 [skip ci] 2024-01-03 15:58:05 -05:00
Elliot DeNolf
46ef284f6b chore(release): db-postgres/0.2.3 [skip ci] 2024-01-03 15:57:54 -05:00
Elliot DeNolf
0727dcd963 chore(release): db-mongodb/1.2.0 [skip ci] 2024-01-03 15:57:22 -05:00
Elliot DeNolf
52f8d4f9f0 chore(release): payload/2.6.0 [skip ci] 2024-01-03 15:55:34 -05:00
Jessica Chowdhury
f1fa374ed1 fix: tab field error when using the same interface name (#4657)
* fix: tab field error when using the same interface name

* fix: removes unused tab types
2024-01-03 15:50:07 -05:00
Alessio Gravili
6b691eee43 chore(eslint-config-payload): improve perfectionist object sort order (#4678) 2024-01-03 21:45:34 +01:00
Paul
be3beabb9b fix: navigation locks when modal is closed with esc (#4664) 2024-01-03 12:06:09 -05:00
Seied Ali Mirkarimi
1fa00cc25c chore: rtl header locale selector (#4670) 2024-01-03 12:04:39 -05:00
James
f70943524b fix(templates): #4662, templates not building after having types generated 2024-01-02 19:49:09 -05:00
Jessica Chowdhury
a67080a291 Merge pull request #4574 from jschuur/patch-1
fix: adjusts json field joi schema to allow editorOptions
2024-01-02 21:58:34 +00:00
Jarrod Flesch
69a99445c9 fix: detect language from request headers accept-language (#4656) 2024-01-02 15:17:00 -05:00
Alessio Gravili
00d8480062 fix: "The punycode module is deprecated" warning by updating nodemailer 2024-01-02 18:26:52 +01:00
Dan Ribbens
7424ba9090 test: e2e await fix (#4646) 2024-01-01 14:09:48 -05:00
Dan Ribbens
ec4d2f97cb fix(db-postgres): query on json properties 2023-12-29 16:42:32 -05:00
Dan Ribbens
9d9ac0ec28 fix(db-postgres): incorrect results querying json field using exists operator 2023-12-29 11:35:12 -05:00
Dan Ribbens
635e7c26e8 fix(plugin-nested-docs): custom parent field slug 2023-12-28 14:30:36 -05:00
Dan Ribbens
c4a4678afb fix(plugin-nested-docs): parent filterOptions errors when specifying breadcrumbsFieldSlug 2023-12-28 14:01:31 -05:00
Dan Ribbens
a5a91c08a9 fix(plugin-nested-docs): breadcrumbsFieldSlug used in resaveSelfAfterCreate hook 2023-12-28 13:05:53 -05:00
Dan Ribbens
7db58b482b fix: custom overrides of breadcrumb and parent fields 2023-12-28 12:56:30 -05:00
Dan Ribbens
1b914083c8 fix: relations with number based ids (postgres) show untitled ID: x 2023-12-27 15:30:30 -05:00
Anthony Bouch
657d14c07b chore(plugin-search): adjusts code comment when attaching hooks (#4595) 2023-12-23 19:24:33 -05:00
yuc
fbf8ab72a4 docs: fix typo in Select Field example (#4593) 2023-12-23 19:15:44 -05:00
Zakher Masri
997f158149 chore(plugin-stripe): fixes broken link in README (#4602) 2023-12-23 19:08:25 -05:00
James Mikrut
c3be5d1d5e Merge pull request #4560 from payloadcms/fix/#4484-graphql-multiple-locales
fix: graphql cannot query multiple locales
2023-12-21 15:29:14 -05:00
James Mikrut
250bcd8189 Merge pull request #4526 from payloadcms/feat/locale-specific-fallbacks
feat: extend locales to have fallbackLocales
2023-12-21 15:25:55 -05:00
Jesse Sivonen
a71d37b398 fix(db-postgres): Wait for transaction to complete on commit (#4582)
* fix(db-postgres): Wait for transaction to complete on commit
* fix session types
2023-12-21 11:03:27 -05:00
Patrik
5c5523195c fix: resets actions array when navigating out of view with actions (#4585) 2023-12-21 10:48:04 -05:00
Joost Schuur
bff4cf518f fix: adjusts json field joi schema to allow editorOptions
Previous fix was not applied to json fields: https://github.com/payloadcms/payload/pull/2731/files
2023-12-21 00:47:14 +08:00
Alessio Gravili
8015e999cd fix(richtext-lexical): z-index issues (#4570) 2023-12-20 15:10:18 +01:00
Sajarin M
0c905f0da7 docs: typo in transactions page (#4565) 2023-12-20 01:31:50 -05:00
Dan Ribbens
e691a90a4c chore: fix failed test 2023-12-19 15:53:20 -05:00
James Mikrut
0b2da4fba7 Merge pull request #4467 from payloadcms/feat/mongodb-transaction-options
feat(db-mongodb): add transactionOptions
2023-12-19 15:30:23 -05:00
Elliot DeNolf
1c6d6788a3 chore: update changelog [skip ci] 2023-12-19 15:03:44 -05:00
Elliot DeNolf
ecc7978184 chore(release): plugin-nested-docs/1.0.10 [skip ci] 2023-12-19 14:49:38 -05:00
Elliot DeNolf
1b9ee64a67 chore(release): live-preview/0.2.2 [skip ci] 2023-12-19 14:48:20 -05:00
Elliot DeNolf
22b02226c3 chore(release): db-postgres/0.2.2 [skip ci] 2023-12-19 14:48:08 -05:00
Elliot DeNolf
e4102b88d8 chore(release): db-mongodb/1.1.1 [skip ci] 2023-12-19 14:47:41 -05:00
Elliot DeNolf
a099f55a69 chore(release): plugin-form-builder/1.1.0 [skip ci] 2023-12-19 14:46:49 -05:00
Elliot DeNolf
1f1445c798 chore(release): richtext-lexical/0.5.0 [skip ci] 2023-12-19 14:45:27 -05:00
Elliot DeNolf
741a5e3650 chore(release): payload/2.5.0 [skip ci] 2023-12-19 14:41:55 -05:00
Dan Ribbens
365047a3fb Merge branch 'feat/locale-specific-fallbacks' into fix/#4484-graphql-multiple-locales 2023-12-19 14:22:09 -05:00
Dan Ribbens
42c06acd18 docs: transaction options 2023-12-19 14:19:28 -05:00
Dan Ribbens
f2c8ac4a9a feat(db-mongodb): add transactionOptions 2023-12-19 14:19:12 -05:00
Dan Ribbens
05e8914db7 fix(db-mongodb): documentDB unique constraint throws incorrect error (#4513) 2023-12-19 14:14:51 -05:00
Dan Ribbens
35191bdd66 docs: improve docs for locales 2023-12-19 14:11:35 -05:00
Dan Ribbens
98890eee1f fix: graphql multiple locales 2023-12-19 14:00:06 -05:00
Ritsu
ef43629502 fix(db-postgres) incorrect currentTableName in find for blocks (#4524) 2023-12-19 10:30:13 -05:00
Dan Ribbens
c703497924 test: improve e2e locale change selector 2023-12-19 09:57:46 -05:00
Jarrod Flesch
7a4607897d chore: exports the useNav hook (#4557) 2023-12-19 09:44:09 -05:00
Sajarin M
1cad1a6954 docs: fix typo in admin hooks page (#4556) 2023-12-19 09:43:25 -05:00
Dan Ribbens
5caad706bb chore: consistent locale and fallback locale for globals 2023-12-19 09:40:26 -05:00
Patrik
9e8f14a897 feat: adds new actions property to admin customization (#4468) 2023-12-19 09:31:58 -05:00
Patrik
f3748a1534 fix: updates return value of empty arrays in getDataByPath (#4553)
* fix: sets the return value to [] instead of 0 for arrays in getDataByPath

* chore: simplifies empty array check
2023-12-19 09:01:24 -05:00
Dan Ribbens
aa048d5409 fix: req.locale and req.fallbackLocale get reassigned in local operations 2023-12-18 16:50:17 -05:00
Alessio Gravili
fee81bfbc4 fix(templates/ecommerce): updates @payloadcms/plugin-stripe to v0.0.19 (#4554) 2023-12-18 16:28:38 -05:00
Jacob Fletcher
ed7c0e19d2 Merge pull request #3673 from payloadcms/chore/plugin-redirects
chore: imports redirects plugin
2023-12-18 15:55:29 -05:00
Jacob Fletcher
adbd76375f chore(plugin-redirects): scaffolds tests (#4552) 2023-12-18 14:47:11 -05:00
Jacob Fletcher
b1f3582764 chore(plugin-redirects): lints and builds (#4551) 2023-12-18 14:25:32 -05:00
Jarrod Flesch
8bc31cd592 fix(db-postgres): findOne correctly querying with where queries (#4550) 2023-12-18 14:17:58 -05:00
Jacob Fletcher
03688f2348 Merge branch 'main' into chore/plugin-redirects 2023-12-18 12:34:16 -05:00
Jacob Fletcher
ace2e9706b Merge pull request #3676 from payloadcms/chore/plugin-seo
chore: imports seo plugin
2023-12-18 12:29:25 -05:00
Jacob Fletcher
c111fa7531 docs: adds seo plugin docs (#4538) 2023-12-18 12:20:32 -05:00
Jacob Fletcher
a859992709 chore(plugin-seo): lints and builds (#4537) 2023-12-18 11:57:16 -05:00
Jacob Fletcher
f51f8493c9 Merge branch 'main' into chore/plugin-seo 2023-12-18 11:50:10 -05:00
Jacob Fletcher
dd32f5e450 chore(plugin-seo): scaffolds tests (#4531) 2023-12-17 23:49:02 -05:00
Jacob Fletcher
6fdd535f29 chore: adds redirects plugin docs (#4530) 2023-12-17 23:32:05 -05:00
Jacob Fletcher
1c6174ecb5 docs: adds stripe plugin docs (#4528) 2023-12-16 13:40:55 -05:00
Dan Ribbens
aafd538cf8 fix failing e2e test 2023-12-16 00:49:04 -05:00
Dan Ribbens
1b42bd207d fix failing tests 2023-12-16 00:18:59 -05:00
Dan Ribbens
9fac2ef24e feat: extend locales to have fallbackLocales 2023-12-15 23:52:12 -05:00
Jacob Fletcher
7ec6af7296 docs: adds nested docs plugin docs (#4521) 2023-12-15 14:40:00 -05:00
Dan Ribbens
c1bd338d0d feat: prevent querying relationship when filterOptions returns false (#4392)
fix: hidden collections showing in lexical and slate relationships
feat: prevent querying relationship when filterOptions returns false
fix: hidden collections appear in richtext internal link options

Co-authored-by: Alessio Gravili <70709113+AlessioGr@users.noreply.github.com>
2023-12-15 12:43:43 -05:00
Alessio Gravili
c49fd66922 feat(richtext-lexical)!: rename TreeviewFeature into TreeViewFeature (#4520)
Breaking: If you import TreeviewFeature in your project, you have to rename the import to use TreeViewFeature (capitalized "V")
2023-12-15 18:33:16 +01:00
Jarrod Flesch
3e9ef849cd fix: omit field default value if read access returns false (#4518) 2023-12-15 11:22:22 -05:00
Jessica Chowdhury
2650c70960 fix: format fields within tab for list controls (#4516) 2023-12-15 10:51:01 -05:00
Jessica Chowdhury
a3f29fd858 chore: adds translated label to verified field (#4509) 2023-12-15 10:44:09 -05:00
Jessica Chowdhury
8257661c47 fix: formats locales with multiple labels for versions locale selector (#4495) 2023-12-15 10:43:03 -05:00
Jacob Fletcher
d86fe0b46c docs: adds form builder plugin docs (#4512) 2023-12-15 10:17:07 -05:00
Jacob Fletcher
d7d55c2a9c docs: adds search plugin docs (#4514) 2023-12-15 09:10:01 -05:00
Jacob Fletcher
f83d65e0cf docs: fixes mdx syntax error in auth config 2023-12-14 13:33:45 -05:00
Jacob Fletcher
303f0d6227 chore(plugin-search): scaffolds tests (#4511) 2023-12-14 13:06:19 -05:00
Jacob Fletcher
6d9110ec48 chore(plugin-stripe): scaffolds tests (#4510) 2023-12-14 11:56:33 -05:00
Jarrod Flesch
07371b9cad fix: adds bg color for year/month select options in datepicker (#4508) 2023-12-14 09:43:29 -05:00
Jarrod Flesch
228d45cf52 fix: correctly fetches externally stored files when passing uploadEdits (#4505) 2023-12-14 09:09:37 -05:00
Alessio Gravili
cc0ba89518 feat(richtext-lexical)!: link node: change doc data format to be consistent with relationship field (#4504)
BREAKING: An unpopulated, internal link node no longer saves the doc id under fields.doc.value.id. Now, it saves it under fields.doc.value.

Migration inside of payload is automatic. If you are reading from the link node inside of your frontend, though, you will have to adjust it.

The version property of the link and autoLink node has been changed from 1 to 2.
2023-12-13 22:57:08 +01:00
Jacob Fletcher
9e7a8c7206 chore(plugin-form-builder): scaffolds tests (#4500) 2023-12-13 15:13:38 -05:00
Fredrik Nordström
eb6572e9e5 fix: make admin navigation transition smoother (#4217)
Co-authored-by: Jarrod Flesch <jarrodmflesch@gmail.com>
2023-12-13 11:17:41 -05:00
Jessica Chowdhury
45c472d6b3 fix: upload related issues, cropping, fetching local file, external preview image (#4461) 2023-12-13 10:22:25 -05:00
Alessio Gravili
c6c5cabfbb feat(plugin-form-builder): Lexical support (#4487)
* chore(plugin-form-builder): upgrade dependencies

* chore(plugin-form-builder): update demo

* feat(plugin-form-builder): lexical support

* chore(plugin-form-builder): add yarn.lock

* chore(plugin-form-builder): undo changes to demo

* fix(plugin-form-builder): get plugin to build for payload 2.0
2023-12-13 16:14:14 +01:00
Alessio Gravili
dd84cc69c7 chore: export payload/dist inside of monorepo (#4489) 2023-12-13 16:12:31 +01:00
Alessio Gravili
31f8f3cac6 feat(richtext-lexical): Slate to Lexical converter: add blockquote conversion, convert custom link fields (#4486) 2023-12-13 13:16:58 +01:00
Alessio Gravili
f868799404 chore(richtext-lexical): Add e2e test for #4115 (#4483) 2023-12-13 08:36:14 +01:00
Jacob Fletcher
fd1c4b7fc8 fix(templates): pins react-hook-form to v7.45.4 (#4469) 2023-12-12 15:22:23 -05:00
Patrik
46e8c01fbe fix: searching by id sends undefined in where query param (#4464)
fix(db-mongodb): search by id using operator
2023-12-12 14:02:30 -05:00
Jarrod Flesch
13e3e06713 fix: graphql schema generation for fields without queryable subfields (#4463) 2023-12-12 12:40:53 -05:00
Jessica Chowdhury
77ebba3ccd docs: adds api key disclaimer (#4390) 2023-12-12 11:27:12 -05:00
Jacob Fletcher
1cc87bd8ea fix(plugin-nested-docs): properly exports field utilities (#4462) 2023-12-12 10:51:03 -05:00
Patrik
3df52a8856 fix(plugin-form-builder): removes use of slate in rich-text serializer (#4451) 2023-12-12 09:47:38 -05:00
dependabot[bot]
b450aeee85 chore(deps): bump sharp from 0.31.3 to 0.32.6 in /templates/blank (#4173)
Bumps [sharp](https://github.com/lovell/sharp) from 0.31.3 to 0.32.6.
- [Release notes](https://github.com/lovell/sharp/releases)
- [Changelog](https://github.com/lovell/sharp/blob/main/docs/changelog.md)
- [Commits](https://github.com/lovell/sharp/compare/v0.31.3...v0.32.6)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-12 09:37:15 -05:00
dependabot[bot]
93f0ebdeae chore(deps): bump terser in /packages/plugin-search/demo (#3886)
Bumps [terser](https://github.com/terser/terser) from 5.12.1 to 5.22.0.
- [Changelog](https://github.com/terser/terser/blob/master/CHANGELOG.md)
- [Commits](https://github.com/terser/terser/compare/v5.12.1...v5.22.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-12 09:36:43 -05:00
Jarrod Flesch
3a20ddc5f8 fix: ensure ui fields do not make it into gql schemas (#4457) 2023-12-12 08:23:24 -05:00
Jacob Fletcher
dff3f37313 fix(templates): collection archive block (#4426) 2023-12-11 18:28:10 -05:00
Jacob Fletcher
2a65717792 chore(examples): adds nested docs example (#4452) 2023-12-11 17:40:10 -05:00
Jarrod Flesch
63000373e6 fix: cursor jumping around inside json field (#4453) 2023-12-11 16:58:54 -05:00
Patrik
678ba6cdcc docs: adds examples and descriptions to field hook docs (#4448) 2023-12-11 16:53:02 -05:00
Jarrod Flesch
a1d66b83e0 fix: disallow duplicate fieldNames to be used on the same level in the config (#4381) 2023-12-11 16:52:24 -05:00
Alessio Gravili
548e78c598 fix(richtext-lexical): Blocks field: should not prompt for unsaved changes due to value comparison between null and non-existent props (#4450) 2023-12-11 20:42:42 +01:00
Alessio Gravili
168d629697 feat: add context to auth and globals local API (#4449)
* feat: add context to auth and globals local API

* chore: add int test
2023-12-11 20:27:34 +01:00
Alessio Gravili
b9c0248823 fix: pin ts-node versions which are causing swc errors (#4447) 2023-12-11 17:55:36 +01:00
Alessio Gravili
a2dac605e5 Merge pull request #4446 from payloadcms/lexical/commits
fix(richtext-lexical): incorrect URL validation for tel: URLs, unnecessary license headers
2023-12-11 16:38:34 +01:00
Alessio Gravili
9222d6f207 chore(richtext-lexical): remove unnecessary leftover Meta license headers, as they're already included in the LICENSE.md 2023-12-11 16:35:26 +01:00
Alessio Gravili
ac7f9809bc fix(richtext-lexical): not all types of URLs are validated correctly 2023-12-11 16:33:00 +01:00
Jacob Fletcher
076c3258d0 docs: typo in admin components (#4445) 2023-12-11 09:48:27 -05:00
Alessio Gravili
9331204295 feat(richtext-lexical)!: improve floating select menu Dropdown classNames (#4444)
Breaking: Dropdown component has a new mandatory sectionKey prop
2023-12-11 14:34:22 +01:00
Alessio Gravili
9babf6804c feat(richtext-lexical): improve link URL validation (#4442)
* fix(richtext-lexical): Link: allow phone numbers as URLs starting with tel:+

* feat(richtext-lexical): Link Feature: immediately validate URL field in drawer form

* Remove console log
2023-12-11 00:39:32 +01:00
Alessio Gravili
5c2739ebd1 fix(richtext-lexical): do not add unnecessary paragraph before upload, relationship and blocks nodes (#4441) 2023-12-11 00:08:15 +01:00
Alessio Gravili
0421173f9e fix(richtext-lexical): lexicalHTML field now works when used inside of row fields (#4440) 2023-12-10 23:47:32 +01:00
Alessio Gravili
057996766b chore(deps): bump various devDependencies in workspace root (#4433) 2023-12-09 15:35:15 +01:00
Alessio Gravili
b70c8ff6b8 chore(richtext-lexical): Slash Menu: Don't show scroll bar if not needed (#4432) 2023-12-09 15:07:33 +01:00
Jarrod Flesch
8299436554 examples(testing): updates examples/testing to align with Payload 2.x (#4431) 2023-12-08 15:46:14 -05:00
Alessio Gravili
d218f63c6f Merge pull request #4430 from payloadcms/chore/upload-node-html
feat(richtext-lexical): Improve Upload element serialization
2023-12-08 20:12:44 +01:00
Alessio Gravili
e55889480f feat(richtext-lexical): Upload html serializer: Output picture element if the image has multiple sizes, improve absolute URL creation 2023-12-08 20:09:41 +01:00
Elliot DeNolf
37aa99f1dd chore: update changelog [skip ci] 2023-12-07 11:01:52 -05:00
Elliot DeNolf
d3e47b64c1 chore(release): richtext-slate/1.3.1 [skip ci] 2023-12-07 11:00:19 -05:00
Elliot DeNolf
070f4d5bb5 chore(release): richtext-lexical/0.4.1 [skip ci] 2023-12-07 10:58:17 -05:00
Alessio Gravili
48f1299fcb fix(richtext-*): loosen RichTextAdapter types due to re-occuring ts strict mode errors (#4416) 2023-12-07 15:59:59 +01:00
Alessio Gravili
61dca16f91 chore(richtext-lexical): upgrade to lexical 0.12.5 and port over relevant playground changes (#4415) 2023-12-07 15:30:39 +01:00
Dan Ribbens
6e9ae65374 fix(db-postgres): querying nested blocks fields (#4404)
Co-authored-by: Jessica Chowdhury <jessica@trbl.design>
2023-12-07 09:18:48 -05:00
Alessio Gravili
35f54a7be3 Merge pull request #4413 from payloadcms/chore/more-misc-lexical
chore(richtext-lexical): misc fixes and improvements
2023-12-07 14:48:15 +01:00
Alessio Gravili
128f9c4e7e fix(richtext-lexical): lexicalHTML field not working when used inside of Blocks field 2023-12-07 14:30:01 +01:00
Alessio Gravili
1469fc26c7 chore(richtext-lexical): Slash menu items: improve overflow behavior 2023-12-07 14:13:11 +01:00
Elliot DeNolf
e03ff791b6 chore(release): live-preview/0.2.1 [skip ci] 2023-12-06 13:41:32 -05:00
Elliot DeNolf
403c3d3e08 chore(release): db-postgres/0.2.1 [skip ci] 2023-12-06 13:41:32 -05:00
Elliot DeNolf
d7765ef9e1 chore(release): richtext-slate/1.3.0 [skip ci] 2023-12-06 13:41:32 -05:00
Elliot DeNolf
df4f346f2f chore(release): richtext-lexical/0.4.0 [skip ci] 2023-12-06 13:41:32 -05:00
Elliot DeNolf
93fa7b608f chore(richtext-lexical): bump payload peer dep 2023-12-06 13:41:32 -05:00
Elliot DeNolf
989aba665e chore(release): payload/2.4.0 [skip ci] 2023-12-06 13:41:32 -05:00
Alessio Gravili
c582f948c7 docs: update reproduction-guide.md (#4402) 2023-12-06 19:36:00 +01:00
Alessio Gravili
217cc1fc42 docs: update CONTRIBUTING.md (#4401) 2023-12-06 19:15:17 +01:00
Alessio Gravili
7af8f29b4a feat(richtext-lexical): Link & Relationship Feature: field-level configurable allowed relationships (#4182)
* feat(richtext-lexical): ability to configure link feature enabled relations on a field-level

* feat(richtext-lexical): ability to configure Relationship feature enabled relations on a field-level

* chore(richtext-lexical): Improve Link feature props typing

* chore(richtext-lexical): Improve Link and Relationship feature props typing

* fix(richtext-lexical): Link drawer types

* chore: merge conflict resolve

* chore(richtext-lexical): Link Feature: add comments that explain how getBaseFields works
2023-12-06 17:50:50 +01:00
chris
5f2cd1ae77 docs: fix example link (#4394) 2023-12-06 09:35:30 -05:00
Dan Ribbens
dbaecda0e9 fix(db-postgres): sorting on a not-configured field throws error (#4382) 2023-12-06 09:27:43 -05:00
Tylan Davis
cf9a3704df fix: handles null upload field values (#4397) 2023-12-06 09:26:19 -05:00
Patrik
4b5453e8e5 fix: simplifies query validation and fixes nested relationship fields (#4391) 2023-12-06 08:47:34 -05:00
Alessio Gravili
5de347ffff feat(richtext-lexical)!: lazy import React components to prevent client-only code from leaking into the server (#4290)
* chore(richtext-lexical): lazy import all React things

* chore(richtext-lexical): use useMemo for lazy-loaded React Components to prevent lag and flashes when parent component re-renders

* chore: make exportPointerFiles.ts script usable for other packages as well by hoisting it up to the workspace root and making it configurable

* chore(richtext-lexical): make sure no client-side code is imported by default from Features

* chore(richtext-lexical): remove unnecessary scss files

* chore(richtext-lexical): adjust package.json exports

* chore(richtext-*): lazy-import Field & Cell Components, move Client-only exports to /components subpath export

* chore(richtext-lexical): make sure nothing client-side is directly exported from the / subpath export anymore

* add missing imports

* chore: remove breaking changes for Slate

* LazyCellComponent & LazyFieldComponent
2023-12-06 14:20:18 +01:00
Jacob Fletcher
80ef18c149 fix(templates/website): removes unused form builder plugin from deps (#4385) 2023-12-05 11:57:21 -05:00
Christian May
912abe2b64 docs(plugin-nested-docs): clarifies that relationships are intra-collection (#4375) 2023-12-05 00:58:36 -05:00
Jacob Fletcher
4090aebb0e fix(live-preview): populates rte uploads and relationships (#4379) 2023-12-05 00:53:11 -05:00
chris
290e9d8238 docs: fixes typo in migrations (#4374) 2023-12-05 00:24:37 -05:00
Kane Wang
50253f617c feat: add Chinese Traditional translation (#4372) 2023-12-04 15:29:29 -05:00
geisterfurz007
999e05d1b4 docs: fix typo in migrations (#4356) 2023-12-04 15:09:21 -05:00
Dan Ribbens
b6cffcea07 fix: defaultValues computed on new globals (#4380) 2023-12-04 15:05:47 -05:00
Patrik
7b2eb0c175 docs: updates afterInput example (#4378) 2023-12-04 14:35:08 -05:00
Timothy Choi
3b8a27d199 feat: pass path to FieldDescription (#4364)
fix: DescriptionFunction type

Co-authored-by: Jarrod Flesch <jarrodmflesch@gmail.com>
2023-12-04 13:59:18 -05:00
Jessica Chowdhury
65adfd21ed fix: uploads files after validation (#4218) 2023-12-04 12:38:23 -05:00
Jacob Fletcher
03a387233d fix(live-preview): sends raw js objects through window.postMessage instead of json (#4354) 2023-12-01 17:50:55 -05:00
Jessica Chowdhury
fcbe5744d9 fix: upload editing error with plugin-cloud (#4170)
Co-authored-by: Jarrod Flesch <jarrodmflesch@gmail.com>
2023-12-01 16:35:12 -05:00
Jessica Chowdhury
06bf6a426e docs: destructures vite bundler import (#4280) 2023-12-01 16:32:10 -05:00
Renat Sagdeev
b634d5e552 docs: fix ul and ol tags mentioned in lexical rte (#4338) 2023-12-01 16:29:43 -05:00
Jacob Fletcher
5f173241df feat: async live preview urls (#4339) 2023-12-01 16:25:39 -05:00
Markus Machatschek
0bd12e01d7 docs: update software requirements to mention pnpm (#4335)
Co-authored-by: Jacob Fletcher <jacobsfletch@gmail.com>
2023-12-01 16:25:21 -05:00
Elliot DeNolf
b6f02765eb chore(release): richtext-lexical/0.3.1 [skip ci] 2023-12-01 16:19:58 -05:00
Elliot DeNolf
156ffdd18c chore(release): payload/2.3.1 [skip ci] 2023-12-01 16:18:48 -05:00
Jarrod Flesch
fe888b5f6c fix: query validation on relationship fields (#4353) 2023-12-01 16:03:58 -05:00
Alessio Gravili
bea79feaea fix: ensure doc controls are not hidden behind lexical field (#4345) 2023-12-01 10:23:39 +01:00
Alessio Gravili
293cee6f90 chore(plugin-stripe): rename build script to _build (#4344) 2023-12-01 10:04:37 +01:00
Alessio Gravili
3e745e91da fix(richtext-lexical): blocks content may be hidden behind components outside of the editor (#4325)
* chore(richtext-lexical): add e2e test to reproduce the issue

* fix the issue
2023-12-01 09:46:21 +01:00
Alessio Gravili
4243048fc5 Merge pull request #4342 from payloadcms/fix/lexical-blocks-v1-conversion
fix(richtext-lexical): Blocks node: incorrect conversion from v1 node to v2 node
2023-12-01 09:29:57 +01:00
Alessio Gravili
ef84a2cfff fix(richtext-lexical): Blocks node: incorrect conversion from v1 node to v2 node 2023-12-01 09:28:44 +01:00
James
c00cbaabbc chore: lints 2023-11-30 18:34:38 -05:00
James
02f407e995 chore: lints 2023-11-30 17:12:01 -05:00
Elliot DeNolf
74e8051bb6 chore(templates): GRAPHQL_API_URL to ecommerce template 2023-11-30 17:01:19 -05:00
James
ee670b2b20 chore: introduces graphql_api_url to website template 2023-11-30 16:58:30 -05:00
Elliot DeNolf
2f8bcc977b fix(templates): adjust graphql endpoint 2023-11-30 16:19:46 -05:00
Dan Ribbens
0cc91d7377 docs: update mongoOptions to connectOptions (#4334) 2023-11-30 12:39:32 -05:00
Elliot DeNolf
34e89ff5db chore(release): richtext-slate/1.2.1 [skip ci] 2023-11-30 11:11:28 -05:00
Elliot DeNolf
b39b52dbd3 chore(release): live-preview-react/0.2.0 [skip ci] 2023-11-30 11:11:03 -05:00
Elliot DeNolf
7bfdb2627a chore(release): live-preview/0.2.0 [skip ci] 2023-11-30 11:10:55 -05:00
Elliot DeNolf
8f5867e876 chore(release): db-postgres/0.2.0 [skip ci] 2023-11-30 11:10:44 -05:00
Elliot DeNolf
45a3e31c95 chore(release): db-mongodb/1.1.0 [skip ci] 2023-11-30 11:10:33 -05:00
Elliot DeNolf
176550d26b chore(release): richtext-lexical/0.3.0 [skip ci] 2023-11-30 11:07:44 -05:00
Elliot DeNolf
53958d4662 chore(release): payload/2.3.0 [skip ci] 2023-11-30 11:05:49 -05:00
Elliot DeNolf
a0859114eb chore(richtext-*): bump payload peer dep 2023-11-30 10:59:26 -05:00
Jacob Fletcher
4adc30b034 chore: fixes failing postgres int test for live preview (#4329) 2023-11-30 10:30:09 -05:00
Alessio Gravili
ff61d5a099 chore(richtext-*): roll-back richtext adapter change 2023-11-30 16:25:17 +01:00
Jacob Fletcher
9cc88bb474 fix: properly sets tabs key in fieldSchemaToJSON (#4317) 2023-11-30 09:48:37 -05:00
Jacob Fletcher
57fc211674 fix(live-preview): re-populates externally updated relationships (#4287) 2023-11-30 09:47:56 -05:00
Dan Ribbens
9da9b1fc50 fix: duplicate documents with required localized fields (#4236) 2023-11-30 09:27:24 -05:00
Dan Ribbens
30d050ef86 chore: fix telemetry user id type string (#4321) 2023-11-30 09:26:51 -05:00
Alessio Gravili
9beb9c8627 chore(richtext-lexical): ensure CSS is not accidentally overridden (#4324) 2023-11-30 11:55:02 +01:00
Patrik
224cddd045 feat: relationship sortOptions property (#4301)
* feat: adds sortOptions property to relationship field

* chore: fix lexical int tests

* feat: simplifies logic & updates joi schema definition

* feat: revert to default when searching in relationship select

* fix types and joi schema

* type adjustments

---------

Co-authored-by: Alessio Gravili <alessio@bonfireleads.com>
Co-authored-by: Jarrod Flesch <jarrodmflesch@gmail.com>
2023-11-29 16:22:47 -05:00
Alessio Gravili
3502ce720b fix: incorrect key property in Tabs field component (#4311)
Fixes #4282
2023-11-29 22:18:40 +01:00
Jacob Fletcher
b8fa61942e chore(examples/custom-server): removes unnused dotenv.js mock file (#4316) 2023-11-29 16:08:16 -05:00
Jacob Fletcher
d49bb4351f feat(live-preview): batches api requests (#4315) 2023-11-29 14:03:05 -05:00
Jacob Fletcher
542096361f fix: properly exports useDocumentsEvents hook (#4314) 2023-11-29 12:26:20 -05:00
Jacob Fletcher
66679fbdd6 fix(live-preview): property resets rte nodes (#4313) 2023-11-29 12:24:51 -05:00
Jarrod Flesch
d4f28b16b4 fix(richtext-slate): add use client to top of tsx files importing from payload core (#4312) 2023-11-29 12:19:54 -05:00
Jarrod Flesch
cd07873fc5 fix(db-postgres): allow for nested block fields to be queried (#4237)
Co-authored-by: Dan Ribbens <dan.ribbens@gmail.com>
2023-11-29 11:03:57 -05:00
1nfinite9
6d28fc46bd docs: updates incorrect API for Reset Password (#4270)
Co-authored-by: Dan Ribbens <dan.ribbens@gmail.com>
2023-11-29 11:01:44 -05:00
Jacob Fletcher
8e903053e2 Merge pull request #4308 from payloadcms/fix/live-preview-deps
fix(live-preview,live-preview-react): removes payload from peer deps
2023-11-29 11:01:13 -05:00
Jacob Fletcher
7e1052fd98 fix(live-preview-react): removes payload from peer deps 2023-11-29 10:57:44 -05:00
Jacob Fletcher
b4af95f894 fix(live-preview): removes payload from peer deps 2023-11-29 10:57:31 -05:00
Jacob Fletcher
381c158b03 fix(live-preview): compounds merge results (#4306) 2023-11-29 10:54:14 -05:00
Dan Ribbens
3514bfbdae fix(db-postgres): error saving nested arrays with versions (#4302) 2023-11-29 10:10:08 -05:00
James Mikrut
4cfe473627 Merge pull request #4296 from TiKevin83/feature/bearer-jwts
feat: support OAuth 2.0 format Authorization: Bearer tokens in headers
2023-11-28 16:42:13 -05:00
Travis Mcgeehan
c1eb9d1727 feat: support OAuth 2.0 format Authorization: Bearer tokens in headers 2023-11-28 16:23:18 -05:00
Patrik
37b765cce8 fix(plugin-stripe): vite support (#4279)
* chore: updates export of stripe plugin & bumps payload versions

* chore: handles type errors

* chore: adds alias for stripeREST & strepWebhooks

* fixes issues with bundling within demo

* chore: defaults plugin-stripe demo to use vite bundler

* chore: updates pnpm lock file

* chore: removes yarn lock file from plugin-stripe demo

* chore: bumps payload in demo & cleans up demo config

* chore: updates pnpm lock file

---------

Co-authored-by: Jarrod Flesch <jarrodmflesch@gmail.com>
2023-11-28 14:12:18 -05:00
Alessio Gravili
5bf64933b4 fix(richtext-lexical): HTML Converter field not working inside of tabs (#4293) 2023-11-28 19:36:23 +01:00
Alessio Gravili
094d02ce1d fix(richtext-lexical): re-use payload population logic to fix population-related issues (#4291)
* chore(richtext-lexical): Add int test which reproduces the issue

* chore: Remove unnecessary await in core afterRead promise

* fix(richtext-lexical): re-use recurseNestedFields from payload instead of using own recurseNestedFields

* chore(richtext-lexical): pass in missing properties which are available in the core afterRead hook

* chore: remove unnecessary block
2023-11-28 19:18:07 +01:00
Elliot DeNolf
1fe4f4c5f4 Merge pull request #4292 from payloadcms/feat/migrate-with-js-files
feat: support migrations with js files
2023-11-28 11:40:36 -05:00
Elliot DeNolf
35ce0ebc83 docs: migrations directory details 2023-11-28 11:18:04 -05:00
Elliot DeNolf
530c825f80 feat(db-mongodb): search for migrations dir intelligently 2023-11-28 11:09:55 -05:00
Elliot DeNolf
308979f31d feat(db-postgres): search for migrations dir intelligently 2023-11-28 11:09:36 -05:00
Elliot DeNolf
2122242192 feat: support migrations with js files 2023-11-28 11:09:25 -05:00
Nikola Spalevic
40c8909ee0 feat: add serbian (latin and cyrillic) translations (#4268) 2023-11-28 09:08:26 -05:00
Dan Ribbens
babe3dba6a chore(db-postgres): add uuid to dependencies (#4286) 2023-11-28 09:08:08 -05:00
Jacob Fletcher
9bb7a88526 feat: useDocumentEvents (#4284) 2023-11-27 16:16:53 -05:00
Elliot DeNolf
098e389147 chore(release): payload/2.2.2 [skip ci] 2023-11-27 16:11:31 -05:00
James Mikrut
b56f1f4f2a Merge pull request #4285 from payloadcms/fix/doc-access-transactions
fix: transactions broken within doc access
2023-11-27 16:07:05 -05:00
James
443847ec71 fix: transactions broken within doc access 2023-11-27 15:56:18 -05:00
Elliot DeNolf
26f6b37a20 chore(release): bundler-vite/0.1.5 [skip ci] 2023-11-27 15:33:43 -05:00
Jessica Chowdhury
1dcd3a2782 fix: prevent json data getting reset when switching tabs (#4123) 2023-11-27 12:23:20 -05:00
Jacob Fletcher
6f59257574 Merge pull request #4250 from payloadcms/fix/live-preview-rels 2023-11-27 11:04:34 -05:00
Jacob Fletcher
65575d3573 Merge branch 'main' into fix/live-preview-rels 2023-11-27 10:54:27 -05:00
Tylan Davis
cbeb0a8bc7 fix(templates): uses context to prevent infinite loop in populateArchiveBlock (#4278) 2023-11-27 10:47:03 -05:00
Jacob Fletcher
ad62db01e7 chore(templates): adds comments to .env.example (#4276) 2023-11-27 10:43:03 -05:00
Kennet Winter
42cba2e3a1 docs: fix broken links to public demo (#4266) 2023-11-27 10:29:05 -05:00
Yunsup Sim
1401718b3b feat(i18n): adds Korean translation (#4258) 2023-11-27 10:26:53 -05:00
Jacob Fletcher
712647d741 docs: adds live preview troubleshooting tips 2023-11-27 08:09:26 -05:00
Alessio Gravili
c8d2b2b60e chore(richtext-lexical): fix failing e2e test due to html class changes (#4265) 2023-11-26 11:39:27 +01:00
Jacob Fletcher
aab2407112 fix(live-preview): clear hasMany relationships 2023-11-24 09:57:41 -05:00
Alessio Gravili
d439bf3011 Merge pull request #4257 from payloadcms/chore/lexical-impr
BREAKING: The last PR is breaking because it changes some properties of the SlashMenu section in the Feature interface
2023-11-24 01:18:55 +01:00
Alessio Gravili
62ca71fbc4 chore(richtext-lexical): breaking: slash menu: simplify, improve CSS class names, change 'title' in interface to key and displayName 2023-11-24 01:16:04 +01:00
Alessio Gravili
e50fa9ca8f feat(richtext-lexical): floating select toolbar: add ability to configure dropdown entry component 2023-11-23 23:52:16 +01:00
Alessio Gravili
ed7aca6525 chore(richtext-lexical): improve CSS class names of floating select toolbar 2023-11-23 23:38:25 +01:00
Zaki Nadhif
98ccd05dd6 chore(richtext-lexical): Add a hint that the slash menu exists to the user (#4206)
* chore(richtext-lexical): Add a hint that the slash menu exists to the user

* Update LexicalEditor.tsx

---------

Co-authored-by: Alessio Gravili <70709113+AlessioGr@users.noreply.github.com>
2023-11-23 22:28:02 +01:00
Alessio Gravili
051bced3b5 Merge pull request #4256 from payloadcms/chore/lexical-small-improvements
BREAKING: The first commit is breaking, as it changes the exported UnoderedListFeature to UnorderedListFeature due to a typo
2023-11-23 22:24:15 +01:00
Alessio Gravili
79f08baf2f chore(richtext-lexical): add lists to floating toolbar 2023-11-23 22:12:10 +01:00
Alessio Gravili
d6b63da617 docs(richtext-lexical): fix incorrect JSDOM import 2023-11-23 22:03:36 +01:00
Alessio Gravili
d512e9382d fix(richtext-lexical): breaking: fix typo: UnoderedListFeature => UnorderedListFeature 2023-11-23 21:39:07 +01:00
Alessio Gravili
b17cafc7be chore(richtext-lexical): add proper typing for node replacements (#4255) 2023-11-23 19:04:34 +01:00
Jacob Fletcher
24dacd6712 fix(live-preview): populates rich text relationships 2023-11-22 17:55:42 -05:00
Dan Ribbens
6ea29094ba fix(db-postgres): incorrect pagination totalDocs (#4248)
Co-authored-by: Alessio Gravili <alessio@bonfireleads.com>
2023-11-22 16:14:14 -05:00
Mark Barton
f27407ce7c chore: correct information from Nested Docs Plugin documentation (#4244) 2023-11-22 12:09:13 -05:00
stoddabr
9ae65fa791 docs: fix create-payload-app example (#4180) 2023-11-21 16:59:06 -05:00
Jessica Chowdhury
3d2b62b210 fix: passes date options to the react-datepicker in filter UI, removes duplicate options from operators select (#4225)
Co-authored-by: Jarrod Flesch <jarrodmflesch@gmail.com>
2023-11-21 16:48:39 -05:00
Jessica Chowdhury
6364afb1dd docs: updates vite alias example and fixes broken link (#4224) 2023-11-21 14:34:18 -05:00
Radosław Kłos
56a4692662 fix: typo in polish translations (#4234) 2023-11-21 13:09:00 -05:00
Dan Ribbens
ef6b8e4235 test: graphql handle deleted relationships (#4229) 2023-11-21 13:07:13 -05:00
Elliot DeNolf
5f5290341a chore(plugin-cloud-storage): adjust prepublishOnly script 2023-11-21 10:28:35 -05:00
Elliot DeNolf
62403584ad chore(scripts): cleanup package details log 2023-11-21 10:28:17 -05:00
Jarrod Flesch
19fcfc27af fix: number field validation (#4233) 2023-11-21 10:12:26 -05:00
Elliot DeNolf
dcf14f5f71 chore(release): payload/2.2.1 [skip ci] 2023-11-21 10:08:07 -05:00
Elliot DeNolf
3a784a06cc fix: make outputSchema optional on richtext config (#4230) 2023-11-21 09:45:57 -05:00
Jessica Chowdhury
6eeae9d53b examples: updates blank template readme (#4216) 2023-11-21 08:40:01 -05:00
Jarrod Flesch
6044f810bd docs: correct PULL_REQUEST_TEMPLATE.md links 2023-11-21 08:37:57 -05:00
Elliot DeNolf
e68ca9363f fix(plugin-cloud-storage): adjust webpack aliasing for pnpm (#4228) 2023-11-20 16:53:30 -05:00
Elliot DeNolf
9963b8d945 chore(release): plugin-nested-docs/1.0.9 [skip ci] 2023-11-20 16:40:46 -05:00
Elliot DeNolf
9afb838182 chore(release): richtext-slate/1.2.0 [skip ci] 2023-11-20 16:39:38 -05:00
Elliot DeNolf
2dad129022 chore(release): richtext-lexical/0.2.0 [skip ci] 2023-11-20 16:39:20 -05:00
Elliot DeNolf
6af1c4d45d chore(release): payload/2.2.0 [skip ci] 2023-11-20 16:36:41 -05:00
Dan Ribbens
4e41dd1bf2 fix(plugin-nested-docs): await populate breadcrumbs on resaveChildren (#4226) 2023-11-20 16:32:02 -05:00
Dan Ribbens
de02490231 feat: hide publish button based on permissions (#4203)
Co-authored-by: James <james@trbl.design>
2023-11-20 16:26:49 -05:00
Jacob Fletcher
8a7b41721a chore: increases live preview testing coverage 2023-11-20 12:58:27 -05:00
Take Weiland
1510baf46e fix: synchronous transaction errors (#4164)
Co-authored-by: Dan Ribbens <dan.ribbens@gmail.com>
2023-11-20 12:20:42 -05:00
Jacob Fletcher
0672e864f3 chore: resolves imports and type errors in live preview test app 2023-11-20 11:30:05 -05:00
Alessio Gravili
c10db332cd docs(richtext-lexical): remove unnecessary await from createHeadlessEditor (#4213) 2023-11-19 14:40:09 +01:00
Alessio Gravili
0af9c4d398 fix(richtext-lexical): Blocks: Array row data is not removed (#4209)
* chore(richtext-lexical): Add failing test which reproduces issue

* fix(richtext-lexical): fix the actual issue
2023-11-18 14:01:57 +01:00
Alessio Gravili
fc137c0f53 Merge pull request #4210 from payloadcms/chore/upgrade-lexical
chore(richtext-lexical): Upgrade lexical from 0.12.2 to 0.12.4 and port some playground changes over
2023-11-18 12:59:24 +01:00
Alessio Gravili
a24f2be4a6 chore(richtext-lexical): backport setFloatingElemPositionForLinkEditor type change from playground 2023-11-18 12:54:40 +01:00
Alessio Gravili
57999adfe2 chore(richtext-lexical): backport autolink changes from lexical playground 2023-11-18 12:51:08 +01:00
Alessio Gravili
7857043d03 chore(richtext-lexical): Upgrade lexical packages 2023-11-18 12:37:28 +01:00
Alessio Gravili
3b93af734b Merge pull request #4207 from payloadcms/fix/lexical-validations-
fix(richtext-lexical): Blocks: fields without fulfilled condition are now skipped for validation
2023-11-18 11:55:41 +01:00
Alessio Gravili
50fab902bd fix(richtext-lexical): Blocks: fields without fulfilled condition are now skipped for validation 2023-11-18 11:52:30 +01:00
Alessio Gravili
724d80b7f4 Merge pull request #4196 from payloadcms/docs/lexical-editorconfig
docs(richtext-lexical): various documentation improvements
2023-11-17 18:39:11 +01:00
Alessio Gravili
b406e6afb9 docs(richtext-lexical): various documentation improvements 2023-11-17 18:38:09 +01:00
Alessio Gravili
3f46b21eb2 Merge pull request #4192 from payloadcms/feat/lexical-top
feat(richtext-lexical): Add new position: 'top' property for plugins
2023-11-17 18:20:29 +01:00
Alessio Gravili
eed4f4361c feat(richtext-lexical): Add new position: 'top' property for plugins 2023-11-17 18:18:54 +01:00
Jarrod Flesch
05f3169a75 fix: thread locale through to access routes from admin panel (#4183) 2023-11-17 10:15:12 -05:00
Alessio Gravili
94f1443ce4 Merge pull request #4176 from payloadcms/fix/missing-use-client
fix(richtext-lexical): add missing 'use client' to TestRecorder
2023-11-16 22:38:52 +01:00
Alessio Gravili
fc26275b7a fix(richtext-lexical): add missing 'use client' to TestRecorder feature plugin 2023-11-16 22:37:37 +01:00
Alessio Gravili
e57f5e2aa0 Merge pull request #4175 from payloadcms/fix/lexical-html-globals
fix(richtext-lexical): make lexicalHTML() function work for globals
2023-11-16 22:11:54 +01:00
Alessio Gravili
dbfc83520c fix(richtext-lexical): make lexicalHTML() function work for globals 2023-11-16 22:10:00 +01:00
Alessio Gravili
c068a8784e fix(richtext-lexical): Blocks: make sure fields are wrapped in a uniquely-named group, change block node data format, fix react key error (#3995)
* fix(richtext-lexical): make sure block fields are wrapped in a uniquely-named group

* chore: remove redundant hook

* chore(richtext-lexical): attempt to fix unnecessary unsaved changes warning regression

* cleanup everything

* chore: more cleanup

* debug

* looks like properly cloning the formdata for setting initial state fixes the issue where the old formdata is updated even if node.setFields is not called

* chore: fix e2e tests

* chore: fix e2e tests (a selector has changed)

* chore: fix int tests (due to new blocks data format)

* chore: fix incorrect insert block commands in drawer

* chore: add new e2e test

* chore: fail e2e tests when there are browser console errors

* fix(breaking): beforeInput and afterInput: fix missing key errors, consistent typing and cases in name
2023-11-16 22:01:04 +01:00
Alessio Gravili
989c10e0e0 feat: allow richtext adapters to control type generation, improve generated lexical types (#4036) 2023-11-16 11:36:20 -05:00
Alessio Gravili
3bf2b7a3fe Merge pull request #4171 from zakinadhif/main
fix(richtext-lexical): visual bug after rearranging blocks
2023-11-16 17:23:41 +01:00
Zaki Nadhif
a6b486007d fix(richtext-lexical): visual bug after rearranging blocks 2023-11-16 22:38:34 +07:00
Wilson
4e03ee7079 chore: adds doc blocks for field access properties (#3973) 2023-11-16 09:15:04 -05:00
Quentin Beauperin
b91711a74a fix: improves live preview breakpoints and zoom options in dark mode (#4090) 2023-11-16 09:10:33 -05:00
Jonathan Wu
191c13a409 chore(examples/form-builder): improve form input accessibility (#4166) 2023-11-16 08:02:15 -05:00
Alessio Gravili
b210af4696 fix(richtext-lexical): incorrect caret positioning when selecting second line of multi-line paragraph (#4165) 2023-11-15 22:22:42 +01:00
Taís Massaro
8cebd2ccce docs: correct useTableColumns react import path in example (#4150) 2023-11-15 08:20:42 -05:00
Take Weiland
195a952c43 fix: transactionID isolation for GraphQL (#4095) 2023-11-14 16:07:10 -05:00
Alessio Gravili
4bc5fa7086 chore(richtext-lexical): remove unused defaultValue prop in RichText component (#4146) 2023-11-14 18:31:04 +01:00
Alessio Gravili
2c8d34d2aa fix(richtext-lexical): remove optional chaining after this as transpilers are not handling it well (#4145) 2023-11-14 18:21:51 +01:00
Alessio Gravili
4ec5643dd7 chore: restricts character length in table cells (#4063) 2023-11-14 11:25:24 -05:00
Jessica Chowdhury
45e9a559bb fix: upload fit not accounted for when editing focal point or crop (#4142)
Co-authored-by: Jarrod Flesch <jarrodmflesch@gmail.com>
2023-11-14 11:19:23 -05:00
Jessica Chowdhury
d6233cbf42 templates: update fetch request in populateArchiveBlock hook (#4127) 2023-11-14 11:16:16 -05:00
Jessica Chowdhury
ad3e23b345 chore: updates translation key in dropzone component (#4135) 2023-11-14 11:09:09 -05:00
Radosław Kłos
782e118569 fix(i18n): polish translations (#4134) 2023-11-14 11:06:59 -05:00
Jessica Chowdhury
dbfe4af993 chore: corrects block name overflow in UI (#4138) 2023-11-14 10:56:35 -05:00
Alessio Gravili
859c2f4a6d fix(richtext-lexical): nested editor may lose focus when writing (#4139) 2023-11-14 15:42:30 +01:00
Elliot DeNolf
a34d0f8274 fix(templates): yarn v1 workaround (#4125) 2023-11-13 11:53:57 -05:00
Jessica Chowdhury
967eff1aab fix: rename tab button classname to prevent unintentional styling (#4121) 2023-11-13 08:39:16 -05:00
Alessio Gravili
b7041d6ab1 chore(richtext-lexical): New e2e test: should allow adding new blocks to a sub-blocks field, part of a parent lexical blocks field (#4114) 2023-11-12 23:48:13 +01:00
Alessio Gravili
78b7bd62cd Merge pull request #4113 from payloadcms/fix/4025
fix(richtext-lexical): Blocks: z-index and floating select menu button click issues
2023-11-12 23:17:53 +01:00
Alessio Gravili
7329b1babd chore(richtext-lexical): Remove unnecessary console.log 2023-11-12 23:17:33 +01:00
Alessio Gravili
c87969b7f9 chore(richtext-lexical): Add e2e test: 'ensure slash menu is not hidden behind other blocks' 2023-11-12 23:12:24 +01:00
Alessio Gravili
09f17f4450 fix(richtext-lexical): Blocks: z-index issue, e.g. select field dropdown in blocks hidden behind blocks below, or slash menu inside nested editor hidden behind blocks below 2023-11-12 22:28:05 +01:00
Alessio Gravili
615702b858 fix(richtext-lexical): Floating Select Toolbar: Buttons and Dropdown Buttons not clickable in nested editors
Fixes #4025
2023-11-12 22:09:36 +01:00
Alessio Gravili
f0642ce031 chore(richtext-lexical): add a bunch of e2e tests, including a failing one 2023-11-12 21:44:18 +01:00
Alessio Gravili
56db87d2ec Merge pull request #4104 from payloadcms/chore/console-log-remove
chore: remove unnecessary console.log
2023-11-11 12:58:54 +01:00
Alessio Gravili
45c42724a4 chore: remove unnecessary console.log 2023-11-11 12:57:22 +01:00
Alessio Gravili
a6d5f2e3de fix(richtext-lexical): HTMLConverter: cannot find nested lexical fields (#4103)
Fixes #4034
2023-11-11 12:54:33 +01:00
Elliot Lintz
73b8549ef5 chore: fix readme badge link styles (#4101) 2023-11-10 17:37:50 -05:00
Jarrod Flesch
e22b95bdf3 fix: fully define the define property for esbuild string replacement (#4099) 2023-11-10 13:47:14 -05:00
Jessica Chowdhury
56ddd2c388 chore: update date field schema (#4098) 2023-11-10 12:25:03 -05:00
Jessica Chowdhury
803a37eaa9 fix: simplifies block/array/hasMany-number field validations (#4052)
Co-authored-by: Jarrod Flesch <jarrodmflesch@gmail.com>
2023-11-10 12:06:21 -05:00
Elliot DeNolf
d308bb3421 chore(release): richtext-lexical/0.1.17 [skip ci] 2023-11-10 10:42:33 -05:00
Elliot DeNolf
cbc4752ecb chore(release): plugin-sentry/0.0.6 [skip ci] 2023-11-10 10:42:26 -05:00
Elliot DeNolf
c51f9d01cb chore(release): live-preview-react/0.1.6 [skip ci] 2023-11-10 10:42:18 -05:00
Elliot DeNolf
d19d8fd232 chore(release): live-preview/0.1.6 [skip ci] 2023-11-10 10:42:11 -05:00
Elliot DeNolf
5dbbd8f88b chore(release): db-mongodb/1.0.8 [skip ci] 2023-11-10 10:42:00 -05:00
Elliot DeNolf
47bd3894c4 chore(release): payload/2.1.1 [skip ci] 2023-11-10 10:40:45 -05:00
Elliot DeNolf
a57c68cd04 chore(plugin-sentry): set version to latest instead of beta for release notes 2023-11-10 10:38:12 -05:00
Take Weiland
acad2888cd fix: fixes creation of related documents within a transaction if filterOptions is used (#4087) 2023-11-10 10:37:58 -05:00
Alessio Gravili
db2da71357 Merge pull request #4097 from payloadcms/docs/disableIndexHints
docs: document disableIndexHints property
2023-11-10 16:31:05 +01:00
Alessio Gravili
cbb4ce2f51 docs: document disableIndexHints property 2023-11-10 16:23:21 +01:00
Dan Ribbens
47efd3b92e fix(plugin-nested-docs): sync write transaction errors (#4084) 2023-11-10 10:16:31 -05:00
Dan Ribbens
348a70cc33 fix: possible issue with access control not using req (#4086) 2023-11-10 10:15:07 -05:00
Alessio Gravili
9f873f8630 chore(db-mongodb): add option to disable index hint optimization, which breaks on AWS DocumentDB (#3997)
* chore: add option to disable pagination count index hinting optimization

* chore: rename hintPaginationCountIndex to disablePaginationCountIndexHint

* chore: fix logic

* chore: disablePaginationCountIndexHint => disableIndexHints
2023-11-10 16:08:14 +01:00
Jessica Chowdhury
949e265cd9 fix: disable editing option for svg image types (#4071)
Co-authored-by: Jarrod Flesch <jarrodmflesch@gmail.com>
2023-11-10 00:35:04 -05:00
Jessica Chowdhury
687f4850ac fix: hide empty image sizes from the preview drawer (#3946)
Co-authored-by: Jarrod Flesch <jarrodmflesch@gmail.com>
2023-11-09 22:34:50 -05:00
Jacob Fletcher
1f851f21b1 fix(live-preview): properly handles apiRoute (#4076) 2023-11-09 13:14:41 -05:00
Jarrod Flesch
dbc4ce71e6 chore: fixes test suites that use clearAndSeedEverything (#4080) 2023-11-09 12:30:19 -05:00
Patrik
cef4cbb0ee fix: conditionally hide dot menu in DocumentControls (#4075) 2023-11-09 12:01:58 -05:00
Jacob Fletcher
7059a71243 fix(live-preview): ensures field schema exists before traversing fields (#4074) 2023-11-09 10:08:10 -05:00
Jacob Fletcher
01559ef34b chore: prevents field validation from triggering unnecessary re-renders (#4066) 2023-11-09 09:46:35 -05:00
Jacob Fletcher
8488f7b8db docs: adds apiRoute to useLivePreview args (#4073) 2023-11-09 09:01:04 -05:00
Michał Korczak
a92a160a13 docs: fix link to public demo example config (#4007) 2023-11-09 00:23:58 -05:00
PatrikKozak
77a7c83251 chore: updates default type value for graphql playground type 2023-11-08 18:30:55 -05:00
Jacob Fletcher
2ad7340154 fix(live-preview): field recursion and relationship population (#4045) 2023-11-08 17:28:35 -05:00
Alessio Gravili
c462df38f6 fix(richtext-lexical): floating select toolbar caret not positioned correctly if first line is selected (#4062) 2023-11-08 22:13:38 +01:00
Alessio Gravili
fff377ad22 fix(richtext-lexical): Blocks: unnecessary saving node value when initially opening a document & new lexical tests (#4059)
* chore: new lexical int tests and working test structure

* chore: more int tests, and better lexical collection structure

* fix(richtext-lexical): Blocks: unnecessary saving node value when initially opening a document
2023-11-08 21:32:43 +01:00
Elliot DeNolf
a2cb946155 chore(release): bundler-vite/0.1.4 [skip ci] 2023-11-08 14:54:50 -05:00
Elliot DeNolf
c39472259a chore(release): db-postgres/0.1.13 [skip ci] 2023-11-08 14:53:16 -05:00
Elliot DeNolf
e2d36c3cab chore(release): db-mongodb/1.0.7 [skip ci] 2023-11-08 14:53:05 -05:00
Elliot DeNolf
0e682a32c3 chore(release): payload/2.1.0 [skip ci] 2023-11-08 14:51:29 -05:00
Hulpoi George-Valentin
266c3274d0 feat: Custom Error, Label, and before/after field components (#3747)
Co-authored-by: Dan Ribbens <dan.ribbens@gmail.com>
2023-11-08 14:40:31 -05:00
Jarrod Flesch
67b3baaa44 fix: vite not replacing env vars correctly when building 2023-11-08 14:23:58 -05:00
Jarrod Flesch
55659c7c36 chore(docs): imporoves usability of useAuth and exports useTableColumns 2023-11-08 14:23:22 -05:00
Jørgen Kalsnes Hagen
6a0a859563 feat: add internationalization (i18n) to locales (#4005) 2023-11-08 12:56:15 -05:00
Dan Ribbens
57da3c99a7 fix: error on graphql multiple queries (#3985) 2023-11-08 12:38:25 -05:00
Elliot DeNolf
611438177b ci: split e2e tests into 8 parts 2023-11-08 12:35:05 -05:00
Jacob Fletcher
d068ef7e24 fix: injects array and block ids into fieldSchemaToJSON (#4043) 2023-11-08 12:34:51 -05:00
Jacob Fletcher
7a9af4417a fix: polymorphic hasMany relationships missing in postgres admin (#4053) 2023-11-08 12:31:07 -05:00
Patrik
8d14c213c8 fix: resets list filter row when the filter on field is changed (#3956)
Co-authored-by: Jarrod Flesch <jarrodmflesch@gmail.com>
2023-11-08 08:31:01 -05:00
Jarrod Flesch
182c57b191 fix: hasMany number and select fields unable to save within arrays (#4047) 2023-11-07 22:29:41 -05:00
Elliot DeNolf
15459fb8e3 ci: add workflow changes to needs_build filter 2023-11-07 21:11:32 -05:00
Elliot DeNolf
3ca71c4def ci: increase v8 memory allocation 2023-11-07 21:06:18 -05:00
Elliot DeNolf
64136a6b17 test(plugin-sentry): add test components (#4042) 2023-11-07 16:02:24 -05:00
Jarrod Flesch
acba5e482b fix: focal and cropping issues, adds test (#4039) 2023-11-07 15:20:57 -05:00
Elliot DeNolf
571f190f34 chore(plugin-sentry): use proper refs instead of from dist 2023-11-07 15:17:07 -05:00
Take Weiland
131d89c3f5 fix: handle invalid tokens in refresh token operation (#3647)
* fix: handle invalid tokens in refresh token operation

* fix: check for any falsy user values instead of just nullish in token refresh
2023-11-07 14:55:35 -05:00
Elliot DeNolf
55c38a8934 test: plugin-sentry suite (#4040) 2023-11-07 13:51:40 -05:00
Elliot DeNolf
2abb46f4f1 ci: add plugin-sentry build 2023-11-07 12:45:45 -05:00
Elliot DeNolf
f41780ef33 chore: sync pnpm-lock.yaml 2023-11-07 12:45:25 -05:00
Elliot DeNolf
105392cf07 Merge pull request #3671 from payloadcms/chore/plugin-sentry
chore: imports sentry plugin
2023-11-07 12:42:56 -05:00
Elliot DeNolf
fa2e68ad1c chore: force pnpm-lock.yaml 2023-11-07 12:42:28 -05:00
Elliot DeNolf
2053e4eeab chore(plugin-sentry): more cleanup 2023-11-07 12:41:43 -05:00
Elliot DeNolf
432794fa55 chore(plugin-sentry): format 2023-11-07 12:25:47 -05:00
Elliot DeNolf
6787f0dfd9 chore(plugin-sentry): fix eslint errors 2023-11-07 12:25:25 -05:00
Elliot DeNolf
0b0a40c9fb chore(plugin-sentry): cleanup after import 2023-11-07 12:18:14 -05:00
Elliot DeNolf
95c43a2ab4 chore: sync payload package readme 2023-11-07 12:05:51 -05:00
Jarrod Flesch
f4037a6bdc chore: readme boldness 2023-11-07 09:13:35 -05:00
Jacob Fletcher
c4d173ae0f chore: updates CODEOWNERS (#4031) 2023-11-07 09:05:35 -05:00
Patrik
3e5149bc43 Merge pull request #3987 from SimYunSup/fix/#3986
fix: Updates checkbox API views
2023-11-06 15:44:41 -05:00
Alessio Gravili
17f7b94555 chore: improve test suites, upgrade jest and playwright, add debug utilities for lexical (#4011)
* feat(richtext-lexical): 'bottom' position value for plugins

* feat: TestRecorderFeature

* chore: restructuring to seed and clear db before each test

* chore: make sure all tests pass

* chore: make sure indexes are created in seed.ts - this fixes one erroring test

* chore: speed up test runs through db snapshots

* chore: support drizzle when resetting db

* chore: simplify seeding process, by moving boilerplate db reset / snapshot logic into a wrapper function

* chore: add new seeding process to admin test suite

* chore(deps): upgrade jest and playwright

* chore: make sure mongoose-specific tests are not skipped

* chore: fix point test, which was depending on another test (that's bad!)

* chore: fix incorrect import

* chore: remove unnecessary comments

* chore: clearly label lexicalE2E test file as todo

* chore: simplify seed logic

* chore: move versions test suite to new seed system
2023-11-06 16:38:40 +01:00
Elliot DeNolf
04850694c1 chore(deps): bump uuid to 9 (#4014) 2023-11-06 08:58:41 -05:00
Elliot DeNolf
eb42c031ef fix: parse predefined migrations via file arg or name prefix (#4001) 2023-11-03 19:26:25 -04:00
Elliot DeNolf
dc253676e8 docs: add latest tag to all mentions of create-payload-app [no ci] (#3998) 2023-11-03 17:18:03 -04:00
Elliot DeNolf
926372f15a chore: add CODEOWNERS file 2023-11-03 17:05:14 -04:00
Elliot DeNolf
c2f379f139 chore(release): db-postgres/0.1.12 [skip ci] 2023-11-03 16:23:12 -04:00
Elliot DeNolf
1a523eff98 chore(release): db-mongodb/1.0.6 [skip ci] 2023-11-03 16:22:59 -04:00
Elliot DeNolf
f320a87f92 chore(release): payload/2.0.15 [skip ci] 2023-11-03 16:21:13 -04:00
Elliot DeNolf
d1a0822f80 fix: properly load temp files into buffer (#3996) 2023-11-03 16:02:41 -04:00
James Mikrut
da533d6b64 Merge pull request #3981 from payloadcms/fix/autosave
fix: autosave updating data in unrelated docs
2023-11-03 13:59:39 -04:00
Jessica Chowdhury
fb3b95e52d docs: update default autosave interval 2023-11-03 17:08:11 +00:00
Jessica Chowdhury
a9d96b1037 fix: global autosave and relevant e2e test 2023-11-03 16:38:43 +00:00
Jessica Chowdhury
ea7ce6fd97 test: adds autosave test 2023-11-03 15:59:06 +00:00
Jessica Chowdhury
354b73c3aa Merge branch 'main' into fix/autosave 2023-11-03 15:57:23 +00:00
Patrik
96fc3df532 chore: ellipse long error messages, add title attribute (#3812)
Co-authored-by: Jarrod Flesch <30633324+JarrodMFlesch@users.noreply.github.com>
2023-11-03 10:40:58 -04:00
Jarrod Flesch
c7a315a7d1 fix: passes correct data to buildStateFromSchema on account page (#3984)
* chore: fixes e2e tests
2023-11-03 10:30:36 -04:00
Yunsup Sim
b008b6c646 fix: Update API Views 2023-11-03 18:38:06 +09:00
Jessica Chowdhury
b722f202af fix: autosave updating data in unrelated docs 2023-11-02 17:54:25 +00:00
Jessica Chowdhury
720760225f docs: adds section on querying and filtering polymorphic relationship fields (#3976) 2023-11-02 13:27:21 -04:00
Jacob Fletcher
f7d4c04f65 chore: adds e2e tests for nested views (#3962) 2023-11-02 13:13:29 -04:00
Patrik
6b1b4ffd27 fix: better error handling within parseCookies (#3720) 2023-11-02 09:01:01 -04:00
Jessica Chowdhury
6325b334ec chore(docs): adds section on swap space and nextjs incompatibilities with the local api (#3975) 2023-11-02 08:40:24 -04:00
Alessio Gravili
79b1b88a2f chore: Better Lexical documentation, minor improvements to HTML converter feature (#3933)
* docs: add html serialization docs

* chore: add .md to the .editorconfig

* chore: add new consolidateHTMLConverters function

* docs: add more documentation about serializing HTML

* docs: document creation of headless editors, editor => markdown conversion, markdown => editor conversion and editor => lexical conversion

* docs: improve wording

* docs: add missing comma

* docs: add rest of the missing docs

* docs: various improvements
2023-11-02 07:44:18 +01:00
Jacob Fletcher
b2beec302f chore: unable to boot config and endpoints test suites (#3969) 2023-11-01 18:02:25 -04:00
Jacob Fletcher
fbc2064a10 chore: deflakes e2e tests (#3970) 2023-11-01 17:26:07 -04:00
Daniel Kirchhof
900a9eafeb fix: prevent sort from saving a new version in version list view (#3944) 2023-11-01 15:11:10 -04:00
Jacob Fletcher
06cd52b622 fix: sort document tabs by order (#3968) 2023-11-01 14:59:47 -04:00
Jarrod Flesch
c7ec557466 chore(docs): server code aliasing cleanup (#3967) 2023-11-01 13:30:34 -04:00
Jacob Fletcher
4c587acc10 docs: fixes custom component property names (#3966) 2023-11-01 13:20:03 -04:00
Jarrod Flesch
6f39b809b3 chore(docs): vite aliasing and extending (#3965) 2023-11-01 12:57:41 -04:00
Jarrod Flesch
796669279a fix: exclude files from dev bundle if aliased (#3957) 2023-11-01 11:41:35 -04:00
Alessio Gravili
886fca8e37 Merge pull request #3964 from payloadcms/docs/preview-docs-2
docs: add "previewing docs" section to the contributing.md
2023-11-01 16:10:21 +01:00
Alessio Gravili
30db52ac45 docs: add "previewing docs" section to the contributing.md 2023-11-01 16:09:21 +01:00
Jacob Fletcher
f04a18a258 chore: fixes flaky e2e tests (#3961) 2023-11-01 10:22:54 -04:00
Jarrod Flesch
cdc10be1a2 fix: do not display field if read permission is false - admin panel ui (#3949) 2023-11-01 10:21:19 -04:00
Jacob Fletcher
a5b2333140 fix: deeply merges view configs (#3954) 2023-11-01 08:58:42 -04:00
Jessica Chowdhury
afe1834f9a chore: updates hover styles for list control and file detail buttons (#3757) 2023-11-01 08:36:07 -04:00
Jarrod Flesch
3d7a2de00d chore: allow overrides to be passed into ReactDatePicker from DateTimeInput (#3937) 2023-11-01 08:33:26 -04:00
Jarrod Flesch
5ea88bb47d fix: block row removal w/ db-postgres adapter (#3951) 2023-11-01 08:32:02 -04:00
Jarrod Flesch
386fe0741d chore: append globalType inside global version operations (#3903) 2023-10-31 16:43:26 -04:00
Patrik
b6d9a2021f fix: vertical alignment in step nav when using larger logos (#3955) 2023-10-31 15:18:39 -04:00
Jacob Fletcher
1f8f173741 fix: findVersions pagination (#3906) 2023-10-31 09:33:13 -04:00
Jarrod Flesch
36576f152a fix: field paths being mutated if they ended with the req.locale (#3936) 2023-10-31 08:53:00 -04:00
James Mikrut
4ea8ace4c8 Merge pull request #3940 from payloadcms/fix/dataloader-parallel-requests
fix: ensures dataloader does not run requests in parallel
2023-10-30 22:19:00 -04:00
James
3a83f08518 chore: corrects dataloader comment 2023-10-30 17:15:24 -04:00
James
4607dbf976 fix: ensures dataloader does not run requests in parallel 2023-10-30 17:13:40 -04:00
Jessica Chowdhury
94d8d2790b chore: adds missing "menu" translation (#3816) 2023-10-30 16:01:32 -04:00
Mikko Vänskä
e6b9fb4fab docs: adds link to tabs field in fields overview (#3909) 2023-10-30 15:09:26 -04:00
Jacob Fletcher
6918be20ba fix(templates): serializes internal links (#3935) 2023-10-30 15:02:01 -04:00
Piotr Rogowski
e4881bb02f fix(i18n): polish translations (#3934) 2023-10-30 14:59:50 -04:00
Elliot DeNolf
ed748102d6 chore: clean up changelog 2023-10-30 12:40:19 -04:00
Elliot DeNolf
88627f22e5 chore(release): bundler-webpack/1.0.5 [skip ci] 2023-10-30 12:30:29 -04:00
Elliot DeNolf
a2a44a81f2 chore(release): richtext-slate/1.1.0 [skip ci] 2023-10-30 12:29:43 -04:00
Elliot DeNolf
b2b0f10935 chore(release): richtext-lexical/0.1.16 [skip ci] 2023-10-30 12:29:08 -04:00
Elliot DeNolf
2ebb9b8752 chore(release): db-postgres/0.1.11 [skip ci] 2023-10-30 12:28:57 -04:00
Elliot DeNolf
d383a00b65 chore(release): db-mongodb/1.0.5 [skip ci] 2023-10-30 12:28:47 -04:00
Elliot DeNolf
d6ff8e3e69 chore(release): payload/2.0.14 [skip ci] 2023-10-30 12:26:26 -04:00
Jacob Fletcher
20373903fd chore: adds e2e tests for versions tab and route (#3908) 2023-10-30 11:39:24 -04:00
Patrik
6d94e57225 docs: adds Props import to cell-component example (#3931) 2023-10-30 11:17:22 -04:00
Jarrod Flesch
a14b15200a chore: add save prop to docs custom save button example 2023-10-30 08:52:59 -04:00
Nathan Clevenger
0da3b59daf docs: fix broken link to Microsoft's Monaco Docs (#3921) 2023-10-30 01:24:44 +01:00
Jarrod Flesch
46fc41cbd9 fix: incorrect duplication of data in admin ui (#3907) 2023-10-27 22:41:33 -04:00
Patrik
237eebdf87 fix: enables nested AND/OR queries (#3834) 2023-10-27 15:18:25 -04:00
Hristiyan Dodov
422c803da6 fix: disable webpack hot reload on production (#3891) 2023-10-27 15:12:12 -04:00
Jarrod Flesch
7e919aa87c fix: adds null to non-required field unions (#3870) 2023-10-27 15:02:40 -04:00
Jarrod Flesch
d393225289 fix: set date to 12UTC for default, dayOnly and monthOnly fields (#3887) 2023-10-27 14:43:36 -04:00
Jessica Chowdhury
a4f36aa8a0 fix: only apply focal manipulation when necessary (#3902)
Co-authored-by: Jarrod Flesch <jarrodmflesch@gmail.com>
2023-10-27 14:40:26 -04:00
Dan Ribbens
3404bab83f fix: generate new block ids on create (#3871) 2023-10-27 13:32:20 -04:00
Dan Ribbens
89f273bf89 fix: duplicate document copying to incorrect locale (#3874) 2023-10-27 13:31:52 -04:00
Dan Ribbens
4d8d4c214a fix: unique field error handling (#3888) 2023-10-27 13:31:14 -04:00
Dan Ribbens
dc13b101f7 fix(payload): graphql query errors transaction race condition (#3795) 2023-10-27 13:29:51 -04:00
Patrik
42d8d11fd7 fix: ensures compare-version select field cannot be cleared (#3901) 2023-10-27 12:15:36 -04:00
Alessio Gravili
56e58e9ec7 fix(db-mongodb): improve find query performance (#3836)
Fixes #3904

* fix(db-mongodb): improve find query performance

* fix: add optimization to other operations which use pagination: findGlobalVersions, findVersions, queryDrafts

* fix: index createdAt field by default
2023-10-27 17:57:18 +02:00
Jessica Chowdhury
c564a83ab6 fix: ensure serverURL has string value for getBaseUploadFields function (#3900) 2023-10-27 11:42:14 -04:00
Alessio Gravili
a4fa0ef393 chore(richtext-*): bump payload peer dependency versions 2023-10-27 15:56:15 +02:00
Alessio Gravili
dac9514eb0 fix(richtext-*): type issues with typescript strict mode enabled 2023-10-27 15:44:10 +02:00
Alessio Gravili
760565f1e9 fix(richtext-lexical): remove unnecessary dependencies (fixes #3889) 2023-10-27 14:25:31 +02:00
Elliot DeNolf
436825cc0b ci: add plugin-form-builder build 2023-10-26 23:26:10 -04:00
Elliot DeNolf
7256a6b8b9 chore: sync pnpm-lock.yaml 2023-10-26 23:23:52 -04:00
Elliot DeNolf
8066806d13 Merge pull request #3669 from payloadcms/chore/plugin-form-builder
chore: imports form builder plugin
2023-10-26 23:23:26 -04:00
Elliot DeNolf
7a15545773 chore: force pnpm-lock.yaml 2023-10-26 23:22:28 -04:00
Elliot DeNolf
9d4969685f chore(plugin-form-builder): clean up more unneeded files 2023-10-26 23:19:51 -04:00
Elliot DeNolf
3ebcc5120c chore(plugin-form-builder): remove mocks dir from packed 2023-10-26 23:13:52 -04:00
Elliot DeNolf
ed68583392 chore(plugin-form-builder): format 2023-10-26 23:07:33 -04:00
Elliot DeNolf
87c58bc0ba chore(plugin-form-builder): eslint fix 2023-10-26 23:07:08 -04:00
Elliot DeNolf
22bd80b8c2 chore(plugin-form-builder): cleanup after import 2023-10-26 23:05:30 -04:00
dependabot[bot]
09d303c8b3 chore(deps): bump http-cache-semantics in /packages/plugin-search/demo (#3825)
Bumps [http-cache-semantics](https://github.com/kornelski/http-cache-semantics) from 4.1.0 to 4.1.1.
- [Commits](https://github.com/kornelski/http-cache-semantics/compare/v4.1.0...v4.1.1)

---
updated-dependencies:
- dependency-name: http-cache-semantics
  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-26 13:36:12 -04:00
dependabot[bot]
aa22392c4f chore(deps): bump json5 in /packages/plugin-search/demo (#3826)
Bumps [json5](https://github.com/json5/json5) from 2.2.1 to 2.2.3.
- [Release notes](https://github.com/json5/json5/releases)
- [Changelog](https://github.com/json5/json5/blob/main/CHANGELOG.md)
- [Commits](https://github.com/json5/json5/compare/v2.2.1...v2.2.3)

---
updated-dependencies:
- dependency-name: json5
  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-26 13:35:48 -04:00
dependabot[bot]
da3f99d57f chore(deps): bump loader-utils in /packages/plugin-search/demo (#3827)
Bumps [loader-utils](https://github.com/webpack/loader-utils) from 2.0.2 to 2.0.4.
- [Release notes](https://github.com/webpack/loader-utils/releases)
- [Changelog](https://github.com/webpack/loader-utils/blob/v2.0.4/CHANGELOG.md)
- [Commits](https://github.com/webpack/loader-utils/compare/v2.0.2...v2.0.4)

---
updated-dependencies:
- dependency-name: loader-utils
  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-26 13:35:43 -04:00
dependabot[bot]
24c89e2ad7 chore(deps): bump graphql in /packages/plugin-search/demo (#3828)
Bumps [graphql](https://github.com/graphql/graphql-js) from 16.6.0 to 16.8.1.
- [Release notes](https://github.com/graphql/graphql-js/releases)
- [Commits](https://github.com/graphql/graphql-js/compare/v16.6.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-26 13:35:19 -04:00
dependabot[bot]
8e05d8f064 chore(deps): bump postcss in /packages/plugin-search/demo (#3829)
Bumps [postcss](https://github.com/postcss/postcss) from 8.4.12 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.12...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-26 13:35:04 -04:00
dependabot[bot]
9ba7265529 chore(deps): bump semver in /packages/plugin-search/demo (#3830)
Bumps [semver](https://github.com/npm/node-semver) from 5.7.1 to 5.7.2.
- [Release notes](https://github.com/npm/node-semver/releases)
- [Changelog](https://github.com/npm/node-semver/blob/v5.7.2/CHANGELOG.md)
- [Commits](https://github.com/npm/node-semver/compare/v5.7.1...v5.7.2)

---
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-26 13:34:34 -04:00
Jacob Fletcher
4f2b080d1c fix(db-mongodb): versions pagination (#3875) 2023-10-26 12:18:54 -04:00
Patrik
115e592b54 fix: handles null & undefined relationship field values in versions view (#3609) 2023-10-26 11:59:00 -04:00
Elliot DeNolf
c8fbfc43bd chore(templates): pin next@13.5.2 2023-10-26 09:54:23 -04:00
Elliot DeNolf
6cfa8a373e test: plugin cloud storage suite (#3884)
* chore: proper admin mock for adapters

* test: add plugin-cloud-storage dev
2023-10-26 09:35:49 -04:00
Elliot DeNolf
6c5d525d8e fix: store resized image on req or tempFilePath (#3883) 2023-10-26 09:35:27 -04:00
Elliot DeNolf
f53b713154 fix: resize image if no aspect ratio change (#3859)
* fix: resize image if no aspect ratio change

* test: adjust unawaited assertion
2023-10-26 09:04:13 -04:00
Dan Ribbens
435eb6204e fix: error handling when duplicating documents fails (#3873) 2023-10-25 16:39:11 -04:00
Elliot DeNolf
c4561a4390 chore: proper clean scripts 2023-10-25 15:05:14 -04:00
Elliot DeNolf
8fe712cb66 chore(release): plugin-stripe/0.0.16 [skip ci] 2023-10-25 13:28:10 -04:00
Elliot DeNolf
459a55dfb6 chore(plugin-stripe): use payload 1.x as dev dep 2023-10-25 13:27:30 -04:00
Elliot DeNolf
8de0b89458 chore(release): plugin-cloud/2.2.6 [skip ci] 2023-10-25 13:18:08 -04:00
Elliot DeNolf
718ab6f93b chore(plugin-cloud): rework build 2023-10-25 13:17:01 -04:00
Elliot DeNolf
5bf1cd6d93 Merge pull request #3869 from payloadcms/chore/peer-deps
chore(deps): peer deps in plugin-cloud and plugin-stripe
2023-10-25 12:21:17 -04:00
Elliot DeNolf
556904e75c chore: sync pnpm-lock.yaml 2023-10-25 12:20:37 -04:00
Elliot DeNolf
0851ef41d7 chore(plugin-stripe): update peer deps 2023-10-25 12:19:22 -04:00
Elliot DeNolf
6616942b78 chore(plugin-cloud): move nodemailer to deps 2023-10-25 11:44:24 -04:00
Dan Ribbens
59fabc757d chore(templates): update ecommerce yarn lock (#3867) 2023-10-25 11:19:31 -04:00
Dan Ribbens
650f78a2b9 chore(templates): fix types and seeding errors (#3845) 2023-10-25 09:45:09 -04:00
Hulpoi George-Valentin
d6826f792c docs: wrong import for collections#beforeValidate (#3863) 2023-10-25 11:38:26 +02:00
Jacob Fletcher
3032e0b5a2 fix: global permissions for live preview (#3854) 2023-10-24 23:32:55 -04:00
Elliot DeNolf
c30b59c5fe chore(plugin-cloud-storage): remove all dist references 2023-10-24 17:05:58 -04:00
Elliot DeNolf
3182d422c4 chore: export more upload types 2023-10-24 17:05:26 -04:00
Elliot DeNolf
ce1e7a5d14 ci: add plugin-cloud-storage build 2023-10-24 16:42:13 -04:00
dependabot[bot]
03101f0f54 chore(deps): bump next in /examples/draft-preview/next-app (#3853)
Bumps [next](https://github.com/vercel/next.js) from 13.4.8 to 13.5.0.
- [Release notes](https://github.com/vercel/next.js/releases)
- [Changelog](https://github.com/vercel/next.js/blob/canary/release.js)
- [Commits](https://github.com/vercel/next.js/compare/v13.4.8...v13.5.0)

---
updated-dependencies:
- dependency-name: next
  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-24 16:41:50 -04:00
dependabot[bot]
80bf97ebb4 chore(deps): bump next from 13.4.19 to 13.5.0 in /templates/ecommerce (#3851)
Bumps [next](https://github.com/vercel/next.js) from 13.4.19 to 13.5.0.
- [Release notes](https://github.com/vercel/next.js/releases)
- [Changelog](https://github.com/vercel/next.js/blob/canary/release.js)
- [Commits](https://github.com/vercel/next.js/compare/v13.4.19...v13.5.0)

---
updated-dependencies:
- dependency-name: next
  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-24 16:41:39 -04:00
dependabot[bot]
ed5da473b5 chore(deps): bump next in /examples/redirects/next-pages (#3850)
Bumps [next](https://github.com/vercel/next.js) from 13.2.1 to 13.5.0.
- [Release notes](https://github.com/vercel/next.js/releases)
- [Changelog](https://github.com/vercel/next.js/blob/canary/release.js)
- [Commits](https://github.com/vercel/next.js/compare/v13.2.1...v13.5.0)

---
updated-dependencies:
- dependency-name: next
  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-24 16:41:24 -04:00
dependabot[bot]
01feb6d92d chore(deps): bump next in /examples/draft-preview/next-pages (#3849)
Bumps [next](https://github.com/vercel/next.js) from 13.4.8 to 13.5.0.
- [Release notes](https://github.com/vercel/next.js/releases)
- [Changelog](https://github.com/vercel/next.js/blob/canary/release.js)
- [Commits](https://github.com/vercel/next.js/compare/v13.4.8...v13.5.0)

---
updated-dependencies:
- dependency-name: next
  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-24 16:41:18 -04:00
dependabot[bot]
daf1f5fa7d chore(deps): bump next in /examples/form-builder/next-pages (#3848)
Bumps [next](https://github.com/vercel/next.js) from 12.3.1 to 13.5.0.
- [Release notes](https://github.com/vercel/next.js/releases)
- [Changelog](https://github.com/vercel/next.js/blob/canary/release.js)
- [Commits](https://github.com/vercel/next.js/compare/v12.3.1...v13.5.0)

---
updated-dependencies:
- dependency-name: next
  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-24 16:41:11 -04:00
Alessio Gravili
35f00fa83d fix(richtext-lexical): Blocks node incorrectly marked as client module 2023-10-24 22:40:05 +02:00
Elliot DeNolf
5fb52f6d17 Merge pull request #3847 from payloadcms/import/plugin-cloud-storage
chore: import plugin-cloud-storage
2023-10-24 16:37:26 -04:00
Elliot DeNolf
41925cef9c chore(plugin-cloud-storage): format 2023-10-24 16:21:12 -04:00
Elliot DeNolf
bff88b3956 chore(plugin-cloud-storage): eslint fix 2023-10-24 16:20:58 -04:00
Elliot DeNolf
11d237ece8 chore(plugin-cloud-storage): cleanup after import 2023-10-24 16:20:01 -04:00
Elliot DeNolf
7f80aa95a4 Merge remote-tracking branch 'plugin-cloud-storage/monorepo-import' into import/plugin-cloud-storage 2023-10-24 16:03:02 -04:00
Elliot DeNolf
fc0c612e47 chore: move all files into packages/plugin-cloud-storage 2023-10-24 15:58:57 -04:00
Jarrod Flesch
24eab3af1d fix: checks for user before accessing properties in preferences update operation(#3844) 2023-10-24 14:46:56 -04:00
Elliot DeNolf
c8f57dd9b9 chore: clean up changelog 2023-10-24 14:21:18 -04:00
Elliot DeNolf
b901401ab3 chore(release): payload/2.0.13 [skip ci] 2023-10-24 14:17:04 -04:00
Elliot DeNolf
00a1ce754a ci: conventional commits changelog (#3843)
* feat(live-preview): another oen

* wip: changelog script

* wippppp

* chore: this worked

* wip: changelog working

* chore(script): working changelog gen

* chore(script): update changelog during release
2023-10-24 14:10:14 -04:00
Dan Ribbens
7eee0ec355 fix: prevent storing duplicate user preferences (#3833)
* fix(payload): prevent storing duplicate user preferences

* test: add int tests for payload-preferences

* chore: add comments and cleanup preferences useEffects
2023-10-24 14:07:43 -04:00
Jacob Fletcher
78312d9d8d fix(templates): gql footer queries 2023-10-24 10:37:29 -04:00
Jacob Fletcher
fa8d591b4b chore: ignores uploads dir in test suite 2023-10-24 09:54:54 -04:00
Paul
a0019d0a78 fix: named tabs not appearing in the gql mutation input type (#3835) 2023-10-24 07:40:51 -04:00
Jarrod Flesch
5a0d0dbc02 fix: reverting localized versions (#3831) 2023-10-23 21:57:24 -04:00
Elliot DeNolf
fa550740eb Merge pull request #3832 from payloadcms/chore/plugin-search
chore: import plugin-search
2023-10-23 17:08:51 -04:00
Elliot DeNolf
e987e2b0ed chore: force pnpm-lock.yaml 2023-10-23 17:08:00 -04:00
Elliot DeNolf
69ca713e45 Revert "chore: imports search plugin (#3675)"
This reverts commit 4f77073e2c.
2023-10-23 17:05:53 -04:00
Jacob Fletcher
71a3e5ba10 fix: prevents document sidebar from collapsing 2023-10-23 17:01:58 -04:00
Elliot DeNolf
9c250d57a4 ci: add plugin-search build 2023-10-23 17:00:17 -04:00
Elliot DeNolf
06b5b3dc6f chore: sync pnpm-lock.yaml 2023-10-23 16:50:48 -04:00
Jacob Fletcher
4f77073e2c chore: imports search plugin (#3675)
* feat: builds plugin

* feat: abstracts syncWithSearch

* feat: attaches payload to beforeSync hook

* feat: enables defaultPriorities

* fix: syncWithSearch args and return type

* 0.0.2

* feat: uses config provider to format linkToDoc

* feat: supports versions api

* 0.0.4

* chore: bumps payload to v0.15.6

* 0.0.5

* chore: updates react peerDep

* 0.0.6

* chore: updates payload and package scope

* 1.0.0

* chore: correct import directive in readme code sample

* chore: exports types (#5)

* chore: eslint and prettier

* chore: migrates demo to payload v1.8.2

* fix: adjusts payload peer dep range (#8)

* 1.0.1

* chore(plugin-search): cleanup after import

* chore(plugin-search): lint

* chore(plugin-search): format

* chore: force pnpm-lock.yaml

---------

Co-authored-by: Colin Ramsay <colinramsay@users.noreply.github.com>
Co-authored-by: Elliot DeNolf <denolfe@gmail.com>
2023-10-23 16:50:09 -04:00
Elliot DeNolf
41e3212949 chore(plugin-search): format 2023-10-23 16:45:45 -04:00
Elliot DeNolf
e9eac9acce chore(plugin-search): lint 2023-10-23 16:45:14 -04:00
Elliot DeNolf
7e20298648 chore(plugin-search): cleanup after import 2023-10-23 16:44:14 -04:00
Daniel Kirchhof
e8f237783b fix: only parses live preview ready message when same origin (#3791) 2023-10-23 15:51:32 -04:00
Elliot DeNolf
d4e6791494 chore: plugin-cloud suite (#3821)
* test: plugin-cloud suite

* chore: clean up dist imports

* chore(plugin-cloud): linting
2023-10-23 14:50:21 -04:00
dependabot[bot]
fa4ceb5322 chore(deps): bump postcss in /packages/plugin-stripe/demo (#3813)
Bumps [postcss](https://github.com/postcss/postcss) from 8.4.20 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.20...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-23 14:31:53 -04:00
dependabot[bot]
9149913319 chore(deps): bump semver in /packages/plugin-stripe/demo (#3814)
Bumps [semver](https://github.com/npm/node-semver) from 5.7.1 to 5.7.2.
- [Release notes](https://github.com/npm/node-semver/releases)
- [Changelog](https://github.com/npm/node-semver/blob/v5.7.2/CHANGELOG.md)
- [Commits](https://github.com/npm/node-semver/compare/v5.7.1...v5.7.2)

---
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-23 14:31:43 -04:00
dependabot[bot]
284f66e6d8 chore(deps): bump graphql in /packages/plugin-stripe/demo (#3815)
Bumps [graphql](https://github.com/graphql/graphql-js) from 16.6.0 to 16.8.1.
- [Release notes](https://github.com/graphql/graphql-js/releases)
- [Commits](https://github.com/graphql/graphql-js/compare/v16.6.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-23 14:31:34 -04:00
Jacob Fletcher
a13ec2ebc4 fix: renders live preview for globals (#3801) 2023-10-23 14:30:51 -04:00
Jacob Fletcher
eaef0e7395 fix: alignment of collapsible within row (#3822) 2023-10-23 14:30:37 -04:00
Elliot DeNolf
4268b7833e chore: export FileData type 2023-10-23 14:02:33 -04:00
Jarrod Flesch
c476d01f4e fix: adjusts props to accept components for before and after fields instead of functions (#3820) 2023-10-23 14:01:51 -04:00
Elliot DeNolf
1a5db608c0 chore: update changelog 2023-10-23 13:34:26 -04:00
Elliot DeNolf
94de5c6c24 chore(release): richtext-slate/1.0.7 [skip ci] 2023-10-23 13:21:00 -04:00
Elliot DeNolf
5d4ef620b1 chore(release): richtext-lexical/0.1.15 [skip ci] 2023-10-23 13:20:48 -04:00
Elliot DeNolf
cac33ac275 chore(release): payload/2.0.12 [skip ci] 2023-10-23 13:18:50 -04:00
Elliot DeNolf
219aa3b2f3 fix: remove duplicate removal of temp upload file (#3818) 2023-10-23 13:01:18 -04:00
Elliot DeNolf
dd0ff50621 chore: sync pnpm-lock.yaml 2023-10-23 00:27:51 -04:00
Elliot DeNolf
591c0a0786 Merge pull request #3677 from payloadcms/chore/plugin-stripe
chore: imports stripe plugin
2023-10-23 00:25:50 -04:00
Elliot DeNolf
a197161390 chore: sync pnpm-lock.yaml 2023-10-23 00:24:15 -04:00
Elliot DeNolf
ae5b397bc8 test(plugin-stripe): stub tests 2023-10-23 00:11:19 -04:00
Elliot DeNolf
e6b2d3d1fc chore(plugin-stripe): format 2023-10-22 17:40:01 -04:00
Elliot DeNolf
6b19525a65 chore(plugin-stripe): eslint fix 2023-10-22 17:39:30 -04:00
Elliot DeNolf
c86ae0a9d2 chore(plugin-stripe): cleanup after import 2023-10-22 17:38:56 -04:00
Alessio Gravili
9277b306de fix(richtext-lexical): infinite re-rendering after draft save (#3709) 2023-10-22 01:41:58 +02:00
Alessio Gravili
156eae2551 fix(richtext-lexical): do not update Block node if form data is the same 2023-10-22 00:21:09 +02:00
Alessio Gravili
e197e0316f fix(richtext-*): hasMany relationships not populated correctly 2023-10-21 23:58:47 +02:00
Alessio Gravili
863b79348b feat(richtext-lexical): linebreak html converter 2023-10-21 23:30:47 +02:00
Alessio Gravili
30ff65d0b4 Merge pull request #3805 from payloadcms/fix/lexical-use-client
fix(richtext-lexical): missing use client markers required for next.js compatibility
2023-10-21 23:25:09 +02:00
Alessio Gravili
3185771551 fix(richtext-lexical): missing use client markers required for next.js compatibility 2023-10-21 23:21:12 +02:00
Jarrod Flesch
ea83c3f3a2 fix: simplify how the search input and query params are connected (#3797) 2023-10-21 10:04:54 -04:00
Alessio Gravili
072f7febd2 chore(richtext-lexical): do not capitalize H2 and H3 headings 2023-10-21 14:56:40 +02:00
Alessio Gravili
b5c7bbed93 fix(richtext-lexical): defaultValue property didn't fit into field schema 2023-10-21 14:52:26 +02:00
Alessio Gravili
931f6ff519 fix(richtext-lexical): Field Description shows up twice (#3793) 2023-10-21 14:51:11 +02:00
Alessio Gravili
0af36af16c feat(richtext-lexical): HTML Serializer (#3685)
* chore(richtext-lexical): add jsdocs for afterReadPromise in GraphQL

* feat(richtext-lexical): HTML Serializer

* chore(richtext-lexical): adjust comment

* chore(richtext-lexical): change the way the html serializer works

* chore: working html converter field, improve various exports

* feat: link and heading html serializers

* fix: populationPromises not being added properly

* feat: allow html serializers to be async

* feat: upload html serializer

* feat: text format => html

* feat: lists => html

* feat: Quote => html

* chore: improve Checklist => html conversion, by passing in the full parent to converters
2023-10-21 14:37:59 +02:00
Alessio Gravili
f6adbae0c7 feat: collection, global and field props for hooks, fix request context initialization, add context to global hooks (#3780)
* feat: pass collection, global and field props to collection, global and field hooks - where applicable

* fix: initial request context not set for all operations

* chore: add tests which check the collection prop for collection hooks

* feat: add context to props of global hooks

* chore: add global tests for global and field props

* chore: int tests: use JSON instead of object hashes
2023-10-21 11:40:57 +02:00
Jacob Fletcher
67d61df563 fix: standardizes layout of document fields (#3798) 2023-10-20 22:22:41 -04:00
Jacob Fletcher
01380bebe5 fix(templates/website): missing env vars (#3799) 2023-10-20 18:09:43 -04:00
Elliot DeNolf
5719b1b39a test: remove declare module from tests 2023-10-20 16:46:14 -04:00
Jarrod Flesch
f259645488 fix: issue where dragging unsortable item would crash the page (#3789) 2023-10-20 16:14:08 -04:00
Elliot DeNolf
eec60d5883 chore: rename .eslintrc.cjs -> .js 2023-10-20 15:50:25 -04:00
Elliot DeNolf
d4548d73d5 ci: checkout code for filters to work with non-PRs 2023-10-20 15:14:20 -04:00
Elliot DeNolf
ccc7c51c90 ci: detect code changes by dir, add builds for templates (#3724)
* ci: add simple website template build

* ci: copy .env.example

* ci: add mongo

* ci: add other templates via matrix

* ci: move templates to separate workflow

* ci: implement paths-filter

* chore: trigger template filter

* chore: refine filters

* chore: adjust needs_build

* chore: undo trigger
2023-10-20 14:57:47 -04:00
Kalon Robson
ec5e35ff71 chore(templates): fix e-commerce template jsx component type error (#3717) 2023-10-20 13:37:21 -04:00
Kalon Robson
55b9bf40df chore(templates): fix website template unused ts-expect-error (#3652) 2023-10-20 13:37:02 -04:00
Elliot DeNolf
5282673746 chore(templates): revert unintentional change 2023-10-20 11:58:35 -04:00
Elliot DeNolf
298ca0b7ae chore(templates): copy yarn.lock in Dockerfile (#3787) 2023-10-20 10:52:00 -04:00
Elliot DeNolf
71407e19e2 chore(deps): bump sharp for CVE-2023-4863 (#3786) 2023-10-20 10:40:59 -04:00
Jarrod Flesch
09078bdb40 fix(examples): ensure next middleware is built, removes unnecessary alias (#3771) 2023-10-20 07:47:07 -04:00
Elliot DeNolf
e84f5ded28 chore: update changelog 2023-10-19 17:34:33 -04:00
Elliot DeNolf
a475b9b28b chore(release): live-preview-react/0.1.5 [skip ci] 2023-10-19 16:42:58 -04:00
Elliot DeNolf
baad7d3360 chore(release): live-preview/0.1.5 [skip ci] 2023-10-19 16:42:33 -04:00
Jacob Fletcher
7fcb972dfa fix(live-preview): blocks field (#3753) 2023-10-19 16:40:16 -04:00
Elliot DeNolf
01245b07f8 chore(release): richtext-lexical/0.1.14 [skip ci] 2023-10-19 16:14:06 -04:00
Elliot DeNolf
d2f45343da chore(release): db-postgres/0.1.10 [skip ci] 2023-10-19 16:13:55 -04:00
Elliot DeNolf
5ba95df674 chore(release): db-mongodb/1.0.4 [skip ci] 2023-10-19 16:13:46 -04:00
Elliot DeNolf
40f98e4a0d chore(release): bundler-webpack/1.0.4 [skip ci] 2023-10-19 16:13:39 -04:00
Elliot DeNolf
584ead9fe2 chore(release): bundler-vite/0.1.3 [skip ci] 2023-10-19 16:13:29 -04:00
Elliot DeNolf
b6bf354f6a chore(release): payload/2.0.11 [skip ci] 2023-10-19 16:10:46 -04:00
Elliot DeNolf
9918c2499a chore(deps): bump sass (#3768)
* chore(deps): bump sass and sass-loader

* chore: handle sass slash div deprecation
2023-10-19 15:52:39 -04:00
Jarrod Flesch
8c48c8beb5 fix(webpack-bundler): corrects payload alias (#3769) 2023-10-19 15:21:39 -04:00
Jacob Fletcher
2697753715 chore(live-preview): significantly improves test coverage (#3763) 2023-10-19 14:56:16 -04:00
Jarrod Flesch
4b13686f61 fix: corrects versions collection casing (#3739) 2023-10-19 13:08:24 -04:00
Jessica Chowdhury
ab7999d3c1 fix: updates req after file resize (#3754) 2023-10-19 12:56:24 -04:00
Jessica Chowdhury
a592188c1d fix: correctly renders focal point when crop is set to false (#3759) 2023-10-19 12:51:13 -04:00
Elliot DeNolf
5ff0846b6c feat: add ability to opt out of type gen declare statement (#3765)
* feat: add ability to opt out of type gen declare statement

* chore: docs wording
2023-10-19 12:44:28 -04:00
xHomu
13cabf129e fix: account for many slug types in generate types (#3698)
* Fix generate:types bug #3697

generateEntityDeclarations function creates mismatched type names. We'll simply use the existing Config type instead.

* code cleanup
2023-10-19 11:36:26 -04:00
Elliot DeNolf
c173e55b89 fix(bundler-webpack): better node_modules resolution (#3744)
* fix(bundler-webpack): better node_modules resolution

* chore: see if retries are affecting new webpack changes

* chore: reinstate retries

This reverts commit 96989295ba.

* chore: default to process.cwd() if cannot find node_modules path
2023-10-19 11:28:31 -04:00
Take Weiland
bcdd2d626f fix: handle graphQL: false on globals when building policy type (#3729) 2023-10-19 09:13:51 -04:00
Elliot DeNolf
67682248c8 chore: more master -> main readme renames 2023-10-19 09:08:40 -04:00
Jacob Fletcher
7c52d6ee28 Merge pull request #3745 from payloadcms/fix/misc-admin
Fix/misc admin
2023-10-19 09:06:20 -04:00
Elliot DeNolf
bc65b53ce5 chore(release): eslint-config-payload/1.0.0 2023-10-18 21:37:35 -04:00
Elliot DeNolf
c8cc6ea1cc chore(script): more prompts during publish 2023-10-18 21:29:26 -04:00
Jacob Fletcher
4e05e6fd85 fix(a11y): tab indices 2023-10-18 17:55:55 -04:00
Jacob Fletcher
6988a68eaf fix: renders id as fallback title in DeleteDocument 2023-10-18 17:55:55 -04:00
Jacob Fletcher
a272692726 chore: refines drawer and blur styles 2023-10-18 17:55:39 -04:00
Dan Ribbens
229e4459cb fix(db-postgres): block and array inserts error (#3714)
Co-authored-by: James <james@trbl.design>
2023-10-18 16:53:26 -04:00
Take Weiland
056585ed31 fix: properly handles hideAPIURL (#3721) 2023-10-18 16:36:57 -04:00
Elliot DeNolf
b545433ee6 chore(templates): add payload helper npm script 2023-10-18 16:11:58 -04:00
Elliot DeNolf
4c938b5f9e chore(plugin-nested-docs): lint fix (#3740) 2023-10-18 14:40:48 -04:00
Elliot DeNolf
f1d8fa9999 chore: add 2.0 announcement banner 2023-10-18 14:38:58 -04:00
Jarrod Flesch
1670a603f6 chore: adjust where sharp types are imported from (#3645) 2023-10-18 11:44:49 -04:00
Elliot DeNolf
22f1fa8fc9 chore: update issue template and repro guide 2023-10-18 11:43:11 -04:00
Jacob Fletcher
370e8d1938 chore: replaces bg blur in document controls (#3736) 2023-10-18 11:40:25 -04:00
Elliot DeNolf
3a3eab761e fix: filesRequiredOnCreate typing, tests, linting (#3737) 2023-10-18 11:27:55 -04:00
Jacob Fletcher
238f7e1b94 chore(examples/live-preview): pins @payloadcms/live-preview-react to latest 2023-10-18 10:18:01 -04:00
Jacob Fletcher
58e2083882 Merge pull request #3719 from payloadcms/fix/live-preview/uploads
Fix/live preview/uploads
2023-10-17 17:05:30 -04:00
Jacob Fletcher
20cde242fb fix(live-preview): properly handles uploads and hasOne monomorphic relationships 2023-10-17 17:00:59 -04:00
Elliot DeNolf
f50a392d59 chore(script): update release script [skip ci] 2023-10-17 17:00:14 -04:00
Elliot DeNolf
fa1740d906 chore: update changelog 2023-10-17 16:51:24 -04:00
Elliot DeNolf
e847061c74 chore(release): payload/2.0.10 [skip ci] 2023-10-17 16:45:10 -04:00
Jacob Fletcher
ebd5e6ae8f chore: types fieldSchemaToJSON 2023-10-17 16:39:36 -04:00
TomDo1234
48de89794b feat: filesRequired is optional for uploads (#3668)
* filesRequired is optional for uploads

* More accurate name

* Updated docs

* ensure that by default you throw on missing file
2023-10-17 15:21:16 -04:00
Elliot DeNolf
ef4b5d8bfd chore: add payload as peer dep to all adapters (#3716) 2023-10-17 15:20:09 -04:00
Elliot DeNolf
5711d42eca chore: update pnpm-lock.yaml 2023-10-17 15:03:58 -04:00
Elliot DeNolf
a446a788a9 chore(release): payload/2.0.9 2023-10-17 15:00:55 -04:00
Elliot DeNolf
df57196d19 chore(live-preview-react): adjust live-preview semver dep 2023-10-17 15:00:55 -04:00
Alessio Gravili
86c563e4e5 Merge remote-tracking branch 'origin/main' 2023-10-17 20:57:17 +02:00
Alessio Gravili
734b8c08ed chore(richtext-lexical): add additional safety checks for incorrect data passed into the editor 2023-10-17 20:56:22 +02:00
geminigeek
68c5a57515 [fix] Register first user verify update missing transaction id / req (#3665)
Co-authored-by: Dan Ribbens <dan.ribbens@gmail.com>
2023-10-17 14:50:56 -04:00
Elliot DeNolf
d9f0b7bd30 chore(release): live-preview-react/0.1.4 2023-10-17 13:23:10 -04:00
Elliot DeNolf
5ecfe3da28 chore(release): richtext-lexical/0.1.13 2023-10-17 13:18:30 -04:00
Elliot DeNolf
3e3163e875 chore(release): live-preview/0.1.4 2023-10-17 13:17:33 -04:00
Elliot DeNolf
cfe1698dfd chore: update changelog 2023-10-17 13:15:36 -04:00
Elliot DeNolf
5722634660 chore(release): v2.0.8 2023-10-17 13:06:25 -04:00
Jacob Fletcher
cdbfc9132a chore: optimizes live preview (#3713) 2023-10-17 12:42:31 -04:00
Jacob Fletcher
dd0ac066ce feat(live-preview): caches field schema (#3711) 2023-10-17 12:11:55 -04:00
PatrikKozak
8b8ceabbdd fix(templates): user access control (#3712) 2023-10-17 12:07:37 -04:00
Alessio Gravili
8da18d3496 Merge pull request #3707 from payloadcms/fix/3683
fix(richtext-lexical): Blocks Field: Sub-forms being re-rendered unnecessarily
2023-10-17 17:33:05 +02:00
Elliot DeNolf
6cd4df3dc4 chore(script): properly version and publish non-latest packages 2023-10-17 11:30:09 -04:00
Elliot DeNolf
e74dc8633b ci: add retries to e2e tests (#3708)
* ci: add retries to e2e tests

* ci: add timeout_minutes for retry
2023-10-17 11:26:34 -04:00
Alessio Gravili
2f945919a3 chore: disable props for useIntersect hook 2023-10-17 17:24:50 +02:00
Alessio Gravili
52dc9177d7 chore: enable forceRender for richtext-lexical's Blocks feature form, and all their sub-forms 2023-10-17 16:44:34 +02:00
Alessio Gravili
cec757d098 chore: make sure intersectionObserver does not cause re-renders if forceRender is enabled 2023-10-17 16:34:44 +02:00
Jacob Fletcher
80e57150a0 chore: refines live preview shadow and bg (#3706) 2023-10-17 10:11:21 -04:00
Elliot DeNolf
2969da7402 chore(release): create-payload-app/1.0.0 2023-10-16 23:32:32 -04:00
Elliot DeNolf
35da1db99f chore(create-payload-app): use swc, cleanup scripts 2023-10-16 23:17:45 -04:00
Elliot DeNolf
a578226d34 ci: rework release-it script 2023-10-16 22:47:27 -04:00
James
8c75f32620 chore: website seed script compatibility with postgres + mongo 2023-10-16 18:39:28 -04:00
James
c3ab8b9115 Merge branch 'main' of github.com:payloadcms/payload 2023-10-16 18:34:18 -04:00
James
993568a195 fix: bug with seeding ecommerce 2023-10-16 18:34:10 -04:00
Jacob Fletcher
c3cec64220 chore: refines main nav (#3703) 2023-10-16 17:36:05 -04:00
Elliot DeNolf
084e9f0ff8 chore(release): db-postgres/0.1.9 2023-10-16 16:32:03 -04:00
James Mikrut
9f0ef9b7da chore: template compatibility with postgres (#3701)
* fix: blocks within groups in postgres

* chore: template compatibility
2023-10-16 16:26:21 -04:00
James Mikrut
c384f490c8 Merge pull request #3700 from payloadcms/fix/postgres-blocks-within-groups
fix: blocks within groups in postgres
2023-10-16 16:25:46 -04:00
James
45a62ba949 fix: blocks within groups in postgres 2023-10-16 16:12:21 -04:00
Elliot DeNolf
1eae5f9c99 test(create-payload-app): test create project for all templates 2023-10-16 15:12:59 -04:00
James
dfa861557d chore: website template postgres compatibility 2023-10-16 14:47:18 -04:00
James
228fd58020 chore: ecommerce template postgres compatibility 2023-10-16 14:40:37 -04:00
Take Weiland
150799e10e fix: some local operations missing req.transactionID (#3651)
Co-authored-by: Dan Ribbens <dan.ribbens@gmail.com>
2023-10-16 14:17:58 -04:00
Elliot DeNolf
823436a883 chore(release): richtext-slate/1.0.6 2023-10-16 14:16:20 -04:00
Elliot DeNolf
cbb0ba1a2c chore(release): richtext-lexical/0.1.12 2023-10-16 14:15:55 -04:00
Alessio Gravili
cb39354a9d fix(richtext-*): link drawer form receiving incorrect field schema (#3696) 2023-10-16 19:43:23 +02:00
Jacob Fletcher
1625ff244e fix: renders mobile document controls (#3695) 2023-10-16 13:37:40 -04:00
Alessio Gravili
24918fe1d2 fix(richtext-lexical): #3682 isolated editor container causing z-index issues 2023-10-16 18:56:25 +02:00
Alessio Gravili
b8a58666e7 fix(richtext-*): extra fields not being iterated correctly (#3693) 2023-10-16 18:47:52 +02:00
Elliot DeNolf
2e6a2c8355 ci: add plugin-nested-docs build 2023-10-16 12:16:14 -04:00
Elliot DeNolf
1fdff92525 chore(script): use semver to validate and show next version 2023-10-16 12:10:30 -04:00
Elliot DeNolf
7da5f6e92a chore(release): plugin-nested-docs/1.0.8 2023-10-16 12:07:17 -04:00
James Mikrut
67c7572e5f Merge pull request #3689 from payloadcms/chore/nested-docs
Chore/nested docs
2023-10-16 11:44:11 -04:00
craigrdaniels
e311e8fff9 fix: autosave time shown minutes only (#3492) 2023-10-16 11:32:31 -04:00
James
086e50b9b3 chore: renames nested-docs test suite 2023-10-16 11:30:45 -04:00
James
66ab6c587d chore: moves nested docs to monorepo 2023-10-16 11:28:40 -04:00
Elliot DeNolf
786fb926c2 chore: update changelog 2023-10-16 11:16:56 -04:00
James
7d954b11a3 Merge branch 'feat/allow-filteroptions-null' of github.com:payloadcms/payload into chore/nested-docs 2023-10-16 11:09:23 -04:00
Jarrod Flesch
3c5044368d fix: corrects add block index (#3681) 2023-10-16 10:58:54 -04:00
Jacob Fletcher
f129d6c607 Merge pull request #3687 from payloadcms/dependabot/npm_and_yarn/examples/testing/babel/traverse-7.23.2
chore(deps): bump @babel/traverse from 7.22.17 to 7.23.2 in /examples/testing
2023-10-16 10:57:29 -04:00
dependabot[bot]
de2d985405 chore(deps): bump @babel/traverse in /examples/testing
Bumps [@babel/traverse](https://github.com/babel/babel/tree/HEAD/packages/babel-traverse) from 7.22.17 to 7.23.2.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.23.2/packages/babel-traverse)

---
updated-dependencies:
- dependency-name: "@babel/traverse"
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-16 14:44:39 +00:00
Jacob Fletcher
060f3c73fa Merge pull request #3674 from payloadcms/chore/plugin-nested-docs
chore: imports nested docs plugin
2023-10-16 10:43:52 -04:00
Jacob Fletcher
62ae7be113 chore(plugin-nested-docs): migrates demo to payload 2.x 2023-10-16 10:40:23 -04:00
Jacob Fletcher
771df061b4 chore(plugin-nested-docs): migrates to monorepo setup 2023-10-16 10:29:04 -04:00
Alessio Gravili
09e64c3be8 chore: _community test: add missing "extends" to tsconfig.json 2023-10-16 16:28:17 +02:00
PatrikKozak
1a006fef19 chore(templates/website): uses correct logo color in dark mode (#3667) 2023-10-16 10:14:09 -04:00
James
c4cac99875 feat: allows filterOptions to return null 2023-10-16 10:01:19 -04:00
Jessica Chowdhury
d616772740 fix: misc upload crop/focal point updates (#3580) 2023-10-16 08:42:35 -04:00
Elliot DeNolf
4b9e87bb4d chore(release): db-postgres/0.1.8 2023-10-15 21:04:46 -04:00
Elliot DeNolf
ff5e174497 chore(script): multiselect publishing prompt 2023-10-15 20:53:16 -04:00
Elliot DeNolf
34017e1758 chore(release): payload/2.0.7 2023-10-15 20:49:18 -04:00
James Mikrut
23d95526ab Merge pull request #3666 from payloadcms/fix/empty-in-array
fix: empty inArray no longer crashes postgres
2023-10-15 18:05:15 -04:00
James
59b87fdb21 chore: typo 2023-10-15 17:55:30 -04:00
James
f2ac1f7d48 chore: merge main 2023-10-15 17:31:24 -04:00
James
8d4f39af5e Merge branch 'main' of github.com:payloadcms/payload into fix/empty-in-array 2023-10-15 17:29:51 -04:00
James
c4ac341d75 fix: empty inArray no longer crashes postgres 2023-10-15 17:28:13 -04:00
James Mikrut
c9844f2958 Update README.md 2023-10-15 10:01:58 -04:00
Jacob Fletcher
a67a9379ce Merge remote-tracking branch 'plugin-sentry/main' into chore/plugin-sentry 2023-10-15 02:49:33 -04:00
Jacob Fletcher
7bbd292efa Merge remote-tracking branch 'plugin-form-builder/main' into chore/plugin-form-builder 2023-10-15 02:31:29 -04:00
Jacob Fletcher
3eefe8cb21 Merge remote-tracking branch 'plugin-nested-docs/main' into chore/plugin-nested-docs 2023-10-15 02:28:29 -04:00
Jacob Fletcher
29ef8e797d Merge remote-tracking branch 'plugin-redirects/main' into chore/plugin-redirects 2023-10-15 01:47:10 -04:00
Jacob Fletcher
b0a62442e5 Merge remote-tracking branch 'plugin-stripe/main' into chore/plugin-stripe 2023-10-15 01:42:42 -04:00
Jacob Fletcher
c6ce6024d2 Merge remote-tracking branch 'plugin-search/main' into chore/plugin-search 2023-10-15 01:30:02 -04:00
Jacob Fletcher
00daf728f4 Merge remote-tracking branch 'plugin-seo/main' into chore/plugin-seo 2023-10-15 00:53:27 -04:00
Elliot DeNolf
927a1ab049 chore(release): plugin-nested-stripe/0.0.15 2023-10-13 10:57:48 -04:00
Elliot DeNolf
f23ae28d45 chore(deps): add payload 2.0 to peer deps 2023-10-13 10:56:46 -04:00
Elliot DeNolf
8938f2b7e9 chore(release): plugin-nested-docs/1.0.7 2023-10-13 10:52:51 -04:00
Elliot DeNolf
ed8a9ffa09 chore(deps): add payload 2.0 to peer deps 2023-10-13 10:51:14 -04:00
Elliot DeNolf
7db69347a1 chore(release): plugin-redirects/1.0.1 2023-10-13 10:44:13 -04:00
Elliot DeNolf
6e22cf291c chore(deps): add payload 2.0 to peer deps 2023-10-13 10:42:08 -04:00
Elliot DeNolf
15cff2b1c5 chore(release): plugin-seo@1.0.15 2023-10-13 10:38:27 -04:00
Elliot DeNolf
864bf2c062 feat: update payload peer dep to 2.0 2023-10-13 10:37:13 -04:00
Elliot DeNolf
6ebc325520 chore(release): plugin-seo@1.0.14 2023-10-13 10:27:13 -04:00
Elliot DeNolf
9aac5a3384 chore: update scripts 2023-10-13 10:22:07 -04:00
Elliot DeNolf
2a549438e0 chore(release): plugin-cloud-storage/1.1.1 2023-10-12 15:54:45 -04:00
Elliot DeNolf
46121b5891 chore(release): plugin-cloud-storage/1.1.0 2023-10-12 15:48:49 -04:00
Elliot DeNolf
f3b6e49781 chore: update peer deps 2023-10-12 15:45:12 -04:00
Elliot DeNolf
36740b70d4 0.0.15-beta.0 2023-10-06 11:49:53 -04:00
PatrikKozak
5d1677a84e Merge pull request #29 from payloadcms/chore/alias-pattern
chore: improves alias pattern
2023-10-06 10:55:29 -04:00
Elliot DeNolf
c73113565a 1.1.0-beta.1 2023-10-06 09:41:41 -04:00
James
ad924c8d7b Merge branch 'master' of github.com:payloadcms/plugin-cloud-storage 2023-10-06 09:02:15 -04:00
James
bb6956cd32 chore: plugin alias specificity 2023-10-06 09:02:08 -04:00
Patrik Kozak
4fab26db9d chore: updates local dev aliases 2023-10-05 22:29:51 -04:00
Patrik Kozak
56cf767e18 chore: improves alias pattern 2023-10-05 15:37:01 -04:00
Elliot DeNolf
5c97d05acf 1.1.0-beta.0 2023-10-05 14:15:02 -04:00
James
6bad383a95 chore: working local dev aliases 2023-10-05 13:28:22 -04:00
James
4b726eb139 chore: improves alias pattern 2023-10-05 12:35:14 -04:00
Daniel Kirchhof
e13d8da7c2 fix: skip following code if form.emails list is empty (#54) 2023-08-28 19:15:09 +02:00
Jacob Fletcher
0a45389a25 0.0.14 2023-08-04 13:28:23 -04:00
Jacob Fletcher
2abdce31f8 feat: allows turning off rest proxy (#22) 2023-08-04 13:27:48 -04:00
Jessica Boezwinkle
3e9826d7ae chore: updates readme 2023-08-03 11:42:26 +01:00
Jessica Boezwinkle
f8a095e7f4 chore: updates readme 2023-08-03 11:41:00 +01:00
Jessica Chowdhury
9c046d049a Removes WIP disclaimer from README 2023-07-21 15:22:30 +01:00
Jessica Boezwinkle
0871f299ef chore: update test suite 2023-07-20 14:47:03 +01:00
Jessica Chowdhury
a074a5b376 Minor README.md tweak 2023-07-18 13:41:25 +01:00
Jessica Chowdhury
abf3378441 Update README.md to emphasize that it is WIP 2023-07-18 13:38:20 +01:00
Jessica Chowdhury
c1b41b75c4 Merge pull request #2 from payloadcms/chore/update-types
chore: updates types and readme
2023-07-17 16:05:36 +01:00
Jacob Fletcher
b5b487ab90 1.0.6 2023-07-10 16:49:14 -04:00
Jacob Fletcher
940bfe4f18 fix: threads locale through resaveChildren (#24) 2023-07-10 16:45:21 -04:00
Jacob Fletcher
41dcdd4e01 chore: adds localization section to docs (#25) 2023-07-10 16:43:28 -04:00
Jessica Boezwinkle
19706617e5 chore: uses existing express app 2023-06-28 12:02:41 +01:00
Jacob Fletcher
ced5ad8b76 1.0.1 2023-06-27 14:30:02 -04:00
Jacob Fletcher
11429135ee fix: adjusts payload peer dep range (#8) 2023-06-27 14:29:15 -04:00
Elliot DeNolf
3d5858ca6d 1.0.19 2023-06-26 14:23:23 -04:00
James Mikrut
5456695728 Merge pull request #62 from lucyawrey/individual-prefixes
Add support for 'prefix' field on individual uploads, takes priority over global prefix field
2023-06-26 14:22:04 -04:00
Lucy Awrey
b79da5920a Add support for 'prefix' field on individual uploads, takes priority over global prefix field
squashed a few commits testing different approaches to this
2023-06-26 13:18:36 -04:00
Elliot DeNolf
a0a92952eb 1.0.18 2023-06-23 17:13:57 -04:00
Elliot DeNolf
a687dfdb16 docs: arg comments and dev readme formatting 2023-06-23 17:13:10 -04:00
Elliot DeNolf
b9d7e82052 chore: add region aws adapter example in readme 2023-06-23 14:42:15 -04:00
Jessica Boezwinkle
cc28df1324 chore: adds test 2023-06-23 17:00:37 +01:00
Jessica Boezwinkle
607d345eb2 chore: misc update 2023-06-23 16:49:40 +01:00
TomDo1234
fb10af8365 docs: mention usage with AWS EC2 IAM Role (#30)
Specified that you don't need to provide any credentials when using a correct IAM Role. IAM Roles are recommended by AWS over direct credentials due to superior security.
2023-06-23 11:40:08 -04:00
Seth Syberg
53427443a7 fix: allow empty config on s3 adapter (#60) 2023-06-23 11:39:04 -04:00
vvvctr
62fae5520d chore: fix email link (#44)
Fix mail link in readme.
2023-06-23 11:33:23 -04:00
DireWolf707
8b186dbf83 docs: add default value for GCS_CREDENTIALS (#48)
without default value, it gives error in payload admin page (in console of browser)

caught SyntaxError: "undefined" is not valid JSON
    at JSON.parse (<anonymous>)
    at ./src/payload.config.ts 

as envs are not availabe in payload admin GCS_CREDENTIALS gives undefined
resulting JSON.parse(undefined) raises this error
2023-06-23 11:32:02 -04:00
Jessica Boezwinkle
e41515564b chore: actually commits jsdoc additions 2023-06-23 16:05:01 +01:00
Jessica Boezwinkle
f615b8cdf2 chore: updates types and readme 2023-06-23 16:02:01 +01:00
Elliot DeNolf
9182e79c2d Merge pull request #1 from payloadcms/feedback
feat: improvements
2023-06-23 10:36:14 -04:00
Elliot DeNolf
ed95722a50 test: add test suite, run in workflow and prepublishOnly 2023-06-23 10:32:44 -04:00
Jessica Boezwinkle
d7adb094a5 chore: updates index.ts and Payload version 2023-06-23 12:22:30 +01:00
Jessica Boezwinkle
717e01bbbf chore: removes yarn test 2023-06-22 11:43:45 +01:00
Jessica Boezwinkle
3987953947 chore: adds enable option and misc feedback changes 2023-06-22 11:28:48 +01:00
Elliot DeNolf
b7c750220e chore: general feedback 2023-06-21 12:00:10 -04:00
Jessica Boezwinkle
33f9357e58 demo: updates depenedencies 2023-06-21 12:13:51 +01:00
Jessica Boezwinkle
9109f7094b chore: adds requestHandler and error options, adds test errors to demo 2023-06-21 12:10:21 +01:00
Jessica Chowdhury
92bd914966 Update README.md 2023-06-21 12:03:09 +01:00
Jessica Chowdhury
b210551e96 Update README.md 2023-06-21 12:01:07 +01:00
Jacob Fletcher
3dbb70a9e6 1.0.5 2023-06-19 17:02:48 -04:00
Jacob Fletcher
adef360275 Merge pull request #21 from payloadcms/fix/parent-types
fix: createParentField types
2023-06-19 17:01:02 -04:00
Jacob Fletcher
abebd7f440 Merge pull request #11 from payloadcms/chore/export-fields
chore: exports fields top-level
2023-06-19 16:56:50 -04:00
Jacob Fletcher
e9ed969ad9 fix: createParentField types 2023-06-19 16:56:34 -04:00
Jessica Chowdhury
5e64e52dab chore: Updates README 2023-06-16 12:13:32 +01:00
Jessica Boezwinkle
90e9dd7f47 setup: builds plugin and demo 2023-06-16 11:58:47 +01:00
Jessica Boezwinkle
f867d7a615 setup: initial commit 2023-06-16 11:55:13 +01:00
Elliot DeNolf
4ede3384f0 1.0.17 2023-06-12 10:54:34 -04:00
Elliot DeNolf
008eb640f0 1.0.17-beta.1 2023-06-12 10:51:57 -04:00
Elliot DeNolf
019ef358a5 chore: proper fsMock location 2023-06-11 19:37:39 -04:00
Elliot DeNolf
72950b2b82 1.0.17-beta.0 2023-06-11 19:06:41 -04:00
Elliot DeNolf
5b2ea583d2 chore: version sync 2023-06-11 19:06:35 -04:00
Elliot DeNolf
6fb0289e71 chore: add enabled to plugin options section in readme 2023-06-11 18:49:25 -04:00
Elliot DeNolf
f2bbe662f2 feat: add enabled property to conditionally enable/disable (#57) 2023-06-11 18:39:58 -04:00
Jacob Fletcher
19f3cef799 1.0.14-canary.0 2023-06-02 10:07:59 -04:00
Jacob Fletcher
9cd7315222 feat: threads doc info through generation functions #53 (#54) 2023-06-02 10:07:24 -04:00
Jacob Fletcher
6b1a7f0843 Merge pull request #16 from payloadcms/chore/eslint
chore: eslint and prettier
2023-05-18 14:43:26 -04:00
Jacob Fletcher
7a9b5133a7 Merge pull request #1 from payloadcms/chore/eslint
chore: eslint and prettier
2023-05-18 14:37:55 -04:00
Jacob Fletcher
7633922ec1 Merge pull request #7 from payloadcms/chore/eslint
chore: eslint and prettier
2023-05-18 14:34:32 -04:00
Jacob Fletcher
c4c7c20c8c chore: migrates demo to payload v1.8.2 2023-05-18 14:33:17 -04:00
Jacob Fletcher
ee403b79f4 chore: eslint and prettier 2023-05-18 14:33:13 -04:00
Jacob Fletcher
0221394c06 Merge pull request #19 from payloadcms/chore/eslint
chore: eslint and prettier
2023-05-18 14:29:18 -04:00
Jacob Fletcher
741ab0487d bumps demo to payload v1.8.2 2023-05-18 14:28:46 -04:00
Jacob Fletcher
8a513ba7af chore: eslint and prettier 2023-05-18 14:28:41 -04:00
Jacob Fletcher
d968349772 chore: bumps demo to payload v1.8.2 2023-05-18 14:03:19 -04:00
Jacob Fletcher
fc8eb07a35 chore: eslint and prettier 2023-05-18 14:02:21 -04:00
Jacob Fletcher
e76cd58425 chore: bumps demo to payload v1.8.2 2023-05-18 13:57:32 -04:00
Jacob Fletcher
888f937e3c chore: eslint and prettier 2023-05-18 13:57:32 -04:00
Jacob Fletcher
3de43379e7 1.0.15 2023-05-16 09:00:51 -04:00
Jacob Fletcher
f564ab6783 1.0.13 2023-05-16 08:38:05 -04:00
Jacob Fletcher
7e88159e99 fix: properly spreads collection fields into non-tabbed configs #50 (#51) 2023-05-16 08:37:29 -04:00
Jacob Fletcher
6c3a5d9c85 1.0.14 2023-05-16 00:03:38 -04:00
Jacob Fletcher
fcca4a46f9 chore: lints DynamicPriceSelector 2023-05-16 00:03:33 -04:00
Jacob Fletcher
c4f8052280 1.0.12 2023-05-15 23:48:01 -04:00
Jacob Fletcher
052c282d75 chore: updates README 2023-05-15 23:45:38 -04:00
Jacob Fletcher
8d1251f0d6 chore: removes unused eslint comments and updates demo yarn.lock 2023-05-15 23:29:06 -04:00
Jacob Fletcher
b9bcbbea02 fix: implements 7501d0a for globals 2023-05-15 23:18:11 -04:00
Jacob Fletcher
8271c206b7 fix: supports custom fields #41 (#48) 2023-05-15 23:09:43 -04:00
Jacob Fletcher
7501d0ad96 fix: supports top-level and sidebar fields with tabbedUI #35 (#47) 2023-05-15 22:45:15 -04:00
Jacob Fletcher
b4259fa625 chore: eslint and prettier (#46) 2023-05-15 17:57:42 -04:00
Jacob Fletcher
5e09f50055 1.0.11 2023-05-15 17:38:55 -04:00
Jacob Fletcher
32dc030e17 1.0.14-canary.0 2023-05-15 17:26:11 -04:00
Jarrod Flesch
64a443f968 chore: adds use client directive atop custom react components (#45) 2023-05-15 13:30:02 -04:00
Jarrod Flesch
8769d042f9 chore: adds use client directive atop custom react components (#42) 2023-05-15 13:29:06 -04:00
Jacob Fletcher
76c9704850 fix: correctly types width fields #37 (#41) 2023-05-15 12:27:34 -04:00
Jacob Fletcher
f8da32a9bd feat: explicitly exports fields for reuse #35 (#39) 2023-05-15 11:56:34 -04:00
Jacob Fletcher
a89df757bf chore: eslint and prettier (#40) 2023-05-15 11:23:29 -04:00
Alberto Maghini
a12240b71e fix: threads locale through findByID (#31) 2023-05-15 17:14:07 +02:00
Jacob Fletcher
dfb9a93547 0.0.13 2023-05-01 17:40:57 -04:00
Jacob Fletcher
a2e336470a Merge pull request #18 from payloadcms/fix/deletion-hook
fix: safely retrieves stripe resource before deletion #17
2023-05-01 17:40:20 -04:00
Jacob Fletcher
f6994e57dd fix: safely retrieves stripe resource before deletion #17 2023-05-01 17:36:40 -04:00
James
297e7f8c1d 1.0.16 2023-04-27 16:38:21 -04:00
James
5c9a01aa1c 1.0.15 2023-04-27 16:37:34 -04:00
James
df7499483a chore: merge conflicts 2023-04-27 16:35:08 -04:00
James
131333fc3a fix: #34, only deletes files with valid filename 2023-04-27 16:30:44 -04:00
James
60cf803e8d fix: #43, not deleting old files 2023-04-27 16:28:16 -04:00
James
7eb8d8bed1 fix: uses fallback for stream to prevent webpack error 2023-04-27 13:00:02 -04:00
Dan Ribbens
2f799a9420 feat: azure upload file stream (#46) 2023-04-10 17:04:28 -04:00
Ssor Onid
09584940d1 chore: Update README.md (#24) 2023-04-10 09:15:42 -04:00
Dan Ribbens
87063a03c4 chore: show MIT license in package.json 2023-04-07 17:07:50 -04:00
Dan Ribbens
b7e2f2a57b Merge pull request #45 from alamit/feat/azure-partial-content 2023-04-07 15:39:44 -04:00
alamit
25c4d858e9 Update staticHandler.ts 2023-04-07 04:36:18 +02:00
alamit
02c83b65ef feat(azure): Add support for partial content requests 2023-04-07 03:06:46 +02:00
Jacob Fletcher
bfe8de3fd6 0.0.12 2023-03-29 13:27:09 -04:00
Jacob Fletcher
bd16e9fb53 chore: conditionally logs webhook events #15 (#16) 2023-03-29 13:25:27 -04:00
Dragos Nedelcu
9968d0aaff chore: conditionally renders meta generation buttons 2023-02-27 11:58:57 -05:00
Ellie
9fe4c4aabc fix: passes locale through generateURL 2023-02-27 10:16:07 -05:00
Elliot DeNolf
6cb8794c5a 1.0.14 2023-02-09 14:01:57 -05:00
Elliot DeNolf
e56518e702 fix: properly alias fs at the package level, not dev 2023-02-09 14:01:09 -05:00
Elliot DeNolf
20cfd61dbf 1.0.13 2023-02-09 13:13:20 -05:00
Elliot DeNolf
65899766d6 feat: add proper prepublishOnly script
chore: remove dev/yarn.lock during clean, prevents publish

chore: make dev package.json private

chore: adjust payload peer dep version
2023-02-09 13:06:00 -05:00
Elliot DeNolf
17dbc1e484 chore: add lib-storage to dev deps, needed for dev and build 2023-02-09 12:13:13 -05:00
Elliot DeNolf
ee62c2a722 chore: additional webpack mock for dev 2023-02-09 12:12:12 -05:00
Elliot DeNolf
1f7f5e5cdb feat(s3): implement multipart upload 2023-02-09 11:56:53 -05:00
Elliot DeNolf
7ab9c386ca fix: change upload fields from disabled to hidden 2023-02-08 13:31:30 -05:00
Elliot DeNolf
b4b66e2f16 chore: explicit type for S3 storage client 2023-02-07 14:37:51 -05:00
Elliot DeNolf
bd64ec3c49 chore: add some eslint ignores for dev dir 2023-02-07 14:27:04 -05:00
Jacob Fletcher
8ddbb67f07 0.0.11 2023-02-02 14:28:23 -05:00
Jacob Fletcher
d61ced9cbd chore: exports fields top-level 2023-02-01 17:57:16 -05:00
Jacob Fletcher
ada165a21e Merge pull request #10 from payloadcms/chore/export-types
chore: exports types
2023-02-01 17:42:12 -05:00
Jacob Fletcher
715e154817 chore: exports types (#5) 2023-02-01 17:41:28 -05:00
Jacob Fletcher
8d4fd14ff2 chore: exports types 2023-02-01 17:36:31 -05:00
Elliot DeNolf
4c8f33e098 feat(s3): support large uploads (#37)
* feat(s3): implement multipart upload

* feat(s3): support tempFilePath and using read stream for uploads
2023-02-01 16:31:07 -05:00
Jacob Fletcher
0eac5ffe64 1.0.0 2023-02-01 14:19:29 -05:00
Jacob Fletcher
41961ad51d chore: bumps demo to payload v1.6.2 2023-02-01 14:18:54 -05:00
Jacob Fletcher
a2aa475ece initial working draft 2023-02-01 13:34:23 -05:00
Jacob Fletcher
42f1a23b7f 1.0.13 2023-01-23 09:36:09 -05:00
Jacob Fletcher
da4d9018c1 feat: spreads overrides into configs #25 (#29) 2023-01-23 09:34:31 -05:00
Jacob Fletcher
e8458f84bc fix: removes conditional return of formattedEmails in sendEmail hook #26 (#28) 2023-01-23 09:00:26 -05:00
Jacob Fletcher
5b6705b4f6 fix: properly overrides form submission relationTo #19 (#27) 2023-01-23 08:59:52 -05:00
bencun
b4d1eaf1fb feat: field localization
* Localize field labels and values.

* More localization.
2023-01-23 14:59:15 +01:00
Jacob Fletcher
93b049288b 1.0.12 2023-01-18 08:07:06 -05:00
Jacob Fletcher
35e14cf044 fix: uses form slug from config in form relationship field #19 (#23) 2023-01-18 08:04:11 -05:00
Jacob Fletcher
76e715aa6d chore: reverts cb0197e 2023-01-18 08:00:09 -05:00
Jessica Chowdhury
2c8ea533af feat: adds cc field to email 2023-01-13 18:00:03 +00:00
Jacob Fletcher
60c14557ff Merge pull request #14 from payloadcms/chore/13
chore: handles stripe test keys
2023-01-04 16:53:56 -05:00
Jacob Fletcher
a38b43dc4f chore: handles stripe test keys 2023-01-04 16:53:18 -05:00
Jacob Fletcher
12e85f654e Merge pull request #12 from payloadcms/fix/7
fix: auto-generates password for webhook-created users
2023-01-04 10:18:26 -05:00
Jacob Fletcher
c02463be69 fix: auto-generates password for webhook-created users 2023-01-04 10:16:41 -05:00
Jacob Fletcher
1b6d0cf4da Merge pull request #11 from payloadcms/feat/type-exports
fix: properly exports types
2023-01-04 09:58:03 -05:00
Jacob Fletcher
e59e6ed65e fix: properly exports types 2023-01-04 09:44:15 -05:00
Jacob Fletcher
d6a11921e0 Merge pull request #10 from Velua/patch-2
feat: accepts generic in StripeWebhookHandler
2023-01-04 08:57:25 -05:00
Jacob Fletcher
ab4df553f0 1.0.10 2023-01-04 01:19:08 -05:00
Jacob Fletcher
e1e91e7e99 Merge pull request #26 from payloadcms/feat/export-types
feat: properly export types
2023-01-04 01:13:37 -05:00
Jacob Fletcher
a7f1aff2c4 chore: explicitly includes types in files array 2023-01-04 01:11:33 -05:00
Jacob Fletcher
a8b366992a 1.0.11 2023-01-04 00:48:54 -05:00
Jacob Fletcher
4841dbf7ab Merge pull request #17 from payloadcms/fix/15
fix: custom form fields
2023-01-04 00:46:10 -05:00
Jacob Fletcher
9ee7041f9f Merge pull request #18 from payloadcms/fix/type-exports
fix: properly exports types
2023-01-04 00:45:37 -05:00
Jacob Fletcher
856962c6c6 fix: properly exports types 2023-01-04 00:39:10 -05:00
Jacob Fletcher
ba0651cecf fix: custom form fields 2023-01-03 23:26:13 -05:00
John Williamson
573c8de380 accept generic 2022-12-29 17:11:33 +10:00
Jacob Fletcher
a64297b376 1.0.10 2022-12-23 17:24:55 -05:00
Jacob Fletcher
9f5ec1784c fix: build errors 2022-12-23 17:24:46 -05:00
Jacob Fletcher
caf9e5699e Merge pull request #13 from andr-ec/latestPayload
Updated to payload 1.3.0
2022-12-23 17:01:54 -05:00
Andre Carrera
505d58f7b6 updated to payload 1.3.0 2022-12-14 21:43:19 -07:00
Elliot DeNolf
3e5da25a24 feat: properly export types 2022-11-26 08:07:08 -05:00
Elliot DeNolf
e11a0fb285 docs: add more detail on S3 configuration 2022-11-21 10:01:16 -05:00
Jacob Fletcher
0363c85dbd chore: renames Options to PluginConfig 2022-11-17 17:13:27 -05:00
Jacob Fletcher
9d43805242 1.0.9 2022-11-17 17:05:28 -05:00
Jacob Fletcher
0dd39bcad2 chore: types 2022-11-17 17:04:47 -05:00
Jacob Fletcher
a0d479ead8 1.0.9 2022-11-17 16:59:25 -05:00
Jacob Fletcher
ef7ba946c4 chore: seeds meta image 2022-11-17 16:48:02 -05:00
Jacob Fletcher
bb915448e1 Merge pull request #25 from payloadcms/fix/tabs
fix: improves tab handling
2022-11-16 17:54:31 -05:00
Jacob Fletcher
b1c07ef748 fix: improves tab handling 2022-11-16 17:37:17 -05:00
Jacob Fletcher
a7d5a0fa81 chore: renames SEOConfig to PluginConfig 2022-11-16 16:04:25 -05:00
Jacob Fletcher
e0f6f36787 docs: adds development documentation 2022-11-16 15:08:12 -05:00
Jacob Fletcher
ca684a33d1 chore: migrates from useWatchForm to useAllFormFields 2022-11-16 15:04:09 -05:00
Jacob Fletcher
59a31543c8 chore: seeds demo 2022-11-16 14:59:29 -05:00
Jacob Fletcher
fa660cd4ef chore: ignores package-lock 2022-11-16 14:06:03 -05:00
Jacob Fletcher
fd9cbd2cdb chore: ignores package-lock 2022-11-16 14:05:19 -05:00
Jacob Fletcher
4f6eb1e307 chore: adds .env.example to demo 2022-11-16 12:50:53 -05:00
Jacob Fletcher
e3278bf981 chore: adds .env.example to demo 2022-11-16 12:47:33 -05:00
Jacob Fletcher
50860bc8c1 1.0.4 2022-11-16 12:27:39 -05:00
Jacob Fletcher
71057aa5ef docs: adds development documentation 2022-11-16 12:25:45 -05:00
Jacob Fletcher
52f7890989 docs: adds development documentation 2022-11-16 12:22:57 -05:00
Jacob Fletcher
6200a119f9 fix: prevents child-parents 2022-11-16 11:31:15 -05:00
Jacob Fletcher
46eb61d18a chore: payload peerDep 2022-11-16 10:45:14 -05:00
Jacob Fletcher
246c78c6c7 chore: bumps payload deps 2022-11-16 10:39:42 -05:00
Jacob Fletcher
37efc13c1e chore: seeds demo 2022-11-15 18:01:26 -05:00
Jacob Fletcher
2766489476 chore: bumps payload deps 2022-11-15 17:44:59 -05:00
Jacob Fletcher
0c1102a138 chore: seeds grandchild page 2022-11-15 17:10:53 -05:00
Jacob Fletcher
e765b96a4e Merge pull request #8 from payloadcms/fix/localization
fix: conditionally localizes breadcrumbs
2022-11-15 16:33:39 -05:00
Jacob Fletcher
01c42d9630 fix: conditionally localizes breadcrumbs 2022-11-15 16:19:18 -05:00
Jacob Fletcher
f421a2715d chore: seeds demo 2022-11-15 16:01:27 -05:00
Jacob Fletcher
edd7a8086c Merge pull request #7 from bencun/feat/disable-self-as-parent
Disable referencing self as a parent by default to prevent crashes
2022-11-15 13:24:09 -05:00
Jacob Fletcher
010db46e08 docs: updates README 2022-11-15 13:18:11 -05:00
Jacob Fletcher
fc8a6e107e chore: ignores .DS_Store 2022-11-15 12:58:09 -05:00
Jacob Fletcher
2a85bb9fa9 chore: ignores .DS_Store 2022-11-15 12:55:36 -05:00
Jacob Fletcher
c069f46f4c docs: adds troubleshooting section 2022-11-15 12:07:42 -05:00
Elliot DeNolf
eb65340923 chore: add installation section to readme 2022-11-14 12:47:22 -05:00
Jacob Fletcher
64bb16a6ff Merge pull request #6 from yagee/main
Update README and little fix to email template
2022-11-10 07:01:20 -08:00
Roman Ryzhikov
6f6e3cabe7 close <div> tag in html email template 2022-11-07 15:56:27 +02:00
Roman Ryzhikov
e9b5309a39 update method miss-spelling 2022-11-07 15:54:58 +02:00
Aleksandar Bencun
2cb79f1752 Improved the docs a bit. 2022-10-26 23:22:53 +02:00
Aleksandar Bencun
5f740a60cc Prevent selecting self as a parent unless this behavior is overridden explicitly. 2022-10-26 23:15:04 +02:00
Jarrod Flesch
175d44b0ae fix: thread through collection admin config properties - #5 2022-10-20 09:59:25 -04:00
Jacob Fletcher
e7ac1819ce 0.0.10 2022-10-19 14:51:29 -04:00
Jacob Fletcher
288ff2b094 feat: inforces stripeArgs array 2022-10-19 14:51:11 -04:00
Jacob Fletcher
aca534ec59 0.0.9 2022-10-19 14:27:39 -04:00
Jacob Fletcher
a8951cb741 fix: safely passes args through stripe proxy method handler 2022-10-19 14:26:39 -04:00
Jarrod Flesch
7f9dd2b4e1 fix: readme example ContentType to Content-Type 2022-10-18 17:02:26 -04:00
Alex Pagnotta
8a9f8408cf feat: ensure "accept-ranges" header is passed-trough on static files for S3 and Azure adapters 2022-10-17 18:21:23 +02:00
James Mikrut
f333ff1c5b Merge pull request #20 from linde12/master
Lazily initialize storage clients
2022-10-14 11:52:06 -04:00
olinde
d9dd7ca2c9 fix: await incoming configs onInit
The incoming configs onInit functions may be async, so we should await them.
2022-10-14 17:40:39 +02:00
olinde
2790bab479 feat: make s3 adapter initialize lazily 2022-10-14 15:29:28 +02:00
olinde
29b4bcd1b0 feat: make gcs adapter initialize lazily 2022-10-14 15:29:28 +02:00
olinde
d9dd60ff70 feat: make azure adapter initialize lazyily 2022-10-14 15:29:28 +02:00
Jacob Fletcher
07b970027d fix: demo subscription sync 2022-10-12 16:14:41 -04:00
Elliot DeNolf
e7f5c2e767 1.0.12 2022-10-11 12:53:45 -04:00
alamit
4889fe29f5 fix: content length header (#16) 2022-10-11 12:44:51 -04:00
Jacob Fletcher
71f6542341 chore: adds ui link to demo subscriptions 2022-10-11 11:13:46 -04:00
Jacob Fletcher
c90830f961 chore: syncs subscription status 2022-10-11 11:10:34 -04:00
Jacob Fletcher
d46d2c0595 0.0.8 2022-10-11 09:58:12 -04:00
Jacob Fletcher
16d6c26387 feat: adds priceJSON sync to demo 2022-10-11 09:55:15 -04:00
Jacob Fletcher
32df3067e1 fix: migrates from afterChange to beforeChange hook 2022-10-10 17:27:49 -04:00
Jacob Fletcher
3a7440dcb9 fix: uses proper key-value pairs in to-stripe hooks and renames fieldName to fieldPath 2022-10-10 17:11:10 -04:00
Jacob Fletcher
417f4b7aa9 fix: allows dot notation in sync config 2022-10-10 16:24:36 -04:00
Jacob Fletcher
822aec0a5c chore: renames fieldName and stripeProperty 2022-10-10 15:24:05 -04:00
Jacob Fletcher
455622fa57 0.0.7 2022-10-07 14:20:00 -04:00
Jacob Fletcher
f93316e588 chore: renames resource to stripeResourceType 2022-10-07 14:05:29 -04:00
Jacob Fletcher
b7e65d1024 feat: adds direct link to stripe resources #4 2022-10-07 13:38:40 -04:00
Jacob Fletcher
b5728104dd 0.0.6 2022-09-30 13:09:52 -04:00
Jacob Fletcher
604197bb98 chore: mocks server modules in demo 2022-09-30 13:05:43 -04:00
Jacob Fletcher
6b30a9702b 0.0.5 2022-09-30 11:21:54 -04:00
Jacob Fletcher
ab974ee587 fix: build errors 2022-09-30 11:20:47 -04:00
Jacob Fletcher
3a9efb21e0 chore: custom webhooks 2022-09-30 11:12:45 -04:00
Jacob Fletcher
2dd395f718 chore: improves logs 2022-09-29 15:27:03 -04:00
Jacob Fletcher
2df28355cf chore: syncs demo products 2022-09-29 12:33:24 -04:00
Jacob Fletcher
7607c17041 chore: custom subscriptionCreatedOrUpdated webhook 2022-09-29 12:33:07 -04:00
Jacob Fletcher
64560dd36b Merge pull request #1 from colinramsay/patch-1
chore: correct import directive in readme code sample
2022-09-29 08:58:35 -04:00
Colin Ramsay
e72fff6768 chore: correct import directive in readme code sample 2022-09-29 13:54:00 +01:00
Jacob Fletcher
f81b4d3a1b feat: detects nested webhooks events 2022-09-28 12:24:53 -04:00
Jacob Fletcher
8305b65b98 chore: renames object to resource 2022-09-27 17:00:47 -04:00
Jacob Fletcher
275d15cfdc chore: renames isSyncedToStripe to skipSync 2022-09-27 16:28:26 -04:00
Jacob Fletcher
c09667edfc chore: general housekeeping 2022-09-27 16:26:49 -04:00
Jacob Fletcher
2cbb14f8dd feat: abstracts webhooks 2022-09-27 14:43:21 -04:00
Jacob Fletcher
936c125a42 fix: auto-sync hooks 2022-09-27 10:55:30 -04:00
Jacob Fletcher
5a8cdef103 wip: auto-sync 2022-09-26 18:18:58 -04:00
Jacob Fletcher
26bc1b46c1 chore: bumps to payload v1.1.4 2022-09-26 10:32:45 -04:00
Jacob Fletcher
639a832600 feat: supports collection config 2022-09-23 16:22:07 -04:00
Jacob Fletcher
ba4d751831 feat: configures working sync 2022-09-23 14:49:48 -04:00
James
c2c60851b0 1.0.11 2022-09-23 09:27:36 -07:00
James
84cd214a89 fix: only uses adapter to generate file urls if filename exists 2022-09-23 09:27:16 -07:00
James
6023191201 1.0.10 2022-09-21 09:45:26 -07:00
James
a7ccfaeb6f feat: adds generateFileURL to override file urls 2022-09-21 09:45:02 -07:00
Jacob Fletcher
32a0972855 feat: webhooks catch-all 2022-09-21 11:09:05 -04:00
Jacob Fletcher
d354610978 0.0.4 2022-09-20 13:20:04 -04:00
Jacob Fletcher
97bd414d3d chore: updates README.md 2022-09-20 13:19:16 -04:00
Jacob Fletcher
9f396598a0 chore: pluralizes stripeWebhooksEndpointSecret 2022-09-20 13:06:54 -04:00
Jacob Fletcher
c2e20277ec chore: aliases server modules 2022-09-20 13:04:09 -04:00
Jacob Fletcher
7e6f35f380 chore: removes proxy from demo hooks 2022-09-19 17:28:51 -04:00
Jacob Fletcher
750646b3b8 chore: updates README 2022-09-19 12:40:40 -04:00
James
e93599234d 1.0.9 2022-09-14 16:37:44 -07:00
James
c1cf66dc53 fix: sets proper headers for gcs 2022-09-14 16:36:15 -07:00
James
2cd83f2aa6 merge 2022-09-14 15:56:50 -07:00
James
0685717794 fix: ensures that proper Content-Type headers are set on pass-through static files 2022-09-14 15:53:14 -07:00
Dan Ribbens
d318e2276c 1.0.8 2022-08-25 11:58:23 -04:00
Dan Ribbens
8d3974776c chore: add prepublish build to package.json 2022-08-25 11:58:02 -04:00
Dan Ribbens
8f8b824432 Merge pull request #5 from afzaalahmad/feature/prefix-option
feat: add prefix option
2022-08-25 11:48:09 -04:00
Dan Ribbens
7d60a22ccf fix: typescript error 2022-08-25 11:39:34 -04:00
afzaalahmad
2075c0e817 fix: existing prefix field scenario 2022-08-25 02:53:46 +05:00
afzaalahmad
ad68a58859 fix: remove unnecessary param from deleteHandler 2022-08-25 02:53:46 +05:00
afzaalahmad
31622dd448 update: README.md 2022-08-25 02:53:42 +05:00
afzaalahmad
2b51699ec3 feat: add prefix option 2022-08-25 02:53:16 +05:00
Jacob Fletcher
eef80a8239 0.0.3 2022-08-24 16:24:38 -04:00
Jacob Fletcher
339fb96b7d fix: type error in demo 2022-08-24 16:24:04 -04:00
Jacob Fletcher
fe8254c73d fix: exports stripeProxy 2022-08-24 16:23:47 -04:00
Jacob Fletcher
aef868f471 0.0.2 2022-08-24 15:44:40 -04:00
Jacob Fletcher
8e02db10ae chore: updates README.md 2022-08-24 15:44:24 -04:00
Jacob Fletcher
44dd66cb72 feat: builds customers sync demo 2022-08-24 15:44:13 -04:00
Jacob Fletcher
713c6738aa feat: abstracts stripe proxy from route 2022-08-24 15:43:26 -04:00
James
5d18d2793a chore: readme 2022-08-24 11:46:40 -07:00
James
fe002cf9b2 1.0.7 2022-08-24 11:45:11 -07:00
James
434bdb72ab Merge branch 'master' of github.com:payloadcms/plugin-cloud-storage 2022-08-24 11:42:06 -07:00
James
5a802d0d94 feat: allows adapter to be set to null, which will fall back to local storage 2022-08-24 11:41:49 -07:00
Jacob Fletcher
f70a7b80fc chore: stripe rest api error handling 2022-08-24 11:34:22 -04:00
Jacob Fletcher
32665d11c5 0.0.1 2022-08-24 08:18:52 -04:00
Jacob Fletcher
1ed4c096a3 fix: type errors 2022-08-24 08:18:43 -04:00
James Mikrut
c4a492a62a Merge pull request #4 from echocrow/master
Fix Google Cloud Storage install instruction
2022-08-23 12:57:38 -07:00
Crow
e01473ec0c Fix Google Cloud Storage install instruction 2022-08-23 16:05:25 +02:00
James
97a3be87f3 1.0.6 2022-08-21 15:41:34 -07:00
James
aa2c48cb71 chore: yarn 2022-08-21 15:41:29 -07:00
James
ef31984e24 1.0.5 2022-08-21 15:39:05 -07:00
James
de37218c6b chore: updates gitignore 2022-08-21 15:38:45 -07:00
James
9d875332b0 Merge branch 'master' of github.com:payloadcms/plugin-cloud-storage 2022-08-21 15:37:36 -07:00
James Mikrut
c8d8f1fd73 Merge pull request #2 from afzaalahmad/feature/add-google-cloud-storage-adapter
feat: add google cloud storage adapter
2022-08-21 15:37:08 -07:00
afzaalahmad
ba29a5dd7a fix: dev build command 2022-08-20 13:35:27 +05:00
afzaalahmad
0c3b69795b update: README.md 2022-08-20 13:17:41 +05:00
afzaalahmad
3465f7c60d feat: add google cloud storage adapter 2022-08-20 13:10:29 +05:00
Jacob Fletcher
fe62871c75 1.0.8 2022-08-19 10:35:09 -04:00
Jacob Fletcher
741ba30513 chore: updates README 2022-08-19 10:34:44 -04:00
Jacob Fletcher
159d61e172 Merge pull request #9 from rsisson/main
feat: useTabbedUI
2022-08-19 10:20:40 -04:00
Riley
63240ca9ab change tabbedUi to tabbedUI 2022-08-19 09:19:02 -05:00
Jacob Fletcher
339ab3a838 fix: express type errors 2022-08-18 15:36:23 -04:00
Jacob Fletcher
cc9f9dd704 feat: opens stripe rest 2022-08-18 14:17:31 -04:00
Riley
6e85a1263d add new config param to readme, fix readme indentation 2022-08-17 18:40:57 -05:00
Riley
eec5fdcccf make tabbed interface opt-in via config 2022-08-17 18:35:41 -05:00
Jacob Fletcher
c13acfe47a feat: initial working draft 2022-08-17 18:11:59 -04:00
Jacob Fletcher
715e13b78e chore: scaffolds plugin 2022-08-17 13:58:41 -04:00
Riley
6d6fd11b04 use tabbed interface for better ux 2022-08-15 09:48:30 -05:00
Jacob Fletcher
27313995cc Merge pull request #5 from mikemoooo/patch-1
feat: localized breadcrumbs
2022-08-15 10:03:02 -04:00
Mike
93afe1d000 Support localised breadcrumbs 2022-08-15 15:51:28 +02:00
Jacob Fletcher
5979f72962 docs: adds globals config to README #7 2022-08-14 10:04:51 -04:00
Jacob Fletcher
7e93ab95d9 1.0.7 2022-08-14 09:54:09 -04:00
Jacob Fletcher
ae156a6679 feat: supports globals #7 2022-08-14 09:53:56 -04:00
Jacob Fletcher
cc9c012e3a docs: adds generateImage to readme #8 2022-08-14 09:45:24 -04:00
Jacob Fletcher
4bac60b959 Merge pull request #6 from kalon-robson/main
chore: bump payload to v1
2022-08-14 09:41:27 -04:00
Jacob Fletcher
790e401837 Merge pull request #3 from Kalmarv/patch-1
docs: readme syntax highlighting
2022-08-14 09:36:23 -04:00
Elliot DeNolf
d7b16dd88f feat: require latest payload as peer dep 2022-08-08 09:32:18 -04:00
Elliot DeNolf
6962fabb4e chore: update .gitignore, remove ignored 2022-08-08 09:28:10 -04:00
James
9705e351b3 chore: improves comments 2022-08-07 20:05:28 -04:00
James
45744b0eed 1.0.4 2022-08-07 19:47:05 -04:00
James
7c8f2b1855 chore: fixes adapter exports 2022-08-07 19:46:59 -04:00
James
a7c5d6476c 1.0.3 2022-08-07 19:36:54 -04:00
James
932fefcb7d chore: simplifies usage pattern for plugin 2022-08-07 19:36:48 -04:00
James
ae8342c3ed 1.0.2 2022-08-07 19:27:14 -04:00
James
ec24bb9e2a Merge branch 'master' of github.com:payloadcms/plugin-cloud-storage 2022-08-07 19:27:04 -04:00
James
e1a903d03e chore: fixes payload dependency requirement 2022-08-07 19:26:59 -04:00
James
2f822d517d feat: builds pattern to preserve payload access control 2022-08-07 19:26:30 -04:00
James Mikrut
02a5648ff9 Update README.md 2022-08-07 10:47:21 -04:00
James Mikrut
2ba244cb01 Update README.md 2022-08-07 10:46:59 -04:00
James Mikrut
fab1ea5338 Update README.md 2022-08-07 10:43:25 -04:00
James
ac9c6c5c6d 1.0.1 2022-08-07 10:39:47 -04:00
James
0a4745b869 feat: builds s3 adapter 2022-08-07 10:37:51 -04:00
James
bc0bb6c1b4 chore: credit 2022-08-06 16:15:42 -04:00
James
3aa0d3f3ee chore: simplifies the work an adapter has to do to delete files 2022-08-06 16:09:31 -04:00
James
1f570f97a4 chore: adds optional chaining in handleDelete 2022-08-06 16:02:19 -04:00
James
76067b4e50 chore: bumps payload 2022-08-06 15:51:51 -04:00
James
82293292a1 chore: ignores azure emulator mounted volume 2022-08-06 15:42:26 -04:00
James
ad9ccfd338 fix: ensures azure server-only dependencies are aliased 2022-08-06 15:36:29 -04:00
James
2b7547fbae feat: builds plugin with azure adapter 2022-08-06 14:49:46 -04:00
James
4e1da749c9 chore: init 2022-08-05 15:00:12 -04:00
Kalon Robson
8b8fccca04 chore: bump payload to v1 2022-07-25 19:52:10 +01:00
Caleb
fa119550ae Add syntax highlighting to readme 2022-07-19 14:19:03 -06:00
James
629e9d3faa 1.0.6 2022-07-16 14:32:54 -07:00
James
de0913d958 1.0.5 2022-07-16 14:32:36 -07:00
James
8e9577b8e7 feat: dark-mode friendly colors 2022-07-16 14:30:43 -07:00
James
e7ffa2638a 1.0.3 2022-07-11 15:19:02 -07:00
James
666765f3fb fix: further ensures resaving children works with drafts 2022-07-11 15:18:52 -07:00
James
fc14622555 1.0.2 2022-07-11 15:14:14 -07:00
James
0d83d83d3c feat: ensures drafts work 2022-07-11 15:14:09 -07:00
Jacob Fletcher
aab2f5f7d2 chore: updates README 2022-07-05 15:11:25 -04:00
Jacob Fletcher
2d5cd84314 chore: updates README 2022-07-05 15:10:54 -04:00
Jacob Fletcher
80b0d79342 1.0.0 2022-07-05 15:10:07 -04:00
Jacob Fletcher
3fc4bc43ac chore: updates payload and package scope 2022-07-05 15:09:50 -04:00
Jacob Fletcher
fbdc74ea71 chore: adds homepage and repository to package.json 2022-07-05 14:54:39 -04:00
Jacob Fletcher
c06c80e416 chore: adds homepage and repository to package.json 2022-07-05 14:54:25 -04:00
Jacob Fletcher
a0116685bd chore: adds homepage and repository to package.json 2022-07-05 14:54:16 -04:00
Jacob Fletcher
141e40ffb9 Merge branch 'main' of github.com:payloadcms/payload-plugin-nested-pages 2022-07-05 14:46:41 -04:00
Jacob Fletcher
bd2c1c6bf2 1.0.1 2022-07-05 14:46:27 -04:00
Jacob Fletcher
ba90fdbdfd feat: updates payload 2022-07-05 14:45:48 -04:00
Jacob Fletcher
22a0486f1c 1.0.4 2022-07-05 14:31:49 -04:00
Jacob Fletcher
3b03abdd78 1.0.3 2022-07-05 14:31:44 -04:00
Jacob Fletcher
b7c3899e38 Merge pull request #2 from payloadcms/feat/textarea-field
feat: adds textarea field
2022-07-05 14:15:27 -04:00
Jacob Fletcher
af4a41e219 1.0.7 2022-07-05 14:13:14 -04:00
Jacob Fletcher
5e59b5666c 1.0.6 2022-07-05 14:12:19 -04:00
Jacob Fletcher
a3105d3897 chore: updates payload 2022-07-05 14:11:32 -04:00
Jacob Fletcher
7a32f39c2c chore: updates payload peerDep 2022-07-05 13:54:26 -04:00
Jacob Fletcher
c4a09967f3 chore: adds build to .gitignore 2022-07-05 13:38:35 -04:00
Jacob Fletcher
dd8c7906da chore: renames textArea to textarea 2022-07-05 13:36:46 -04:00
Jacob Fletcher
c7bdf5eb43 chore: adds textarea documentation 2022-07-05 13:35:04 -04:00
Jacob Fletcher
3e0ba91c5b chore: removes required label from fields 2022-07-05 13:33:10 -04:00
Jessica Boezwinkle
6940f2c0b7 fix: updates payload 2022-07-05 18:24:11 +01:00
Jessica Boezwinkle
474436e9ab feat: add textarea field 2022-07-05 15:48:49 +01:00
James Mikrut
9991fdb8c8 Update README.md 2022-06-13 09:15:14 -04:00
Jacob Fletcher
15c9ce56c2 chore: updates package name 2022-05-27 10:25:15 -04:00
Jacob Fletcher
0306d01af9 1.0.2 2022-05-27 09:35:58 -04:00
Jacob Fletcher
02676bb421 feat: bumps payload to v0.17.2 2022-05-27 09:34:47 -04:00
Jacob Fletcher
911285db27 wip: migrates to payload v0.17.0 2022-05-17 09:06:13 -04:00
Patrik Kozak
3816431893 feat: adds email-from-name & reply-to-name fields to Emails 2022-05-13 12:49:41 -04:00
James
b8f62f6d52 1.0.5 2022-05-09 17:54:15 -04:00
James
3ca632bcbd fix: overwrites incoming config arrays within field overrides 2022-05-09 17:54:09 -04:00
James
a4032c49e9 1.0.4 2022-05-09 17:48:01 -04:00
James
7f89d404f8 1.0.3 2022-05-09 17:37:35 -04:00
James
c880a61f13 fix: allows form fields to be properly overridden 2022-05-09 17:37:21 -04:00
James
c3401be7c4 1.0.2 2022-05-04 11:39:24 -04:00
James
af8e283203 1.0.1 2022-05-04 11:38:26 -04:00
James
65d72b01f0 Merge branch 'main' of github.com:payloadcms/payload-plugin-form-builder 2022-05-04 11:38:15 -04:00
James
2bbe4286f6 fix: only populates redirect references if passed via config 2022-05-04 11:38:07 -04:00
James
d41dd8cc4a chore: merge 2022-05-04 11:28:24 -04:00
James
de9f9c16b2 chore: bumps version 2022-05-04 11:27:51 -04:00
James
e2cc1dcf17 chore: migrates to @payloadcms scope 2022-05-04 11:27:22 -04:00
Jacob Fletcher
b8eeea9ea1 chore: updates react peerDep 2022-05-04 11:17:45 -04:00
Jacob Fletcher
eecdd0e118 Merge branch 'main' of github.com:payloadcms/payload-plugin-nested-pages 2022-05-04 11:13:21 -04:00
Jacob Fletcher
f749732a0a 0.0.3 2022-05-04 11:13:07 -04:00
Jacob Fletcher
78e2b518cf chore: updates react peerDep 2022-05-04 11:12:09 -04:00
Jacob Fletcher
66fa70e275 0.0.6 2022-05-04 11:09:46 -04:00
Jacob Fletcher
6b31173ed0 chore: updates react peerDep 2022-05-04 11:09:29 -04:00
Jacob Fletcher
196a4574cb 0.0.5 2022-05-04 11:08:48 -04:00
Jacob Fletcher
313f42ef55 chore: updates react peerDep 2022-05-04 11:08:18 -04:00
James
91362587f0 chore: renames plugin 2022-05-04 10:48:36 -04:00
James
e1485b3600 chore: updates readme 2022-05-04 10:34:41 -04:00
James
9119087f71 chore: updates README 2022-05-04 10:28:04 -04:00
James
321c666dba chore: moves plugin to @payloadcms npm scope 2022-05-04 10:27:17 -04:00
Jacob Fletcher
f0e9b75a73 Merge pull request #3 from AlessioGr/patch-2
chore: fixes generateTitle example in README and adds screenshot
2022-04-30 15:28:02 -04:00
James
1ce678505b 1.0.7 2022-04-27 17:10:49 -04:00
James
4938602ee0 feat: utilizes unused replyTo 2022-04-27 17:10:38 -04:00
Jacob Fletcher
4dd3f131b0 1.0.6 2022-04-26 10:17:40 -04:00
Alessio Gravili
20e385b358 Add image 2022-04-18 19:49:18 +02:00
Alessio Gravili
3d3f5e3302 Fix incorrect generateTitle title value in README 2022-04-18 19:44:57 +02:00
Jacob Fletcher
a4c4fc7060 Merge pull request #1 from payloadcms/fix/disable-errors-breadcrumbs
fix: disables errors while populating breadcrumbs
2022-04-18 08:43:31 -04:00
Jacob Fletcher
268c66b907 Merge pull request #2 from AlessioGr/patch-1
fix: import path in README.md
2022-04-18 08:13:56 -04:00
Alessio Gravili
af23614ad6 Fix incorrect import in the README.md 2022-04-17 21:31:56 +02:00
James
db09f4839f fix: disables errors while populating breadcrumbs 2022-04-15 15:28:18 -04:00
Jacob Fletcher
e2b9e227a0 0.0.2 2022-04-10 12:52:01 -04:00
Jacob Fletcher
4f0bc2306f chore: logs mock email credentials and adds field placeholders 2022-04-10 12:51:46 -04:00
Jacob Fletcher
7ad4c26829 chore: bumps payload to v0.15.6 2022-04-10 12:28:35 -04:00
Jacob Fletcher
c71e079fae 0.0.2 2022-04-10 12:23:09 -04:00
Jacob Fletcher
b90785fa8c chore: bumps payload to v0.15.6 2022-04-10 12:22:54 -04:00
Jacob Fletcher
472bf4401e 0.0.5 2022-04-10 12:17:12 -04:00
Jacob Fletcher
77f7054832 chore: bumps payload to v0.15.6 2022-04-10 12:17:01 -04:00
Jacob Fletcher
4567e6fb0b 0.0.4 2022-04-10 12:10:23 -04:00
Jacob Fletcher
3a0658f0dd chore: bumps payload to v0.15.6 2022-04-10 12:09:09 -04:00
Jacob Fletcher
6e340f008f feat: initial working draft 2022-03-07 16:19:40 -05:00
Jacob Fletcher
1d3a9aee28 0.0.4 2022-03-07 12:40:38 -05:00
Jacob Fletcher
875d8dc27b feat: supports versions api 2022-03-07 12:40:12 -05:00
Jacob Fletcher
01d092b219 0.0.1 2022-03-04 15:26:25 -05:00
Jacob Fletcher
a8d432f7b3 fix: dynamic price selector 2022-03-04 15:26:20 -05:00
Jacob Fletcher
36a8dc49b3 fix: payment form submissions 2022-03-04 15:01:02 -05:00
Jacob Fletcher
e08e681eda chore: initializes standalone repository 2022-02-22 15:22:13 -05:00
Jacob Fletcher
0d26923d30 0.0.3 2022-02-22 14:58:57 -05:00
Jacob Fletcher
869215e65b feat: supports generateURL 2022-02-22 14:48:41 -05:00
Jacob Fletcher
064c141be1 fix: passes plugin config to custom components 2022-02-22 13:28:38 -05:00
Jacob Fletcher
1fe7ea936c 0.0.2 2022-02-21 15:14:46 -05:00
Jacob Fletcher
52d24d96db fix: image field and type errors 2022-02-21 15:05:38 -05:00
Jacob Fletcher
1a2a576aa8 feat: uses config provider to format linkToDoc 2022-02-21 08:31:49 -05:00
Jacob Fletcher
d1a04965f3 fix: payload config provider 2022-02-20 13:00:44 -05:00
Jacob Fletcher
2ba6bf69c1 chore: initializes standalone repository 2022-02-20 12:39:58 -05:00
Jacob Fletcher
274f19c269 0.0.2 2022-02-20 02:08:59 -05:00
Jacob Fletcher
41d80a959c fix: syncWithSearch args and return type 2022-02-20 02:08:41 -05:00
Jacob Fletcher
80da94c3e0 feat: enables defaultPriorities 2022-02-20 01:08:15 -05:00
Jacob Fletcher
27a3b8ca6d feat: attaches payload to beforeSync hook 2022-02-20 00:38:23 -05:00
Jacob Fletcher
7e44fa1010 feat: abstracts syncWithSearch 2022-02-19 23:44:02 -05:00
Jacob Fletcher
1b10111ba9 feat: builds plugin 2022-02-19 11:02:55 -05:00
Jacob Fletcher
2b01b9b41f 1.0.5 2022-02-18 18:18:11 -05:00
Jacob Fletcher
422b63a9f6 1.0.4 2022-02-18 18:17:42 -05:00
Jacob Fletcher
fbc216e667 chore: adds README 2022-02-18 18:17:37 -05:00
Jacob Fletcher
f0cc05ab91 fix: dynamic field selector option values 2022-02-18 13:22:12 -05:00
Jacob Fletcher
65a53c7d76 feat: builds getPaymentTotal utility 2022-02-18 13:21:41 -05:00
Jacob Fletcher
12c85d7707 feat: adds basePrice to payment field 2022-02-18 11:08:24 -05:00
Jacob Fletcher
4a31090388 feat: types payment field 2022-02-18 11:07:15 -05:00
Jacob Fletcher
6d76091fa1 chore: initializes standalone repository 2022-02-17 23:02:42 -05:00
Jacob Fletcher
3d8d043ab1 1.0.3 2022-02-17 21:09:05 -05:00
Jacob Fletcher
a7780b10d9 fix: fieldToUse options 2022-02-17 21:07:53 -05:00
Jacob Fletcher
b931072eed chore: bumps payload to v0.14.24-beta.0 2022-02-17 21:03:06 -05:00
Jacob Fletcher
dfabfc5227 1.0.2 2022-02-17 16:41:40 -05:00
Jacob Fletcher
8b69625b57 feat: configures tsc and fixes types 2022-02-17 16:41:31 -05:00
Jacob Fletcher
d4d05ae3f3 1.0.1 2022-02-17 15:30:18 -05:00
Jacob Fletcher
e15e00b5f1 fix: declares payload as a peer dependency 2022-02-17 15:30:06 -05:00
Jacob Fletcher
31efa57975 chore: ignores demo env 2022-02-17 13:58:05 -05:00
Jacob Fletcher
f05462efd3 feat: builds demo 2022-02-17 13:57:13 -05:00
Jacob Fletcher
92fa206fa4 chore: initializes standalone repository 2022-02-17 11:42:38 -05:00
Jacob Fletcher
b749f89c30 feat: dynamic pricing and payment handling #43 2022-02-17 11:09:26 -05:00
Jacob Fletcher
3b1b8ddc30 feat: restructures form builder #43 2022-02-09 18:05:00 -05:00
Jacob Fletcher
ec60147aff feat: integrates stripe api into form builder #43 2022-02-09 13:32:10 -05:00
Jacob Fletcher
2f00aef66c feat: adds payment fields to form builder #43 2022-02-09 12:09:40 -05:00
James
238db1750c fix: potential bug in breadcrumbs plugin 2022-01-31 16:18:46 -05:00
Jacob Fletcher
3db98e14dd feat: removes pipe from meta title #33 2022-01-21 12:31:21 -05:00
Jessica Boezwinkle
b4610a3fae fix: reduces richtext indent padding 2022-01-12 16:02:04 -05:00
Jessica Boezwinkle
ea22da4fc7 fix: updates richtext indentation within formbuilder 2022-01-12 16:00:31 -05:00
Jessica Boezwinkle
67df834f31 feat: adds indentation option to richText 2022-01-12 15:48:30 -05:00
Jessica Boezwinkle
3e4271474a merge conflicts 2022-01-10 14:41:53 -05:00
Jessica Boezwinkle
0152c91869 feat: adds max file size label to media fields 2022-01-10 14:40:10 -05:00
James
0962cd6fcb fix: allows breadcrumbs to populate without being passed full copy of page data 2022-01-07 18:34:40 -05:00
James
5b3d0fc0fe fix: unnecessary dependencies 2022-01-07 10:54:53 -05:00
James
f478fee9ea chore: bumps payload 2021-12-29 15:14:44 -05:00
Jacob Fletcher
2ccaa823e4 feat: omits irrelevant collections from rich text relationships 2021-12-16 14:04:18 -05:00
Jacob Fletcher
c2c2bb7f2d feat: adds image and video elements to sticky list and content grid rich text 2021-12-16 10:51:31 -05:00
Jacob Fletcher
8f0d85fe13 fix: form builder rich text serialization 2021-12-15 16:03:29 -05:00
Jacob Fletcher
7ce4f546a3 feat: form submission emails 2021-12-14 18:07:46 -05:00
Jacob Fletcher
db29b07b82 feat: form submission emails 2021-12-14 18:07:30 -05:00
Jacob Fletcher
3207202808 feat: supports form email variables and prepares for send 2021-12-14 13:21:07 -05:00
Jacob Fletcher
24a4bc6f19 feat: modifies form builder api 2021-12-13 12:03:28 -05:00
Jacob Fletcher
0acb49422d fix: adds error handling to meta title and prioritizes exerpt in meta description 2021-12-10 14:57:50 -05:00
Jacob Fletcher
e761eea4e6 fix: meta image upload field 2021-12-10 14:44:12 -05:00
Jacob Fletcher
d7015b5d5e fix: meta image generation 2021-12-10 14:43:56 -05:00
Jacob Fletcher
1f959f357c feat: includes subsite in meta title generation 2021-12-10 14:28:36 -05:00
Jacob Fletcher
f8f7a0893a fix: meta length indicator 2021-12-01 11:46:25 -05:00
Jacob Fletcher
8f389a5630 feat: improves meta description auto generation 2021-12-01 10:24:33 -05:00
Jacob Fletcher
1ed5fd551e fix: type errors 2021-11-30 13:40:06 -05:00
Jacob Fletcher
ce15725552 chore: bumps payload to v0.13.6 2021-11-30 13:37:36 -05:00
Jacob Fletcher
158920e57b fix: type errors 2021-11-30 11:12:47 -05:00
Jacob Fletcher
68580869ff chore: migrates payload to v0.13.5 2021-11-30 11:04:08 -05:00
Jacob Fletcher
31e0cbdce7 feat: refines seo descriptions 2021-11-19 12:15:15 -05:00
Jacob Fletcher
fc02b933bb feat: renames meta plugin to seo 2021-11-17 17:55:25 -05:00
James
6b436d38e1 fix: bug with breadcrumbs 2021-10-18 11:42:29 -04:00
James
ae93006446 chore: revises logs 2021-10-07 19:59:17 -04:00
James
fc722573bf chore: logging 2021-10-07 19:18:49 -04:00
James
3fdf23a1a0 fix: misc bugs with data safety 2021-09-15 17:47:12 -04:00
James
b72ba7fe86 feat: resaves page after create to properly generate breadcrumb 2021-09-14 11:47:17 -04:00
James
3dd777343b fix: ensures id is passed through to populateBreadcrumbs 2021-09-14 11:42:17 -04:00
James
f1f7592eb2 fix: big rip 2021-09-08 20:30:21 -04:00
James
3816589e8b fix: restricts depth to 0 in search sync ops 2021-09-08 20:15:11 -04:00
James
ba70b8065e feat: improves breadcrumbs performance 2021-09-08 19:01:05 -04:00
James
9b88a47a47 feat: attempts to optimize breadcrumbs 2021-09-01 18:14:18 -04:00
James
9a747bc1eb feat: adds alerts 2021-09-01 13:42:28 -04:00
James
f82723ef33 fix: reverts plugin back to beforeRead 2021-08-31 12:49:19 -04:00
James
897f7be0f7 feat: adds author and improves breadcrumbs 2021-08-31 12:43:09 -04:00
James
80f6c7ebe1 fix: cleans breadcrumb types 2021-08-31 12:33:53 -04:00
James
9da4151642 fix: breadcrumbs plugin beforeChange 2021-08-31 12:31:38 -04:00
James
b89cbe5715 fix: breadcrumbs, fullTitle, subsite 2021-08-30 17:08:56 -04:00
James
32a69f8f36 fix: form builder types 2021-08-27 11:48:06 -04:00
James
b398a92db4 fix: who can say 2021-08-26 17:21:24 -04:00
James
3c58e51d17 feat: extends form builder plugin 2021-08-26 17:07:45 -04:00
James
6e2f43394d feat: adds title to forms 2021-08-03 14:29:34 -04:00
James
725a1d35ef feat: revises breadcrumbs and subsites to rely on depth properly 2021-08-02 22:01:58 -04:00
James
2a2a2e3a2f feat: builds breadcrumbs plugin 2021-08-02 21:08:01 -04:00
James
2fbfb5d305 feat: builds breadcrumbs plugin 2021-08-02 21:08:01 -04:00
James
eeecbbedb6 feat: builds form builder plugin 2021-07-29 08:25:20 -04:00
1947 changed files with 192163 additions and 46103 deletions

View File

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

32
.github/CODEOWNERS vendored Normal file
View File

@@ -0,0 +1,32 @@
# Order matters. The last matching pattern takes precedence.
### Core ###
### Adapters ###
/packages/richtext-*/ @AlessioGr
### Plugins ###
/packages/plugin-cloud*/ @denolfe
### Templates ###
/templates/ @jacobsfletch @denolfe
### Misc ###
/packages/create-payload-app/ @denolfe
/packages/eslint-*/ @denolfe
### Build Files ###
/**/package.json @denolfe
/tsconfig.json @denolfe
/**/tsconfig*.json @denolfe
/jest.config.js @denolfe
/**/jest.config.js @denolfe
### Root ###
/package.json @denolfe
/scripts/ @denolfe
/.husky/ @denolfe
/.vscode/ @denolfe
/.github/ @denolfe

View File

@@ -0,0 +1,76 @@
name: Bug Report v3
description: Create a bug report for Payload v3 (beta)
labels: ['status: needs-triage', 'v3']
body:
- type: textarea
attributes:
label: Describe the Bug
validations:
required: true
- type: input
id: reproduction-link
attributes:
label: Link to the code that reproduces this issue
description: >-
Required: Please provide a link to your reproduction. Note, if the URL is invalid (404 or a private repository), we may close the issue.
Either use `npx create-payload-app@beta -t blank` or follow the [reproduction-guide](https://github.com/payloadcms/payload/blob/main/.github/reproduction-guide.md) for more information.
validations:
required: true
- type: textarea
attributes:
label: Reproduction Steps
description: Steps to reproduce the behavior, please provide a clear description of how to reproduce the issue, based on the linked minimal reproduction. Screenshots can be provided in the issue body below. If using code blocks, make sure that [syntax highlighting is correct](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/creating-and-highlighting-code-blocks#syntax-highlighting) and double check that the rendered preview is not broken.
validations:
required: true
- type: dropdown
attributes:
label: Which area(s) are affected? (Select all that apply)
multiple: true
options:
- 'Not sure'
- 'area: core'
- 'area: templates'
- 'area: ui'
- 'db-mongodb'
- 'db-postgres'
- 'db-sqlite'
- 'db-vercel-postgres'
- 'plugin: cloud'
- 'plugin: cloud-storage'
- 'plugin: form-builder'
- 'plugin: nested-docs'
- 'plugin: richtext-lexical'
- 'plugin: richtext-slate'
- 'plugin: search'
- 'plugin: sentry'
- 'plugin: seo'
- 'plugin: stripe'
- 'plugin: other'
validations:
required: true
- type: textarea
attributes:
label: Environment Info
description: Paste output from `pnpm payload info` (>= beta.92) _or_ Payload, Node.js, and Next.js versions.
render: bash
placeholder: |
Payload:
Node.js:
Next.js:
validations:
required: true
- 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.
- type: markdown
attributes:
value: Contributors should be able to follow the steps provided in order to reproduce the bug.
- type: markdown
attributes:
value: These steps are used to add integration tests to ensure the same issue does not happen again. Thanks in advance!

View File

@@ -1,6 +1,6 @@
name: Bug Report
description: Create a bug report for Payload
labels: ['possible-bug']
labels: ['status: needs-triage', 'v2']
body:
- type: markdown
attributes:
@@ -10,7 +10,12 @@ 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/main/.github/reproduction-guide.md) for more information.
description: Want us to look into your issue faster? Follow the [reproduction-guide](https://github.com/payloadcms/payload/blob/main/.github/reproduction-guide.md) for more information.
validations:
required: false
- type: textarea
attributes:
label: Describe the Bug
validations:
required: true
- type: textarea
@@ -19,11 +24,6 @@ body:
description: Steps to reproduce the behavior, please provide a clear description of how to reproduce the issue, based on the linked minimal reproduction. Screenshots can be provided in the issue body below. If using code blocks, make sure that [syntax highlighting is correct](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/creating-and-highlighting-code-blocks#syntax-highlighting) and double check that the rendered preview is not broken.
validations:
required: true
- type: textarea
attributes:
label: Describe the Bug
validations:
required: true
- type: input
id: version
attributes:

View File

@@ -1,23 +1,10 @@
## Description
<!--
<!-- Please include a summary of the pull request and any related issues it fixes. Please also include relevant motivation and context. -->
For external contributors, please include:
- [ ] I have read and understand the [CONTRIBUTING.md](https://github.com/payloadcms/payload/blob/main/CONTRIBUTING.md) document in this repository.
- A summary of the pull request and any related issues it fixes.
- Reasoning for the changes made or any additional context that may be useful.
## Type of change
Ensure you have read and understand the [CONTRIBUTING.md](https://github.com/payloadcms/payload/blob/main/CONTRIBUTING.md) document in this repository.
<!-- 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:
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] Existing test suite passes locally with my changes
- [ ] I have made corresponding changes to the documentation
-->

View File

@@ -0,0 +1,13 @@
module.exports = {
env: {
es6: true,
node: true,
},
extends: ['eslint:recommended', 'plugin:@typescript-eslint/eslint-recommended'],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2018,
sourceType: 'module',
},
plugins: ['@typescript-eslint'],
}

View File

@@ -0,0 +1,8 @@
module.exports = {
printWidth: 100,
parser: 'typescript',
semi: false,
singleQuote: true,
trailingComma: 'all',
arrowParens: 'avoid',
}

View File

@@ -0,0 +1,74 @@
# Release Commenter
This GitHub Action automatically comments on and/or labels Issues and PRs when a fix is released for them.
> [!IMPORTANT]
> 🔧 Heavily modified version of https://github.com/apexskier/github-release-commenter
## Fork Modifications
- Filters to closed PRs only
- Adds tag filter to support non-linear releases
- Better logging
- Moved to pnpm
- Uses @vercel/ncc for packaging
- Comments on locked issues by unlocking then re-locking
## How it works
Use this action in a workflow [triggered by a release](https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows#release). It will scan commits between that and the prior release, find associated Issues and PRs, and comment on them to let people know a release has been made. Associated Issues and PRs can be directly [linked](https://docs.github.com/en/free-pro-team@latest/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue) to the commit or manually linked from a PR associated with the commit.
## Inputs
**GITHUB_TOKEN**
A GitHub personal access token with repo scope, such as [`secrets.GITHUB_TOKEN`](https://docs.github.com/en/free-pro-team@latest/actions/reference/authentication-in-a-workflow#about-the-github_token-secret).
**comment-template** (optional)
Override the comment posted on Issues and PRs. Set to the empty string to disable commenting. Several variables strings will be automatically replaced:
- `{release_link}` - a markdown link to the release
- `{release_name}` - the release's name
- `{release_tag}` - the release's tag
**label-template** (optional)
Add the given label. Multiple labels can be separated by commas. Several variable strings will be automatically replaced:
- `{release_name}` - the release's name
- `{release_tag}` - the release's tag
**skip-label** (optional)
Skip processing if any of the given labels are present. Same processing rules as **label-template**. Default is "dependencies".
## Example
```yml
on:
release:
types: [published]
jobs:
release:
steps:
- uses: apexskier/github-release-commenter@v1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
comment-template: |
Release {release_link} addresses this.
```
## Known limitations
These are some known limitations of this action. I'd like to try to address them in the future.
- Non-linear releases aren't supported. For example, releasing a patch to a prior major release after a new major release has been bumped.
- Non-sequential releases aren't supported. For example, if you release multiple prereleases between two official releases, this will only create a comment for the first prerelease in which a fix is released, not the final release.
- The first release for a project will be ignored. This is intentional, as the use case is unlikely. Most projects will either have several alphas that don't need release comments, or won't use issues/PRs for the first commit.
- If a large number of things are commented on, you may see the error `Error: You have triggered an abuse detection mechanism. Please wait a few minutes before you try again.`. Consider using the `skip-label` input to reduce your load on the GitHub API.
## Versions
Workflows will automatically update the tags `v1` and `latest`, allowing you to reference one of those instead of locking to a specific release.

View File

@@ -0,0 +1,32 @@
name: Release Commenter
description: Comment on PRs and Issues when a fix is released
branding:
icon: message-square
color: blue
inputs:
GITHUB_TOKEN:
description: |
A GitHub personal access token with repo scope, such as
secrets.GITHUB_TOKEN.
required: true
comment-template:
description: |
Text template for the comment string.
required: false
default: |
Included in release {release_link}
label-template:
description: Add the given label. Multiple labels can be separated by commas.
required: false
skip-label:
description: Skip commenting if any of the given label are present. Multiple labels can be separated by commas.
required: false
default: "dependencies"
tag-filter:
description: |
Filter tags by a regular expression. Must be escaped. e.g. 'v\\d' to isolate tags between major versions.
required: false
default: null
runs:
using: node20
main: dist/index.js

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,7 @@
module.exports = {
testEnvironment: 'node',
testPathIgnorePatterns: ['/node_modules/', '<rootDir>/dist/'],
transform: {
'^.+\\.(t|j)sx?$': ['@swc/jest'],
},
}

View File

@@ -0,0 +1,34 @@
{
"name": "release-commenter",
"version": "0.0.0",
"description": "GitHub Action to automatically comment on PRs and Issues when a fix is released.",
"main": "dist/index.js",
"license": "MIT",
"private": true,
"scripts": {
"clean": "rimraf dist",
"build": "pnpm build:typecheck && pnpm build:ncc",
"build:ncc": "ncc build src/index.ts -t -o dist",
"build:typecheck": "tsc",
"test": "jest"
},
"dependencies": {
"@actions/core": "^1.3.0",
"@actions/github": "^5.0.0"
},
"devDependencies": {
"@octokit/webhooks-types": "^7.5.1",
"@swc/jest": "^0.2.36",
"@types/jest": "^27.5.2",
"@types/node": "^20.16.5",
"@typescript-eslint/eslint-plugin": "^4.33.0",
"@typescript-eslint/parser": "^4.33.0",
"@vercel/ncc": "0.38.1",
"concurrently": "^8.2.2",
"eslint": "^7.32.0",
"jest": "^29.7.0",
"prettier": "^3.3.3",
"ts-jest": "^26.5.6",
"typescript": "^4.9.5"
}
}

5419
.github/actions/release-commenter/pnpm-lock.yaml generated vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,266 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`tests feature tests can apply labels 1`] = `
[
[
{
"issue_number": 123,
"labels": [
":dart: landed",
"release-current_tag_name",
"Release Name",
],
},
],
[
{
"issue_number": 7,
"labels": [
":dart: landed",
"release-current_tag_name",
"Release Name",
],
},
],
]
`;
exports[`tests main test 1`] = `
{
"graphql": [MockFunction] {
"calls": [
[
"
{
resource(url: "http://repository/commit/SHA1") {
... on Commit {
messageHeadlineHTML
messageBodyHTML
associatedPullRequests(first: 10) {
pageInfo {
hasNextPage
}
edges {
node {
bodyHTML
number
state
labels(first: 10) {
pageInfo {
hasNextPage
}
nodes {
name
}
}
timelineItems(itemTypes: [CONNECTED_EVENT, DISCONNECTED_EVENT], first: 100) {
pageInfo {
hasNextPage
}
nodes {
... on ConnectedEvent {
__typename
isCrossRepository
subject {
... on Issue {
number
}
}
}
... on DisconnectedEvent {
__typename
isCrossRepository
subject {
... on Issue {
number
}
}
}
}
}
}
}
}
}
}
}
",
],
[
"
{
resource(url: "http://repository/commit/SHA2") {
... on Commit {
messageHeadlineHTML
messageBodyHTML
associatedPullRequests(first: 10) {
pageInfo {
hasNextPage
}
edges {
node {
bodyHTML
number
state
labels(first: 10) {
pageInfo {
hasNextPage
}
nodes {
name
}
}
timelineItems(itemTypes: [CONNECTED_EVENT, DISCONNECTED_EVENT], first: 100) {
pageInfo {
hasNextPage
}
nodes {
... on ConnectedEvent {
__typename
isCrossRepository
subject {
... on Issue {
number
}
}
}
... on DisconnectedEvent {
__typename
isCrossRepository
subject {
... on Issue {
number
}
}
}
}
}
}
}
}
}
}
}
",
],
],
"results": [
{
"type": "return",
"value": Promise {},
},
{
"type": "return",
"value": Promise {},
},
],
},
"rest": {
"issues": {
"addLabels": [MockFunction],
"createComment": [MockFunction] {
"calls": [
[
{
"body": "Included in release [current_tag_name](http://current_release). Replacements: current_tag_name, current_tag_name.",
"issue_number": 3,
},
],
[
{
"body": "Included in release [current_tag_name](http://current_release). Replacements: current_tag_name, current_tag_name.",
"issue_number": 123,
},
],
[
{
"body": "Included in release [current_tag_name](http://current_release). Replacements: current_tag_name, current_tag_name.",
"issue_number": 7,
},
],
],
"results": [
{
"type": "return",
"value": Promise {},
},
{
"type": "return",
"value": Promise {},
},
{
"type": "return",
"value": Promise {},
},
],
},
"get": [MockFunction] {
"calls": [
[
{
"issue_number": 3,
},
],
[
{
"issue_number": 123,
},
],
[
{
"issue_number": 7,
},
],
],
"results": [
{
"type": "return",
"value": Promise {},
},
{
"type": "return",
"value": Promise {},
},
{
"type": "return",
"value": Promise {},
},
],
},
},
"repos": {
"compareCommits": [MockFunction] {
"calls": [
[
{
"base": "prior_tag_name",
"head": "current_tag_name",
},
],
],
"results": [
{
"type": "return",
"value": Promise {},
},
],
},
"listReleases": [MockFunction] {
"calls": [
[
{
"per_page": 100,
},
],
],
"results": [
{
"type": "return",
"value": Promise {},
},
],
},
},
},
}
`;

View File

@@ -0,0 +1,399 @@
import type * as githubModule from '@actions/github'
import type * as coreModule from '@actions/core'
import { mock } from 'node:test'
jest.mock('@actions/core')
jest.mock('@actions/github')
type Mocked<T> = {
-readonly [P in keyof T]: T[P] extends Function ? jest.Mock<T[P]> : jest.Mocked<Partial<T[P]>>
}
const github = require('@actions/github') as jest.Mocked<Mocked<typeof githubModule>>
const core = require('@actions/core') as jest.Mocked<Mocked<typeof coreModule>>
describe('tests', () => {
let mockOctokit: any = {}
let currentTag: string = 'current_tag_name'
;(core.warning as any) = jest.fn(console.warn.bind(console))
;(core.error as any) = jest.fn(console.error.bind(console))
let commentTempate: string = ''
let labelTemplate: string | null = null
const skipLabelTemplate: string | null = 'skip,test'
let tagFilter: string | RegExp | null = null
let simpleMockOctokit: any = {}
beforeEach(() => {
tagFilter = null
currentTag = 'current_tag_name'
;(github.context as any) = {
payload: {
repo: {
owner: 'owner',
repo: 'repo',
},
release: {
tag_name: currentTag,
},
repository: { html_url: 'http://repository' },
},
}
github.getOctokit.mockReset().mockImplementationOnce(((token: string) => {
expect(token).toBe('GITHUB_TOKEN_VALUE')
return mockOctokit
}) as any)
;(core.getInput as any).mockImplementation((key: string) => {
if (key == 'GITHUB_TOKEN') {
return 'GITHUB_TOKEN_VALUE'
}
if (key == 'comment-template') {
return commentTempate
}
if (key == 'label-template') {
return labelTemplate
}
if (key == 'skip-label') {
return skipLabelTemplate
}
if (key == 'tag-filter') {
return tagFilter
}
fail(`Unexpected input key ${key}`)
})
commentTempate =
'Included in release {release_link}. Replacements: {release_name}, {release_tag}.'
labelTemplate = null
simpleMockOctokit = {
rest: {
issues: {
get: jest.fn(() => Promise.resolve({ data: { locked: false } })),
createComment: jest.fn(() => Promise.resolve()),
addLabels: jest.fn(() => Promise.resolve()),
},
repos: {
listReleases: jest.fn(() =>
Promise.resolve({
data: [
{
name: 'Release Name',
tag_name: 'current_tag_name',
html_url: 'http://current_release',
},
{
tag_name: 'prior_tag_name',
html_url: 'http://prior_release',
},
],
}),
),
compareCommits: jest.fn(() =>
Promise.resolve({
data: { commits: [{ sha: 'SHA1' }] },
}),
),
},
},
graphql: jest.fn(() =>
Promise.resolve({
resource: {
messageHeadlineHTML: '',
messageBodyHTML:
'<span class="issue-keyword tooltipped tooltipped-se" aria-label="This commit closes issue #123.">Closes</span> <p><span class="issue-keyword tooltipped tooltipped-se" aria-label="This pull request closes issue #7.">Closes</span>',
associatedPullRequests: {
pageInfo: { hasNextPage: false },
edges: [],
},
},
}),
),
}
})
afterEach(() => {
expect(core.error).not.toHaveBeenCalled()
expect(core.warning).not.toHaveBeenCalled()
expect(core.setFailed).not.toHaveBeenCalled()
})
test('main test', async () => {
mockOctokit = {
...simpleMockOctokit,
rest: {
issues: {
get: jest.fn(() => Promise.resolve({ data: { locked: false } })),
createComment: jest.fn(() => Promise.resolve()),
addLabels: jest.fn(() => Promise.resolve()),
},
repos: {
listReleases: jest.fn(() =>
Promise.resolve({
data: [
{
tag_name: 'current_tag_name',
html_url: 'http://current_release',
},
{
tag_name: 'prior_tag_name',
html_url: 'http://prior_release',
},
],
}),
),
compareCommits: jest.fn(() =>
Promise.resolve({
data: { commits: [{ sha: 'SHA1' }, { sha: 'SHA2' }] },
}),
),
},
},
graphql: jest.fn(() =>
Promise.resolve({
resource: {
messageHeadlineHTML:
'<span class="issue-keyword tooltipped tooltipped-se" aria-label="This commit closes issue #3.">Closes</span> <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="718013420" data-permission-text="Title is private" data-url="https://github.com/apexskier/github-release-commenter/issues/1" data-hovercard-type="issue" data-hovercard-url="/apexskier/github-release-commenter/issues/1/hovercard" href="https://github.com/apexskier/github-release-commenter/issues/1">#1</a>',
messageBodyHTML:
'<span class="issue-keyword tooltipped tooltipped-se" aria-label="This commit closes issue #123.">Closes</span> <p><span class="issue-keyword tooltipped tooltipped-se" aria-label="This pull request closes issue #7.">Closes</span>',
associatedPullRequests: {
pageInfo: { hasNextPage: false },
edges: [
{
node: {
bodyHTML:
'<span class="issue-keyword tooltipped tooltipped-se" aria-label="This commit closes issue #4.">Closes</span> <span class="issue-keyword tooltipped tooltipped-se" aria-label="This commit closes issue #5.">Closes</span>',
number: 9,
labels: {
pageInfo: { hasNextPage: false },
nodes: [{ name: 'label1' }, { name: 'label2' }],
},
timelineItems: {
pageInfo: { hasNextPage: false },
nodes: [
{
isCrossRepository: true,
__typename: 'ConnectedEvent',
subject: { number: 1 },
},
{
isCrossRepository: false,
__typename: 'ConnectedEvent',
subject: { number: 2 },
},
{
isCrossRepository: false,
__typename: 'DisconnectedEvent',
subject: { number: 2 },
},
{
isCrossRepository: false,
__typename: 'ConnectedEvent',
subject: { number: 2 },
},
],
},
},
},
{
node: {
bodyHTML: '',
number: 42,
labels: {
pageInfo: { hasNextPage: false },
nodes: [{ name: 'label1' }, { name: 'skip' }],
},
timelineItems: {
pageInfo: { hasNextPage: false },
nodes: [
{
isCrossRepository: true,
__typename: 'ConnectedEvent',
subject: { number: 82 },
},
],
},
},
},
],
},
},
}),
),
}
jest.isolateModules(() => {
require('./index')
})
await new Promise<void>(setImmediate)
expect(mockOctokit).toMatchSnapshot()
expect(mockOctokit.rest.issues.createComment).toHaveBeenCalledTimes(3)
})
describe('can filter tags', () => {
const v3prev = 'v3.0.1'
const v3current = 'v3.0.2'
const v2prev = 'v2.0.1'
const v2current = 'v2.0.2'
const listReleasesData = [
{
name: 'Current Release Name',
tag_name: v3current,
html_url: 'http://v3.0.2',
},
{
name: 'Prev Release Name',
tag_name: v3prev,
html_url: 'http://v3.0.1',
},
{
name: 'v2 Current Release Name',
tag_name: v2current,
html_url: 'http://v2.0.2',
},
{
name: 'v2 Prev Release Name',
tag_name: v2prev,
html_url: 'http://v2.0.1',
},
]
it.each`
description | prevTag | currentTag | filter
${'no filter'} | ${v3prev} | ${v3current} | ${null}
${'v3'} | ${v3prev} | ${v3current} | ${'v\\d'}
${'v2'} | ${v2prev} | ${v2current} | ${'v\\d'}
`('should filter tags with $description', async ({ prevTag, currentTag, filter }) => {
// @ts-ignore
github.context.payload.release.tag_name = currentTag
tagFilter = filter
mockOctokit = {
...simpleMockOctokit,
rest: {
issues: {
get: jest.fn(() => Promise.resolve({ data: { locked: false } })),
createComment: jest.fn(() => Promise.resolve()),
addLabels: jest.fn(() => Promise.resolve()),
},
repos: {
listReleases: jest.fn(() =>
Promise.resolve({
data: listReleasesData,
}),
),
compareCommits: jest.fn(() =>
Promise.resolve({
data: { commits: [{ sha: 'SHA1' }] },
}),
),
},
},
graphql: jest.fn(() =>
Promise.resolve({
resource: {
messageHeadlineHTML: '',
messageBodyHTML:
'<span class="issue-keyword tooltipped tooltipped-se" aria-label="This commit closes issue #123.">Closes</span> <p><span class="issue-keyword tooltipped tooltipped-se" aria-label="This pull request closes issue #7.">Closes</span>',
associatedPullRequests: {
pageInfo: { hasNextPage: false },
edges: [],
},
},
}),
),
}
jest.isolateModules(() => {
require('./index')
})
await new Promise<void>(resolve => setImmediate(() => resolve()))
expect(github.getOctokit).toHaveBeenCalled()
expect(mockOctokit.rest.repos.compareCommits.mock.calls).toEqual([
[{ base: prevTag, head: currentTag }],
])
})
})
describe('feature tests', () => {
beforeEach(() => {
mockOctokit = simpleMockOctokit
})
it('can disable comments', async () => {
commentTempate = ''
jest.isolateModules(() => {
require('./index')
})
await new Promise<void>(resolve => setImmediate(() => resolve()))
expect(github.getOctokit).toHaveBeenCalled()
expect(mockOctokit.rest.issues.createComment).not.toHaveBeenCalled()
})
it('should unlock and comment', async () => {
mockOctokit = {
...simpleMockOctokit,
rest: {
...simpleMockOctokit.rest,
issues: {
// Return locked for both issues to be commented on
get: jest.fn(() => Promise.resolve({ data: { locked: true } })),
lock: jest.fn(() => Promise.resolve()),
unlock: jest.fn(() => Promise.resolve()),
createComment: jest.fn(() => Promise.resolve()),
},
},
graphql: jest.fn(() =>
Promise.resolve({
resource: {
messageHeadlineHTML: '',
messageBodyHTML:
'<span class="issue-keyword tooltipped tooltipped-se" aria-label="This commit closes issue #123.">Closes</span> <p><span class="issue-keyword tooltipped tooltipped-se" aria-label="This pull request closes issue #7.">Closes</span>',
associatedPullRequests: {
pageInfo: { hasNextPage: false },
edges: [],
},
},
}),
),
}
jest.isolateModules(() => {
require('./index')
})
await new Promise<void>(resolve => setImmediate(() => resolve()))
expect(github.getOctokit).toHaveBeenCalled()
// Should call once for both linked issues
expect(mockOctokit.rest.issues.unlock).toHaveBeenCalledTimes(2)
expect(mockOctokit.rest.issues.createComment).toHaveBeenCalledTimes(2)
expect(mockOctokit.rest.issues.lock).toHaveBeenCalledTimes(2)
})
it.skip('can apply labels', async () => {
labelTemplate = ':dart: landed,release-{release_tag},{release_name}'
jest.isolateModules(() => {
require('./index')
})
await new Promise<void>(resolve => setImmediate(() => resolve()))
expect(github.getOctokit).toHaveBeenCalled()
expect(mockOctokit.rest.issues.addLabels.mock.calls).toMatchSnapshot()
})
})
})

View File

@@ -0,0 +1,349 @@
import * as core from '@actions/core'
import * as github from '@actions/github'
import type * as Webhooks from '@octokit/webhooks-types'
const closesMatcher = /aria-label="This (?:commit|pull request) closes issue #(\d+)\."/g
const releaseLinkTemplateRegex = /{release_link}/g
const releaseNameTemplateRegex = /{release_name}/g
const releaseTagTemplateRegex = /{release_tag}/g
;(async function main() {
try {
const payload = github.context.payload as Webhooks.EventPayloadMap['release']
const githubToken = core.getInput('GITHUB_TOKEN')
const tagFilter = core.getInput('tag-filter') || undefined // Accept tag filter as an input
const octokit = github.getOctokit(githubToken)
const commentTemplate = core.getInput('comment-template')
const labelTemplate = core.getInput('label-template') || null
const skipLabelTemplate = core.getInput('skip-label') || null
// Fetch the releases with the optional tag filter applied
const { data: rawReleases } = await octokit.rest.repos.listReleases({
...github.context.repo,
per_page: 100,
})
// Get the current release tag or latest tag
const currentTag = payload?.release?.tag_name || rawReleases?.[0]?.tag_name
let releases = rawReleases
// Filter releases by the tag filter if provided
if (tagFilter) {
core.info(`Filtering releases by tag filter: ${tagFilter}`)
// Get the matching part of the current release tag
const regexMatch = currentTag.match(tagFilter)?.[0]
if (!regexMatch) {
core.error(`Current release tag ${currentTag} does not match the tag filter ${tagFilter}`)
return
}
core.info(`Matched string from filter: ${regexMatch}`)
releases = releases
.filter(release => {
const match = release.tag_name.match(regexMatch)?.[0]
return match
})
.slice(0, 2)
}
core.info(`Releases: ${JSON.stringify(releases, null, 2)}`)
if (releases.length < 2) {
if (!releases.length) {
core.error(`No releases found with the provided tag filter: '${tagFilter}'`)
return
}
core.info('first release')
return
}
const [currentRelease, priorRelease] = releases
core.info(`${priorRelease.tag_name}...${currentRelease.tag_name}`)
const {
data: { commits },
} = await octokit.rest.repos.compareCommits({
...github.context.repo,
base: priorRelease.tag_name,
head: currentRelease.tag_name,
})
if (!currentRelease.name) {
core.info('Current release has no name, will fall back to the tag name.')
}
const releaseLabel = currentRelease.name || currentRelease.tag_name
const comment = commentTemplate
.trim()
.split(releaseLinkTemplateRegex)
.join(`[${releaseLabel}](${currentRelease.html_url})`)
.split(releaseNameTemplateRegex)
.join(releaseLabel)
.split(releaseTagTemplateRegex)
.join(currentRelease.tag_name)
const parseLabels = (rawInput: string | null) =>
rawInput
?.split(releaseNameTemplateRegex)
.join(releaseLabel)
?.split(releaseTagTemplateRegex)
.join(currentRelease.tag_name)
?.split(',')
?.map(l => l.trim())
.filter(l => l)
const labels = parseLabels(labelTemplate)
const skipLabels = parseLabels(skipLabelTemplate)
const linkedIssuesPrs = new Set<number>()
await Promise.all(
commits.map(commit =>
(async () => {
const query = `
{
resource(url: "${payload.repository.html_url}/commit/${commit.sha}") {
... on Commit {
messageHeadlineHTML
messageBodyHTML
associatedPullRequests(first: 10) {
pageInfo {
hasNextPage
}
edges {
node {
bodyHTML
number
state
labels(first: 10) {
pageInfo {
hasNextPage
}
nodes {
name
}
}
timelineItems(itemTypes: [CONNECTED_EVENT, DISCONNECTED_EVENT], first: 100) {
pageInfo {
hasNextPage
}
nodes {
... on ConnectedEvent {
__typename
isCrossRepository
subject {
... on Issue {
number
}
}
}
... on DisconnectedEvent {
__typename
isCrossRepository
subject {
... on Issue {
number
}
}
}
}
}
}
}
}
}
}
}
`
const response: {
resource: null | {
messageHeadlineHTML: string
messageBodyHTML: string
associatedPullRequests: {
pageInfo: { hasNextPage: boolean }
edges: ReadonlyArray<{
node: {
bodyHTML: string
number: number
state: 'OPEN' | 'CLOSED' | 'MERGED'
labels: {
pageInfo: { hasNextPage: boolean }
nodes: ReadonlyArray<{
name: string
}>
}
timelineItems: {
pageInfo: { hasNextPage: boolean }
nodes: ReadonlyArray<{
__typename: 'ConnectedEvent' | 'DisconnectedEvent'
isCrossRepository: boolean
subject: {
number: number
}
}>
}
}
}>
}
}
} = await octokit.graphql(query)
if (!response.resource) {
return
}
// core.info(JSON.stringify(response.resource, null, 2))
core.info(`Checking commit: ${payload.repository.html_url}/commit/${commit.sha}`)
const associatedClosedPREdges = response.resource.associatedPullRequests.edges.filter(
e => e.node.state === 'MERGED',
)
if (associatedClosedPREdges.length) {
core.info(
` Associated Merged PRs:\n ${associatedClosedPREdges.map(pr => `${payload.repository.html_url}/pull/${pr.node.number}`).join('\n ')}`,
)
} else {
core.info(' No associated merged PRs')
}
const html = [
response.resource.messageHeadlineHTML,
response.resource.messageBodyHTML,
...associatedClosedPREdges.map(pr => pr.node.bodyHTML),
].join(' ')
for (const match of html.matchAll(closesMatcher)) {
const [, num] = match
linkedIssuesPrs.add(parseInt(num, 10))
core.info(
` Linked issue/PR from closesMatcher: ${payload.repository.html_url}/pull/${num}`,
)
}
if (response.resource.associatedPullRequests.pageInfo.hasNextPage) {
core.warning(`Too many PRs associated with ${commit.sha}`)
}
const seen = new Set<number>()
for (const associatedPR of associatedClosedPREdges) {
if (associatedPR.node.timelineItems.pageInfo.hasNextPage) {
core.warning(`Too many links for #${associatedPR.node.number}`)
}
if (associatedPR.node.labels.pageInfo.hasNextPage) {
core.warning(`Too many labels for #${associatedPR.node.number}`)
}
// a skip labels is present on this PR
if (
skipLabels?.some(l => associatedPR.node.labels.nodes.some(({ name }) => name === l))
) {
continue
}
linkedIssuesPrs.add(associatedPR.node.number)
core.info(
` Linked issue/PR from associated PR: ${payload.repository.html_url}/pull/${associatedPR.node.number}`,
)
// These are sorted by creation date in ascending order. The latest event for a given issue/PR is all we need
// ignore links that aren't part of this repo
const links = associatedPR.node.timelineItems.nodes
.filter(node => !node.isCrossRepository)
.reverse()
for (const link of links) {
if (seen.has(link.subject.number)) {
continue
}
if (link.__typename == 'ConnectedEvent') {
linkedIssuesPrs.add(link.subject.number)
core.info(
`Linked issue/PR from connected event: ${payload.repository.html_url}/pull/${link.subject.number}`,
)
}
seen.add(link.subject.number)
}
}
})(),
),
)
core.info(
`Final issues/PRs to be commented on: \n${Array.from(linkedIssuesPrs)
.map(num => ` ${payload.repository.html_url}/pull/${num}`)
.join('\n')}`,
)
const requests: Array<Promise<unknown>> = []
for (const issueNumber of linkedIssuesPrs) {
const baseRequest = {
...github.context.repo,
issue_number: issueNumber,
}
if (comment) {
const commentRequest = {
...baseRequest,
body: comment,
}
// Check if issue is locked or not
const { data: issue } = await octokit.rest.issues.get(baseRequest)
let createCommentPromise: () => Promise<void>
if (!issue.locked) {
createCommentPromise = async () => {
try {
await octokit.rest.issues.createComment(commentRequest)
} catch (error) {
core.error(error as Error)
core.error(
`Failed to comment on issue/PR: ${issueNumber}. ${payload.repository.html_url}/pull/${issueNumber}`,
)
}
}
} else {
core.info(
`Issue/PR is locked: ${issueNumber}. Unlocking, commenting, and re-locking. ${payload.repository.html_url}/pull/${issueNumber}`,
)
createCommentPromise = async () => {
try {
core.debug(`Unlocking issue/PR: ${issueNumber}`)
await octokit.rest.issues.unlock(baseRequest)
core.debug(`Commenting on issue/PR: ${issueNumber}`)
await octokit.rest.issues.createComment(commentRequest)
core.debug(`Re-locking issue/PR: ${issueNumber}`)
await octokit.rest.issues.lock(baseRequest)
} catch (error) {
core.error(error as Error)
core.error(
`Failed to unlock, comment, and re-lock issue/PR: ${issueNumber}. ${payload.repository.html_url}/pull/${issueNumber}`,
)
}
}
}
requests.push(createCommentPromise())
}
if (labels) {
const request = {
...baseRequest,
labels,
}
// core.info(JSON.stringify(request, null, 2))
requests.push(octokit.rest.issues.addLabels(request))
}
}
await Promise.all(requests)
} catch (error) {
core.error(error as Error)
core.setFailed((error as Error).message)
}
})()

View File

@@ -0,0 +1,15 @@
{
"compilerOptions": {
"target": "es5",
"lib": ["es2020.string"],
"noEmit": true,
"strict": true,
"noUnusedLocals": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"forceConsistentCasingInFileNames": true,
"downlevelIteration": true,
"skipLibCheck": true,
},
"exclude": ["src/**/*.test.ts"]
}

View File

@@ -0,0 +1,18 @@
We cannot recreate the issue with the provided information. **Please add a reproduction in order for us to be able to investigate.**
### Why was this issue marked with the `invalid-reproduction` label?
To be able to investigate, we need access to a reproduction to identify what triggered the issue. We prefer a link to a public GitHub repository created with `create-payload-app@beta -t blank` or a forked/branched version of this repository with tests added (more info in the [reproduction-guide](https://github.com/payloadcms/payload/blob/main/.github/reproduction-guide.md)).
To make sure the issue is resolved as quickly as possible, please make sure that the reproduction is as **minimal** as possible. This means that you should **remove unnecessary code, files, and dependencies** that do not contribute to the issue. Ensure your reproduction does not depend on secrets, 3rd party registries, private dependencies, or any other data that cannot be made public. Avoid a reproduction including a whole monorepo (unless relevant to the issue). The easier it is to reproduce the issue, the quicker we can help.
Please test your reproduction against the latest version of Payload to make sure your issue has not already been fixed.
### I added a link, why was it still marked?
Ensure the link is pointing to a codebase that is accessible (e.g. not a private repository). "[example.com](http://example.com/)", "n/a", "will add later", etc. are not acceptable links -- we need to see a public codebase. See the above section for accepted links.
### Useful Resources
- [Reproduction Guide](https://github.com/payloadcms/payload/blob/main/.github/reproduction-guide.md)
- [Contributing to Payload](https://www.youtube.com/watch?v=08Qa3ggR9rw)

74
.github/dependabot.yml vendored Normal file
View File

@@ -0,0 +1,74 @@
# docs: https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
version: 2
updates:
- package-ecosystem: github-actions
directories:
- /
- /.github/workflows
- /.github/actions/* # Not working until resolved: https://github.com/dependabot/dependabot-core/issues/6345
- /.github/actions/setup
target-branch: beta
schedule:
interval: monthly
timezone: America/Detroit
time: '06:00'
groups:
github_actions:
patterns:
- '*'
- package-ecosystem: npm
directory: /
target-branch: beta
schedule:
interval: weekly
day: sunday
timezone: America/Detroit
time: '06:00'
commit-message:
prefix: 'chore(deps)'
labels:
- dependencies
groups:
production-deps:
dependency-type: production
update-types:
- minor
- patch
patterns:
- '*'
exclude-patterns:
- 'drizzle*'
dev-deps:
dependency-type: development
update-types:
- minor
- patch
patterns:
- '*'
exclude-patterns:
- 'drizzle*'
# Only bump patch versions for 2.x
- package-ecosystem: npm
directory: /
target-branch: main
schedule:
interval: weekly
day: sunday
timezone: America/Detroit
time: '06:00'
commit-message:
prefix: 'chore(deps)'
labels:
- dependencies
groups:
production-deps:
dependency-type: production
update-types:
- patch
patterns:
- '*'
exclude-patterns:
- 'drizzle*'

3977
.github/pnpm-lock.yaml generated vendored Normal file

File diff suppressed because it is too large Load Diff

2
.github/pnpm-workspace.yaml vendored Normal file
View File

@@ -0,0 +1,2 @@
packages:
- 'actions/*'

View File

@@ -1,10 +1,11 @@
# Reproduction Guide
1. [fork](https://github.com/payloadcms/payload/fork) this repo
2. run `yarn` to install dependencies
3. open up the `test/_community` directory
4. add any necessary `collections/globals/fields` in this directory to recreate the issue you are experiencing
5. run `yarn dev _community` to start the admin panel
1. [Fork](https://github.com/payloadcms/payload/fork) this repo
2. Optionally, create a new branch for your reproduction
3. Run `pnpm install` to install dependencies
4. Open up the `test/_community` directory
5. Add any necessary `collections/globals/fields` in this directory to recreate the issue you are experiencing
6. Run `pnpm dev _community` to start the admin panel
**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.
@@ -21,7 +22,7 @@
- `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.
@@ -44,7 +45,7 @@ There are a couple ways run integration tests:
- **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
```
### Running E2E tests (Admin Panel UI tests)
@@ -60,4 +61,4 @@ Once they are installed you can open the `testing` tab in vscode sidebar and dri
#### 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.
The default credentials are `dev@payloadcms.com` as email and `test` as password. They can be found in `test/credentials.ts`. By default, these will be autofilled, so no log-in is required.

80
.github/workflows/label-author.yml vendored Normal file
View File

@@ -0,0 +1,80 @@
name: label-author
on:
pull_request:
types: [opened]
issues:
types: [opened]
permissions:
contents: read
pull-requests: write
issues: write
jobs:
debug-context:
runs-on: ubuntu-latest
steps:
- name: View context attributes
uses: actions/github-script@v7
with:
script: console.log(context)
label-created-by:
name: Label pr/issue on opening
runs-on: ubuntu-latest
steps:
- name: Tag with 'created-by'
uses: actions/github-script@v7
if: github.event.action == 'opened'
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const payloadTeamUsernames = [
'denolfe',
'jmikrut',
'DanRibbens',
'jacobsfletch',
'JarrodMFlesch',
'AlessioGr',
'JessChowdhury',
'kendelljoseph',
'PatrikKozak',
'tylandavis',
'paulpopus',
];
const type = context.payload.pull_request ? 'pull_request' : 'issue';
const isTeamMember = payloadTeamUsernames
.map(n => n.toLowerCase())
.includes(context.payload[type].user.login.toLowerCase());
if (isTeamMember) {
github.rest.issues.addLabels({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: ['created-by: Payload team'],
});
console.log(`Added 'created-by: Payload team' label`);
return;
}
const association = context.payload[type].author_association;
let label = ''
if (association === 'MEMBER' || association === 'OWNER') {
label = 'created-by: Payload team';
} else if (association === 'CONTRIBUTOR') {
label = 'created-by: Contributor';
}
if (!label) return;
github.rest.issues.addLabels({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: [label],
});
console.log(`Added '${label}' label.`);

116
.github/workflows/label-on-change.yml vendored Normal file
View File

@@ -0,0 +1,116 @@
name: label-on-change
on:
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target
issues:
types:
- assigned
- closed
- labeled
- reopened
# TODO: Handle labeling on comment
jobs:
on-labeled-ensure-one-status:
runs-on: ubuntu-latest
permissions:
issues: write
# Only run on issue labeled and if label starts with 'status:'
if: github.event.action == 'labeled' && startsWith(github.event.label.name, 'status:')
steps:
- name: Ensure only one status label
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
// Get all labels that start with 'status:' and are not the incoming label
const incomingLabelName = context.payload.label.name;
const labelNamesToRemove = context.payload.issue.labels
.filter(label => label.name.startsWith('status:') && label.name !== incomingLabelName)
.map(label => label.name);
if (!labelNamesToRemove.length) {
console.log('No labels to remove');
return;
}
console.log(`Labels to remove: '${labelNamesToRemove}'`);
// If there is more than one status label, remove all but the incoming label
for (const labelName of labelNamesToRemove) {
await github.rest.issues.removeLabel({
issue_number: context.issue.number,
name: labelName,
owner: context.repo.owner,
repo: context.repo.repo,
});
console.log(`Removed '${labelName}' label`);
}
on-issue-close:
runs-on: ubuntu-latest
permissions:
issues: write
if: github.event.action == 'closed'
steps:
- name: Remove all labels on issue close
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
// Get all labels that start with 'status:' and 'stale'
const labelNamesToRemove = context.payload.issue.labels
.filter(label => label.name.startsWith('status:') || label.name === 'stale')
.map(label => label.name);
if (!labelNamesToRemove.length) {
console.log('No labels to remove');
return;
}
console.log(`Labels to remove: '${labelNamesToRemove}'`);
for (const labelName of labelNamesToRemove) {
await github.rest.issues.removeLabel({
issue_number: context.issue.number,
name: labelName,
owner: context.repo.owner,
repo: context.repo.repo,
});
console.log(`Removed '${labelName}' label`);
}
on-issue-reopen:
runs-on: ubuntu-latest
permissions:
issues: write
if: github.event.action == 'reopened'
steps:
- name: Add needs-triage label on issue reopen
uses: actions-ecosystem/action-add-labels@v1
with:
labels: 'status: needs-triage'
on-issue-assigned:
runs-on: ubuntu-latest
permissions:
issues: write
if: >
github.event.action == 'assigned' &&
contains(github.event.issue.labels.*.name, 'status: needs-triage')
steps:
- name: Remove needs-triage label on issue assign
uses: actions-ecosystem/action-remove-labels@v1
with:
labels: 'status: needs-triage'
# on-pr-merge:
# runs-on: ubuntu-latest
# if: github.event.pull_request.merged == true
# steps:
# on-pr-close:
# runs-on: ubuntu-latest
# if: github.event_name == 'pull_request_target' && github.event.pull_request.merged == false
# steps:

26
.github/workflows/lock-issues.yml vendored Normal file
View File

@@ -0,0 +1,26 @@
name: lock-issues
on:
schedule:
# Run nightly at 12am EST
- cron: '0 4 * * *'
workflow_dispatch:
permissions:
issues: write
jobs:
lock_issues:
runs-on: ubuntu-latest
steps:
- name: Lock issues
uses: dessant/lock-threads@v5
with:
process-only: 'issues'
issue-inactive-days: '1'
exclude-any-issue-labels: 'status: awaiting-reply'
log-output: true
issue-comment: >
This issue has been automatically locked.
Please open a new issue if this issue persists with any additional detail.

View File

@@ -2,12 +2,46 @@ name: build
on:
pull_request:
types: [opened, reopened, synchronize]
types: [ opened, reopened, synchronize ]
push:
branches: ['main']
branches: [ 'main' ]
jobs:
changes:
runs-on: ubuntu-latest
permissions:
pull-requests: read
outputs:
needs_build: ${{ steps.filter.outputs.needs_build }}
templates: ${{ steps.filter.outputs.templates }}
steps:
# https://github.com/actions/virtual-environments/issues/1187
- name: tune linux network
run: sudo ethtool -K eth0 tx off rx off
- uses: actions/checkout@v4
with:
fetch-depth: 25
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
needs_build:
- '.github/workflows/main.yml'
- 'packages/**'
- 'test/**'
- 'pnpm-lock.yaml'
- 'package.json'
templates:
- 'templates/**'
- name: Log all filter results
run: |
echo "needs_build: ${{ steps.filter.outputs.needs_build }}"
echo "templates: ${{ steps.filter.outputs.templates }}"
core-build:
needs: changes
if: ${{ needs.changes.outputs.needs_build == 'true' }}
runs-on: ubuntu-latest
steps:
@@ -15,15 +49,19 @@ jobs:
with:
fetch-depth: 25
- name: Use Node.js 18
uses: actions/setup-node@v3
# https://github.com/actions/virtual-environments/issues/1187
- name: tune linux network
run: sudo ethtool -K eth0 tx off rx off
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: 18
node-version: 20
- name: Install pnpm
uses: pnpm/action-setup@v2
uses: pnpm/action-setup@v3
with:
version: 8
version: 9.7.0
run_install: false
- name: Get pnpm store directory
@@ -31,7 +69,7 @@ jobs:
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v3
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
@@ -44,7 +82,7 @@ jobs:
- run: pnpm run build
- name: Cache build
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ./*
key: ${{ github.sha }}-${{ github.run_number }}
@@ -55,30 +93,41 @@ jobs:
strategy:
fail-fast: false
matrix:
database: [mongoose, postgres]
database: [mongoose, postgres, postgres-custom-schema, postgres-uuid, supabase]
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: payloadtests
AWS_ENDPOINT_URL: http://127.0.0.1:4566
AWS_ACCESS_KEY_ID: localstack
AWS_SECRET_ACCESS_KEY: localstack
AWS_REGION: us-east-1
steps:
- name: Use Node.js 18
uses: actions/setup-node@v3
# https://github.com/actions/virtual-environments/issues/1187
- name: tune linux network
run: sudo ethtool -K eth0 tx off rx off
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: 18
node-version: 20
- name: Install pnpm
uses: pnpm/action-setup@v2
uses: pnpm/action-setup@v3
with:
version: 8
version: 9.7.0
run_install: false
- name: Restore build
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ./*
key: ${{ github.sha }}-${{ github.run_number }}
- name: Start LocalStack
run: pnpm docker:start
- name: Start PostgreSQL
uses: CasperWA/postgresql-action@v1.2
with:
@@ -86,15 +135,40 @@ jobs:
postgresql db: ${{ env.POSTGRES_DB }}
postgresql user: ${{ env.POSTGRES_USER }}
postgresql password: ${{ env.POSTGRES_PASSWORD }}
if: matrix.database == 'postgres'
if: startsWith(matrix.database, 'postgres')
- name: Install Supabase CLI
uses: supabase/setup-cli@v1
with:
version: latest
if: matrix.database == 'supabase'
- name: Initialize Supabase
run: |
supabase init
supabase start
if: matrix.database == 'supabase'
- name: Wait for PostgreSQL
run: sleep 30
if: startsWith(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'
if: startsWith(matrix.database, 'postgres')
- name: Configure PostgreSQL with custom schema
run: |
psql "postgresql://$POSTGRES_USER:$POSTGRES_PASSWORD@localhost:5432/$POSTGRES_DB" -c "CREATE SCHEMA custom;"
if: matrix.database == 'postgres-custom-schema'
- name: Configure Supabase
run: |
echo "POSTGRES_URL=postgresql://postgres:postgres@127.0.0.1:54322/postgres" >> $GITHUB_ENV
if: matrix.database == 'supabase'
- name: Component Tests
run: pnpm test:components
@@ -102,6 +176,7 @@ jobs:
- name: Integration Tests
run: pnpm test:int
env:
NODE_OPTIONS: --max-old-space-size=8096
PAYLOAD_DATABASE: ${{ matrix.database }}
POSTGRES_URL: ${{ env.POSTGRES_URL }}
@@ -111,28 +186,37 @@ jobs:
strategy:
fail-fast: false
matrix:
part: [1/4, 2/4, 3/4, 4/4]
part: [ 1/8, 2/8, 3/8, 4/8, 5/8, 6/8, 7/8, 8/8 ]
steps:
- name: Use Node.js 18
uses: actions/setup-node@v3
# https://github.com/actions/virtual-environments/issues/1187
- name: tune linux network
run: sudo ethtool -K eth0 tx off rx off
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: 18
node-version: 20
- name: Install pnpm
uses: pnpm/action-setup@v2
uses: pnpm/action-setup@v3
with:
version: 8
version: 9.7.0
run_install: false
- name: Restore build
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ./*
key: ${{ github.sha }}-${{ github.run_number }}
- name: E2E Tests
run: pnpm test:e2e --part ${{ matrix.part }} --bail
uses: nick-fields/retry@v2
with:
retry_on: error
max_attempts: 2
timeout_minutes: 15
command: pnpm test:e2e --part ${{ matrix.part }} --bail
- uses: actions/upload-artifact@v3
if: always()
@@ -146,19 +230,23 @@ jobs:
needs: core-build
steps:
- name: Use Node.js 18
uses: actions/setup-node@v3
# https://github.com/actions/virtual-environments/issues/1187
- name: tune linux network
run: sudo ethtool -K eth0 tx off rx off
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: 18
node-version: 20
- name: Install pnpm
uses: pnpm/action-setup@v2
uses: pnpm/action-setup@v3
with:
version: 8
version: 9.7.0
run_install: false
- name: Restore build
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ./*
key: ${{ github.sha }}-${{ github.run_number }}
@@ -186,19 +274,23 @@ jobs:
- live-preview-react
steps:
- name: Use Node.js 18
uses: actions/setup-node@v3
# https://github.com/actions/virtual-environments/issues/1187
- name: tune linux network
run: sudo ethtool -K eth0 tx off rx off
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: 18
node-version: 20
- name: Install pnpm
uses: pnpm/action-setup@v2
uses: pnpm/action-setup@v3
with:
version: 8
version: 9.7.0
run_install: false
- name: Restore build
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ./*
key: ${{ github.sha }}-${{ github.run_number }}
@@ -213,23 +305,33 @@ jobs:
fail-fast: false
matrix:
pkg:
- plugin-cloud
- create-payload-app
- plugin-cloud
- plugin-cloud-storage
- plugin-form-builder
- plugin-nested-docs
- plugin-search
- plugin-sentry
- plugin-seo
steps:
- name: Use Node.js 18
uses: actions/setup-node@v3
# https://github.com/actions/virtual-environments/issues/1187
- name: tune linux network
run: sudo ethtool -K eth0 tx off rx off
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: 18
node-version: 20
- name: Install pnpm
uses: pnpm/action-setup@v2
uses: pnpm/action-setup@v3
with:
version: 8
version: 9.7.0
run_install: false
- name: Restore build
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ./*
key: ${{ github.sha }}-${{ github.run_number }}
@@ -240,3 +342,39 @@ jobs:
- name: Test ${{ matrix.pkg }}
run: pnpm --filter ${{ matrix.pkg }} run test
if: matrix.pkg != 'create-payload-app' # degit doesn't work within GitHub Actions
templates:
needs: changes
if: ${{ needs.changes.outputs.templates == 'true' }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
template: [ blank, website, ecommerce ]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 25
# https://github.com/actions/virtual-environments/issues/1187
- name: tune linux network
run: sudo ethtool -K eth0 tx off rx off
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: 20
- name: Start MongoDB
uses: supercharge/mongodb-github-action@1.10.0
with:
mongodb-version: 6.0
- name: Build Template
run: |
cd templates/${{ matrix.template }}
cp .env.example .env
yarn install
yarn build
yarn generate:types

32
.github/workflows/post-release.yml vendored Normal file
View File

@@ -0,0 +1,32 @@
name: post-release
on:
release:
types:
- published
workflow_dispatch:
jobs:
post_release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
# Only needed if debugging on a branch other than default
# ref: ${{ github.event.release.target_commitish || github.ref }}
- run: echo "npm_version=$(npm pkg get version | tr -d '"')" >> "$GITHUB_ENV"
- uses: ./.github/actions/release-commenter
continue-on-error: true
env:
ACTIONS_STEP_DEBUG: true
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
tag-filter: 'v\d'
# Change to blank to disable commenting
# comment-template: ''
comment-template: |
🚀 This is included in version {release_link}

11
.github/workflows/release-canary.yml vendored Normal file
View File

@@ -0,0 +1,11 @@
name: release-canary
on:
workflow_dispatch:
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Echo
run: echo "Register release-canary workflow"

42
.github/workflows/stale.yml vendored Normal file
View File

@@ -0,0 +1,42 @@
name: stale
on:
workflow_dispatch:
jobs:
stale:
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
- uses: actions/stale@v9
id: stale
with:
debug-only: true
days-before-stale: 90
days-before-close: 7
ascending: true
operations-per-run: 300
# Ignore all assigned
exempt-all-assignees: false
# Issues
stale-issue-label: 'stale'
exempt-issue-labels: 'blocked,must,should,keep,created-by: Payload team,created-by: Contributor'
stale-issue-message: >
This issue has been marked as stale due to lack of activity. To keep the ticket open, please indicate that it is still relevant in a comment below.
close-issue-message: >
This issue was automatically closed due to lack of activity.
# Pull Requests
stale-pr-label: 'stale'
exempt-pr-labels: 'blocked,must,should,keep,created-by: Payload team,created-by: Contributor'
stale-pr-message: >
This PR is stale due to lack of activity. To keep the PR open, please indicate that it is still relevant in a comment below.
close-pr-message: >
This pull request was automatically closed due to lack of activity.
- name: Print outputs
run: echo ${{ format('{0},{1}', toJSON(steps.stale.outputs.staled-issues-prs), toJSON(steps.stale.outputs.closed-issues-prs)) }}

29
.github/workflows/triage.yml vendored Normal file
View File

@@ -0,0 +1,29 @@
name: triage
on:
issues:
types:
- opened
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
permissions:
issues: write
jobs:
triage:
name: nissuer
if: false # Disable after adjusting scenarios which this should be applied
runs-on: ubuntu-latest
steps:
- uses: balazsorban44/nissuer@1.10.0
with:
label-area-prefix: ""
label-area-match: "name"
label-area-section: 'Which area\(s\) are affected\? \(Select all that apply\)(.*)### Environment Info'
reproduction-comment: '.github/comments/invalid-reproduction.md'
reproduction-blocklist: 'github.com/\\w*/?$,github.com$'
reproduction-link-section: '### Link to the code that reproduces this issue(.*)### Reproduction Steps'
reproduction-invalid-label: 'invalid-reproduction'
reproduction-issue-labels: 'status: needs-triage,'

107
.gitignore vendored
View File

@@ -1,10 +1,17 @@
coverage
package-lock.json
dist
.idea
/.idea/*
!/.idea/runConfigurations
# Custom actions
!.github/actions/**/dist
test-results
.devcontainer
.localstack
/migrations
.localstack
# 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
@@ -130,7 +137,6 @@ out
# Nuxt.js build / generate output
.nuxt
dist
# Gatsby files
.cache/
@@ -230,119 +236,24 @@ GitHub.sublime-settings
.history
.ionide
### 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
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf
# AWS User-specific
.idea/**/aws.xml
# Generated files
.idea/**/contentModel.xml
# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml
# Gradle
.idea/**/gradle.xml
.idea/**/libraries
# 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
# CMake
cmake-build-*/
# Mongo Explorer plugin
.idea/**/mongoSettings.xml
# File-based project format
*.iws
# IntelliJ
out/
# mpeltonen/sbt-idea plugin
.idea_modules/
# JIRA plugin
atlassian-ide-plugin.xml
# Cursive Clojure plugin
.idea/replstate.xml
# SonarLint plugin
.idea/sonarlint/
# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
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
# *.iml
# modules.xml
# .idea/misc.xml
# *.ipr
# Sonarlint plugin
# 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
@@ -371,4 +282,4 @@ $RECYCLE.BIN/
# End of https://www.toptal.com/developers/gitignore/api/node,macos,windows,webstorm,sublimetext,visualstudiocode
/build
/build

View File

@@ -0,0 +1,5 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Run Dev Fields" type="NodeJSConfigurationType" application-parameters="fields" path-to-js-file="node_modules/.pnpm/nodemon@3.0.3/node_modules/nodemon/bin/nodemon.js" working-dir="$PROJECT_DIR$">
<method v="2" />
</configuration>
</component>

View File

@@ -0,0 +1,5 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Run Dev _community" type="NodeJSConfigurationType" application-parameters="_community" path-to-js-file="node_modules/.pnpm/nodemon@3.0.3/node_modules/nodemon/bin/nodemon.js" working-dir="$PROJECT_DIR$">
<method v="2" />
</configuration>
</component>

View File

@@ -1,22 +0,0 @@
{
"verbose": true,
"git": {
"commitMessage": "chore(release): v${version}",
"requireCleanWorkingDir": true
},
"github": {
"release": true
},
"npm": {
"skipChecks": true
},
"hooks": {
"before:init": ["pnpm i", "pnpm clean", "pnpm test"]
},
"plugins": {
"@release-it/conventional-changelog": {
"preset": "angular",
"infile": "CHANGELOG.md"
}
}
}

16
.release-it.pre.js Normal file
View File

@@ -0,0 +1,16 @@
module.exports = {
verbose: true,
git: {
requireCleanWorkingDir: false,
commit: false,
push: false,
tag: false,
},
npm: {
skipChecks: true,
tag: 'beta',
},
hooks: {
'before:init': ['pnpm install', 'pnpm clean', 'pnpm build'],
},
}

View File

@@ -1,25 +0,0 @@
{
"verbose": true,
"git": {
"requireCleanWorkingDir": false,
"commit": false,
"push": false,
"tag": false
},
"github": {
"release": true
},
"npm": {
"skipChecks": true,
"tag": "canary"
},
"hooks": {
"before:init": ["pnpm i", "pnpm clean", "pnpm test"]
},
"plugins": {
"@release-it/conventional-changelog": {
"preset": "angular",
"infile": "CHANGELOG.md"
}
}
}

52
.vscode/launch.json vendored
View File

@@ -9,6 +9,23 @@
"request": "launch",
"type": "node-terminal"
},
{
"command": "pnpm run dev plugin-cloud-storage",
"cwd": "${workspaceFolder}",
"name": "Run Dev - plugin-cloud-storage",
"request": "launch",
"type": "node-terminal",
"env": {
"PAYLOAD_PUBLIC_CLOUD_STORAGE_ADAPTER": "s3"
}
},
{
"command": "pnpm run dev collections-graphql",
"cwd": "${workspaceFolder}",
"name": "Run Dev GraphQL",
"request": "launch",
"type": "node-terminal"
},
{
"command": "pnpm run dev fields",
"cwd": "${workspaceFolder}",
@@ -30,6 +47,27 @@
"request": "launch",
"type": "node-terminal"
},
{
"command": "pnpm run dev localization",
"cwd": "${workspaceFolder}",
"name": "Run Dev Localization",
"request": "launch",
"type": "node-terminal"
},
{
"command": "pnpm run dev field-error-states",
"cwd": "${workspaceFolder}",
"name": "Run Dev Field Error States",
"request": "launch",
"type": "node-terminal"
},
{
"command": "pnpm run dev uploads",
"cwd": "${workspaceFolder}",
"name": "Run Dev Uploads",
"request": "launch",
"type": "node-terminal"
},
{
"command": "PAYLOAD_BUNDLER=vite pnpm run dev fields",
"cwd": "${workspaceFolder}",
@@ -40,6 +78,20 @@
"NODE_ENV": "production"
}
},
{
"command": "pnpm run test:int live-preview",
"cwd": "${workspaceFolder}",
"name": "Live Preview Int Tests",
"request": "launch",
"type": "node-terminal"
},
{
"command": "pnpm run test:int plugin-search",
"cwd": "${workspaceFolder}",
"name": "Search Plugin Int Tests",
"request": "launch",
"type": "node-terminal"
},
{
"command": "ts-node ./packages/payload/src/bin/index.ts build",
"env": {

12
.vscode/settings.json vendored
View File

@@ -5,21 +5,21 @@
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
"source.fixAll.eslint": "explicit"
}
},
"[typescriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
"source.fixAll.eslint": "explicit"
}
},
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
"source.fixAll.eslint": "explicit"
}
},
"[json]": {
@@ -35,5 +35,9 @@
"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"]
"gitlens.advanced.blame.customArguments": ["--ignore-revs-file", ".git-blame-ignore-revs"],
"jestrunner.jestCommand": "pnpm exec cross-env NODE_OPTIONS=\"--experimental-vm-modules --no-deprecation\" node 'node_modules/jest/bin/jest.js'",
"jestrunner.debugOptions": {
"runtimeArgs": ["--experimental-vm-modules", "--no-deprecation"]
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -14,7 +14,7 @@ If you find a vulnerability within the core Payload repository, and we determine
## 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.
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
@@ -30,9 +30,17 @@ Our design review ensures that proposed changes fit seamlessly with other compon
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.
### Installation & Requirements
Payload is structured as a Monorepo, encompassing not only the core Payload platform but also various plugins and packages. To install all required dependencies, you have to run `pnpm install` once in the root directory. **PNPM IS REQUIRED!** Yarn or npm will not work - you will have to use pnpm to develop in the core repository. In most systems, the easiest way to install pnpm is to run `corepack enable` in your terminal.
If you're coming from a very outdated version of payload, it is recommended to nuke the node_modules folder before running pnpm install. On UNIX systems, you can easily do that using the `pnpm clean:unix` command, which will delete all node_modules folders and build artefacts.
It is also recommended to use at least Node v18 or higher. You can check your current node version by typing `node --version` in your terminal. The easiest way to switch between different node versions is to use [nvm](https://github.com/nvm-sh/nvm#intro).
### 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.
Most new functionality should keep testing in mind. 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.
@@ -49,21 +57,35 @@ A typical directory with `test/` will be structured like this:
- `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`.
- `payload-types.ts` - Generated types from `config.ts`. Generate this file by running `pnpm dev:generate-types my-test-dir`. Replace `my-test-dir` with the name of your testing directory.
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.
Each test directory is 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.
The following command will start Payload with your config: `pnpm dev my-test-dir`. Example: `pnpm dev fields` for the test/`fields` test suite. This command will start up Payload using your config and refresh a test database on every restart. If you're using VS Code, the most common run configs are automatically added to your editor - you should be able to find them in your VS Code launch tab.
By default, 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`.
By default, payload will [automatically log you in](https://payloadcms.com/docs/authentication/config#admin-autologin) with the default credentials. To disable that, you can either pass in the --no-auto-login flag (example: `pnpm dev my-test-dir --no-auto-login`) or set the `PAYLOAD_PUBLIC_DISABLE_AUTO_LOGIN` environment variable to `false`.
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:
The default credentials are `dev@payloadcms.com` as E-Mail and `test` as password. These are used in the auto-login.
### Testing with your own MongoDB database
If you wish to use your own MongoDB 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`.
- Simply set `process.env.NODE_ENV` to `test` and set `process.env.PAYLOAD_TEST_MONGO_URL` to your MongoDB 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.
### Using Postgres
If you have postgres installed on your system, you can also run the test suites using postgres. By default, mongodb is used.
To do that, simply set the `PAYLOAD_DATABASE` environment variable to `postgres`.
### Running the e2e and int tests
You can run the entire test suite using `pnpm test`. If you wish to only run e2e tests, you can use `pnpm test:e2e`. If you wish to only run int tests, you can use `pnpm test:int`.
By default, `pnpm test:int` will only run int test against MongoDB. To run int tests against postgres, you can use `pnpm test:int:postgres`. You will have to have postgres installed on your system for this to work.
### Commits
@@ -89,3 +111,14 @@ If you are committing to [templates](./templates) or [examples](./examples), use
## 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.
## Previewing docs
This is how you can preview changes you made locally to the docs:
1. Clone our [website repository](https://github.com/payloadcms/website)
2. Run `yarn install`
3. Duplicate the `.env.example` file and rename it to `.env`
4. Add a `DOCS_DIR` environment variable to the `.env` file which points to the absolute path of your modified docs folder. For example `DOCS_DIR=/Users/yourname/Documents/GitHub/payload/docs`
5. Run `yarn run fetchDocs:local`. If this was successful, you should see no error messages and the following output: *Docs successfully written to /.../website/src/app/docs.json*. There could be error messages if you have incorrect markdown in your local docs folder. In this case, it will tell you how you can fix it
6. You're done! Now you can start the website locally using `yarn run dev` and preview the docs under [http://localhost:3000/docs/](http://localhost:3000/docs/)

View File

@@ -1,24 +1,14 @@
<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>
<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 />
<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/main.yml?style=flat-square">
</a>
<a href="https://github.com/payloadcms/payload/actions"><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://discord.gg/payload">
<img alt="Discord" src="https://img.shields.io/discord/967097582721572934?label=Discord&color=7289da&style=flat-square" />
</a>
<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;
<a href="https://www.npmjs.com/package/payload">
<img alt="npm" src="https://img.shields.io/npm/v/payload?style=flat-square" />
</a>
<a href="https://www.npmjs.com/package/payload"><img alt="npm" src="https://img.shields.io/npm/v/payload?style=flat-square" /></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 Twitter" />
</a>
<a href="https://twitter.com/payloadcms"><img src="https://img.shields.io/badge/follow-payloadcms-1DA1F2?logo=twitter&style=flat-square" alt="Payload Twitter" /></a>
</p>
<hr/>
<h4>
@@ -27,7 +17,7 @@
<hr/>
> [!IMPORTANT]
> 🎉 <strong>Payload 2.0 is now available!<strong> Read more in the <a target="_blank" href="https://payloadcms.com/blog/payload-2-0" rel="dofollow"><strong>announcement post</strong></a>.
> 🎉 <strong>Payload 3.0 beta released!</strong> You can now deploy Payload fully in any Next.js app folder. Read more in the <a target="_blank" href="https://payloadcms.com/blog/30-beta-install-payload-into-any-nextjs-app-with-one-line" rel="dofollow"><strong>announcement post</strong></a>.
<h3>Benefits over a regular CMS</h3>
<ul>
@@ -51,7 +41,7 @@ Create a cloud account, connect your GitHub, and [deploy in minutes](https://pay
Before beginning to work with Payload, make sure you have all of the [required software](https://payloadcms.com/docs/getting-started/installation).
```text
npx create-payload-app
npx create-payload-app@latest
```
Alternatively, it only takes about five minutes to [create an app from scratch](https://payloadcms.com/docs/getting-started/installation#from-scratch).
@@ -109,6 +99,10 @@ If you want to add contributions to this repository, please follow the instructi
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.
If you'd like to run the examples, you can either copy them to a folder outside this repo or run them directly by (1) navigating to the example's subfolder (`cd examples/your-example-folder`) and (2) using the `--ignore-workspace` flag to bypass workspace restrictions (e.g., `pnpm --ignore-workspace install` or `pnpm --ignore-workspace dev`).
You can see more examples at:
- [Examples Directory](./examples)
- [Payload Blog](https://payloadcms.com/blog)
- [Payload YouTube](https://www.youtube.com/@payloadcms)

39
changelog.config.js Normal file
View File

@@ -0,0 +1,39 @@
module.exports = {
// gitRawCommitsOpts: {
// from: 'v2.0.9',
// path: 'packages/payload',
// },
// infile: 'CHANGELOG.md',
options: {
preset: {
name: 'conventionalcommits',
types: [
{ section: 'Features', type: 'feat' },
{ section: 'Features', type: 'feature' },
{ section: 'Bug Fixes', type: 'fix' },
{ section: 'Documentation', type: 'docs' },
],
},
},
// outfile: 'NEW.md',
writerOpts: {
commitGroupsSort: (a, b) => {
const groupOrder = ['Features', 'Bug Fixes', 'Documentation']
return groupOrder.indexOf(a.title) - groupOrder.indexOf(b.title)
},
// Scoped commits at the end, alphabetical sort
commitsSort: (a, b) => {
if (a.scope || b.scope) {
if (!a.scope) return -1
if (!b.scope) return 1
return a.scope === b.scope
? a.subject.localeCompare(b.subject)
: a.scope.localeCompare(b.scope)
}
// Alphabetical sort
return a.subject.localeCompare(b.subject)
},
},
}

View File

@@ -37,9 +37,12 @@ const defaultPayloadAccess = ({ req: { user } }) => {
<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>
whatever it needs. But, you can opt back in by setting the option
{' '}
<strong>
overrideAccess
</strong>{' '}
</strong>
{' '}
to <strong>false</strong>.
</Banner>

View File

@@ -27,14 +27,15 @@ You can override a set of admin panel-wide components by providing a component t
| **`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) |
| **`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) |
| **`actions`** | Array of custom components to be rendered in the Payload Admin UI header, providing additional interactivity and functionality. |
| **`views`** | Override or create new views within the Payload Admin UI. [More](#views) |
Here is a full example showing how to swap some of these components for your own.
@@ -50,6 +51,7 @@ import {
MyCustomAccount,
MyCustomDashboard,
MyProvider,
MyCustomAdminAction,
} from './customComponents'
export default buildConfig({
@@ -60,6 +62,7 @@ export default buildConfig({
Icon: MyCustomIcon,
Logo: MyCustomLogo,
},
actions: [MyCustomAdminAction],
views: {
Account: MyCustomAccount,
Dashboard: MyCustomDashboard,
@@ -72,7 +75,7 @@ export default buildConfig({
#### 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:
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 by default, all of which can be overridden:
| Property | Description |
| ------------------ | ---------------------------------------------------------------------------------------------------------------------------- |
@@ -96,7 +99,7 @@ To swap out any of these views, simply pass in your custom component to the `adm
}
```
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):
For more granular control, pass a configuration object instead. Each view corresponds to its own `<Route />` component in [React Router v5](https://v5.reactrouter.com). Payload exposes all of the properties of React Router:
| Property | Description |
| ------------------ | ---------------------------------------------------------------------------------------------------------------------------- |
@@ -129,13 +132,19 @@ To add a _new_ view to the Admin Panel, simply add another key to the `views` ob
}
```
<Banner type="warning">
<strong>Note:</strong>
<br />
Routes are cascading. This means that unless explicitly given the `exact` property, they will match on URLs that simply _start_ with the route's path. This is helpful when creating catch-all routes in your application. Alternatively, you could define your nested route _before_ your parent route.
</Banner>
_For more examples regarding how to customize components, look at the following [examples](https://github.com/payloadcms/payload/tree/main/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 their `admin` property.
You can override components on a collection-by-collection basis via the `admin.components` property.
| Path | Description |
| -------------------------- | ---------------------------------------------------------------------------------------------------------------------- |
@@ -159,12 +168,12 @@ import * as React from 'react'
import {
CustomSaveButtonProps,
CustomSaveDraftButtonProps,
CustomPublishButtonProps,
CustomPublishButtonType,
CustomPreviewButtonProps,
} from 'payload/types'
export const CustomSaveButton: CustomSaveButtonProps = ({ DefaultButton, label }) => {
return <DefaultButton label={label} />
export const CustomSaveButton: CustomSaveButtonProps = ({ DefaultButton, label, save }) => {
return <DefaultButton label={label} save={save} />
}
export const CustomSaveDraftButton: CustomSaveDraftButtonProps = ({
@@ -176,7 +185,7 @@ export const CustomSaveDraftButton: CustomSaveDraftButtonProps = ({
return <DefaultButton label={label} disabled={disabled} saveDraft={saveDraft} />
}
export const CustomPublishButton: CustomPublishButtonProps = ({
export const CustomPublishButton: CustomPublishButtonType = ({
DefaultButton,
disabled,
label,
@@ -211,7 +220,7 @@ export const MyCollection: SanitizedCollectionConfig = {
#### 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:
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 by default, all of which can be overridden:
| Property | Description |
| ------------------ | ---------------------------------------------------------------------------------------------------------------------------- |
@@ -237,7 +246,11 @@ To swap out any of these views, simply pass in your custom component to the `adm
_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.
**Customizing Nested Views within 'Edit' in Collections**
The `Edit` view in collections consists of several nested views, each serving a unique purpose. You can customize these nested views using the `admin.components.views.Edit` property in the collection's configuration. This approach allows you to replace specific nested views while keeping the overall structure of the `Edit` view intact, including the page breadcrumbs, title, tabs, etc.
Here's an example of how you can customize nested views within the `Edit` view in collections, including the use of the `actions` property:
```ts
// Collection.ts
@@ -247,7 +260,29 @@ To swap specific _nested_ views within the parent `Edit` view, you can use the `
components: {
views: {
Edit: {
Default: MyCustomDefaultTab,
Default: {
Component: MyCustomDefaultTab,
actions: [CollectionEditButton], // Custom actions for the default edit view
},
API: {
Component: MyCustomAPIView,
actions: [CollectionAPIButton], // Custom actions for API view
},
LivePreview: {
Component: MyCustomLivePreviewView,
actions: [CollectionLivePreviewButton], // Custom actions for Live Preview
},
Version: {
Component: MyCustomVersionView,
actions: [CollectionVersionButton], // Custom actions for Version view
},
Versions: {
Component: MyCustomVersionsView,
actions: [CollectionVersionsButton], // Custom actions for Versions view
},
},
List: {
actions: [CollectionListButton],
},
},
},
@@ -255,23 +290,25 @@ To swap specific _nested_ views within the parent `Edit` view, you can use the `
}
```
**Adding New Tabs to 'Edit' View**
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 the `admin.components` property.
| 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) |
| Path | Description |
| ------------------------------ | ---------------------------------------------------------------------------------------------------------------------- |
| **`elements.SaveButton`** | Replace the default `Save` button with a custom component. Drafts must be disabled |
| **`elements.SaveDraftButton`** | Replace the default `Save Draft` button with a custom component. Drafts must be enabled and autosave must be disabled. |
| **`elements.PublishButton`** | Replace the default `Publish` button with a custom component. Drafts must be enabled. |
| **`elements.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:
To swap out views for globals, you can use the `admin.components.views` property on the global's config. Payload renders the following views by default, all of which can be overridden:
| Property | Description |
| ------------------ | ---------------------------------------------------------------------------------------------------------------------------- |
@@ -295,7 +332,11 @@ To swap out any of these views, simply pass in your custom component to the `adm
_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.
**Customizing Nested Views within 'Edit' in Globals**
Similar to collections, Globals allow for detailed customization within the `Edit` view. This includes the ability to swap specific nested views while maintaining the overall structure of the `Edit` view. You can use the `admin.components.views.Edit` property in the Globals configuration to achieve this, and this will only replace the nested view, leaving the page breadcrumbs, title, and tabs intact.
Here's how you can customize nested views within the `Edit` view in Globals, including the use of the `actions` property:
```ts
// Global.ts
@@ -305,7 +346,26 @@ To swap specific _nested_ views within the parent `Edit` view, you can use the `
components: {
views: {
Edit: {
Default: MyCustomDefaultTab,
Default: {
Component: MyCustomGlobalDefaultTab,
actions: [GlobalEditButton], // Custom actions for the default edit view
},
API: {
Component: MyCustomGlobalAPIView,
actions: [GlobalAPIButton], // Custom actions for API view
},
LivePreview: {
Component: MyCustomGlobalLivePreviewView,
actions: [GlobalLivePreviewButton], // Custom actions for Live Preview
},
Version: {
Component: MyCustomGlobalVersionView,
actions: [GlobalVersionButton], // Custom actions for Version view
},
Versions: {
Component: MyCustomGlobalVersionsView,
actions: [GlobalVersionsButton], // Custom actions for Versions view
},
},
},
},
@@ -317,7 +377,7 @@ You can also add _new_ tabs to the `Edit` view by adding another key to the `com
### 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:
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 by default, all of which can be overridden:
| Property | Description |
| ------------------ | ---------------------------------------------------------------------------------------------------------------------------- |
@@ -426,6 +486,15 @@ All Payload fields support the ability to swap in your own React components. So,
| **`Cell`** | Used in the `List` view's table to represent a table-based preview of the data stored in the field. [More](#cell-component) |
| **`Field`** | Swap out the field itself within all `Edit` views. [More](#field-component) |
As an alternative to replacing the entire Field component, you may want to keep the majority of the default Field component and only swap components within. This allows you to replace the **`Label`** or **`Error`** within a field component or add additional components inside the field with **`beforeInput`** or **`afterInput`**. **`beforeInput`** and **`afterInput`** are allowed in any fields that don't contain other fields, except [UI](/docs/fields/ui) and [Rich Text](/docs/fields/rich-text).
| Component | Description |
| ----------------- | --------------------------------------------------------------------------------------------------------------- |
| **`Label`** | Override the default Label in the Field Component. [More](#label-component) |
| **`Error`** | Override the default Error in the Field Component. [More](#error-component) |
| **`beforeInput`** | An array of elements that will be added before `input`/`textarea` elements. [More](#afterinput-and-beforeinput) |
| **`afterInput`** | An array of elements that will be added after `input`/`textarea` elements. [More](#afterinput-and-beforeinput) |
## Cell Component
These are the props that will be passed to your custom Cell to use in your own components.
@@ -442,7 +511,9 @@ These are the props that will be passed to your custom Cell to use in your own c
```tsx
import React from 'react'
import type { Props } from 'payload/components/views/Cell'
import './index.scss'
const baseClass = 'custom-cell'
const CustomCell: React.FC<Props> = (props) => {
@@ -463,14 +534,13 @@ When swapping out the `Field` component, you'll be responsible for sending and r
```tsx
import { useField } from 'payload/components/forms'
type Props = { path: string }
const CustomTextField: React.FC<Props> = ({ path }) => {
const CustomTextField: React.FC<{ path: string }> = ({ path }) => {
// highlight-start
const { value, setValue } = useField<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} />
}
```
@@ -479,9 +549,106 @@ const CustomTextField: React.FC<Props> = ({ path }) => {
components, including the <strong>useField</strong> hook, [click here](/docs/admin/hooks).
</Banner>
## Label Component
These are the props that will be passed to your custom Label.
| Property | Description |
| ---------------- | ---------------------------------------------------------------- |
| **`htmlFor`** | Property used to set `for` attribute for label. |
| **`label`** | Label value provided in field, it can be used with i18n. |
| **`required`** | A boolean value that represents if the field is required or not. |
#### Example
```tsx
import React from 'react'
import { useTranslation } from 'react-i18next'
import { getTranslation } from 'payload/utilities/getTranslation'
type Props = {
htmlFor?: string
label?: Record<string, string> | false | string
required?: boolean
}
const CustomLabel: React.FC<Props> = (props) => {
const { htmlFor, label, required = false } = props
const { i18n } = useTranslation()
if (label) {
return (<span>
{getTranslation(label, i18n)}
{required && <span className="required">*</span>}
</span>);
}
return null
}
```
## Error Component
These are the props that will be passed to your custom Error.
| Property | Description |
| ---------------- | ------------------------------------------------------------- |
| **`message`** | The error message. |
| **`showError`** | A boolean value that represents if the error should be shown. |
#### Example
```tsx
import React from 'react'
type Props = {
message: string
showError?: boolean
}
const CustomError: React.FC<Props> = (props) => {
const { message, showError } = props
if (showError) {
return <p style={{color: 'red'}}>{message}</p>
} else return null;
}
```
## afterInput and beforeInput
With these properties you can add multiple components before and after the input element. For example, you can add an absolutely positioned button to clear the current field value.
#### Example
```tsx
import React from 'react'
import { Field } from 'payload/types'
import './style.scss'
const ClearButton: React.FC = () => {
return <button onClick={() => {/* ... */}}>X</button>
}
const titleField: Field = {
name: 'title',
type: 'text',
admin: {
components: {
afterInput: [ClearButton]
}
}
}
export default titleField;
```
## 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.
As your admin customizations gets more complex you may want to share state between fields or other components. You can add custom providers to 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
@@ -490,7 +657,7 @@ As your admin customizations gets more complex you may want to share state betwe
### Styling Custom Components
Payload exports its SCSS variables and mixins for reuse in your own custom components. This is helpful in cases where you might want to style a custom input similarly to Payload's built-ini styling, so it blends more thoroughly into the existing admin UI.
Payload exports its SCSS variables and mixins for reuse in your own custom components. This is helpful in cases where you might want to style a custom input similarly to Payload's built-in styling, so it blends more thoroughly into the existing admin UI.
To make use of Payload SCSS variables / mixins to use directly in your own components, you can import them as follows:

View File

@@ -91,14 +91,34 @@ This way when your bundler goes to import a file that contains server-only modul
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
In the Subscriptions config file above, we are importing the hook like so:
export default {}
```ts
// collections/Subscriptions/index.ts
import createStripeSubscription from './hooks/createStripeSubscription'
```
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:
By default the browser bundle will now include all the code from that file and any files down the tree. We know that the file imports `stripe`.
To fix this, we need to alias the `createStripeSubscription` file to a different file that can safely be included in the browser bundle.
First, we will create a mock file to replace the server-only file when bundling:
```js
// mocks/modules.js
export default {}
/**
* NOTE: if you are destructuring an import
* the mock file will need to export matching
* variables as the destructured object.
*
* export const namedExport = {}
*/
```
Aliasing with [Webpack](/docs/admin/webpack) can be done by:
```ts
// payload.config.ts
@@ -106,10 +126,16 @@ Then, in your Payload config, you can alias the file containing the server-only
import { buildConfig } from 'payload/config'
import { webpackBundler } from '@payloadcms/bundler-webpack'
import { Subscriptions } from './collections/Subscriptions'
const mockModulePath = path.resolve(__dirname, 'mocks/emptyObject.js')
const pathToFileWithServerOnlyModule = path.resolve(__dirname, 'hooks/syncStripeCustomer.ts')
const fullFilePath = path.resolve(
__dirname,
'collections/Subscriptions/hooks/createStripeSubscription'
)
export default buildConfig({
collections: [Subscriptions],
admin: {
bundler: webpackBundler(),
webpack: (config) => {
@@ -120,7 +146,7 @@ export default buildConfig({
// highlight-start
alias: {
...config.resolve.alias,
[pathToFileWithServerOnlyModule]: mockModulePath,
[fullFilePath]: mockModulePath,
},
// highlight-end
},
@@ -129,3 +155,52 @@ export default buildConfig({
},
})
```
Aliasing with [Vite](/docs/admin/vite) can be done by:
```ts
// payload.config.ts
import { buildConfig } from 'payload/config'
import { viteBundler } from '@payloadcms/bundler-vite'
import { Subscriptions } from './collections/Subscriptions'
const mockModulePath = path.resolve(__dirname, 'mocks/emptyObject.js')
export default buildConfig({
collections: [Subscriptions],
admin: {
bundler: viteBundler(),
vite: (incomingViteConfig) => {
const existingAliases = incomingViteConfig?.resolve?.alias || {};
let aliasArray: { find: string | RegExp; replacement: string; }[] = [];
// Pass the existing Vite aliases
if (Array.isArray(existingAliases)) {
aliasArray = existingAliases;
} else {
aliasArray = Object.values(existingAliases);
}
// highlight-start
// Add your own aliases using the find and replacement keys
// remember, vite aliases are exact-match only
aliasArray.push({
find: '../server-only-module',
replacement: path.resolve(__dirname, './path/to/browser-safe-module.js')
});
// highlight-end
return {
...incomingViteConfig,
resolve: {
...(incomingViteConfig?.resolve || {}),
alias: aliasArray,
}
};
},
},
})
```

View File

@@ -324,7 +324,7 @@ The `useForm` hook returns an object with the following properties: |
},
{
drawerTitle: 'addFieldRow',
drawerDescription: 'A useful method to programtically add a row to an array or block field.',
drawerDescription: 'A useful method to programmatically add a row to an array or block field.',
drawerSlug: 'addFieldRow',
drawerContent: (
<>
@@ -434,7 +434,7 @@ export const CustomArrayManager = () => {
},
{
drawerTitle: 'removeFieldRow',
drawerDescription: 'A useful method to programtically remove a row from an array or block field.',
drawerDescription: 'A useful method to programmatically remove a row from an array or block field.',
drawerSlug: 'removeFieldRow',
drawerContent: (
<>
@@ -531,7 +531,7 @@ export const CustomArrayManager = () => {
},
{
drawerTitle: 'replaceFieldRow',
drawerDescription: 'A useful method to programtically replace a row from an array or block field.',
drawerDescription: 'A useful method to programmatically replace a row from an array or block field.',
drawerSlug: 'replaceFieldRow',
drawerContent: (
<>
@@ -635,6 +635,37 @@ export const CustomArrayManager = () => {
]}
/>
### useCollapsible
The `useCollapsible` hook allows you to control parent collapsibles:
| Property | Description |
|---------------------------|--------------------------------------------------------------------------------------------------------------------|
| **`collapsed`** | State of the collapsible. `true` if open, `false` if collapsed |
| **`isVisible`** | If nested, determine if the nearest collapsible is visible. `true` if no parent is closed, `false` otherwise |
| **`toggle`** | Toggles the state of the nearest collapsible |
| **`withinCollapsible`** | Determine when you are within another collaspible | |
**Example:**
```tsx
import React from 'react'
import { useCollapsible } from 'payload/components/utilities'
const CustomComponent: React.FC = () => {
const { collapsed, toggle } = useCollapsible()
return (
<div>
<p className="field-type">I am {collapsed ? 'closed' : 'open'}</p>
<button onClick={toggle} type="button">
Toggle
</button>
</div>
)
}
```
### useDocumentInfo
The `useDocumentInfo` hook provides lots of information about the document currently being edited, including the following:
@@ -758,3 +789,85 @@ const MyComponent: React.FC = () => {
### usePreferences
Returns methods to set and get user preferences. More info can be found [here](https://payloadcms.com/docs/admin/preferences).
### useTheme
Returns the currently selected theme (`light`, `dark` or `auto`), a set function to update it and a boolean `autoMode`, used to determine if the theme value should be set automatically based on the user's device preferences.
```tsx
import { useTheme } from 'payload/components/utilities'
const MyComponent: React.FC = () => {
// highlight-start
const { autoMode, setTheme, theme } = useTheme()
// highlight-end
return (
<>
<span>The current theme is {theme} and autoMode is {autoMode}</span>
<button
type="button"
onClick={() => setTheme(prev => prev === "light" ? "dark" : "light")}
>
Toggle theme
</button>
</>
)
}
```
### useTableColumns
Returns methods to manipulate table columns
```tsx
import { useTableColumns } from 'payload/components/hooks'
const MyComponent: React.FC = () => {
// highlight-start
const { setActiveColumns } = useTableColumns()
const resetColumns = () => {
setActiveColumns(['id', 'createdAt', 'updatedAt'])
}
// highlight-end
return (
<button
type="button"
onClick={resetColumns}
>
Reset columns
</button>
)
}
```
### useDocumentEvents
The `useDocumentEvents` hook provides a way of subscribing to cross-document events, such as updates made to nested documents within a drawer. This hook will report document events that are outside the scope of the document currently being edited. This hook provides the following:
| Property | Description |
|---------------------------|-------------------------------------------------------------------------------------------------------------------------------------------|
| **`mostRecentUpdate`** | An object containing the most recently updated document. It contains the `entitySlug`, `id` (if collection), and `updatedAt` properties |
| **`reportUpdate`** | A method used to report updates to documents. It accepts the same arguments as the `mostRecentUpdate` property. |
**Example:**
```tsx
import { useDocumentEvents } from 'payload/components/hooks'
const ListenForUpdates: React.FC = () => {
const { mostRecentUpdate } = useDocumentEvents()
return (
<span>
{JSON.stringify(mostRecentUpdate)}
</span>
)
}
```
<Banner type="info">
Right now the `useDocumentEvents` hook only tracks recently updated documents, but in the future it will track more document-related events as needed, such as document creation, deletion, etc.
</Banner>

View File

@@ -5,6 +5,10 @@ order: 90
desc: NEEDS TO BE WRITTEN
---
<Banner type="info">
The Vite bundler is currently in beta. If you would like to help us test this package, we'd love to hear from you if you find any [bugs or issues](https://github.com/payloadcms/payload/issues/)!
</Banner>
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:
@@ -13,9 +17,19 @@ To use Vite as your bundler, first you need to install the package:
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>
Then you will need to add the [bundler](/docs/admin/bundlers) to your Payload config:
```ts
import { buildConfig } from '@payloadcms/config'
import { viteBundler } from '@payloadcms/bundler-vite'
export default buildConfig({
collections: [],
admin: {
bundler: viteBundler(),
}
})
```
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.
@@ -29,10 +43,53 @@ This is because Vite aliases work fundamentally differently than Webpack aliases
Here are the main differences between how Vite aliases work and how Webpack aliases work.
**Vite aliases do not work with absolute paths.**
**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.
In Vite, alias keys must <strong>exactly match</strong> a import paths. If you have 2 files that import the same server-only module, but have different import paths, you would need to add 2 aliases to support both import paths.
```ts
// File A
import serverOnlyModule from '../server-only-module'
// File B
import serverOnlyModule from '../../server-only-module'
// payload.config.ts
// You would need to add 2 aliases to support both import paths
export const buildConfig({
collections: [],
admin: {
bundler: viteBundler(),
vite: (incomingViteConfig) => {
const existingAliases = incomingViteConfig?.resolve?.alias || {};
let aliasArray: { find: string | RegExp; replacement: string; }[] = [];
// Pass the existing Vite aliases
if (Array.isArray(existingAliases)) {
aliasArray = existingAliases;
} else {
aliasArray = Object.values(existingAliases);
}
// Add your own aliases using the find and replacement keys
aliasArray.push({
find: '../server-only-module',
replacement: path.resolve(__dirname, './path/to/browser-safe-module.js')
find: '../../server-only-module',
replacement: path.resolve(__dirname, './path/to/browser-safe-module.js')
});
return {
...incomingViteConfig,
resolve: {
...(incomingViteConfig?.resolve || {}),
alias: aliasArray,
}
};
},
}
})
```
**Vite aliases do not get applied to pre-bundled dependencies.**
@@ -49,7 +106,8 @@ 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')
find: 'payload-plugin-cool',
replacement: path.resolve(__dirname, './my-admin-plugin.js')
}
```
@@ -58,7 +116,7 @@ This will effectively alias the entire plugin and work with Vite. If the plugin
### 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`.
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`. You can check out the [Vite docs](https://vitejs.dev/config/shared-options.html) for more information on what you can do with the Vite config.
It's a function that takes a Vite config, and returns an updated Vite config. Here's an example:
@@ -66,17 +124,38 @@ It's a function that takes a Vite config, and returns an updated Vite config. He
export const buildConfig({
collections: [],
admin: {
vite: (incomingViteConfig) => ({
...incomingViteConfig,
resolve: {
...incomingViteConfig.resolve,
// Do whatever you need here
bundler: viteBundler(),
vite: (incomingViteConfig) => {
const existingAliases = incomingViteConfig?.resolve?.alias || {};
let aliasArray: { find: string | RegExp; replacement: string; }[] = [];
// Pass the existing Vite aliases
if (Array.isArray(existingAliases)) {
aliasArray = existingAliases;
} else {
aliasArray = Object.values(existingAliases);
}
})
// Add your own aliases using the find and replacement keys
aliasArray.push({
find: '../server-only-module',
replacement: path.resolve(__dirname, './path/to/browser-safe-module.js')
});
return {
...incomingViteConfig,
resolve: {
...(incomingViteConfig?.resolve || {}),
alias: aliasArray,
}
};
},
}
})
```
Learn more about [aliasing server-only modules](https://payloadcms.com/docs/admin/excluding-server-code#aliasing-server-only-modules).
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.
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

@@ -45,6 +45,13 @@ To enable API keys on a collection, set the `useAPIKey` auth option to `true`. F
your API keys will not be.
</Banner>
<Banner type="warning">
<strong>Important:</strong>
If you change your `PAYLOAD_SECRET`, you will need to regenerate your API keys.
<br />
The secret key is used to encrypt the API keys, so if you change the secret, existing API keys will no longer be valid.
</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. By doing this, Payload recognizes the request being made as a request by the user associated with that API key.
@@ -209,7 +216,7 @@ Example:
{
slug: 'customers',
auth: {
forgotPassword: {
verify: {
// highlight-start
generateEmailSubject: ({ req, user }) => {
return `Hey ${user.email}, reset your password!`;

View File

@@ -191,7 +191,7 @@ mutation {
### Refresh
Allows for "refreshing" JWTs. If your user has a token that is about to expire, but the user is still active and using the app, you might want to use the `refresh` operation to receive a new token by sending the operation the token that is about to expire.
Allows for "refreshing" JWTs. If your user has a token that is about to expire, but the user is still active and using the app, you might want to use the `refresh` operation to receive a new token by executing this operation via the authenticated user.
This operation requires a non-expired token to send back a new one. If the user's token has already expired, you will need to allow them to log in again to retrieve a new token.
@@ -237,13 +237,6 @@ 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.
</Banner>
### Verify by Email
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.
@@ -290,6 +283,9 @@ const res = await fetch(`http://localhost:3000/api/[collection-slug]/unlock`, {
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
email: 'dev@payloadcms.com',
}),
})
```
@@ -297,7 +293,7 @@ const res = await fetch(`http://localhost:3000/api/[collection-slug]/unlock`, {
```
mutation {
unlock[collection-singular-label]
unlock[collection-singular-label](email: "dev@payloadcms.com")
}
```
@@ -306,6 +302,9 @@ mutation {
```ts
const result = await payload.unlock({
collection: '[collection-slug]',
data: {
email: 'dev@payloadcms.com',
},
})
```

View File

@@ -82,7 +82,7 @@ Once enabled, each document that is created within the Collection can be thought
### Token-based auth
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.
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: JWT` or `Authorization: Bearer` 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.

View File

@@ -30,6 +30,26 @@ Payload Cloud gives you S3 file storage backed by Cloudflare as a CDN, and this
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.
#### Accessing Files Outside of Payload Cloud
If you'd like to access your files outside of Payload Cloud, you'll need to retrieve some values from your project's settings and put them into your environment variables. In Payload Cloud, navigate to the File Storage tab and copy the values using the copy button. Put these values in your .env file. Also copy the Cognito Password value separately and put into your .env file as well.
When you are done, you should have the following values in your .env file:
```env
PAYLOAD_CLOUD=true
PAYLOAD_CLOUD_ENVIRONMENT=prod
PAYLOAD_CLOUD_COGNITO_USER_POOL_CLIENT_ID=
PAYLOAD_CLOUD_COGNITO_USER_POOL_ID=
PAYLOAD_CLOUD_COGNITO_IDENTITY_POOL_ID=
PAYLOAD_CLOUD_PROJECT_ID=
PAYLOAD_CLOUD_BUCKET=
PAYLOAD_CLOUD_BUCKET_REGION=
PAYLOAD_CLOUD_COGNITO_PASSWORD=
```
The plugin will pick up these values and use them to access your files.
### Build Settings
You can update settings from your Projects Settings tab. Changes to your build settings will trigger a redeployment of your project.

View File

@@ -30,6 +30,8 @@ It's often best practice to write your Collections in separate files and then im
| **`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) |
| **`dbName`** | Custom table or collection name depending on the database adapter. Auto-generated from slug if not defined. |
| **`db`** | Set custom database operations for this Collection. [More](/docs/database/overview#collection-operations) |
_\* An asterisk denotes that a property is required._
@@ -59,7 +61,8 @@ export const Orders: CollectionConfig = {
#### 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
of [example collection configs](https://github.com/payloadcms/public-demo/tree/master/src/payload/collections) in the
Public
Demo source code on GitHub.
### Admin options

View File

@@ -6,14 +6,18 @@ desc: Set up your Global config for your needs by defining fields, adding slugs
keywords: globals, config, configuration, documentation, Content Management System, cms, headless, javascript, node, react, express
---
Global configs are in many ways similar to [Collections](/docs/configuration/collections). The big difference is that Collections will potentially contain _many_ documents, while a Global is a "one-off". Globals are perfect for things like header nav, site-wide banner alerts, app-wide localized strings, and other "global" data that your site or app might rely on.
Global configs are in many ways similar to [Collections](/docs/configuration/collections). The big difference is that
Collections will potentially contain _many_ documents, while a Global is a "one-off". Globals are perfect for things
like header nav, site-wide banner alerts, app-wide localized strings, and other "global" data that your site or app
might rely on.
As with Collection configs, it's often best practice to write your Globals in separate files and then import them into the main Payload config.
As with Collection configs, it's often best practice to write your Globals 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 Global. |
| **`fields`** \* | Array of field types that will determine the structure and functionality of the data stored within this Global. [Click here](/docs/fields/overview) for a full list of field types as well as how to configure them. |
| **`label`** | Text for the name in the Admin panel or an object with keys for each language. Auto-generated from slug if not defined. |
@@ -26,6 +30,7 @@ As with Collection configs, it's often best practice to write your Globals in se
| **`graphQL.name`** | Text 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. |
| **`custom`** | Extension point for adding custom data (e.g. for plugins) |
| **`dbName`** | Custom table or collection name for this global depending on the database adapter. Auto-generated from slug if not defined.
_\* An asterisk denotes that a property is required._
@@ -59,26 +64,30 @@ export default Nav
#### Global config example
You can find an [example Global config](https://github.com/payloadcms/public-demo/blob/master/src/globals/MainMenu.ts) in the Public Demo source code on GitHub.
You can find a few [example Global configs](https://github.com/payloadcms/public-demo/tree/master/src/payload/globals)
in the Public Demo source code on GitHub.
### Admin options
You can customize the way that the Admin panel behaves on a Global-by-Global basis by defining the `admin` property on a Global's config.
You can customize the way that the Admin panel behaves on a Global-by-Global basis by defining the `admin` property on a
Global's config.
| Option | Description |
| ------------ | ----------------------------------------------------------------------------------------------------------------------------------------- |
| `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 global from navigation and admin routing. |
| `components` | Swap in your own React components to be used within this Global. [More](/docs/admin/components#globals) |
| `preview` | Function to generate a preview URL within the Admin panel for this global 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). |
| `hideAPIURL` | Hides the "API URL" meta field while editing documents within this collection. |
| Option | Description |
|---------------|-----------------------------------------------------------------------------------------------------------------------------------|
| `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 global from navigation and admin routing. |
| `components` | Swap in your own React components to be used within this Global. [More](/docs/admin/components#globals) |
| `preview` | Function to generate a preview URL within the Admin panel for this global 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). |
| `hideAPIURL` | Hides the "API URL" meta field while editing documents within this collection. |
### Preview
Global `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.
Global `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 global'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 global's Edit view.
Clicking the Preview button will link to the URL that is generated by the function.
**The preview function accepts two arguments:**
@@ -113,15 +122,20 @@ export const MyGlobal: GlobalConfig = {
### Access control
As with Collections, you can specify extremely granular access control (what users can do with this Global) on a Global-by-Global basis. However, Globals only have `update` and `read` access control due to their nature of only having one document. To learn more, go to the [Access Control](/docs/access-control/overview) docs.
As with Collections, you can specify extremely granular access control (what users can do with this Global) on a
Global-by-Global basis. However, Globals only have `update` and `read` access control due to their nature of only having
one document. To learn more, go to the [Access Control](/docs/access-control/overview) docs.
### Hooks
Globals also fully support a smaller subset of Hooks. To learn more, go to the [Hooks](/docs/hooks/overview) documentation.
Globals also fully support a smaller subset of Hooks. To learn more, go to the [Hooks](/docs/hooks/overview)
documentation.
### Field types
Globals 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.
Globals 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.
### TypeScript

View File

@@ -6,11 +6,13 @@ desc: Add and maintain as many locales as you need by adding Localization to you
keywords: localization, internationalization, i18n, config, configuration, documentation, Content Management System, cms, headless, javascript, node, react, express
---
Payload features deep field-based localization support. Maintaining as many locales as you need is easy. All localization support is opt-in by default. To do so, follow the two steps below.
Payload features deep field-based localization support. Maintaining as many locales as you need is easy. All
localization support is opt-in by default. To do so, follow the two steps below.
### Enabling in the Payload config
Add the `localization` property to your Payload config to enable localization project-wide. You'll need to provide a list of all locales that you'd like to support as well as set a few other options.
Add the `localization` property to your Payload config to enable localization project-wide. You'll need to provide a
list of all locales that you'd like to support as well as set a few other options.
**Example Payload config set up for localization:**
@@ -22,8 +24,8 @@ export default buildConfig({
// collections go here
],
localization: {
locales: ['en', 'es', 'de'],
defaultLocale: 'en',
locales: ['en', 'es', 'de'], // required
defaultLocale: 'en', // required
fallback: true,
},
})
@@ -47,11 +49,45 @@ export default buildConfig({
{
label: 'Arabic',
code: 'ar',
// opt-in to setting default text-alignment on Input fields to rtl (right-to-left) when current locale is rtl
// opt-in to setting default text-alignment on Input fields to rtl (right-to-left)
// when current locale is rtl
rtl: true,
},
],
defaultLocale: 'en',
defaultLocale: 'en', // required
fallback: true,
},
})
```
**Example Payload config set up for localization with full locales objects (
including [internationalization](/docs/configuration/i18n) support):**
```ts
import { buildConfig } from 'payload/config'
export default buildConfig({
collections: [
// collections go here
],
localization: {
locales: [
{
label: {
en: 'English', // English label
nb: 'Engelsk', // Norwegian label
},
code: 'en',
},
{
label: {
en: 'Norwegian', // English label
nb: 'Norsk', // Norwegian label
},
code: 'nb',
},
],
defaultLocale: 'en', // required
fallback: true,
},
})
@@ -61,19 +97,38 @@ export default buildConfig({
**`locales`**
Array-based list of all locales that you would like to support. These can be strings of locale codes or objects with a `label`, a locale `code`, and the `rtl` (right-to-left) property. The locale codes do not need to be in any specific format. It's up to you to define how to represent your locales. Common patterns are to use two-letter ISO 639 language codes or four-letter language and country codes (ISO 31661) such as `en-US`, `en-UK`, `es-MX`, etc.
Array-based list of all the languages that you would like to support. This can be an array containing strings for each
language code you want your project to store and serve or objects with a `label`, a locale `code`, `rtl` (
right-to-left), and `fallbackLocale` property. The locale codes do not need to be in any specific format. It's up to you
to define how to represent your locales. Common patterns are to use two-letter ISO 639 language codes or four-letter
language and country codes (ISO 31661) such as `en-US`, `en-UK`, `es-MX`, etc.
### Locale Properties:
| Option | Description |
|----------------------|--------------------------------------------------------------------------------------------------------------------------------|
| **`code`** \* | Unique code to identify the language throughout the APIs for `locale` and `fallbackLocale` |
| **`label`** | A string to use for the selector when choosing a language, or an object keyed on the i18n keys for different languages in use. |
| **`rtl`** | A boolean that when true will make the admin UI display in Right-To-Left. |
| **`fallbackLocale`** | The code for this language to fallback to when properties of a document are not present. |
_\* An asterisk denotes that a property is required._
**`defaultLocale`**
Required string that matches one of the locale codes from the array provided. By default, if no locale is specified, documents will be returned in this locale.
Required string that matches one of the locale codes from the array provided. By default, if no locale is specified,
documents will be returned in this locale.
**`fallback`**
Boolean enabling "fallback" locale functionality. If a document is requested in a locale, but a field does not have a localized value corresponding to the requested locale, then if this property is enabled, the document will automatically fall back to the fallback locale value. If this property is not enabled, the value will not be populated.
Boolean enabling "fallback" locale functionality. If a document is requested in a locale, but a field does not have a
localized value corresponding to the requested locale, then if this property is enabled, the document will automatically
fall back to the fallback locale value. If this property is not enabled, the value will not be populated.
### Field by field localization
Payload localization works on a **field** level—not a document level. In addition to configuring the base Payload config to support localization, you need to specify each field that you would like to localize.
Payload localization works on a **field** level—not a document level. In addition to configuring the base Payload config
to support localization, you need to specify each field that you would like to localize.
**Here is an example of how to enable localization for a field:**
@@ -87,9 +142,11 @@ Payload localization works on a **field** level—not a document level. In addit
}
```
With the above configuration, the `title` field will now be saved in the database as an object of all locales instead of a single string.
With the above configuration, the `title` field will now be saved in the database as an object of all locales instead of
a single string.
All field types with a `name` property support the `localized` property—even the more complex field types like `array`s and `block`s.
All field types with a `name` property support the `localized` property—even the more complex field types like `array`s
and `block`s.
<Banner>
<strong>Note:</strong>
@@ -111,7 +168,8 @@ All field types with a `name` property support the `localized` property—even t
### Retrieving localized docs
When retrieving documents, you can specify which locale you'd like to receive as well as which fallback locale should be used.
When retrieving documents, you can specify which locale you'd like to receive as well as which fallback locale should be
used.
##### REST API
@@ -123,7 +181,8 @@ Specify your desired locale by providing the `locale` query parameter directly i
**`?fallback-locale=`**
Specify fallback locale to be used by providing the `fallback-locale` query parameter. This can be provided as either a valid locale as provided to your base Payload config, or `'null'`, `'false'`, or `'none'` to disable falling back.
Specify fallback locale to be used by providing the `fallback-locale` query parameter. This can be provided as either a
valid locale as provided to your base Payload config, or `'null'`, `'false'`, or `'none'` to disable falling back.
**Example:**
@@ -135,7 +194,9 @@ fetch('https://localhost:3000/api/pages?locale=es&fallback-locale=none');
In the GraphQL API, you can specify `locale` and `fallbackLocale` args to all relevant queries and mutations.
The `locale` arg will only accept valid locales, but locales will be formatted automatically as valid GraphQL enum values (dashes or special characters will be converted to underscores, spaces will be removed, etc.). If you are curious to see how locales are auto-formatted, you can use the [GraphQL playground](/docs/graphql/overview#graphql-playground).
The `locale` arg will only accept valid locales, but locales will be formatted automatically as valid GraphQL enum
values (dashes or special characters will be converted to underscores, spaces will be removed, etc.). If you are curious
to see how locales are auto-formatted, you can use the [GraphQL playground](/docs/graphql/overview#graphql-playground).
The `fallbackLocale` arg will accept valid locales as well as `none` to disable falling back.
@@ -143,11 +204,11 @@ The `fallbackLocale` arg will accept valid locales as well as `none` to disable
```graphql
query {
Posts(locale: de, fallbackLocale: none) {
docs {
title
Posts(locale: de, fallbackLocale: none) {
docs {
title
}
}
}
}
```
@@ -159,7 +220,9 @@ query {
##### Local API
You can specify `locale` as well as `fallbackLocale` within the Local API as well as properties on the `options` argument. The `locale` property will accept any valid locale, and the `fallbackLocale` property will accept any valid locale as well as `'null'`, `'false'`, `false`, and `'none'`.
You can specify `locale` as well as `fallbackLocale` within the Local API as well as properties on the `options`
argument. The `locale` property will accept any valid locale, and the `fallbackLocale` property will accept any valid
locale as well as `'null'`, `'false'`, `false`, and `'none'`.
**Example:**

View File

@@ -108,7 +108,7 @@ export default buildConfig({
#### Full example config
You can see a full [example config](https://github.com/payloadcms/public-demo/blob/master/src/payload.config.ts) in the Public Demo source code on GitHub.
You can see a full [example config](https://github.com/payloadcms/public-demo/blob/master/src/payload/payload.config.ts) in the Public Demo source code on GitHub.
### Using environment variables in your config

View File

@@ -6,7 +6,8 @@ keywords: database, migrations, ddl, sql, mongodb, postgres, documentation, Cont
desc: Payload features first-party database migrations all done in TypeScript.
---
Payload exposes a full suite of migration controls available for your use. Migration commands are accessible via the `npm run payload` command in your project directory.
Payload exposes a full suite of migration controls available for your use. Migration commands are accessible via
the `npm run payload` command in your project directory.
Ensure you have an npm script called "payload" in your `package.json` file.
@@ -24,29 +25,44 @@ Ensure you have an npm script called "payload" in your `package.json` file.
### Migration file contents
Payload stores all created migrations in a folder that you can specify. By default, migrations are stored in `./src/migrations`.
Payload stores all created migrations in a folder that you can specify. By default, migrations are stored
in `./src/migrations`.
A migration file has two exports - an `up` function, which is called when a migration is executed, and a `down` function that will be called if for some reason the migration fails to complete successfully. The `up` function should contain all changes that you attempt to make within the migration, and the `down` should ideally revert any changes you make.
A migration file has two exports - an `up` function, which is called when a migration is executed, and a `down` function
that will be called if for some reason the migration fails to complete successfully. The `up` function should contain
all changes that you attempt to make within the migration, and the `down` should ideally revert any changes you make.
For an added level of safety, migrations should leverage Payload [transactions](/docs/database/transactions).
For an added level of safety, migrations should leverage Payload [transactions](/docs/database/transactions). Migration
functions should make use of the `req` by adding it to the arguments of your payload local API calls such
as `payload.create` and database adapter methods like `payload.db.create`.
Here is an example migration file:
```ts
import { MigrateUpArgs, MigrateDownArgs } from '@payloadcms/your-db-adapter'
export async function up({ payload }: MigrateUpArgs): Promise<void> {
export async function up ({ payload, req }: MigrateUpArgs): Promise<void> {
// Perform changes to your database here.
// You have access to `payload` as an argument, and
// everything is done in TypeScript.
};
export async function down({ payload }: MigrateDownArgs): Promise<void> {
export async function down ({ payload, req }: MigrateDownArgs): Promise<void> {
// Do whatever you need to revert changes if the `up` function fails
};
```
All database adapters should implement similar migration patterns, but there will be small differences based on the adapter and its specific needs. Below is a list of all migration commands that should be supported by your database adapter.
### Migrations Directory
Each DB adapter has an optional property `migrationDir` where you can override where you want your migrations to be
stored/read. If this is not specified, Payload will check the default and possibly make a best effort to find your
migrations directory by searching in common locations ie. `./src/migrations`, `./dist/migrations`, `./migrations`, etc.
All database adapters should implement similar migration patterns, but there will be small differences based on the
adapter and its specific needs. Below is a list of all migration commands that should be supported by your database
adapter.
## Commands
### Migrate
@@ -58,7 +74,8 @@ npm run payload migrate
### Create
Create a new migration file in the migrations directory. You can optionally name the migration that will be created. By default, migrations will be named using a timestamp.
Create a new migration file in the migrations directory. You can optionally name the migration that will be created. By
default, migrations will be named using a timestamp.
```text
npm run payload migrate:create optional-name-here
@@ -66,7 +83,8 @@ npm run payload migrate:create optional-name-here
### Status
The `migrate:status` command will check the status of migrations and output a table of which migrations have been run, and which migrations have not yet run.
The `migrate:status` command will check the status of migrations and output a table of which migrations have been run,
and which migrations have not yet run.
`payload migrate:status`

View File

@@ -6,7 +6,8 @@ desc: Payload has supported MongoDB natively since we started. The flexible natu
keywords: MongoDB, documentation, typescript, Content Management System, cms, headless, javascript, node, react, express
---
To use Payload with MongoDB, install the package `@payloadcms/db-mongodb`. It will come with everything you need to store your Payload data in MongoDB.
To use Payload with MongoDB, install the package `@payloadcms/db-mongodb`. It will come with everything you need to
store your Payload data in MongoDB.
Then from there, pass it to your Payload config as follows:
@@ -29,18 +30,74 @@ export default buildConfig({
### Options
| Option | Description |
| --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `autoPluralization` | Tell Mongoose to auto-pluralize any collection names if it encounters any singular words used as collection `slug`s. |
| `connectOptions` | Customize MongoDB connection options. Payload will connect to your MongoDB database using default options which you can override and extend to include all the [options](https://mongoosejs.com/docs/connections.html#options) available to mongoose. |
| `migrationDir` | Customize the directory that migrations are stored. |
| Option | Description |
|----------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `autoPluralization` | Tell Mongoose to auto-pluralize any collection names if it encounters any singular words used as collection `slug`s. |
| `schemaOptions` | Customize schema options for all Mongoose schemas created internally. |
| `jsonParse` | Set to false to disable the automatic JSON stringify/parse of data queried by MongoDB. For example, if you have data not tracked by Payload such as `Date` fields and similar, you can use this option to ensure that existing `Date` properties remain as `Date` and not strings. |
| `collections` | Options on a collection-by-collection basis. [More](#collections-options) |
| `globals` | Options for the Globals collection created by Payload. [More](#globals-options) |
| `connectOptions` | Customize MongoDB connection options. Payload will connect to your MongoDB database using default options which you can override and extend to include all the [options](https://mongoosejs.com/docs/connections.html#options) available to mongoose. |
| `disableIndexHints` | Set to true to disable hinting to MongoDB to use 'id' as index. This is currently done when counting documents for pagination, as it increases the speed of the count function used in that query. Disabling this optimization might fix some problems with AWS DocumentDB. Defaults to false |
| `migrationDir` | Customize the directory that migrations are stored. |
| `transactionOptions` | An object with configuration properties used in [transactions](https://www.mongodb.com/docs/manual/core/transactions/) or `false` which will disable the use of transactions. |
| `collation` | Enable language-specific string comparison with customizable options. Available on MongoDB 3.4+. Defaults locale to "en". Example: `{ strength: 3 }`. For a full list of collation options and their definitions, see the [MongoDB documentation](https://www.mongodb.com/docs/manual/reference/collation/). |
### Access to Mongoose models
After Payload is initialized, this adapter exposes all of your Mongoose models and they are available for you to work with directly.
After Payload is initialized, this adapter exposes all of your Mongoose models and they are available for you to work
with directly.
You can access Mongoose models as follows:
- Collection models - `payload.db.collections[myCollectionSlug]`
- Globals model - `payload.db.globals`
- Versions model (both collections and globals) - `payload.db.versions[myEntitySlug]`
- Versions model (both collections and globals) - `payload.db.versions[myEntitySlug]`
### Collections Options
You can configure the way the MongoDB adapter works on a collection-by-collection basis, including customizing Mongoose `schemaOptions` for each collection schema created.
Example:
```ts
const db = mongooseAdapter({
url: 'your-url-here',
collections: {
users: {
//
schemaOptions: {
strict: false,
}
}
}
})
```
### Global Options
Payload automatically creates a single `globals` collection that correspond with any Payload globals that you define. When you initialize the `mongooseAdapter`, you can specify settings here for your globals in a similar manner to how you can for collections above. Right now, the only property available is `schemaOptions` but more may be added in the future.
### Preserving externally managed data
You can use Payload in conjunction with an existing MongoDB database, where you might have some fields "tracked" in Payload via corresponding field configs, and other fields completely unknown to Payload.
If you have external field data in existing MongoDB collections which you'd like to use in combination with Payload, and you don't want to lose those external fields, you can configure Payload to "preserve" that data while it makes updates to your existing documents.
To do this, the first step is to configure Mongoose's `strict` property, which tells Mongoose to write all data that it receives (and not disregard any data that it does not know about).
The second step is to disable Payload's automatic JSON parsing of documents it receives from MongoDB.
Here's an example for how to configure your Mongoose adapter to preserve external collection fields that are not tracked by Payload:
```ts
mongooseAdapter({
url: process.env.DATABASE_URI,
// Disable the JSON parsing that Payload performs
jsonParse: false,
// Disable strict mode for Mongoose
schemaOptions: {
strict: false,
},
})
```

View File

@@ -70,4 +70,105 @@ export default buildConfig({
}
}),
})
```
```
## Collection Operations
To configure Collection database operations in your Payload application, your Collection config has methods that can override default database operations for that Collection.
The override methods receive arguments useful for augmenting operations such as Field data, the collection slug, and the req.
Here is an example:
```ts
import type { CollectionConfig } from 'payload/types'
export const Collection: CollectionConfig => {
return {
slug: 'collection-db-operations',
db: {
// Create a document in a custom db
create: async ({ collection, data, req }) => {
const doc = await fetch(`https://example.com/api/${collection}/create`, {
method: "POST",
body: JSON.stringify(data),
headers: {
'x-app-user': `payload_${req.payload.user}`,
'Content-Type': 'application/json'
}
}).then(response => response.json())
return doc
},
// Delete a document in a custom db
deleteOne: async ({ collection, data, req }) => {
const docs = await fetch(`https://example.com/api/${collection}/delete/${data.id}`, {
method: 'DELETE',
headers: {
'x-app-user': `payload_${req.payload.user}`
}
}).then(response => response.json())
return docs
},
// Delete many documents in a custom db
deleteMany: async ({ collection, data, req }) => {
const docs = await fetch(`https://example.com/api/${collection}/delete`, {
method: 'DELETE'
headers: {
'x-app-user': `payload_${req.payload.user}`
}
body: JSON.stringify(data),
}).then(response => response.json())
return docs
},
// Find documents in a custom db
find: async ({ collection, data, req, where, limit }) => {
const docs = await fetch(`https://example.com/api/${collection}/find`, {
headers: {
'x-app-user': `payload_${req.payload.user}`
}
body: JSON.stringify({data, where, limit}),
}).then(response => response.json())
return { docs }
},
// Find one document in a custom db
findOne: async ({ collection, data, req }) => {
const doc = await fetch(`https://example.com/api/${collection}/find/${data.id}`, {
headers: {
'x-app-user': `payload_${req.payload.user}`
}
}).then(response => response.json())
return doc
},
// Update one document in an custom db
updateOne: async ({ collection, data, req }) => {
const doc = await fetch(`https://example.com/api/${collection}/update/${data.id}`, {
method: 'PUT',
body: JSON.stringify(data),
headers: {
'x-app-user': `payload_${req.payload.user}`,
'Content-Type': 'application/json'
}
}).then(response => response.json())
return { ...doc, updated: true }
},
},
fields: [
{
name: 'name',
type: 'text',
},
],
}
}
```

View File

@@ -2,7 +2,7 @@
title: Postgres
label: Postgres
order: 50
desc: Payload supports Postgres through an officially supported Drizzle database adapter.
desc: Payload supports Postgres through an officially supported Drizzle database adapter.
keywords: Postgres, documentation, typescript, Content Management System, cms, headless, javascript, node, react, express
---
@@ -37,11 +37,18 @@ export default buildConfig({
### Options
| Option | Description |
| ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `pool` | [Pool connection options](https://orm.drizzle.team/docs/quick-postgresql/node-postgres) that will be passed to Drizzle and `node-postgres`. |
| `push` | Disable Drizzle's [`db push`](https://orm.drizzle.team/kit-docs/overview#prototyping-with-db-push) in development mode. By default, `push` is enabled for development mode only. |
| `migrationDir` | Customize the directory that migrations are stored. |
| Option | Description |
|-----------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `pool` \* | [Pool connection options](https://orm.drizzle.team/docs/quick-postgresql/node-postgres) that will be passed to Drizzle and `node-postgres`. |
| `push` | Disable Drizzle's [`db push`](https://orm.drizzle.team/kit-docs/overview#prototyping-with-db-push) in development mode. By default, `push` is enabled for development mode only. |
| `migrationDir` | Customize the directory that migrations are stored. |
| `logger` | The instance of the logger to be passed to drizzle. By default Payload's will be used. |
| `schemaName` | A string for the postgres schema to use, defaults to 'public'. |
| `localesSuffix` | A string appended to the end of table names for storing localized fields. Default is '_locales'. |
| `relationshipsSuffix` | A string appended to the end of table names for storing relationships. Default is '_rels'. |
| `versionsSuffix` | A string appended to the end of table names for storing versions. Defaults to '_v'. |
### Access to Drizzle
@@ -65,7 +72,7 @@ In addition to exposing Drizzle directly, all of the tables, Drizzle relations,
Drizzle exposes two ways to work locally in development mode.
The first is [`db push`](https://orm.drizzle.team/kit-docs/overview#prototyping-with-db-push), which automatically pushes changes you make to your Payload config (and therefore, Drizzle schema) to your database so you don't have to manually migrate every time you change your Payload config. This only works in development mode, and should not be mixed with manually running [`migrate`](/docs/database/migrations) commands.
The first is [`db push`](https://orm.drizzle.team/kit-docs/overview#prototyping-with-db-push), which automatically pushes changes you make to your Payload config (and therefore, Drizzle schema) to your database so you don't have to manually migrate every time you change your Payload config. This only works in development mode, and should not be mixed with manually running [`migrate`](/docs/database/migrations) commands.
You will be warned if any changes that you make will entail data loss while in development mode. Push is enabled by default, but you can opt out if you'd like.
@@ -77,11 +84,11 @@ Migrations are extremely powerful thanks to the seamless way that Payload and Dr
1. You are building your Payload config locally, with a local database used for testing.
1. You have left the default setting of `push` enabled, so every time you change your Payload config (add or remove fields, collections, etc.), Drizzle will automatically push changes to your local DB.
1. Once you're done with your changes, or have completed a feature, you can run `npm run payload migrate:create`.
1. Once you're done with your changes, or have completed a feature, you can run `npm run payload migrate:create`.
1. Payload and Drizzle will look for any existing migrations, and automatically generate all SQL changes necessary to convert your schema from its prior state into the state of your current Payload config, and store the resulting DDL in a newly created migration.
1. Once you're ready to go to production, you will be able to run `npm run payload migrate` against your production database, which will apply any new migrations that have not yet run.
1. Now your production database is in sync with your Payload config!
<Banner type="warning">
Warning: do not mix "push" and migrations with your local development database. If you use "push" locally, and then try to migrate, Payload will throw a warning, telling you that these two methods are not meant to be used interchangeably.
</Banner>
</Banner>

View File

@@ -20,7 +20,8 @@ The initial request made to Payload will begin a new transaction and attach it t
```ts
const afterChange: CollectionAfterChangeHook = async ({ req }) => {
// because req.transactionID is assigned from Payload and passed through, my-slug will only persist if the entire request is successful
// because req.transactionID is assigned from Payload and passed through,
// my-slug will only persist if the entire request is successful
await req.payload.create({
req,
collection: 'my-slug',
@@ -48,7 +49,7 @@ const afterChange: CollectionAfterChangeHook = async ({ req }) => {
})
// Should this call fail, it will not rollback other changes
// because the req (and its transationID) is not passed through
// because the req (and its transactionID) is not passed through
const safelyIgnoredAsync = req.payload.create({
collection: 'my-slug',
data: {
@@ -60,10 +61,44 @@ const afterChange: CollectionAfterChangeHook = async ({ req }) => {
### Direct Transaction Access
When writing your own scripts or custom endpoints, you may wish to have direct control over transactions. This is useful for interacting with your database outside of Payload's local API.
When writing your own scripts or custom endpoints, you may wish to have direct control over transactions. This is useful for interacting with your database in something like a background job, outside the normal request-response flow.
The following functions can be used for managing transactions:
`payload.db.beginTransaction` - Starts a new session and returns a transaction ID for use in other Payload Local API calls.
`payload.db.commitTransaction` - Takes the identifier for the transaction, finalizes any changes.
`payload.db.rollbackTransaction` - Takes the identifier for the transaction, discards any changes.
`payload.db.beginTransaction` - Starts a new session and returns a transaction ID for use in other Payload Local API calls. Note that if your database does not support transactions, this will return `null`.\
`payload.db.commitTransaction` - Takes the identifier for the transaction, finalizes any changes.\
`payload.db.rollbackTransaction` - Takes the identifier for the transaction, discards any changes.
You can then use the transaction ID with Payload's local API by passing it inside the `PayloadRequest` object.
Here is an example for a "background job" function, which utilizes the direct transaction API to make sure it either succeeds completely or gets rolled back in case of an error.
```ts
async function allOrNothingJob() {
const req = {} as PayloadRequest;
req.transactionID = await payload.db.beginTransaction();
try {
await payload.create({
req, // use our manual transaction
collection: 'my-slug',
data: {
some: 'data'
}
});
await payload.create({
req, // use our manual transaction
collection: 'something-else',
data: {
some: 'data'
}
});
console.log('Everything done.');
if (req.transactionID) await payload.db.commitTransaction(req.transactionID);
} catch (e) {
console.error('Oh no, something went wrong!');
if (req.transactionID) await payload.db.rollbackTransaction(req.transactionID);
}
}
```

View File

@@ -30,16 +30,16 @@ The following options are configurable in the `email` property object as part of
| **`fromName`** \* | The name part of the From field that will be seen on the delivered email |
| **`fromAddress`** \* | The email address part of the From field that will be used when delivering email |
| **`transport`** | The NodeMailer transport object for when you want to do it yourself, not needed when transportOptions is set |
| **`transportOptions`** | An object that configures the transporter that Payload will create. For all the available options see the [NodeMailer documentation](https://nodemailer.com/smtp/) or see the examples below |
| **`transportOptions`** | An object that configures the transporter that Payload will create. For all the available options see the [NodeMailer documentation](https://nodemailer.com) or see the examples below |
| **`logMockCredentials`** | If set to true and no transport/transportOptions, ethereal credentials will be logged to console on startup |
_\* An asterisk denotes that a property is required._
### Use SMTP
Simple Mail Transfer Protocol, also known as SMTP can be passed in using the `transportOptions` object on the `email` options.
Simple Mail Transfer Protocol (SMTP) options can be passed in using the `transportOptions` object on the `email` options. See the [NodeMailer SMTP documentation](https://nodemailer.com/smtp/) for more information, including details on when `secure` should and should not be set to `true`.
**Example email part using SMTP:**
**Example email options using SMTP:**
```ts
payload.init({
@@ -50,12 +50,9 @@ payload.init({
user: process.env.SMTP_USER,
pass: process.env.SMTP_PASS,
},
port: 587,
secure: true, // use TLS
tls: {
// do not fail on invalid certs
rejectUnauthorized: false,
},
port: Number(process.env.SMTP_HOST),
secure: Number(process.env.SMTP_PORT) === 465, // true for port 465, false (the default) for 587 and others
requireTLS: true,
},
fromName: 'hello',
fromAddress: 'hello@example.com',
@@ -71,7 +68,7 @@ payload.init({
### Use an email service
Many third party mail providers are available and offer benefits beyond basic SMTP. As an example your payload init could look this if you wanted to use SendGrid.com though the same approach would work for any other [NodeMailer transports](https://nodemailer.com/transports/) shown here or provided by another third party.
Many third party mail providers are available and offer benefits beyond basic SMTP. As an example, your payload init could look like this if you wanted to use SendGrid.com, though the same approach would work for any other [NodeMailer transports](https://nodemailer.com/transports/) shown here or provided by another third party.
```ts
import payload from 'payload'

View File

@@ -0,0 +1,39 @@
---
title: Examples
label: Overview
order: 10
desc:
keywords: example, examples, starter, boilerplate, template, templates
---
Payload provides a vast array of examples to help you get started with your project no matter what you are working on. These examples are designed to be easy to get up and running, and to be easy to understand. They showcase nothing more than the specific features being demonstrated, so you can easily decipher what is going on.
Examples are changing every day, so be sure to check back often to see what new examples have been added. If you have a specific example you would like to see, please feel free to start a new [Discussion](https://github.com/payloadcms/payload/discussions) or open a new [PR](https://github.com/payloadcms/payload/pulls) to add it yourself.
- [Auth](https://github.com/payloadcms/payload/tree/main/examples/auth)
- [Custom Server](https://github.com/payloadcms/payload/tree/main/examples/custom-server)
- [Draft Preview](https://github.com/payloadcms/payload/tree/main/examples/draft-preview)
- [Email](https://github.com/payloadcms/payload/tree/main/examples/email)
- [Form Builder](https://github.com/payloadcms/payload/tree/main/examples/form-builder)
- [Hierarchy](https://github.com/payloadcms/payload/tree/main/examples/hierarchy)
- [Live Preview](https://github.com/payloadcms/payload/tree/main/examples/live-preview)
- [Multi-tenant](https://github.com/payloadcms/payload/tree/main/examples/multi-tenant)
- [Nested Docs](https://github.com/payloadcms/payload/tree/main/examples/nested-docs)
- [Redirects](https://github.com/payloadcms/payload/tree/main/examples/redirects)
- [Tests](https://github.com/payloadcms/payload/tree/main/examples/testing)
- [Virtual Fields](https://github.com/payloadcms/payload/tree/main/examples/virtual-fields)
- [White-label Admin UI](https://github.com/payloadcms/payload/tree/main/examples/whitelabel)
Where necessary, some examples include a front-end. Examples that require a front-end share this folder structure:
```plaintext
example/
├── payload/
├── next-app/
├── next-pages/
├── react-router/
├── vue/
├── svelte/
```
Where `payload` is your Payload project, and the other directories are dedicated to their respective front-end framework. We are adding new examples every day, so if your framework of choice is not yet supported in any particular example, please feel free to start a new [Discussion](https://github.com/payloadcms/payload/discussions) or open a new [PR](https://github.com/payloadcms/payload/pulls) to add it yourself.

View File

@@ -12,22 +12,24 @@ keywords: array, fields, config, configuration, documentation, Content Managemen
</Banner>
<LightDarkImage
srcLight="https://payloadcms.com/images/docs/fields/array.png"
srcDark="https://payloadcms.com/images/docs/fields/array-dark.png"
alt="Array field with two Rows in Payload admin panel"
caption="Admin panel screenshot of an Array field with two Rows"
srcLight="https://payloadcms.com/images/docs/fields/array.png"
srcDark="https://payloadcms.com/images/docs/fields/array-dark.png"
alt="Array field with two Rows in Payload admin panel"
caption="Admin panel screenshot of an Array field with two Rows"
/>
**Example uses:**
- A "slider" with an image ([upload field](/docs/fields/upload)) and a caption ([text field](/docs/fields/text))
- Navigational structures where editors can specify nav items containing pages ([relationship field](/docs/fields/relationship)), an "open in new tab" [checkbox field](/docs/fields/checkbox)
- Event agenda "timeslots" where you need to specify start & end time ([date field](/docs/fields/date)), label ([text field](/docs/fields/text)), and Learn More page [relationship](/docs/fields/relationship)
- Navigational structures where editors can specify nav items containing
pages ([relationship field](/docs/fields/relationship)), an "open in new tab" [checkbox field](/docs/fields/checkbox)
- Event agenda "timeslots" where you need to specify start & end time ([date field](/docs/fields/date)),
label ([text field](/docs/fields/text)), and Learn More page [relationship](/docs/fields/relationship)
### Config
| Option | Description |
| ------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|---------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **`name`** \* | To be used as the property name when stored and retrieved from the database. [More](/docs/fields/overview#field-names) |
| **`label`** | Text used as the heading in the Admin panel or an object with keys for each language. Auto-generated from name if not defined. |
| **`fields`** \* | Array of field types to correspond to each row of the Array. |
@@ -45,16 +47,19 @@ keywords: array, fields, config, configuration, documentation, Content Managemen
| **`admin`** | Admin-specific configuration. See below for [more detail](#admin-config). |
| **`custom`** | Extension point for adding custom data (e.g. for plugins) |
| **`interfaceName`** | Create a top level, reusable [Typescript interface](/docs/typescript/generating-types#custom-field-interfaces) & [GraphQL type](/docs/graphql/graphql-schema#custom-field-schemas). |
| **`dbName`** | Custom table name for the field when using SQL database adapter ([Postgres](/docs/database/postgres)). Auto-generated from name if not defined. |
_\* An asterisk denotes that a property is required._
### Admin Config
In addition to the default [field admin config](/docs/fields/overview#admin-config), you can adjust the following properties:
In addition to the default [field admin config](/docs/fields/overview#admin-config), you can adjust the following
properties:
| Option | Description |
| ------------------------- | -------------------------------------------------------------------------------------------------------------------- |
|---------------------------|----------------------------------------------------------------------------------------------------------------------|
| **`initCollapsed`** | Set the initial collapsed state |
| **`isSortable`** | Disable array order sorting by setting this value to `false` |
| **`components.RowLabel`** | Function or React component to be rendered as the label on the array row. Receives `({ data, index, path })` as args |
### Example
@@ -63,6 +68,7 @@ In addition to the default [field admin config](/docs/fields/overview#admin-conf
```ts
import { CollectionConfig } from 'payload/types'
import { RowLabelArgs } from 'payload/dist/admin/components/forms/RowLabel/types'
export const ExampleCollection: CollectionConfig = {
slug: 'example-collection',
@@ -97,7 +103,7 @@ export const ExampleCollection: CollectionConfig = {
],
admin: {
components: {
RowLabel: ({ data, index }) => {
RowLabel: ({ data, index }: RowLabelArgs) => {
return data?.title || `Slide ${String(index).padStart(2, '0')}`
},
},

View File

@@ -14,22 +14,23 @@ keywords: blocks, fields, config, configuration, documentation, Content Manageme
</Banner>
<LightDarkImage
srcLight="https://payloadcms.com/images/docs/fields/blocks.png"
srcDark="https://payloadcms.com/images/docs/fields/blocks-dark.png"
alt="Admin panel screenshot of add Blocks drawer view"
caption="Admin panel screenshot of add Blocks drawer view"
srcLight="https://payloadcms.com/images/docs/fields/blocks.png"
srcDark="https://payloadcms.com/images/docs/fields/blocks-dark.png"
alt="Admin panel screenshot of add Blocks drawer view"
caption="Admin panel screenshot of add Blocks drawer view"
/>
**Example uses:**
- A layout builder tool that grants editors to design highly customizable page or post layouts. Blocks could include configs such as `Quote`, `CallToAction`, `Slider`, `Content`, `Gallery`, or others.
- A layout builder tool that grants editors to design highly customizable page or post layouts. Blocks could include
configs such as `Quote`, `CallToAction`, `Slider`, `Content`, `Gallery`, or others.
- A form builder tool where available block configs might be `Text`, `Select`, or `Checkbox`.
- Virtual event agenda "timeslots" where a timeslot could either be a `Break`, a `Presentation`, or a `BreakoutSession`.
### Field config
| Option | Description |
| ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|--------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **`name`** \* | To be used as the property name when stored and retrieved from the database. [More](/docs/fields/overview#field-names) |
| **`label`** | Text used as the heading in the Admin panel or an object with keys for each language. Auto-generated from name if not defined. |
| **`blocks`** \* | Array of [block configs](/docs/fields/blocks#block-configs) to be made available to this field. |
@@ -51,11 +52,13 @@ _\* An asterisk denotes that a property is required._
### Admin Config
In addition to the default [field admin config](/docs/fields/overview#admin-config), you can adjust the following properties:
In addition to the default [field admin config](/docs/fields/overview#admin-config), you can adjust the following
properties:
| Option | Description |
| ------------------- | ------------------------------- |
|---------------------|---------------------------------|
| **`initCollapsed`** | Set the initial collapsed state |
| **`isSortable`** | Disable block order sorting by setting this value to `false` |
### Block configs
@@ -72,7 +75,7 @@ Blocks are defined as separate configs of their own.
</Banner>
| Option | Description |
| -------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|----------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **`slug`** \* | Identifier for this block type. Will be saved on each block as the `blockType` property. |
| **`fields`** \* | Array of fields to be stored in this block. |
| **`labels`** | Customize the block labels that appear in the Admin dashboard. Auto-generated from slug if not defined. |
@@ -80,6 +83,8 @@ Blocks are defined as separate configs of their own.
| **`imageAltText`** | Customize this block's image thumbnail alt text. |
| **`interfaceName`** | Create a top level, reusable [Typescript interface](/docs/typescript/generating-types#custom-field-interfaces) & [GraphQL type](/docs/graphql/graphql-schema#custom-field-schemas). |
| **`graphQL.singularName`** | Text to use for the GraphQL schema name. Auto-generated from slug if not defined. NOTE: this is set for deprecation, prefer `interfaceName`. |
| **`dbName`** | Custom table name for this block type when using SQL database adapter ([Postgres](/docs/database/postgres)). Auto-generated from slug if not defined.
| **`custom`** | Extension point for adding custom data (e.g. for plugins) |
#### Auto-generated data per block
@@ -91,7 +96,8 @@ The `blockType` is saved as the slug of the block that has been selected.
**`blockName`**
The Admin panel provides each block with a `blockName` field which optionally allows editors to label their blocks for better editability and readability.
The Admin panel provides each block with a `blockName` field which optionally allows editors to label their blocks for
better editability and readability.
### Example
@@ -138,7 +144,8 @@ export const ExampleCollection: CollectionConfig = {
### TypeScript
As you build your own Block configs, you might want to store them in separate files but retain typing accordingly. To do so, you can import and use Payload's `Block` type:
As you build your own Block configs, you might want to store them in separate files but retain typing accordingly. To do
so, you can import and use Payload's `Block` type:
```ts
import type { Block } from 'payload/types'

View File

@@ -55,6 +55,7 @@ In addition to the default [field admin config](/docs/fields/overview#admin-conf
| **`date.maxDate`** \* | Max date value to allow. |
| **`date.minTime`** \* | Min time value to allow. |
| **`date.maxTime`** \* | Max date value to allow. |
| **`date.overrides`** \* | Pass any valid props directly to the [react-datepicker](https://github.com/Hacker0x01/react-datepicker/blob/master/docs/datepicker.md) |
| **`date.timeIntervals`** \* | Time intervals to display. Defaults to 30 minutes. |
| **`date.timeFormat`** \* | Determines time format. Defaults to `'h:mm aa'`. |

View File

@@ -4,7 +4,7 @@ label: JSON
order: 50
desc: The JSON field type will store any string in the Database. Learn how to use JSON fields, see examples and options.
keywords: json, fields, config, configuration, documentation, Content Management System, cms, headless, javascript, node, react, express
keywords: json, jsonSchema, schema, validation, fields, config, configuration, documentation, Content Management System, cms, headless, javascript, node, react, express
---
<Banner>
@@ -28,8 +28,9 @@ This field uses the `monaco-react` editor syntax highlighting.
| **`name`** \* | To be used as the property name when stored and retrieved from the database. [More](/docs/fields/overview#field-names) |
| **`label`** | Text used as a field label in the Admin panel or an object with keys for each language. |
| **`unique`** | Enforce that each entry in the Collection has a unique value for this field. |
| **`index`** | Build a an [index](/docs/database/overview) for this field to produce faster queries. Set this field to `true` if your users will perform queries on this field's data often. |
| **`index`** | Build an [index](/docs/database/overview) for this field to produce faster queries. Set this field to `true` if your users will perform queries on this field's data often. |
| **`validate`** | Provide a custom validation function that will be executed on both the Admin panel and the backend. [More](/docs/fields/overview#validation) |
| **`jsonSchema`** | Provide a JSON schema that will be used for validation. [JSON schemas](https://json-schema.org/learn/getting-started-step-by-step) |
| **`saveToJWT`** | If this field is top-level and nested in a config supporting [Authentication](/docs/authentication/config), include its data in the user JWT. |
| **`hooks`** | Provide field-based hooks to control logic for this field. [More](/docs/fields/overview#field-level-hooks) |
| **`access`** | Provide field-based access control to denote what users can see and do with this field's data. [More](/docs/fields/overview#field-level-access-control) |
@@ -48,11 +49,11 @@ In addition to the default [field admin config](/docs/fields/overview#admin-conf
| Option | Description |
| ------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **`editorOptions`** | Options that can be passed to the monaco editor, [view the full list](https://microsoft.github.io/monaco-editor/api/interfaces/monaco.editor.IDiffEditorConstructionOptions.html). |
| **`editorOptions`** | Options that can be passed to the monaco editor, [view the full list](https://microsoft.github.io/monaco-editor/typedoc/variables/editor.EditorOptions.html). |
### Example
`collections/ExampleCollection.ts
`collections/ExampleCollection.ts`
```ts
import { CollectionConfig } from 'payload/types'
@@ -68,3 +69,68 @@ export const ExampleCollection: CollectionConfig = {
],
}
```
### JSON Schema Validation
Payload JSON fields fully support the [JSON schema](https://json-schema.org/) standard. By providing a schema in your field config, the editor will be guided in the admin UI, getting typeahead for properties and their formats automatically. When the document is saved, the default validation will prevent saving any invalid data in the field according to the schema in your config.
If you only provide a URL to a schema, Payload will fetch the desired schema if it is publicly available. If not, it is recommended to add the schema directly to your config or import it from another file so that it can be implemented consistently in your project.
#### Local JSON Schema
`collections/ExampleCollection.ts`
```ts
import { CollectionConfig } from 'payload/types'
export const ExampleCollection: CollectionConfig = {
slug: 'example-collection',
fields: [
{
name: 'customerJSON', // required
type: 'json', // required
jsonSchema: {
uri: 'a://b/foo.json', // required
fileMatch: ['a://b/foo.json'], // required
schema: {
type: 'object',
properties: {
foo: {
enum: ['bar', 'foobar'],
}
},
},
},
},
],
}
// {"foo": "bar"} or {"foo": "foobar"} - ok
// Attempting to create {"foo": "not-bar"} will throw an error
```
#### Remote JSON Schema
`collections/ExampleCollection.ts`
```ts
import { CollectionConfig } from 'payload/types'
export const ExampleCollection: CollectionConfig = {
slug: 'example-collection',
fields: [
{
name: 'customerJSON', // required
type: 'json', // required
jsonSchema: {
uri: 'https://example.com/customer.schema.json', // required
fileMatch: ['https://example.com/customer.schema.json'], // required
},
},
],
}
// If 'https://example.com/customer.schema.json' has a JSON schema
// {"foo": "bar"} or {"foo": "foobar"} - ok
// Attempting to create {"foo": "not-bar"} will throw an error
```

View File

@@ -46,6 +46,7 @@ export const Page: CollectionConfig = {
- [Date](/docs/fields/date) - date / time field that saves a timestamp
- [Email](/docs/fields/email) - validates the entry is a properly formatted email
- [Group](/docs/fields/group) - nest fields within an object
- [JSON](/docs/fields/json) - saves actual JSON in the database
- [Number](/docs/fields/number) - field that enforces that its value be a number
- [Point](/docs/fields/point) - geometric coordinates for location data
- [Radio](/docs/fields/radio) - radio button group, allowing only one value to be selected
@@ -53,6 +54,7 @@ export const Page: CollectionConfig = {
- [Rich Text](/docs/fields/rich-text) - fully extensible Rich Text editor
- [Row](/docs/fields/row) - used for admin field layout, no effect on data shape
- [Select](/docs/fields/select) - dropdown / picklist style value selector
- [Tabs](/docs/fields/tabs) - used for admin layout, nest fields within tabs
- [Text](/docs/fields/text) - simple text input
- [Textarea](/docs/fields/textarea) - allows a bit larger of a text editor
- [Upload](/docs/fields/upload) - allows local file and image upload
@@ -68,7 +70,16 @@ In addition to being able to define access control on a document-level, you can
### Field names
Some fields use their `name` property as a unique identifier to store and retrieve from the database. `__v`, `salt`, and `hash` are all reserved field names which are sanitized from Payload's config and cannot be used.
All fields require a `name` property. This is the key that will be used to store and retrieve the field's value in the database. This property must be unique within the Collection, Global, or nested group that it is defined in.
Payload reserves various field names for internal use. Using reserved field names will result in your field being sanitized from the config.
The following field names are forbidden and cannot be used:
- `__v`
- `salt`
- `hash`
- `file`
### Validation
@@ -143,6 +154,7 @@ const field: Field = {
Collections ID fields are generated automatically by default. An explicit `id` field can be declared in the `fields` array to override this behavior.
Users are then required to provide a custom ID value when creating a record through the Admin UI or API.
Valid ID types are `number` and `text`.
When using the text value, remember that it shouldn't contain the / (slash) sign, as the API will read it separately and this can result in unexpected behavior.
Example:
@@ -161,19 +173,21 @@ Example:
In addition to each field's base configuration, you can define specific traits and properties for fields that only have effect on how they are rendered in the Admin panel. The following properties are available for all fields within the `admin` property:
| Option | Description |
| ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `condition` | You can programmatically show / hide fields based on what other fields are doing. [Click here](#conditional-logic) for more info. |
| `components` | All field components can be completely and easily swapped out for custom components that you define. [Click here](#custom-components) for more info. |
| `description` | Helper text to display with the field to provide more information for the editor user. [Click here](#description) for more info. |
| `position` | Specify if the field should be rendered in the sidebar by defining `position: 'sidebar'`. |
| `width` | Restrict the width of a field. you can pass any string-based value here, be it pixels, percentages, etc. This property is especially useful when fields are nested within a `Row` type where they can be organized horizontally. |
| `style` | Attach raw CSS style properties to the root DOM element of a field. |
| `className` | Attach a CSS class name to the root DOM element of a field. |
| `readOnly` | Setting a field to `readOnly` has no effect on the API whatsoever but disables the admin component's editability to prevent editors from modifying the field's value. |
| `disabled` | If a field is `disabled`, it is completely omitted from the Admin panel. |
| `disableBulkEdit` | Set `disableBulkEdit` to `true` to prevent fields from appearing in the select options when making edits for multiple documents. |
| `hidden` | Setting a field's `hidden` property on its `admin` config will transform it into a `hidden` input type. Its value will still submit with the Admin panel's requests, but the field itself will not be visible to editors. |
| Option | Description |
| ------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `condition` | You can programmatically show / hide fields based on what other fields are doing. [Click here](#conditional-logic) for more info. |
| `components` | All field components can be completely and easily swapped out for custom components that you define. [Click here](#custom-components) for more info. |
| `description` | Helper text to display with the field to provide more information for the editor user. [Click here](#description) for more info. |
| `position` | Specify if the field should be rendered in the sidebar by defining `position: 'sidebar'`. |
| `width` | Restrict the width of a field. you can pass any string-based value here, be it pixels, percentages, etc. This property is especially useful when fields are nested within a `Row` type where they can be organized horizontally. |
| `style` | Attach raw CSS style properties to the root DOM element of a field. |
| `className` | Attach a CSS class name to the root DOM element of a field. |
| `readOnly` | Setting a field to `readOnly` has no effect on the API whatsoever but disables the admin component's editability to prevent editors from modifying the field's value. |
| `disabled` | If a field is `disabled`, it is completely omitted from the Admin panel. |
| `disableBulkEdit` | Set `disableBulkEdit` to `true` to prevent fields from appearing in the select options when making edits for multiple documents. |
| `disableListColumn` | Set `disableListColumn` to `true` to prevent fields from appearing in the list view column selector. |
| `disableListFilter` | Set `disableListFilter` to `true` to prevent fields from appearing in the list view filter options. |
| `hidden` | Setting a field's `hidden` property on its `admin` config will transform it into a `hidden` input type. Its value will still submit with the Admin panel's requests, but the field itself will not be visible to editors. |
### Custom components
@@ -250,11 +264,16 @@ const field = {
### Description
A description can be configured three ways.
A description can be configured in three ways.
- As a string
- As a function that accepts an object containing the field's value, which returns a string
- As a React component that accepts value as a prop
- As a function which returns a string
- As a React component
Functions are called with an optional argument object with the following shape, and React components are rendered with the following props:
- `path` - the path of the field
- `value` - the current value of the field
As shown above, you can simply provide a string that will show by the field, but there are use cases where you may want to create some dynamic feedback. By using a function or a component for the `description` property you can provide realtime feedback as the user interacts with the form.
@@ -268,8 +287,8 @@ As shown above, you can simply provide a string that will show by the field, but
type: 'text',
maxLength: 20,
admin: {
description: ({ value }) =>
`${typeof value === 'string' ? 20 - value.length : '20'} characters left`,
description: ({ path, value }) =>
`${typeof value === 'string' ? 20 - value.length : '20'} characters left (field: ${path})`,
},
},
]
@@ -289,11 +308,12 @@ This example will display the number of characters allowed as the user types.
maxLength: 20,
admin: {
description:
({ value }) => (
({ path, value }) => (
<div>
Character count:
{' '}
{ value?.length || 0 }
(field: {path})
</div>
)
}
@@ -302,7 +322,7 @@ This example will display the number of characters allowed as the user types.
}
```
This component will count the number of characters entered.
This component will count the number of characters entered, as well as display the path of the field.
### TypeScript

View File

@@ -36,6 +36,7 @@ keywords: radio, fields, config, configuration, documentation, Content Managemen
| **`required`** | Require this field to have a value. |
| **`admin`** | Admin-specific configuration. See below for [more detail](#admin-config). |
| **`custom`** | Extension point for adding custom data (e.g. for plugins) |
| **`enumName`** | Custom enum name for this field when using SQL database adapter ([Postgres](/docs/database/postgres)). Auto-generated from name if not defined.
_\* An asterisk denotes that a property is required._

View File

@@ -12,10 +12,10 @@ keywords: relationship, fields, config, configuration, documentation, Content Ma
</Banner>
<LightDarkImage
srcLight="https://payloadcms.com/images/docs/fields/relationship.png"
srcDark="https://payloadcms.com/images/docs/fields/relationship-dark.png"
alt="Shows a relationship field in the Payload admin panel"
caption="Admin panel screenshot of a Relationship field"
srcLight="https://payloadcms.com/images/docs/fields/relationship.png"
srcDark="https://payloadcms.com/images/docs/fields/relationship-dark.png"
alt="Shows a relationship field in the Payload admin panel"
caption="Admin panel screenshot of a Relationship field"
/>
**Example uses:**
@@ -26,28 +26,28 @@ keywords: relationship, fields, config, configuration, documentation, Content Ma
### Config
| Option | Description |
| ------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **`name`** \* | To be used as the property name when stored and retrieved from the database. [More](/docs/fields/overview#field-names) |
| **`relationTo`** \* | Provide one or many collection `slug`s to be able to assign relationships to. |
| **`filterOptions`** | A query to filter which options appear in the UI and validate against. [More](#filtering-relationship-options). |
| **`hasMany`** | Boolean when, if set to `true`, allows this field to have many relations instead of only one. |
| **`minRows`** | A number for the fewest allowed items during validation when a value is present. Used with `hasMany`. |
| **`maxRows`** | A number for the most allowed items during validation when a value is present. Used with `hasMany`. |
| **`maxDepth`** | Sets a number limit on iterations of related documents to populate when queried. [Depth](/docs/getting-started/concepts#depth) |
| **`label`** | Text used as a field label in the Admin panel or an object with keys for each language. |
| **`unique`** | Enforce that each entry in the Collection has a unique value for this field. |
| **`validate`** | Provide a custom validation function that will be executed on both the Admin panel and the backend. [More](/docs/fields/overview#validation) |
| **`index`** | Build a an [index](/docs/database/overview) for this field to produce faster queries. Set this field to `true` if your users will perform queries on this field's data often. |
| **`saveToJWT`** | If this field is top-level and nested in a config supporting [Authentication](/docs/authentication/config), include its data in the user JWT. |
| **`hooks`** | Provide field-based hooks to control logic for this field. [More](/docs/fields/overview#field-level-hooks) |
| **`access`** | Provide field-based access control to denote what users can see and do with this field's data. [More](/docs/fields/overview#field-level-access-control) |
| **`hidden`** | Restrict this field's visibility from all APIs entirely. Will still be saved to the database, but will not appear in any API or the Admin panel. |
| **`defaultValue`** | Provide data to be used for this field's default value. [More](/docs/fields/overview#default-values) |
| **`localized`** | Enable localization for this field. Requires [localization to be enabled](/docs/configuration/localization) in the Base config. |
| **`required`** | Require this field to have a value. |
| **`admin`** | Admin-specific configuration. See the [default field admin config](/docs/fields/overview#admin-config) for more details. |
| **`custom`** | Extension point for adding custom data (e.g. for plugins) |
| Option | Description |
|---------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **`name`** \* | To be used as the property name when stored and retrieved from the database. [More](/docs/fields/overview#field-names) |
| **`relationTo`** \* | Provide one or many collection `slug`s to be able to assign relationships to. |
| **`filterOptions`** | A query to filter which options appear in the UI and validate against. [More](#filtering-relationship-options). |
| **`hasMany`** | Boolean when, if set to `true`, allows this field to have many relations instead of only one. |
| **`minRows`** | A number for the fewest allowed items during validation when a value is present. Used with `hasMany`. |
| **`maxRows`** | A number for the most allowed items during validation when a value is present. Used with `hasMany`. |
| **`maxDepth`** | Sets a number limit on iterations of related documents to populate when queried. [Depth](/docs/getting-started/concepts#depth) |
| **`label`** | Text used as a field label in the Admin panel or an object with keys for each language. |
| **`unique`** | Enforce that each entry in the Collection has a unique value for this field. |
| **`validate`** | Provide a custom validation function that will be executed on both the Admin panel and the backend. [More](/docs/fields/overview#validation) |
| **`index`** | Build an [index](/docs/database/overview) for this field to produce faster queries. Set this field to `true` if your users will perform queries on this field's data often. |
| **`saveToJWT`** | If this field is top-level and nested in a config supporting [Authentication](/docs/authentication/config), include its data in the user JWT. |
| **`hooks`** | Provide field-based hooks to control logic for this field. [More](/docs/fields/overview#field-level-hooks) |
| **`access`** | Provide field-based access control to denote what users can see and do with this field's data. [More](/docs/fields/overview#field-level-access-control) |
| **`hidden`** | Restrict this field's visibility from all APIs entirely. Will still be saved to the database, but will not appear in any API or the Admin panel. |
| **`defaultValue`** | Provide data to be used for this field's default value. [More](/docs/fields/overview#default-values) |
| **`localized`** | Enable localization for this field. Requires [localization to be enabled](/docs/configuration/localization) in the Base config. |
| **`required`** | Require this field to have a value. |
| **`admin`** | Admin-specific configuration. See the [default field admin config](/docs/fields/overview#admin-config) for more details. |
| **`custom`** | Extension point for adding custom data (e.g. for plugins) |
_\* An asterisk denotes that a property is required._
@@ -60,24 +60,79 @@ _\* An asterisk denotes that a property is required._
### Admin config
In addition to the default [field admin config](/docs/fields/overview#admin-config), the Relationship field type also allows for the following admin-specific properties:
In addition to the default [field admin config](/docs/fields/overview#admin-config), the Relationship field type also
allows for the following admin-specific properties:
**`isSortable`**
Set to `true` if you'd like this field to be sortable within the Admin UI using drag and drop (only works when `hasMany` is set to `true`).
Set to `true` if you'd like this field to be sortable within the Admin UI using drag and drop (only works when `hasMany`
is set to `true`).
**`allowCreate`**
Set to `false` if you'd like to disable the ability to create new documents from within the relationship field (hides the "Add new" button in the admin UI).
Set to `false` if you'd like to disable the ability to create new documents from within the relationship field (hides
the "Add new" button in the admin UI).
**`sortOptions`**
The `sortOptions` property allows you to define a default sorting order for the options within a Relationship field's
dropdown. This can be particularly useful for ensuring that the most relevant options are presented first to the user.
You can specify `sortOptions` in two ways:
**As a string:**
Provide a string to define a global default sort field for all relationship field dropdowns across different
collections. You can prefix the field name with a minus symbol ("-") to sort in descending order.
Example:
```ts
sortOptions: 'fieldName',
```
This configuration will sort all relationship field dropdowns by `"fieldName"` in ascending order.
**As an object :**
Specify an object where keys are collection slugs and values are strings representing the field names to sort by. This
allows for different sorting fields for each collection's relationship dropdown.
Example:
```ts
sortOptions: {
"pages"
:
"fieldName1",
"posts"
:
"-fieldName2",
"categories"
:
"fieldName3"
}
```
In this configuration:
- Dropdowns related to `pages` will be sorted by `"fieldName1"` in ascending order.
- Dropdowns for `posts` will use `"fieldName2"` for sorting in descending order (noted by the "-" prefix).
- Dropdowns associated with `categories` will sort based on `"fieldName3"` in ascending order.
Note: If `sortOptions` is not defined, the default sorting behavior of the Relationship field dropdown will be used.
### Filtering relationship options
Options can be dynamically limited by supplying a [query constraint](/docs/queries/overview), which will be used both for validating input and filtering available relationships in the UI.
Options can be dynamically limited by supplying a [query constraint](/docs/queries/overview), which will be used both
for validating input and filtering available relationships in the UI.
The `filterOptions` property can either be a `Where` query directly, or a function (synchronous or asynchronous) that returns one. When using a function, it will be called with an argument object containing the following properties:
The `filterOptions` property can either be a `Where` query, or a function returning `true` to not filter, `false` to
prevent all, or a `Where` query. When using a function, it will be
called with an argument object with the following properties:
| Property | Description |
| ------------- | ------------------------------------------------------------------------------------ |
|---------------|--------------------------------------------------------------------------------------|
| `relationTo` | The `relationTo` to filter against (as defined on the field) |
| `data` | An object of the full collection or global document currently being edited |
| `siblingData` | An object of the document data limited to fields within the same parent to the field |
@@ -128,16 +183,21 @@ You can learn more about writing queries [here](/docs/queries/overview).
### How the data is saved
Given the variety of options possible within the `relationship` field type, the shape of the data needed for creating and updating these fields can vary. The following sections will describe the variety of data shapes that can arise from this field.
Given the variety of options possible within the `relationship` field type, the shape of the data needed for creating
and updating these fields can vary. The following sections will describe the variety of data shapes that can arise from
this field.
#### Has One
The most simple pattern of a relationship is to use `hasMany: false` with a `relationTo` that allows for only one type of collection.
The most simple pattern of a relationship is to use `hasMany: false` with a `relationTo` that allows for only one type
of collection.
```ts
{
slug: 'example-collection',
fields: [
fields
:
[
{
name: 'owner', // required
type: 'relationship', // required
@@ -163,12 +223,15 @@ When querying documents in this collection via REST API, you could query as foll
#### Has One - Polymorphic
Also known as **dynamic references**, in this configuration, the `relationTo` field is an array of Collection slugs that tells Payload which Collections are valid to reference.
Also known as **dynamic references**, in this configuration, the `relationTo` field is an array of Collection slugs that
tells Payload which Collections are valid to reference.
```ts
{
slug: 'example-collection',
fields: [
fields
:
[
{
name: 'owner', // required
type: 'relationship', // required
@@ -207,7 +270,9 @@ The `hasMany` tells Payload that there may be more than one collection saved to
```ts
{
slug: 'example-collection',
fields: [
fields
:
[
{
name: 'owners', // required
type: 'relationship', // required
@@ -222,7 +287,10 @@ To save the to `hasMany` relationship field we need to send an array of IDs:
```json
{
"owners": ["6031ac9e1289176380734024", "602c3c327b811235943ee12b"]
"owners": [
"6031ac9e1289176380734024",
"602c3c327b811235943ee12b"
]
}
```
@@ -235,7 +303,9 @@ When querying documents, the format does not change for arrays:
```ts
{
slug: 'example-collection',
fields: [
fields
:
[
{
name: 'owners', // required
type: 'relationship', // required
@@ -247,7 +317,8 @@ When querying documents, the format does not change for arrays:
}
```
Relationship fields with `hasMany` set to more than one kind of collections save their data as an array of objects—each containing the Collection `slug` as the `relationTo` value, and the related document `id` for the `value`:
Relationship fields with `hasMany` set to more than one kind of collections save their data as an array of objects—each
containing the Collection `slug` as the `relationTo` value, and the related document `id` for the `value`:
```json
{
@@ -267,3 +338,29 @@ Relationship fields with `hasMany` set to more than one kind of collections save
Querying is done in the same way as the earlier Polymorphic example:
`?where[owners.value][equals]=6031ac9e1289176380734024`.
#### Querying and Filtering Polymorphic Relationships
Polymorphic and non-polymorphic relationships must be queried differently because of how the related data is stored and
may be inconsistent across different collections. Because of this, filtering polymorphic relationship fields from the
Collection List admin UI is limited to the `id` value.
For a polymorphic relationship, the response will always be an array of objects. Each object will contain
the `relationTo` and `value` properties.
The data can be queried by the related document ID:
`?where[field.value][equals]=6031ac9e1289176380734024`.
Or by the related document Collection slug:
`?where[field.relationTo][equals]=your-collection-slug`.
However, you **cannot** query on any field values within the related document.
Since we are referencing multiple collections, the field you are querying on may not exist and break the query.
<Banner type="warning">
<strong>Note:</strong>
<br />
You <strong>cannot</strong> query on a field within a polymorphic relationship as you would with a non-polymorphic relationship.
</Banner>

View File

@@ -12,32 +12,34 @@ keywords: select, multi-select, fields, config, configuration, documentation, Co
</Banner>
<LightDarkImage
srcLight="https://payloadcms.com/images/docs/fields/select.png"
srcDark="https://payloadcms.com/images/docs/fields/select-dark.png"
alt="Shows a Select field in the Payload admin panel"
caption="Admin panel screenshot of a Select field"
srcLight="https://payloadcms.com/images/docs/fields/select.png"
srcDark="https://payloadcms.com/images/docs/fields/select-dark.png"
alt="Shows a Select field in the Payload admin panel"
caption="Admin panel screenshot of a Select field"
/>
### Config
| Option | Description |
| ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **`name`** \* | To be used as the property name when stored and retrieved from the database. [More](/docs/fields/overview#field-names) |
| **`options`** \* | Array of options to allow the field to store. Can either be an array of strings, or an array of objects containing a `label` string and a `value` string. |
| **`hasMany`** | Boolean when, if set to `true`, allows this field to have many selections instead of only one. |
| **`label`** | Text used as a field label in the Admin panel or an object with keys for each language. |
| **`unique`** | Enforce that each entry in the Collection has a unique value for this field. |
| **`validate`** | Provide a custom validation function that will be executed on both the Admin panel and the backend. [More](/docs/fields/overview#validation) |
| **`index`** | Build an [index](/docs/database/overview) for this field to produce faster queries. Set this field to `true` if your users will perform queries on this field's data often. |
| **`saveToJWT`** | If this field is top-level and nested in a config supporting [Authentication](/docs/authentication/config), include its data in the user JWT. |
| **`hooks`** | Provide field-based hooks to control logic for this field. [More](/docs/fields/overview#field-level-hooks) |
| **`access`** | Provide field-based access control to denote what users can see and do with this field's data. [More](/docs/fields/overview#field-level-access-control) |
| **`hidden`** | Restrict this field's visibility from all APIs entirely. Will still be saved to the database, but will not appear in any API or the Admin panel. |
| **`defaultValue`** | Provide data to be used for this field's default value. [More](/docs/fields/overview#default-values) |
| **`localized`** | Enable localization for this field. Requires [localization to be enabled](/docs/configuration/localization) in the Base config. |
| **`required`** | Require this field to have a value. |
| **`admin`** | Admin-specific configuration. See the [default field admin config](/docs/fields/overview#admin-config) for more details. |
| **`custom`** | Extension point for adding custom data (e.g. for plugins) |
| Option | Description |
|--------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **`name`** \* | To be used as the property name when stored and retrieved from the database. [More](/docs/fields/overview#field-names) |
| **`options`** \* | Array of options to allow the field to store. Can either be an array of strings, or an array of objects containing a `label` string and a `value` string. |
| **`hasMany`** | Boolean when, if set to `true`, allows this field to have many selections instead of only one. |
| **`label`** | Text used as a field label in the Admin panel or an object with keys for each language. |
| **`unique`** | Enforce that each entry in the Collection has a unique value for this field. |
| **`validate`** | Provide a custom validation function that will be executed on both the Admin panel and the backend. [More](/docs/fields/overview#validation) |
| **`index`** | Build an [index](/docs/database/overview) for this field to produce faster queries. Set this field to `true` if your users will perform queries on this field's data often. |
| **`saveToJWT`** | If this field is top-level and nested in a config supporting [Authentication](/docs/authentication/config), include its data in the user JWT. |
| **`hooks`** | Provide field-based hooks to control logic for this field. [More](/docs/fields/overview#field-level-hooks) |
| **`access`** | Provide field-based access control to denote what users can see and do with this field's data. [More](/docs/fields/overview#field-level-access-control) |
| **`hidden`** | Restrict this field's visibility from all APIs entirely. Will still be saved to the database, but will not appear in any API or the Admin panel. |
| **`defaultValue`** | Provide data to be used for this field's default value. [More](/docs/fields/overview#default-values) |
| **`localized`** | Enable localization for this field. Requires [localization to be enabled](/docs/configuration/localization) in the Base config. |
| **`required`** | Require this field to have a value. |
| **`admin`** | Admin-specific configuration. See the [default field admin config](/docs/fields/overview#admin-config) for more details. |
| **`custom`** | Extension point for adding custom data (e.g. for plugins) |
| **`enumName`** | Custom enum name for this field when using SQL database adapter ([Postgres](/docs/database/postgres)). Auto-generated from name if not defined. |
| **`dbName`** | Custom table name (if `hasMany` set to `true`) for this field when using SQL database adapter ([Postgres](/docs/database/postgres)). Auto-generated from name if not defined. |
_\* An asterisk denotes that a property is required._
@@ -52,7 +54,8 @@ _\* An asterisk denotes that a property is required._
### Admin config
In addition to the default [field admin config](/docs/fields/overview#admin-config), the Select field type also allows for the following admin-specific properties:
In addition to the default [field admin config](/docs/fields/overview#admin-config), the Select field type also allows
for the following admin-specific properties:
**`isClearable`**
@@ -60,7 +63,8 @@ Set to `true` if you'd like this field to be clearable within the Admin UI.
**`isSortable`**
Set to `true` if you'd like this field to be sortable within the Admin UI using drag and drop. (Only works when `hasMany` is set to `true`)
Set to `true` if you'd like this field to be sortable within the Admin UI using drag and drop. (Only works
when `hasMany` is set to `true`)
### Example
@@ -101,7 +105,8 @@ export const ExampleCollection: CollectionConfig = {
### Customization
The Select field UI component can be customized by providing a custom React component to the `components` object in the Base config.
The Select field UI component can be customized by providing a custom React component to the `components` object in the
Base config.
```ts
export const CustomSelectField: Field = {
@@ -133,7 +138,7 @@ import * as React from 'react';
import { SelectInput, useField } from 'payload/components/forms';
import { useAuth } from 'payload/components/utilities';
type customSelectProps = {
type CustomSelectProps = {
path: string;
options: {
label: string;
@@ -156,27 +161,33 @@ export const CustomSelectComponent: React.FC<CustomSelectProps> = ({ path, optio
return (
<div>
<label className="field-label">
Custom Select
</label>
<SelectInput
path={path}
name={path}
options={adjustedOptions}
value={value}
onChange={() => setValue(e.value)}
/>
</div>
)
<label className = "field-label" >
Custom
Select
< /label>
< SelectInput
path = { path }
name = { path }
options = { adjustedOptions }
value = { value }
onChange = {(e)
=>
setValue(e.value)
}
/>
< /div>
)
}
```
If you are looking to create a dynamic select field, the following tutorial will walk you through the process of creating a custom select field that fetches its options from an external API.
If you are looking to create a dynamic select field, the following tutorial will walk you through the process of
creating a custom select field that fetches its options from an external API.
<VideoDrawer
id='Efn9OxSjA6Y'
label='How to Create a Custom Select Field'
drawerTitle='How to Create a Custom Select Field: A Step-by-Step Guide'
id='Efn9OxSjA6Y'
label='How to Create a Custom Select Field'
drawerTitle='How to Create a Custom Select Field: A Step-by-Step Guide'
/>
If you want to learn more about custom components check out the [Admin > Custom Component](/docs/admin/components#field-component) docs.
If you want to learn more about custom components check out
the [Admin > Custom Component](/docs/admin/components#field-component) docs.

View File

@@ -38,7 +38,9 @@ keywords: text, fields, config, configuration, documentation, Content Management
| **`required`** | Require this field to have a value. |
| **`admin`** | Admin-specific configuration. See below for [more detail](#admin-config). |
| **`custom`** | Extension point for adding custom data (e.g. for plugins) |
| **`hasMany`** | Makes this field an ordered array of text instead of just a single text. |
| **`minRows`** | Minimum number of texts in the array, if `hasMany` is set to true. |
| **`maxRows`** | Maximum number of texts in the array, if `hasMany` is set to true. |
_\* An asterisk denotes that a property is required._
### Admin config

View File

@@ -31,6 +31,7 @@ With this field, you can also inject custom `Cell` components that appear as add
| **`label`** | Human-readable label for this UI field. |
| **`admin.components.Field`** \* | React component to be rendered for this field within the Edit view. [More](/docs/admin/components/#field-component) |
| **`admin.components.Cell`** | React component to be rendered as a Cell within collection List views. [More](/docs/admin/components/#field-component) |
| **`admin.disableListColumn`** | Set `disableListColumn` to `true` to prevent the UI field from appearing in the list view column selector. |
| **`custom`** | Extension point for adding custom data (e.g. for plugins) |
_\* An asterisk denotes that a property is required._

View File

@@ -20,10 +20,10 @@ keywords: upload, images media, fields, config, configuration, documentation, Co
</Banner>
<LightDarkImage
srcLight="https://payloadcms.com/images/docs/fields/upload.png"
srcDark="https://payloadcms.com/images/docs/fields/upload-dark.png"
alt="Shows an upload field in the Payload admin panel"
caption="Admin panel screenshot of an Upload field"
srcLight="https://payloadcms.com/images/docs/fields/upload.png"
srcDark="https://payloadcms.com/images/docs/fields/upload-dark.png"
alt="Shows an upload field in the Payload admin panel"
caption="Admin panel screenshot of an Upload field"
/>
**Example uses:**
@@ -34,25 +34,26 @@ keywords: upload, images media, fields, config, configuration, documentation, Co
### Config
| Option | Description |
| -------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **`name`** \* | To be used as the property name when stored and retrieved from the database. [More](/docs/fields/overview#field-names) |
| **`*relationTo`** \* | Provide a single collection `slug` to allow this field to accept a relation to. <strong>Note: the related collection must be configured to support Uploads.</strong> |
| **`filterOptions`** | A query to filter which options appear in the UI and validate against. [More](#filtering-upload-options). |
| **`maxDepth`** | Sets a number limit on iterations of related documents to populate when queried. [Depth](/docs/getting-started/concepts#depth) |
| **`label`** | Text used as a field label in the Admin panel or an object with keys for each language. |
| **`unique`** | Enforce that each entry in the Collection has a unique value for this field. |
| **`validate`** | Provide a custom validation function that will be executed on both the Admin panel and the backend. [More](/docs/fields/overview#validation) |
| Option | Description |
|----------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **`name`** \* | To be used as the property name when stored and retrieved from the database. [More](/docs/fields/overview#field-names) |
| **`*relationTo`** \* | Provide a single collection `slug` to allow this field to accept a relation to. <strong>Note: the related collection must be configured to support Uploads.</strong> |
| **`filterOptions`** | A query to filter which options appear in the UI and validate against. [More](#filtering-upload-options). |
| **`maxDepth`** | Sets a number limit on iterations of related documents to populate when queried. [Depth](/docs/getting-started/concepts#depth) |
| **`label`** | Text used as a field label in the Admin panel or an object with keys for each language. |
| **`unique`** | Enforce that each entry in the Collection has a unique value for this field. |
| **`validate`** | Provide a custom validation function that will be executed on both the Admin panel and the backend. [More](/docs/fields/overview#validation) |
| **`index`** | Build an [index](/docs/database/overview) for this field to produce faster queries. Set this field to `true` if your users will perform queries on this field's data often. |
| **`saveToJWT`** | If this field is top-level and nested in a config supporting [Authentication](/docs/authentication/config), include its data in the user JWT. |
| **`hooks`** | Provide field-based hooks to control logic for this field. [More](/docs/fields/overview#field-level-hooks) |
| **`access`** | Provide field-based access control to denote what users can see and do with this field's data. [More](/docs/fields/overview#field-level-access-control) |
| **`hidden`** | Restrict this field's visibility from all APIs entirely. Will still be saved to the database, but will not appear in any API or the Admin panel. |
| **`defaultValue`** | Provide data to be used for this field's default value. [More](/docs/fields/overview#default-values) |
| **`localized`** | Enable localization for this field. Requires [localization to be enabled](/docs/configuration/localization) in the Base config. |
| **`required`** | Require this field to have a value. |
| **`admin`** | Admin-specific configuration. See the [default field admin config](/docs/fields/overview#admin-config) for more details. |
| **`custom`** | Extension point for adding custom data (e.g. for plugins) |
| **`saveToJWT`** | If this field is top-level and nested in a config supporting [Authentication](/docs/authentication/config), include its data in the user JWT. |
| **`hooks`** | Provide field-based hooks to control logic for this field. [More](/docs/fields/overview#field-level-hooks) |
| **`access`** | Provide field-based access control to denote what users can see and do with this field's data. [More](/docs/fields/overview#field-level-access-control) |
| **`hidden`** | Restrict this field's visibility from all APIs entirely. Will still be saved to the database, but will not appear in any API or the Admin panel. |
| **`defaultValue`** | Provide data to be used for this field's default value. [More](/docs/fields/overview#default-values) |
| **`displayPreview`** | Enable displaying preview of the uploaded file. Overrides related Collection's `displayPreview` option. [More](/docs/upload/overview#collection-upload-options). |
| **`localized`** | Enable localization for this field. Requires [localization to be enabled](/docs/configuration/localization) in the Base config. |
| **`required`** | Require this field to have a value. |
| **`admin`** | Admin-specific configuration. See the [default field admin config](/docs/fields/overview#admin-config) for more details. |
| **`custom`** | Extension point for adding custom data (e.g. for plugins) |
_\* An asterisk denotes that a property is required._
@@ -78,12 +79,15 @@ export const ExampleCollection: CollectionConfig = {
### Filtering upload options
Options can be dynamically limited by supplying a [query constraint](/docs/queries/overview), which will be used both for validating input and filtering available uploads in the UI.
Options can be dynamically limited by supplying a [query constraint](/docs/queries/overview), which will be used both
for validating input and filtering available uploads in the UI.
The `filterOptions` property can either be a `Where` query directly, or a function that returns one. When using a function, it will be called with an argument object with the following properties:
The `filterOptions` property can either be a `Where` query, or a function returning `true` to not filter, `false` to
prevent all, or a `Where` query. When using a function, it will be
called with an argument object with the following properties:
| Property | Description |
| ------------- | ------------------------------------------------------------------------------------ |
|---------------|--------------------------------------------------------------------------------------|
| `relationTo` | The `relationTo` to filter against (as defined on the field) |
| `data` | An object of the full collection or global document currently being edited |
| `siblingData` | An object of the document data limited to fields within the same parent to the field |

View File

@@ -10,7 +10,7 @@ keywords: documentation, getting started, guide, Content Management System, cms,
Payload requires the following software:
- Yarn or NPM
- Any JavaScript package manager (Yarn, NPM, or pnpm)
- Node.js version 16+
- Any [compatible database](/docs/database/overview) (MongoDB or Postgres)
@@ -23,7 +23,7 @@ Payload requires the following software:
To quickly scaffold a new Payload app in the fastest way possible, you can use [create-payload-app](https://npmjs.com/package/create-payload-app). To do so, run the following command:
```
npx create-payload-app
npx create-payload-app@latest
```
Then just follow the prompts! You'll get set up with a new folder and a functioning Payload app inside.

View File

@@ -11,19 +11,23 @@ keywords: documentation, getting started, guide, Content Management System, cms,
title="Payload Introduction - Closing the Gap Between Headless CMS and Application Frameworks"
/>
Payload is a headless CMS and application framework. It's meant to provide a massive boost to your
development process, but importantly, stay out of your way as your apps get more complex.
<Banner type="success">
Payload is a headless CMS and application framework. Its meant to provide a massive boost to your
development process, but importantly, stay out of your way as your apps get more complex.
<strong>Payload 2.0 has been released!</strong>
<br />
Includes Postgres support, Live Preview, Lexical Editor, and more. <a href="/blog/payload-2-0">Read the announcement</a>.
</Banner>
Out of the box, Payload gives you a lot of the things that you often need when developing a new website, web app, or native app:
- A MongoDB database to store your data
- A database to store your data (Postgres and MongoDB supported)
- A way to store, retrieve, and manipulate data of any shape via full REST and GraphQL APIs
- Authentication—complete with commonly required functionality like registration, email verification, login, & password reset
- Deep access control to your data, based on document or field-level functions
- File storage and access control
- A beautiful admin UI thats generated specifically to suit your data
- A beautiful admin UI that's generated specifically to suit your data
## What does "headless" mean?

View File

@@ -43,11 +43,12 @@ export const PublicUser: CollectionConfig = {
**Payload will automatically open up the following queries:**
| Query Name | Operation |
| ------------------ | ------------------- |
| **`PublicUser`** | `findByID` |
| **`PublicUsers`** | `find` |
| **`mePublicUser`** | `me` auth operation |
| Query Name | Operation |
| ------------------ | ------------------- |
| **`PublicUser`** | `findByID` |
| **`PublicUsers`** | `find` |
| **`countPublicUsers`** | `count` |
| **`mePublicUser`** | `me` auth operation |
**And the following mutations:**

View File

@@ -26,6 +26,8 @@ Additionally, `auth`-enabled collections feature the following hooks:
- [afterRefresh](#afterrefresh)
- [afterMe](#afterme)
- [afterForgotPassword](#afterforgotpassword)
- [refresh](#refresh)
- [me](#me)
## Config
@@ -59,6 +61,8 @@ export const ExampleHooks: CollectionConfig = {
afterRefresh: [(args) => {...}],
afterMe: [(args) => {...}],
afterForgotPassword: [(args) => {...}],
refresh: [(args) => {...}],
me: [(args) => {...}],
},
}
```
@@ -75,6 +79,7 @@ import { CollectionBeforeOperationHook } from 'payload/types'
const beforeOperationHook: CollectionBeforeOperationHook = async ({
args, // original arguments passed into the operation
operation, // name of the operation
req, // full express request
}) => {
return args // return modified operation arguments as necessary
}
@@ -91,7 +96,7 @@ Please do note that this does not run before the client-side validation. If you
3. `validate` runs on the server
```ts
import { CollectionBeforeOperationHook } from 'payload/types'
import { CollectionBeforeValidateHook } from 'payload/types'
const beforeValidateHook: CollectionBeforeValidateHook = async ({
data, // incoming data to update or create with
@@ -209,6 +214,7 @@ import { CollectionAfterOperationHook } from 'payload/types'
const afterOperationHook: CollectionAfterOperationHook = async ({
args, // arguments passed into the operation
operation, // name of the operation
req, // full express request
result, // the result of the operation, before modifications
}) => {
return result // return modified result as necessary
@@ -290,13 +296,37 @@ For auth-enabled Collections, this hook runs after successful `forgotPassword` o
```ts
import { CollectionAfterForgotPasswordHook } from 'payload/types'
const afterLoginHook: CollectionAfterForgotPasswordHook = async ({
req, // full express request
user, // user being logged in
token, // user token
}) => {
return user
}
const afterForgotPasswordHook: CollectionAfterForgotPasswordHook = async ({
args, // arguments passed into the operation
context,
collection, // The collection which this hook is being run on
}) => {...}
```
### refresh
For auth-enabled Collections, this hook allows you to optionally replace the default behavior of the `refresh` operation with your own. If you optionally return a value from your hook, the operation will not perform its own logic and continue.
```ts
import type { CollectionRefreshHook } from 'payload/types'
const myRefreshHook: CollectionRefreshHook = async ({
args, // arguments passed into the `refresh` operation
user, // the user as queried from the database
}) => {...}
```
### me
For auth-enabled Collections, this hook allows you to optionally replace the default behavior of the `me` operation with your own. If you optionally return a value from your hook, the operation will not perform its own logic and continue.
```ts
import type { CollectionMeHook } from 'payload/types'
const meHook: CollectionMeHook = async ({
args, // arguments passed into the `me` operation
user, // the user as queried from the database
}) => {...}
```
## TypeScript
@@ -319,5 +349,7 @@ import type {
CollectionAfterRefreshHook,
CollectionAfterMeHook,
CollectionAfterForgotPasswordHook,
CollectionRefreshHook,
CollectionMeHook,
} from 'payload/types'
```

View File

@@ -6,7 +6,8 @@ desc: Hooks can be added to any fields, and optionally modify the return value o
keywords: hooks, fields, config, configuration, documentation, Content Management System, cms, headless, javascript, node, react, express
---
Field-level hooks offer incredible potential for encapsulating your logic. They help to isolate concerns and package up functionalities to be easily reusable across your projects.
Field-level hooks offer incredible potential for encapsulating your logic. They help to isolate concerns and package up
functionalities to be easily reusable across your projects.
**Example use cases include:**
@@ -18,10 +19,10 @@ Field-level hooks offer incredible potential for encapsulating your logic. They
**All field types provide the following hooks:**
- `beforeValidate`
- `beforeChange`
- `afterChange`
- `afterRead`
- [beforeValidate](#beforevalidate)
- [beforeChange](#beforechange)
- [afterChange](#afterchange)
- [afterRead](#afterread)
## Config
@@ -46,7 +47,8 @@ const ExampleField: Field = {
## Arguments and return values
All field-level hooks are formatted to accept the same arguments, although some arguments may be `undefined` based on which field hook you are utilizing.
All field-level hooks are formatted to accept the same arguments, although some arguments may be `undefined` based on
which field hook you are utilizing.
<Banner type="success">
<strong>Tip:</strong>
@@ -62,21 +64,26 @@ All field-level hooks are formatted to accept the same arguments, although some
Field Hooks receive one `args` argument that contains the following properties:
| Option | Description |
| ------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|--------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **`data`** | The data passed to update the document within `create` and `update` operations, and the full document itself in the `afterRead` hook. |
| **`siblingData`** | The sibling data passed to a field that the hook is running against. |
| **`findMany`** | Boolean to denote if this hook is running against finding one, or finding many within the `afterRead` hook. |
| **`operation`** | A string relating to which operation the field type is currently executing within. Useful within `beforeValidate`, `beforeChange`, and `afterChange` hooks to differentiate between `create` and `update` operations. |
| **`originalDoc`** | The full original document in `update` operations. In the `afterChange` hook, this is the resulting document of the operation. |
| **`previousDoc`** | The document before changes were applied, only in `afterChange` hooks. |
| **`previousSiblingDoc`** | The sibling data from the previous document in `afterChange` hook. |
| **`previousSiblingDoc`** | The sibling data of the document before changes being applied, only in `beforeChange` and `afterChange` hook. |
| **`req`** | The Express `request` object. It is mocked for Local API operations. |
| **`value`** | The value of the field. |
| **`previousValue`** | The previous value of the field, before changes were applied, only in `afterChange` hooks. |
| **`previousValue`** | The previous value of the field, before changes, only in `beforeChange` and `afterChange` hooks. |
| **`context`** | Context passed to this hook. More info can be found under [Context](/docs/hooks/context) |
| **`field`** | The field which the hook is running against. |
| **`collection`** | The collection which the field belongs to. If the field belongs to a global, this will be null. |
| **`global`** | The global which the field belongs to. If the field belongs to a collection, this will be null. |
#### Return value
All field hooks can optionally modify the return value of the field before the operation continues. Field Hooks may optionally return the value that should be used within the field.
All field hooks can optionally modify the return value of the field before the operation continues. Field Hooks may
optionally return the value that should be used within the field.
<Banner type="warning">
<strong>Important</strong>
@@ -86,6 +93,120 @@ All field hooks can optionally modify the return value of the field before the o
reconsider Field Hooks and instead evaluate if Collection / Global hooks might suit you better.
</Banner>
## Examples of Field Hooks
To better illustrate how field-level hooks can be applied, here are some specific examples. These demonstrate the
flexibility and potential of field hooks in different contexts. Remember, these examples are just a starting point - the
true potential of field-level hooks lies in their adaptability to a wide array of use cases.
### beforeValidate
Runs before the `update` operation. This hook allows you to pre-process or format field data before it undergoes
validation.
```ts
import { Field } from 'payload/types'
const usernameField: Field = {
name: 'username',
type: 'text',
hooks: {
beforeValidate: [({ value }) => {
// Trim whitespace and convert to lowercase
return value.trim().toLowerCase()
}],
}
}
```
In this example, the `beforeValidate` hook is used to process the `username` field. The hook takes the incoming value of
the field and transforms it by trimming whitespace and converting it to lowercase. This ensures that the username is
stored in a consistent format in the database.
### beforeChange
Immediately following validation, `beforeChange` hooks will run within `create` and `update` operations. At this stage,
you can be confident that the field data that will be saved to the document is valid in accordance to your field
validations.
```ts
import { Field } from 'payload/types'
const emailField: Field = {
name: 'email',
type: 'email',
hooks: {
beforeChange: [({ value, operation }) => {
if (operation === 'create') {
// Perform additional validation or transformation for 'create' operation
}
return value
}],
}
}
```
In the `emailField`, the `beforeChange` hook checks the `operation` type. If the operation is `create`, it performs
additional validation or transformation on the email field value. This allows for operation-specific logic to be applied
to the field.
### afterChange
The `afterChange` hook is executed after a field's value has been changed and saved in the database. This hook is useful
for post-processing or triggering side effects based on the new value of the field.
```ts
import { Field } from 'payload/types'
const membershipStatusField: Field = {
name: 'membershipStatus',
type: 'select',
options: [
{ label: 'Standard', value: 'standard' },
{ label: 'Premium', value: 'premium' },
{ label: 'VIP', value: 'vip' }
],
hooks: {
afterChange: [({ value, previousValue, req }) => {
if (value !== previousValue) {
// Log or perform an action when the membership status changes
console.log(`User ID ${req.user.id} changed their membership status from ${previousValue} to ${value}.`)
// Here, you can implement actions that could track conversions from one tier to another
}
}],
}
}
```
In this example, the `afterChange` hook is used with a `membershipStatusField`, which allows users to select their
membership level (Standard, Premium, VIP). The hook monitors changes in the membership status. When a change occurs, it
logs the update and can be used to trigger further actions, such as tracking conversion from one tier to another or
notifying them about changes in their membership benefits.
### afterRead
The `afterRead` hook is invoked after a field value is read from the database. This is ideal for formatting or
transforming the field data for output.
```ts
import { Field } from 'payload/types'
const dateField: Field = {
name: 'createdAt',
type: 'date',
hooks: {
afterRead: [({ value }) => {
// Format date for display
return new Date(value).toLocaleDateString()
}],
}
}
```
Here, the `afterRead` hook for the `dateField` is used to format the date into a more readable format
using `toLocaleDateString()`. This hook modifies the way the date is presented to the user, making it more
user-friendly.
## TypeScript
Payload exports a type for field hooks which can be accessed and used as follows:

View File

@@ -79,7 +79,7 @@ import { GlobalAfterChangeHook } from 'payload/types'
const afterChangeHook: GlobalAfterChangeHook = async ({
doc, // full document data
previousDoc, // document data before updating the collection
previousDoc, // document data before updating the global
req, // full express request
}) => {
return data

View File

@@ -2,13 +2,13 @@
title: Hooks Overview
label: Overview
order: 10
desc: Hooks allow you to add your own logic to Payload, including integrating with third-party APIs, adding auto-generated data, or modifing Payload's base functionality.
desc: Hooks allow you to add your own logic to Payload, including integrating with third-party APIs, adding auto-generated data, or modifying Payload's base functionality.
keywords: hooks, overview, config, configuration, documentation, Content Management System, cms, headless, javascript, node, react, express
---
<Banner type="info">
Hooks are powerful ways to tie into existing Payload actions in order to add your own logic like
integrating with third-party APIs, adding auto-generated data, or modifing Payload's base
integrating with third-party APIs, adding auto-generated data, or modifying Payload's base
functionality.
</Banner>
@@ -36,7 +36,7 @@ If your Hook simply performs a side-effect, such as updating a CRM, it might be
#### Server-only execution
Payload Hooks do not have any effect within the Payload Admin panel. You can safely [remove your hooks](/docs/admin/webpack#aliasing-server-only-modules) from your Admin panel's code by customizing the Webpack config, which not only keeps your Admin bundles' filesize small but also ensures that any server-side only code does not cause problems within browser environments.
Payload Hooks are only triggered on the server. You can safely [remove your hooks](/docs/admin/excluding-server-code#aliasing-server-only-modules) from your Admin panel's client-side code by customizing the Webpack config, which not only keeps your Admin bundles' filesize small but also ensures that any server-side only code does not cause problems within browser environments.
## Hook Types

View File

@@ -1,30 +1,30 @@
---
title: Vercel Visual Editing
label: Vercel Visual Editing
title: Vercel Content Link
label: Vercel Content Link
order: 10
desc: Payload + Vercel Visual Editing allows yours editors to navigate directly from the content rendered on your front-end to the fields in Payload that control it.
keywords: vercel, vercel visual editing, visual editing, content source maps, Content Management System, cms, headless, javascript, node, react, express
desc: Payload + Vercel Content Link allows yours editors to navigate directly from the content rendered on your front-end to the fields in Payload that control it.
keywords: vercel, vercel content link, visual editing, content source maps, Content Management System, cms, headless, javascript, node, react, express
---
[Vercel Visual Editing](https://vercel.com/docs/workflow-collaboration/visual-editing) will allow your editors to navigate directly from the content rendered on your front-end to the fields in Payload that control it. This requires no changes to your front-end code and very few changes to your Payload config.
[Vercel Content Link](https://vercel.com/docs/workflow-collaboration/edit-mode#content-link) will allow your editors to navigate directly from the content rendered on your front-end to the fields in Payload that control it. This requires no changes to your front-end code and very few changes to your Payload config.
![Versions](/images/docs/vercel-visual-editing.jpg)
<Banner type="warning">
Vercel Visual Editing is an enterprise-only feature and only available for deployments hosted on
Vercel Content Link is an enterprise-only feature and only available for deployments hosted on
Vercel. If you are an existing enterprise customer, [contact our sales
team](https://payloadcms.com/for-enterprise) for help with your integration.
</Banner>
### How it works
To power Vercel Visual Editing, Payload embeds Content Source Maps into its API responses. Content Source Maps are invisible, encoded JSON values that include a link back to the field in the CMS that generated the content. When rendered on the page, Vercel detects and decodes these values to display the Visual Editing interface.
To power Vercel Content Link, Payload embeds Content Source Maps into its API responses. Content Source Maps are invisible, encoded JSON values that include a link back to the field in the CMS that generated the content. When rendered on the page, Vercel detects and decodes these values to display the Content Link interface.
For full details on how the encoding and decoding algorithm works, check out [`@vercel/stega`](https://www.npmjs.com/package/@vercel/stega).
### Getting Started
Setting up Payload with Vercel Visual Editing is easy. First, install the `@payloadcms/plugin-csm` plugin into your project. This plugin requires an API key to install, [contact our sales team](https://payloadcms.com/for-enterprise) if you don't already have one.
Setting up Payload with Vercel Content Link is easy. First, install the `@payloadcms/plugin-csm` plugin into your project. This plugin requires an API key to install, [contact our sales team](https://payloadcms.com/for-enterprise) if you don't already have one.
```bash
npm i @payloadcms/plugin-csm
@@ -76,7 +76,7 @@ And that's it! You are now ready to enter Edit Mode and begin visually editing y
##### Edit Mode
To see Visual Editing on your site, you first need to visit any preview deployment on Vercel and login using the Vercel Toolbar. When Content Source Maps are detected on the page, a pencil icon will appear in the toolbar. Clicking this icon will enable Edit Mode, highlighting all editable fields on the page in blue.
To see Content Link on your site, you first need to visit any preview deployment on Vercel and login using the Vercel Toolbar. When Content Source Maps are detected on the page, a pencil icon will appear in the toolbar. Clicking this icon will enable Edit Mode, highlighting all editable fields on the page in blue.
![Versions](/images/docs/vercel-toolbar.jpg)
@@ -93,7 +93,7 @@ const { cleaned, encoded } = vercelStegaSplit(text)
##### Blocks
All `blocks` fields by definition do not have plain text strings to encode. For this reason, blocks are given an additional `encodedSourceMap` key, which you can use to enable Visual Editing on entire sections of your site. You can then specify the editing container by adding the `data-vercel-edit-target` HTML attribute to any top-level element of your block.
All `blocks` fields by definition do not have plain text strings to encode. For this reason, blocks are given an additional `encodedSourceMap` key, which you can use to enable Content Link on entire sections of your site. You can then specify the editing container by adding the `data-vercel-edit-target` HTML attribute to any top-level element of your block.
```ts
<div data-vercel-edit-target>

View File

@@ -1,6 +1,6 @@
---
title: Implementing Live Preview in your app
label: Frontend Implementation
label: Frontend
order: 20
desc: Learn how to implement Live Preview in your front-end application.
keywords: live preview, frontend, react, next.js, vue, nuxt.js, svelte, hook, useLivePreview
@@ -8,15 +8,16 @@ keywords: live preview, frontend, react, next.js, vue, nuxt.js, svelte, hook, us
While using Live Preview, the Admin panel emits a new `window.postMessage` event every time a change is made to the document. Your front-end application can listen for these events and re-render accordingly.
Wiring your front-end into Live Preview is easy. If your front-end application is built with React or Next.js, use the [`useLivePreview`](#react) React hook that Payload provides. In the future, all other major frameworks like Vue, Svelte, etc will be officially supported. If you are using any of these frameworks today, you can still integrate with Live Preview yourself using the underlying tooling that Payload provides. See [building your own hook](#building-your-own-hook) for more information.
Wiring your front-end into Live Preview is easy. If your front-end application is built with React, Next.js, Vue or Nuxt.js, use the `useLivePreview` hook that Payload provides. In the future, all other major frameworks like Svelte will be officially supported. If you are using any of these frameworks today, you can still integrate with Live Preview yourself using the underlying tooling that Payload provides. See [building your own hook](#building-your-own-hook) for more information.
By default, all hooks require the following args:
By default, all hooks accept the following args:
| Path | Description |
| --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **`serverURL`** \* | The URL of your Payload server. |
| **`initialData`** | The initial data of the document. The live data will be merged in as changes are made. |
| **`depth`** | The depth of the relationships to fetch. Defaults to `0`. |
| **`apiRoute`** | The path of your API route as defined in `routes.api`. Defaults to `/api`. |
_\* An asterisk denotes that a property is required._
@@ -31,6 +32,10 @@ And return the following values:
If your front-end is tightly coupled to required fields, you should ensure that your UI does not break when these fields are removed. For example, if you are rendering something like `data.relatedPosts[0].title`, your page will break once you remove the first related post. To get around this, use conditional logic, optional chaining, or default values in your UI where needed. For example, `data?.relatedPosts?.[0]?.title`.
</Banner>
<Banner type="info">
If is important that the `depth` argument matches exactly with the depth of your initial page request. The depth property is used to populated relationships and uploads beyond their IDs. See [Depth](../getting-started/concepts#depth) for more information.
</Banner>
### React
If your front-end application is built with React or Next.js, you can use the `useLivePreview` hook that Payload provides.
@@ -68,9 +73,40 @@ export const PageClient: React.FC<{
}
```
<Banner type="info">
If is important that the `depth` argument matches exactly with the depth of your initial page request. The depth property is used to populated relationships and uploads beyond their IDs. See [Depth](../getting-started/concepts#depth) for more information.
</Banner>
### Vue
If your front-end application is built with Vue 3 or Nuxt 3, you can use the `useLivePreview` composable that Payload provides.
First, install the `@payloadcms/live-preview-vue` package:
```bash
npm install @payloadcms/live-preview-vue
```
Then, use the `useLivePreview` hook in your Vue component:
```vue
<script setup lang="ts">
import type { PageData } from '~/types';
import { defineProps } from 'vue';
import { useLivePreview } from '@payloadcms/live-preview-vue';
// Fetch the initial data on the parent component or using async state
const props = defineProps<{ initialData: PageData }>();
// The hook will take over from here and keep the preview in sync with the changes you make.
// The `data` property will contain the live data of the document only when viewed from the Preview view of the Admin UI.
const { data } = useLivePreview<PageData>({
initialData: props.initialData,
serverURL: "<PAYLOAD_SERVER_URL>",
depth: 2,
});
</script>
<template>
<h1>{{ data.title }}</h1>
</template>
```
## Building your own hook
@@ -186,3 +222,63 @@ For a working demonstration of this, check out the official [Live Preview Exampl
- [Next.js App Router](https://github.com/payloadcms/payload/tree/main/examples/live-preview/next-app)
- [Next.js Pages Router](https://github.com/payloadcms/payload/tree/main/examples/live-preview/next-pages)
## Troubleshooting
#### Relationships and/or uploads are not populating
If you are using relationships or uploads in your front-end application, and your front-end application runs on a different domain than your Payload server, you may need to configure [CORS](../configuration/overview) to allow requests to be made between the two domains. This includes sites that are running on a different port or subdomain. Similarly, if you are protecting resources behind user authentication, you may also need to configure [CSRF](../authentication/overview#csrf-protection) to allow cookies to be sent between the two domains. For example:
```ts
// payload.config.ts
{
// ...
// If your site is running on a different domain than your Payload server,
// This will allows requests to be made between the two domains
cors: {
[
'http://localhost:3001' // Your front-end application
],
},
// If you are protecting resources behind user authentication,
// This will allow cookies to be sent between the two domains
csrf: {
[
'http://localhost:3001' // Your front-end application
],
},
}
```
#### Relationships and/or uploads disappear after editing a document
It is possible that either you are setting an improper [`depth`](../getting-started/concepts#depth) in your initial request and/or your `useLivePreview` hook, or they're mismatched. Ensure that the `depth` parameter is set to the correct value, and that it matches exactly in both places. For example:
```tsx
// Your initial request
const { docs } = await payload.find({
collection: 'pages',
depth: 1, // Ensure this is set to the proper depth for your application
where: {
slug: {
equals: 'home',
}
}
})
```
```tsx
// Your hook
const { data } = useLivePreview<PageType>({
initialData: initialPage,
serverURL: PAYLOAD_SERVER_URL,
depth: 1, // Ensure this matches the depth of your initial request
})
```
#### Iframe refuses to connect
If your front-end application has set a [Content Security Policy](https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP) (CSP) that blocks the Admin Panel from loading your front-end application, the iframe will not be able to load your site. To resolve this, you can whitelist the Admin Panel's domain in your CSP by setting the `frame-ancestors` directive:
```plaintext
frame-ancestors: "self" localhost:* https://your-site.com;
```

View File

@@ -12,6 +12,10 @@ Live Preview works by rendering an iframe on the page that loads your front-end
{/* IMAGE OF LIVE PREVIEW HERE */}
<Banner type="warning">
Live Preview is currently in beta. You may use this feature in production, but please be aware that it is subject to change and may not be fully stable for all use cases. If you encounter any issues, please [report them](https://github.com/payloadcms/payload/issues/new?assignees=jacobsfletch&labels=possible-bug&projects=&title=Live%20Preview&template=1.bug_report.yml) with as much detail as possible.
</Banner>
## Setup
Setting up Live Preview is easy. You first need to enable it through the `admin.livePreview` property of your Payload config. It takes the following options:

View File

@@ -6,7 +6,9 @@ desc: The Payload Local API allows you to interact with your database and execut
keywords: local api, config, configuration, documentation, Content Management System, cms, headless, javascript, node, react, express
---
The Payload Local API gives you the ability to execute the same operations that are available through REST and GraphQL within Node, directly on your server. Here, you don't need to deal with server latency or network speed whatsoever and can interact directly with your database.
The Payload Local API gives you the ability to execute the same operations that are available through REST and GraphQL
within Node, directly on your server. Here, you don't need to deal with server latency or network speed whatsoever and
can interact directly with your database.
<Banner type="success">
<strong>Tip:</strong>
@@ -30,7 +32,9 @@ You can gain access to the currently running `payload` object via two ways:
##### Importing it
You can import or require `payload` into your own files after it's been initialized, but you need to make sure that your `import` / `require` statements come **after** you call `payload.init()`—otherwise Payload won't have been initialized yet. That might be obvious. To us, it's usually not.
You can import or require `payload` into your own files after it's been initialized, but you need to make sure that
your `import` / `require` statements come **after** you call `payload.init()`—otherwise Payload won't have been
initialized yet. That might be obvious. To us, it's usually not.
Example:
@@ -47,7 +51,8 @@ const afterChangeHook: CollectionAfterChangeHook = async () => {
##### Accessing from the `req`
Payload is available anywhere you have access to the Express `req` - including within your access control and hook functions.
Payload is available anywhere you have access to the Express `req` - including within your access control and hook
functions.
Example:
@@ -61,10 +66,11 @@ const afterChangeHook: CollectionAfterChangeHook = async ({ req: { payload } })
### Local options available
You can specify more options within the Local API vs. REST or GraphQL due to the server-only context that they are executed in.
You can specify more options within the Local API vs. REST or GraphQL due to the server-only context that they are
executed in.
| Local Option | Description |
| ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|--------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `collection` | Required for Collection operations. Specifies the Collection slug to operate against. |
| `data` | The data to use within the operation. Required for `create`, `update`. |
| `depth` | [Control auto-population](/docs/getting-started/concepts#depth) of nested relationship and upload fields. |
@@ -158,6 +164,22 @@ const result = await payload.findByID({
})
```
#### Count
```js
// Result will be an object with:
// {
// totalDocs: 10, // count of the documents satisfies query
// }
const result = await payload.count({
collection: 'posts', // required
locale: 'en',
where: {}, // pass a `where` query here
user: dummyUser,
overrideAccess: false,
})
```
#### Update by ID
```js
@@ -268,7 +290,8 @@ const result = await payload.delete({
## Auth Operations
If a collection has [`Authentication`](/docs/authentication/overview) enabled, additional Local API operations will be available:
If a collection has [`Authentication`](/docs/authentication/overview) enabled, additional Local API operations will be
available:
#### Login
@@ -319,10 +342,11 @@ const token = await payload.forgotPassword({
// token: 'o38jf0q34jfij43f3f...', // JWT used for auth
// user: { ... } // the user document that just logged in
// }
const result = await payload.forgotPassword({
const result = await payload.resetPassword({
collection: 'users', // required
data: {
// required
password: req.body.password, // the new password to set
token: 'afh3o2jf2p3f...', // the token generated from the forgotPassword operation
},
req: req, // pass an Express `req` which will be provided to all hooks
@@ -349,7 +373,7 @@ const result = await payload.unlock({
```js
// Returned result will be a boolean representing success or failure
const result = await payload.verify({
const result = await payload.verifyEmail({
collection: 'users', // required
token: 'afh3o2jf2p3f...', // the token saved on the user as `_verificationToken`
})
@@ -400,6 +424,73 @@ const result = await payload.updateGlobal({
})
```
## Next.js Conflict with Local API
There is a known issue when using the Local API with Next.js version `13.4.13` and higher. Next.js executes within a
separate child process, and Payload has not been initalized yet in these instances. That means that unless you
explicitly initialize Payload within your operation, it will not be running and return no data / an empty object.
As a workaround, we recommend leveraging the following pattern to determine and ensure Payload is initalized:
```
import dotenv from 'dotenv'
import path from 'path'
import type { Payload } from 'payload'
import payload from 'payload'
import type { InitOptions } from 'payload/config'
import { seed as seedData } from './seed'
dotenv.config({
path: path.resolve(__dirname, '../.env'),
})
let cached = (global as any).payload
if (!cached) {
cached = (global as any).payload = { client: null, promise: null }
}
interface Args {
initOptions?: Partial<InitOptions>
seed?: boolean
}
export const getPayloadClient = async ({ initOptions, seed }: Args = {}): Promise<Payload> => {
if (!process.env.DATABASE_URI) {
throw new Error('DATABASE_URI environment variable is missing')
}
if (!process.env.PAYLOAD_SECRET) {
throw new Error('PAYLOAD_SECRET environment variable is missing')
}
if (cached.client) {
return cached.client
}
if (!cached.promise) {
cached.promise = payload.init({
mongoURL: process.env.DATABASE_URI,
secret: process.env.PAYLOAD_SECRET,
local: initOptions?.express ? false : true,
...(initOptions || {}),
})
}
try {
process.env.PAYLOAD_DROP_DATABASE = seed ? 'true' : 'false'
cached.client = await cached.promise
if (seed) {
payload.logger.info('---- SEEDING DATABASE ----')
await seedData(payload)
}
} catch (e: unknown) {
cached.promise = null
throw e
}
return cached.client
}
```
To checkout how this works in a project, take a look at
our [custom server example](https://github.com/payloadcms/payload/blob/master/examples/custom-server/src/getPayload.ts).
## Example Script using Local API
The Local API is especially useful for running scripts

View File

@@ -1,10 +0,0 @@
---
title: Admin panel compatibility
label: Admin compatibility
order: 30
desc: NEEDS TO BE WRITTEN
---
<Banner type="success">
COMING SOON: This page is a work in progress. Check back soon for more information.
</Banner>

View File

@@ -1,7 +1,7 @@
---
title: Building Your Own Plugin
label: Build Your Own
order: 20
order: 50
desc: Starting to build your own plugin? Find everything you need and learn best practices with the Payload plugin template.
keywords: plugins, template, config, configuration, extensions, custom, documentation, Content Management System, cms, headless, javascript, node, react, express
---
@@ -84,7 +84,7 @@ If you&apos;re starting from scratch, you can easily setup a dev environment lik
```
mkdir dev
cd dev
npx create-payload-app
npx create-payload-app@latest
```
If you&apos;re using the plugin template, the dev folder is built out for you and the `samplePlugin` has already been installed in `dev/payload.config()`.
@@ -247,7 +247,7 @@ In the template, we have stubbed out a basic `onInitExtension` file that you can
### Webpack
If any of your files use server only packages such as fs, stripe, nodemailer, etc, they will need to be removed from the browser bundle. To do that, you can [alias the file imports with webpack](https://payloadcms.com/docs/admin/webpack#aliasing-server-only-modules).
If any of your files use server only packages such as fs, stripe, nodemailer, etc, they will need to be removed from the browser bundle. To do that, you can [alias the file imports with webpack](https://payloadcms.com/docs/admin/excluding-server-code#aliasing-server-only-modules).
When files are bundled for the browser, the import paths are essentially crawled to determine what files to include in the bundle. To prevent the server only files from making it into the bundle, we can alias their import paths to a file that can be included in the browser. This will short-circuit the import path crawling and ensure browser only code is bundled.
@@ -290,5 +290,5 @@ If you&apos;ve configured tests for your package, integrate them into your workf
The best way to share and allow others to use your plugin once it is complete is to publish an NPM package. This process is straightforward and well documented, find out more about [creating and publishing a NPM package here](https://docs.npmjs.com/creating-and-publishing-scoped-public-packages/).
##### Add payload-plugin topic tag:
Apply the tag **payload-plugin** to your GitHub repository. This will boost the visibility of your plugin and ensure it gets listed with [existing payload plugins](https://github.com/topics/payload-plugin).
##### Use [Semantic Versioning](https://semver.org/) (SemVar):
With the SemVar system you release version numbers that reflect the nature of changes (major, minor, patch). Ensure all major versions reference their Payload compatibility.
##### Use [Semantic Versioning](https://semver.org/) (SemVer):
With the SemVer system you release version numbers that reflect the nature of changes (major, minor, patch). Ensure all major versions reference their Payload compatibility.

View File

@@ -0,0 +1,400 @@
---
title: Form Builder Plugin
label: Form Builder
order: 20
desc: Easily build and manage forms from the admin panel. Send dynamic, personalized emails and even accept and process payments.
keywords: plugins, plugin, form, forms, form builder
---
[![NPM](https://img.shields.io/npm/v/@payloadcms/plugin-form-builder)](https://www.npmjs.com/package/@payloadcms/plugin-form-builder)
This plugin allows you to build and manage custom forms directly within the admin panel. Instead of hard-coding a new form into your website or application every time you need one, admins can simply define the schema for each form they need on-the-fly, and your front-end can map over this schema, render its own UI components, and match your brand's design system.
All form submissions are stored directly in your database and are managed directly from the admin panel. When forms are submitted, you can display a custom on-screen confirmation message to the user or redirect them to a dedicated confirmation page. You can even send dynamic, personalized emails derived from the form's data. For example, you may want to send a confirmation email to the user who submitted the form, and also send a notification email to your team.
Forms can be as simple or complex as you need, from a basic contact form, to a multi-step lead generation engine, or even a donation form that processes payment. You may not need to reach for third-party services like HubSpot or Mailchimp for this, but instead use your own first-party tooling, built directly into your own application.
<Banner type="info">
This plugin is completely open-source and the [source code can be found here](https://github.com/payloadcms/payload/tree/main/packages/plugin-form-builder). If you need help, check out our [Community Help](https://payloadcms.com/community-help). If you think you've found a bug, please [open a new issue](https://github.com/payloadcms/payload/issues/new?assignees=&labels=plugin%3A%20form-builder&template=bug_report.md&title=plugin-form-builder%3A) with as much detail as possible.
</Banner>
##### Core Features
- Build completely dynamic forms directly from the admin panel for a variety of use cases
- Render forms on your front-end using your own UI components and match your brand's design system
- Send dynamic, personalized emails upon form submission to multiple recipients, derived from the form's data
- Display a custom confirmation message or automatically redirect upon form submission
- Build dynamic prices based on form input to use for payment processing (optional)
## Installation
Install the plugin using any JavaScript package manager like [Yarn](https://yarnpkg.com), [NPM](https://npmjs.com), or [PNPM](https://pnpm.io):
```bash
yarn add @payloadcms/plugin-form-builder
```
## Basic Usage
In the `plugins` array of your [Payload config](https://payloadcms.com/docs/configuration/overview), call the plugin with [options](#options):
```ts
import { buildConfig } from 'payload/config'
import formBuilder from '@payloadcms/plugin-form-builder'
const config = buildConfig({
collections: [
{
slug: 'pages',
fields: [],
},
],
plugins: [
formBuilder({
// see below for a list of available options
})
],
})
export default config
```
### Options
#### `fields` (option)
The `fields` property is an object of field types to allow your admin editors to build forms with. To override default settings, pass either a boolean value or a partial [Payload Block](https://payloadcms.com/docs/fields/blocks#block-configs) _keyed to the block's slug_. See [Fields](#fields) for more details.
```ts
// payload.config.ts
formBuilder({
// ...
fields: {
text: true,
textarea: true,
select: true,
email: true,
state: true,
country: true,
checkbox: true,
number: true,
message: true,
payment: false
}
})
```
#### `redirectRelationships`
The `redirectRelationships` property is an array of collection slugs that, when enabled, are populated as options in the form's `redirect` field. This field is used to redirect the user to a dedicated confirmation page upon form submission (optional).
```ts
// payload.config.ts
formBuilder({
// ...
redirectRelationships: ['pages']
})
```
#### `beforeEmail`
The `beforeEmail` property is a [beforeChange](https://payloadcms.com/docs/hooks/globals#beforechange) hook that is called just after emails are prepared, but before they are sent. This is a great place to inject your own HTML template to add custom styles.
```ts
// payload.config.ts
formBuilder({
// ...
beforeEmail: (emailsToSend) => {
// modify the emails in any way before they are sent
return emails.map((email) => ({
...email,
html: email.html, // transform the html in any way you'd like (maybe wrap it in an html template?)
}))
}
})
```
#### `formOverrides`
Override anything on the `forms` collection by sending a [Payload Collection Config](https://payloadcms.com/docs/configuration/collections) to the `formOverrides` property.
```ts
// payload.config.ts
formBuilder({
// ...
formOverrides: {
slug: "contact-forms",
access: {
read: () => true,
update: () => false,
},
fields: [
{
name: "custom-field",
type: "text"
}
]
}
})
```
#### `formSubmissionOverrides`
Override anything on the `form-submissions` collection by sending a [Payload Collection Config](https://payloadcms.com/docs/configuration/collections) to the `formSubmissionOverrides` property.
<Banner type="warning">
By default, this plugin relies on [Payload access control](https://payloadcms.com/docs/access-control/collections) to restrict the `update` and `read` operations on the `form-submissions` collection. This is because _anyone_ should be able to create a form submission, even from a public-facing website, but _no one_ should be able to update a submission one it has been created, or read a submission unless they have permission. You can override this behavior or any other property as needed.
</Banner>
```ts
// payload.config.ts
formBuilder({
// ...
formSubmissionOverrides: {
slug: "leads",
}
})
```
#### `handlePayment`
The `handlePayment` property is a [beforeChange](<[beforeChange](https://payloadcms.com/docs/hooks/globals#beforechange)>) hook that is called upon form submission. You can integrate into any third-party payment processing API here to accept payment based on form input. You can use the `getPaymentTotal` function to calculate the total cost after all conditions have been applied. This is only applicable if the form has enabled the `payment` field.
First import the utility function. This will execute all of the price conditions that you have set in your form's `payment` field and returns the total price.
```ts
// payload.config.ts
import { getPaymentTotal } from '@payloadcms/plugin-form-builder';
```
Then in your plugin's config:
```ts
// payload.config.ts
formBuilder({
// ...
handlePayment: async ({ form, submissionData }) => {
// first calculate the price
const paymentField = form.fields?.find((field) => field.blockType === 'payment');
const price = getPaymentTotal({
basePrice: paymentField.basePrice,
priceConditions: paymentField.priceConditions,
fieldValues: submissionData,
});
// then asynchronously process the payment here
}
})
```
## Fields
Each field represents a form input. To override default settings pass either a boolean value or a partial [Payload Block](https://payloadcms.com/docs/fields/blocks) _keyed to the block's slug_. See [Field Overrides](#field-overrides) for more details on how to do this.
<Banner type="info">
<strong>Note:</strong>
"Fields" here is in reference to the _fields to build forms with_, not to be confused with the _fields of a collection_ which are set via `formOverrides.fields`.
</Banner>
#### Text
Maps to a `text` input in your front-end. Used to collect a simple string.
| Property | Type | Description |
| --- | --- | --- |
| `name` | string | The name of the field. |
| `label` | string | The label of the field. |
| `defaultValue` | string | The default value of the field. |
| `width` | string | The width of the field on the front-end. |
| `required` | checkbox | Whether or not the field is required when submitted. |
#### Textarea
Maps to a `textarea` input on your front-end. Used to collect a multi-line string.
| Property | Type | Description |
| --- | --- | --- |
| `name` | string | The name of the field. |
| `label` | string | The label of the field. |
| `defaultValue` | string | The default value of the field. |
| `width` | string | The width of the field on the front-end. |
| `required` | checkbox | Whether or not the field is required when submitted. |
#### Select
Maps to a `select` input on your front-end. Used to display a list of options.
| Property | Type | Description |
| --- | --- | --- |
| `name` | string | The name of the field. |
| `label` | string | The label of the field. |
| `defaultValue` | string | The default value of the field. |
| `width` | string | The width of the field on the front-end. |
| `required` | checkbox | Whether or not the field is required when submitted. |
| `options` | array | An array of objects with `label` and `value` properties. |
#### Email (field)
Maps to a `text` input with type `email` on your front-end. Used to collect an email address.
| Property | Type | Description |
| --- | --- | --- |
| `name` | string | The name of the field. |
| `label` | string | The label of the field. |
| `defaultValue` | string | The default value of the field. |
| `width` | string | The width of the field on the front-end. |
| `required` | checkbox | Whether or not the field is required when submitted. |
#### State
Maps to a `select` input on your front-end. Used to collect a US state.
| Property | Type | Description |
| --- | --- | --- |
| `name` | string | The name of the field. |
| `label` | string | The label of the field. |
| `defaultValue` | string | The default value of the field. |
| `width` | string | The width of the field on the front-end. |
| `required` | checkbox | Whether or not the field is required when submitted. |
#### Country
Maps to a `select` input on your front-end. Used to collect a country.
| Property | Type | Description |
| --- | --- | --- |
| `name` | string | The name of the field. |
| `label` | string | The label of the field. |
| `defaultValue` | string | The default value of the field. |
| `width` | string | The width of the field on the front-end. |
| `required` | checkbox | Whether or not the field is required when submitted. |
#### Checkbox
Maps to a `checkbox` input on your front-end. Used to collect a boolean value.
| Property | Type | Description |
| --- | --- | --- |
| `name` | string | The name of the field. |
| `label` | string | The label of the field. |
| `defaultValue` | checkbox | The default value of the field. |
| `width` | string | The width of the field on the front-end. |
| `required` | checkbox | Whether or not the field is required when submitted. |
#### Number
Maps to a `number` input on your front-end. Used to collect a number.
| Property | Type | Description |
| --- | --- | --- |
| `name` | string | The name of the field. |
| `label` | string | The label of the field. |
| `defaultValue` | string | The default value of the field. |
| `width` | string | The width of the field on the front-end. |
| `required` | checkbox | Whether or not the field is required when submitted. || `defaultValue` | number | The default value of the field. |
#### Message
Maps to a `RichText` component on your front-end. Used to display an arbitrary message to the user anywhere in the form.
| property | type | description |
| --- | --- | --- |
| `message` | richText | The message to display on the form. |
#### Payment
Add this field to your form if it should collect payment. Upon submission, the `handlePayment` callback is executed with the form and submission data. You can use this to integrate with any third-party payment processing API.
| property | type | description |
| --- | --- | --- |
| `name` | string | The name of the field. |
| `label` | string | The label of the field. |
| `defaultValue` | number | The default value of the field. |
| `width` | string | The width of the field on the front-end. |
| `required` | checkbox | Whether or not the field is required when submitted. |
| `priceConditions` | array | An array of objects that define the price conditions. See below for more details. |
##### Price Conditions
Each of the `priceConditions` are executed by the `getPaymentTotal` utility that this plugin provides. You can call this function in your `handlePayment` callback to dynamically calculate the total price of a form upon submission based on the user's input. For example, you could create a price condition that says "if the user selects 'yes' for this checkbox, add $10 to the total price".
| property | type | description |
| --- | --- | --- |
| `fieldToUse` | relationship | The field to use to determine the price. |
| `condition` | string | The condition to use to determine the price. |
| `valueForOperator` | string | The value to use for the operator. |
| `operator` | string | The operator to use to determine the price. |
| `valueType` | string | The type of value to use to determine the price. |
| `value` | string | The value to use to determine the price. |
#### Field Overrides
You can provide your own custom fields by passing a new [Payload Block](https://payloadcms.com/docs/fields/blocks#block-configs) object into `fields`. You can override or extend any existing fields by first importing the `fields` from the plugin:
```ts
import { fields } from '@payloadcms/plugin-form-builder'
```
Then merging it into your own custom field:
```ts
// payload.config.ts
formBuilder({
// ...
fields: {
text: {
...fields.text,
labels: {
singular: "Custom Text Field",
plural: "Custom Text Fields",
}
}
}
})
```
## Email
This plugin relies on the [email configuration](https://payloadcms.com/docs/email/overview) defined in your `payload.init()`. It will read from your config and attempt to send your emails using the credentials provided.
## TypeScript
All types can be directly imported:
```js
import {
PluginConfig,
Form,
FormSubmission,
FieldsConfig,
BeforePayment,
BeforeEmail,
HandlePayment,
...
} from "@payloadcms/plugin-form-builder/types";
```
## Examples
The [Examples Directory](https://github.com/payloadcms/payload/tree/main/examples) contains an official [Form Builder Plugin Example](https://github.com/payloadcms/payload/tree/main/examples/form-builder) which demonstrates exactly how to configure this plugin in Payload and implement it on your front-end. We've also included an in-depth walk-through of how to build a form from scratch in our [Form Builder Plugin Blog Post](https://payloadcms.com/blog/create-custom-forms-with-the-official-form-builder-plugin).
## Troubleshooting
Below are some common troubleshooting tips. To help other developers, please contribute to this section as you troubleshoot your own application.
##### SendGrid 403 Forbidden Error
- If you are using [SendGrid Link Branding](https://docs.sendgrid.com/ui/account-and-settings/how-to-set-up-link-branding) to remove the "via sendgrid.net" part of your email, you must also setup [Domain Authentication](https://docs.sendgrid.com/ui/account-and-settings/how-to-set-up-domain-authentication). This means you can only send emails from an address on this domain — so the `from` addresses in your form submission emails **_cannot_** be anything other than `something@your_domain.com`. This means that from `{{email}}` will not work, but `website@your_domain.com` will. You can still send the form's email address in the body of the email.
## Screenshots
![screenshot 1](https://github.com/payloadcms/plugin-form-builder/blob/main/images/screenshot-1.jpg?raw=true)
<br />
![screenshot 2](https://github.com/payloadcms/plugin-form-builder/blob/main/images/screenshot-2.jpg?raw=true)
<br />
![screenshot 3](https://github.com/payloadcms/plugin-form-builder/blob/main/images/screenshot-3.jpg?raw=true)
<br />
![screenshot 4](https://github.com/payloadcms/plugin-form-builder/blob/main/images/screenshot-4.jpg?raw=true)
<br />
![screenshot 5](https://github.com/payloadcms/plugin-form-builder/blob/main/images/screenshot-5.jpg?raw=true)
<br />
![screenshot 6](https://github.com/payloadcms/plugin-form-builder/blob/main/images/screenshot-6.jpg?raw=true)

View File

@@ -0,0 +1,239 @@
---
title: Nested Docs Plugin
label: Nested Docs
order: 20
desc: Nested documents in a parent, child, and sibling relationship.
keywords: plugins, nested, documents, parent, child, sibling, relationship
---
[![NPM](https://img.shields.io/npm/v/@payloadcms/plugin-nested-docs)](https://www.npmjs.com/package/@payloadcms/plugin-nested-docs)
This plugin allows you to easily nest the documents of your application inside of one another. It does so by adding a
new `parent` field onto each of your documents that, when selected, attaches itself to the parent's tree. When you edit
the great-great-grandparent of a document, for instance, all of its descendants are recursively updated. This is an
extremely powerful way of achieving hierarchy within a collection, such as parent/child relationship between pages.
Documents also receive a new `breadcrumbs` field. Once a parent is assigned, these breadcrumbs are populated based on
each ancestor up the tree. Breadcrumbs allow you to dynamically generate labels and URLs based on the document's
position in the hierarchy. Even if the slug of a parent document changes, or the entire tree is nested another level
deep, changes will cascade down the entire tree and all breadcrumbs will reflect those changes.
With this pattern you can perform whatever side-effects your applications needs on even the most deeply nested
documents. For example, you could easily add a custom `fullTitle` field onto each document and inject the parent's title
onto it, such as "Parent Title > Child Title". This would allow you to then perform searches and filters based on _that_
field instead of the original title. This is especially useful if you happen to have two documents with identical titles
but different parents.
<Banner type="info">
This plugin is completely open-source and the [source code can be found here](https://github.com/payloadcms/payload/tree/main/packages/plugin-nested-docs). If you need help, check out our [Community Help](https://payloadcms.com/community-help). If you think you've found a bug, please [open a new issue](https://github.com/payloadcms/payload/issues/new?assignees=&labels=plugin%3A%20nested-docs&template=bug_report.md&title=plugin-nested-docs%3A) with as much detail as possible.
</Banner>
##### Core features
- Automatically adds a `parent` relationship field to each document
- Allows for parent/child relationships between documents within the same collection
- Recursively updates all descendants when a parent is changed
- Automatically populates a `breadcrumbs` field with all ancestors up the tree
- Dynamically generate labels and URLs for each breadcrumb
- Supports localization
## Installation
Install the plugin using any JavaScript package manager like [Yarn](https://yarnpkg.com), [NPM](https://npmjs.com),
or [PNPM](https://pnpm.io):
```bash
yarn add @payloadcms/plugin-nested-docs
```
## Basic Usage
In the `plugins` array of your [Payload config](https://payloadcms.com/docs/configuration/overview), call the plugin
with [options](#options):
```ts
import { buildConfig } from 'payload/config'
import nestedDocs from '@payloadcms/plugin-nested-docs'
const config = buildConfig({
collections: [
{
slug: 'pages',
fields: [
{
name: 'title',
type: 'text',
},
{
name: 'slug',
type: 'text',
},
],
},
],
plugins: [
nestedDocs({
collections: ['pages'],
generateLabel: (_, doc) => doc.title,
generateURL: (docs) => docs.reduce((url, doc) => `${url}/${doc.slug}`, ''),
}),
],
})
export default config
```
### Fields
#### Parent
The `parent` relationship field is automatically added to every document which allows editors to choose another document
from the same collection to act as the direct parent.
#### Breadcrumbs
The `breadcrumbs` field is an array which dynamically populates all parent relationships of a document up to the top
level and stores the following fields.
| Field | Description |
|---------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `label` | The label of the breadcrumb. This field is automatically set to either the `collection.admin.useAsTitle` (if defined) or is set to the `ID` of the document. You can also dynamically define the `label` by passing a function to the options property of [`generateLabel`](#generateLabel). |
| `url` | The URL of the breadcrumb. By default, this field is undefined. You can manually define this field by passing a property called function to the plugin options property of [`generateURL`](#generateURL). |
### Options
#### `collections`
An array of collections slugs to enable nested docs.
#### `generateLabel`
Each `breadcrumb` has a required `label` field. By default, its value will be set to the collection's `admin.useAsTitle`
or fallback the the `ID` of the document.
You can also pass a function to dynamically set the `label` of your breadcrumb.
```ts
// payload.config.ts
nestedDocs({
//...
generateLabel: (_, doc) => doc.title // NOTE: 'title' is a hypothetical field
})
```
The function takes two arguments and returns a string:
| Argument | Type | Description |
|----------|----------|----------------------------------------------|
| `docs` | `Array` | An array of the breadcrumbs up to that point |
| `doc` | `Object` | The current document being edited |
#### `generateURL`
A function that allows you to dynamically generate each breadcrumb `url`. Each `breadcrumb` has an optional `url` field
which is undefined by default. For example, you might want to format a full URL to contain all breadcrumbs up to
that point, like `/about-us/company/our-team`.
```ts
// payload.config.ts
nestedDocs({
//...
generateURL: (docs) => docs.reduce((url, doc) => `${url}/${doc.slug}`, ''), // NOTE: 'slug' is a hypothetical field
})
```
| Argument | Type | Description |
|----------|----------|----------------------------------------------|
| `docs` | `Array` | An array of the breadcrumbs up to that point |
| `doc` | `Object` | The current document being edited |
#### `parentFieldSlug`
When defined, the `parent` field will not be provided for you automatically, and instead, expects you to add your
own `parent` field to each collection manually. This gives you complete control over where you put the field in your
admin dashboard, etc. Set this property to the `name` of your custom field.
#### `breadcrumbsFieldSlug`
When defined, the `breadcrumbs` field will not be provided for you, and instead, expects you to add your
own `breadcrumbs` field to each collection manually. Set this property to the `name` of your custom field.
<Banner type="info">
<strong>Note:</strong>
<br />
If you opt out of automatically being provided a `parent` or `breadcrumbs` field, you need to make sure that both fields are placed at the top-level of your document. They cannot exist within any nested data structures like a `group`, `array`, or `blocks`.
</Banner>
## Overrides
You can also extend the built-in `parent` and `breadcrumbs` fields per collection by using the `createParentField`
and `createBreadcrumbField` methods. They will merge your customizations overtop the plugin's base field configurations.
```ts
import { CollectionConfig } from "payload/types";
import { createParentField } from "@payloadcms/plugin-nested-docs/fields";
import { createBreadcrumbsField } from "@payloadcms/plugin-nested-docs/fields";
const examplePageConfig: CollectionConfig = {
slug: "pages",
fields: [
createParentField(
// First argument is equal to the slug of the collection
// that the field references
"pages",
// Second argument is equal to field overrides that you specify,
// which will be merged into the base parent field config
{
admin: {
position: "sidebar",
},
// Note: if you override the `filterOptions` of the `parent` field,
// be sure to continue to prevent the document from referencing itself as the parent like this:
// filterOptions: ({ id }) => ({ id: {not_equals: id }})`
}
),
createBreadcrumbsField(
// First argument is equal to the slug of the collection
// that the field references
"pages",
// Argument equal to field overrides that you specify,
// which will be merged into the base `breadcrumbs` field config
{
label: "Page Breadcrumbs",
}
),
],
};
```
<Banner type="warning">
<strong>Note:</strong>
<br />
If overriding the `name` of either `breadcrumbs` or `parent` fields, you must specify the `breadcrumbsFieldSlug` or `parentFieldSlug` respectively.
</Banner>
## Localization
This plugin supports localization by default. If the `localization` property is set in your Payload config,
the `breadcrumbs` field is automatically localized. For more details on how localization works in Payload, see
the [Localization](https://payloadcms.com/docs/configuration/localization) docs.
## TypeScript
All types can be directly imported:
```ts
import { PluginConfig, GenerateURL, GenerateLabel } from '@payloadcms/plugin-nested-docs/types'
```
## Examples
The [Examples Directory](https://github.com/payloadcms/payload/tree/main/examples) contains an
official [Nested Docs Plugin Example](https://github.com/payloadcms/payload/tree/main/examples/nested-docs) which
demonstrates exactly how to configure this plugin in Payload and implement it on your front-end.
The [Templates Directory](https://github.com/payloadcms/payload/tree/main/templates) also contains an
official [Website Template](https://github.com/payloadcms/payload/tree/main/templates/website)
and [E-commerce Template](https://github.com/payloadcms/payload/tree/main/templates/ecommerce), both of which use this
plugin.

View File

@@ -144,6 +144,10 @@ export default addLastModified
### Available Plugins
You can discover existing plugins by browsing the `payload-plugin` topic on [GitHub](https://github.com/topics/payload-plugin).
Payload supports both official plugins, maintained by the Payload team, and community plugins, developed by external contributors.
You can discover existing plugins by browsing the `payload-plugin` topic on [GitHub](https://github.com/topics/payload-plugin). These plugins offer a wide range of functionality. Some are maintained by the Payload team, while others are community-built. While we encourage users to explore them, please note that only official plugins are maintained and supported by the Payload team. For community plugins, support may vary as they are developed and maintained independently.
For maintainers building plugins for others to use, please add the topic to help others find it. If you would like one to be built by the core Payload team, [open a Feature Request](https://github.com/payloadcms/payload/discussions) in our GitHub Discussions board. We would be happy to review your code and maybe feature you and your plugin where appropriate.
For a list of official plugins, check the [Payload monorepo](https://github.com/payloadcms/payload/tree/main/packages).

View File

@@ -0,0 +1,75 @@
---
title: Redirects Plugin
label: Redirects
order: 20
desc: Automatically create redirects for your Payload application
keywords: plugins, redirects, redirect, plugin, payload, cms, seo, indexing, search, search engine
---
[![NPM](https://img.shields.io/npm/v/@payloadcms/plugin-redirects)](https://www.npmjs.com/package/@payloadcms/plugin-redirects)
This plugin allows you to easily manage redirects for your application from within your admin panel. It does so by adding a `redirects` collection to your config that allows you specify a redirect from one URL to another. Your front-end application can use this data to automatically redirect users to the correct page using proper HTTP status codes. This is useful for SEO, indexing, and search engine ranking when re-platforming or when changing your URL structure.
For example, if you have a page at `/about` and you want to change it to `/about-us`, you can create a redirect from the old page to the new one, then you can use this data to write HTTP redirects into your front-end application. This will ensure that users are redirected to the correct page without penalty because search engines are notified of the change at the request level. This is a very lightweight plugin that will allow you to integrate managed redirects for any front-end framework.
<Banner type="info">
This plugin is completely open-source and the [source code can be found here](https://github.com/payloadcms/payload/tree/main/packages/plugin-redirects). If you need help, check out our [Community Help](https://payloadcms.com/community-help). If you think you've found a bug, please [open a new issue](https://github.com/payloadcms/payload/issues/new?assignees=&labels=plugin%3A%25redirects&template=bug_report.md&title=plugin-redirects%3A) with as much detail as possible.
</Banner>
##### Core features
- Adds a `redirects` collection to your config that:
- includes a `from` and `to` fields
- allows `to` to be a document reference
## Installation
Install the plugin using any JavaScript package manager like [Yarn](https://yarnpkg.com), [NPM](https://npmjs.com), or [PNPM](https://pnpm.io):
```bash
yarn add @payloadcms/plugin-redirects
```
## Basic Usage
In the `plugins` array of your [Payload config](https://payloadcms.com/docs/configuration/overview), call the plugin with [options](#options):
```ts
import { buildConfig } from "payload/config";
import redirects from "@payloadcms/plugin-redirects";
const config = buildConfig({
collections: [
{
slug: "pages",
fields: [],
},
],
plugins: [
redirects({
collections: ["pages"],
}),
],
});
export default config;
```
### Options
| Option | Type | Description |
| --- | --- | --- |
| `collections` | `string[]` | An array of collection slugs to populate in the `to` field of each redirect. |
| `overrides` | `object` | A partial collection config that allows you to override anything on the `redirects` collection. |
## TypeScript
All types can be directly imported:
```ts
import { PluginConfig } from "@payloadcms/plugin-redirects/types";
```
## Examples
The [Examples Directory](https://github.com/payloadcms/payload/tree/main/examples) contains an official [Redirects Plugin Example](https://github.com/payloadcms/payload/tree/main/examples/redirects) which demonstrates exactly how to configure this plugin in Payload and implement it on your front-end. The [Templates Directory](https://github.com/payloadcms/payload/tree/main/templates) also contains an official [Website Template](https://github.com/payloadcms/payload/tree/main/templates/website) and [E-commerce Template](https://github.com/payloadcms/payload/tree/main/templates/ecommere), both of which use this plugin.

146
docs/plugins/search.mdx Normal file
View File

@@ -0,0 +1,146 @@
---
title: Search Plugin
label: Search
order: 20
desc: Generates records of your documents that are extremely fast to search on.
keywords: plugins, search, search plugin, search engine, search index, search results, search bar, search box, search field, search form, search input
---
[![NPM](https://img.shields.io/npm/v/@payloadcms/plugin-search)](https://www.npmjs.com/package/@payloadcms/plugin-search)
This plugin generates records of your documents that are extremely fast to search on. It does so by creating a new `search` collection that is indexed in the database then saving a static copy of each of your documents using only search-critical data. Search records are automatically created, synced, and deleted behind-the-scenes as you manage your application's documents.
For example, if you have a posts collection that is extremely large and complex, this would allow you to sync just the title, excerpt, and slug of each post so you can query on _that_ instead of the original post directly. Search records are static, so querying them also has the significant advantage of bypassing any hooks that may present be on the original documents. You define exactly what data is synced, and you can even modify or fallback this data before it is saved on a per-document basis.
To query search results, use all the existing Payload APIs that you are already familiar with. You can also prioritize search results by setting a custom priority for each collection. For example, you may want to list blog posts before pages. Or you may want one specific post to always take appear first. Search records are given a `priority` field that can be used as the `?sort=` parameter in your queries.
This plugin is a great way to implement a fast, immersive search experience such as a search bar in a front-end application. Many applications may not need the power and complexity of a third-party service like Algolia or ElasticSearch. This plugin provides a first-party alternative that is easy to set up and runs entirely on your own database.
<Banner type="info">
This plugin is completely open-source and the [source code can be found here](https://github.com/payloadcms/payload/tree/main/packages/plugin-search). If you need help, check out our [Community Help](https://payloadcms.com/community-help). If you think you've found a bug, please [open a new issue](https://github.com/payloadcms/payload/issues/new?assignees=&labels=plugin%3A%20search&template=bug_report.md&title=plugin-search%3A) with as much detail as possible.
</Banner>
##### Core Features
- Automatically adds an indexed `search` collection to your database
- Automatically creates, syncs, and deletes search records as you manage your documents
- Saves only search-critical data that you define (e.g. title, excerpt, etc.)
- Allows you to query search results using first-party Payload APIs
- Allows you to query documents without triggering any of their underlying hooks
- Allows you to easily prioritize search results by collection or document
## Installation
Install the plugin using any JavaScript package manager like [Yarn](https://yarnpkg.com), [NPM](https://npmjs.com), or [PNPM](https://pnpm.io):
```bash
yarn add @payloadcms/plugin-search
```
## Basic Usage
In the `plugins` array of your [Payload config](https://payloadcms.com/docs/configuration/overview), call the plugin with [options](#options):
```js
import { buildConfig } from 'payload/config'
import search from '@payloadcms/plugin-search'
const config = buildConfig({
collections: [
{
slug: 'pages',
fields: [],
},
{
slug: 'posts',
fields: [],
},
],
plugins: [
search({
collections: ['pages', 'posts'],
defaultPriorities: {
pages: 10,
posts: 20,
},
}),
],
})
export default config
```
### Options
#### `collections`
The `collections` property is an array of collection slugs to enable syncing to search. Enabled collections receive a `beforeChange` and `afterDelete` hook that creates, updates, and deletes its respective search record as it changes over time.
#### `defaultPriorities`
This plugin automatically adds a `priority` field to the `search` collection that can be used as the `?sort=` parameter in your queries. For example, you may want to list blog posts before pages. Or you may want one specific post to always take appear first.
The `defaultPriorities` property is used to set a fallback `priority` on search records during the `create` operation. It accepts an object with keys that are your collection slugs and values that can either be a number or a function that returns a number. The function receives the `doc` as an argument, which is the document being created.
```ts
// payload.config.ts
{
// ...
searchPlugin({
defaultPriorities: {
pages: ({ doc }) => (doc.title.startsWith('Hello, world!') ? 1 : 10),
posts: 20,
},
}),
}
```
#### `searchOverrides`
This plugin automatically creates the `search` collection, but you can override anything on this collection via the `searchOverrides` property. It accepts anything from the [Payload Collection Config](https://payloadcms.com/docs/configuration/collections) and merges it in with the default `search` collection config provided by the plugin.
```ts
// payload.config.ts
{
// ...
searchPlugin({
searchOverrides: {
slug: 'search-results',
},
}),
}
```
#### `beforeSync`
Before creating or updating a search record, the `beforeSync` function runs. This is an [afterChange](https://payloadcms.com/docs/hooks/globals#afterchange) hook that allows you to modify the data or provide fallbacks before its search record is created or updated.
```ts
// payload.config.ts
{
// ...
searchPlugin({
beforeSync: ({ originalDoc, searchDoc }) => ({
...searchDoc,
// Modify your docs in any way here, this can be async
excerpt: originalDoc?.excerpt || 'This is a fallback excerpt',
}),
}),
}
```
#### `syncDrafts`
When `syncDrafts` is true, draft documents will be synced to search. This is false by default. You must have [Payload Drafts](https://payloadcms.com/docs/versions/drafts) enabled for this to apply.
#### `deleteDrafts`
If true, will delete documents from search whose status changes to draft. This is true by default. You must have [Payload Drafts](https://payloadcms.com/docs/versions/drafts) enabled for this to apply.
## TypeScript
All types can be directly imported:
```ts
import type { SearchConfig, BeforeSync } from '@payloadcms/plugin-search/types'
```

133
docs/plugins/sentry.mdx Normal file
View File

@@ -0,0 +1,133 @@
---
title: Sentry Plugin
label: Sentry
order: 20
desc: Integrate Sentry error tracking into your Payload application
keywords: plugins, sentry, error, tracking, monitoring, logging, bug, reporting, performance
---
[![NPM](https://img.shields.io/npm/v/@payloadcms/plugin-sentry)](https://www.npmjs.com/package/@payloadcms/plugin-sentry)
This plugin allows you to integrate [Sentry](https://sentry.io/) seamlessly with your [Payload](https://github.com/payloadcms/payload) application.
### What is Sentry?
Sentry is a powerful error tracking and performance monitoring tool that helps developers identify, diagnose, and resolve issues in their applications.
<Banner type="success">
Sentry does smart stuff with error data to make bugs easier to find and fix. - [sentry.io](https://sentry.io/)
</Banner>
This multi-faceted software offers a range of features that will help you manage errors with greater ease and ultimately ensure your application is running smoothly:
#### Core Features
- **Error Tracking**: Instantly captures and logs errors as they occur in your application
- **Performance Monitoring**: Tracks application performance to identify slowdowns and bottlenecks
- **Detailed Reports**: Provides comprehensive insights into errors, including stack traces and context
- **Alerts and Notifications**: Send and customize event-triggered notifications
- **Issue Grouping, Filtering and Search**: Automatically groups similar errors, and allows filtering and searching issues by custom criteria
- **Breadcrumbs**: Records user actions and events leading up to an error
- **Integrations**: Connects with various tools and services for enhanced workflow and issue management
<Banner type="info">
This plugin is completely open-source and the [source code can be found here](https://github.com/payloadcms/payload/tree/main/packages/plugin-sentry). If you need help, check out our [Community Help](https://payloadcms.com/community-help). If you think you've found a bug, please [open a new issue](https://github.com/payloadcms/payload/issues/new?assignees=&labels=plugin%3A%20seo&template=bug_report.md&title=plugin-seo%3A) with as much detail as possible.
</Banner>
## Installation
Install the plugin using any JavaScript package manager like [Yarn](https://yarnpkg.com), [NPM](https://npmjs.com), or [PNPM](https://pnpm.io):
```bash
yarn add @payloadcms/plugin-sentry
```
## Basic Usage
In the `plugins` array of your [Payload config](https://payloadcms.com/docs/configuration/overview), call the plugin and pass in your Sentry DSN as an option.
```ts
import { buildConfig } from 'payload/config'
import { sentry } from '@payloadcms/plugin-sentry'
import { Pages, Media } from './collections'
const config = buildConfig({
collections: [Pages, Media],
plugins: [
sentry({
dsn: 'https://61edebas776889984d323d777@o4505289711681536.ingest.sentry.io/4505357433352176',
}),
],
})
export default config
```
## Options
- `dsn` : string | **required**
Sentry automatically assigns a DSN when you create a project, the unique DSN informs Sentry where to send events so they are associated with the correct project.
<Banner type="warning">
You can find your project DSN (Data Source Name) by visiting [sentry.io](sentry.io) and navigating to your [Project] > Settings > Client Keys (DSN).
</Banner>
- `enabled`: boolean | optional
Set to false to disable the plugin. Defaults to true.
- `init` : ClientOptions | optional
Sentry allows a variety of options to be passed into the Sentry.init() function, see the full list of options [here](https://docs.sentry.io/platforms/node/guides/express/configuration/options).
- `requestHandler` : RequestHandlerOptions | optional
Accepts options that let you decide what data should be included in the event sent to Sentry, checkout the options [here](https://docs.sentry.io/platforms/node/guides/express/configuration/options).
- `captureErrors`: number[] | optional
By default, `Sentry.errorHandler` will capture only errors with a status code of 500 or higher. To capture additional error codes, pass the values as numbers in an array.
To see all options available, visit the [Sentry Docs](https://docs.sentry.io/platforms/node/guides/express/configuration/options).
### Example
Configure any of these options by passing them to the plugin:
```ts
import { buildConfig } from 'payload/config'
import { sentry } from '@payloadcms/plugin-sentry'
import { Pages, Media } from './collections'
const config = buildConfig({
collections: [Pages, Media],
plugins: [
sentry({
dsn: 'https://61edebas777689984d323d777@o4505289711681536.ingest.sentry.io/4505357433352176',
options: {
init: {
debug: true,
environment: 'development',
tracesSampleRate: 1.0,
},
requestHandler: {
serverName: false,
user: ['email'],
},
captureErrors: [400, 403, 404],
},
}),
],
})
export default config
```
## TypeScript
All types can be directly imported:
```ts
import { PluginOptions } from '@payloadcms/plugin-sentry/types'
```

214
docs/plugins/seo.mdx Normal file
View File

@@ -0,0 +1,214 @@
---
title: SEO Plugin
label: SEO
order: 20
desc: Manage SEO metadata from your Payload admin
keywords: plugins, seo, meta, search, engine, ranking, google
---
[![NPM](https://img.shields.io/npm/v/@payloadcms/plugin-seo)](https://www.npmjs.com/package/@payloadcms/plugin-seo)
This plugin allows you to easily manage SEO metadata for your application from within your admin panel. When enabled on your collections and globals, it adds a new `meta` field group containing `title`, `description`, and `image` by default. Your front-end application can then use this data to render meta tags however your application requires. For example, you would inject a `title` tag into the `<head>` of your page using `meta.title` as its content.
As users are editing documents within the admin panel, they have the option to "auto-generate" these fields. When clicked, this plugin will execute your own custom functions that re-generate the title, description, and image. This way you can build your own SEO writing assistance directly into your application. For example, you could append your site name onto the page title, or use the document's excerpt field as the description, or even integrate with some third-party API to generate the image using AI.
To help you visualize what your page might look like in a search engine, a preview is rendered on page just beneath the meta fields. This preview is updated in real-time as you edit your metadata. There are also visual indicators to help you write effective meta, such as a character counter for the title and description fields. You can even inject your own custom fields into the `meta` field group as your application requires, like `og:title` or `json-ld`. If you've ever used something like Yoast SEO, this plugin might feel very familiar.
<Banner type="info">
This plugin is completely open-source and the [source code can be found here](https://github.com/payloadcms/payload/tree/main/packages/plugin-seo). If you need help, check out our [Community Help](https://payloadcms.com/community-help). If you think you've found a bug, please [open a new issue](https://github.com/payloadcms/payload/issues/new?assignees=&labels=plugin%3A%20seo&template=bug_report.md&title=plugin-seo%3A) with as much detail as possible.
</Banner>
##### Core features
- Adds a `meta` field group to every SEO-enabled collection or global
- Allows you to define custom functions to auto-generate metadata
- Displays hints and indicators to help content editor write effective meta
- Renders a snippet of what a search engine might display
- Extendable so you can define custom fields like `og:title` or `json-ld`
- Soon will support dynamic variable injection
## Installation
Install the plugin using any JavaScript package manager like [Yarn](https://yarnpkg.com), [NPM](https://npmjs.com), or [PNPM](https://pnpm.io):
```bash
yarn add @payloadcms/plugin-seo
```
## Basic Usage
In the `plugins` array of your [Payload config](https://payloadcms.com/docs/configuration/overview), call the plugin with [options](#options):
```ts
import { buildConfig } from 'payload/config';
import seoPlugin from '@payloadcms/plugin-seo';
const config = buildConfig({
collections: [
{
slug: 'pages',
fields: []
},
{
slug: 'media',
upload: {
staticDir: // path to your static directory,
},
fields: []
}
],
plugins: [
seoPlugin({
collections: [
'pages',
],
uploadsCollection: 'media',
generateTitle: ({ doc }) => `Website.com — ${doc.title.value}`,
generateDescription: ({ doc }) => doc.excerpt
})
]
});
export default config;
```
### Options
##### `collections`
An array of collections slugs to enable SEO. Enabled collections receive a `meta` field which is an object of title, description, and image subfields.
##### `globals`
An array of global slugs to enable SEO. Enabled globals receive a `meta` field which is an object of title, description, and image subfields.
##### `fields`
An array of fields that allows you to inject your own custom fields onto the `meta` field group. The following fields are provided by default:
- `title`: text
- `description`: textarea
- `image`: upload (if an `uploadsCollection` is provided)
- `preview`: ui
##### `uploadsCollection`
Set the `uploadsCollection` to your application's upload-enabled collection slug. This is used to provide an `image` field on the `meta` field group.
##### `tabbedUI`
When the `tabbedUI` property is `true`, it appends an `SEO` tab onto your config using Payload's [Tabs Field](https://payloadcms.com/docs/fields/tabs). If your collection is not already tab-enabled, meaning the first field in your config is not of type `tabs`, then one will be created for you called `Content`. Defaults to `false`.
<Banner type="info">
If you wish to continue to use top-level or sidebar fields with `tabbedUI`, you must not let the default `Content` tab get created for you (see the note above). Instead, you must define the first field of your config with type `tabs` and place all other fields adjacent to this one.
</Banner>
##### `generateTitle`
A function that allows you to return any meta title, including from document's content.
```ts
// payload.config.ts
{
// ...
seoPlugin({
generateTitle: ({ ...docInfo, doc, locale }) => `Website.com — ${doc?.title?.value}`,
})
}
```
##### `generateDescription`
A function that allows you to return any meta description, including from document's content.
```ts
// payload.config.ts
{
// ...
seoPlugin({
generateDescription: ({ ...docInfo, doc, locale }) => doc?.excerpt?.value
})
}
```
##### `generateImage`
A function that allows you to return any meta image, including from document's content.
```ts
// payload.config.ts
{
// ...
seoPlugin({
generateImage: ({ ...docInfo, doc, locale }) => doc?.featuredImage?.value
})
}
```
##### `generateURL`
A function called by the search preview component to display the actual URL of your page.
```ts
// payload.config.ts
{
// ...
seoPlugin({
generateURL: ({ ...docInfo, doc, locale }) => `https://yoursite.com/${collection?.slug}/${doc?.slug?.value}`
})
}
```
#### `interfaceName`
Rename the meta group interface name that is generated for TypeScript and GraphQL.
```ts
// payload.config.ts
{
// ...
seoPlugin({
interfaceName: 'customInterfaceNameSEO'
})
}
```
#### `fieldOverrides`
Pass any valid field props to the base fields: Title, Description or Image.
```ts
// payload.config.ts
seoPlugin({
// ...
fieldOverrides: {
title: {
required: true,
},
description: {
localized: true,
},
},
})
```
## TypeScript
All types can be directly imported:
```ts
import {
PluginConfig,
GenerateTitle,
GenerateDescription
GenerateURL
} from '@payloadcms/plugin-seo/types';
```
## Examples
The [Templates Directory](https://github.com/payloadcms/payload/tree/main/templates) contains an official [Website Template](https://github.com/payloadcms/payload/tree/main/templates/website) and [E-commerce Template](https://github.com/payloadcms/payload/tree/main/templates/ecommerce) which demonstrates exactly how to configure this plugin in Payload and implement it on your front-end.
## Screenshots
![image](https://user-images.githubusercontent.com/70709113/163850633-f3da5f8e-2527-4688-bc79-17233307a883.png)

291
docs/plugins/stripe.mdx Normal file
View File

@@ -0,0 +1,291 @@
---
title: Stripe Plugin
label: Stripe
order: 20
desc: Easily accept payments with Stripe
keywords: plugins, stripe, payments, ecommerce
---
[![NPM](https://img.shields.io/npm/v/@payloadcms/plugin-stripe)](https://www.npmjs.com/package/@payloadcms/plugin-stripe)
With this plugin you can easily integrate [Stripe](https://stripe.com) into Payload. Simply provide your Stripe credentials and this plugin will open up a two-way communication channel between the two platforms. This enables you to easily sync data back and forth, as well as proxy the Stripe REST API through Payload's access control. Use this plugin to completely offload billing to Stripe and retain full control over your application's data.
For example, you might be building an e-commerce or SaaS application, where you have a `products` or a `plans` collection that requires either a one-time payment or a subscription. You can to tie each of these products to Stripe, then easily subscribe to billing-related events to perform your application's business logic, such as active purchases or subscription cancellations.
To build a checkout flow on your front-end you can either use [Stripe Checkout](https://stripe.com/payments/checkout), or you can also build a completely custom checkout experience from scratch using [Stripe Web Elements](https://stripe.com/docs/payments/elements). Then to build fully custom, secure customer dashboards, you can leverage Payload's access control to restrict access to your Stripe resources so your users never have to leave your site to manage their accounts.
The beauty of this plugin is the entirety of your application's content and business logic can be handled in Payload while Stripe handles solely the billing and payment processing. You can build a completely proprietary application that is endlessly customizable and extendable, on APIs and databases that you own. Hosted services like Shopify or BigCommerce might fracture your application's content then charge you for access.
<Banner type="info">
This plugin is completely open-source and the [source code can be found here](https://github.com/payloadcms/payload/tree/main/packages/plugin-stripe). If you need help, check out our [Community Help](https://payloadcms.com/community-help). If you think you've found a bug, please [open a new issue](https://github.com/payloadcms/payload/issues/new?assignees=&labels=plugin%3A%20stripe&template=bug_report.md&title=plugin-stripe%3A) with as much detail as possible.
</Banner>
##### Core features
- Hides your Stripe credentials when shipping SaaS applications
- Allows restricted keys through [Payload access control](https://payloadcms.com/docs/access-control/overview)
- Enables a two-way communication channel between Stripe and Payload
- Proxies the [Stripe REST API](https://stripe.com/docs/api)
- Proxies [Stripe webhooks](https://stripe.com/docs/webhooks)
- Automatically syncs data between the two platforms
## Installation
Install the plugin using any JavaScript package manager like [Yarn](https://yarnpkg.com), [NPM](https://npmjs.com), or [PNPM](https://pnpm.io):
```bash
yarn add @payloadcms/plugin-stripe
```
## Basic Usage
In the `plugins` array of your [Payload config](https://payloadcms.com/docs/configuration/overview), call the plugin with [options](#options):
```ts
import { buildConfig } from 'payload/config'
import stripePlugin from '@payloadcms/plugin-stripe'
const config = buildConfig({
plugins: [
stripePlugin({
stripeSecretKey: process.env.STRIPE_SECRET_KEY,
}),
],
})
export default config
```
### Options
| Option | Type | Default | Description |
| --- | --- | --- | --- |
| `stripeSecretKey` \* | string | `undefined` | Your Stripe secret key |
| `stripeWebhooksEndpointSecret` | string | `undefined` | Your Stripe webhook endpoint secret |
| `rest` | boolean | `false` | When `true`, opens the `/api/stripe/rest` endpoint |
| `webhooks` | object \| function | `undefined` | Either a function to handle all webhooks events, or an object of Stripe webhook handlers, keyed to the name of the event |
| `sync` | array | `undefined` | An array of sync configs |
| `logs` | boolean | `false` | When `true`, logs sync events to the console as they happen |
_\* An asterisk denotes that a property is required._
## Endpoints
The following custom endpoints are automatically opened for you:
| Endpoint | Method | Description |
| --- | --- | --- |
| `/api/stripe/rest` | `POST` | Proxies the [Stripe REST API](https://stripe.com/docs/api) behind [Payload access control](https://payloadcms.com/docs/access-control/overview) and returns the result. See the [REST Proxy](#stripe-rest-proxy) section for more details. |
| `/stripe/webhooks` | `POST` | Handles all Stripe webhook events |
##### Stripe REST Proxy
If `rest` is true, proxies the [Stripe REST API](https://stripe.com/docs/api) behind [Payload access control](https://payloadcms.com/docs/access-control/overview) and returns the result. If you need to proxy the API server-side, use the [stripeProxy](#node) function.
```ts
const res = await fetch(`/api/stripe/rest`, {
method: 'POST',
credentials: 'include',
headers: {
'Content-Type': 'application/json',
// Authorization: `JWT ${token}` // NOTE: do this if not in a browser (i.e. curl or Postman)
},
body: JSON.stringify({
stripeMethod: 'stripe.subscriptions.list',
stripeArgs: [
{
customer: 'abc',
},
],
}),
})
```
<Banner type="info">
<strong>Note:</strong>
<br />
The `/api` part of these routes may be different based on the settings defined in your Payload config.
</Banner>
## Webhooks
[Stripe webhooks](https://stripe.com/docs/webhooks) are used to sync from Stripe to Payload. Webhooks listen for events on your Stripe account so you can trigger reactions to them. Follow the steps below to enable webhooks.
Development:
1. Login using Stripe cli `stripe login`
1. Forward events to localhost `stripe listen --forward-to localhost:3000/stripe/webhooks`
1. Paste the given secret into your `.env` file as `STRIPE_WEBHOOKS_ENDPOINT_SECRET`
Production:
1. Login and [create a new webhook](https://dashboard.stripe.com/test/webhooks/create) from the Stripe dashboard
1. Paste `YOUR_DOMAIN_NAME/stripe/webhooks` as the "Webhook Endpoint URL"
1. Select which events to broadcast
1. Paste the given secret into your `.env` file as `STRIPE_WEBHOOKS_ENDPOINT_SECRET`
1. Then, handle these events using the `webhooks` portion of this plugin's config:
```ts
import { buildConfig } from 'payload/config'
import stripePlugin from '@payloadcms/plugin-stripe'
const config = buildConfig({
plugins: [
stripePlugin({
stripeSecretKey: process.env.STRIPE_SECRET_KEY,
stripeWebhooksEndpointSecret: process.env.STRIPE_WEBHOOKS_ENDPOINT_SECRET,
webhooks: {
'customer.subscription.updated': ({ event, stripe, stripeConfig }) => {
// do something...
},
},
// NOTE: you can also catch all Stripe webhook events and handle the event types yourself
// webhooks: (event, stripe, stripeConfig) => {
// switch (event.type): {
// case 'customer.subscription.updated': {
// // do something...
// break;
// }
// default: {
// break;
// }
// }
// }
}),
],
})
export default config
```
For a full list of available webhooks, see [here](https://stripe.com/docs/cli/trigger#trigger-event).
## Node
On the server you should interface with Stripe directly using the [stripe](https://www.npmjs.com/package/stripe) npm module. That might look something like this:
```ts
import Stripe from 'stripe'
const stripeSecretKey = process.env.STRIPE_SECRET_KEY
const stripe = new Stripe(stripeSecretKey, { apiVersion: '2022-08-01' })
export const MyFunction = async () => {
try {
const customer = await stripe.customers.create({
email: data.email,
})
// do something...
} catch (error) {
console.error(error.message)
}
}
```
Alternatively, you can interface with the Stripe using the `stripeProxy`, which is exactly what the `/api/stripe/rest` endpoint does behind-the-scenes. Here's the same example as above, but piped through the proxy:
```ts
import { stripeProxy } from '@payloadcms/plugin-stripe'
export const MyFunction = async () => {
try {
const customer = await stripeProxy({
stripeSecretKey: process.env.STRIPE_SECRET_KEY,
stripeMethod: 'customers.create',
stripeArgs: [
{
email: data.email,
},
],
})
if (customer.status === 200) {
// do something...
}
if (customer.status >= 400) {
throw new Error(customer.message)
}
} catch (error) {
console.error(error.message)
}
}
```
## Sync
This option will setup a basic sync between Payload collections and Stripe resources for you automatically. It will create all the necessary hooks and webhooks handlers, so the only thing you have to do is map your Payload fields to their corresponding Stripe properties. As documents are created, updated, and deleted from either Stripe or Payload, the changes are reflected on either side.
<Banner type="info">
<strong>Note:</strong>
<br />
If you wish to enable a _two-way_ sync, be sure to setup [`webhooks`](#webhooks) and pass the `stripeWebhooksEndpointSecret` through your config.
</Banner>
```ts
import { buildConfig } from 'payload/config'
import stripePlugin from '@payloadcms/plugin-stripe'
const config = buildConfig({
plugins: [
stripePlugin({
stripeSecretKey: process.env.STRIPE_SECRET_KEY,
stripeWebhooksEndpointSecret: process.env.STRIPE_WEBHOOKS_ENDPOINT_SECRET,
sync: [
{
collection: 'customers',
stripeResourceType: 'customers',
stripeResourceTypeSingular: 'customer',
fields: [
{
fieldPath: 'name', // this is a field on your own Payload config
stripeProperty: 'name', // use dot notation, if applicable
},
],
},
],
}),
],
})
export default config
```
<Banner type="warning">
<strong>Note:</strong>
<br />
Due to limitations in the Stripe API, this currently only works with top-level fields. This is because every Stripe object is a separate entity, making it difficult to abstract into a simple reusable library. In the future, we may find a pattern around this. But for now, cases like that will need to be hard-coded.
</Banner>
Using `sync` will do the following:
- Adds and maintains a `stripeID` read-only field on each collection, this is a field generated _by Stripe_ and used as a cross-reference
- Adds a direct link to the resource on Stripe.com
- Adds and maintains an `skipSync` read-only flag on each collection to prevent infinite syncs when hooks trigger webhooks
- Adds the following hooks to each collection:
- `beforeValidate`: `createNewInStripe`
- `beforeChange`: `syncExistingWithStripe`
- `afterDelete`: `deleteFromStripe`
- Handles the following Stripe webhooks
- `STRIPE_TYPE.created`: `handleCreatedOrUpdated`
- `STRIPE_TYPE.updated`: `handleCreatedOrUpdated`
- `STRIPE_TYPE.deleted`: `handleDeleted`
## TypeScript
All types can be directly imported:
```ts
import {
StripeConfig,
StripeWebhookHandler,
StripeProxy,
...
} from '@payloadcms/plugin-stripe/types';
```
## Examples
The [Templates Directory](https://github.com/payloadcms/payload/tree/main/templates) contains an official [E-commerce Template](https://github.com/payloadcms/payload/tree/main/templates/ecommerce) which demonstrates exactly how to configure this plugin in Payload and implement it on your front-end. You can also check out [How to Build An E-Commerce Site With Next.js](https://payloadcms.com/blog/how-to-build-an-e-commerce-site-with-nextjs) post for a bit more context around this template.

View File

@@ -11,7 +11,8 @@ keywords: deployment, production, config, configuration, documentation, Content
launch. <strong>Awesome! Great work!</strong> Now, what's next?
</Banner>
There are many ways to deploy Payload to a production environment. When evaluating how you will deploy Payload, you need to consider these main aspects:
There are many ways to deploy Payload to a production environment. When evaluating how you will deploy Payload, you need
to consider these main aspects:
1. [Basics](#basics)
1. [Security](#security)
@@ -21,19 +22,26 @@ There are many ways to deploy Payload to a production environment. When evaluati
## Basics
In order for Payload to run, it requires both the server code and the built admin panel. These will be the `dist` and `build` directories by default. If you've used `create-payload-app` to create your project, executing the `build` npm script will build both and output these directories.
In order for Payload to run, it requires both the server code and the built admin panel. These will be the `dist`
and `build` directories by default. If you've used `create-payload-app` to create your project, executing the `build`
npm script will build both and output these directories.
## Security
Payload features a suite of security features that you can rely on to strengthen your application's security. When deploying to Production, it's a good idea to double-check that you are making proper use of each of them.
Payload features a suite of security features that you can rely on to strengthen your application's security. When
deploying to Production, it's a good idea to double-check that you are making proper use of each of them.
##### The Secret Key
When you initialize Payload, you provide it with a `secret` property. This property should be impossible to guess and extremely difficult for brute-force attacks to crack. Make sure your Production `secret` is a long, complex string. It's often best practice to store it in an `env` file which is not checked into your Git repository, using `dotenv` to supply it to your `payload.init` call.
When you initialize Payload, you provide it with a `secret` property. This property should be impossible to guess and
extremely difficult for brute-force attacks to crack. Make sure your Production `secret` is a long, complex string. It's
often best practice to store it in an `env` file which is not checked into your Git repository, using `dotenv` to supply
it to your `payload.init` call.
##### Double-check and thoroughly test all Access Control
Because _**you**_ are in complete control of who can do what with your data, you should double and triple-check that you wield that power responsibly before deploying to Production.
Because _**you**_ are in complete control of who can do what with your data, you should double and triple-check that you
wield that power responsibly before deploying to Production.
<Banner type="error">
<strong>By default, all Access Control functions require that a user is successfully logged in to Payload to create, read, update, or delete data.</strong>{' '}
@@ -44,7 +52,8 @@ Because _**you**_ are in complete control of who can do what with your data, you
##### Building the Admin panel
Before running in Production, you need to have built a production-ready copy of the Payload Admin panel. To do this, Payload provides the `build` NPM script. You can use it by adding a `script` to your `package.json` file like this:
Before running in Production, you need to have built a production-ready copy of the Payload Admin panel. To do this,
Payload provides the `build` NPM script. You can use it by adding a `script` to your `package.json` file like this:
`package.json`:
@@ -60,19 +69,26 @@ Before running in Production, you need to have built a production-ready copy of
}
```
Then, to build Payload, you would run `npm run build` in your project folder. A production-ready Admin bundle will be created in the `build` directory.
Then, to build Payload, you would run `npm run build` in your project folder. A production-ready Admin bundle will be
created in the `build` directory.
##### Setting Node to Production
Make sure you set the environment variable `NODE_ENV` to `production`. Based on this variable, many Node packages automatically optimize themselves. In production, Payload automatically disables the [GraphQL Playground](/docs/graphql/overview#graphql-playground), serves a production-ready version of the Admin panel, and other changes.
Make sure you set the environment variable `NODE_ENV` to `production`. Based on this variable, many Node packages
automatically optimize themselves. In production, Payload automatically disables
the [GraphQL Playground](/docs/graphql/overview#graphql-playground), serves a production-ready version of the Admin
panel, and other changes.
##### Secure Cookie Settings
You should be using an SSL certificate for production Payload instances, which means you can [enable secure cookies](/docs/authentication/config) in your Authentication-enabled Collection configs.
You should be using an SSL certificate for production Payload instances, which means you
can [enable secure cookies](/docs/authentication/config) in your Authentication-enabled Collection configs.
##### Preventing API Abuse
Payload comes with a robust set of built-in anti-abuse measures, such as locking out users after X amount of failed login attempts, request rate limiting, GraphQL query complexity limits, max `depth` settings, and more. [Click here to learn more](/docs/production/preventing-abuse).
Payload comes with a robust set of built-in anti-abuse measures, such as locking out users after X amount of failed
login attempts, request rate limiting, GraphQL query complexity limits, max `depth` settings, and
more. [Click here to learn more](/docs/production/preventing-abuse).
## MongoDB
@@ -80,11 +96,18 @@ Payload can be used with any MongoDB compatible database including AWS DocumentD
##### Managing MongoDB yourself
If you are using a [persistent filesystem-based cloud host](#persistent-vs-ephemeral-filesystems) such as a [DigitalOcean Droplet](https://www.digitalocean.com/products/droplets/) or an [Amazon EC2](https://aws.amazon.com/ec2/?ec2-whats-new.sort-by=item.additionalFields.postDateTime&ec2-whats-new.sort-order=desc) server, you might opt to install MongoDB directly on that server itself so that Node can communicate with it locally. With this approach, you can benefit from faster response times, but scaling can become more involved as your app's user base grows.
If you are using a [persistent filesystem-based cloud host](#persistent-vs-ephemeral-filesystems) such as
a [DigitalOcean Droplet](https://www.digitalocean.com/products/droplets/) or
an [Amazon EC2](https://aws.amazon.com/ec2/?ec2-whats-new.sort-by=item.additionalFields.postDateTime&ec2-whats-new.sort-order=desc)
server, you might opt to install MongoDB directly on that server itself so that Node can communicate with it locally.
With this approach, you can benefit from faster response times, but scaling can become more involved as your app's user
base grows.
##### Letting someone else do it
Alternatively, you can rely on a third-party MongoDB host such as [MongoDB Atlas](https://www.mongodb.com/). With Atlas or a similar cloud provider, you can trust them to take care of your database's availability, security, redundancy, and backups.
Alternatively, you can rely on a third-party MongoDB host such as [MongoDB Atlas](https://www.mongodb.com/). With Atlas
or a similar cloud provider, you can trust them to take care of your database's availability, security, redundancy, and
backups.
<Banner type="warning">
<strong>Note:</strong>
@@ -98,21 +121,31 @@ Alternatively, you can rely on a third-party MongoDB host such as [MongoDB Atlas
##### DocumentDB
When using AWS DocumentDB, you will need to configure connection options for authentication in the `mongoOptions` passed to `payload.init`. You also need to set `mongoOptions.useFacet` to `false` to disable use of the unsupported `$facet` aggregation.
When using AWS DocumentDB, you will need to configure connection options for authentication in the `connectOptions`
passed to the `mongooseAdapter` . You also need to set `connectOptions.useFacet` to `false` to disable use of the
unsupported `$facet` aggregation.
##### CosmosDB
When using Azure Cosmos DB, an index is needed for any field you may want to sort on. To add the sort index for all fields that may be sorted in the admin UI use the <a href="/docs/configuration/overview">indexSortableFields</a> configuration option.
When using Azure Cosmos DB, an index is needed for any field you may want to sort on. To add the sort index for all
fields that may be sorted in the admin UI use the <a href="/docs/configuration/overview">indexSortableFields</a>
configuration option.
## File storage
If you are using Payload to [manage file uploads](/docs/upload/overview), you need to consider where your uploaded files will be permanently stored. If you do not use Payload for file uploads, then this section does not impact your app whatsoever.
If you are using Payload to [manage file uploads](/docs/upload/overview), you need to consider where your uploaded files
will be permanently stored. If you do not use Payload for file uploads, then this section does not impact your app
whatsoever.
#### Persistent vs Ephemeral Filesystems
Some cloud app hosts such as [Heroku](https://heroku.com) use `ephemeral` file systems, which means that any files uploaded to your server only last until the server restarts or shuts down. Heroku and similar providers schedule restarts and shutdowns without your control, meaning your uploads will accidentally disappear without any way to get them back.
Some cloud app hosts such as [Heroku](https://heroku.com) use `ephemeral` file systems, which means that any files
uploaded to your server only last until the server restarts or shuts down. Heroku and similar providers schedule
restarts and shutdowns without your control, meaning your uploads will accidentally disappear without any way to get
them back.
Alternatively, persistent filesystems will never delete your files and can be trusted to reliably host uploads perpetually.
Alternatively, persistent filesystems will never delete your files and can be trusted to reliably host uploads
perpetually.
**Popular cloud providers with ephemeral filesystems:**
@@ -135,21 +168,26 @@ Alternatively, persistent filesystems will never delete your files and can be tr
##### Using ephemeral filesystem providers like Heroku
If you don't use Payload's `upload` functionality, you can go ahead and use Heroku or similar platform easily. Everything will work exactly as you want it to.
If you don't use Payload's `upload` functionality, you can go ahead and use Heroku or similar platform easily.
Everything will work exactly as you want it to.
But, if you do, and you still want to use an ephemeral filesystem provider, you can write a hook-based solution to _copy_ the files your users upload to a more permanent storage solution like Amazon S3 or DigitalOcean Spaces.
But, if you do, and you still want to use an ephemeral filesystem provider, you can write a hook-based solution to
_copy_ the files your users upload to a more permanent storage solution like Amazon S3 or DigitalOcean Spaces.
**To automatically send uploaded files to S3 or similar, you could:**
- Write an asynchronous `beforeChange` hook for all Collections that support Uploads, which takes any uploaded `file` from the Express `req` and sends it to an S3 bucket
- Write an `afterRead` hook to save a `s3URL` field that automatically takes the `filename` stored and formats a full S3 URL
- Write an asynchronous `beforeChange` hook for all Collections that support Uploads, which takes any uploaded `file`
from the Express `req` and sends it to an S3 bucket
- Write an `afterRead` hook to save a `s3URL` field that automatically takes the `filename` stored and formats a full S3
URL
- Write an `afterDelete` hook that automatically deletes files from the S3 bucket
With the above configuration, deploying to Heroku or similar becomes no problem.
## DigitalOcean Tutorials
DigitalOcean provides extremely helpful documentation that can walk you through the entire process of creating a production-ready Droplet to host your Payload app:
DigitalOcean provides extremely helpful documentation that can walk you through the entire process of creating a
production-ready Droplet to host your Payload app:
1. Create a new Ubuntu 20.04 droplet on [DigitalOcean](https://digitalocean.com)
1. [Initial server setup](https://www.digitalocean.com/community/tutorials/initial-server-setup-with-ubuntu-20-04)
@@ -158,9 +196,27 @@ DigitalOcean provides extremely helpful documentation that can walk you through
1. [Create a new MongoDB and user](https://medium.com/@mhagemann/how-to-add-a-new-user-to-a-mongodb-database-d896776b5362)
1. [Set up Node for production](https://www.digitalocean.com/community/tutorials/how-to-set-up-a-node-js-application-for-production-on-ubuntu-20-04)
### Swap Space
Swap refers to a section of storage on the hard drive that is reserved to temporarily store data that can no longer fit
within RAM. This allows for the expansion of your server's working memory, with some limitations. Swap space comes into
play when available RAM can no longer accommodate actively used application data, enabling the system to continue
functioning.
Insufficient space can lead to deployment errors and memory-related issues, resulting in application crashes, sluggish
performance, or an unresponsive server.
Common deployment error due to **space limitations** (as reported by users):
- `Error: Command failed with exit code 1`
To configure swap, we recommend following this tutorial
on [How To Add Swap Space](https://www.digitalocean.com/community/tutorials/how-to-add-swap-space-on-ubuntu-22-04).
## Docker
This is an example of a multi-stage docker build of Payload for production. Ensure you are setting your environment variables on deployment, like `PAYLOAD_SECRET`, `PAYLOAD_CONFIG_PATH`, and `DATABASE_URI` if needed.
This is an example of a multi-stage docker build of Payload for production. Ensure you are setting your environment
variables on deployment, like `PAYLOAD_SECRET`, `PAYLOAD_CONFIG_PATH`, and `DATABASE_URI` if needed.
```dockerfile
FROM node:18-alpine as base

View File

@@ -20,7 +20,7 @@ To prevent DDoS, brute-force, and similar attacks, you can set IP-based rate lim
| Option | Description |
| ---------------- | ----------------------------------------------------------------------------------------------------------------------- |
| **`window`** | Time in milliseconds to track requests per IP. Defaults to `90000` (15 minutes). |
| **`window`** | Time in milliseconds to track requests per IP. Defaults to `900000` (15 minutes). |
| **`max`** | Number of requests served from a single IP before limiting. Defaults to `500`. |
| **`skip`** | Express middleware function that can return true (or promise resulting in true) that will bypass limit. |
| **`trustProxy`** | True or false, to enable to allow requests to pass through a proxy such as a load balancer or an `nginx` reverse proxy. |

View File

@@ -62,4 +62,4 @@ All Payload APIs support the pagination controls below. With them, you can creat
### Disabling pagination within Local API
For `find` operations within the Local API, you can disable pagination to retrieve all documents from a collection by passing `pagination: false` to the `find` local operation. This is not supported in REST or GraphQL, however, because it could potentially lead to malicious activity.
For `find` operations within the Local API, you can disable pagination to retrieve all documents from a collection by passing `pagination: false` to the `find` local operation.

View File

@@ -90,6 +90,19 @@ Note: Collection slugs must be formatted in kebab-case
},
},
},
{
operation: "Count",
method: "GET",
path: "/api/{collection-slug}/count",
description: "Count the documents",
example: {
slug: "count",
req: true,
res: {
totalDocs: 10
},
},
},
{
operation: "Create",
method: "POST",

View File

@@ -2,7 +2,7 @@
title: Lexical Rich Text
label: Lexical
order: 30
desc: Built by Meta, Lexical is an incredibly powerful rich text editor and it works beautifully within Payload.
desc: Built by Meta, Lexical is an incredibly powerful rich text editor, and it works beautifully within Payload.
keywords: lexical, rich text, editor, headless cms
---
@@ -45,7 +45,39 @@ export default buildConfig({
You can also override Lexical settings on a field-by-field basis as follows:
```ts
import { CollectionConfig } from 'payload/types'
import type { CollectionConfig } from 'payload/types'
import {
lexicalEditor
} from '@payloadcms/richtext-lexical'
export const Pages: CollectionConfig = {
slug: 'pages',
fields: [
{
name: 'content',
type: 'richText',
// Pass the Lexical editor here and override base settings as necessary
editor: lexicalEditor({})
}
]
}
```
## Extending the lexical editor with Features
Lexical has been designed with extensibility in mind. Whether you're aiming to introduce new functionalities or tweak the existing ones, Lexical makes it seamless for you to bring those changes to life.
### Features: The Building Blocks
At the heart of Lexical's customization potential are "features". While Lexical ships with a set of default features we believe are essential for most use cases, the true power lies in your ability to redefine, expand, or prune these as needed.
If you remove all the default features, you're left with a blank editor. You can then add in only the features you need, or you can build your own custom features from scratch.
### Integrating New Features
To weave in your custom features, utilize the `features` prop when initializing the Lexical Editor. Here's a basic example of how this is done:
```ts
import {
BlocksFeature,
LinkFeature,
@@ -55,62 +87,559 @@ import {
import { Banner } from '../blocks/Banner'
import { CallToAction } from '../blocks/CallToAction'
export const Pages: CollectionConfig = {
{
editor: lexicalEditor({
features: ({ defaultFeatures }) => [
...defaultFeatures,
LinkFeature({
// Example showing how to customize the built-in fields
// of the Link feature
fields: [
{
name: 'rel',
label: 'Rel Attribute',
type: 'select',
hasMany: true,
options: ['noopener', 'noreferrer', 'nofollow'],
admin: {
description:
'The rel attribute defines the relationship between a linked resource and the current document. This is a custom link field.',
},
},
],
}),
UploadFeature({
collections: {
uploads: {
// Example showing how to customize the built-in fields
// of the Upload feature
fields: [
{
name: 'caption',
type: 'richText',
editor: lexicalEditor(),
},
],
},
},
}),
// This is incredibly powerful. You can re-use your Payload blocks
// directly in the Lexical editor as follows:
BlocksFeature({
blocks: [
Banner,
CallToAction,
],
}),
]
})
}
```
## Features overview
Here's an overview of all the included features:
| Feature Name | Included by default | Description |
|--------------------------------|---------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **`BoldTextFeature`** | Yes | Handles the bold text format |
| **`ItalicTextFeature`** | Yes | Handles the italic text format |
| **`UnderlineTextFeature`** | Yes | Handles the underline text format |
| **`StrikethroughTextFeature`** | Yes | Handles the strikethrough text format |
| **`SubscriptTextFeature`** | Yes | Handles the subscript text format |
| **`SuperscriptTextFeature`** | Yes | Handles the superscript text format |
| **`InlineCodeTextFeature`** | Yes | Handles the inline-code text format |
| **`ParagraphFeature`** | Yes | Handles paragraphs. Since they are already a key feature of lexical itself, this Feature mainly handles the Slash and Add-Block menu entries for paragraphs |
| **`HeadingFeature`** | Yes | Adds Heading Nodes (by default, H1 - H6, but that can be customized) |
| **`AlignFeature`** | Yes | Allows you to align text left, centered and right |
| **`IndentFeature`** | Yes | Allows you to indent text with the tab key |
| **`UnorderedListFeature`** | Yes | Adds unordered lists (ul) |
| **`OrderedListFeature`** | Yes | Adds ordered lists (ol) |
| **`CheckListFeature`** | Yes | Adds checklists |
| **`LinkFeature`** | Yes | Allows you to create internal and external links |
| **`RelationshipFeature`** | Yes | Allows you to create block-level (not inline) relationships to other documents |
| **`BlockQuoteFeature`** | Yes | Allows you to create block-level quotes |
| **`UploadFeature`** | Yes | Allows you to create block-level upload nodes - this supports all kinds of uploads, not just images |
| **`HorizontalRuleFeature`** | Yes | Horizontal rules / separators. Basically displays an `<hr>` element |
| **`BlocksFeature`** | No | Allows you to use Payload's [Blocks Field](/docs/fields/blocks) directly inside your editor. In the feature props, you can specify the allowed blocks - just like in the Blocks field. |
| **`TreeViewFeature`** | No | Adds a debug box under the editor, which allows you to see the current editor state live, the dom, as well as time travel. Very useful for debugging |
## Creating your own, custom Feature
Creating your own custom feature requires deep knowledge of the Lexical editor. We recommend you take a look at the [Lexical documentation](https://lexical.dev/docs/intro) first - especially the "concepts" section.
Next, take a look at the [features we've already built](https://github.com/payloadcms/payload/tree/main/packages/richtext-lexical/src/field/features) - understanding how they work will help you understand how to create your own. There is no difference between the features included by default and the ones you create yourself - since those features are all isolated from the "core", you have access to the same APIs, whether the feature is part of payload or not!
## Converters
### Lexical => HTML
Lexical saves data in JSON, but can also generate its HTML representation via two main methods:
1. **Outputting HTML from the Collection:** Create a new field in your collection to convert saved JSON content to HTML. Payload generates and outputs the HTML for use in your frontend.
2. **Generating HTML on any server** Convert JSON to HTML on-demand on the server.
The editor comes with built-in HTML serializers, simplifying the process of converting JSON to HTML.
#### Outputting HTML from the Collection
To add HTML generation directly within the collection, follow the example below:
```ts
import type { CollectionConfig } from 'payload/types'
import {
HTMLConverterFeature,
lexicalEditor,
lexicalHTML
} from '@payloadcms/richtext-lexical'
const Pages: CollectionConfig = {
slug: 'pages',
fields: [
{
name: 'content',
name: 'nameOfYourRichTextField',
type: 'richText',
// Pass the Lexical editor here and override base settings as necessary
editor: lexicalEditor({
features: ({ defaultFeatures }) => [
...defaultFeatures,
LinkFeature({
// Example showing how to customize the built-in fields
// of the Link feature
fields: [
{
name: 'rel',
label: 'Rel Attribute',
type: 'select',
hasMany: true,
options: ['noopener', 'noreferrer', 'nofollow'],
admin: {
description:
'The rel attribute defines the relationship between a linked resource and the current document. This is a custom link field.',
},
},
],
}),
UploadFeature({
collections: {
uploads: {
// Example showing how to customize the built-in fields
// of the Upload feature
fields: [
{
name: 'caption',
type: 'richText',
editor: lexicalEditor(),
},
],
},
},
}),
// This is incredibly powerful. You can re-use your Payload blocks
// directly in the Lexical editor as follows:
BlocksFeature({
blocks: [
Banner,
CallToAction,
],
}),
]
})
}
]
// The HTMLConverter Feature is the feature which manages the HTML serializers.
// If you do not pass any arguments to it, it will use the default serializers.
HTMLConverterFeature({}),
],
}),
},
lexicalHTML('nameOfYourRichTextField', { name: 'nameOfYourRichTextField_html' }),
],
}
```
The `lexicalHTML()` function creates a new field that automatically converts the referenced lexical richText field into HTML through an afterRead hook.
#### Generating HTML anywhere on the server:
If you wish to convert JSON to HTML ad-hoc, use this code snippet:
```ts
import type { SerializedEditorState } from 'lexical'
import {
type SanitizedEditorConfig,
convertLexicalToHTML,
consolidateHTMLConverters,
} from '@payloadcms/richtext-lexical'
async function lexicalToHTML(editorData: SerializedEditorState, editorConfig: SanitizedEditorConfig) {
return await convertLexicalToHTML({
converters: consolidateHTMLConverters({ editorConfig }),
data: editorData,
})
}
```
This method employs `convertLexicalToHTML` from `@payloadcms/richtext-lexical`, which converts the serialized editor state into HTML.
Because every `Feature` is able to provide html converters, and because the `htmlFeature` can modify those or provide their own, we need to consolidate them with the default html Converters using the `consolidateHTMLConverters` function.
#### Creating your own HTML Converter
HTML Converters are typed as `HTMLConverter`, which contains the node type it should handle, and a function that accepts the serialized node from the lexical editor, and outputs the HTML string. Here's the HTML Converter of the Upload node as an example:
```ts
import type { HTMLConverter } from '@payloadcms/richtext-lexical'
import payload from 'payload'
const UploadHTMLConverter: HTMLConverter<SerializedUploadNode> = {
converter: async ({ node }) => {
const uploadDocument = await payload.findByID({
id: node.value.id,
collection: node.relationTo,
})
const url = (payload?.config?.serverURL || '') + uploadDocument?.url
if (!(uploadDocument?.mimeType as string)?.startsWith('image')) {
// Only images can be serialized as HTML
return ``
}
return `<img src="${url}" alt="${uploadDocument?.filename}" width="${uploadDocument?.width}" height="${uploadDocument?.height}"/>`
},
nodeTypes: [UploadNode.getType()], // This is the type of the lexical node that this converter can handle. Instead of hardcoding 'upload' we can get the node type directly from the UploadNode, since it's static.
}
```
As you can see, we have access to all the information saved in the node (for the Upload node, this is `value`and `relationTo`) and we can use that to generate the HTML.
The `convertLexicalToHTML` is part of `@payloadcms/richtext-lexical` automatically handles traversing the editor state and calling the correct converter for each node.
#### Embedding the HTML Converter in your Feature
You can embed your HTML Converter directly within your custom `Feature`, allowing it to be handled automatically by the `consolidateHTMLConverters` function. Here is an example:
```ts
export const UploadFeature = (props?: UploadFeatureProps): FeatureProvider => {
return {
feature: () => {
return {
nodes: [
{
converters: {
html: yourHTMLConverter, // <= This is where you define your HTML Converter
},
node: UploadNode,
type: UploadNode.getType(),
//...
},
],
plugins: [/*...*/],
props: props,
slashMenu: {/*...*/},
}
},
key: 'upload',
}
}
```
### Headless Editor
Lexical provides a seamless way to perform conversions between various other formats:
- HTML to Lexical (or, importing HTML into the lexical editor)
- Markdown to Lexical (or, importing Markdown into the lexical editor)
- Lexical to Markdown
A headless editor can perform such conversions outside of the main editor instance. Follow this method to initiate a headless editor:
```ts
import { createHeadlessEditor } from '@lexical/headless' // <= make sure this package is installed
import {
getEnabledNodes,
sanitizeEditorConfig,
} from '@payloadcms/richtext-lexical'
const yourEditorConfig; // <= your editor config here
const headlessEditor = createHeadlessEditor({
nodes: getEnabledNodes({
editorConfig: sanitizeEditorConfig(yourEditorConfig),
}),
})
```
### Getting the editor config
As you can see, you need to provide an editor config in order to create a headless editor. This is because the editor config is used to determine which nodes & features are enabled, and which converters are used.
To get the editor config, simply import the default editor config and adjust it - just like you did inside of the `editor: lexicalEditor({})` property:
```ts
import { defaultEditorConfig, defaultEditorFeatures } from '@payloadcms/richtext-lexical' // <= make sure this package is installed
const yourEditorConfig = defaultEditorConfig
// If you made changes to the features of the field's editor config, you should also make those changes here:
yourEditorConfig.features = [
...defaultEditorFeatures,
// Add your custom features here
]
```
### HTML => Lexical
Once you have your headless editor instance, you can use it to convert HTML to Lexical:
```ts
import { $generateNodesFromDOM } from '@lexical/html'
import { $getRoot,$getSelection } from 'lexical'
import { JSDOM } from 'jsdom';
headlessEditor.update(() => {
// In a headless environment you can use a package such as JSDom to parse the HTML string.
const dom = new JSDOM(htmlString)
// Once you have the DOM instance it's easy to generate LexicalNodes.
const nodes = $generateNodesFromDOM(headlessEditor, dom.window.document)
// Select the root
$getRoot().select()
// Insert them at a selection.
const selection = $getSelection()
selection.insertNodes(nodes)
}, { discrete: true })
// Do this if you then want to get the editor JSON
const editorJSON = headlessEditor.getEditorState().toJSON()
```
Functions prefixed with a `$` can only be run inside of an `editor.update()` or `editorState.read()` callback.
This has been taken from the [lexical serialization & deserialization docs](https://lexical.dev/docs/concepts/serialization#html---lexical).
<Banner type="success">
<strong>Note:</strong>
<br />
Using the <code>discrete: true</code> flag ensures instant updates to the editor state. If immediate reading of the updated state isn't necessary, you can omit the flag.
</Banner>
### Markdown => Lexical
Convert markdown content to the Lexical editor format with the following:
```ts
import { $convertFromMarkdownString } from '@lexical/markdown'
import { sanitizeEditorConfig } from '@payloadcms/richtext-lexical'
const yourSanitizedEditorConfig = sanitizeEditorConfig(yourEditorConfig) // <= your editor config here
const markdown = `# Hello World`
headlessEditor.update(() => { $convertFromMarkdownString(markdown, yourSanitizedEditorConfig.features.markdownTransformers) }, { discrete: true })
// Do this if you then want to get the editor JSON
const editorJSON = headlessEditor.getEditorState().toJSON()
```
### Lexical => Markdown
Export content from the Lexical editor into Markdown format using these steps:
1. Import your current editor state into the headless editor.
2. Convert and fetch the resulting markdown string.
Here's the code for it:
```ts
import { $convertToMarkdownString } from '@lexical/markdown'
import { sanitizeEditorConfig } from '@payloadcms/richtext-lexical'
import type { SerializedEditorState } from "lexical"
const yourSanitizedEditorConfig = sanitizeEditorConfig(yourEditorConfig) // <= your editor config here
const yourEditorState: SerializedEditorState // <= your current editor state here
// Import editor state into your headless editor
try {
headlessEditor.setEditorState(headlessEditor.parseEditorState(yourEditorState)) // This should commit the editor state immediately
} catch (e) {
logger.error({ err: e }, 'ERROR parsing editor state')
}
// Export to markdown
let markdown: string
headlessEditor.getEditorState().read(() => {
markdown = $convertToMarkdownString(yourSanitizedEditorConfig?.features?.markdownTransformers)
})
```
The `.setEditorState()` function immediately updates your editor state. Thus, there's no need for the `discrete: true` flag when reading the state afterward.
### Lexical => Plain Text
Export content from the Lexical editor into plain text using these steps:
1. Import your current editor state into the headless editor.
2. Convert and fetch the resulting plain text string.
Here's the code for it:
```ts
import type { SerializedEditorState } from "lexical"
import { $getRoot } from "lexical"
const yourEditorState: SerializedEditorState // <= your current editor state here
// Import editor state into your headless editor
try {
headlessEditor.setEditorState(headlessEditor.parseEditorState(yourEditorState)) // This should commit the editor state immediately
} catch (e) {
logger.error({ err: e }, 'ERROR parsing editor state')
}
// Export to plain text
const plainTextContent = headlessEditor.getEditorState().read(() => {
return $getRoot().getTextContent()
}) || ''
```
## Migrating from Slate
While both Slate and Lexical save the editor state in JSON, the structure of the JSON is different.
### Migration via SlateToLexicalFeature
One way to handle this is to just give your lexical editor the ability to read the slate JSON.
Simply add the `SlateToLexicalFeature` to your editor:
```ts
import type { CollectionConfig } from 'payload/types'
import {
SlateToLexicalFeature,
lexicalEditor,
} from '@payloadcms/richtext-lexical'
const Pages: CollectionConfig = {
slug: 'pages',
fields: [
{
name: 'nameOfYourRichTextField',
type: 'richText',
editor: lexicalEditor({
features: ({ defaultFeatures }) => [
...defaultFeatures,
SlateToLexicalFeature({})
],
}),
},
],
}
```
and done! Now, everytime this lexical editor is initialized, it converts the slate date to lexical on-the-fly. If the data is already in lexical format, it will just pass it through.
This is by far the easiest way to migrate from Slate to Lexical, although it does come with a few caveats:
- There is a performance hit when initializing the lexical editor
- The editor will still output the Slate data in the output JSON, as the on-the-fly converter only runs for the admin panel
The easy way to solve this: Just save the document! This overrides the slate data with the lexical data, and the next time the document is loaded, the lexical data will be used. This solves both the performance and the output issue for that specific document.
### Migration via migration script
The method described above does not solve the issue for all documents, though. If you want to convert all your documents to lexical, you can use a migration script. Here's a simple example:
```ts
import type { Payload } from 'payload'
import type { YourDocumentType } from 'payload/generated-types'
import {
cloneDeep,
convertSlateToLexical,
defaultSlateConverters,
} from '@payloadcms/richtext-lexical'
import { AnotherCustomConverter } from './lexicalFeatures/converters/AnotherCustomConverter'
export async function convertAll(payload: Payload, collectionName: string, fieldName: string) {
const docs: YourDocumentType[] = await payload.db.collections[collectionName].find({}).exec() // Use MongoDB models directly to query all documents at once
console.log(`Found ${docs.length} ${collectionName} docs`)
const converters = cloneDeep([...defaultSlateConverters, AnotherCustomConverter])
// Split docs into batches of 20.
const batchSize = 20
const batches = []
for (let i = 0; i < docs.length; i += batchSize) {
batches.push(docs.slice(i, i + batchSize))
}
let processed = 0 // Number of processed docs
for (const batch of batches) {
// Process each batch asynchronously
const promises = batch.map(async (doc: YourDocumentType) => {
const richText = doc[fieldName]
if (richText && Array.isArray(richText) && !('root' in richText)) { // It's Slate data - skip already-converted data
const converted = convertSlateToLexical({
converters: converters,
slateData: richText,
})
await payload.update({
id: doc.id,
collection: collectionName as any,
data: {
[fieldName]: converted,
},
})
}
})
// Wait for all promises in the batch to complete. Resolving batches of 20 asynchronously is faster than waiting for each doc to update individually
await Promise.all(promises)
// Update the count of processed docs
processed += batch.length
console.log(`Converted ${processed} of ${docs.length}`)
}
}
```
The `convertSlateToLexical` is the same method used in the `SlateToLexicalFeature` - it handles traversing the Slate JSON for you.
Do note that this script might require adjustment depending on your document structure, especially if you have nested richText fields or localization enabled.
### Converting custom Slate nodes
If you have custom Slate nodes, create a custom converter for them. Here's the Upload converter as an example:
```ts
import type { SerializedUploadNode } from '../uploadNode.'
import type { SlateNodeConverter } from '@payloadcms/richtext-lexical'
export const SlateUploadConverter: SlateNodeConverter = {
converter({ slateNode }) {
return {
fields: {
...slateNode.fields,
},
format: '',
relationTo: slateNode.relationTo,
type: 'upload',
value: {
id: slateNode.value?.id || '',
},
version: 1,
} as const as SerializedUploadNode
},
nodeTypes: ['upload'],
}
```
It's pretty simple: You get a Slate node as input, and you return the lexical node. The `nodeTypes` array is used to determine which Slate nodes this converter can handle.
When using a migration script, you can add your custom converters to the `converters` property of the `convertSlateToLexical` props, as seen in the example above
When using the `SlateToLexicalFeature`, you can add your custom converters to the `converters` property of the `SlateToLexicalFeature` props:
```ts
import type { CollectionConfig } from 'payload/types'
import {
SlateToLexicalFeature,
lexicalEditor,
defaultSlateConverters
} from '@payloadcms/richtext-lexical'
import { YourCustomConverter } from '../converters/YourCustomConverter'
const Pages: CollectionConfig = {
slug: 'pages',
fields: [
{
name: 'nameOfYourRichTextField',
type: 'richText',
editor: lexicalEditor({
features: ({ defaultFeatures }) => [
...defaultFeatures,
SlateToLexicalFeature({
converters: [
...defaultSlateConverters,
YourCustomConverter
]
}),
],
}),
},
],
}
```
## Migrating from payload-plugin-lexical
Migrating from [payload-plugin-lexical](https://github.com/AlessioGr/payload-plugin-lexical) works similar to migrating from Slate.
Instead of a `SlateToLexicalFeature` there is a `LexicalPluginToLexicalFeature` you can use. And instead of `convertSlateToLexical` you can use `convertLexicalPluginToLexical`.
## Coming Soon
Lots more documentation will be coming soon, which will show in detail how to create your own custom features within Lexical.

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