Compare commits

...

2464 Commits

Author SHA1 Message Date
Elliot DeNolf
25968d43c2 chore(release): v3.0.0-beta.49 [skip ci] 2024-06-17 14:32:33 -04:00
Jacob Fletcher
9e76c8f4e3 feat!: prebundle payload, ui, richtext-lexical (#6579)
# Breaking Changes

### New file import locations

Exports from the `payload` package have been _significantly_ cleaned up.
Now, just about everything is able to be imported from `payload`
directly, rather than an assortment of subpath exports. This means that
things like `import { buildConfig } from 'payload/config'` are now just
imported via `import { buildConfig } from 'payload'`. The mental model
is significantly simpler for developers, but you might need to update
some of your imports.

Payload now exposes only three exports:

1. `payload` - all types and server-only Payload code
2. `payload/shared` - utilities that can be used in either the browser
or in Node environments
3. `payload/node` - heavy utilities that should only be imported in Node
scripts and never be imported into bundled code like Next.js

### UI library pre-bundling

With this release, we've dramatically sped up the compile time for
Payload by pre-bundling our entire UI package for use inside of the
Payload admin itself. There are new exports that should be used within
Payload custom components:

1. `@payloadcms/ui/client` - all client components 
2. `@payloadcms/ui/server` - all server components

For all of your custom Payload admin UI components, you should be
importing from one of these two pre-compiled barrel files rather than
importing from the more deeply nested exports directly. That will keep
compile times nice and speedy, and will also make sure that the bundled
JS for your admin UI is kept small.

For example, whereas before, if you imported the Payload `Button`, you
would have imported it like this:

```ts
import { Button } from '@payloadcms/ui/elements/Button'
```

Now, you would import it like this:

```ts
import { Button } from '@payloadcms/ui/client'
```

This is a significant DX / performance optimization that we're pretty
pumped about.

However, if you are importing or re-using Payload UI components
_outside_ of the Payload admin UI, for example in your own frontend
apps, you can import from the individual component exports which will
make sure that the bundled JS is kept to a minimum in your frontend
apps. So in your own frontend, you can continue to import directly to
the components that you want to consume rather than importing from the
pre-compiled barrel files.

Individual component exports will now come with their corresponding CSS
and everything will work perfectly as-expected.

### Specific exports have changed

- `'@payloadcms/ui/templates/Default'` and
`'@payloadcms/ui/templates/Minimal`' are now exported from
`'@payloadcms/next/templates'`
- Old: `import { LogOut } from '@payloadcms/ui/icons/LogOut'` new:
`import { LogOutIcon } from '@payloadcms/ui/icons/LogOut'`

## Background info

In effort to make local dev as fast as possible, we need to import as
few files as possible so that the compiler has less to process. One way
we've achieved this in the Admin Panel was to _remove_ all .scss imports
from all components in the `@payloadcms/ui` module using a build
process. This stripped all `import './index.scss'` statements out of
each component before injecting them into `dist`. Instead, it bundles
all of the CSS into a single `main.css` file, and we import _that_ at
the root of the app.

While this concept is _still_ the right solution to the problem, this
particular approach is not viable when using these components outside
the Admin Panel, where not only does this root stylesheet not exist, but
where it would also bloat your app with unused styles. Instead, we need
to _keep_ these .scss imports in place so they are imported directly
alongside your components, as expected. Then, we need create a _new_
build step that _separately_ compiles the components _without_ their
stylesheets—this way your app can consume either as needed from the new
`client` and `server` barrel files within `@payloadcms/ui`, i.e. from
within `@payloadcms/next` and all other admin-specific packages and
plugins.

This way, all other applications will simply import using the direct
file paths, just as they did before. Except now they come with
stylesheets.

And we've gotten a pretty awesome initial compilation performance boost.

---------

Co-authored-by: James <james@trbl.design>
Co-authored-by: Alessio Gravili <alessio@gravili.de>
2024-06-17 14:25:36 -04:00
Elliot DeNolf
3b3b1cecc5 chore(release): v3.0.0-beta.48 [skip ci] 2024-06-17 12:55:08 -04:00
Jacob Fletcher
6862b43261 docs: prepares docs for beta (#6808) 2024-06-17 11:44:25 -04:00
Paul
a3e1856bde fix: date hydration error if user locale is different to server (#6806)
Closes https://github.com/payloadcms/payload/issues/6796

## Type of change
- [x] Bug fix (non-breaking change which fixes an issue)
2024-06-17 15:16:58 +00:00
Alessio Gravili
6612bd1c98 fix(richtext-lexical): lexicalHTML field was persisted in database even though it should not (#6795) 2024-06-17 15:14:38 +00:00
Dan Ribbens
ce2ae9561d fix: loader windows path resolution (#6804) 2024-06-17 10:54:09 -04:00
Jarrod Flesch
1a03e9ace5 fix: prevent clearing of language selection on account view (#6803)
Fixes https://github.com/payloadcms/payload/issues/6794

Users should not be able to clear their language selection on the
account view.
2024-06-17 09:53:33 -04:00
Alessio Gravili
e7159c033e fix(ui,richtext-*): path from context should always have precedence over path from props, even if it's an empty string (#6782) 2024-06-15 05:42:16 +00:00
Alessio Gravili
628749573e fix(ui): properly type Select element onChange type, as well as any components using it (#6785) 2024-06-14 22:28:59 -04:00
Jarrod Flesch
0920c8a2f0 fix: array row validation messages (#6781) 2024-06-14 19:49:48 +00:00
Jarrod Flesch
680ed1dec8 fix: allows navigation to reset-pw route, adds customization for route (#6778)
Fixes https://github.com/payloadcms/payload/issues/6745

Fixes the inability to navigate to the reset password route. Adds the ability to customize the route and docs for all customizable admin panel routes.
2024-06-14 12:38:32 -04:00
Jarrod Flesch
ddc3ab534e fix: passes toast success and error handlers to form handleResponse fn (#6775)
Fixes https://github.com/payloadcms/payload/issues/6747

Passes successToast and errorToast through to the Form handleResponse
method.
2024-06-14 00:31:39 -04:00
Jarrod Flesch
7c35e8865c feat: prevent setting column preferences unless edited (#6774)
Fixes https://github.com/payloadcms/payload/issues/6458

Prevents setting column preferences unless they are manually changed.
2024-06-13 23:52:39 -04:00
Elliot DeNolf
8f6cedf67a chore(release): v3.0.0-beta.47 [skip ci] 2024-06-13 15:36:34 -04:00
Anders Semb Hermansen
7bb2e3be76 feat: adds X-HTTP-Method-Override header (#6487)
Fixes: https://github.com/payloadcms/payload/issues/6486

Adds `X-HTTP-Method-Override` header to allow for sending query params in the body of a POST request. This is useful when the query param string hits the upper limit.
2024-06-13 15:27:39 -04:00
Paul
78db50a497 feat(plugin-stripe): add full req object to stripe webhook handlers (#6770)
Provides `req` to the webhook handlers in Stripe plugin and fixes type
to `PayloadRequest` for req by default.
2024-06-13 19:00:11 +00:00
Jarrod Flesch
f36bf5e4e3 fix: adds translation for authentication:apiKey (#6771)
Fixes https://github.com/payloadcms/payload/issues/6697

Adds `authentication:apiKey` to client translations.
2024-06-13 14:57:58 -04:00
Elliot DeNolf
d10792452f docs: add disclaimer to migration guide 2024-06-13 14:34:51 -04:00
Elliot DeNolf
c500ac83b2 docs: rough draft of migration guide (#6769)
Rough draft of migration guide / breaking changes doc.
2024-06-13 14:23:49 -04:00
Jarrod Flesch
082650c0e2 fix: attempt to use user locale preference when not set as query param (#6761)
Fixes https://github.com/payloadcms/payload/issues/6619

Attempt to use user preference if available when loading view data instead of always relying on query param when loading view data.
2024-06-13 11:22:28 -04:00
Elliot DeNolf
11de4b037d feat!: use Gravatar for default avatar (#6765)
- Fixes #6725 . Gravatar and custom avatar components.
- Makes Gravatar the default
2024-06-13 15:01:44 +00:00
Viet-Tien
0162560996 fix: adds siteName to openGraphSchema joi validation (#6764) 2024-06-13 10:29:32 -04:00
Elliot DeNolf
ed0820f6c8 feat: warn if image resizing enabled but sharp is not passed to config (#6763)
Warning will now show if image resizing enabled, but sharp is not passed
to config.

Fixes #6755
2024-06-13 14:19:57 +00:00
Patrik
e148243260 fix(payload, ui): unable to save animated file types with undefined image sizes (#6757)
## Description

V2 PR [here](https://github.com/payloadcms/payload/pull/6733)

Additionally fixes issue with image thumbnails not updating properly
until page refresh.

Image thumbnails properly update on document save 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] 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:43:44 -04:00
Jacob Fletcher
8e56328e63 fix!: meta.icons type and schema validation (#6759) 2024-06-13 09:36:30 -04:00
Jacob Fletcher
019677b7e6 chore(eslint): consolidates and prevents duplicate imports (#6756)
## Description

Adds ESLint rule to consolidate duplicate imports using the
`import/no-duplicates` rule of the `eslint-plugin-import` plugin. More
here:
https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-duplicates.md.
This was needed as opposed to `no-duplicate-imports` because of the
auto-fix feature.
2024-06-12 16:45:43 -04:00
Elliot DeNolf
0d31021c25 chore(release): v3.0.0-beta.46 [skip ci] 2024-06-12 16:21:26 -04:00
Jarrod Flesch
8e9ed2ebe3 chore: corrects admin.meta joi validation (#6754) 2024-06-12 16:16:23 -04:00
Jessica Chowdhury
763a34f19b fix: corrects block duplicate action and add tests (#6589) 2024-06-12 14:44:17 -04:00
Elliot DeNolf
be0462db56 feat: diff generated types before write (#6749)
Diff types on disk before write
2024-06-12 14:16:03 -04:00
Elliot DeNolf
6e55a2e52d fix: unawaited emails (#6265)
Await email sending, serverless may end before send

Fixes #6457
2024-06-12 14:02:05 -04:00
Alessio Gravili
4e127054ca feat(richtext-lexical)!: sub-field hooks and localization support (#6591)
## BREAKING
- Our internal field hook methods now have new required `schemaPath` and
path `props`. This affects the following functions, if you are using
those: `afterChangeTraverseFields`, `afterReadTraverseFields`,
`beforeChangeTraverseFields`, `beforeValidateTraverseFields`,
`afterReadPromise`
- The afterChange field hook's `value` is now the value AFTER the
previous hooks were run. Previously, this was the original value, which
I believe is a bug
- Only relevant if you have built your own richText adapter: the
richText adapter `populationPromises` property has been renamed to
`graphQLPopulationPromises` and is now only run for graphQL. Previously,
it was run for graphQL AND the rest API. To migrate, use
`hooks.afterRead` to run population for the rest API
- Only relevant if you have built your own lexical features: The
`populationPromises` server feature property has been renamed to
`graphQLPopulationPromises` and is now only run for graphQL. Previously,
it was run for graphQL AND the rest API. To migrate, use
`hooks.afterRead` to run population for the rest API
- Serialized lexical link and upload nodes now have a new `id` property.
While not breaking, localization / hooks will not work for their fields
until you have migrated to that. Re-saving the old document on the new
version will automatically add the `id` property for you. You will also
get a bunch of console logs for every lexical node which is not migrated
2024-06-12 13:33:08 -04:00
Elliot DeNolf
27510bb963 chore(templates): fix vercel one click links [skip ci] 2024-06-11 16:30:11 -04:00
Anders Semb Hermansen
de45e6094b fix(ui): hideGutter was ignored in group field (#6613) 2024-06-11 16:26:00 -04:00
Patryk Kowalczyk
74159de1ec fix: add missing export for useLeaf hook (#6693) 2024-06-11 16:12:25 -04:00
Jarrod Flesch
ba92d864bb fix: list sort preferences (#6731)
Fixes https://github.com/payloadcms/payload/issues/6617

Sets preferences when list sort is set. Uses defaultSort when defined in
config and preferences are not set.
2024-06-11 16:02:28 -04:00
Elliot DeNolf
0fb14cfebe chore(release): v3.0.0-beta.45 [skip ci] 2024-06-11 15:09:41 -04:00
Paul
2ada6fc58d fix: toasts padding and button placement by 1px (#6730)
## Type of change

- [x] Bug fix (non-breaking change which fixes an issue)
2024-06-11 18:42:17 +00:00
Alessio Gravili
cb3355b30f feat!: move from react-toastify to sonner (#6682)
**BREAKING:** We now export toast from `sonner` instead of
`react-toastify`. If you send out toasts from your own projects, make
sure to use our `toast` export, or install `sonner`. React-toastify
toasts will no longer work anymore. The Toast APIs are mostly similar,
but there are some differences if you provide options to your toast

CSS styles have been changed from Toastify

```css
/* before */
.Toastify


/* current */
.payload-toast-container
.payload-toast-item
.payload-toast-close-button

/* individual toast items will also have these classes depending on the state */
.toast-info
.toast-warning
.toast-success
.toast-error
```


https://github.com/payloadcms/payload/assets/70709113/da3e732e-aafc-4008-9469-b10f4eb06b35

---------

Co-authored-by: Paul Popus <paul@nouance.io>
2024-06-11 14:12:59 -04:00
Patrik
10c6ffafc3 fix: only use metadata.pages for height if animated (#6728)
## 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:45:49 -04:00
Patrik
6512d5ce69 fix: create sharp file for fileHasAdjustments files or fileIsAnimated files (#6708)
## Description

Fixes #6694 

Previously we were only creating sharp files for files that have file
adjustments but instead a sharp file should be created for animated
images even if there are no file adjustments - i.e

`const fileHasAdjustments = fileSupportsResize && Boolean(resizeOptions
|| formatOptions || imageSizes || trimOptions || file.tempFilePath)`

- [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:55:51 -04:00
Jarrod Flesch
57fcc9148e fix: corrects field-paths that were incorrectly being set (#6724)
Fixes https://github.com/payloadcms/payload/issues/6650

Similar to [6712](https://github.com/payloadcms/payload/pull/6712). Field paths were
not accounting for the 4 scenarios:
- both parentPath & fieldName
- only parentPath
- only fieldName
- neither parentPath or fieldName (top level rows, etc)
2024-06-11 10:17:40 -04:00
Elliot DeNolf
36f4f23463 chore(release): v3.0.0-beta.44 [skip ci] 2024-06-11 09:46:31 -04:00
Alessio Gravili
7b7dc71845 fix: get auto type-gen to work on turbo, by running type gen in a child process outside turbo/webpack (#6714)
Before on turbo: https://github.com/vercel/next.js/issues/66723
2024-06-10 22:03:12 +00:00
Jarrod Flesch
ba513d5a97 fix: corrects tab paths when nested within other row like fields (#6712)
Fixes https://github.com/payloadcms/payload/issues/6637

There was an issue where tab paths were being generated based on 2
scenarios when there are 3 possible scenarios:
- A path is provided and the tab is named
- A path is **not** provided but the tab is named
- Neither a path or a tab name are provided
2024-06-10 16:06:09 -04:00
Jarrod Flesch
a26d03190e fix: re-exports graphql json types for external use (#6711)
Fixes https://github.com/payloadcms/payload/issues/6683

Exports import `GraphQLJSON` and `GraphQLJSONObject` from
`@payloadcms/graphql/types`

```ts
import { GraphQLJSON, GraphQLJSONObject } from '@payloadcms/graphql/types'
```
2024-06-10 14:53:31 -04:00
Patrik
9f525621c8 fix(ui): removes array & blocks & group fields from sort (#6576)
## Description

V2 PR [here](https://github.com/payloadcms/payload/pull/6574)

- [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:09:50 -04:00
Elliot DeNolf
7309d474ee feat!: type auto-generation (#6657)
Types are now auto-generated by default.

You can opt-out of this behavior by setting:
```ts
buildConfig({
  // Rest of config
  typescript: {
    autoGenerate: false
  },
})
```
2024-06-10 13:42:44 -04:00
Jarrod Flesch
45e86832c2 fix: global draft validations (#6709)
- Extends draft validation from https://github.com/payloadcms/payload/pull/6677 to work with globals as
well

- Fixes bug from https://github.com/payloadcms/payload/pull/6677 where
autosave was not saving properly after first autosave
2024-06-10 12:31:22 -04:00
Alessio Gravili
1bd91b23ca chore: improved clean commands which work on windows and output pretty summary (#6685) 2024-06-09 05:21:11 +00:00
Alessio Gravili
ac34380eb8 fix(ui): set checkbox htmlFor by default, fixing some checkbox labels not toggling the checkbox (#6684) 2024-06-08 19:34:26 +00:00
Jacob Fletcher
17707852e0 chore: migrates @faceless-ui imports to esm (#6681) 2024-06-07 22:59:39 -04:00
Elliot DeNolf
8b95218577 chore(release): v3.0.0-beta.43 [skip ci] 2024-06-07 17:45:28 -04:00
Jarrod Flesch
a79d23c631 chore: adjusts test config for draft validation (#6678) 2024-06-07 16:01:03 -04:00
Jarrod Flesch
52c81ad525 feat: adds draft validation option (#6677)
## Description

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-07 15:22:03 -04:00
Paul
8ec836737e chore: add turbo resolveAlias mock alias to hide webpack warnings (#6676) 2024-06-07 17:23:35 +00:00
Paul
e4a90294ea feat(plugin-redirects)!: update fields overrides to use a function (#6675)
## Description

Updates the `fields` override in plugin redirects to allow for
overriding

```ts
// before
overrides: {
  fields: [
    {
      type: 'text',
      name: 'customField',
    },
  ],
},

// current
overrides: {
  fields: ({ defaultFields }) => {
    return [
      ...defaultFields,
      {
        type: 'text',
        name: 'customField',
      },
    ]
  },
},
```


## Type of change

- [x] New feature (non-breaking change which adds functionality)
- [x] Breaking change (fix or feature that would cause existing
functionality to not work as expected)
2024-06-07 14:41:09 +00:00
Jacob Fletcher
7c8d562f03 fix(next): live preview device position when using zoom (#6665) 2024-06-07 10:17:49 -04:00
Alessio Gravili
11c3a65e63 feat(richtext-*): allow omitting the root editor property (#6660)
No need to add lexical/slate to the bundle if someone decides not to
make use of richText fields within payload at all
2024-06-06 17:57:03 +00:00
Paul
8dd5e4dc24 fix: max versions config not being respected on globals (#6654)
Closes https://github.com/payloadcms/payload/issues/6646

## Type of change

- [x] Bug fix (non-breaking change which fixes an issue)
2024-06-06 17:21:32 +00:00
Alessio Gravili
9bd9e7a986 feat!: upgrade minimum node 20 version from 20.6.0 to 20.9.0 (#6659)
**BREAKING**:
- This bumps the minimum required node version from node 20.6.0 to node
20.9.0. This is because 20.6.0 breaks type generation due to a CJS node
bug, and 20.9.0 is the next v20 LTS version. The minimum node 18 version
stays the same (18.20.2)
2024-06-06 17:15:21 +00:00
Elliot DeNolf
66e00f8172 chore(release): v3.0.0-beta.42 [skip ci] 2024-06-06 12:21:02 -04:00
Jacob Fletcher
b95e25e937 docs: adds live preview csp troubleshooting tips (#6655) 2024-06-06 10:59:34 -04:00
Alessio Gravili
5722c530a1 chore: fix vscode jest extension debugger (#6653) 2024-06-06 14:53:06 +00:00
Jacob Fletcher
267c23616d fix(ui): global documents disabled after save (#6652) 2024-06-06 10:48:12 -04:00
Alessio Gravili
19f8cbcf76 docs: new and improve lexical docs, hoist up all headings (#6639) 2024-06-05 17:08:15 -04:00
Elliot DeNolf
aee3ee21d1 chore(release): v3.0.0-beta.41 [skip ci] 2024-06-05 16:25:52 -04:00
Dan Ribbens
ff82bb5661 fix(db-postgres)!: create predefined migration missing json schema output (#6641)
## Description

fixes #6630

# BREAKING CHANGES

This only applies to you if you using db-postgres and have created the
`v2-v3-relationships` migration released in
[v3.0.0-beta.39](https://github.com/payloadcms/payload/releases/tag/v3.0.0-beta.39)
from @payloadcms/db-postgres <= v3.0.0-beta.40.

### Steps to fix

- Delete the existing v2-v3-relationships migration file. 
- If changes were made to your config since the previous migration was
made, you will need to revert those by checking out a previous commit in
your version control.
- Recreate the migration using `payload migrate:create --file
@payloadcms/db-postgres/relationships-v2-v3` to make the migration with
the snapshot .json file.
2024-06-05 16:15:01 -04:00
Alessio Gravili
8a78134b72 chore(eslint): improve perfectionist configuration (#6644) 2024-06-05 19:50:49 +00:00
Elliot DeNolf
1dbb29e847 chore(templates): add generated templates [no-lint] (#6604)
Generate static template variations
2024-06-05 15:39:28 -04:00
Alessio Gravili
2077da8665 fix: update file-type dependency and fix dependency version mismatch (#6638) 2024-06-05 10:55:02 -04:00
Alessio Gravili
b2751f75d5 feat: support Next.js basePath config property (#6628) 2024-06-04 21:38:28 -04:00
Alessio Gravili
1afd221795 feat(ui): expose RowLabelProps (#6627) 2024-06-04 20:53:55 +00:00
Alessio Gravili
aeb4df894a fix(translations): explicitly declare date-fns v3 as a dependency (#6626) 2024-06-04 16:41:41 -04:00
Jacob Fletcher
f91c19e1fd chore(deps): bumps faceless pkgs to react 19-rc (#6622) 2024-06-04 14:05:07 -04:00
Patrik
bcd277eaaa fix: resizing animated images (#6623)
Fixes resizing of animated images

V2 PR [here](https://github.com/payloadcms/payload/pull/6621)
2024-06-04 13:57:46 -04:00
Alessio Gravili
da35afbd8f feat(richtext-lexical)!: upgrade lexical from 0.15.0 to 0.16.0 and port over relevant playground changes (#6620)
**BREAKING:**
- This upgrades the required version of lexical from 0.15.0 to 0.16.0.
If you are using lexical directly in your project, possibly due to
custom features, there might be breaking changes for you. Please consult
the lexical 0.16.0 changelog:
https://github.com/facebook/lexical/releases/tag/v0.16.0
2024-06-04 15:49:46 +00:00
Alessio Gravili
cafc13a7d5 fix: migration file cannot be imported (#6616) 2024-06-04 14:10:45 +00:00
Paul
2b6bff3c1d chore: update website template seed script (#6615)
## Type of change

- [x] Chore (non-breaking change which does not add functionality)
2024-06-04 13:58:01 +00:00
Paul
95f499d2bd chore: update website template to use new formBuilderPlugin fields override (#6614)
## Type of change

- [x] Chore (non-breaking change which does not add functionality)
2024-06-04 13:13:35 +00:00
Elliot DeNolf
6659fd1b97 chore(release): v3.0.0-beta.40 [skip ci] 2024-06-03 22:37:24 -04:00
Alessio Gravili
45b02d8827 fix: pin ajv to 8.14.0, as 8.15.0 is broken (#6606) 2024-06-04 00:25:13 +00:00
Alessio Gravili
59cde0dbb3 feat: match next.js env file loading behavior in bin scripts & importConfig, clean up installed packages & mismatching package versions (#6601) 2024-06-03 21:23:05 +00:00
Paul
1aece399f7 fix(plugin-form-builder): fix bug with optional chain operator in field overrides logic (#6602)
## Type of change

- [x] Bug fix (non-breaking change which fixes an issue)
2024-06-03 16:34:18 +00:00
Alessio Gravili
c3589ded08 fix(db-postgres): type issue in migratePostgresV2toV3 call if ts strict mode is enabled (#6585) 2024-05-31 22:37:08 -04:00
Alessio Gravili
c7fbd76dae fix(richtext-lexical): minor design improvements (#6575) 2024-05-30 20:50:32 +00:00
Alessio Gravili
6b9c796218 fix: critical getPredefinedMigration dependency error (#6578) 2024-05-30 20:47:44 +00:00
Alessio Gravili
5cb49c3307 fix(richtext-*): fix client features were not loaded properly, improve performance of LexicalProvider, slate cell component was non-functional, support richtext adapter Cell RSCs (#6573) 2024-05-30 16:26:06 -04:00
Alessio Gravili
f41bb05c70 feat(richtext-lexical)!: configurable fixed toolbar (#6560)
**BREAKING**: useEditorFocusProvider has been removed and merged with
useEditorConfigContext. You can now find information about the focused
editor, parent editors and child editors within useEditorConfigContext
2024-05-30 20:08:22 +00:00
Elliot DeNolf
c68189788c chore(release): v3.0.0-beta.39 [skip ci] 2024-05-30 14:26:03 -04:00
Jacob Fletcher
e603c83f55 fix(next): ssr live preview was not dispatching document save events (#6572) 2024-05-30 14:20:22 -04:00
Dan Ribbens
edfa85bcd5 feat(db-postgres)!: relationship column (#6339)
BREAKING CHANGE:

Moves `upload` field and `relationship` fields with `hasMany: false` &
`relationTo: string` from the many-to-many `_rels` join table to simple
columns. This only affects Postgres database users.

## TL;DR

We have dramatically simplified the storage of simple relationships in
relational databases to boost performance and align with more expected
relational paradigms. If you are using the beta Postgres adapter, and
you need to keep simple relationship data, you'll need to run a
migration script that we provide you.

### Background

For example, prior to this update, a collection of "posts" with a simple
`hasMany: false` and `relationTo: 'categories'` field would have a
`posts_rels` table where the category relations would be stored.

This was somewhat unnecessary as simple relations like this can be
expressed with a `category_id` column which is configured as a foreign
key. This also introduced added complexity for dealing directly with the
database if all you have are simple relations.

### Who needs to migrate

You need to migrate if you are using the beta Postgres database adapter
and any of the following applies to you.

- If you have versions enabled on any collection / global
- If you use the `upload` field 
- If you have relationship fields that are `hasMany: false` (default)
and `relationTo` to a single category ([has
one](https://payloadcms.com/docs/fields/relationship#has-one)) relations

### We have a migration for you

Even though the Postgres adapter is in beta, we've prepared a predefined
migration that will work out of the box for you to migrate from an
earlier version of the adapter to the most recent version easily.

It makes the schema changes in step with actually moving the data from
the old locations to the new before adding any null constraints and
dropping the old columns and tables.

### How to migrate

The steps to preserve your data while making this update are as follows.
These steps are the same whether you are moving from Payload v2 to v3 or
a previous version of v3 beta to the most recent v3 beta.

**Important: during these steps, don't start the dev server unless you
have `push: false` set on your Postgres adapter.**

#### Step 1 - backup

Always back up your database before performing big changes, especially
in production cases.

#### Step 2 - create a pre-update migration 
Before updating to new Payload and Postgres adapter versions, run
`payload migrate:create` without any other config changes to have a
prior snapshot of the schema from the previous adapter version

#### Step 3 - if you're migrating a dev DB, delete the dev `push` row
from your `payload_migrations` table

If you're migrating a dev database where you have the default setting to
push database changes directly to your DB, and you need to preserve data
in your development database, then you need to delete a `dev` migration
record from your database.

Connect directly to your database in any tool you'd like and delete the
dev push record from the `payload_migrations` table using the following
SQL statement:

```sql
DELETE FROM payload_migrations where batch = -1`
```

#### Step 4 - update Payload and Postgres versions to most recent

Update packages, making sure you have matching versions across all
`@payloadcms/*` and `payload` packages (including
`@payloadcms/db-postgres`)

#### Step 5 - create the predefined migration

Run the following command to create the predefined migration we've
provided:

```
payload migrate:create --file @payloadcms/db-postgres/relationships-v2-v3
```

#### Step 6 - migrate!

Run migrations with the following command: 

```
payload migrate
```

Assuming the migration worked, you can proceed to commit this change and
distribute it to be run on all other environments.

Note that if two servers connect to the same database, only one should
be running migrations to avoid transaction conflicts.

Related discussion:
https://github.com/payloadcms/payload/discussions/4163

---------

Co-authored-by: James <james@trbl.design>
Co-authored-by: PatrikKozak <patrik@payloadcms.com>
2024-05-30 14:09:11 -04:00
Elliot DeNolf
b86d4c647f chore(release): v3.0.0-beta.38 [skip ci] 2024-05-30 11:24:12 -04:00
Elliot DeNolf
4884f0d297 fix(cpa): safer command exists check (#6569)
- Use execa to check if command exists
- Remove third-party dep
2024-05-30 11:11:40 -04:00
Patrik
f1db24e303 fix(ui): adjusts sizing of remove/add buttons to be same size (#6529)
## Description

V2 PR [here](https://github.com/payloadcms/payload/pull/6527)

- [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:42:25 -04:00
Patrik
7f15147286 fix: ui field validation error with admin.disableListColumn property (#6531)
## Description

V2 PR [here](https://github.com/payloadcms/payload/pull/6530)

- [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-30 09:41:58 -04:00
Patrik
e0a6db7f97 fix(translations): adds new userEmailAlreadyRegistered translations (#6550)
## Description

V2 PR [here](https://github.com/payloadcms/payload/pull/6549)

- [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:37:02 -04:00
Elliot DeNolf
0d7d3e5c92 fix(cpa): more package manager detection improvements (#6566)
- Adjust package manager detection logic
- Remove pnpm-lock.yaml from blank template
2024-05-30 09:35:53 -04:00
Elliot DeNolf
8b49402e4c chore(templates): consolidate initial vercel-postgres migration (#6568) 2024-05-30 09:33:35 -04:00
Jarrod Flesch
347464250e fix: duplicate options appearing in relationship where builder (#6557)
- enables reactStrictMode by default
- enables reactCompiler by default
- fixes cases where ID's set to 0 broke UI
2024-05-30 00:35:59 -04:00
Paul
aa02801c3d fix(plugin-search): Render error on custom UI component (#6562)
## Type of change

- [x] Bug fix (non-breaking change which fixes an issue)
2024-05-30 01:56:06 +00:00
Elliot DeNolf
a3ee07f693 chore: import vercel-postgres one-click template (#6564)
Import vercel one-click template
2024-05-29 18:06:52 -04:00
Jessica Chowdhury
511908a964 docs: adds sentry to plugin docs (#6475) 2024-05-29 15:19:16 -04:00
Jarrod Flesch
425576be25 fix: ensure relationship field pills respect isSortable property (#6561) 2024-05-29 15:12:42 -04:00
Jacob Fletcher
92f458dad2 feat(next,ui): improves loading states (#6434) 2024-05-29 14:01:13 -04:00
Jarrod Flesch
043a91d719 fix: ability to query relationships not equal to ID (#6555) 2024-05-29 13:47:44 -04:00
Jacob Fletcher
54e2d7fb38 docs: renames vercel visual editing to vercel content link (#6559) 2024-05-29 13:39:40 -04:00
Jacob Fletcher
321e97f9fe feat: extracts buildFormState logic from endpoint for reuse (#6501) 2024-05-29 12:51:16 -04:00
Elliot DeNolf
4e0dfd410d chore(release): v3.0.0-beta.37 [skip ci] 2024-05-29 10:54:45 -04:00
Elliot DeNolf
8506385ef9 fix(cpa): improve package manager detection (#6546)
Improves package manager detection.

Closes #6231
2024-05-29 09:30:15 -04:00
Jarrod Flesch
e74952902e fix: multi value draggable/sortable pills (#6500) 2024-05-29 08:22:37 -04:00
Alessio Gravili
4a51f4d2c1 fix(richtext-lexical): various html converter fixes (#6544) 2024-05-29 00:29:25 -04:00
Alessio Gravili
2c283bcc08 fix(richtext-lexical): user-defined html converters not taking precedence, and shared default html converters doubling in size after every field initialization 2024-05-29 00:14:58 -04:00
Alessio Gravili
a2e9bcd333 fix(richtext-lexical): list converters and nodes being added duplicatively 2024-05-28 23:53:35 -04:00
Alessio Gravili
33d53121a2 feat(richtext-lexical): link markdown transformers (#6543)
Closes https://github.com/payloadcms/payload/issues/6507

---------

Co-authored-by: ShawnVogt <41651465+shawnvogt@users.noreply.github.com>
2024-05-29 03:28:26 +00:00
Leo Hilsheimer
e0b201c810 fix(richtext-lexical): link html converter: serialize newTab to target="_blank" (#6350)
Co-authored-by: Leo <leo.hilsheimer@gmail.com>
2024-05-28 23:20:44 -04:00
Alessio Gravili
a8000f644f feat(richtext-lexical): i18n (#6542)
Continuation of https://github.com/payloadcms/payload/pull/6524
2024-05-29 02:40:48 +00:00
Paul
7d0e909a30 feat(plugin-form-builder)!: update form builder plugin field overrides to use a function instead (#6497)
## Description

Changes the `fields` override for form builder plugin to use a function
instead so that we can actually override existing fields which currently
will not work.

```ts
//before
fields: [
  {
    name: 'custom',
    type: 'text',
  }
]

// current
fields: ({ defaultFields }) => {
  return [
    ...defaultFields,
    {
      name: 'custom',
      type: 'text',
    },
  ]
}
```

## Type of change

- [x] Breaking change (fix or feature that would cause existing
functionality to not work as expected)
2024-05-28 17:45:51 -03:00
Elliot DeNolf
b2662eeb1f ci: update app-build-with-packed job (#6541)
Add `--ignore-workspace` and `--no-frozen-lockfile` where necessary
2024-05-28 14:35:18 -04:00
Elliot DeNolf
0b274dd67e chore: adjust email-nodemailer workspace dep pattern (#6539)
Adjust dep pattern for email-nodemailer reference from plugin-cloud
2024-05-28 14:19:21 -04:00
Elliot DeNolf
2ddd50edc4 fix(deps): proper location for scheduler peer dep (#6537)
Properly put `scheduler` dep under `ui` instead of `payload`.
2024-05-28 14:15:56 -04:00
Elliot DeNolf
0287acb8f0 chore(templates): update dockerfile and docker-compose for blank template (#6536)
Update Dockerfile and docker-compose.yml for blank template.
2024-05-28 12:35:05 -04:00
Elliot DeNolf
10c94b3665 feat(cpa): update existing payload installation (#6193)
Updates create-payload-app to update an existing payload installation

- Detects existing Payload installation. Fixes #6517 
- If not latest, will install latest and grab the `(payload)` directory
structure (ripped from `templates/blank-3.0`
2024-05-28 11:38:33 -04:00
Alessio Gravili
ea48ca377e chore: move lexical package from workspace-root to test package (#6533) 2024-05-28 15:01:30 +00:00
zvizvi
6f5d86ed84 fix: Add missing He lang export in payload/i18n (#6484)
## Description
Fixed missing Hebrew language export in payload/i18n module.
The import statement import { he } from 'payload/i18n/he' was not
functioning due to he not being exported correctly.


<!-- 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)
2024-05-28 10:52:20 -03:00
Alessio Gravili
c383f391e3 feat(richtext-lexical): i18n support (#6524) 2024-05-28 09:10:39 -04:00
Paul
8a91a7adbb feat(richtext-lexical): update validation of custom URLs to include relative and anchor links (#6525)
Updates the regex to allow relative and anchor links as well. Manually
tested all common variations of absolute, relative and anchor links with
a combination

## Type of change

- [x] New feature (non-breaking change which adds functionality)
2024-05-28 00:55:00 -03:00
Alessio Gravili
96181d91a6 chore(ui): add ability to compile using react compiler (#6483)
This does not enable the react compiler by default
2024-05-27 22:54:36 -04:00
Alessio Gravili
eff5129a5f fix(next): unable to pass custom view client components (#6513) 2024-05-27 22:48:41 -04:00
Dan Ribbens
38e5adc462 chore: fix seed file path windows (#6512) 2024-05-26 15:39:16 +00:00
Dan Ribbens
ff4ea1eecc chore: getPayloadHMR conditionally call db.connect (#6510) 2024-05-25 22:17:27 +00:00
Dan Ribbens
dbfd1beed5 chore: gitignore static files uploads tests (#6509) 2024-05-25 22:06:43 +00:00
Dan Ribbens
4b6774463e chore: loader tests error on windows (#6508) 2024-05-25 21:57:32 +00:00
Dan Ribbens
cb14b97a6e chore: swcrc syntax fix (#6505) 2024-05-25 15:45:05 +00:00
Jarrod Flesch
18bc4b708c fix: separate collection docs with same ids were excluded in selectable (#6499) 2024-05-24 15:20:07 -04:00
Paul
6d951e6987 chore: add lexical as a direct dependency to the website template (#6496) 2024-05-24 16:33:36 +00:00
Elliot DeNolf
365660764d chore(templates): enable next lint on blank (#6494)
Enables next linting on blank template

Closes #6481
2024-05-24 11:36:50 -04:00
Elliot DeNolf
8b91af8a5b chore(cpa): adjust unit test template (#6490)
Adjust template used in unit tests.
2024-05-24 10:12:19 -04:00
Paul
b4092f59ae chore: fix seed data validation in website template (#6491)
Fixes an issue with data validation in lexical for the seed script
2024-05-24 14:10:29 +00:00
Alessio Gravili
7a768144ea fix(richtext-lexical): localized sub-fields were omitted from the API output (#6489)
Closes #6455. Proper localization support will be worked on later, this
just resolves the issue where having it enabled not only doesn't
localize those fields, it also omits them from the API response. Now,
they are not omitted, and localization is simply skipped.
2024-05-24 10:01:04 -04:00
Elliot DeNolf
3839eb5ab0 chore(templates): remove blank v2 template (#6488)
New v3 is `blank-3.0`. Will rename that one in future PR.
2024-05-24 09:36:57 -04:00
Paul
fd02bee0fe chore: website template updates (#6480)
Just style updates
2024-05-23 20:38:25 +00:00
Patrik
42222cd2f6 fix(ui): where builder issues (#6478)
Co-authored-by: Jarrod Flesch <jarrodmflesch@gmail.com>
2024-05-23 16:01:13 -04:00
Elliot DeNolf
e3222f2ac3 chore(release): v3.0.0-beta.36 [skip ci] 2024-05-23 13:35:19 -04:00
Alessio Gravili
35f961fecb feat!: next.js 15, react 19, react compiler support (#6429)
**BREAKING:**
- bumps minimum required next.js version from `14.3.0-canary.68` to
`15.0.0-rc.0`
- bumps minimum required react and react-dom versions to `19.0.0
`(`19.0.0-rc-f994737d14-20240522` should be used)
- `@types/react` and `@types/react-dom` have to be bumped to
`npm:types-react@19.0.0-beta.2` using overrides and pnpm overrides, if
you want correct types. You can find an example of this here:
https://github.com/payloadcms/payload/pull/6429/files#diff-10cb9e57a77733f174ee2888587281e94c31f79e434aa3f932a8ec72fa7a5121L32

## Issues

- Bunch of todos for our react-select package which is having type
issues. Works fine, just type issues. Their type defs are importing JSX
in a weird way, we likely just have to wait until they fix them in a
future update.
2024-05-23 13:30:12 -04:00
Paul
85bfca79ef feat: add website template (#6470)
Adds the new website template for 3.0
2024-05-23 16:48:41 +00:00
Alessio Gravili
661a4a099d feat(ui): split up Select component into Select and SelectInput (#6471) 2024-05-23 11:36:57 -04:00
Jarrod Flesch
72c0534008 fix: adds host to initPage req creation (#6476) 2024-05-23 11:04:35 -04:00
Alessio Gravili
78579ed2bd feat(richtext-lexical): various UX and performance improvements (#6467) 2024-05-22 14:42:17 -04:00
Alessio Gravili
7bcb4ba1cc chore(email-*): remove excess backtick in readme install commands 2024-05-22 13:59:33 -04:00
Alessio Gravili
6b45cf3197 feat(richtext-lexical): improve block dragging UX 2024-05-22 13:55:44 -04:00
Elliot DeNolf
73d0b209d7 fix: isHotkey webpack error (#6466)
Fixes webpack issue with isHotkey: `TypeError:
is_hotkey__WEBPACK_IMPORTED_MODULE_9__ is not a function`

Changing this from a default import to a named export, and it appears to
resolve the issue.

Fixes #6421
2024-05-22 17:41:15 +00:00
Alessio Gravili
c93752bdbb fix(richtext-lexical): order of add/drag handles was inconsistent between gutter and no-gutter mode 2024-05-22 10:49:11 -04:00
Alessio Gravili
7a4dd5890e fix(ui): field errors aren't red in light mode 2024-05-22 10:29:41 -04:00
Alessio Gravili
60ee55fcaa chore(richtext-lexical): do not show red border & background for erroring field without gutter 2024-05-22 10:22:06 -04:00
Jacob Fletcher
1fe9790d0d feat(next): server-side theme detection (#6452) 2024-05-22 10:19:38 -04:00
zvizvi
3c0853a675 feat(translations): add Hebrew translation (#6428)
Hebrew translation added.
2024-05-22 14:15:10 +00:00
Jacob Fletcher
2b941b7e2c fix(next,ui): fixes global doc permissions and optimizes publish access data loading (#6451) 2024-05-22 10:03:12 -04:00
Elliot DeNolf
db772a058c chore: add label-author.yml 2024-05-22 09:09:52 -04:00
Alessio Gravili
0bfbf9c750 fix(richtext-lexical): link drawer sending too many form state requests for actions unrelated to links 2024-05-21 22:34:41 -04:00
Alessio Gravili
5c7647f45b ci: split up test suites (#6415) 2024-05-21 17:11:55 -04:00
Alessio Gravili
6c952875e8 feat(richtext-lexical): various gutter, error states & add/drag handle improvements (#6448)
## Gutter

Adds gutter by default:

![CleanShot 2024-05-21 at 16 24
13](https://github.com/payloadcms/payload/assets/70709113/09c59b6f-bd4a-4e81-bfdd-731d1cbbe075)


![CleanShot 2024-05-21 at 16 20
23](https://github.com/payloadcms/payload/assets/70709113/94df3e8c-663e-4b08-90cb-a24b2a788ff6)

can be disabled with admin.hideGutter

## Error states
![CleanShot 2024-05-21 at 16 21
18](https://github.com/payloadcms/payload/assets/70709113/06754d8f-c674-4aaa-a4e5-47e284970776)

Finally, proper error states display. Cleaner, and previously fields
were shown as erroring even though they weren't. No more!

## Drag & Block handles
Improved performance, and cleaned up code. Drag handle positions are now
only calculated for one editor rather than all editors on the page. Add
block handle calculation now uses a better algorithm to minimize the
amount of nodes which are iterated.

Additionally, have you noticed how sometimes the add button jumps to the
next node while the drag button is still at the previous node?


https://github.com/payloadcms/payload/assets/70709113/8dff3081-1de0-4902-8229-62f178f23549

No more! Now they behave the same. Feels a lot cleaner now.
2024-05-21 20:55:06 +00:00
Jacob Fletcher
af7e12aa2f chore(ui)!: uses consistent button naming conventions (#6444)
## Description

Renames the `Save` to `SaveButton`, etc. to match the already
established convention of the `PreviewButton`, etc. This matches the
imports with their respective component and type names, and also gives
these components more context to the developer whenever they're
rendered, i.e. its clearly just a button and not an entire block or
complex component.

**BREAKING**:

Import paths for these components have changed, if you were previously
importing these components into your own projects to customize, change
the import paths accordingly:

Old:
```ts
import { PublishButton } from '@payloadcms/ui/elements/Publish'
import { SaveButton } from '@payloadcms/ui/elements/Save'
import { SaveDraftButton } from '@payloadcms/ui/elements/SaveDraft'
```

New:
```ts
import { PublishButton } from '@payloadcms/ui/elements/PublishButton'
import { SaveButton } from '@payloadcms/ui/elements/SaveButton'
import { SaveDraftButton } from '@payloadcms/ui/elements/SaveDraftButton'
```

- [x] I have read and understand the
[CONTRIBUTING.md](https://github.com/payloadcms/payload/blob/main/CONTRIBUTING.md)
document in this repository.
2024-05-21 14:52:53 -04:00
Patrik
bcc506b423 fix(ui): disableListColumn fields not hidden in table columns (#6445)
## Description

Setting `disableListColumn` to `true` on a field would hide the field
from the column selector but not from the table columns.

- [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 13:33:28 -04:00
Elliot DeNolf
3d7c8277d7 chore(release): v3.0.0-beta.35 [skip ci] 2024-05-21 10:51:19 -04:00
Paul
a8a2dc2347 chore!: export DefaultListView as ListView (#6432)
Change the exports of DefaultListView and DefaultEditView to be renamed
without "Default" as ListView

```ts
// before
import { DefaultEditView } from '@payloadcms/next/views'
import { DefaultListView } from '@payloadcms/next/views'

// after 
import { EditView } from '@payloadcms/next/views'
import { ListView } from '@payloadcms/next/views'
```
2024-05-21 10:22:44 -04:00
Alessio Gravili
6c74b0326b chore(richtext-lexical): improve node validation messages (#6443) 2024-05-21 10:19:24 -04:00
Paul
f51af92491 chore(translations): ai translation script should use formal language (#6433)
Added additional prompt to make sure the translation we receive is using
formal language where it makes sense.

In the context of latin languages for example:
- Spanish: "tu" should be using "vos"
- French: "tu" should be using "votre"

These differences can affect verb conjugations and in these languages it
comes across as less professional if informal language is used.
2024-05-21 10:15:01 -04:00
Alessio Gravili
77528a1e7d chore(richtext-slate): fix richtext container elements direction 2024-05-21 09:40:17 -04:00
Alessio Gravili
ba8b8e8330 chore(richtext-lexical): improve node validation messages 2024-05-21 09:36:58 -04:00
Jessica Chowdhury
23f9a32a99 fix: user verification email broken (#6442)
## Description

Closes
[#225](https://github.com/payloadcms/payload-3.0-demo/issues/225).

The user verification emails are not being sent and this error is shown:
```ts
APIError: Error sending email: 422 validation_error - Invalid `from` field. The email address needs to follow the `email@example.com` or `Name <email@example.com>` format.
```

The issue is resolved by updating the `from` property on the outgoing
verification email:
```ts
from: `"${email.defaultFromName}" <${email.defaultFromName}>`,
// to
from: `"${email.defaultFromName}" <${email. defaultFromAddress}>`,
```

**NOTE:** This was not broken in 2.0, see correct outgoing email
[here](https://github.com/payloadcms/payload/blob/main/packages/payload/src/auth/sendVerificationEmail.ts#L69).

- [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 13:25:59 +00:00
Jessica Chowdhury
0190eb8b28 fix(ui): blocks browser save dialog from opening when hotkey used with no changes (#6366) 2024-05-21 09:00:34 -04:00
Anders Semb Hermansen
f482fdcfd5 fix: separate sort and search fields when looking up relationship. (#6440)
## Description

Default sort is used as searching field which is causing unexpected
behaviour described in https://github.com/payloadcms/payload/issues/4815
and https://github.com/payloadcms/payload/issues/5222 This bugfix
separates which field is used for sorting and which is used for
searching.

Fixes: https://github.com/payloadcms/payload/issues/4815
https://github.com/payloadcms/payload/issues/5222

@denolfe This fix is a port of the fix in
[#5964](https://github.com/payloadcms/payload/pull/5964) to beta branch.

- [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 16:57:49 -04:00
Alessio Gravili
ed4766188d fix(ui): tooltip positioning issues (#6439) 2024-05-20 20:37:53 +00:00
Ritsu
e682cb1b04 fix(ui): update relationship cell formatted value when when search changes (#6208)
## Description

Fixes https://github.com/payloadcms/payload-3.0-demo/issues/181
Although issue is about page changing, it happens as well when you
change sort / limit / where filter (and probably locale)
<!-- 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] Existing test suite passes locally with my changes

---------

Co-authored-by: Jessica Chowdhury <jessica@trbl.design>
2024-05-20 16:03:04 -04:00
Elliot DeNolf
36fda30c61 feat: store focal point on uploads (#6436)
Store focal point data on uploads as `focalX` and `focalY`

Addresses https://github.com/payloadcms/payload/discussions/4082

Mirrors #6364 for beta branch.
2024-05-20 15:57:52 -04:00
Alessio Gravili
fa7cc376d1 fix(richtext-lexical): field required validation not working if content was removed manually (#6435) 2024-05-20 17:17:54 +00:00
Paul
3fc2ff1ef9 chore: export DefaultListView for reuse (#6422)
Exports `DefaultListView` so other plugins or custom implementations can
re-use it
2024-05-20 11:53:36 -03:00
Jarrod Flesch
1d81eef805 fix: attributes graphql packages, adds esm import path (#6431) 2024-05-20 10:48:41 -04:00
Paul
8fcfac61b5 fix(plugin-seo): white screen of death on choosing an existing media for meta image (#6424)
Closes https://github.com/payloadcms/payload/issues/6423

## Type of change

- [x] Bug fix (non-breaking change which fixes an issue)
2024-05-19 04:51:19 +00:00
Elliot DeNolf
0d544dacdb chore(release): v3.0.0-beta.34 [skip ci] 2024-05-17 16:12:46 -04:00
Alessio Gravili
147b50e719 fix: page metadata generation not working in turbopack (#6417)
In turbo, payloadFaviconDark is a string, not an object with src
2024-05-17 15:44:12 -04:00
Elliot DeNolf
eeb689dd55 chore(release): v3.0.0-beta.33 [skip ci] 2024-05-17 14:59:23 -04:00
James Mikrut
c2571cfdb6 fix(db-postgres): uuid custom db name (#6408)
## Description

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

---------

Co-authored-by: PatrikKozak <patrik@payloadcms.com>
2024-05-17 14:11:14 -04:00
Dan Ribbens
12c812d379 fix(db-postgres): query with like on id columns (#6414)
When typing into the search input on the list view of a collection, the
`like` operator is used for id which causes an error for postgres. To
fix this we are sanitizing the `like` for number or uuid fields to
instead be an `equals` operator. An alternate solution would have been
to cast the ids to text `id::text` but this would have performence
implications on larger data sets.

---------

Co-authored-by: James <james@trbl.design>
2024-05-17 14:09:44 -04:00
Alessio Gravili
bf106db6e2 feat(richtext-lexical): new aboveContainer and belowContainer plugin positioning options, fix incorrect placeholder positioning (#6410) 2024-05-17 17:51:51 +00:00
Jacob Fletcher
18009349c0 fix(ui): properly sets hasSavePermission on nested documents (#6394) 2024-05-17 13:41:38 -04:00
Alessio Gravili
89b6055d61 fix: component is undefined error within isReactServerComponentOrFunction (#6411) 2024-05-17 17:24:51 +00:00
Francis Turmel
d9a8869132 chore(translations): French translation improvements (beta branch) (#6406)
## Description

* 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

---

- [x] I have read and understand the
[CONTRIBUTING.md](https://github.com/payloadcms/payload/blob/main/CONTRIBUTING.md)
document in this repository.
2024-05-17 13:52:17 -03:00
Alessio Gravili
9d5c0d350c feat!: upgrade minimum next version to 14.3.0-canary.68 & upgrade react packages, react-toastify (#6387)
**BREAKING:**
- The minimum required next version is now 14.3.0-canary.68. This is
because we are migrating away from the deprecated
experimental.serverComponentsExternalPackages next config key to
experimental.serverExternalPackages, which is not available in older
next canaries
- The minimum `react` and `react-dom` versions have been bumped to
^18.2.0 or ^19.0.0. This matches the minimum react version recommended
by next
2024-05-17 12:48:37 -04:00
Alessio Gravili
4dedd6e267 fix: turbopack RSC detection (#6405) 2024-05-17 11:40:10 -04:00
Alessio Gravili
276213193b feat: allow client components and extra rsc props for custom edit and list views (#6395) 2024-05-17 11:25:33 -04:00
Jacob Fletcher
553bb4b530 fix(next)!: removes initPage export from barrel file (#6403) 2024-05-17 09:37:54 -04:00
James Mikrut
5083525189 fix: loader support for server-only (#6383)
## Description

Allows `server-only` to work within the Payload loader.

Fixes https://github.com/payloadcms/payload-3.0-demo/issues/218
2024-05-17 09:07:18 -04:00
Elliot DeNolf
e4185259b4 ci: properly prefix proposed release in release script with 'v' 2024-05-16 22:34:21 -04:00
Alessio Gravili
5323d76a5b fix: react-select menu is hidden behind lexical fixed toolbar (#6396) 2024-05-16 21:09:41 +00:00
Alessio Gravili
608387084c fix(richtext-lexical): upload, relationship and block node insertion fails sometimes 2024-05-16 16:02:53 -04:00
Jacob Fletcher
9556d1bd42 feat!: replaces admin.meta.ogImage with admin.meta.openGraph.images (#6227) 2024-05-16 12:40:15 -04:00
Paul
a6bf05815c chore!: remove unused staticOptions config on uploads (#6378)
Removes the unused `staticOptions` on upload config, it was previously
typed to express configuration and is unused anywhere in the codebase
2024-05-16 15:15:35 +00:00
Patrik
a4deaf07d6 fix(next): incorrect stepnav breadcrumbs after selecting existing upload (#6372)
## Description

Fixes [this](https://github.com/payloadcms/payload-3.0-demo/issues/202)
v3 demo issue

- [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-16 10:23:32 -04:00
Jacob Fletcher
4adf01ab04 fix(next): does not wrap custom views with template by default (#6379) 2024-05-16 09:10:27 -04:00
Alessio Gravili
1abcdf96fa fix(translations): type StripCountVariants not working in TS strict mode (#6374)
This also removes the unnecessary StripCountVariants utility use for
when NestedKeysStripped<T[K]> is an object
2024-05-15 21:30:57 -04:00
Paul
3456b5f6a7 chore: eslint updates to the tailwind example (#6377)
minor updates to eslint rules in tailwind example
2024-05-16 00:56:19 +00:00
Paul
d053778bf2 chore: update form builder example (#6376)
Updates the form builder example
2024-05-15 21:22:54 -03:00
Patrik
fbad39a120 fix: safely access cookie header for uploads (#6373)
## Description

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

`fix`: adds optional chaining to safely access cookie header when
fetching image

v2 PR [here](https://github.com/payloadcms/payload/pull/6367)

- [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 21:04:21 +00:00
Patrik
e8d1d369cf fix(db-postgres): filter with ID not_in AND queries (#6359)
## Description

v2 PR [here](https://github.com/payloadcms/payload/pull/6358)

- [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:10:51 -04:00
Alessio Gravili
fbea52416c feat(richtext-lexical)!: upgrade lexical from 0.14.5 to 0.15.0 (#6371)
**BREAKING:** This upgrades all lexical packages from 0.14.5 to 0.15.0.
If there are any breaking changes within lexical, this could break your
project if you use lexical APIs directly (e.g. in custom features). We
have not noticed any breaking changes within core. Please consult their
changelog: https://github.com/facebook/lexical/releases/tag/v0.15.0
2024-05-15 13:44:51 -04:00
Alessio Gravili
cb9a20fefa fix: loader throwing errors for client files imported using TS paths (#6369)
## Description

Fixes https://github.com/payloadcms/payload-3.0-demo/issues/215

imports like import LogoSVG from '@/components/logo.svg' did not make it
to the TS module resolution, due to the early isClient check.

And the isClient check only uses node module resolution (using
nextResolves) which throws an error here.

This removes module resolution completely, as we "ignore" client files
anyways. Should also help improve performance, and we do not have to
fall back to ts module resolution for client files that way, which would
be unnecessary
2024-05-15 12:53:07 -04:00
Alessio Gravili
8db9664700 fix(richtext-lexical): autoLink node styles not inherited from original text node on creation
Backports https://github.com/facebook/lexical/pull/6069
2024-05-15 12:50:30 -04:00
Alessio Gravili
08add653c7 chore(richtext-lexical): replace deprecated event.keyCode with event.code 2024-05-15 12:42:14 -04:00
Alessio Gravili
eed9676536 chore(richtext-lexical): add @lexical/eslint-plugin eslint plugin and fix all eslint errors & warnings 2024-05-15 12:41:10 -04:00
Alessio Gravili
22480a7648 feat(richtext-lexical)!: upgrade lexical from 0.14.5 to 0.15.0 and ensure peerDependencies force correct lexical version 2024-05-15 12:22:26 -04:00
Jarrod Flesch
aa2073f9e9 chore: adjusts how file uploads are handled, consolidates reading to busboy (#6346) 2024-05-15 11:42:04 -04:00
Alessio Gravili
e0618f81a5 chore: loosen type for ClientTranslationsObject to improve TS performance (#6368) 2024-05-15 15:18:43 +00:00
Alessio Gravili
ea90018979 chore: auto-translation script for v3, and translate all missing translation keys (#6361) 2024-05-15 13:54:25 +00:00
Jessica Chowdhury
5a4074e90a fix: multiselect relationship bug and improve accessibility (#6286)
## Description

Closes [#117](https://github.com/payloadcms/payload-3.0-demo/issues/177)
- hitting the space key while the `ReactSelect` is in focus crashes the
page.

This PR makes the following changes:
- Multivalue select component updated to only use `id`, drag feature
does not work when using `uuid()`
- Ensures relationship field (multi and single value) can be accessed
via the keyboard

- [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 09:33:47 -04:00
Elliot DeNolf
0e9bbecbee chore(release): v3.0.0-beta.32 [skip ci] 2024-05-14 17:33:28 -04:00
Alessio Gravili
c8a1ccaf4b feat(richtext-lexical): add rootFeatures prop to lexicalEditor (#6360) 2024-05-14 17:29:21 -04:00
Alessio Gravili
79f4907cb3 feat!: add missing server-only props to custom RSCs, improve req.user type, clean-up ui imports (#6355) 2024-05-14 17:27:15 -04:00
Jacob Fletcher
6a0fffe002 feat!: consolidates admin.logoutRoute and admin.inactivityRoute into admin.routes (#6354) 2024-05-14 21:18:19 +00:00
Jarrod Flesch
6e116a76fd fix(graphql): threads through correct draft value for upload relations (#6235) 2024-05-14 14:05:58 -04:00
Elliot DeNolf
f52607f3b5 chore(release): v3.0.0-beta.31 [skip ci] 2024-05-14 12:37:38 -04:00
Alessio Gravili
f716122eab feat!: typed i18n (#6343) 2024-05-14 11:10:31 -04:00
Patrik
353c2b0be2 fix(ui): step-nav breadcrumbs ellipsis (#6344) 2024-05-14 11:08:34 -04:00
Jessica Chowdhury
58bbbbd395 fix: collection labels with multiple locales showing incorrectly (#5998) 2024-05-14 15:05:36 +00:00
Jessica Chowdhury
57b072edfc chore: fix indentation in API tab json for empty nested objects/arrays (#6150) 2024-05-14 14:44:10 +00:00
Jacob Fletcher
f6039246c6 feat!: replaces admin.favicon with admin.icons (#6347) 2024-05-14 09:56:07 -04:00
Jessica Chowdhury
fcee13b017 fix: depth field in api view throws error when no value present (#6106) 2024-05-14 13:46:16 +00:00
Jacob Fletcher
ef5197a514 Merge branch 'beta' into feat/next-icons 2024-05-14 09:30:01 -04:00
Jacob Fletcher
7438812db3 feat!: replaces admin.favicon with admin.icons 2024-05-14 08:56:21 -04:00
Elliot DeNolf
48af78278d ci: run protected branch actions to completion 2024-05-13 19:30:02 -04:00
Jarrod Flesch
3abc2e8328 fix: implements graphql schema generation (#6254)
Co-authored-by: Elliot DeNolf <denolfe@gmail.com>
2024-05-13 16:46:43 -04:00
Jacob Fletcher
a48043c2aa fix(next): replaces default svg favicons with png 2024-05-13 16:33:50 -04:00
Jacob Fletcher
7e4f50a01c feat(ui): exports png favicons 2024-05-13 16:27:53 -04:00
Elliot DeNolf
40d3078bf2 feat(cpa): initialize git repo on project creation (#6342) 2024-05-13 14:59:39 -04:00
Elliot DeNolf
662334abfb ci: bump playwright actions/cache usage to v4 2024-05-13 14:01:32 -04:00
Paul
aa5ad47177 fix: named tab being required in generated types without any required fields (#6324) 2024-05-13 13:55:48 -04:00
James Mikrut
890c21dda4 fix(payload): loader alias issues (#6341) 2024-05-13 13:49:16 -04:00
Patrik
c7635b2783 fix(ui): properly adds readOnly styles to disabled radio fields (#6240) 2024-05-13 12:18:36 -04:00
James Mikrut
47cd5f4d01 fix(db-postgres): too many clients already, cannot read properties 'transaction' of undefined (#6338) 2024-05-13 12:13:30 -04:00
Alessio Gravili
0d98b4b96f fix!: some custom components were not handled properly if they are RSCs (#6315)
**Breaking:** The following, exported components now need the `payload` object as a prop rather than the `config` object:
- `RenderCustomComponent` (optional)
- `Logo`
- `DefaultTemplate`
- `DefaultNav`
2024-05-13 12:05:13 -04:00
Jacob Fletcher
a20cf70105 docs: removes express 2024-05-13 10:29:59 -04:00
Elliot DeNolf
23c7ab2bc4 ci: add plugin-relationship-object-ids to publish list (#6335) 2024-05-13 10:14:10 -04:00
Fredrik
0680e0c58b chore(plugin-nested-docs): export the getParents utility (#6325) 2024-05-13 13:39:35 +00:00
Jessica Chowdhury
b3df253880 feat: adds translations for API view and select component (#6143) 2024-05-13 13:03:26 +00:00
Elliot DeNolf
a78b44d0c1 docs: add storage adapter docs (#6334) 2024-05-13 08:46:05 -04:00
Elliot DeNolf
d272a1fd22 docs: update email docs for new adapters (#6332) 2024-05-13 08:44:59 -04:00
Elliot DeNolf
095e4402ac test: type fixes (#6331) 2024-05-13 01:37:52 +00:00
Elliot DeNolf
60d2def428 chore: create file that imports all 2.x exports (#6224) 2024-05-12 21:28:19 -04:00
Paul
2f02b3a6e1 fix: wrong translation key being used as upload:Sizes instead of upload:sizes (#6323) 2024-05-11 15:09:38 +00:00
Jacob Fletcher
0886e4e972 docs: restructures admin components docs 2024-05-10 17:56:11 -04:00
Jarrod Flesch
4f0ddcf632 chore: improves lexical fixed toolbar styles (#6317) 2024-05-10 17:38:24 -04:00
Jarrod Flesch
693621a6e3 chore: improves types for lexical client features (#6318) 2024-05-10 17:38:10 -04:00
Elliot DeNolf
5b201392cc ci: add storage-uploadthing 2024-05-10 17:15:22 -04:00
Elliot DeNolf
a70bcf81c0 chore(release): v3.0.0-beta.30 [skip ci] 2024-05-10 17:10:18 -04:00
Elliot DeNolf
ed880d5018 feat: storage-uploadthing package (#6316)
Co-authored-by: James <james@trbl.design>
2024-05-10 17:05:35 -04:00
Patrik
ea84e82ad5 feat(payload, ui): adds disableListColumn & disableListFilter to fields admin props (#6238) 2024-05-10 15:59:29 -04:00
Patrik
4216d69ccb fix(richtext-slate): list item values returning null (#6291) 2024-05-10 15:42:37 -04:00
Jacob Fletcher
550a40d6a2 docs: updates admin overview doc 2024-05-10 15:28:14 -04:00
Patrik
dcad5003f5 fix(ui): appends editDepth value to radio & checkbox IDs when inside drawer (#6252) 2024-05-10 15:56:24 +00:00
Paul
bd9c06a99d chore: update readme for tailwind example (#6314) 2024-05-10 12:13:10 -03:00
Elliot DeNolf
48932ef54d chore: format plugin object ids (#6310) 2024-05-10 14:20:21 +00:00
Jacob Fletcher
261f6dc20d docs: adds examples docs 2024-05-10 10:00:14 -04:00
Patrik
4aeefc5a1a feat: adds plugin-relationship-object-ids package (#6045) 2024-05-10 09:31:25 -04:00
Ritsu
e96ff90029 fix(next): respect fallback locale null value (#6207) 2024-05-10 14:27:13 +01:00
Elliot DeNolf
f6e77b845b ci: add npm provenance to canary releases 2024-05-10 09:08:16 -04:00
Elliot DeNolf
a0bb02d05a chore: remove unneeded val in redirects publish config 2024-05-09 23:58:58 -04:00
Elliot DeNolf
354ad7092c chore: type gen formatting (#6309) 2024-05-09 23:55:55 -04:00
Elliot DeNolf
f9d862d854 ci(scripts): update getPackageRegistryVersions [skip ci] 2024-05-09 23:35:50 -04:00
Elliot DeNolf
f41576dd65 ci: canary releases (#6308) 2024-05-09 23:12:47 -04:00
Elliot DeNolf
ffa20aa7d0 chore(release): v3.0.0-beta.29 [skip ci] 2024-05-09 17:19:54 -04:00
Alessio Gravili
f7a2cf96b9 chore: properly working generated types within tests (#6288) 2024-05-09 17:12:51 -04:00
Alessio Gravili
cfeac79b99 feat!: fix non-functional custom RSC component handling, separate label and description props, fix non-functional label function handling (#6264)
Breaking Changes:

- Globals config: `admin.description` no longer accepts a custom component. You will have to move it to `admin.components.elements.Description`
- Collections config: `admin.description` no longer accepts a custom component. You will have to move it to `admin.components.edit.Description`
- All Fields: `field.admin.description` no longer accepts a custom component. You will have to move it to `field.admin.components.Description`
- Collapsible Field: `field.label` no longer accepts a custom component. You will have to move it to `field.admin.components.RowLabel`
- Array Field: `field.admin.components.RowLabel` no longer accepts strings or records
- If you are using our exported field components in your own app, their `labelProps` property has been stripped down and no longer contains the `label` and `required` prop. Those can now only be configured at the top-level
2024-05-09 17:12:01 -04:00
Elliot DeNolf
821bed0ea6 ci: all green (#6289) 2024-05-09 16:33:05 -04:00
Jacob Fletcher
1a20390454 docs: removes bundlers, webpack, and vite 2024-05-09 15:58:51 -04:00
Jacob Fletcher
9e9111666b chore(examples/live-preview): migrates to 3.0 (#6268) 2024-05-09 15:32:46 -04:00
David Velasco
5065322d31 fix(plugin-form-builder): resolve labelValue from LabelFunction (#5817) 2024-05-09 16:23:44 -03:00
Paul
ad4796cdb2 fix(plugin-form-builder): export types correctly (#6287) 2024-05-09 14:42:14 -03:00
Alessio Gravili
43b7ba82da chore: fix dev:generate-types not working (#6284) 2024-05-09 10:37:11 -04:00
Alessio Gravili
3785c79ac9 fix(templates): yarn install broken for new template installs (#6283) 2024-05-09 10:17:09 -04:00
Jarrod Flesch
4384e9eb0e chore: fixes cannot destructure property 'schema' issue (#6282) 2024-05-09 10:16:30 -04:00
Alessio Gravili
9364f8da2e fix(templates): blank-3.0: pin next version, as it was breaking new installs (#6281) 2024-05-09 10:05:38 -04:00
Elliot DeNolf
a4ef359660 chore: examples linting (#6269) 2024-05-08 14:58:57 -04:00
Elliot DeNolf
848c05f247 chore(deps): sync pnpm-lock.yaml 2024-05-08 14:37:48 -04:00
Elliot DeNolf
ec556360b6 chore(release): v3.0.0-beta.28 [skip ci] 2024-05-08 14:08:09 -04:00
Elliot DeNolf
d99b426e3b fix: live-preview-* dep version 2024-05-08 14:07:06 -04:00
Elliot DeNolf
19a78297b4 ci: add live-preview and live-preview-react to publish list 2024-05-08 13:48:17 -04:00
Elliot DeNolf
e95eea694c chore(release): v3.0.0-beta.27 [skip ci] 2024-05-08 13:33:55 -04:00
Kendell Joseph
4c6aaafe88 feat(ui): toggle sortable arrays and blocks (#6008) 2024-05-08 13:28:26 -04:00
Elliot DeNolf
dc8c099d9e ci: publish script retry on failure, log all version on completion 2024-05-08 12:30:48 -04:00
Elliot DeNolf
259ae674a1 chore(release): v3.0.0-beta.26 [skip ci] 2024-05-08 11:18:39 -04:00
Jacob Fletcher
731f023c6d feat: ssr live preview (#6239) 2024-05-08 11:08:15 -04:00
Elliot DeNolf
86b19d4c74 chore: update codeowners file [skip ci] 2024-05-08 10:05:55 -04:00
Elliot DeNolf
17b8c29799 chore(eslint): no imports from exports dir (#6263) 2024-05-08 10:01:20 -04:00
Elliot DeNolf
29af2849ba ci: yaml formatting [skip ci] 2024-05-08 09:40:57 -04:00
Jarrod Flesch
a7ac5efd70 feat: improves crop rendering in thumbnail (#6260) 2024-05-08 08:27:30 -04:00
Elliot DeNolf
15c7a9dcf8 ci: only lint on prs 2024-05-07 16:40:31 -04:00
Alessio Gravili
8e55a2a866 feat(richtext-lexical)!: strongly typed PluginComponent types, remove LexicalBlocks, improve exports, fix e2e (#6255)
**BREAKING:**
- Narrows the type of the `plugins` prop of lexical features. Client props are now also automatically provided to the plugin components. To migrate, type your plugin as either `PluginComponent` or PluginComponentWithAnchor.
- `BlockQuoteFeature` has been renamed to `BlockquoteFeature`
- `createClientComponent` is now exported only from /components
- The `LexicalBlocks` and `FieldWithRichTextRequiredEditor` types have been removed in favor of just `Blocks` & `Fields`, as well as improved validation.
2024-05-07 16:26:28 -04:00
Alessio Gravili
0f306da63b fix(richtext-lexical): various UX improvements (#6241) 2024-05-07 10:42:26 -04:00
Alessio Gravili
ba9ea5c752 fix(richtext-lexical): fixed toolbar actions not ensuring editor focus, various link editor selection issues 2024-05-07 10:40:56 -04:00
Alessio Gravili
53b7d6f89f fix(richtext-lexical): fixed toolbar not wrapping correctly on small screen sizes 2024-05-07 09:51:45 -04:00
Alessio Gravili
f5fb095df4 feat(richtext-lexical): improve draggable block indicator style and animations 2024-05-07 09:39:11 -04:00
Alessio Gravili
721919fae9 feat(richtext-lexical): add maxDepth property to various lexical features (#6242) 2024-05-07 09:11:34 -04:00
Elliot DeNolf
d3e27e87fe ci: add lint job (#6247) 2024-05-06 23:32:45 -04:00
Jacob Fletcher
e1ff92e8c6 chore(plugin-stripe)!: disables rest proxy by default (#6230) 2024-05-06 17:33:43 -04:00
Jarrod Flesch
ac5d744914 fix: properly extracts fallbackLang (#6237) 2024-05-06 15:56:46 -04:00
Alessio Gravili
b94a265fad fix(richtext-lexical): ensure inline toolbar is positioned between link editor and fixed toolbar 2024-05-06 15:07:16 -04:00
Alessio Gravili
1ba3a92745 fix(richtext-lexical): text within relationship and upload node components was not able to be selected without selection resetting immediately 2024-05-06 14:58:42 -04:00
Alessio Gravili
9814fd705e fix(richtext-lexical): inline editor is overlapping the clickable link editor for the first line 2024-05-06 14:54:35 -04:00
Alessio Gravili
20455f4fc2 fix(richtext-lexical): floating link editor did not properly hide if selection is not a range selection 2024-05-06 14:50:52 -04:00
Elliot DeNolf
9f37bf7397 ci(scripts): improve footer parsing trailing quote 2024-05-06 13:53:34 -04:00
Elliot DeNolf
892b884745 chore(release): v3.0.0-beta.25 [skip ci] 2024-05-06 13:02:08 -04:00
Elliot DeNolf
e8dd0a7daf chore: more type updates (#6234) 2024-05-06 12:57:50 -04:00
Elliot DeNolf
26151e39c9 chore: package type export consistency (#6232) 2024-05-06 11:38:23 -04:00
Elliot DeNolf
453e331014 chore: package.json author consistency 2024-05-06 11:05:44 -04:00
Paul
7f72006020 chore(plugin-stripe)!: add types exports and rename types to be more consistent with other plugins (#6216)
Co-authored-by: Elliot DeNolf <denolfe@gmail.com>
2024-05-06 10:37:44 -04:00
Paul
3c13df3c2d chore(plugin-search): add types export and rename internal config (#6220)
Co-authored-by: Elliot DeNolf <denolfe@gmail.com>
2024-05-06 09:54:01 -04:00
Paul
d31af813e2 chore(plugin-nested-docs): add types export (#6219)
Co-authored-by: Elliot DeNolf <denolfe@gmail.com>
2024-05-06 09:52:24 -04:00
Paul
a85dc66a39 chore(plugin-form-builder): add types export (#6218)
Co-authored-by: Elliot DeNolf <denolfe@gmail.com>
2024-05-06 09:48:14 -04:00
Paul
9492f0ae29 chore(plugin-seo): export types (#6217) 2024-05-06 09:46:25 -04:00
Jarrod Flesch
51149c75ff fix: threads draft arg through for child resolvers in GraphQL queries (#6196) 2024-05-04 16:43:17 -04:00
Jarrod Flesch
56bedb821f chore: adjusts forgot pw email template (#6209) 2024-05-04 16:42:22 -04:00
Friggo
d3bca574aa feat(translations): add Slovak translation (#6114) 2024-05-04 17:26:29 -03:00
Alessio Gravili
c462bf229f feat(richtext-lexical)!: add FixedToolbarFeature (#6192)
BREAKING:

- The default inline toolbar has now been extracted into an `InlineToolbarFeature`. While it's part of the defaultFeatures, you might have to add it to your editor features if you are not including the defaultFeatures and still want to keep the inline toolbar (floating toolbar)
- Some types have been renamed, e.g. `InlineToolbarGroup` is now `ToolbarGroup`, and `InlineToolbarGroupItem` is now `ToolbarGroupItem`
- The `displayName` property of SlashMenuGroup and SlashMenuItem has been renamed to `label` to match the `label` prop of the toolbars
- The `inlineToolbarFeatureButtonsGroupWithItem`, `inlineToolbarFormatGroupWithItems` and `inlineToolbarTextDropdownGroupWithItems` exports have been renamed to `toolbarTextDropdownGroupWithItems`,  `toolbarFormatGroupWithItems`, `toolbarFeatureButtonsGroupWithItems`
2024-05-03 19:55:26 -04:00
Paul
8a452c42af fix(plugin-form-builder): custom formSubmission hooks overriding core ones (#6204) 2024-05-03 18:02:17 -03:00
Jacob Fletcher
07f2d74dc3 chore(examples/auth): migrates to 3.0 (#5877) 2024-05-03 16:28:27 -04:00
Elliot DeNolf
2ce65dc1e0 chore(release): v3.0.0-beta.24 [skip ci] 2024-05-03 14:56:47 -04:00
Elliot DeNolf
37be06448c ci: more resilient release script (#6202) 2024-05-03 14:39:26 -04:00
Elliot DeNolf
9c13089a2f chore: add dotenv to test dir [skip ci] 2024-05-03 13:42:01 -04:00
Paul
b642cb2d93 chore!: update plugin exports to be named and consistent (#6195)
BREAKING CHANGE: All plugins have been updated to use named exports and the names have been updated to be consistent.

// before
import { cloudStorage } from '@payloadcms/plugin-cloud-storage'
// current
import { cloudStoragePlugin } from '@payloadcms/plugin-cloud-storage'

//before
import { payloadCloud } from '@payloadcms/plugin-cloud'
// current
import { payloadCloudPlugin } from '@payloadcms/plugin-cloud'

//before
import formBuilder from '@payloadcms/plugin-form-builder'
// current
import { formBuilderPlugin } from '@payloadcms/plugin-form-builder'

//before
import { nestedDocs } from '@payloadcms/plugin-nested-docs'
// current
import { nestedDocsPlugin } from '@payloadcms/plugin-nested-docs'

//before
import { redirects } from '@payloadcms/plugin-redirects'
// current
import { redirectsPlugin } from '@payloadcms/plugin-redirects'

// before
import search from '@payloadcms/plugin-search'
// current
import { searchPlugin } from '@payloadcms/plugin-search'

//before
import { sentry } from '@payloadcms/plugin-sentry'
// current
import { sentryPlugin } from '@payloadcms/plugin-sentry'

// before
import { seo } from '@payloadcms/plugin-seo'
// current
import { seoPlugin } from '@payloadcms/plugin-seo'
2024-05-03 13:36:36 -03:00
Elliot DeNolf
9e5d521567 ci: allow examples/* scopes 2024-05-03 11:41:16 -04:00
Jessica Chowdhury
6eabc99e01 chore: translate checkbox result in collection list view (#6165) 2024-05-03 10:44:43 -04:00
Jacob Fletcher
ea917dd811 feat(next): supports custom login redirects in initPage (#6186) 2024-05-03 09:48:57 -04:00
Jacob Fletcher
070d8e1731 feat(next): supports custom login redirects in initPage 2024-05-03 09:24:34 -04:00
Jacob Fletcher
664c60d2bc chore(next): restructures initPage 2024-05-03 09:17:17 -04:00
Jarrod Flesch
e25814e1ee fix: cascade graphql locales through relationships (#6166) 2024-05-03 08:33:53 -04:00
Jarrod Flesch
27ea117731 fix: only allow save after form is modified (#6189) 2024-05-03 08:28:37 -04:00
Alessio Gravili
7ab156e117 feat(richtext-lexical)!: finalize ClientFeature interface (#6191)
**BREAKING:**
If you have own, custom lexical features, there will be a bunch of breaking API changes for you. The saved JSON data is not affected.

- `floatingSelectToolbar` has been changed to `toolbarInline`

- `slashMenu.dynamicOptions `and `slashMenu.options` have been changed to `slashMenu.groups` and `slashMenu.dynamicGroups`

- `toolbarFixed.sections` is now `toolbarFixed.groups`

- Slash menu group `options` and toolbar group `entries` have both been renamed to `items`

- Toolbar group item `onClick` has been renamed to `onSelect` to match slash menu properties

- slashMenu item `onSelect` is no longer auto-wrapped inside an `editor.update`. If you perform editor updates in them, you have to wrap it inside an `editor.update` callback yourself. Within our own features this extra control has removed a good amount of unnecessary, nested `editor.update` calls, which is good

- Slash menu items are no longer initialized using the `new` keyword, as they are now types and no longer classes. You can convert them to an object and add the `key` property as an object property instead of an argument to the previous SlashMenuItem constructor

- CSS classnames for slash menu and toolbars, as well as their items, have changed

- `CheckListFeature` is now exported as and has been renamed to `ChecklistFeature`

For guidance on migration, check out how we migrated our own features in this PR's diff: https://github.com/payloadcms/payload/pull/6191/files
2024-05-02 21:38:15 -04:00
Paul
f2d415663f fix: ensures confirm password remains on form state (#6190) 2024-05-02 18:53:35 -03:00
Jarrod Flesch
bdf08a19d1 fix: moves ts-essentials to prod deps (#6187) 2024-05-02 16:37:05 -04:00
Elliot DeNolf
cb90e9f622 chore(release): v3.0.0-beta.23 [skip ci] 2024-05-02 16:05:19 -04:00
Elliot DeNolf
b05a5e1fb6 chore(deps): bump turborepo 2024-05-02 15:57:18 -04:00
Elliot DeNolf
92a5da1006 chore: move stripe postman out of src [skip ci] 2024-05-02 15:50:44 -04:00
Paul
75a95469b2 feat(plugin-stripe): update plugin stripe for v3 (#6019) 2024-05-02 16:19:27 -03:00
Jarrod Flesch
c0ae287d46 fix: reset password validations (#6153)
Co-authored-by: Elliot DeNolf <denolfe@gmail.com>
Co-authored-by: James <james@trbl.design>
Co-authored-by: Alessio Gravili <alessio@gravili.de>
2024-05-02 15:08:47 -04:00
Patrik
a2b92aa3ff fix(ui): watch "where" query param inside route and reset WhereBuilder (#6184) 2024-05-02 13:25:51 -04:00
Friggo
544a2285d3 chore(translations): czech translation improvements (#6078) 2024-05-02 12:54:18 -04:00
Elliot DeNolf
8c39950ea3 chore(release): v3.0.0-beta.22 [skip ci] 2024-05-02 12:27:28 -04:00
Yiannis Demetriades
6d642fe9b9 fix(templates): adds back missing CSS import in blank 3.0 template (#6183) 2024-05-02 11:30:58 -04:00
Jacob Fletcher
f175a741bc chore(next): exports initPage utility (#6182) 2024-05-02 11:22:13 -04:00
Jacob Fletcher
3290376f80 fix(next): ensures admin access only blocks admin routes 2024-05-02 11:07:43 -04:00
Jacob Fletcher
2b5c1ba99a chore(next): exports initPage utility 2024-05-02 10:32:17 -04:00
Alessio Gravili
bcb3f08386 chore: hide test flakes, improve playwright CI logs, significantly reduce playwright timeouts, add back test retries, cache playwright browsers in CI, disable CI telemetry, improve test throttle utility (#6155) 2024-05-01 17:35:41 -04:00
Wilson
b729b9bebd docs: add before login comments (#6101) 2024-05-01 15:59:11 -04:00
Tylan Davis
26ee91eb48 docs: adjust line breaks in code blocks (#6001) 2024-05-01 15:57:39 -04:00
Paul
43a17f67a0 chore(richtext-lexical): export types for additional props (#6173) 2024-05-01 15:03:06 -03:00
Elliot DeNolf
c71d2db949 chore(release): v3.0.0-beta.21 [skip ci] 2024-05-01 13:25:14 -04:00
Jacob Fletcher
04f1df8af1 fix(templates): updates payload app files (#6172) 2024-05-01 12:43:47 -04:00
Elliot DeNolf
1c490aee42 fix(deps): move file-type to deps (#6171) 2024-05-01 12:20:45 -04:00
Elliot DeNolf
c6132df866 chore: rename resend package (#6168) 2024-05-01 12:02:40 -04:00
Alessio Gravili
d8f91cc94c feat(richtext-lexical)!: various validation improvement (#6163)
BREAKING: this will now display errors if you're previously had invalid link or upload fields data - for example if you have a required field added to an uploads node and did not provide a value to it every time you've added an upload node
2024-05-01 11:33:02 -04:00
Alessio Gravili
568b074809 fix: various loader issues (#6090) 2024-05-01 10:45:28 -04:00
Alessio Gravili
401c16e485 chore: lexical int tests: do not use relationTo to collection with rich text relationships disabled 2024-05-01 00:47:40 -04:00
Elliot DeNolf
17bee6a145 ci: reworks changelog and release notes generation (#6164) 2024-04-30 23:50:49 -04:00
Alessio Gravili
8829fba6cf feat(richtext-lexical)!: add validation to link and upload nodes
BREAKING: this will now display errors if you're previously had invalid link or upload fields data - for example if you have a required field added to an uploads node and did not provide a value to it every time you've added an upload node
2024-04-30 23:14:27 -04:00
Alessio Gravili
e8983abe65 ci: enable fields RichText e2e test suite 2024-04-30 23:12:47 -04:00
Alessio Gravili
01f38c4e33 feat(richtext-lexical): link node: disable client-side link validation. This allows overriding validation behavior by providing your own url field to the Link feature.
Allows you to, for example, allow anchor nodes to be inputted as URL by overriding validation.
2024-04-30 23:12:07 -04:00
Alessio Gravili
10b99ceb6f fix: add missing error logger to buildFormState error catch 2024-04-30 23:10:52 -04:00
Alessio Gravili
1140426b73 Merge remote-tracking branch 'origin/beta' into feat/improve-lexical-validations-2 2024-04-30 23:02:07 -04:00
Alessio Gravili
5a82f34801 feat(richtext-lexical)!: change link fields handling (#6162)
**BREAKING:**
- Drawer fields are no longer wrapped in a `fields` group. This might be breaking if you depend on them being in a field group in any way - potentially if you use custom link fields. This does not change how the data is saved
- If you pass in an array of custom fields to the link feature, those were previously added to the base fields. Now, they completely replace the base fields for consistency. If you want to ADD fields to the base fields now, you will have to pass in a function and spread `defaultFields` - similar to how adding your own features to lexical works

**Example Migration for ADDING fields to the link base fields:**

**Previous:**
```ts
 LinkFeature({
    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.',
        },
      },
    ],
  }),
```

**Now:**
```ts
 LinkFeature({
    fields: ({ defaultFields }) => [
      ...defaultFields,
      {
        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.',
        },
      },
    ],
  }),
2024-04-30 23:01:08 -04:00
Alessio Gravili
5420d889fe fix(richtext-slate): do not add empty fields group if no custom fields are added 2024-04-30 21:53:47 -04:00
Alessio Gravili
d9bb51fdc7 feat(richtext-lexical)!: initialize lexical during sanitization (#6119)
BREAKING:

- sanitizeFields is now an async function
- the richText adapters now return a function instead of returning the adapter directly
2024-04-30 15:09:32 -04:00
Alessio Gravili
9a636a3cfb fix(richtext-lexical): floating toolbar caret positioned incorrectly for some line heights (#6149) 2024-04-30 12:01:25 -04:00
Alessio Gravili
181f82f33e feat(richtext-lexical): implement relationship node click and delete/backspace handling (#6147) 2024-04-30 11:11:47 -04:00
Alessio Gravili
6a9cde24b0 fix(richtext-lexical): drag and add block handles disappear too quickly for smaller screen sizes. (#6144) 2024-04-30 10:50:18 -04:00
Elliot DeNolf
dc31d9c715 test: parse and update tsconfig in before test hook 2024-04-30 00:24:06 -04:00
Elliot DeNolf
45b3f06e1b chore: implement better tsconfig reset mechanism 2024-04-29 23:23:09 -04:00
Elliot DeNolf
d5f7944ac4 chore(eslint): set prefer-ts-expect-error to error 2024-04-29 22:30:05 -04:00
Elliot DeNolf
3d50caf985 feat: implement resend rest email adapter (#5916) 2024-04-29 22:06:53 -04:00
Jacob Fletcher
4d7ef58e7e fix: blocks non-admin users from admin access (#6127) 2024-04-29 19:53:18 -04:00
Paul
3e117f4e99 chore: add graphql as a dependency to the blank template (#6128) 2024-04-29 20:09:27 -03:00
Elliot DeNolf
888d6f8856 ci(scripts): adjust release publish limit 2024-04-29 17:19:36 -04:00
Elliot DeNolf
9ebf8693d4 chore(release): v3.0.0-beta.20 [skip ci] 2024-04-29 16:51:35 -04:00
James Mikrut
d8c3127b09 fix: local req missing url headers (#6126)
Co-authored-by: Jarrod Flesch <jarrodmflesch@gmail.com>
2024-04-29 16:40:59 -04:00
James Mikrut
b6631f4778 fix: logout-inactivity route was 404ing (#6121) 2024-04-29 15:53:08 -04:00
Elliot DeNolf
2e77bdf11e test: add test email adapter, use for all tests by default (#6120) 2024-04-29 14:38:35 -04:00
Elliot DeNolf
cce75f11ca ci: add better message for PR subject pattern error 2024-04-29 14:34:04 -04:00
Elliot DeNolf
d8b6b39dbb fix: validate user slug is an auth-enabled collection (#6118) 2024-04-29 14:25:23 -04:00
Jacob Fletcher
fa89057aac fix(next,ui): properly sets document operation for globals (#6116) 2024-04-29 13:58:06 -04:00
Jarrod Flesch
15db0a8018 fix: conditions throwing errors break form state (#6113) 2024-04-29 12:54:00 -04:00
Elliot DeNolf
b7a4d9cea4 chore(deps): adjust node engines to account for node register requirement (#6115) 2024-04-29 12:28:31 -04:00
Elliot DeNolf
5b676c36e5 docs(storage-*): readme fixes 2024-04-29 09:40:39 -04:00
Jacob Fletcher
32231762ff chore: version permissions (#6068) 2024-04-29 08:22:56 -04:00
Elliot DeNolf
a7096c1599 chore: telemetry localization (#6075) 2024-04-28 22:17:08 -04:00
Alessio Gravili
bed428c27e feat(richtext-lexical)!: upgrade lexical from 0.13.1 to 0.14.5 and backport other changes (#6095)
BREAKING:

- Lexical may introduce breaking changes in their updates. Please consult their changelog. One breaking change I noticed is that the SerializedParagraphNode now has a new, required textFormat property.

- Now that lexical supports ESM, all CJS-style imports have been changed to ESM-style imports. You may have to do the same in your codebase if you import from lexical core packages
2024-04-28 20:25:27 -04:00
Elliot DeNolf
873e698352 docs: storage-* and plugin-cloud-storage updates (#6096) 2024-04-28 20:07:49 -04:00
Alessio Gravili
ad13577399 chore(richtext-lexical): fix build and backport badNode logic change from lexical core 2024-04-28 19:58:07 -04:00
Alessio Gravili
31a9c77055 fix(richtext-lexical): preserve bullet list item indent on newline
BACKPORTS https://github.com/facebook/lexical/pull/5578
2024-04-28 19:30:52 -04:00
Alessio Gravili
bae0c2df5f fix(richtext-lexical): add missing uuid dependency 2024-04-28 19:26:25 -04:00
Alessio Gravili
0ed31def68 feat(richtext-lexical): implement upload node click and delete/backspace handling 2024-04-28 19:19:34 -04:00
Alessio Gravili
0e7a6ad5ab fix(richtext-lexical): prevent link modal from showing if selection spans further than the link
Backports https://github.com/facebook/lexical/pull/5551
2024-04-28 19:03:02 -04:00
Alessio Gravili
180797540c feat(richtext-lexical)!: change all CJS lexical imports to ESM lexical imports
BREAKING: You might have to do the same if you import from lexical in your application
2024-04-28 18:50:58 -04:00
Alessio Gravili
c00babf9b3 chore(richtext-lexical): upgrade all lexical dependencies from 0.13.1 to 0.14.5 2024-04-28 17:52:11 -04:00
Alessio Gravili
943681ae3c chore: upgrade typescript from 5.4.4 to 5.4.5 (#6093) 2024-04-28 17:46:41 -04:00
Alessio Gravili
f14ce367d2 fix(richtext-lexical): type errors for FeatureProviderServer with typescript strict mode (#6091) 2024-04-28 17:12:47 -04:00
Paul
3eb5766323 fix: issue with dupplicate ':' in email links (#6086) 2024-04-28 17:22:07 -03:00
Alessio Gravili
cd5e8d7b52 fix: importWithoutClientFiles not working due to incorrect import path used 2024-04-28 16:06:01 -04:00
Alessio Gravili
361d12e97c chore: loader test: use importConfig helper instead of manually registering loader to realistically test what a user would experience 2024-04-28 16:04:11 -04:00
Elliot DeNolf
fb4a5a3715 chore(ui): fix bad imports 2024-04-28 14:53:15 -04:00
Elliot DeNolf
9c2585ba86 chore(eslint): no-relative-monorepo-imports on package dir, other cleanup 2024-04-28 14:49:48 -04:00
Paul
feb6296bb4 chore: add tailwind and shadcn/ui example (#6085) 2024-04-28 15:06:43 -03:00
Alessio Gravili
74eb71c304 chore: add failing loader test case 2024-04-27 21:13:38 -04:00
Alessio Gravili
fa2083f764 fix: loader: typescript module resolver not resolving to source path of symlinked module 2024-04-27 20:45:04 -04:00
Jacob Fletcher
7111834a99 fix(ui): conditionally fetches versions based on read access 2024-04-26 17:40:28 -04:00
Jacob Fletcher
a943c7eddb fix(ui): conditionally renders versions tab based on read access 2024-04-26 17:40:14 -04:00
Jacob Fletcher
2d089a7bae chore: threads permissions through document tab conditions 2024-04-26 17:38:59 -04:00
Elliot DeNolf
5bba969f0d chore(release): v3.0.0-beta.19 [skip ci] 2024-04-26 17:08:50 -04:00
Jarrod Flesch
3a43fd34c0 chore: fixes bad auto import (#6070) 2024-04-26 16:45:24 -04:00
Jarrod Flesch
d9005b3f53 chore: file uploads, broken import path (#6069) 2024-04-26 16:26:11 -04:00
Jarrod Flesch
fab9e32175 fix: correct createPayloadRequest routeParams (#6059) 2024-04-26 16:13:21 -04:00
Jarrod Flesch
e71c1c2ec4 fix: formData handling on Vercel (#6067) 2024-04-26 16:10:14 -04:00
Dan Ribbens
81fb0515fb fix: bulk publish from collection list (#6065) 2024-04-26 15:46:02 -04:00
Elliot DeNolf
739dfc1434 chore: convert all errors to named exports (#6061) 2024-04-26 13:24:18 -04:00
Jacob Fletcher
a4e8795666 fix(deps): dedupes react (#6064) 2024-04-26 13:22:12 -04:00
Elliot DeNolf
14134d637d fix: properly handle external file url (#6060) 2024-04-26 12:02:07 -04:00
Elliot DeNolf
2b698a9018 chore: add more valid pr scopes [skip ci] 2024-04-26 11:55:01 -04:00
Elliot DeNolf
91684c8a7d ci: app build with packed (#6051) 2024-04-26 00:19:44 -04:00
Elliot DeNolf
fbdfe1d9dd chore: set -ex on pack and build step 2024-04-25 23:56:16 -04:00
Elliot DeNolf
7221725121 chore: start mongo for build 2024-04-25 23:46:48 -04:00
Elliot DeNolf
640348df3a chore: use --ignore-workspace in template install 2024-04-25 23:37:05 -04:00
Elliot DeNolf
4ed99e017a ci: add app-build-with-packed job 2024-04-25 23:28:28 -04:00
Elliot DeNolf
df6b9dd30b ci(scripts): update pack-all-to-dest 2024-04-25 23:25:31 -04:00
Elliot DeNolf
faf142baff chore: sort package.json files (#6050) 2024-04-25 22:41:55 -04:00
Elliot DeNolf
f80cb9f553 chore: clean up package.json descriptions and keywords 2024-04-25 22:39:03 -04:00
Elliot DeNolf
d3eaa1fceb chore: add sort-package-json to lint-staged 2024-04-25 22:23:58 -04:00
Elliot DeNolf
df77152851 chore: add sort-package-json, sort all package.json files 2024-04-25 22:19:37 -04:00
Elliot DeNolf
937202b27c fix(deps): remove monorepo deps 2024-04-25 22:12:44 -04:00
Paul
3581f39c31 chore: update whitelabel example (#6049) 2024-04-25 17:24:42 -03:00
Paul
c1d9c81b68 chore: update virtual fields example (#6043) 2024-04-25 16:13:10 -03:00
Jarrod Flesch
20355a4dd4 fix: version restoration (#6040) 2024-04-25 14:15:12 -04:00
Elliot DeNolf
cf66d7f09b docs: new packages (#6041) 2024-04-25 13:14:52 -04:00
Elliot DeNolf
30afe81462 docs: add docs for all new storage packages 2024-04-25 13:08:32 -04:00
Elliot DeNolf
18ee6e8867 docs: add docs for email-nodemailer 2024-04-25 13:08:18 -04:00
Paul
9f78a93403 chore: update hierarchy example (#6036) 2024-04-25 12:54:17 -03:00
Dan Ribbens
bd046e2437 fix(db-postgres): use locales suffix (#6032) 2024-04-25 11:07:52 -04:00
Elliot DeNolf
e9004a93a4 ci(scripts): safer package details retrieval 2024-04-25 10:50:41 -04:00
Elliot DeNolf
4816a1638a chore(release): v3.0.0-beta.18 [skip ci] 2024-04-25 10:31:56 -04:00
Jarrod Flesch
22c53392a3 chore: improves types for payloadRequest (#6012) 2024-04-25 10:23:03 -04:00
Paul
bdaa9e831d chore: add e2e tests for creating first user (#6027) 2024-04-25 10:57:50 -03:00
James Mikrut
036bcd6b8f chore: adds uuid to test (#6030) 2024-04-25 09:51:49 -04:00
Dan Ribbens
4d2bc861cf fix: disable api key beta (#6021) 2024-04-25 09:39:30 -04:00
James Mikrut
98722dc0fd fix(db-postgres): postgres version id bug (#6026) 2024-04-25 09:23:13 -04:00
James Mikrut
629d7c3263 fix(db-postgres): fully functional dbNames (#6023) 2024-04-24 22:42:24 -04:00
James Mikrut
5f7af5317a fix(next): ensures create-first user works (#6020) 2024-04-24 22:23:14 -04:00
James
8bb1b60964 chore: removes unused line 2024-04-24 22:22:40 -04:00
Elliot DeNolf
7ef5493414 ci(scripts): misc improvements 2024-04-24 21:04:12 -04:00
James
a3ac838221 chore: cleanup 2024-04-24 19:52:58 -04:00
James
14400d1cb9 chore: functional create-first-user 2024-04-24 19:48:58 -04:00
James
7d531646fd Merge branch 'fix/create-first-user-pt2' of github.com:payloadcms/payload into fix/create-first-user-pt2 2024-04-24 18:05:02 -04:00
Jacob Fletcher
6f6c1435c7 fix(ui): renders stay logged in modal (#6009) 2024-04-24 16:19:11 -04:00
Elliot DeNolf
332b8b6f34 ci(scripts): true publish with pLimit 2024-04-24 15:26:24 -04:00
Elliot DeNolf
d40a734080 wip: create first user fix 2024-04-24 15:17:13 -04:00
Dan Ribbens
94f1dfef52 fix: bulk publish (#6007) 2024-04-24 15:05:02 -04:00
Elliot DeNolf
0857dbe465 Revert "fix: issues creating the first user (#5986)"
This reverts commit 0ede95f375.
2024-04-24 14:36:08 -04:00
Elliot DeNolf
71f19fba58 chore(release): v3.0.0-beta.15 [skip ci] 2024-04-24 13:41:28 -04:00
Paul
24b18fb0fd feat!: removed getDataAndFile and getLocales from createPayloadRequest in favour of new utilities addDataAndFileToRequest and addLocalesToRequest (#5999) 2024-04-24 13:31:54 -03:00
Elliot DeNolf
5731241a5c fix(db-postgres): postgres uuid (#6003)
Co-authored-by: James <james@trbl.design>
2024-04-24 11:59:39 -04:00
Dan Ribbens
47e70abb4e fix: type collection config missing dbName (#5983) 2024-04-24 11:32:59 -04:00
Paul
0ede95f375 fix: issues creating the first user (#5986)
Co-authored-by: Jarrod Flesch <jarrodmflesch@gmail.com>
2024-04-24 11:30:52 -04:00
Jarrod Flesch
b723efdd3b chore: fixing flakey tests (#5984) 2024-04-24 00:44:43 -04:00
Elliot DeNolf
14c513690d ci: lint pr titles (#5988) 2024-04-23 23:40:55 -04:00
Alessio Gravili
88f239e784 feat(richtext-lexical)!: rework population behavior and allow richText adapter field hooks (#5893)
BREAKING:

- Unpopulated lexical relationship, link and upload nodes now save the relationTo document ID under value instead of value.id. This matches the behavior of core relationship fields. This changes the shape of the saved JSON data
- Any custom features which add their own population promises need to be reworked. populationPromises no longer accepts the promises as a return value. Instead, it expects you to mutate the promises array which is passed through, which mimics the way it works in core
2024-04-23 20:43:07 -04:00
Alessio Gravili
a1f6bf8a67 fix(richtext-lexical): Heading feature: enabledHeadingSizes not being applied 2024-04-23 20:37:11 -04:00
Alessio Gravili
912dcd38df fix(richtext-lexical): add missing HorizontalRuleFeature export 2024-04-23 20:25:12 -04:00
Alessio Gravili
da5028cdee feat(richtext-lexical): show loading indicator while block nodes are loading 2024-04-23 20:22:18 -04:00
Elliot DeNolf
899faa62f1 chore: update pnpm-lock 2024-04-23 17:01:57 -04:00
Alessio Gravili
9df6a644c9 chore: update lockfile 2024-04-23 16:37:02 -04:00
Alessio Gravili
1a6d9eaa11 Merge remote-tracking branch 'origin/beta' into fix/lexical-localization 2024-04-23 16:33:54 -04:00
Alessio Gravili
7d447af277 chore: add remaining missing preferences prop to validations 2024-04-23 15:46:01 -04:00
Elliot DeNolf
d8baaab849 chore(release): v3.0.0-beta.14 [skip ci] 2024-04-23 15:29:35 -04:00
Jarrod Flesch
3e1523f007 fix: move graphql-http from devDep to dep in next package (#5982)
Co-authored-by: Elliot DeNolf <denolfe@gmail.com>
2024-04-23 15:27:43 -04:00
Alessio Gravili
fa38af025f Merge branch 'beta' into fix/lexical-localization 2024-04-23 15:20:56 -04:00
Elliot DeNolf
6ca9ff847f chore(release): v3.0.0-beta.13 [skip ci] 2024-04-23 15:15:21 -04:00
Alessio Gravili
a8824b2b51 fix: incorrect value for empty preferences passed into buildStateFromSchema 2024-04-23 15:12:55 -04:00
Alessio Gravili
6aa3752b16 feat(richtext-lexical): allow richtext adapters to hook into field hooks 2024-04-23 15:10:35 -04:00
Elliot DeNolf
c483a439bf build: adjust pnpm engines version 2024-04-23 15:01:00 -04:00
Jarrod Flesch
74bdf1c681 chore: reduces graphql dependencies (#5979)
Co-authored-by: Elliot DeNolf <denolfe@gmail.com>
2024-04-23 15:00:09 -04:00
James Mikrut
7437d9fe58 Fix/postgres relation names (#5976) 2024-04-23 14:56:43 -04:00
Elliot DeNolf
51f7351962 fix(cpa): install db adapter in package.json (#5921) 2024-04-23 14:03:01 -04:00
Elliot DeNolf
d01fcb921b chore: tsconfig.json back to default 2024-04-23 13:18:45 -04:00
Elliot DeNolf
6179c938bf ci: remove email e2e tests, ethereal calls failing 2024-04-23 13:18:10 -04:00
Elliot DeNolf
dbbcb658a9 fix(deps): proper deps for storage-s3 and storage-vercel-blob (#5975) 2024-04-23 13:17:00 -04:00
James
16f97ad7c3 chore: disables forced pg for tests 2024-04-23 13:13:59 -04:00
James
bc7445ed99 Merge branch 'beta' of github.com:payloadcms/payload into fix/postgres-relation-names 2024-04-23 12:43:32 -04:00
James
e4d024cd0d chore: properly destroys db in postgres 2024-04-23 12:43:25 -04:00
James
1005de8295 fix(db-postgres): shortens relation names 2024-04-23 12:14:01 -04:00
Elliot DeNolf
c79289cedf chore(release): v3.0.0-beta.12 [skip ci] (#5972) 2024-04-23 11:02:08 -04:00
Jarrod Flesch
6a745be036 chore: pass mock req through with validate function to slate richText validation function (#5971) 2024-04-23 10:57:36 -04:00
Elliot DeNolf
cee9cc33ed chore(release): v3.0.0-beta.12 [skip ci] 2024-04-23 10:55:51 -04:00
Elliot DeNolf
9a5e9313cd ci: remove warning for no artifacts found 2024-04-23 10:47:17 -04:00
Elliot DeNolf
5401af5812 chore(storage-*): set disableLocalStorage true for enabled collections (#5970) 2024-04-23 10:46:33 -04:00
Elliot DeNolf
6305a1d1c2 chore: remove NodemailerAdapter type imports 2024-04-23 10:09:35 -04:00
Jarrod Flesch
95b96e3e9e chore: adjust headersWithCors for req without payload (#5963) 2024-04-23 09:50:41 -04:00
Elliot DeNolf
95b3f6d40d chore(scripts): add new packages to getPackageRegistryVersions 2024-04-23 09:10:25 -04:00
Elliot DeNolf
c258a4bef1 chore(scripts): add throttling to release script, optional git commit arg 2024-04-23 09:09:55 -04:00
Elliot DeNolf
647544a0c6 chore: fix build:tests filter [skip ci] 2024-04-23 08:46:15 -04:00
Elliot DeNolf
7e0a2a879c chore: adjust nodemailer type export 2024-04-23 08:39:32 -04:00
Elliot DeNolf
471e1388ae ci: bump pnpm version in gh action, use variable 2024-04-22 22:29:07 -04:00
Elliot DeNolf
1da430b042 ci: bump pnpm version 2024-04-22 22:01:56 -04:00
Elliot DeNolf
56ac06c563 fix: disallow importing from ts extensions 2024-04-22 21:15:13 -04:00
Elliot DeNolf
4dec4bb61c fix: resave media using cloud storage plugin (#5959) 2024-04-22 19:58:57 -04:00
Elliot DeNolf
99a09c49a3 ci: start docker for plugin-cloud-storage e2e 2024-04-22 16:59:57 -04:00
James Mikrut
88fd46bfea fix(db-postgres): row table names were not being built properly (#5960) 2024-04-22 16:55:12 -04:00
Elliot DeNolf
8a6603b3d8 test: add plugin-cloud-storage e2e 2024-04-22 16:43:54 -04:00
PatrikKozak
f6c9f454a5 Merge branch 'beta' of https://github.com/payloadcms/payload into fix/row-table-names 2024-04-22 16:18:24 -04:00
PatrikKozak
d8a5426c37 chore: adds array within row in tabsDoc data 2024-04-22 16:18:14 -04:00
Elliot DeNolf
c9011dcbfd fix(plugin-cloud-storage): resave media 2024-04-22 16:11:19 -04:00
Jarrod Flesch
43089fd13c chore: adds cors headers to routeErrors (#5957) 2024-04-22 15:48:42 -04:00
Elliot DeNolf
bb3bd9c395 chore: adjust email adapter messaging 2024-04-22 15:42:21 -04:00
James
ba423ab424 fix: row table names were not being built properly 2024-04-22 15:10:59 -04:00
Elliot DeNolf
c23984cac3 feat(plugin-cloud-storage): implement storage packages (#5928) 2024-04-22 14:31:20 -04:00
Elliot DeNolf
6685a0fa7e feat!: email adapter (#5901) 2024-04-22 14:26:12 -04:00
Jarrod Flesch
ac4750d016 chore: adds fallbackFileType functionality (#5958) 2024-04-22 14:20:02 -04:00
Elliot DeNolf
951e9fd7f2 test: email e2e updated nodemailer usage 2024-04-22 14:13:38 -04:00
Elliot DeNolf
cbd1554589 chore: adjust email pattern 2024-04-22 13:32:33 -04:00
Jacob Fletcher
80c545933f fix(next): adds CORS headers to API Responses (#5906)
Co-authored-by: Jarrod Flesch <jarrodmflesch@gmail.com>
2024-04-22 12:13:06 -04:00
Paul
594f319fc6 chore!: admin now takes a client side custom property and custom is server only (#5926) 2024-04-22 12:22:32 -03:00
Elliot DeNolf
102feb9576 chore: updates telemetry (#5883) 2024-04-22 09:44:34 -04:00
Simon Vreman
68274d2862 fix(plugin-cloud-storage)!: Pass filename to utility function getting file prefix (#5934) 2024-04-21 07:32:11 -04:00
Dan Ribbens
8945b7a4fa fix(db-postgres): nested groups in nested blocks validation (#5941)
Co-authored-by: Ricardo Domingues <rfdomingues98@gmail.com>
2024-04-21 00:38:55 -04:00
Dan Ribbens
d5ef93b2ba fix(db-postgres): v3 #5938 extra version suffix table names (#5940) 2024-04-20 23:23:06 -04:00
Ritsu
cb0f0dba3a chore: removes comment and unused type import (#5935) 2024-04-20 23:06:43 -04:00
Paul
7b263be01b chore: add missing translations (#5929) 2024-04-20 14:57:22 -04:00
Dan Ribbens
56df60f520 chore: fixes e2e test running on windows (#5927) 2024-04-20 14:54:18 -04:00
Ritsu
d5cbbc472d feat: add count operation to collections (#5930) 2024-04-20 14:45:44 -04:00
Dan Ribbens
d987e5628a feat(live-preview-vue): new live-preview-vue package (#5933)
Co-authored-by: Christian Gil <mrcgam.christian@gmail.com>
2024-04-20 07:52:00 -04:00
Dan Ribbens
1383191f15 fix: v3 update many with drafts (#5900)
Co-authored-by: Elliot DeNolf <denolfe@gmail.com>
2024-04-19 16:32:59 -04:00
Ritsu
27297284cf fix: Passes correct path to import modules on Windows started with file:// (#5919) 2024-04-19 16:28:41 -04:00
Kendell Joseph
3af3a91c87 feat: json field schemas (#5898) 2024-04-19 13:35:59 -04:00
Paul
23c5b71f95 chore(payload,ui)!:update custom config to separate client and server bundles (#5914) 2024-04-19 11:52:55 -03:00
Dan Ribbens
2ee6a8ec3a fix(db-mongodb): ignore end session errors (#5905) 2024-04-19 09:19:55 -04:00
Elliot DeNolf
10819b8693 chore: proper SendMailOptions export 2024-04-18 15:43:10 -04:00
Elliot DeNolf
83c617b452 test: clean up email-nodemailer config 2024-04-18 14:17:36 -04:00
Elliot DeNolf
4acb133655 chore: export SendMailOptions 2024-04-18 14:15:55 -04:00
Elliot DeNolf
6e4135e790 test: add nodemailer adapter to email test config 2024-04-18 13:36:48 -04:00
Elliot DeNolf
f0198b62f3 feat: implement stdout email adapter, use if no adapter configured 2024-04-18 11:59:03 -04:00
Jessica Chowdhury
3ff8063ab8 chore:(i18n): adds translation for document/s key (#5890) 2024-04-18 10:18:06 +01:00
Elliot DeNolf
8d52f1b279 chore: add payload to dev deps 2024-04-18 02:27:43 -04:00
Elliot DeNolf
24072d222c chore: clean up types, remove logMockEmailCredentials 2024-04-18 02:07:54 -04:00
Elliot DeNolf
55c59e71da chore: remove nodemailer from payload completely 2024-04-18 01:44:35 -04:00
Elliot DeNolf
62233788e0 feat(plugin-cloud): use nodemailer adapter 2024-04-18 01:44:20 -04:00
Elliot DeNolf
b297c5499d chore(email): strict true 2024-04-18 00:02:05 -04:00
Elliot DeNolf
fb7925f272 feat: create email-nodemailer package 2024-04-17 21:58:24 -04:00
Patrik
221e873862 chore(translations): adds localsNotSaved_one & localsNotSaved_other translations (#5903) 2024-04-17 16:34:10 -04:00
Patrik
e7143e02e2 fix: adds type error validations for email and password in login operation (#5899) 2024-04-17 16:33:19 -04:00
Elliot DeNolf
a1d68bd951 feat: abstract nodemailer into email adapter interface 2024-04-17 16:10:51 -04:00
Jarrod Flesch
93ee452a2d fix(next): do not require handlers, attempt to read filesystem or throw (#5896) 2024-04-17 15:12:57 -04:00
Jarrod Flesch
1abaa5fc17 chore(next): bump next@^14.3.0-canary.7 (#5894) 2024-04-17 13:07:40 -04:00
Alessio Gravili
999059bc61 fix(richtext-lexical): properly validate block node nested fields, fixes one failing e2e test suite we previously skipped 2024-04-17 11:47:24 -04:00
Alessio Gravili
39ba39c237 feat(richtext-lexical)!: rework how population works and saves data, improve node typing 2024-04-17 11:46:47 -04:00
Jarrod Flesch
009e6c2066 chore(test): fix flakey relationship tests (#5892) 2024-04-17 11:44:07 -04:00
Ritsu
8bf03ae706 fix(next): pass a corrent content-type header in getFile route (#5799)
Co-authored-by: Jarrod Flesch <jarrodmflesch@gmail.com>
2024-04-17 11:40:02 -04:00
Kendell Joseph
a2fe3f66e3 fix: accepts empty cell data in json field (#5876) 2024-04-17 11:07:28 -04:00
Jacob Fletcher
6cd5b253f1 fix(next): admin access control (#5887) 2024-04-17 10:31:39 -04:00
Elliot DeNolf
abf0461d80 ci: add exports pattern to codeowners 2024-04-17 10:24:02 -04:00
Elliot DeNolf
abca45e152 chore: add comments to exports about server vs. front-end 2024-04-17 10:23:21 -04:00
Alessio Gravili
58ea94f6ac feat: pass through doc preferences to field validate function and improve types 2024-04-17 09:27:04 -04:00
Jessica Chowdhury
49cba92fa1 fix(create-payload-app): uses baseUrl for payload config path in tsconfig (#5888) 2024-04-17 13:53:00 +01:00
Elliot DeNolf
42329fc736 ci: cut down on codeowners noise [skip ci] 2024-04-16 22:07:55 -04:00
Elliot DeNolf
68dee49501 feat(cpa): list plugin template after updating for 3.0 2024-04-16 19:46:27 -04:00
Dan Ribbens
234837ee1d fix: postgres query hasMany in (#5884) 2024-04-16 17:09:43 -04:00
Kendell Joseph
0d3554d70a fix: accepts empty cell data 2024-04-16 12:35:03 -04:00
Paul
7f6c6c4787 fix(next): check for matching passwords when creating the first user (#5869) 2024-04-16 12:41:20 -03:00
Jacob Fletcher
b6c975bfdc Revert "fix(plugin-seo): uses correct key for ukrainian translation"
This reverts commit b9a9dad60a.
2024-04-16 11:36:38 -04:00
Elliot DeNolf
eaf5a86121 ci: enforce node version for all jobs 2024-04-16 11:35:00 -04:00
Jacob Fletcher
b9a9dad60a fix(plugin-seo): uses correct key for ukrainian translation 2024-04-16 11:14:44 -04:00
Alessio Gravili
a2afc38894 fix(richtext-lexical): do not allow empty url field in link drawer 2024-04-16 11:03:12 -04:00
Paul
b80c92ba93 fix(next): issue with password and confirm password fields not being type of password (#5870) 2024-04-16 11:52:56 -03:00
Patrik
6669a2cedb fix(next): adds client-side field validations to login and forgot-password views (#5871) 2024-04-16 10:36:37 -04:00
Bohdan Kucheriavyi
7369da3d8d chore(plugin-seo): adds Ukrainian translations (#5836)
Signed-off-by: Bohdan Kucheriavyi <bohdan.kucheriavyi@zapal.tech>
2024-04-16 09:32:08 -04:00
Jarrod Flesch
697a0f1ecf fix: ensure body limit is respected (#5807)
Co-authored-by: James <james@trbl.design>
2024-04-16 09:22:41 -04:00
Jarrod Flesch
3db0557b07 chore: improve cookie helper functions (#5866) 2024-04-15 22:11:17 -04:00
Elliot DeNolf
8178d57ab9 chore(release): v3.0.0-beta.11 [skip ci] 2024-04-15 16:50:51 -04:00
Ritsu
f1b2f767bb fix(db-postgres): validateExistingBlockIsIdentical localized (#5840) 2024-04-15 16:50:28 -04:00
Dan Ribbens
f21b394d21 chore(create-payload-app): db user and password connection URI (#5853) 2024-04-15 16:40:31 -04:00
Dan Ribbens
4e4ccca02a fix(db-mongodb): version fields indexSortableFields (#5864) 2024-04-15 16:26:26 -04:00
Elliot DeNolf
b6578d6447 test(pcs): add prefix test (#5867) 2024-04-15 16:10:51 -04:00
Elliot DeNolf
abeb94a53d docs: add externalFileHeaderFilter 2024-04-15 15:11:35 -04:00
Ritsu
974a74500b fix(ui): passes cellComponentProps through buildColumnState (#5848) 2024-04-15 15:03:16 -04:00
Elliot DeNolf
61dd17ae5e feat: allow configuration for setting headers on external file fetch (#5862) 2024-04-15 15:02:07 -04:00
Jacob Fletcher
2628249a51 fix(next): removes links to hidden entities (#5861) 2024-04-15 14:58:57 -04:00
Elliot DeNolf
5f57782199 fix(db-postgres): properly pass id type for type gen (#5859) 2024-04-15 13:38:46 -04:00
Ritsu
bceb49ee6c fix(ui): ensures titleField is not empty (#5850) 2024-04-15 13:33:49 -03:00
Alessio Gravili
beeb59f263 ci: add weird tune linux network step which seems to reduce flakes (#5855) 2024-04-15 12:23:48 -04:00
Paul
4150c87be0 chore(plugin-nested-docs): update nested docs plugin exports and moved away from default exports (#5856) 2024-04-15 13:22:01 -03:00
Patrik
a394d8211e fix: passes parent id instead of incoming id to saveVersion (#5854) 2024-04-15 12:02:17 -04:00
Paul
6a162776f2 chore: export react toastify from UI (#5828) 2024-04-15 12:53:12 -03:00
James Mikrut
d41bd7b133 chore: exports getFieldsToSign (#5852) 2024-04-15 10:48:03 -04:00
Patrik
f3409fab29 fix(db-mongodb): failing contains query with special chars (#5776) 2024-04-15 10:24:07 -04:00
James Mikrut
dd75fbfee2 feat: image dimensions rework (#5824) 2024-04-15 10:22:40 -04:00
James
ae2c85f947 chore: exports getFieldsToSign 2024-04-15 10:19:55 -04:00
Oladayo Olufemi Fagbemi
c0b454a5de fix(plugin-seo): add default empty endpoints array (#5844) 2024-04-14 17:44:15 -04:00
Alessio Gravili
27754dd0d7 fix(richtext-lexical): ensure schema maps for complex fields / sub-fields are handled correctly (#5842) 2024-04-14 17:29:48 -04:00
Oladayo Olufemi Fagbemi
18ec830882 fix(plugin-seo): incorrect styling of field labels (#5845)
Co-authored-by: Oladayo Fagbemi <oladayo.fagbemi@acelspringer.com>
Co-authored-by: Alessio Gravili <alessio@gravili.de>
2024-04-14 17:28:53 -04:00
Ritsu
1ffc0f552e fix(payload): remove incorrect payload module import within payload (#5847) 2024-04-14 16:49:06 -04:00
Alessio Gravili
07b676ac81 chore(richtext-lexical): adjust field name inside int tests 2024-04-14 16:45:54 -04:00
Alessio Gravili
da79f09544 fix(payload): ensure that the minimum @swc/core peerdep version used is 1.4.13 (#5841) 2024-04-14 16:43:42 -04:00
Alessio Gravili
993b035285 fix(richtext-lexical): ensure schema maps for complex fields / sub-fields are handled correctly for blocks, link and upload features 2024-04-14 02:19:58 -04:00
Alessio Gravili
3f2df643e7 chore(richtext-lexical): add failing e2e test which ensures sub-richtext blocks work as intended 2024-04-14 02:18:16 -04:00
James
42c7649176 chore: removes tempy 2024-04-13 17:06:25 -04:00
Ritsu
2722d2f5ce fix: passes number type limit arg to find on the list view (#5837)
Co-authored-by: Paul <paul@payloadcms.com>
2024-04-13 17:24:46 -03:00
Elliot DeNolf
f71e61d7d9 chore(templates): remove no longer used editor-import comment 2024-04-13 10:27:39 -04:00
Gabriel Novotny
73c76cab77 fix: postgres turbopack static analysis error (#5832) 2024-04-12 18:53:19 -04:00
Elliot DeNolf
43e8a533b7 fix: ensure file persists through form state changes (#5823) 2024-04-12 15:16:47 -04:00
Elliot DeNolf
ea4203bb32 chore(release): v3.0.0-beta.10 [skip ci] 2024-04-12 14:58:12 -04:00
Elliot DeNolf
568b5073c8 chore(deps): sync pnpm-lock.yaml 2024-04-12 14:56:42 -04:00
Elliot DeNolf
471e1f4827 chore: specify next canary peer dep 2024-04-12 14:56:04 -04:00
Elliot DeNolf
b9185a6fcd chore: fix more publish config exports 2024-04-12 14:48:34 -04:00
Elliot DeNolf
80496aa94c fix: remove all exports null (#5830) 2024-04-12 14:35:36 -04:00
Alessio Gravili
5fd6e3c1a8 fix!: upgrade minimum required node version from 18.17.0 to v18.20.2. Some old node versions have issues with our loader (#5829) 2024-04-12 14:01:33 -04:00
Alessio Gravili
54590c1700 fix(richtext-lexical)!: fix output of internal list HTML converter (#5827)
BREAKING: Changes the classnames of the converted HTML
2024-04-12 12:10:44 -04:00
Elliot DeNolf
b1259be8f2 chore(release): v3.0.0-beta.9 [skip ci] 2024-04-12 12:06:41 -04:00
Elliot DeNolf
cd161e4b16 feat!: remove pointer files (#5826) 2024-04-12 11:58:34 -04:00
Alessio Gravili
cb4214fe6e fix(richtext-lexical)!: fix output of internal list HTML converter
BREAKING: Changes the classnames of the converted HTML
2024-04-12 11:58:05 -04:00
Elliot DeNolf
9d42751a42 feat!: remove more pointer files 2024-04-12 11:39:08 -04:00
Elliot DeNolf
c2c637b359 chore: clean up unused files 2024-04-12 11:35:25 -04:00
Paul
2f446e11d6 chore: bump nextjs dependencies to ^14.2 (#5820)
fix(plugin-seo): overriding existing endpoints
2024-04-12 12:32:45 -03:00
Elliot DeNolf
4f566b088c feat!: remove pointer files 2024-04-12 11:31:35 -04:00
Dan Ribbens
0d40d87b31 fix(db-postgres): relationship query pagination (#5803) 2024-04-12 11:18:40 -04:00
Elliot DeNolf
70fcd6bf40 feat: rework image dimensions, use image-size 2024-04-12 11:13:16 -04:00
Jacob Fletcher
94c0095b3b chore(ui): removes all static font assets (#5821) 2024-04-12 09:57:31 -04:00
Elliot DeNolf
4328060637 feat(pcs): vercel blob storage adapter (#5811) 2024-04-12 09:37:35 -04:00
Elliot DeNolf
d98d0fd5bd chore(pcs): use proper getFilePrefix 2024-04-12 09:30:19 -04:00
Elliot DeNolf
5db2863d08 feat(pcs): export utilities 2024-04-12 09:30:10 -04:00
Jacob Fletcher
ff5e438d6d chore(ui): replaces suisse-intl font with system fallbacks 2024-04-12 09:16:43 -04:00
Paul
bfd5f13ee9 chore: add types for local api find/update operations (#5808) 2024-04-12 10:15:57 -03:00
Elliot DeNolf
8043188f36 chore(pcs): update README 2024-04-12 09:12:34 -04:00
Elliot DeNolf
e3e0998772 chore: ignore vercelBlob pointers, adjust peer deps 2024-04-12 00:34:41 -04:00
Elliot DeNolf
86adc6f282 chore: add vercelBlob to exports 2024-04-11 23:05:22 -04:00
Elliot DeNolf
b51b519d30 feat(plugin-cloud-storage): vercel blob storage adapter 2024-04-11 22:58:55 -04:00
Alessio Gravili
c70dcb6a59 feat(richtext-lexical): add HorizontalRuleFeature, improve block handle positioning (#5806) 2024-04-11 16:51:54 -04:00
Alessio Gravili
2486c7dba0 fix(richtext-lexical): incorrect margin for nested unordered lists 2024-04-11 16:42:35 -04:00
Paul
1456fcdcad chore: type locale from localization config on the payload request (#5801) 2024-04-11 17:38:35 -03:00
Alessio Gravili
a216800c72 chore(richtext-lexical): fix build error 2024-04-11 16:31:40 -04:00
Alessio Gravili
c3d8597c13 feat(richtext-lexical): add HorizontalRuleFeature 2024-04-11 16:24:04 -04:00
Alessio Gravili
844663ce1a fix(richtext-lexical): limit unnecessary floating handle positioning updates 2024-04-11 15:55:55 -04:00
Alessio Gravili
055e6af7b7 feat(richtext-lexical): improve floating handle y-positioning by positioning it in the center for smaller elements. 2024-04-11 15:55:43 -04:00
Alessio Gravili
479e6ecddc fix(richtext-lexical): incorrect floating handle y-position calculation next to certain kinds of HTML elements like HR 2024-04-11 15:55:26 -04:00
Jacob Fletcher
b9456e8244 fix(next): safely handles missing json body in post requests (#5797) 2024-04-11 15:53:50 -04:00
Jacob Fletcher
432dfef435 chore(next): installs merriweather as google font and removes static assets 2024-04-11 15:31:19 -04:00
Elliot DeNolf
429c6f7a48 chore(release): v3.0.0-beta.6 [skip ci] 2024-04-11 15:20:10 -04:00
Elliot DeNolf
6d41f6c56d fix(ui): actual scss paths [skip ci] 2024-04-11 15:17:33 -04:00
Elliot DeNolf
20ac2b86cf chore(release): v3.0.0-beta.5 [skip ci] 2024-04-11 15:11:14 -04:00
Elliot DeNolf
b88455166a fix: improve config finding (#5800) 2024-04-11 15:08:04 -04:00
Elliot DeNolf
9b86de1f9d fix(ui): scss paths 2024-04-11 15:06:27 -04:00
Elliot DeNolf
1393c72281 fix: improve config finding 2024-04-11 15:06:09 -04:00
Jacob Fletcher
bcb538aee2 fix(next): awaits logout operation in api route handler 2024-04-11 14:57:35 -04:00
Jacob Fletcher
01e8f8c649 Merge branch 'beta' into fix/post-body-parse 2024-04-11 14:15:56 -04:00
Elliot DeNolf
1119cf3af9 chore(release): v3.0.0-beta.4 [skip ci] 2024-04-11 14:02:17 -04:00
Elliot DeNolf
216934145c fix: default baseUrl in loader if not set (#5798) 2024-04-11 13:52:35 -04:00
James Mikrut
40f952cac3 chore: type local API auth function and PayloadRequest (#5791) 2024-04-11 13:45:24 -04:00
Jacob Fletcher
330e4a7724 fix(next): safely handles missing json body in post requests 2024-04-11 13:42:21 -04:00
Paul Popus
e676503e02 update further types 2024-04-11 14:12:03 -03:00
James Mikrut
06233fbb2f fix: Generated ids for an array items are the same as global id if it's created (#5795) 2024-04-11 13:06:24 -04:00
Paul Popus
17298695b1 fix: provide request to the previewFunction and fix type 2024-04-11 14:01:22 -03:00
Jarrod Flesch
c1081ccfe2 chore(tests): flakey drawer, tab, navigation tests (#5792) 2024-04-11 12:57:19 -04:00
Ritsu
30da5a8643 fix: generated ids for array items the same as global id 2024-04-11 19:46:14 +03:00
Paul Popus
55bf5436e4 fix type issues 2024-04-11 13:09:39 -03:00
Elliot DeNolf
a4956dc649 fix(cpa): ast parse error handling (#5793) 2024-04-11 12:01:16 -04:00
James Mikrut
512b7bd429 fix: number ids were not sanitized to number in rest api (#5778) 2024-04-11 11:19:22 -04:00
Paul Popus
5119c51439 chore: type request too 2024-04-11 12:19:11 -03:00
James
f3e25f3277 more de-flake 2024-04-11 11:17:59 -04:00
Jacob Fletcher
1275c70187 feat(ui): provides payload as prop to all custom server components (#5775) 2024-04-11 11:16:15 -04:00
James
be69fc448d chore: de-flake 2024-04-11 10:59:26 -04:00
Paul Popus
bcccefe98e chore: add int test for local API login function 2024-04-11 11:56:52 -03:00
Paul Popus
2061f38d9e feat: add new type generation for the auth operation 2024-04-11 11:56:42 -03:00
Elliot DeNolf
d0869d9087 chore: unused file [skip ci] 2024-04-11 10:22:06 -04:00
Elliot DeNolf
1eabf316d6 chore(templates): add generate:types to blank 2024-04-10 22:30:56 -04:00
Elliot DeNolf
a0dd750a52 chore(cpa): add or operator to process.env.DATABASE_URI [skip ci] 2024-04-10 22:17:52 -04:00
Elliot DeNolf
2fc9885abc chore(scripts): add getPackageRegistryVersions script 2024-04-10 21:26:50 -04:00
Elliot DeNolf
14d683fb9a chore(scripts): update release script 2024-04-10 21:26:31 -04:00
Elliot DeNolf
e286519cb1 chore(release): v3.0.0-beta.3 [skip ci] 2024-04-10 20:46:22 -04:00
Elliot DeNolf
b1e78a3562 feat(cpa): improvements (#5783) 2024-04-10 20:35:19 -04:00
Elliot DeNolf
0bc103658a chore(cpa): improve move message 2024-04-10 20:29:57 -04:00
Elliot DeNolf
9037b9b4fa chore(cpa): remove 2.0 templates until updated 2024-04-10 20:25:20 -04:00
Elliot DeNolf
d194493e9a chore(cpa): update help 2024-04-10 20:24:51 -04:00
Elliot DeNolf
aa22344cdb fix(cpa): append to existing .env 2024-04-10 20:16:59 -04:00
Elliot DeNolf
736e7b822e chore(release): v3.0.0-beta.2 [skip ci] 2024-04-10 17:32:32 -04:00
Elliot DeNolf
2ebda95036 fix(next): proper named export of withPayload 2024-04-10 17:30:47 -04:00
Elliot DeNolf
d8783eaad4 chore(release): v3.0.0-beta.1 [skip ci] 2024-04-10 17:16:20 -04:00
Elliot DeNolf
cddb08de1a chore: ignore payload/i18n 2024-04-10 17:11:20 -04:00
James
d4e5d3df54 chore: fixes to unit tests 2024-04-10 17:05:44 -04:00
James
414b03ce74 chore: fix to unit tests 2024-04-10 17:03:37 -04:00
James
96dbab8834 chore: misc fixes 2024-04-10 16:58:08 -04:00
Elliot DeNolf
03a110a750 feat(next)!: cjs support (#5772) 2024-04-10 16:44:20 -04:00
Elliot DeNolf
6accc705be chore(next): cjs build 2024-04-10 16:32:36 -04:00
Elliot DeNolf
312dca003b feat(cpa): CJS next config AST parsing 2024-04-10 16:32:19 -04:00
James
4f9fdb6c14 fix: number ids were not sanitized to number in rest api 2024-04-10 16:01:28 -04:00
Jarrod Flesch
94af06466b chore: re-exports languages in payload (#5771) 2024-04-10 15:55:01 -04:00
Jacob Fletcher
7cf2686097 fix: optionally types req in auth operation (#5769) 2024-04-10 14:08:47 -04:00
Elliot DeNolf
f14883aa11 chore: update blank 3.0 template for withPayload change 2024-04-10 13:41:11 -04:00
Elliot DeNolf
9df8de2386 chore: adjust exports 2024-04-10 13:41:11 -04:00
James
8b2cf4705e chore: withPayload CJS 2024-04-10 13:41:10 -04:00
Jarrod Flesch
364e9832ac fix(next): ensures requested lang header is supported (#5765) 2024-04-10 13:05:56 -04:00
Jarrod Flesch
2deeb61f17 fix: locale switcher flakey test (#5761) 2024-04-10 13:05:30 -04:00
Patrik
14498e8a9c fix(ui): avoids getting and setting doc preferences when creating new (#5758) 2024-04-10 11:42:03 -04:00
Alessio Gravili
eb78022387 fix: undo changing baseBlockFields type to FieldWithRichTextRequiredEditor (#5767) 2024-04-10 11:38:27 -04:00
Elliot DeNolf
3677a59a78 fix(cpa): dependency tag (#5768) 2024-04-10 11:25:54 -04:00
Alessio Gravili
7c1c840a59 chore: increase admin e2e beforeAll timeout, as prebuild sometimes takes longer than the timeout 2024-04-10 11:22:17 -04:00
Alessio Gravili
a73eaf5d37 chore: fix test suite types, add LexicalBlock type 2024-04-10 11:07:01 -04:00
Alessio Gravili
68989a58a8 fix: undo changing baseBlockFields types to FieldWithRichTextRequiredEditor 2024-04-10 10:56:07 -04:00
Alessio Gravili
9841731ae7 feat: properly type withPayload (#5756) 2024-04-10 09:51:46 -04:00
Elliot DeNolf
ba7ac5d439 test: fix unit tests (#5760) 2024-04-09 23:08:20 -04:00
Elliot DeNolf
7c60772b26 ci: alpha -> beta branch push list 2024-04-09 23:07:09 -04:00
Alessio Gravili
1141a5d3af fix(richtext-lexical): do not render uploads extra fields drawer if no extra fields are provided (#5755) 2024-04-09 16:30:43 -04:00
Elliot DeNolf
6f74fd1f98 chore(release): v3.0.0-beta.0 [skip ci] 2024-04-09 15:00:39 -04:00
Alessio Gravili
75873bfcfa fix(richtext-lexical): catch errors that may occur during HTML generation (#5752) 2024-04-09 14:53:17 -04:00
Jarrod Flesch
1faf621f17 fix: persist locale when navigating (#5753) 2024-04-09 14:49:26 -04:00
Elliot DeNolf
1d1c73dfcc chore(release): v3.0.0-alpha.61 [skip ci] 2024-04-09 14:36:04 -04:00
Patrik
d057ce0a85 fix(next): removes global slug from collectionSlug prop in SetStepNav (#5744) 2024-04-09 14:26:09 -04:00
James Mikrut
0ce26d2c08 Feat/config i18n (#5735) 2024-04-09 14:13:17 -04:00
Alessio Gravili
abf285d713 chore: get dev:generate-types to work again (#5750) 2024-04-09 14:12:23 -04:00
James
c2ee8e3999 chore: de-flakes fields/index tests 2024-04-09 13:56:32 -04:00
James
167ba0c68f chore: adds back all tests 2024-04-09 13:50:54 -04:00
James
9ad1cbe920 chore: adjusts test snapshot logic to restore uploads properly 2024-04-09 13:33:42 -04:00
James
313ea52e3d chore: getRequestLanguage now defaults 2024-04-09 13:17:43 -04:00
James
3acfb7a83f chore: corrects imports 2024-04-09 12:43:36 -04:00
James
783dae2bbb Merge branch 'alpha' of github.com:payloadcms/payload into feat/config-i18n 2024-04-09 12:35:57 -04:00
Alessio Gravili
59681b211b fix(richtext-lexical): upload nodes weren't visible (#5746) 2024-04-09 12:32:24 -04:00
James
98438175cf chore: handles server errors 2024-04-09 12:31:25 -04:00
Alessio Gravili
af40302e5f fix(richtext-lexical): get links to work again (#5745) 2024-04-09 12:29:45 -04:00
Alessio Gravili
ec0e0ae449 chore(richtext-lexical): add e2e test to ensure that pre-seeded upload nodes are visible 2024-04-09 12:24:54 -04:00
Alessio Gravili
607ff17033 fix(richtext-lexical): upload nodes weren't visible due to incorrect relationships condition 2024-04-09 12:24:30 -04:00
Alessio Gravili
e73e610669 chore: fields test suite: clearAndSeedEverything instead of seed for dev as well, to ensure same state as test runs (most importantly, this gets rid of leftover uploads) 2024-04-09 12:22:42 -04:00
Jarrod Flesch
30fddde066 chore: corrects type for getLocalI18n 2024-04-09 11:51:40 -04:00
Jarrod Flesch
a56d2842fb chore: converts ua to uk 2024-04-09 11:44:34 -04:00
Jarrod Flesch
35f59a47cc chore: corrects dateFNS keys, stricter types 2024-04-09 11:38:38 -04:00
Jarrod Flesch
817d57bd12 chore: migrate langs 2024-04-09 11:05:35 -04:00
Elliot DeNolf
5826048e7b ci: publish script throttling 2024-04-09 09:50:23 -04:00
Elliot DeNolf
1a975b31cf chore(release): v3.0.0-alpha.60 [skip ci] 2024-04-09 09:36:41 -04:00
James
73298a80f0 chore: adds more de-flake to tabs 2024-04-09 09:34:11 -04:00
James
a5d14ef4c1 chore: de-flakes tabs 2024-04-09 09:34:11 -04:00
James
d0c79b65f8 chore: skips index to see what remains 2024-04-09 09:34:11 -04:00
James
2fc50b1a1f chore: de-flakes array 2024-04-09 09:34:11 -04:00
James
0ddeedb0b3 chore: de-flakes relationship suite 2024-04-09 09:34:11 -04:00
James
09c2fb10f3 chore: bug in ci 2024-04-09 09:34:11 -04:00
James
5bfff5b7ba chore: ensures artifacts work 2024-04-09 09:34:11 -04:00
James
702088375c chore: attempts to de-flake 2024-04-09 09:34:11 -04:00
James
ea507fbcc4 chore: moves lexical tests into collection folder 2024-04-09 09:34:11 -04:00
James
0ff1e6632b chore: splits out relationship 2024-04-09 09:34:11 -04:00
James
996ee47f96 chore: splits out blocks and array into their own suites 2024-04-09 09:34:11 -04:00
James
3e9bd5bb62 chore: uses ci env var to set max retries 2024-04-09 09:34:11 -04:00
James
ee7221c986 chore: sets maxRetries 2024-04-09 09:34:11 -04:00
James
318c126ae3 chore: turns off prebuild for fields 2024-04-09 09:34:11 -04:00
Jarrod Flesch
2154aea89f chore: comment out all other test suites for now 2024-04-09 09:34:11 -04:00
Jarrod Flesch
4d3ad1af35 chore: run fields e2e on ci 2024-04-09 09:34:11 -04:00
Alessio Gravili
75cab7688f chore: fix incorrect next tsconfig paths breaking monorepo setup (#5743) 2024-04-09 09:26:09 -04:00
James
5084d6dd97 chore: attempts to de-flake live preview 2024-04-08 22:34:23 -04:00
James
518f80cbb6 chore: es 2024-04-08 22:29:41 -04:00
James
c9399efa65 chore: fixes access control test 2024-04-08 22:25:35 -04:00
Elliot DeNolf
dd9133659c ci: rework caching, consolidates build (#5737) 2024-04-08 22:19:37 -04:00
James
d3016b7eb5 chore: merge 2024-04-08 22:13:16 -04:00
James
69e884f5b7 chore: dynamically loads date-fns locales 2024-04-08 22:12:05 -04:00
Elliot DeNolf
6d122905f4 chore: ignore new pointer files 2024-04-08 21:19:03 -04:00
Elliot DeNolf
e6e016ac2d chore(cpa): build for es6 (#5736) 2024-04-08 17:11:03 -04:00
James
3e7925e33f chore: removes async nature from a few lexical things 2024-04-08 16:48:56 -04:00
James
7a2ccba63c Merge branch 'feat/config-i18n' of github.com:payloadcms/payload into feat/config-i18n 2024-04-08 16:39:03 -04:00
James
be2134eb69 chore: requires languages to be passed to config 2024-04-08 16:38:12 -04:00
James Mikrut
95e422b0e1 Merge branch 'alpha' into feat/config-i18n 2024-04-08 16:26:38 -04:00
James
53d9c4ca95 chore: dynamically loads translations 2024-04-08 16:25:24 -04:00
James
30948ab545 chore: dynamically loads translations 2024-04-08 16:25:21 -04:00
Jacob Fletcher
906df6b401 fix(next): properly renders document-level unauthorized view (#5734) 2024-04-08 15:40:46 -04:00
Jacob Fletcher
b9c585bab5 fix(ui): uses correct save draft button label (#5730) 2024-04-08 14:34:28 -04:00
Elliot DeNolf
12203140ad chore: unprettified pointer files 2024-04-08 13:59:03 -04:00
Patrik
0704152e38 chore(next): removes unnecessary apostrophe from payload-lng cookie (#5729) 2024-04-08 13:42:44 -04:00
Elliot DeNolf
f582efe98d chore(release): v3.0.0-alpha.59 [skip ci] 2024-04-08 13:32:21 -04:00
James Mikrut
540579f520 chore: corrects invalid export (#5728) 2024-04-08 13:26:37 -04:00
James
24c348dc49 chore: corrects invalid export 2024-04-08 13:26:04 -04:00
Jacob Fletcher
4b4c245507 fix(ui): properly initializes collapsible context (#5725) 2024-04-08 12:48:44 -04:00
Dan Ribbens
400f68d1aa chore: add fetch to dev.js to trigger admin (#5724) 2024-04-08 12:26:33 -04:00
Jacob Fletcher
5bb27ed9cd fix(ui): renders searchable fields in list controls (#5723) 2024-04-08 11:49:02 -04:00
Jacob Fletcher
833498c269 chore(deps): regenerates frozen lockfile 2024-04-08 11:30:12 -04:00
Jacob Fletcher
80507d487b Merge branch 'alpha' into fix/list-searchable-fields 2024-04-08 11:23:24 -04:00
Jacob Fletcher
08f4ebaaf8 fix(ui): adds css specificity to select all 2024-04-08 11:22:05 -04:00
Jacob Fletcher
4c418525eb fix(ui): renders searchable fields in list controls 2024-04-08 11:01:47 -04:00
Elliot DeNolf
4962f6c926 chore(release): v3.0.0-alpha.58 [skip ci] 2024-04-08 10:52:04 -04:00
James Mikrut
50f0e9298c chore: adds upload export back (#5722) 2024-04-08 10:47:10 -04:00
James
89efcc5db1 chore: adds upload export back 2024-04-08 10:46:41 -04:00
Elliot DeNolf
c3119a5632 chore(release): v3.0.0-alpha.57 [skip ci] 2024-04-08 10:29:26 -04:00
James Mikrut
069bbd92b0 Feat/bulletproof loader (#5721) 2024-04-08 10:18:38 -04:00
James
c4422a2593 chore: improves logic of loader 2024-04-08 10:17:18 -04:00
James
3aab9d368e chore: working loader 2024-04-08 10:07:55 -04:00
Elliot DeNolf
b6afab63b2 chore(cpa): remove test from prepublishOnly 2024-04-08 09:34:52 -04:00
Alessio Gravili
b93f5e9c44 feat!: pass in req to access.admin, to match 2.0 behavior, and strongly type it (#5712) 2024-04-07 22:22:48 -04:00
James
630082035f chore: sets up test environment for loader 2024-04-07 19:48:42 -04:00
Elliot DeNolf
c74e41fc76 chore(release): v3.0.0-alpha.56 [skip ci] 2024-04-07 13:53:49 -04:00
Alessio Gravili
08ce7c58b5 chore: upgrade playwright & TS, and hide deprecation warnings (#5708) 2024-04-06 17:15:02 -04:00
Alessio Gravili
1853fde379 chore: upgrade typescript and "@types/"-prefixed packages 2024-04-06 15:35:09 -04:00
Alessio Gravili
f29d22ca95 chore: ensure node deprecation warnings stay hidden during e2e test runs 2024-04-06 15:06:04 -04:00
Alessio Gravili
5ea5f928ab chore: upgrade playwright from 1.42.1 to 1.43.0 and update patches 2024-04-06 15:05:27 -04:00
James Mikrut
efd6d35eb3 Fix/live preview flake (#5707) 2024-04-06 14:31:19 -04:00
James
2b2538f13a chore: removes old bin 2024-04-06 14:31:02 -04:00
James
9375dae179 Merge branch 'alpha' of github.com:payloadcms/payload into fix/live-preview-flake 2024-04-06 14:22:50 -04:00
James
674bb3758d chore: reduces parallel creates in live preview seed 2024-04-06 14:22:43 -04:00
James Mikrut
cedf9a2eb8 chore: pre-builds in CI (#5690) 2024-04-06 14:10:25 -04:00
James
7d2dc5b6c6 chore: adds more tests to loader int suite 2024-04-06 14:07:17 -04:00
James
9d2aad7bf9 chore: lockfile 2024-04-06 14:01:16 -04:00
James
f085d7609b chore: cleanup 2024-04-06 13:59:29 -04:00
James
a49243a42a chore: cleanup 2024-04-06 13:58:05 -04:00
James
e79f431f14 chore: cleans up tsconfigs 2024-04-06 13:40:30 -04:00
James
38e5b6e8e3 chore: temp disables fields 2024-04-06 13:38:14 -04:00
James
35bdb785c4 Merge branch 'chore/pre-build-e2e' of github.com:payloadcms/payload into chore/pre-build-e2e 2024-04-06 13:35:35 -04:00
James
25cb146fde feat: moduleResolution: bundler in config loaders 2024-04-06 13:35:09 -04:00
Jarrod Flesch
c10f0f4a9e chore: fix sort header route replace 2024-04-05 22:34:04 -04:00
Elliot DeNolf
3a3a7f6e16 ci(scripts): remove p-map 2024-04-05 17:48:21 -04:00
Elliot DeNolf
1d3b500962 chore(release): v3.0.0-alpha.55 [skip ci] 2024-04-05 17:40:07 -04:00
Dan Ribbens
f39f95af6d feat: custom db naming for postgres and mongodb (#5697) 2024-04-05 17:09:08 -04:00
Dan Ribbens
6fec2bbe1c chore: refactor auth from next into new payload local operation (#5641) 2024-04-05 17:08:51 -04:00
Elliot DeNolf
2412134073 chore: importConfig and importWithoutClientFiles (#5701) 2024-04-05 16:49:20 -04:00
Dan Ribbens
136545d1fd feat: move disableDuplicate out of admin and update APIs (#5620) 2024-04-05 16:44:41 -04:00
Jarrod Flesch
684c4d2113 chore: fix admin sort flake, fix console warning for test package.json 2024-04-05 16:39:13 -04:00
Elliot DeNolf
6624fd0401 ci: single job per branch (#5702) 2024-04-05 16:24:53 -04:00
James
31502d2da3 chore: attempts to de-flake admin 2024-04-05 16:12:49 -04:00
James
3ee39ecca3 chore: increases timeout for fields prebuild 2024-04-05 16:06:00 -04:00
Paul
89e7c305e7 chore: emails e2e suite (#5698)
fix: move 'email' configuration to server only
2024-04-05 16:50:47 -03:00
James
60dd71c59e chore: sets longer timeout for prebuild in admin and fields 2024-04-05 15:49:12 -04:00
James
0936f77930 Merge branch 'alpha' of github.com:payloadcms/payload into chore/pre-build-e2e 2024-04-05 15:25:41 -04:00
James
3c09b95a8c chore: builds in child process for e2e 2024-04-05 15:23:07 -04:00
Jacob Fletcher
780f26f135 fix(next): incorrect access of select options in versions view (#5687) 2024-04-05 15:03:49 -04:00
Jacob Fletcher
77618674a0 fix(next): live preview url (#5692) 2024-04-05 15:00:58 -04:00
Alessio Gravili
c9c89a6005 fix(richtext-lexical): do not allow omitting editor prop for sub-richtext fields within lexical defined in the payload config (#5699) 2024-04-05 14:42:15 -04:00
Jacob Fletcher
d1276c4299 feat(next): threads payload through live preview url 2024-04-05 14:36:14 -04:00
Jacob Fletcher
69730b6c95 Merge branch 'alpha' into fix/lp-url 2024-04-05 14:25:17 -04:00
James
9147d30152 Merge branch 'chore/green-ci' of github.com:payloadcms/payload into chore/pre-build-e2e 2024-04-05 14:13:28 -04:00
James
6217c70fb5 chore: prebuilds fields and admin in ci 2024-04-05 14:13:14 -04:00
Jarrod Flesch
17352c9a56 chore: change pw buttons, field readOnly prop, admin panel thumbnailURL fallback (#5694) 2024-04-05 13:51:17 -04:00
Jacob Fletcher
1b6026304f fix(next): adjusts args sent through live preview url 2024-04-05 13:37:12 -04:00
Jacob Fletcher
91f9973c6c fix(next): properly types locale in live preview url 2024-04-05 13:37:07 -04:00
Elliot DeNolf
ca2acee38a chore(release): create-payload-app/v3.0.0-alpha.54 [skip ci] 2024-04-05 11:53:19 -04:00
James
3bd455ced2 chore: pre-builds in CI 2024-04-05 11:46:02 -04:00
Patrik
2c25abd143 test(versions): replaces outdated CustomPublishButtonProps type (#5688) 2024-04-05 11:11:16 -04:00
PatrikKozak
08a9fb8cd7 Merge branch 'alpha' of https://github.com/payloadcms/payload into fix/alpha/versions-select-options 2024-04-05 10:38:23 -04:00
PatrikKozak
d8a38b4e35 fix: incorrect access of select options in versions 2024-04-05 10:38:09 -04:00
Paul
e64660f2d8 fix(db-postgres): querying by localised relations postgres (#5686) 2024-04-05 10:37:58 -04:00
Elliot DeNolf
1a11466e69 chore(release): v3.0.0-alpha.54 [skip ci] 2024-04-04 21:05:18 -04:00
Elliot DeNolf
78ab2fbe09 chore: adjust translations and next publishConfig 2024-04-04 21:03:36 -04:00
James
0c45d5773a chore: brings back admin and fields 2024-04-04 21:02:31 -04:00
James
f48335444b chore: flake 2024-04-04 21:01:38 -04:00
Elliot DeNolf
81b33cee5c chore(release): v3.0.0-alpha.53 [skip ci] 2024-04-04 20:32:31 -04:00
James Mikrut
020dcaad75 chore: exports sql from pg adapter (#5678) 2024-04-04 20:31:14 -04:00
James
9bc56bcfc7 chore: exports sql from pg adapter 2024-04-04 20:30:38 -04:00
Elliot DeNolf
8325fadeb3 chore(release): v3.0.0-alpha.52 [skip ci] 2024-04-04 20:15:31 -04:00
Elliot DeNolf
d54275b3bd chore: unpushed version bump 2024-04-04 20:11:16 -04:00
James Mikrut
29d20423a3 chore: adds retryWrites, fixes a few flakes (#5674) 2024-04-04 20:09:51 -04:00
James
e539816253 chore: temp remove fields 2024-04-04 20:09:33 -04:00
James
922ce9ef5f chore: re-enables database adapter types 2024-04-04 20:07:59 -04:00
James
b73ec6ae94 chore: flake 2024-04-04 19:39:41 -04:00
Elliot DeNolf
4a11bf956d fix: db migrations esm part 2 (#5677) 2024-04-04 19:36:59 -04:00
Elliot DeNolf
3b3bb6c80a fix: db migrations esm (#5675) 2024-04-04 19:33:04 -04:00
James
0f323ff2e3 chore: re-adds fields 2024-04-04 19:17:41 -04:00
James
3305c65ae6 chore: adds retryWrites, fixes a few flakes 2024-04-04 19:14:01 -04:00
Elliot DeNolf
5c5acdcb03 chore(release): v3.0.0-alpha.50 [skip ci] 2024-04-04 19:00:11 -04:00
James Mikrut
0e6991f486 chore: green ci (#5673) 2024-04-04 18:44:27 -04:00
James
014786cc5f chore: green ci 2024-04-04 18:44:04 -04:00
James Mikrut
223c6b50fc Fix/fields e2e (#5672) 2024-04-04 18:24:21 -04:00
James
b18946352e chore: misc fields e2e fixes 2024-04-04 18:23:31 -04:00
James
96012b26b7 chore: properly isolates req in parallel requests 2024-04-04 18:00:37 -04:00
James
31cd663ad5 chore: merge alpha 2024-04-04 17:33:30 -04:00
Jacob Fletcher
0e9c9d7ccf Fix/admin e2e (#5670) 2024-04-04 17:31:42 -04:00
James
2a6eb6ec86 Merge branch 'fix/fields-e2e' of github.com:payloadcms/payload into fix/fields-e2e 2024-04-04 17:25:21 -04:00
James
0a74423c07 chore: replaces clearAndSeedEverything 2024-04-04 17:25:09 -04:00
Alessio Gravili
6f1302ae67 chore: skip react-select flakester test 2024-04-04 17:23:07 -04:00
Alessio Gravili
f275570f12 fix: WhereBuilder Relationship placeholder not shown if value is cleared 2024-04-04 17:18:16 -04:00
Alessio Gravili
90b47f6c44 Merge remote-tracking branch 'origin/fix/fields-e2e' into fix/fields-e2e 2024-04-04 17:10:14 -04:00
Alessio Gravili
e73d008695 fix: WhereBuilder Relationship conditions weren't able to be removed 2024-04-04 17:09:58 -04:00
Jacob Fletcher
3c5d1b402c test(admin): enables entity descriptions test 2024-04-04 17:09:22 -04:00
Jacob Fletcher
3e22bccce4 fix(ui): ssr entity descriptions 2024-04-04 17:08:03 -04:00
Jacob Fletcher
354e140305 fix(ui): ssr entity descriptions 2024-04-04 17:07:09 -04:00
James
54859f3582 Merge branch 'fix/fields-e2e' of github.com:payloadcms/payload into fix/fields-e2e 2024-04-04 17:04:35 -04:00
James
da12efd675 chore: more passing fields e2e 2024-04-04 17:04:23 -04:00
Alessio Gravili
32f848e90d fix: correctly extract relationTo prop for Relationship field condition in WhereBuilder 2024-04-04 16:55:46 -04:00
Jacob Fletcher
32440d23f7 chore(ui): extracts collection and global component maps into standalone files 2024-04-04 16:40:58 -04:00
Jarrod Flesch
62b7acc93a chore: simplify usage of useTitle 2024-04-04 16:15:49 -04:00
Jacob Fletcher
7b8e2c75c2 ci: enables admin e2e test suite 2024-04-04 16:09:46 -04:00
Jacob Fletcher
03abc641c5 test(admin): ignores search params when waiting for list view url 2024-04-04 16:09:46 -04:00
Alessio Gravili
fa5b98c9b5 chore: wait through e2e flakes 2024-04-04 15:59:48 -04:00
Alessio Gravili
c681be7ba8 chore: reduce flakes in fields/uploads e2e test suite 2024-04-04 15:17:52 -04:00
Alessio Gravili
3d3305a312 Merge remote-tracking branch 'origin/alpha' into fix/fields-e2e 2024-04-04 14:57:22 -04:00
Alessio Gravili
bb305af7b4 chore: fields-relationship e2e fixes (#5665) 2024-04-04 14:53:16 -04:00
Alessio Gravili
fd284973b6 ci: add missing --with-deps to playwright install command (#5667) 2024-04-04 14:52:59 -04:00
James
5d57572694 chore: work to add consistency to fields e2e 2024-04-04 14:41:58 -04:00
Jarrod Flesch
36a22f2b3c chore: fixes failing where builder 2024-04-04 14:28:47 -04:00
Patrik
dea9b590d1 fix: incorrect tooltip colors in light mode (#5636) 2024-04-04 14:13:25 -04:00
Patrik
bf843fe598 fix: skip parsing if operator is exists (#5639) 2024-04-04 14:11:22 -04:00
Jacob Fletcher
a23bc6caa8 Merge pull request #5646 from payloadcms/fix/alpha/admin-e2e
Fix/alpha/admin e2e
2024-04-04 14:10:21 -04:00
Alessio Gravili
1904fd5b02 chore: commit intellij payload.iml and mark temp or non-core directories as excluded. This excludes them from search (#5662) 2024-04-04 14:03:44 -04:00
Jacob Fletcher
03c9a883e1 Merge branch 'alpha' into fix/alpha/admin-e2e 2024-04-04 13:48:11 -04:00
Jacob Fletcher
c06df267a3 test(live-preview): uses correct locator to find linked cell 2024-04-04 13:42:55 -04:00
Jacob Fletcher
0bccdfeda7 fix(ui): finds index of useAsTitle after mutating column order 2024-04-04 13:42:55 -04:00
Jarrod Flesch
07d118ae7d chore: fix filtering tests 2024-04-04 13:39:17 -04:00
Alessio Gravili
e912dde08d chore: ensure autologin passes before starting tests for all e2e test suites (#5659) 2024-04-04 13:39:06 -04:00
Elliot DeNolf
3544375fdd chore(deps): remove release-it (#5658) 2024-04-04 12:57:13 -04:00
Elliot DeNolf
ab6ca7910e ci: release script concurrency (#5657)
* chore(deps): update turborepo

* chore: unprettified upload pointer files

* ci: use p-map in release script
2024-04-04 12:37:05 -04:00
Jacob Fletcher
6a329f7a8e fix(ui): adds optional chaining to fieldComponentProps in buildColumnState 2024-04-04 12:23:31 -04:00
Elliot DeNolf
5d4bb10106 chore: update all package.json repository urls and homepage (#5655) 2024-04-04 12:02:08 -04:00
Jarrod Flesch
cbc079bfff Merge branch 'fix/alpha/fields-e2et push' into fix/alpha/admin-e2e 2024-04-04 11:58:21 -04:00
Jarrod Flesch
09358d5853 chore: fix customLabel inside buildColumnState 2024-04-04 11:42:48 -04:00
Jacob Fletcher
81c345f33e test(admin): extracts api view tests into standalone group 2024-04-04 11:25:53 -04:00
Jacob Fletcher
3aa200eacc chore(deps): removes react-router-dom from peer deps 2024-04-04 11:24:09 -04:00
James Mikrut
6ce0b60cf2 Merge pull request #5652 from payloadcms/fix/ensure-indexes
chore: re-enables fields-relationship tests
2024-04-04 11:23:45 -04:00
James
faef0784ee chore: re-enables fields-relationship tests 2024-04-04 11:22:39 -04:00
Jarrod Flesch
fb70fe5760 chore: skips i18n tests for now 2024-04-04 11:09:31 -04:00
Jarrod Flesch
5b75b8a89e chore: fixes multi-select stalling tests 2024-04-04 11:04:46 -04:00
Jarrod Flesch
fa0296b796 chore: passing admin/list-filtering/multi-select 2024-04-04 11:04:46 -04:00
Jarrod Flesch
4e2d1f568f chore: fix plugin-form-builder test 2024-04-04 11:04:46 -04:00
Jacob Fletcher
b8d1aec1e5 fix(ui): properly sanitizes functional labels from field map 2024-04-04 10:53:04 -04:00
James Mikrut
38cfd6985e Merge pull request #5651 from payloadcms/fix/ensure-indexes
chore: ensure indexes are created before running localization test suite
2024-04-04 10:22:02 -04:00
James
d7c20c6941 chore: ensure indexes are created before running localization test suite 2024-04-04 10:11:45 -04:00
Jacob Fletcher
7894a54a0e Merge branch 'alpha' into fix/alpha/admin-e2e 2024-04-04 10:02:37 -04:00
James Mikrut
a46e64eec3 Merge pull request #5650 from payloadcms/fix/e2e-flakes
chore: adds logging, converts localization to use no config
2024-04-04 09:59:47 -04:00
Jarrod Flesch
cae0399584 chore: adds types to default columns 2024-04-04 09:54:05 -04:00
Jacob Fletcher
bfbf4ef0b5 test(admin): improves file organization and test names 2024-04-04 09:52:51 -04:00
Jarrod Flesch
ca4004605e chore: adds types to default columns 2024-04-04 09:52:21 -04:00
James
ec565a1bd3 chore: adds update to test sdk 2024-04-04 09:47:08 -04:00
Jarrod Flesch
94c4b180c1 chore: fix tsc errors 2024-04-04 09:40:36 -04:00
James
66de0b9019 chore: adds logging, converts localization to use no config 2024-04-04 09:34:45 -04:00
Jacob Fletcher
f752b38228 test(admin): partially passing list view filtering 2024-04-04 09:30:30 -04:00
Jarrod Flesch
d79748a967 chore: more admin test fixes 2024-04-04 09:28:12 -04:00
Alessio Gravili
c1b6c2c5a5 chore: unflake versions e2e (#5616) 2024-04-04 09:07:44 -04:00
Alessio Gravili
806b04e0ca Merge pull request #5633 from payloadcms/feat/form-server-validation 2024-04-04 09:07:05 -04:00
Alessio Gravili
736b562f3a chore: clean-up console logs 2024-04-04 09:06:09 -04:00
James
db440236fc Merge branch 'feat/form-server-validation' of github.com:payloadcms/payload into feat/form-server-validation 2024-04-04 09:04:30 -04:00
James
00ea8b900a chore: skips bulk edit test until fixes are merged 2024-04-04 09:04:14 -04:00
Paul
e092e9ba67 fix: missing data in first user registration (#5645) 2024-04-03 19:08:10 -03:00
Jacob Fletcher
8313cf34a6 test(admin): passing custom css 2024-04-03 18:03:10 -04:00
Jacob Fletcher
8f4b8f5826 fix(ui): shares sort order between where builder and column selector 2024-04-03 17:31:57 -04:00
Jacob Fletcher
c607b01f33 chore(ui): extracts reduceFieldMap from where builder 2024-04-03 17:31:47 -04:00
Jarrod Flesch
cc5d01d0e2 chore: fixes deleteAllPosts test helper 2024-04-03 17:07:45 -04:00
Alessio Gravili
a4cc41b679 chore: skip more flaky tests 2024-04-03 17:04:26 -04:00
Jarrod Flesch
67361e9ed5 chore: fixes bulk upldate test 2024-04-03 16:56:54 -04:00
Alessio Gravili
8662572690 chore: enable fields on CI 2024-04-03 16:54:27 -04:00
Alessio Gravili
99ea1788e7 chore: skip flaky fields-relationship tests for now 2024-04-03 16:54:07 -04:00
James
7bec3c90cd chore: adds ux de-flaking to relationship field 2024-04-03 16:14:01 -04:00
Jacob Fletcher
ca4e6c46bc fix(ui): properly sorts table columns 2024-04-03 15:09:38 -04:00
James
678da159a9 Merge branch 'alpha' of github.com:payloadcms/payload into feat/form-server-validation 2024-04-03 14:20:39 -04:00
James
cc3b51fb3b chore: logs to localization seed 2024-04-03 14:18:36 -04:00
James
060344bb5a chore: logs for ci visibility 2024-04-03 14:09:42 -04:00
Jacob Fletcher
b42c67040d fix(ui): properly flattens tabs field map 2024-04-03 14:01:21 -04:00
Alessio Gravili
f3b18fcf0e chore: move autosave new document creation & redirect logic to server, fixes versions e2e flakes due to late redirect 2024-04-03 13:50:52 -04:00
Elliot DeNolf
a86c69edc9 fix: sets beforeValidateHook req type to required (#5634)
Co-authored-by: Patrik <patrik@payloadcms.com>
2024-04-03 13:45:44 -04:00
Jessica Chowdhury
55c60a05dc feat(plugin-seo): adds Norwegian translation (#5629) 2024-04-03 13:26:44 -04:00
Jacob Fletcher
ecf40cc747 fix(ui): renders field description functions 2024-04-03 13:18:49 -04:00
Jacob Fletcher
197458e60b chore: adds isReactComponent utility 2024-04-03 13:18:49 -04:00
Alessio Gravili
0c3ffb0743 chore: expect accurate error in uploads e2e test 2024-04-03 13:14:38 -04:00
Alessio Gravili
56dffd3c58 fix: validation not running correctly when changing field state and submitting form immediately after 2024-04-03 13:00:23 -04:00
Jarrod Flesch
57a3a37fdd chore: passing admin/i18n tests 2024-04-03 12:40:41 -04:00
Elliot DeNolf
a8a273f0d8 chore(cpa): ensure project name is slugified (#5631) 2024-04-03 12:18:46 -04:00
Jarrod Flesch
9f4ab26696 chore: passing admin/nav tests 2024-04-03 12:17:48 -04:00
James
4ddef9d648 chore: adds prop to form to allow server validation only on submit 2024-04-03 12:03:05 -04:00
Jessica Chowdhury
7cccca8194 chore(alpha): update fields-relationship e2e tests (#5553)
* fix: handles filter options in form state merge

* chore: fix and reintegrate fields-relationship e2e tests

* chore: update withMergedProps function for e2e tests
2024-04-03 16:11:19 +01:00
James Mikrut
2a8b678a4b Merge pull request #5604 from payloadcms/fix/postgres-fields
chore: revisions to baseIDField
2024-04-03 10:55:43 -04:00
Jarrod Flesch
b9767b865a chore: working but wip admin e2e 2024-04-03 10:47:01 -04:00
James
f6bc3eb014 chore: passing pg 2024-04-03 10:39:38 -04:00
Elliot DeNolf
007917df19 ci: docker compose v2, v1 no longer supported on gh runner (#5626) 2024-04-03 10:34:49 -04:00
Alessio Gravili
22a2e850bf Merge pull request #5627 from payloadcms/chore/port-lexical-fixes 2024-04-03 09:56:36 -04:00
Alessio Gravili
1cfdf3613c docs(richtext-lexical): clarify that HTML generation has to happen on the server 2024-04-03 09:55:33 -04:00
Alessio Gravili
fe280e6bb1 fix(richtext-lexical): disable instanceof HTMLImageElement check as it causes issues when used on the server 2024-04-03 09:55:23 -04:00
Jarrod Flesch
a330fe6017 chore(ui): simplifies adminThumbnail functionality (#5615) 2024-04-03 08:49:31 -04:00
Jessica Chowdhury
4ee4ad25b0 fix(alpha): number field with hasMany accept defaultValue array (#5619) 2024-04-03 08:05:49 -04:00
Paul
777a661389 chore: remove dead refresh permissions test from github workflows (#5614) 2024-04-02 20:57:54 -03:00
Paul
8174230afe chore: plugin form builder e2e (#5612)
* chore: update plugin files to esm

* chore: add e2e for plugin form builder

* chore: update release script and gh workflow

* chore: update build command for form builder plugin
2024-04-02 20:56:37 -03:00
Alessio Gravili
e1777dc533 ci: do not fail upload-artifact action if more than 2 e2e tests fail (#5605) 2024-04-02 18:36:07 -04:00
Elliot DeNolf
390731c07b ci: separate tests-unit, esm scripts (#5607)
* ci: script esm updates

* ci: separate out unit tests
2024-04-02 17:31:38 -04:00
James
25d475e165 chore: revisions to baseIDField 2024-04-02 17:04:27 -04:00
Alessio Gravili
1e60250670 chore: enable all fields int tests (#5603) 2024-04-02 17:00:32 -04:00
Alessio Gravili
f6d2dd520c Merge pull request #5561 from payloadcms/temp38
fix: test suite & transactions fixes
2024-04-02 16:00:10 -04:00
Alessio Gravili
4600588e72 chore: disable uploads e2e 2024-04-02 15:59:25 -04:00
Dan Ribbens
825ca94080 fix: duplicate handles locales with unique (#5600)
* fix: duplicate errors with localized and unique fields

* docs: beforeDuplicate hooks
2024-04-02 15:30:49 -04:00
Alessio Gravili
7f674f9861 chore: fix payload HMR being run during e2e & int tests 2024-04-02 15:01:18 -04:00
James
27dba7e4e1 chore: improper expect in upload test suite 2024-04-02 14:21:58 -04:00
Alessio Gravili
44295ff248 chore: use initPayloadInt consistently in all int test suites and do not init payload twice 2024-04-02 13:39:01 -04:00
Alessio Gravili
dc33d96a54 chore: remove async seeding from auth and fields-relationship test suites 2024-04-02 13:25:12 -04:00
Alessio Gravili
4ff7619356 chore: remove console logs 2024-04-02 12:29:38 -04:00
Alessio Gravili
cc5c2bd7cd chore: fix flakes in versions test suite 2024-04-02 12:27:29 -04:00
Alessio Gravili
2884712685 chore: fix versions int test seeding 2024-04-02 12:17:27 -04:00
Alessio Gravili
027264588b chore: versions test improvements 2024-04-02 12:13:12 -04:00
Alessio Gravili
ddd75ce730 Merge remote-tracking branch 'origin/temp38' into temp38 2024-04-02 12:12:51 -04:00
Alessio Gravili
4bc13c28dd chore: passing live-preview 2024-04-02 12:12:42 -04:00
James
7a1db89a6e Merge branch 'temp38' of github.com:payloadcms/payload into temp38 2024-04-02 12:12:35 -04:00
James
c08489509a chore: startMemoryDB in e2e 2024-04-02 12:12:21 -04:00
Alessio Gravili
7054ae8a88 chore: unit/int test CI stuff 2024-04-02 12:00:32 -04:00
Alessio Gravili
d7e913be95 fix: do not re-use same transaction ID for parallel operations 2024-04-02 11:08:04 -04:00
James
f283a2ced5 Merge branch 'temp38' of github.com:payloadcms/payload into temp38 2024-04-02 10:40:06 -04:00
James
c7274ba16f chore: wires up conditions for collapsibles, groups, etc 2024-04-02 10:39:52 -04:00
Alessio Gravili
6f323e379c add console logs 2024-04-02 10:35:20 -04:00
Alessio Gravili
42212b409a chore: remove console log 2024-04-02 10:19:24 -04:00
James
e8506cc5f1 chore: startMemoryDB pointing to mongodb instead of mongoose 2024-04-02 10:02:51 -04:00
James
d387f9f1fa chore: working pattern for debugging e2e and int 2024-04-02 10:01:47 -04:00
James
73a555788d chore: uses globalSetup for starting memory db 2024-04-02 09:44:55 -04:00
Elliot DeNolf
be58f67115 test(uploads): remove all process.cwd() usage (#5588) 2024-04-02 00:08:58 -04:00
Elliot DeNolf
b26117a65d feat(cpa): strict true 😈 (#5587) 2024-04-01 23:05:57 -04:00
Alessio Gravili
34fe6182c8 temp3 2024-04-01 23:05:54 -04:00
Alessio Gravili
ee3ae6025f temp2 2024-04-01 22:41:24 -04:00
James
df9812b2a3 Merge branch 'temp38' of github.com:payloadcms/payload into temp38 2024-04-01 22:13:02 -04:00
James
113eea04cc chore: seed endpoint 2024-04-01 22:12:45 -04:00
Alessio Gravili
57f9ebdb68 temp1 2024-04-01 22:04:45 -04:00
James
94d0e28ad7 chore: local api sdk for e2e tests 2024-04-01 21:53:30 -04:00
James
cd553d45cc chore: merge 2024-04-01 17:47:28 -04:00
James
d993f9ac64 chore: bug in isMongoose 2024-04-01 17:46:42 -04:00
James
833bdc13bd chore: uploads e2e tweak 2024-04-01 17:38:24 -04:00
James Mikrut
33657b4b49 Merge branch 'alpha' into temp38 2024-04-01 17:37:54 -04:00
James
ec6bc8e36b chore: removes old refs to startMemoryDB 2024-04-01 17:36:36 -04:00
Jacob Fletcher
799370f753 fix(next): establishes pattern for preview urls (#5581) 2024-04-01 17:30:49 -04:00
James
abd404c57c chore: adjusts playwright env used to trigger memory db 2024-04-01 17:30:18 -04:00
Kendell Joseph
037ed3cd54 test: e2e uploads (#5511)
* chore: enables upload tests on CI

* fix: adds relationTo information to field map

* chore: updates e2e tests (WIP)

* chore: move back to probe-image-size, tiff files do not support buffers

* chore: basic runtime err fixes

* chore: remove admin thumbnail when creating client config

* test: small upload fixes

---------

Co-authored-by: Elliot DeNolf <denolfe@gmail.com>
Co-authored-by: Jarrod Flesch <jarrodmflesch@gmail.com>
2024-04-01 17:28:15 -04:00
James
c461a7fa15 chore: renames mongoose db adapter refs to mongodb 2024-04-01 17:24:43 -04:00
James
8fc8aaa6dd yammil 2024-04-01 17:14:43 -04:00
James
2bc45e2b2e chore: adds logging for ci 2024-04-01 17:12:16 -04:00
James
cdfc58d115 chore: re-adds int 2024-04-01 17:08:50 -04:00
James
bb8a57d2e9 chore: better pattern to initialize memory server 2024-04-01 17:04:05 -04:00
James
5e52339135 chore: converts e2e suites to new pattern 2024-04-01 16:37:12 -04:00
James
df75914e30 chore: attempts to get _community to pass with change to import order of config 2024-04-01 16:29:22 -04:00
Patrik
572e6ccb37 fix(ui): places id field last in field map and prevents render (#5585) 2024-04-01 16:25:29 -04:00
James
8e1ebe28c0 chore: adds node env for e2e tests 2024-04-01 15:57:23 -04:00
James
adec044e02 chore: returns runE2E 2024-04-01 15:55:38 -04:00
James
b9868cc709 chore: reverts memory test approach 2024-04-01 15:51:40 -04:00
James
fce8b125f8 Merge branch 'temp38' of github.com:payloadcms/payload into temp38 2024-04-01 15:29:43 -04:00
James
4befd2e4ff chore: sets env vars for tests in globalSetup 2024-04-01 15:29:27 -04:00
James Mikrut
38cdc1b7ba Merge branch 'alpha' into temp38 2024-04-01 14:37:33 -04:00
James
a0f6018469 chore: better pattern for memory db 2024-04-01 14:36:08 -04:00
James
f230d55031 chore: restores memory db 2024-04-01 11:11:52 -04:00
James
2f6a15a9ae chore: calculates default values before running buildFormState 2024-04-01 10:52:26 -04:00
Elliot DeNolf
04d751208f Merge pull request #5557 from payloadcms/feat/cpa-detect-next-app
feat(cpa): detect next app
2024-04-01 10:44:43 -04:00
Elliot DeNolf
7cfc40f328 test(cpa): update tests 2024-04-01 10:32:17 -04:00
Elliot DeNolf
3c54d32b6d feat(cpa): rework all prompts to use @clack/prompts 2024-04-01 10:16:07 -04:00
Jessica Chowdhury
ece7d92e57 chore: updates e2e tests for plugin-nested-docs and plugin-seo (#5434)
* test: removes unnecessary lines

* fix: do not error if row field has no fields (#5433)

* ci(deps): update turborepo

* ci: release script updates

* chore: lint all json/yml, add to lint-staged

* chore: lint mdx in lint-staged

* chore: enable e2e live preview (#5444)

* chore: update workflow file

---------

Co-authored-by: Alessio Gravili <70709113+AlessioGr@users.noreply.github.com>
Co-authored-by: Elliot DeNolf <denolfe@gmail.com>
Co-authored-by: Paul <paul@payloadcms.com>
2024-04-01 15:01:05 +01:00
James
8e736b28af Merge branch 'temp38' of github.com:payloadcms/payload into temp38 2024-04-01 09:30:12 -04:00
Alessio Gravili
92ec0a5b1d chore: temporarily disable int tests, and field-error-states, live-preview, versions e2e's (#5578) 2024-03-31 22:41:52 -04:00
Alessio Gravili
398834f690 øMerge remote-tracking branch 'origin/alpha' into temp38 2024-03-31 21:35:54 -04:00
Alessio Gravili
28e6dd8759 fix: do not exclude admin.hidden fields from default active columns (#5556) 2024-03-31 21:35:11 -04:00
Alessio Gravili
dedc937915 Merge pull request #5576 from payloadcms/feat/alpha-5574
feat(richtext-*): add ability to provide custom Field and Error components
2024-03-31 21:17:19 -04:00
Alessio Gravili
732f4241fe chore: commit updated translation files 2024-03-31 21:16:17 -04:00
Alessio Gravili
873585e1ae feat(richtext-*): add ability to provide custom Field and Error components 2024-03-31 21:12:52 -04:00
Alessio Gravili
71a5a02e8c docs(richtext-slate): update outdated code example (#5572) (#5573) 2024-03-31 17:50:15 -04:00
Alessio Gravili
51fbd02b40 fix(richtext-lexical): checklist html converter incorrectly outputting children (#5570) (#5571) 2024-03-31 16:25:16 -04:00
Alessio Gravili
763eda5038 fix(richtext-lexical): properly center add- and drag-block handles (#5568) (#5569) 2024-03-31 16:08:00 -04:00
Alessio Gravili
6cdb76503b chore: disable memory db for now, as it doesn't work locally for the versions test suite 2024-03-31 16:05:55 -04:00
Alessio Gravili
aa8edd7a47 chore: fix issues in versions e2e test 2024-03-31 16:05:20 -04:00
Alessio Gravili
535aa56627 fix: do not pass undefined data through buildStateFromSchema for tab fields 2024-03-29 17:32:40 -04:00
Elliot DeNolf
db0fb30f7b test(cpa): update jest config 2024-03-29 17:28:35 -04:00
Elliot DeNolf
7619fb4753 feat(cpa): handle next.js app with and without src dir 2024-03-29 16:45:52 -04:00
Paul
0aeba954d4 fix: localization e2e (#5555)
* fix: issue with missing locale when duplication localized collections

* chore: fix localization tests
2024-03-29 17:45:26 -03:00
Alessio Gravili
2bc1468fa2 chore: tests: uploads dir: delete and restore snapshot between tests (#5560)
* chore: tests: uploads dir: delete and restore snapshot between tests

* chore: add missing creation of uploads dir cache folder

* fix logic
2024-03-29 16:29:40 -04:00
James Mikrut
4b29b6efc5 Merge pull request #5559 from payloadcms/temp36
Temp36
2024-03-29 14:57:27 -04:00
James
26b1003cfd Merge branch 'alpha' of github.com:payloadcms/payload into alpha 2024-03-29 14:56:15 -04:00
James
b696dce6e4 chore: disables password fields if disableLocalStrategy, safely inherits valid: false 2024-03-29 14:55:58 -04:00
Elliot DeNolf
403a86feca chore(create-payload-app): configure db in init next flow 2024-03-29 14:25:00 -04:00
Jacob Fletcher
56d6a9767e Merge pull request #5551 from payloadcms/fix/nav
fix: misc.
2024-03-29 13:58:22 -04:00
James
d2cc229622 Merge branch 'alpha' of github.com:payloadcms/payload into fix/alpha/rte-e2e-tests 2024-03-29 13:51:29 -04:00
Jacob Fletcher
e6b166da7d fix(next): proper 404 handling 2024-03-29 13:30:00 -04:00
Elliot DeNolf
77f401d977 chore(create-payload-app): console.log wrapper 2024-03-29 13:23:25 -04:00
Elliot DeNolf
7d7b232fdb feat(create-payload-app): functioning init next flow, no prompts 2024-03-29 12:48:00 -04:00
James
959f1e33cd chore: form now validates without field validate functions 2024-03-29 12:44:40 -04:00
Elliot DeNolf
7f5ab96f81 chore: move payload config into src 2024-03-29 12:22:32 -04:00
James
443089a66f chore: fixes Translation component 2024-03-29 11:54:20 -04:00
Jacob Fletcher
f5d9b47177 fix(richtext-lexical): uses entity visibility hook when enabling relationships 2024-03-29 11:54:02 -04:00
Jacob Fletcher
a0cddbe9b3 fix(richtext-slate): uses entity visibility hook when enabling relationships 2024-03-29 11:36:49 -04:00
Jacob Fletcher
5f7fcfd3df chore(next): uses visibileEntities in getViewsFromConfig 2024-03-29 11:30:33 -04:00
Alessio Gravili
a39080340a fix: missing translation key for richtext fields (#5550) 2024-03-29 11:11:50 -04:00
Jacob Fletcher
a3d6879c55 fix(ui): wraps nav with fragment 2024-03-29 11:10:43 -04:00
Alessio Gravili
b09be86a3c Merge pull request #5549 from payloadcms/temp33
fix: unload client functions after unmount (e.g. leaving document)
2024-03-29 11:07:47 -04:00
James
02ef033d23 chore: fixes infinite processing when submitting bad form 2024-03-29 11:03:21 -04:00
Alessio Gravili
f10861e1de chore: add lexical test which verifies it's working 2024-03-29 10:53:30 -04:00
James
ecf53d9961 chore: passes through props in listinfoprovider 2024-03-29 10:51:24 -04:00
Paul
5339c09b72 fix: access control test suite (#5548)
* chore: improve flakiness with access control test suite

* fix issue with redirecting from a drawer

* chore: watches for created id in drawers

---------

Co-authored-by: James <james@trbl.design>
2024-03-29 11:46:46 -03:00
Jacob Fletcher
b6ad218126 fix(ui): establishes pattern for hidden entities (#5546) 2024-03-29 10:32:09 -04:00
Alessio Gravili
b7b74a429e fix: unload client functions after unmount (e.g. leaving document) 2024-03-29 09:54:11 -04:00
James
52acd3123f chore: allows slate to render 2024-03-29 09:48:54 -04:00
Patrik
c9c3a689d8 fix: flaky indexed test suite (#5509) 2024-03-29 09:01:44 -04:00
Patrik
da4a2a2494 fix: reverts selector in array bulk update test to original to get passing test (#5512) 2024-03-29 09:00:48 -04:00
James
35a1fb26f9 Merge branch 'fix/alpha/rte-e2e-tests' of github.com:payloadcms/payload into fix/alpha/rte-e2e-tests 2024-03-29 08:27:00 -04:00
Jarrod Flesch
cb3723242c fix: passing versions e2e (#5521) 2024-03-29 01:20:02 -04:00
Patrik
6a0c6284d0 fix: passing blocks field test suite (#5529) 2024-03-28 20:56:52 -04:00
Jarrod Flesch
114ade7456 chore: wip rte field work 2024-03-28 16:53:32 -04:00
Kendell Joseph
a01e0e37f4 fix: corrects query so upload edits can happen (#5527) 2024-03-28 16:22:26 -04:00
Elliot DeNolf
18884025de ci: disable access-control suite until flakes are fixed 2024-03-28 15:41:20 -04:00
Alessio Gravili
cfdc941207 fix(richtext-lexical): Blocks: do not include empty arrays in form state (#5526) 2024-03-28 15:40:02 -04:00
Kendell Joseph
5eaf00ba0e chore: use dirname to resolve file locations for uploads test (#5523) 2024-03-28 15:35:35 -04:00
Elliot DeNolf
8948555ac1 ci: re-enable fields int suite (#5525) 2024-03-28 15:34:09 -04:00
Alessio Gravili
e28418d6d6 fix: onError not found error (#5524) 2024-03-28 15:10:20 -04:00
Kendell Joseph
fe83c53206 fix(ui): adds relationTo to cellComponentProps (#5518) 2024-03-28 14:43:46 -04:00
Alessio Gravili
942aa08285 chore: obliterate next cache before starting e2e/int/dev (#5522) 2024-03-28 14:42:45 -04:00
Alessio Gravili
93dd6b5a98 chore: add skipped, failing lexical e2e test for errors within nested block fields, fix lexical seed data, disable access-control test (#5508) 2024-03-28 13:36:05 -04:00
James Mikrut
08dd9ca91c Merge pull request #5516 from payloadcms/feat/simplify-doc-fetch
feat: simplifies fetching of docs for drawer and edit views
2024-03-28 13:35:07 -04:00
Jacob Fletcher
77efdc3ccf fix(ui): adds support for direct field label props (#5517) 2024-03-28 13:22:09 -04:00
James
ef1bcd5afa chore: fixes redirection on create 2024-03-28 13:18:35 -04:00
Jarrod Flesch
8636685252 fix: simplifies field error paths (#5504) 2024-03-28 13:15:44 -04:00
Patrik
5873dfb731 fix(ui): incorrect conditions in WhereBuilder (#5503)
* fix: relationship field tests e2e

* chore: adds POLL_TOPASS_TIMEOUT to relationship field tests

* chore: adds comments to relationship test waits
2024-03-28 13:14:00 -04:00
James
934abec88c feat: simplifies fetching of docs for drawer and edit views 2024-03-28 12:14:12 -04:00
Jarrod Flesch
c1d654c4ce fix(tests): passing tabs test in fields suite (#5463) 2024-03-28 11:28:37 -04:00
Paul
d64b12b14c fix: breadcrumbs on live preview tab (#5478) 2024-03-28 09:32:21 -03:00
Alessio Gravili
3f4ab5f95e fix: undefined error when creating new row without subFieldState present (#5502) 2024-03-27 17:13:06 -04:00
Jacob Fletcher
ee1e94be96 fix(ui): sets proper id on publish button and updates custom button semantics in field map (#5501) 2024-03-27 17:09:16 -04:00
Alessio Gravili
1e9999a8d3 fix: shallow-copy new form state one level deeper, fixes conditions (#5499) 2024-03-27 16:51:13 -04:00
Dan Ribbens
460ca99fe1 chore: alpha fix test defaultvalues (#5500) 2024-03-27 16:47:22 -04:00
Jacob Fletcher
7fdf9b7012 fix(ui): threads initial data through document info provider (#5498) 2024-03-27 16:39:00 -04:00
Alessio Gravili
c16b869fea Merge pull request #5491 from payloadcms/temp24
fix: form-state issues
2024-03-27 16:28:26 -04:00
Alessio Gravili
8deb19e3ac chore: replace incorrect usage of saveDocAndAssert helpers 2024-03-27 16:17:46 -04:00
Alessio Gravili
e6d4445a8a chore: fix build 2024-03-27 16:03:23 -04:00
Jacob Fletcher
0f0da809da Merge pull request #5497 from payloadcms/fix/table-cols
Fix/table cols
2024-03-27 16:00:06 -04:00
Alessio Gravili
db8e805a96 fix: improve error path merging from server, make sure no new or removed rows/values coming from the server are being considered outside addFieldRow 2024-03-27 15:55:19 -04:00
Jacob Fletcher
a882cc7e8e fix(ui): properly handles column selector labels 2024-03-27 15:45:26 -04:00
Elliot DeNolf
acede26aa6 fix: imports from exports dir (#5496)
* chore: remove all internal importing from exports directory

* chore: more package.json main values to src/index.ts
2024-03-27 15:39:58 -04:00
Paul
9330919be8 fix: issue of losing locale when switching tabs between API and edit views (#5494)
* fix: issue of losing locale when switching tabs between API and edit views
2024-03-27 16:20:04 -03:00
Jacob Fletcher
91b4e91e9c fix(ui): filters fields and unfurls subfields for table columns 2024-03-27 13:00:54 -04:00
Dan Ribbens
2fb265ae2d chore: fix broken fields test (#5492) 2024-03-27 12:39:09 -04:00
Elliot DeNolf
3b5e7f1dc4 chore: unprettify tsconfig.json to avoid needing to reformat 2024-03-27 12:28:19 -04:00
Alessio Gravili
08ff286f9a chore: e2e: replace flaky manual save actions with non-flaky saveDocAndAssert helper 2024-03-27 12:18:17 -04:00
Jacob Fletcher
bc9fe2f4f9 fix(ui): disables bulk edit for default id fields 2024-03-27 12:13:29 -04:00
Alessio Gravili
e99b168bd6 ci: do not retry failing tests - we shouldn't have flaky tests in the first place 2024-03-27 12:03:38 -04:00
Alessio Gravili
a7afb1f680 chore: enable all lexical e2e tests 2024-03-27 11:54:12 -04:00
Alessio Gravili
6f3934f2e5 fix: server form-state request wasn't triggered on first onChange 2024-03-27 11:44:50 -04:00
Alessio Gravili
79da297add fix: form state not replaced if server has different data for rows 2024-03-27 11:44:02 -04:00
Alessio Gravili
6664535ab9 fix: form onChange using out-of-date old fields state 2024-03-27 11:43:35 -04:00
Alessio Gravili
80d290e178 fix: server-generated ID for base ID field is overriden on the client 2024-03-27 11:42:08 -04:00
Alessio Gravili
d144af6d8e fix: baseIDField not included in form states 2024-03-27 11:41:21 -04:00
Paul
aba7c13a1d chore: rename the DB strings in buildconfigwithdefaults to DATABASE_URI (#5490)
* chore: rename the DB strings in buildconfigwithdefaults to DATABASE_URI

* reverse name change for postgres strings
2024-03-27 12:34:10 -03:00
Paul
f59d3f36d1 chore: add process.env.MONGO_URL to buildconfigwithdefaults with fallback to string (#5489) 2024-03-27 12:00:42 -03:00
Jacob Fletcher
3f0d0ecd5f fix(ui): prevents field errors from flashing when used outside of field props context (#5488) 2024-03-27 10:48:05 -04:00
Elliot DeNolf
0c51502cc5 Merge pull request #5464 from payloadcms/feat/cpa-updates
feat(create-payload-app): updates
2024-03-27 10:26:18 -04:00
Elliot DeNolf
e829650cd9 chore(create-payload-app): ESM test fix 2024-03-27 09:08:09 -04:00
Jacob Fletcher
a8082c551b fix(next): removes reliance on instanceof from api error formatting (#5482) 2024-03-27 09:06:47 -04:00
Elliot DeNolf
ff55cfa001 ci: conditionally set jest reporter 2024-03-26 18:45:53 -04:00
Elliot DeNolf
623a3d3b7b ci: re-enable cpa test suite 2024-03-26 18:45:53 -04:00
Elliot DeNolf
fb32e2a561 test(create-payload-app): only use local-template in tests 2024-03-26 18:45:53 -04:00
Elliot DeNolf
8aa8a380e1 test: missing test dir deps, update cpa create project suite 2024-03-26 18:45:53 -04:00
Elliot DeNolf
f35b8b05e8 chore(create-payload-app): remove unneeded 2.0 func, add cli overrides 2024-03-26 18:45:53 -04:00
Elliot DeNolf
05bb73bb7c chore: update blank 3.0 template 2024-03-26 18:45:53 -04:00
Elliot DeNolf
18299dc65e chore: blank 3.0 template type 2024-03-26 18:45:53 -04:00
Elliot DeNolf
818ab2c10f chore: restructure 2024-03-26 18:45:52 -04:00
Elliot DeNolf
df0bf28d57 chore: return error messages from parse 2024-03-26 18:45:52 -04:00
Elliot DeNolf
ff65f10c2f chore: edge case for parsing next config 2024-03-26 18:45:52 -04:00
Elliot DeNolf
5cf49aa166 chore: implement AST parsing of next config 2024-03-26 18:45:52 -04:00
Elliot DeNolf
0651daa1d4 chore: more ESM, linting 2024-03-26 18:45:52 -04:00
Elliot DeNolf
921c53f75c chore(templates): bump alpha deps and next app changes 2024-03-26 18:45:52 -04:00
Elliot DeNolf
dd37519185 chore: missing semis on payload pointer files 2024-03-26 18:45:09 -04:00
Dan Ribbens
a1e8c4eb2b fix(db-postgres): query with contains operator hasMany (#5481) 2024-03-26 15:26:46 -04:00
Paul
1f8c191cb3 fix: missing data in livepreview causing missing updated at values (#5477) 2024-03-26 15:15:14 -03:00
Paul
f4acc74eee chore: added iframe content test for live-preview test (#5476) 2024-03-26 15:03:18 -03:00
Dan Ribbens
3d1378ab77 fix: duplicate db called with incorrect data (#5475) 2024-03-26 13:51:25 -04:00
Dan Ribbens
58e4174edb fix(db-postgres): deleteOne handle joins (#5457)
* fix(db-postgres): deleteOne handle joins

* chore(db-postgres): reduce duplicate lines of code

* chore: optimize delete preferences

* chore(db-postgres): fix deleteOne regression

* chore(db-postgres): missing await
2024-03-26 13:36:15 -04:00
Jacob Fletcher
20b4585666 chore: properly types cell components (#5474) 2024-03-26 12:08:33 -04:00
Paul
9c7e7ed8d4 fix(ui): custom buttons and e2e refresh permissions test (#5458)
* moved refresh permissions test suite to access control

* support for custom Save, SaveDraft and Publish buttons in admin config for collections and globals

* moved navigation content to client side so that permissions can be refreshed from active state
2024-03-26 11:48:00 -03:00
Alessio Gravili
436c4f2736 fix: missing withConditions for Upload, Select, Password, Blocks, Array fields (#5471)
* fix: missing withConditions for Upload, Select, Password, Blocks, Array fields. Fixes Lexical e2e tests

* chore: skip failing lexical test for now
2024-03-26 10:38:48 -04:00
Dan Ribbens
0ce752af79 fix: regression of filterOptions using different transaction (#5450) 2024-03-26 10:13:57 -04:00
Jarrod Flesch
92ff896bdb chore: adjusts e2e to watch for new file url paths (#5467) 2024-03-26 00:44:21 -04:00
Alessio Gravili
77a3cbaba5 Merge pull request #5466 from payloadcms/temp20
chore: improve e2e and int test speed, reduce flakiness and errors
2024-03-26 00:13:50 -04:00
Alessio Gravili
56f9c88251 chore: optimize test seed payload.create calls and run them in parallel to reduce MongoDB errors 2024-03-25 23:58:55 -04:00
Alessio Gravili
8a5a08cbe1 chore: fix test seed helper keeping all uploads deleted during test run, as they weren't restored like the db snapshot 2024-03-25 23:57:54 -04:00
Alessio Gravili
5241c38ba0 chore: speed up tests by not running seed twice for the first test, and reduce flakiness of lexical e2e test suite 2024-03-25 23:55:42 -04:00
Jacob Fletcher
072a903351 Merge pull request #5461 from payloadcms/fix/misc-views
Fix/misc views
2024-03-25 23:35:15 -04:00
Jacob Fletcher
328bd453bb chore(i18n): adds version:status to client translations 2024-03-25 22:56:28 -04:00
Jacob Fletcher
690a3cfa68 fix(ui): threads data through document info context 2024-03-25 22:56:28 -04:00
Jacob Fletcher
1c1847f63c fix(next): dynamic params for custom collection and global views 2024-03-25 22:56:19 -04:00
Alessio Gravili
c3d9d8ee2f Merge pull request #5460 from payloadcms/temp14
fix: various issues impacting lexical e2e tests
2024-03-25 20:50:57 -04:00
Alessio Gravili
65932b65d2 chore: fields test: fix Mongo write errors during seed by making create calls run sequentially.
Adds easy way of toggling between parallel or sequential runs, and optimized performance of create calls
2024-03-25 20:39:56 -04:00
Alessio Gravili
682e961416 chore: run lexical e2e's in CI, adjust runE2E to allow running just the fields/lexical.e2e.spec.ts 2024-03-25 17:17:13 -04:00
Alessio Gravili
9fcccc8197 chore: add payload/no-jsx-import-statements eslint rule to eslint-config-payload by default 2024-03-25 17:08:43 -04:00
Alessio Gravili
72f3ced219 chore: fix incorrect logic in auth test 2024-03-25 17:07:55 -04:00
Alessio Gravili
74de066529 chore: skip last lexical e2e test for now 2024-03-25 16:56:44 -04:00
Alessio Gravili
3d1589404c fix: race condition between form modified setter and form onSubmit. Caused e2e flakes 2024-03-25 16:53:07 -04:00
Patrik
30d9d46dd8 test: passing point fields test suite (#5401)
* test: passing point fields test suite

* chore: removes waits from point fields test suite

* chore: removes unnecessary waits in dates field test suite

* chore: removes waits entirely from dates tests

* chore: adds translates function for longitude/latitude

* chore: renames coordinate function and conditionally renders hypen in the function
2024-03-25 16:36:02 -04:00
Alessio Gravili
740373897a fix(richtext-lexical): Blocks: field schemas for sub-fields were not handled 2024-03-25 15:42:15 -04:00
Elliot DeNolf
f7ca01bafd test: convert PrePopulateFieldUI to client component (#5456) 2024-03-25 15:38:37 -04:00
Jacob Fletcher
7654ff686a fix(ui): throws explicit error for custom view tabs that are client components 2024-03-25 15:37:57 -04:00
Jarrod Flesch
5266612bb3 chore: get correct labels for unnamed fields in list view (#5454) 2024-03-25 15:31:23 -04:00
Patrik
a9b46a4d63 fix(ui): properly formats collapsible field IDs (#5435)
* test: passing collapsible fields test suite

* chore: passes indexPath into ArrayRow & updates path in collapsible field

* fix: collapsible paths and indexPath prop types

* chore: improves path and schemaPath syntax

* leftover

* chore: updates selectors in collapsibles tests

* chore: updates selector in live-preview test suite

---------

Co-authored-by: Jacob Fletcher <jacobsfletch@gmail.com>
2024-03-25 14:16:35 -04:00
Elliot DeNolf
76e9bd8ad6 chore: enable no-jsx-import-statements for test dir 2024-03-25 13:51:30 -04:00
Elliot DeNolf
317a443644 chore: remove unused update changelog script 2024-03-25 13:40:07 -04:00
Elliot DeNolf
43f91ca42c test: run prettier on tsconfig.json after test 2024-03-25 13:36:29 -04:00
Alessio Gravili
8d78d07415 fix: prioritize props path in useField - fixes sub-fields initialized from within fields, like blockName (#5451) 2024-03-25 13:21:01 -04:00
Jarrod Flesch
99a00a1ae2 fix(tests): number field e2e (#5452) 2024-03-25 13:17:13 -04:00
Patrik
2cd8d891a1 test: passing date fields test suite (#5412)
* test: passing date fields test suite

* chore: reverts dates from 2024 back to 2023 to remove clutter
2024-03-25 11:49:44 -04:00
Dan Ribbens
7fc33af1e5 fix: image resize tiff files (#5449) 2024-03-25 11:09:17 -04:00
Alessio Gravili
67c57a1137 Merge pull request #5436 from payloadcms/temp11
chore: improvements to eslint, and access-control + lexical test suites
2024-03-25 10:48:27 -04:00
Alessio Gravili
9f8ac06659 fix: already-sanitized fields were sanitized twice in buildFieldSchemaMap 2024-03-25 10:36:52 -04:00
Alessio Gravili
aea28b28d0 Merge remote-tracking branch 'origin/alpha' into temp11 2024-03-25 10:18:08 -04:00
Paul
ee4cd61696 chore: enable e2e live preview (#5444) 2024-03-25 08:39:34 -03:00
Elliot DeNolf
e9f15c377f chore: lint mdx in lint-staged 2024-03-24 23:18:52 -04:00
Elliot DeNolf
d5935ea81b chore: lint all json/yml, add to lint-staged 2024-03-24 23:16:26 -04:00
Alessio Gravili
934ad96a98 chore: unflake lexical 2024-03-22 17:09:06 -04:00
Alessio Gravili
2c68f8fba1 chore: unflake access-control, fix incorrect poll & toPass timeouts 2024-03-22 16:42:41 -04:00
Elliot DeNolf
c90de87f37 ci: release script updates 2024-03-22 16:32:23 -04:00
Elliot DeNolf
ab84566d86 ci(deps): update turborepo 2024-03-22 16:19:29 -04:00
Alessio Gravili
4c109a467f chore: AdminUrlUtil: add ?limit=10 to list view url generator, as it would automatically redirect anyways. Had potential for flaky tests 2024-03-22 15:59:03 -04:00
Alessio Gravili
bc4f6aaf9c chore: improve id type of adminUrlUtil 2024-03-22 15:46:01 -04:00
Alessio Gravili
cf8ac7e8b3 chore: fix no-flaky-assertions not working withing .toPass callbacks 2024-03-22 15:41:10 -04:00
Alessio Gravili
3a9b230aef chore: fix payload/no-flaky-assertions not working for chained assertions (e.g. .not.toBe() instead of just .toBe()) 2024-03-22 15:33:02 -04:00
Alessio Gravili
016b644d86 fix: do not error if row field has no fields (#5433) 2024-03-22 14:29:13 -04:00
Elliot DeNolf
7082b47856 chore(release): v3.0.0-alpha.49 [skip ci] 2024-03-22 12:58:47 -04:00
Elliot DeNolf
57ec382102 Merge pull request #5430 from payloadcms/fix/alpha/more-release-fixes
chore: add back live-preview packages to tsconfig paths
2024-03-22 12:49:41 -04:00
Elliot DeNolf
9748ed2259 chore(ui): tsconfig cleanup 2024-03-22 12:39:21 -04:00
Elliot DeNolf
6ec5981f1d chore: dev app live-preview fix 2024-03-22 12:38:55 -04:00
Elliot DeNolf
e20ea342c2 chore: more specific prettierignore 2024-03-22 12:38:25 -04:00
Alessio Gravili
2ff3603245 fix: unnecessary data fetching for /create operation causing failed network request (#5431) 2024-03-22 12:16:29 -04:00
Elliot DeNolf
da6e8f14d6 chore: add back live-preview packages to tsconfig paths 2024-03-22 10:58:05 -04:00
Elliot DeNolf
2dd04739b5 Merge pull request #5428 from payloadcms/fix/alpha/release-fixes
fix: alpha release fixes
2024-03-22 10:47:38 -04:00
Alessio Gravili
8e758ea979 chore: new payload/no-flaky-assertions and payload/no-wait-function eslint rules (#5425) 2024-03-22 10:12:40 -04:00
Elliot DeNolf
a81f7e2a24 chore(eslint): add no-jsx-import-statements custom rule (#5420) 2024-03-22 02:08:49 -04:00
Elliot DeNolf
c98ec3658c chore: add /uploads pointer files 2024-03-21 22:23:49 -04:00
Elliot DeNolf
249463f7df chore: remove unused copyfiles:api 2024-03-21 22:10:36 -04:00
Elliot DeNolf
700e77ad43 chore(scripts): script:pack for packing to destination 2024-03-21 17:25:01 -04:00
Jacob Fletcher
1a272879f1 fix(ui): passes initCollapsed through collapsible field map (#5417) 2024-03-21 17:15:21 -04:00
Elliot DeNolf
aa6cb4f25b fix(next): prod css output webpack 2024-03-21 17:09:15 -04:00
Elliot DeNolf
59eec36746 fix: no export * allowed in client 2024-03-21 17:08:46 -04:00
Elliot DeNolf
45baff403a fix: plugin-db exports 2024-03-21 17:08:07 -04:00
Jacob Fletcher
5de1883390 fix(ui): ensures row label context exists for collapsible fields (#5416) 2024-03-21 16:41:35 -04:00
Alessio Gravili
35b0d213a6 fix: move form data retrieval logic to client (#5411)
* fix: only execute onChange if form modified

* fix: move document loading logic from RSC to DocumentInfoProvider

* fix: make it work for globals

* chore: remove unnecessary diffs

---------

Co-authored-by: Jarrod Flesch <jarrodmflesch@gmail.com>
2024-03-21 16:38:12 -04:00
Elliot DeNolf
774a4b7533 fix: bad publishConfig for ui and translations 2024-03-21 16:12:33 -04:00
Elliot DeNolf
11cbb774bc chore: update codeowners file 2024-03-21 14:16:19 -04:00
Elliot DeNolf
0f7d0a03d9 chore: remove unused release-it config 2024-03-21 14:16:06 -04:00
Elliot DeNolf
cb568a1af4 chore: put @payload-config back to default 2024-03-21 12:54:23 -04:00
Elliot DeNolf
f4da03d840 Merge pull request #5409 from payloadcms/test/misc-fixes
test: add build:tests command, misc test and export fixes
2024-03-21 12:53:19 -04:00
Elliot DeNolf
e5cc8123b9 chore: tsconfig.json conflicts 2024-03-21 12:38:04 -04:00
Elliot DeNolf
cc13e1210d chore: comment out non-functioning generateGraphQLSchema test/ script 2024-03-21 12:34:22 -04:00
Jacob Fletcher
1e838f2e55 Merge pull request #5407 from payloadcms/fix/misc-fields
fix(ui): misc fields
2024-03-21 12:18:16 -04:00
Jacob Fletcher
154d4170cc chore: fixes import paths 2024-03-21 12:08:30 -04:00
Jacob Fletcher
64d6163f13 chore(ui): consolidates field label, error, and description components 2024-03-21 12:08:20 -04:00
Jacob Fletcher
85ffc5d8bf fix(ui): renders default group field labels and reduces field margins 2024-03-21 12:06:59 -04:00
Jacob Fletcher
38f36d465c fix(ui): disables adding id to nested field maps 2024-03-21 12:06:45 -04:00
Jacob Fletcher
d956055795 fix(ui): renders custom row labels 2024-03-21 12:06:32 -04:00
Elliot DeNolf
c1e1cd0596 test: misc test dir type fixes 2024-03-21 11:51:29 -04:00
Elliot DeNolf
a3df2ca0ef chore(ui): export EditView 2024-03-21 11:50:20 -04:00
Elliot DeNolf
6b3325d0ba test: remove root:true from test config 2024-03-21 11:49:35 -04:00
Elliot DeNolf
9e4dd44a2e test: proper turbo filter on test typecheck 2024-03-21 11:49:09 -04:00
Elliot DeNolf
e880588aac test: add -o flag to dev to open admin 2024-03-21 11:39:27 -04:00
Elliot DeNolf
c2af3df331 test: force @payload-config back to _community 2024-03-21 11:29:40 -04:00
Elliot DeNolf
46be6e37dc test: fix auth jwt call 2024-03-21 11:08:41 -04:00
Elliot DeNolf
5165077bc9 chore: getFileByPath to named export 2024-03-21 10:18:08 -04:00
Alessio Gravili
5ae537f23c Merge pull request #5393 from payloadcms/fix/auth-test-suite
fix: new playwright eslint rules, fix flakes in auth test suite and helpers.ts, add auth suite to CI
2024-03-20 23:48:17 -04:00
Alessio Gravili
5f572dbd04 chore: unflake auth e2e tests 2024-03-20 23:28:56 -04:00
Alessio Gravili
d511e80b01 chore: new payload/no-relative-monorepo-imports eslint rule 2024-03-20 23:03:09 -04:00
Alessio Gravili
27dfa41b67 chore: custom eslint rule which complains about flaky non-retryable playwright assertions 2024-03-20 22:51:27 -04:00
Alessio Gravili
f55c28352e chore: delayNetwork helper function for playwright 2024-03-20 21:49:48 -04:00
Alessio Gravili
a7b884d170 Merge remote-tracking branch 'origin/alpha' into fix/auth-test-suite 2024-03-20 19:23:14 -04:00
Dan Ribbens
fd4f996c30 fix: skip validation for other locales when duplicating (#5394)
* fix: skip validation for other locales when duplicating

* fix: duplicate document errors toast
2024-03-20 16:58:31 -03:00
Jacob Fletcher
c897037b7a Merge pull request #5391 from payloadcms/chore/optimize-comp-map
chore: optimize the component map
2024-03-20 15:40:53 -04:00
Elliot DeNolf
11fe64eee3 ci: adjust e2e artifacts path 2024-03-20 15:26:16 -04:00
Jacob Fletcher
6cbc0f0304 Merge branch 'alpha' into chore/optimize-comp-map 2024-03-20 15:19:26 -04:00
Jacob Fletcher
b3d28bac6a chore(ui): client-side renders all default field labels, descriptions, and errors 2024-03-20 15:18:05 -04:00
Alessio Gravili
96833bdf89 chore: run auth test suite in CI 2024-03-20 14:35:32 -04:00
Patrik
6cf5730bcb test: passing json fields test suite (#5389)
* test: passing json fields test suite

* test: actually gets json tests to pass
2024-03-20 14:21:58 -04:00
Jarrod Flesch
e5403f8dfd fix: return state inside whereBuilder reducer (#5392) 2024-03-20 14:09:04 -04:00
Jarrod Flesch
8278992feb feat(alpha): list view improvements, querying, ssr data loading (#5390) 2024-03-20 13:48:35 -04:00
Jacob Fletcher
9f690c1f5d chore(ui): client-side renders table column headings 2024-03-20 13:47:59 -04:00
Jacob Fletcher
b946f7e697 chore(ui): client-side renders all default cells 2024-03-20 13:11:12 -04:00
Jacob Fletcher
c9dea854f6 fix(ui): removes duplicative hidden field from block rows (#5387)
* fix(ui): removes duplicative hidden field from block rows

* fixes proper file
2024-03-20 14:06:29 -03:00
Jacob Fletcher
e72dfe5af2 chore(ui): excludes preferences and migrations collections from component map 2024-03-20 12:58:45 -04:00
Elliot DeNolf
d5912a53f4 ci: cancel in-progress runs of same ref (#5384) 2024-03-20 12:57:45 -04:00
Patrik
cb5d005e68 test: passing array fields test suite (#5383)
* test: array tests passing except bulk update

* test: passing array fields test suite
2024-03-20 12:00:56 -04:00
Elliot DeNolf
0dd0f39250 Merge pull request #5368 from payloadcms/newtests
chore: get e2e and dev to work with test as new root directory
2024-03-20 11:24:46 -04:00
Alessio Gravili
9c7e250109 fix all imports in tests 2024-03-20 11:09:22 -04:00
Alessio Gravili
ca103b6af3 fixes 2024-03-20 11:03:59 -04:00
Alessio Gravili
2f75ee9472 fixes 2024-03-20 10:59:29 -04:00
Alessio Gravili
7eab38afa7 fixes 2024-03-20 10:53:33 -04:00
Alessio Gravili
68d0a442e4 fixes 2024-03-20 10:52:21 -04:00
Alessio Gravili
ee2b6d3b85 fix jsx imports 2024-03-20 10:41:30 -04:00
Alessio Gravili
e73220e069 chore: fix build errors 2024-03-20 10:30:46 -04:00
Alessio Gravili
d2a1404f04 Merge remote-tracking branch 'origin/alpha' into newtests 2024-03-20 10:26:35 -04:00
Alessio Gravili
c8a7eb4988 fix: next webpack config entry path 2024-03-20 10:09:20 -04:00
Alessio Gravili
7ec37e058e chore: adjust imports for richtext-slate 2024-03-20 10:07:30 -04:00
Alessio Gravili
64f2d2a502 fix: debugging by moving app dir out of test 2024-03-20 09:48:05 -04:00
Elliot DeNolf
6afb4ccf26 Merge pull request #5381 from payloadcms/chore/build-fixes
chore: build fixes
2024-03-20 03:52:13 -04:00
Elliot DeNolf
a4676d1fea chore: more next build fixes 2024-03-20 03:35:50 -04:00
Elliot DeNolf
97173de555 ci: remove auth e2e, passes locally but fails in CI 2024-03-20 03:17:56 -04:00
Elliot DeNolf
9e6d01b2a1 chore: fix ui build 2024-03-20 03:17:12 -04:00
Jacob Fletcher
d3a5437079 Merge pull request #5379 from payloadcms/fix/radio-map
fix(ui): radio field map
2024-03-19 23:46:50 -04:00
Jacob Fletcher
b22a03a317 fix(ui): builds radio fields in component map 2024-03-19 23:40:35 -04:00
Jacob Fletcher
06cd13aef2 chore(ui): types mapped rich text field props 2024-03-19 23:37:50 -04:00
Elliot DeNolf
25a3feb2ca chore(ui): more elements default fixes 2024-03-19 18:00:58 -04:00
James
c8c3332366 Merge branch 'newtests' of github.com:payloadcms/payload into newtests 2024-03-19 17:56:50 -04:00
James
006b315120 chore: moves buildComponentMap stuff out of client file 2024-03-19 17:56:29 -04:00
Alessio Gravili
f74d6efcae Merge remote-tracking branch 'origin/newtests' into newtests 2024-03-19 17:43:05 -04:00
Alessio Gravili
b2d802aa85 fix testHooks paths 2024-03-19 17:42:58 -04:00
James
964a51e21d chore: ??? 2024-03-19 17:41:59 -04:00
James
4a43db06dd Merge branch 'newtests' of github.com:payloadcms/payload into newtests 2024-03-19 17:32:44 -04:00
James
3ce7fe638f chore: adds back webpack to ui if we need it 2024-03-19 17:32:32 -04:00
Alessio Gravili
c2a4d44bf4 richtext-lexical 2024-03-19 17:26:41 -04:00
James
867817f568 chore: adds scss removal plugin back to ui 2024-03-19 17:23:07 -04:00
James
46a56a236f Merge branch 'newtests' of github.com:payloadcms/payload into newtests 2024-03-19 17:15:08 -04:00
James
6357009055 chore: finishes next dependency imports 2024-03-19 17:14:57 -04:00
Elliot DeNolf
42f7091038 chore: update ui refs next versions 2024-03-19 17:11:29 -04:00
James
a3c63fcdf0 Merge branch 'newtests' of github.com:payloadcms/payload into newtests 2024-03-19 17:00:17 -04:00
James
6b358c626f Merge branch 'newtests' of github.com:payloadcms/payload into newtests 2024-03-19 17:00:07 -04:00
Elliot DeNolf
3bbfa822d7 chore: update ui refs in plugins 2024-03-19 17:00:04 -04:00
James
a13fc138f2 chore: converts list to use specific imports 2024-03-19 16:59:57 -04:00
Jacob Fletcher
721a082758 Merge pull request #5376 from payloadcms/fix/array-paths
fix(ui): array fields
2024-03-19 16:54:50 -04:00
Alessio Gravili
07288de5a1 pnpm lock 2024-03-19 16:51:10 -04:00
Alessio Gravili
ac0bb78412 tsconfig paths to fix webstorm 2024-03-19 16:50:27 -04:00
James
c24464179b chore: progress to next 2024-03-19 16:43:30 -04:00
Jacob Fletcher
d473600a15 fix(ui): removes duplicative hidden field from array rows 2024-03-19 16:29:37 -04:00
James
accd9eaa27 chore: progress to next build 2024-03-19 16:25:19 -04:00
Jarrod Flesch
cb180cbbf8 feat: search filter in list view 2024-03-19 16:22:10 -04:00
Jarrod Flesch
a3dbe482e2 chore: fixes flattenFields function 2024-03-19 16:17:17 -04:00
James
959302a868 chore: progress to next 2024-03-19 16:16:08 -04:00
Dan Ribbens
95be2b55f7 fix: duplicate locales (#5371)
* fix: duplicate documents with locales

* fix: duplicate execute access data
2024-03-19 17:08:14 -03:00
James
3bce86a1e8 chore: progress to next repo 2024-03-19 15:58:17 -04:00
James
dd10931316 chore: buildable ui 2024-03-19 15:52:38 -04:00
James
f5b8f5a6f8 chore: merge 2024-03-19 15:44:23 -04:00
James
65fddc5d28 chore: resolve build issues 2024-03-19 15:43:57 -04:00
Elliot DeNolf
d3ac843249 chore: rename Header ot AppHeader from usage 2024-03-19 15:43:16 -04:00
Elliot DeNolf
1b5f4f5c3c chore: EditMany FormProps ref 2024-03-19 15:42:57 -04:00
Alessio Gravili
1af558af44 chore: fix incorrect import in tests 2024-03-19 15:40:37 -04:00
Elliot DeNolf
b3b36f3340 chore(ui): more elements rework to EditMany 2024-03-19 15:39:48 -04:00
Elliot DeNolf
4624659af6 chore(ui): more elements rework to Loading 2024-03-19 15:37:57 -04:00
Elliot DeNolf
ab649af8be chore(ui): rework elements end to PerPage 2024-03-19 15:37:57 -04:00
James
c5491e6f27 chore: linting useThumbnail 2024-03-19 15:36:29 -04:00
James
b47b5ddb05 chore: more progress to elements 2024-03-19 15:30:07 -04:00
James
095799a816 chore: merge 2024-03-19 15:24:52 -04:00
James
1104b6daa4 chore: progress to element exports 2024-03-19 15:23:22 -04:00
Alessio Gravili
4ecd811302 adjust providers 2024-03-19 15:18:58 -04:00
Alessio Gravili
b112ccd6d8 templates and graphics 2024-03-19 15:11:08 -04:00
Jacob Fletcher
bee32f9898 fix(ui): takes context as precedent when determining field paths 2024-03-19 15:09:02 -04:00
Alessio Gravili
69fce590e3 graphics 2024-03-19 14:57:31 -04:00
Alessio Gravili
c51ed43a10 fix: access control test suite & add it to CI (#5372) 2024-03-19 14:47:16 -04:00
James
fd51511380 chore: merge 2024-03-19 14:44:28 -04:00
James
8a054d8cc9 chore: moves fields, preps for individual export 2024-03-19 14:43:46 -04:00
Alessio Gravili
91731896c4 providers 2024-03-19 14:25:16 -04:00
Paul
e897d04218 fix: not-found being squished (#5369) 2024-03-19 13:32:30 -03:00
James
69e4de6ba9 Merge branch 'newtests' of github.com:payloadcms/payload into newtests 2024-03-19 12:24:38 -04:00
James
6b176066ec chore: progress to removing barrel file reliance 2024-03-19 12:23:57 -04:00
Alessio Gravili
4c372962fc fix publishConfig 2024-03-19 11:39:25 -04:00
Jacob Fletcher
001f386244 chore: splits client config into separate files (#5367) 2024-03-19 11:38:33 -04:00
Alessio Gravili
5eb73e0c05 remove unnecessary TypeScript import 2024-03-19 11:34:22 -04:00
Alessio Gravili
3347f92414 stuff 2024-03-19 11:33:32 -04:00
Alessio Gravili
72c6200f17 get e2e and dev to work with test as new root directory 2024-03-19 11:31:50 -04:00
Dan Ribbens
ed01ee1e2d feat: duplicate doc moved from frontend to backend concern (#5342)
BREAKING CHANGE: collection.admin.hooks.beforeDuplicate removed and instead should be handled using field beforeDuplicate hooks which take the full field hook arguments.

* feat: duplicate doc moved from frontend to backend concern

* feat: default beforeDuplicate hook functions on unique fields

* docs: beforeDuplicate field hook

* test: duplicate doc local api

* chore: fix build errors

* chore: add access.create call to duplicate operation

* chore: perfectionist reorder imports
2024-03-19 11:25:19 -04:00
Jacob Fletcher
b259bc60a2 Merge pull request #5358 from payloadcms/chore/select-labels
fix(ui): renders select options labels from component map and migrates SanitizedConfig to ClientConfig types
2024-03-19 10:19:55 -04:00
Jacob Fletcher
772d5e10b8 chore: migrates from SanitizedConfig to ClientConfig types where necessary 2024-03-19 10:18:20 -04:00
Jacob Fletcher
7e96560fbb chore(ui): adds disableBulkEdit and unique to field map 2024-03-19 10:18:08 -04:00
Jacob Fletcher
6ae5e11c6f fix(ui): renders label from component map in select field 2024-03-19 10:14:06 -04:00
Alessio Gravili
9877fe2eed chore: add test directory to package.json workspaces directory (#5365) 2024-03-19 09:59:20 -04:00
Alessio Gravili
fe086e90a1 chore: add auth to CI (#5363) 2024-03-19 09:42:59 -04:00
Elliot DeNolf
c9958e1634 ci: disable postgres temporarily 2024-03-19 09:35:44 -04:00
Elliot DeNolf
67f7c002c9 Merge pull request #5359 from payloadcms/chore/test-dir-to-workspace
chore: add test dir to workspace
2024-03-19 08:53:37 -04:00
Paul Popus
bf7c38d8e8 chore: add escape-html to dev deps 2024-03-19 09:47:48 -03:00
Elliot DeNolf
f361d153d1 chore: suppress memory db log message if in CI 2024-03-19 02:13:09 -04:00
Elliot DeNolf
0e571c3e35 ci: ignore fields int tests for now 2024-03-19 02:13:09 -04:00
Elliot DeNolf
7857c80c79 chore: move getFileByPath to payload/uploads 2024-03-19 01:46:28 -04:00
Elliot DeNolf
99adfd2bba chore: export mapAsync, fix some packages/next refs 2024-03-19 01:34:12 -04:00
Elliot DeNolf
9a493491f1 chore: properly export getFileByPath 2024-03-19 01:24:05 -04:00
Elliot DeNolf
1ac76d7758 chore: more linting 2024-03-19 01:15:25 -04:00
Elliot DeNolf
c5ecf48d94 chore: add test/ to workspace, update most references 2024-03-19 00:59:56 -04:00
Elliot DeNolf
1e10f021b5 chore: update all package.json main, types, exports, publishConfig 2024-03-19 00:45:50 -04:00
Paul Popus
7d0bd49ae3 fix: live-preview replace goToDoc utility with correct waitForURL 2024-03-18 18:38:07 -03:00
Elliot DeNolf
d4e7cabee5 ci: comment out all e2e tests 2024-03-18 17:11:38 -04:00
Elliot DeNolf
92471b0beb chore: fix @payloadcms/ui refs in test dir 2024-03-18 16:55:27 -04:00
Paul Popus
ea713758a1 fix: remove pretest steps on live-preview e2e 2024-03-18 17:52:15 -03:00
Jacob Fletcher
9182d8d594 fix(ui): falls back custom fields as undefined instead of null 2024-03-18 16:50:15 -04:00
Elliot DeNolf
7df3434c6a ci: run e2e tests individually 2024-03-18 16:48:28 -04:00
Alessio Gravili
5e9014b2c3 chore: fix some eslint errors 2024-03-18 16:46:56 -04:00
Alessio Gravili
4d95c824f3 Merge remote-tracking branch 'origin/alpha' into alpha 2024-03-18 16:24:52 -04:00
Alessio Gravili
28d7d2544e fix: live preview aliases 2024-03-18 16:24:40 -04:00
Jacob Fletcher
decc56e54d fix: properly renders custom field components 2024-03-18 16:21:52 -04:00
Alessio Gravili
976d86ae1a fix: missing name in ID field 2024-03-18 16:06:22 -04:00
Alessio Gravili
4e650e17aa chore: remove some default exports 2024-03-18 15:50:53 -04:00
Alessio Gravili
d08d04debd fix: build errors by making getTranslation return type smarter 2024-03-18 15:48:03 -04:00
Alessio Gravili
602108b150 Merge remote-tracking branch 'origin/alpha' into alpha 2024-03-18 15:43:47 -04:00
Alessio Gravili
a9b1a2e7b7 fix: live-preview build 2024-03-18 15:43:40 -04:00
Jarrod Flesch
99f31bbc23 feat: wires up server-action for language translation loading (#5346) 2024-03-18 15:42:45 -04:00
James
6c2faf68c4 Merge branch 'alpha' of github.com:payloadcms/payload into alpha 2024-03-18 15:35:15 -04:00
James
ee8c29c5ef chore: missing getTranslation in create op 2024-03-18 15:35:04 -04:00
Alessio Gravili
26df916421 fix: issues related to Auth test suite 2024-03-18 15:30:55 -04:00
Alessio Gravili
0a8f400a59 chore: optimize test/tsconfig for import suggestions within test suite 2024-03-18 15:21:04 -04:00
Alessio Gravili
cc1cbd1ed7 chore: add back test/tsconfig.json and upgrade @types/node 2024-03-18 14:56:13 -04:00
Alessio Gravili
034e85aa87 fix: APIKey Component validation and React Element handling inside getTranslation 2024-03-18 14:32:17 -04:00
James
12e54e189a Merge branch 'alpha' of github.com:payloadcms/payload into alpha 2024-03-18 14:28:04 -04:00
James
5eaea1c7f1 chore: moves live preview test suite into main app folder 2024-03-18 14:27:56 -04:00
Jacob Fletcher
10786c6ca8 fix(ui): client-side hidden fields 2024-03-18 14:26:35 -04:00
Jacob Fletcher
55d9377403 chore(ui): client-side renders all default fields (#5357) 2024-03-18 12:51:39 -04:00
James
70f29785ca chore: removes unused prop 2024-03-18 12:19:32 -04:00
James
e197c5120d Merge branch 'alpha' of github.com:payloadcms/payload into alpha 2024-03-18 12:17:59 -04:00
James
2cf72aea81 chore: fixes mongodb memory server timeout issues 2024-03-18 12:17:43 -04:00
Alessio Gravili
30111bb125 chore: push updated translation files 2024-03-18 12:04:34 -04:00
Alessio Gravili
7d38f6b074 chore: upgrade TypeScript from 5.2.2 to 5.4.2 2024-03-18 12:02:00 -04:00
Paul Popus
7e625b8e9e fix: fieldComponentProps undefined error in mapFields 2024-03-18 12:22:34 -03:00
James
152eea3cb8 chore: removes unused prop 2024-03-18 11:18:26 -04:00
James
ee72b1be5d Merge branch 'alpha' of github.com:payloadcms/payload into alpha 2024-03-18 11:04:05 -04:00
James
605d96b71b chore: avoids passing fieldTypes in buildComponentMap 2024-03-18 11:03:14 -04:00
Alessio Gravili
8e1c7d955f chore: add back --no-deprecation to dev script 2024-03-18 10:57:42 -04:00
Alessio Gravili
8046b5675f fix: do not break default edit view if there is no user 2024-03-18 10:54:09 -04:00
James
0ac8a39c5e Merge branch 'alpha' of github.com:payloadcms/payload into alpha 2024-03-18 10:36:53 -04:00
James
81522b33e6 chore: removes setOnSave from DocumentInfo, refreshes cookie when saving user 2024-03-18 10:36:13 -04:00
Paul Popus
4df49689a9 chore: add csrf and cors config to live preview 2024-03-18 10:29:11 -03:00
Elliot DeNolf
0f7106bf4a ci: bump actions/upload-artifact 2024-03-16 19:43:16 -04:00
Elliot DeNolf
900c5b7661 chore: remove unnecessary tsconfigs 2024-03-16 10:33:42 -04:00
Elliot DeNolf
5cac4c953d test: fix missing awaits in E2E 2024-03-16 10:26:51 -04:00
Elliot DeNolf
65f2cb9a22 chore: rename configHelpers to match function name 2024-03-16 10:18:34 -04:00
Elliot DeNolf
7ddb68b70d test: fix some easy eslint errors 2024-03-16 10:15:09 -04:00
Elliot DeNolf
14eb66c87d test: refactor int tests to use initPayloadInt which reduces boilerplate 2024-03-16 10:11:00 -04:00
Elliot DeNolf
ef141d499b ci: bump all actions to use Node 20. 16 is deprecated. 2024-03-16 07:35:27 -04:00
Elliot DeNolf
1ab27e8fe3 test: update packages/ test configs 2024-03-16 07:34:49 -04:00
Elliot DeNolf
145a3b7ee4 ci: update paths-filter 2024-03-16 07:19:02 -04:00
Elliot DeNolf
a042327741 chore: sync pnpm-lock.yaml 2024-03-16 07:16:29 -04:00
Elliot DeNolf
4eba651c3d test: refine testHooks 2024-03-16 07:00:38 -04:00
Elliot DeNolf
ba3b2ea66f chore: script cleanup 2024-03-16 06:52:55 -04:00
Elliot DeNolf
c48719dfdb test: fix next/link import 2024-03-16 06:46:30 -04:00
Elliot DeNolf
1680f0ef52 chore: cleanup 2024-03-16 06:45:54 -04:00
Elliot DeNolf
ae6c4b2ddf test: remove typescript declare from test suite type output 2024-03-16 06:45:32 -04:00
Elliot DeNolf
8e9192181d chore: remove node warnings 2024-03-16 06:43:55 -04:00
Elliot DeNolf
a2f2a59c21 test: rework jest setup to use setupFilesAfterEnv 2024-03-16 06:40:20 -04:00
Elliot DeNolf
e739c26f2e chore: rework test hooks to reset tsconfig.json 2024-03-16 06:37:30 -04:00
Jacob Fletcher
b215eae914 chore(ui): exports missing FieldType and Options 2024-03-16 01:10:09 -04:00
Elliot DeNolf
1123e4e751 ci: disable tests-type-generation job 2024-03-15 17:50:57 -04:00
Elliot DeNolf
203bc26c0e ci: disable templates job 2024-03-15 17:46:07 -04:00
Jacob Fletcher
fb4651bdad chore(ui): strictly types fields (#5344) 2024-03-15 17:41:48 -04:00
Elliot DeNolf
09f2926bbb test(plugin-cloud): update jest config for esm 2024-03-15 17:28:39 -04:00
Jarrod Flesch
eef06425a3 chore: passing versions e2e (#5343) 2024-03-15 17:09:32 -04:00
Alessio Gravili
b329e3c43c fix: browser console warning: Skipping auto-scroll behavior due to position: sticky or position: fixed on element 2024-03-15 17:02:41 -04:00
Elliot DeNolf
04a3223ff5 test: fix seed helper, was causing errors in versions suite 2024-03-15 16:55:54 -04:00
Elliot DeNolf
9226be058c test: fix useField imports 2024-03-15 16:02:27 -04:00
PatrikKozak
2dc425b083 test: updates text field config imports to relative imports 2024-03-15 15:54:54 -04:00
James
c5f915651c Merge branch 'alpha' of github.com:payloadcms/payload into alpha 2024-03-15 15:30:56 -04:00
James
e2d7fec793 chore: merge 2024-03-15 15:30:29 -04:00
Paul Popus
d3b4f46b25 fix: further fixes for live preview 2024-03-15 16:30:00 -03:00
James
6311156169 chore: optimizes buildFormState by passing prefs from admin 2024-03-15 15:28:05 -04:00
Elliot DeNolf
695a814eb3 ci: explicitly install playwright 2024-03-15 15:17:05 -04:00
Elliot DeNolf
5ef2e35685 test: fix mongodb destroy 2024-03-15 15:11:04 -04:00
Alessio Gravili
8818ed9d7b fix: document permissions not working for Document Drawers 2024-03-15 15:06:55 -04:00
Paul Popus
d785af1826 fix: core fixes to the live-preview e2e test suite 2024-03-15 15:36:58 -03:00
Alessio Gravili
398811a14e fix: Document Drawers triggered from relationship fields were requesting form state from field schemaPath rather than the actual, requested collection 2024-03-15 14:32:12 -04:00
Patrik
c5f9533d2b test: passing text field suite (#5341) 2024-03-15 14:27:43 -04:00
Alessio Gravili
aaf17aa2b2 chore: e2e tests: get nav-toggler helpers to work on all screen sizes 2024-03-15 13:43:48 -04:00
Elliot DeNolf
3e11379e6c chore: add jest runner to extensions 2024-03-15 13:24:54 -04:00
Elliot DeNolf
f78d0b7c7a chore: add proper playwright ext to extensions.json 2024-03-15 13:21:55 -04:00
Elliot DeNolf
978e19c817 test: fix custom-graphql beforeAll 2024-03-15 12:19:00 -04:00
Alessio Gravili
1550e32282 chore: keep sync and ui next versions in sync. Only the monorepo next version has to be different 2024-03-15 11:53:31 -04:00
Alessio Gravili
7fb2dc6500 chore: fix playwright by making sure ui uses a different next version than anything else 2024-03-15 11:50:57 -04:00
Alessio Gravili
92654af609 fix: properly type getPreferences and update richtext-lexical's block collapsed handling to match that type 2024-03-15 10:53:32 -04:00
Alessio Gravili
c10787dbb3 chore: fix ts-eslint not being able to work with types imported across packages 2024-03-15 10:46:14 -04:00
Elliot DeNolf
4fecb7fad9 chore(richtext-lexical): do not pass DefaultCell 2024-03-15 10:23:39 -04:00
Elliot DeNolf
01a121868b revert(db-mongodb): add back 'as any' removed during lint 2024-03-15 10:13:48 -04:00
Paul Popus
a023009dee fix: not returning not found when fetching docPermissions when id doesnt exist 2024-03-15 11:09:06 -03:00
Paul Popus
e301393f33 fix: add conditional for getCustomViewByRoute 2024-03-15 10:26:55 -03:00
Alessio Gravili
39600fb0f5 fix(eslint-config-payload): get eslint-config-prettier to work properly by moving it to the end of the extends array 2024-03-15 09:22:28 -04:00
Paul Popus
663cde7676 chore: track website media pictures 2024-03-15 10:06:07 -03:00
Elliot DeNolf
dac771c096 Merge pull request #5337 from payloadcms/alpha-lint-prettier
chore: eslint improvements, run eslint & prettier everywhere
2024-03-15 08:58:24 -04:00
Alessio Gravili
b8b1d572b4 chore: add lint & prettier commit to .git-blame-ignore-revs 2024-03-14 23:55:05 -04:00
Alessio Gravili
6789e61488 chore: run lint & prettier on everything 2024-03-14 23:53:47 -04:00
Alessio Gravili
051fdfb081 chore: more eslint rule improvements 2024-03-14 23:40:07 -04:00
Alessio Gravili
1f07a827ec chore: remove unused eslint-plugin-import 2024-03-14 23:17:43 -04:00
Alessio Gravili
81618d2efc chore: eslint: turn off react/jsx-one-expression-per-line rule which is conflicting with prettier 2024-03-14 22:54:59 -04:00
Alessio Gravili
6f44a88ffd chore: add @typescript-eslint/no-unnecessary-type-constraint rule to warn-only 2024-03-14 22:51:49 -04:00
Alessio Gravili
4300c3d550 chore: add missing .prettierignore files. Without them, folders like "dist" would not be excluded on a package-level despite a root-level .prettierignore being present 2024-03-14 22:48:27 -04:00
Alessio Gravili
5fbf7b3d24 chore: improve pre-defined eslint ignorePatterns 2024-03-14 22:44:31 -04:00
Alessio Gravili
eb5899c94b chore: upgrade all eslint packages, fix incorrect override for test/eslintrc 2024-03-14 22:40:08 -04:00
Alessio Gravili
5e68fa1255 chore: change eslint sharedRules to baseRules to match baseExtends 2024-03-14 22:20:33 -04:00
Alessio Gravili
f1c322fe69 chore: narrow down eslint included files, change some rules to warn-only instead of erroring 2024-03-14 22:18:35 -04:00
Alessio Gravili
580520f100 chore: add back relaxed eslint rules for tests 2024-03-14 21:22:30 -04:00
Alessio Gravili
40343df255 fix(richtext-lexical): createHeadlessEditor import 2024-03-14 17:04:29 -04:00
Alessio Gravili
57f8b427db fix(richtext-lexical): remove Lazy field & cell components, which fixes RSC errors, likely due to RSC bug where React.lazy's are not handled properly 2024-03-14 17:01:14 -04:00
Jacob Fletcher
f85e96acac fix(ui): executes filterOptions on the server (#5335) 2024-03-14 16:53:24 -04:00
Alessio Gravili
bff83f1785 chore: upgrade next 2024-03-14 16:47:57 -04:00
Alessio Gravili
ca27748799 fix(richtext-lexical): get sub-block-lexical fields to work 4 out of 5 times 2024-03-14 16:42:08 -04:00
Paul Popus
2dc98f682f fix: issue with community post type 2024-03-14 17:01:33 -03:00
Paul Popus
d4f3309ffd fix: rowLabel for array field and collapsible field to support client side components 2024-03-14 16:59:33 -03:00
Elliot DeNolf
821777bd64 chore: remove redundant token deletion 2024-03-14 15:52:47 -04:00
Kendell Joseph
84c2fa9491 fix: forgot password view (#5322) 2024-03-14 15:46:42 -04:00
Dan Ribbens
d193c677c7 chore: attach mongoMemoryServer to db and destroy in tests (#5326)
* chore: attach mongoMemoryServer to db and destroy in tests

* bump mongodb-memory-server to 9.x

---------

Co-authored-by: Paul Popus <paul@nouance.io>
2024-03-14 15:41:20 -04:00
Jacob Fletcher
cbfc7c8b43 docs: adds jsdocs for filterOptions and syncs docs 2024-03-14 15:00:17 -04:00
Jacob Fletcher
6a43065316 chore: sanitizes live preview url from client config 2024-03-14 14:30:44 -04:00
Jacob Fletcher
9dd390f7a7 chore: more strictly types client config 2024-03-14 14:17:11 -04:00
Elliot DeNolf
6c631cb11e test: jest debug-compatible pluralize import 2024-03-14 13:58:06 -04:00
Elliot DeNolf
817b790757 ci: add github-actions jest reporter 2024-03-14 13:32:05 -04:00
James
98aa8cc22a Merge branch 'feat/doc-permissions' into alpha 2024-03-14 13:03:13 -04:00
James
e9e228abaf chore: builds 2024-03-14 13:02:06 -04:00
Jacob Fletcher
909bb6f6cf chore: sanitizes admin hooks from client config 2024-03-14 12:20:25 -04:00
Elliot DeNolf
e8b47eef2f chore(plugin-sentry): migrate esm, remove webpack 2024-03-14 12:15:58 -04:00
Paul Popus
415ba26efe fix: openNav selector in test helpers 2024-03-14 13:11:52 -03:00
Elliot DeNolf
777e2744c4 test(plugin-seo): proper import and lint 2024-03-14 11:54:54 -04:00
Elliot DeNolf
53a09f4989 chore(create-payload-app): migrate to esm, adjust init-next tests 2024-03-14 11:12:28 -04:00
Alessio Gravili
e3e0f056a9 chore: auth test suite lint & prettier 2024-03-14 10:48:48 -04:00
Alessio Gravili
b6ce1fbd51 chore: downgrade next version of ui to fix e2e tests 2024-03-14 10:35:23 -04:00
Alessio Gravili
7267cfdbfc chore: make sure installed next versions match everywhere 2024-03-14 10:16:32 -04:00
Jacob Fletcher
fa259aa194 fix(next): custom edit view base override 2024-03-14 10:06:35 -04:00
Patrik
da1d2873d5 chore: adds blank 3.0 template (#5330) 2024-03-14 09:59:36 -04:00
James
be88d278c6 chore: builds 2024-03-13 22:22:15 -04:00
Jacob Fletcher
81cb8c83bf fix(ui): renders versions tab count only when docs exist 2024-03-13 17:39:50 -04:00
Paul Popus
eee44a9919 fix: helper.ts issues with changing locales in tests 2024-03-13 18:17:00 -03:00
Jacob Fletcher
4f730410bc fix(next): custom root views (#5321) 2024-03-13 17:15:38 -04:00
Paul Popus
171144be80 fix: tests running with local API imported from the payload package instead of the HMR from the next package 2024-03-13 18:01:11 -03:00
Alessio Gravili
5c2bcba000 fix: document view issues (#5324)
* fix: cannot get versions view for globals, return Unauthorized view if you are unauthorized instead of the Not Found view for document edit views. This makes it match the API

* chore: ensure there is always an error view to render if needed
2024-03-13 16:59:40 -04:00
Paul
5b5c6e975d fix: redirect issue when creating a post in a different locale and being redirected to the default locale on submit (#5323)
* fix: redirect issue when creating a post in a different locale and being redirected to the default locale on submit

* style fixes
2024-03-13 17:25:05 -03:00
Alessio Gravili
45110f60c3 chore: ignore flaky "Failed to fetch RSC payload for" browser console error in playwright 2024-03-13 15:36:47 -04:00
Jarrod Flesch
26c434c4ee chore: implements clearRouteCache in other list actions 2024-03-13 15:25:36 -04:00
Alessio Gravili
2e872d4818 chore: add className to unauthorized component to appease access control e2e test selectors 2024-03-13 15:14:07 -04:00
Elliot DeNolf
30a1219f9d ci: release script outputs stderr on publish 2024-03-13 15:06:02 -04:00
Alessio Gravili
cf1632f80b chore: db init & destroy type improvements. No need to pass in payload again, as the functions already have access to it through the adapter 2024-03-13 15:04:16 -04:00
Alessio Gravili
885b003730 chore: payload HMR type & globals improvements 2024-03-13 15:02:55 -04:00
Paul Popus
a9a61b2617 fix: locales not using fallbackLocale in the admin UI and re-rendering issue when changing locales 2024-03-13 15:51:46 -03:00
Elliot DeNolf
b968d8594c ci: proper mongodb memory server configuration (#5318)
* ci: mongo memory server instance

* test: use proper mongo memory opts

* chore: rollback mongodb-memory-server dep

* chore: more mongodb-memory-server
2024-03-13 14:44:12 -04:00
Jarrod Flesch
d7ebb871bb feat: adds routerCache provider 2024-03-13 14:33:03 -04:00
Alessio Gravili
6f67b2381a fix: missing collection permission redirect to unauthorized view 2024-03-13 14:32:20 -04:00
James
2237d7e860 Merge branch 'alpha' of github.com:payloadcms/payload into alpha 2024-03-13 13:59:53 -04:00
James
6ea456d6da chore: reduces date-fns locales loaded 2024-03-13 13:59:38 -04:00
Alessio Gravili
f0a2edf7cf chore: fix dev script 2024-03-13 13:07:55 -04:00
Jarrod Flesch
881fcd4e9b chore: alter @payload-config tsconfig for e2e tests 2024-03-13 13:01:28 -04:00
Alessio Gravili
8954af5c53 chore: automatically adjust tsconfig @payload-config path when running e2e tests 2024-03-13 12:32:06 -04:00
Elliot DeNolf
e3c6d5859b chore(eslint): properly order overrides 2024-03-13 12:10:54 -04:00
Paul Popus
16441b5b6a chore: add playwright ext to .vscode 2024-03-13 13:01:36 -03:00
Paul Popus
195b1ccfcc chore: remove npx playwright install from test:e2e command 2024-03-13 12:55:21 -03:00
Elliot DeNolf
b3f5670cc0 chore(eslint): properly spread shared rules 2024-03-13 11:53:11 -04:00
Elliot DeNolf
e43c80b4f5 chore(eslint): shared rules 2024-03-13 11:50:58 -04:00
Alessio Gravili
931e2f6134 chore(eslint-config-payload): more granular eslint config (#5315) 2024-03-13 11:05:28 -04:00
Paul
e091a37241 chore: update seo plugin (#5309)
* chore: update seo plugin

* fix translations export
2024-03-12 18:47:14 -03:00
Paul
5f093846a7 chore: add admin access control to buildFormState (#5310) 2024-03-12 18:46:41 -03:00
Alessio Gravili
dcbae0618c chore: rename getPayload to getPayloadHMR 2024-03-12 17:16:48 -04:00
Dan Ribbens
4d70d6319b chore: reduce db io by optimizing internal calls (#5302) 2024-03-12 16:31:02 -04:00
Dan Ribbens
09484667f0 chore: relationships int test race condition 2024-03-12 16:30:06 -04:00
Dan Ribbens
04fcf57d0a Fix/alpha/int tests (#5311)
* chore: converts dynamic imports to esm require

* chore: adjusts require and import usage

* chore: reverts bin script change

* chore: adjust dataloaded tests to use slate editor

* fix: converts custom auth strategy

* chore: fixes to form builder int test config

* chore: adjusts plugin-stripe and int tests

---------

Co-authored-by: Jarrod Flesch <jarrodmflesch@gmail.com>
2024-03-12 16:27:43 -04:00
Alessio Gravili
8436dd5851 chore(plugin-cloud-storage): add proper error messages if peerDeps are not found for webpack 2024-03-12 16:15:37 -04:00
Jacob Fletcher
bbae8cccfb chore(i18n): adds authentication:createFirstUser to client translations 2024-03-12 16:08:15 -04:00
Jarrod Flesch
044fa2d10f chore: customizes req.json on payload request 2024-03-12 16:02:55 -04:00
Alessio Gravili
2dd50cccd3 chore: improve obliterate-playwright-cache command 2024-03-12 15:58:35 -04:00
Alessio Gravili
c05ffb0c6b chore: update playwright patch to work on windows 2024-03-12 15:47:04 -04:00
Jacob Fletcher
935044d2da chore(i18n): adds error:unauthorized to client translations 2024-03-12 15:13:26 -04:00
Alessio Gravili
6ec6505a5d chore: use matching aws/client-s3 version in monorepo 2024-03-12 14:58:40 -04:00
Dan Ribbens
96e0f55c61 chore(release): v3.0.0-alpha.48 [skip ci] 2024-03-12 14:51:40 -04:00
Alessio Gravili
b765f06dfd chore(plugin-cloud-storage): correct publishConfig exports again 2024-03-12 14:40:46 -04:00
Alessio Gravili
8da6318cc6 chore(plugin-cloud-storage): correct publishConfig exports 2024-03-12 14:37:31 -04:00
Dan Ribbens
0fcdec604c chore(release): v3.0.0-alpha.47 [skip ci] 2024-03-12 14:14:16 -04:00
Alessio Gravili
3edda36a91 chore(plugin-cloud-storage): update .gitignore 2024-03-12 13:56:42 -04:00
Alessio Gravili
97d65bfca0 Merge remote-tracking branch 'origin/alpha' into alpha 2024-03-12 13:54:35 -04:00
Alessio Gravili
66771c6f62 chore(plugin-cloud-storage): package.json exports and automated generation of barrel files 2024-03-12 13:54:27 -04:00
Patrik
e6b23aee18 fix(ui): field label htmlFor (#5308) 2024-03-12 13:54:00 -04:00
Alessio Gravili
5e9ee50f99 fix(plugin-cloud-storage): make sure barrel files use import instead of require 2024-03-12 13:49:54 -04:00
Jarrod Flesch
93584bc766 chore: use require if it exists on the global, else use esm import (#5305) 2024-03-12 13:32:05 -04:00
Alessio Gravili
a89180ea06 chore: make sure deprecation warnings do not happen in jest 2024-03-12 12:54:04 -04:00
Alessio Gravili
4983da7efa chore(eslint-config-payload): improve @typescript-eslint/no-unused-vars rule (#4793) 2024-03-12 12:46:47 -04:00
Jacob Fletcher
8fd6bd4c71 fix(ui): document drawer titles (#5306) 2024-03-12 12:40:15 -04:00
Alessio Gravili
c7ea62a394 fix: JSON Field: validation not working and incorrect initialValue 2024-03-12 12:38:40 -04:00
Alessio Gravili
fc8e2d3e05 chore: get eslint to scream at default exports 2024-03-12 12:01:35 -04:00
Alessio Gravili
6cf3c91293 chore: simplify onChange handling, make sure previous onChange results are passed through to a potential next onChange 2024-03-12 11:57:36 -04:00
Alessio Gravili
e122278ec4 fix: path and schemaPaths for tabs not working, renderfields schemaPath adding unnecessary dot at the end of the path if the field has no name 2024-03-12 11:30:53 -04:00
Jarrod Flesch
7c9b5cba1c chore: adds pnpm swc-plugin-transform-remove-imports to root dev deps 2024-03-12 10:36:34 -04:00
James
a86c1b7cd3 chore: error in _community e2e 2024-03-12 10:02:45 -04:00
James
dd6d08d61d Merge branch 'alpha' of github.com:payloadcms/payload into alpha 2024-03-12 10:02:08 -04:00
James
0fc120d7d5 chore: _community e2e 2024-03-12 10:01:51 -04:00
Paul Popus
6e03558dcb chore: eslint the _community code 2024-03-12 10:52:41 -03:00
Alessio Gravili
b327dd31b7 chore: fix up intellij run configs 2024-03-12 09:40:37 -04:00
Alessio Gravili
da1326a336 chore: eslint perf improvements for test suite, make use of cascading for all eslint configs to minimize duplicative rule 2024-03-12 09:15:38 -04:00
Dan Ribbens
d22cb1dfa7 chore(release): v3.0.0-alpha.46 [skip ci] 2024-03-11 17:33:49 -04:00
James Mikrut
5556915564 Merge pull request #5297 from payloadcms/fix/fixes-schema-path-issues-with-arrays-and-blocks
fix (alpha): fixes schema path issues with arrays and blocks
2024-03-11 17:18:28 -04:00
Paul Popus
4c6fc53ba5 fix (alpha): issues with wrong schemaPath in array and block fields 2024-03-11 18:15:42 -03:00
Alessio Gravili
626b6500de chore: remove deprecation warnings for int & e2e tests 2024-03-11 17:03:50 -04:00
Jacob Fletcher
dbbbb6b921 fix(ui): document drawer permissions (#5296) 2024-03-11 17:03:13 -04:00
Alessio Gravili
d9e3d4dbae Merge remote-tracking branch 'origin/alpha' into alpha 2024-03-11 15:57:43 -04:00
Alessio Gravili
92648de3b4 chore: patch playwright 2024-03-11 15:57:29 -04:00
Jacob Fletcher
4f9e5b9336 fix(ui): table cell links (#5295) 2024-03-11 15:55:44 -04:00
James Mikrut
d55d0ad621 Merge pull request #5279 from payloadcms/chore/alpha-remove-schemaOutputFile
chore (alpha): removes `schemaOutputFile` prop
2024-03-11 15:16:21 -04:00
PatrikKozak
4edbe2aace Merge branch 'alpha' of https://github.com/payloadcms/payload into chore/alpha-remove-schemaOutputFile 2024-03-11 15:10:32 -04:00
Dan Ribbens
ba2702cfca chore(release): v3.0.0-alpha.45 [skip ci] 2024-03-11 14:53:31 -04:00
James
eba1f6327d Merge branch 'alpha' of github.com:payloadcms/payload into alpha 2024-03-11 14:41:37 -04:00
James Mikrut
1ba0b4037c Merge pull request #5293 from payloadcms/fix/auth-schema-and-client-side
fix (alpha): `auth.strategies` schema and removal of auth functions from client config
2024-03-11 14:40:43 -04:00
James
49daa75bc4 chore: fixes race condition in payload hmr 2024-03-11 14:39:41 -04:00
PatrikKozak
cd21138b3d Merge branch 'alpha' of https://github.com/payloadcms/payload into chore/alpha-remove-schemaOutputFile 2024-03-11 14:05:33 -04:00
PatrikKozak
fea1eb1149 fix: removes auth strategies & forgotPassword & verify functions from client side 2024-03-11 13:56:50 -04:00
PatrikKozak
9a58f6c454 fix: updates auth schema to match updated auth types 2024-03-11 13:54:54 -04:00
James
66cefe6bb5 chore: removes auth cache, sets overrideAccess false 2024-03-11 12:21:13 -04:00
Jarrod Flesch
23510acf40 chore: sets bg on templates (#5289) 2024-03-10 23:10:37 -04:00
Jarrod Flesch
faa49f36e7 fix(alpha): correctly set redirect route when logout is triggered (#5288) 2024-03-10 22:35:06 -04:00
James
a5fb8b20a1 Merge branch 'alpha' of github.com:payloadcms/payload into alpha 2024-03-10 22:18:56 -04:00
James
e14b303609 chore: int tests 2024-03-10 22:18:48 -04:00
Dan Ribbens
2ec3df6680 chore(release): v3.0.0-alpha.44 [skip ci] 2024-03-10 22:07:16 -04:00
Elliot DeNolf
1f4b6001ef chore: run eslint on pre-commit hook 2024-03-10 22:01:15 -04:00
James
6e7c9cc6a3 Merge branch 'alpha' of github.com:payloadcms/payload into alpha 2024-03-10 21:56:06 -04:00
James
2db385c6a5 chore: requires drizzle-kit within func 2024-03-10 21:54:31 -04:00
Elliot DeNolf
bd27f48eae test: remove component test suite 2024-03-10 21:19:04 -04:00
Dan Ribbens
98a33250f6 chore(release): v3.0.0-alpha.43 [skip ci] 2024-03-10 21:11:46 -04:00
Elliot DeNolf
8f9729a928 ci: remove component tests 2024-03-10 21:10:19 -04:00
James
1a8564bc35 chore: safely import drizzle-kit 2024-03-10 19:03:15 -04:00
James
76c9632417 Merge branch 'alpha' of github.com:payloadcms/payload into alpha 2024-03-10 18:18:32 -04:00
James
2370361b43 chore: stops excluding pino and pino-pretty in webpack config 2024-03-10 18:17:57 -04:00
Dan Ribbens
cb63095d3f chore(release): v3.0.0-alpha.42 [skip ci] 2024-03-10 14:28:05 -04:00
Dan Ribbens
601f2fb450 chore: add building plugins to release 2024-03-10 14:16:45 -04:00
Alessio Gravili
e746f17167 fix: incorrect TypeScript type for getPayload() props, throw proper error if config doesn't exist 2024-03-10 14:14:29 -04:00
James
5f76097562 chore: merge playwright revisions 2024-03-10 14:08:52 -04:00
James Mikrut
03756c4210 Merge pull request #5286 from payloadcms/feat/pre-compile-css
Feat/pre compile css
2024-03-10 14:06:10 -04:00
James
5e1e158414 chore: add exports for css 2024-03-10 14:05:22 -04:00
James
76d2525fd2 chore: cleanup 2024-03-10 13:57:28 -04:00
James
ec8c7e5c2c chore: finishes css pre-compilation 2024-03-10 13:53:37 -04:00
Elliot DeNolf
0a4cbe1a08 chore: remove unused directive 2024-03-10 13:52:48 -04:00
Dan Ribbens
c228421a38 chore(plugin-form-builder): esm imports 2024-03-10 12:12:49 -04:00
Dan Ribbens
a742f82370 chore: plugins peerDependencies payload workspace 2024-03-10 11:43:13 -04:00
Dan Ribbens
213678ca3e chore(plugin-redirects): esm imports 2024-03-10 11:42:14 -04:00
Dan Ribbens
e1b7ad6a71 chore(plugin-nested-docs): esm imports 2024-03-10 11:39:41 -04:00
Dan Ribbens
8b9985a92c chore(plugin-search): payload peer dependency workspace 2024-03-10 11:32:05 -04:00
Dan Ribbens
f276826b09 chore(plugin-search): esm imports 2024-03-10 11:28:54 -04:00
geisterfurz007
8c1df551ef chore: fix typescript hallucinations (#4559) 2024-03-10 01:53:59 -05:00
Akhil Naidu
b62cb157e1 docs: improve naming for afterForgotPassword hook example code (#5062) 2024-03-10 00:23:29 -05:00
Max Morozov
045c74ce67 docs: fix typo (#5052) 2024-03-10 00:13:09 -05:00
madaxen86
911e902da4 feat: add support for displaying AVIF images (#5227) 2024-03-10 00:00:26 -05:00
Alessio Gravili
4e0d90d720 WIP 2024-03-09 18:20:32 -05:00
James
7b62705cc0 chore: restores webpack config, still broken 2024-03-09 15:55:26 -05:00
James
bdf02bebaa chore: adds spawn process to playwright tests as well 2024-03-09 14:53:53 -05:00
James
94aa309910 chore: avoids importing config into playwright tests 2024-03-09 14:41:00 -05:00
Elliot DeNolf
499a0a782a chore: adjust tgz specifier in pnpm lock 2024-03-08 21:05:00 -05:00
Elliot DeNolf
1e5a531a83 ci: add alpha branch to main workflow 2024-03-08 20:57:14 -05:00
Elliot DeNolf
3e6a4073c4 chore(scripts): cleanup release script 2024-03-08 20:56:39 -05:00
Alessio Gravili
e7cb6abd1f chore: add new obliterate-playwright-cache 2024-03-08 19:48:26 -05:00
Dan Ribbens
abfd8841a5 chore(release): v3.0.0-alpha.41 [skip ci] 2024-03-08 17:07:01 -05:00
Dan Ribbens
5e385fa33b fix(db-postgres): postgres dev push schemas 2024-03-08 17:05:10 -05:00
Jarrod Flesch
95688c7e30 chore: more test adjustments 2024-03-08 16:41:03 -05:00
Jarrod Flesch
b041d3e70e chore: fix uploads int suite 2024-03-08 16:41:03 -05:00
Jarrod Flesch
0e91cddab9 chore: fix relationships test 2024-03-08 16:41:03 -05:00
Jarrod Flesch
d3856693ce chore: fixes localization test 2024-03-08 16:41:03 -05:00
Alessio Gravili
40f36104f3 feat(ui): upgrade react-datepicker and date-fns, fix datepicker not working 2024-03-08 16:20:03 -05:00
Dan Ribbens
7215edb784 chore(release): v3.0.0-alpha.40 [skip ci] 2024-03-08 16:07:05 -05:00
PatrikKozak
189be7ce69 Merge branch 'alpha' of https://github.com/payloadcms/payload into chore/alpha-remove-schemaOutputFile 2024-03-08 15:58:45 -05:00
PatrikKozak
28f10ffc25 chore: removes schemaOutputFile prop in alpha 2024-03-08 15:58:37 -05:00
Dan Ribbens
be015320de chore(release): v3.0.0-alpha.39 [skip ci] 2024-03-08 15:57:39 -05:00
Alessio Gravili
a37d53b2e7 fix: lazy imports for DatePicker and CodeEditor 2024-03-08 15:49:40 -05:00
Jarrod Flesch
f43de11121 chore: fixes create view 2024-03-08 15:45:44 -05:00
Jacob Fletcher
4c1129188b Merge pull request #5278 from payloadcms/fix/custom-logout-button
fix(next): ssr custom logout button and icon graphic and narrows client config type
2024-03-08 15:39:00 -05:00
Dan Ribbens
34e04f5251 chore(release): v3.0.0-alpha.37 [skip ci] 2024-03-08 15:33:40 -05:00
Jacob Fletcher
b613d65b36 fix(ui): server renders custom icon 2024-03-08 15:33:27 -05:00
Dan Ribbens
66aec63f6b chore: pnpm lock 2024-03-08 15:32:23 -05:00
James
5b0d18bb3b Merge branch 'alpha' of github.com:payloadcms/payload into alpha 2024-03-08 15:31:42 -05:00
James
1c5b43c218 chore: migration fixes 2024-03-08 15:31:35 -05:00
Jacob Fletcher
c78cfb9fcf chore: narrows ClientConfig type 2024-03-08 15:21:52 -05:00
Jacob Fletcher
927d4dd06f fix(ui): server renders custom logout button 2024-03-08 15:19:53 -05:00
Dan Ribbens
afb75ef75a chore(release): v3.0.0-alpha.36 [skip ci] 2024-03-08 15:06:34 -05:00
James
92181866a4 Merge branch 'alpha' of github.com:payloadcms/payload into alpha 2024-03-08 15:04:12 -05:00
James
c97805c7f1 chore: type issue 2024-03-08 15:04:05 -05:00
Alessio Gravili
c20a139e58 chore(translations): run prettier after creating translation files 2024-03-08 15:03:24 -05:00
James
4287d1032f chore: build fix 2024-03-08 15:03:08 -05:00
Alessio Gravili
8b784d7c10 chore: remove console log 2024-03-08 14:56:02 -05:00
Alessio Gravili
8895f6420f chore: fix all esm test suite imports 2024-03-08 14:42:24 -05:00
Jarrod Flesch
bb10ed5b7d fix: sync localization data after switching locale (#5277)
Co-authored-by: James <james@trbl.design>
2024-03-08 14:40:23 -05:00
Jacob Fletcher
9dc315dbf3 fix(next): ssr custom providers (#5276) 2024-03-08 14:22:20 -05:00
Jacob Fletcher
677531531f fix: sanitizes root components from client config (#5274) 2024-03-08 14:20:50 -05:00
James
70c89b14a9 chore: builds translations as ts instead of json 2024-03-08 14:14:09 -05:00
Alessio Gravili
7f7c94e0d5 Revert "chore: imports translations in a safer manner"
This reverts commit e12e720a99.
2024-03-08 13:44:03 -05:00
Alessio Gravili
e6f09e42a1 chore: fix tsconfig for tests 2024-03-08 13:12:09 -05:00
Dan Ribbens
f0419b7502 chore(release): v3.0.0-alpha.35 [skip ci] 2024-03-08 12:57:12 -05:00
Dan Ribbens
f01072eb11 chore: test drop db 2024-03-08 12:46:29 -05:00
James
c88102d6cc Merge branch 'alpha' of github.com:payloadcms/payload into alpha 2024-03-08 12:34:01 -05:00
Alessio Gravili
847a2994f9 chore: work on e2e's 2024-03-08 12:33:44 -05:00
James
ab186c0608 chore: functional bin 2024-03-08 12:33:37 -05:00
James
349ae8ed27 chore: progress to client files in bin script 2024-03-08 12:01:58 -05:00
Jarrod Flesch
0066b858d6 fix: simplify searchParams provider, leverage next router properly (#5273) 2024-03-08 11:59:37 -05:00
James
e12e720a99 chore: imports translations in a safer manner 2024-03-08 11:24:25 -05:00
Jacob Fletcher
c17f2e2560 fix(ui): prevents missing entity permissions from crashing buildComponentMap 2024-03-08 11:17:23 -05:00
James
d75bf235bb chore: builds esm register script 2024-03-08 11:16:55 -05:00
Alessio Gravili
881d1e9594 chore: replace all __dirname's in test dir 2024-03-08 11:09:59 -05:00
Will Viles
45a443989a fix(next): missing FormQueryParamsProvider in account view (#5270)
Co-authored-by: Will Viles <will@vil.es>
2024-03-08 11:02:23 -05:00
Alessio Gravili
7880fb402a chore: playwright support (#5262)
* working playwright

* chore: use zipped, local build of playwright instead of patching it

* chore: remove bloat

* chore: get playwright and lexical to work by fixing imports from cjs modules
2024-03-08 10:56:13 -05:00
Jacob Fletcher
ac2f8c9141 fix(ui): prevents missing field permissions from crashing buildComponentMap 2024-03-08 10:32:31 -05:00
Jarrod Flesch
e36e774382 fix: requests without Content-Type failing (#5268) 2024-03-08 09:54:17 -05:00
Dan Ribbens
b1be2dfbf4 chore: add cross-env to dev scripts 2024-03-08 09:41:11 -05:00
mhjmaas
32f3a11bf7 chore(translations): NL mistranslation of crop from "gewas" to "bijsnijden" 2024-03-07 22:59:31 -05:00
Dan Ribbens
7d0c72f92e chore(release): v3.0.0-alpha.34 [skip ci] 2024-03-07 21:56:31 -05:00
Dan Ribbens
27e0e12595 chore: fix type payload-cloud builds 2024-03-07 21:48:14 -05:00
Dan Ribbens
f6ae6b3658 Merge branch 'feat/next-poc' of github.com:payloadcms/payload into feat/next-poc 2024-03-07 21:46:10 -05:00
James
9e1d633244 chore: fix graphql json import 2024-03-07 21:42:24 -05:00
James
6b28e72686 chore: begins fixing esm bin script 2024-03-07 20:21:35 -05:00
Dan Ribbens
dfd3a06600 chore(release): v3.0.0-alpha.33 [skip ci] 2024-03-07 18:54:35 -05:00
Alessio Gravili
2c35a6f0e1 Merge remote-tracking branch 'origin/feat/next-poc' into feat/next-poc 2024-03-07 18:48:14 -05:00
Alessio Gravili
f956558656 fix(richtext-lexical): error when loading lexical without custom config (so it uses the defaultSanitizedServerEditorConfig), due to error in the cloneDeep function which clones react components. Now, it doesn't clone them anymore. 2024-03-07 18:48:07 -05:00
Dan Ribbens
32fa7006ff chore(release): v3.0.0-alpha.32 [skip ci] 2024-03-07 18:37:20 -05:00
James
95acf71dbf chore: bumps next peer deps 2024-03-07 17:43:02 -05:00
James
5640c27cec chore: bumps bin to cjs 2024-03-07 17:37:18 -05:00
Alessio Gravili
a7c5e4f317 Merge remote-tracking branch 'origin/feat/next-poc' into feat/next-poc 2024-03-07 16:41:26 -05:00
Alessio Gravili
274682e736 chore(eslint-config-payload): disable no-restricted-exports rule for payload config files 2024-03-07 16:41:19 -05:00
Jarrod Flesch
b4b6ab2667 chore: fix version restoration 2024-03-07 16:37:16 -05:00
Jarrod Flesch
bbe9dd6760 chore: adds more translations 2024-03-07 16:37:16 -05:00
Alessio Gravili
2aa7adb3bd chore: get old ts-node scripts to work, replace ts-node with tsx, fix runE2E.ts 2024-03-07 16:35:44 -05:00
James
fb7e671c26 chore: begins work to get playwright working with esm 2024-03-07 16:26:46 -05:00
Alessio Gravili
7420dba0c9 chore: upgrade testing libraries, remove express devDependency 2024-03-07 16:21:14 -05:00
Alessio Gravili
9a059bdce4 chore: undo weird as any removal 2024-03-07 16:11:25 -05:00
Alessio Gravili
50c7269315 chore: replace .d.ts type imports with .js imports, as .d.ts imports break usage checks in the IDE 2024-03-07 16:08:49 -05:00
Alessio Gravili
b4434a369b chore: improve clean commands 2024-03-07 15:49:33 -05:00
Jarrod Flesch
1c945ebfbf chore: add missing translation 2024-03-07 15:45:48 -05:00
Jarrod Flesch
20d0915a03 chore: adjust rest endpoints to use new query property on req 2024-03-07 15:45:48 -05:00
James
21ee94739b chore: jest esm compat 2024-03-07 15:40:39 -05:00
Alessio Gravili
9ebb894694 chore: replace probe-image-size with image-size to reduce bundle size 2024-03-07 15:38:06 -05:00
Alessio Gravili
483db08057 chore: upgrade turborepo to 1.12.5 2024-03-07 15:11:27 -05:00
Jacob Fletcher
3a557998d0 fix(next): completely opts out of router cache 2024-03-07 15:08:54 -05:00
Alessio Gravili
c8322349a0 fix(richtext-lexical): Blocks: generated output schema is not fully correct (#5259) 2024-03-07 15:08:30 -05:00
Jacob Fletcher
75b993bc6b fix(next): account view isEditing prop 2024-03-07 14:17:24 -05:00
Jacob Fletcher
b9db83a741 fix(next): threads isEditing through document info context 2024-03-07 14:01:06 -05:00
Jarrod Flesch
5bbb65b569 chore: fixes DiffMethod imports 2024-03-07 13:55:47 -05:00
Jacob Fletcher
974eedc4dd fix(next): reports globals to events provider 2024-03-07 13:48:36 -05:00
Jacob Fletcher
c38c95dab5 fix(next): adds optional chaining for globals in getDataAndFile 2024-03-07 13:36:50 -05:00
Jacob Fletcher
c3a3446baa fix(next): global api url 2024-03-07 13:36:50 -05:00
Fabian Aggeler
443413c03e fix(richtext-lexical): Link: add open-in-new-tab to html converter 2024-03-07 13:33:31 -05:00
Dan Ribbens
0c56f420d5 chore(ecommerce-template): fix duplicate cart update calls (#5228) 2024-03-07 13:33:10 -05:00
Ed
f66bcb22c4 chore(next): updated auth API status codes for improved error handling (#5254) 2024-03-07 13:28:41 -05:00
James
b44d59a303 chore: adds script to analyze bundle 2024-03-07 13:01:53 -05:00
Jacob Fletcher
dbe382f91e fix(ui): document info types 2024-03-07 12:59:07 -05:00
Jacob Fletcher
1d4ec9cd71 chore(next): moves document info provider from root to page 2024-03-07 12:54:49 -05:00
Alessio Gravili
36f88b198c fix(ui): ID field Cell component not being displayed 2024-03-07 12:27:43 -05:00
James
e2ca80a33f chore: fixes usage of NextLink in nav 2024-03-07 12:12:21 -05:00
James
c08f981224 chore: simplifies logs 2024-03-07 12:10:11 -05:00
Dan Ribbens
846f59974c chore(release): v3.0.0-alpha.31 [skip ci] 2024-03-07 12:06:51 -05:00
Jarrod Flesch
5e368f486a chore: esm fixes in _community test dir 2024-03-07 12:03:02 -05:00
Jarrod Flesch
42eed07dfd chore: moves file handler into catch all GET rest handler 2024-03-07 12:02:44 -05:00
Dan Ribbens
fcd647832c chore(release): v3.0.0-alpha.30 [skip ci] 2024-03-07 11:43:53 -05:00
Dan Ribbens
06d30f0182 chore: dependency file lock 2024-03-07 11:36:13 -05:00
James
c6c5b2e682 chore: safely uses deepMerge 2024-03-07 11:33:46 -05:00
James
5431a84f37 chore: safely accesses more dependencies 2024-03-07 11:04:27 -05:00
Jacob Fletcher
764c6f0086 chore(ui): react-animate-height esm imports 2024-03-07 10:55:26 -05:00
Jarrod Flesch
7f48c5c0e5 chore: fixes esm next/link imports 2024-03-07 10:54:36 -05:00
James
bd66cda0ee chore: safely accesses bson-objectid within both ts and webpack 2024-03-07 10:54:27 -05:00
James
030ddbe12f chore: move to lexical for local testing 2024-03-07 10:37:48 -05:00
James
60e3b21596 chore: builds 2024-03-07 10:23:12 -05:00
James
647e0236bb chore: removes unused dependencies 2024-03-07 10:12:38 -05:00
James
83c0b8b96e chore: removes webpack build script from next package 2024-03-07 10:11:30 -05:00
James
4d2f1ca10e chore: fixes esm dependency imports 2024-03-07 10:10:44 -05:00
Jarrod Flesch
678a617b0b chore: esm fixes for GenerateViewMetadata 2024-03-07 10:07:12 -05:00
Jacob Fletcher
b88d78a7e5 chore(next): more esm imports 2024-03-07 10:03:18 -05:00
Jarrod Flesch
3d4092ee3e chore: esm createFirstUser 2024-03-07 10:00:28 -05:00
Kendell Joseph
0306a79a37 chore: updates imports for ESM 2024-03-07 09:56:19 -05:00
PatrikKozak
539503f766 chore: converts more files in ui package to esm 2024-03-07 09:55:51 -05:00
Jarrod Flesch
e06022e4d4 chore: partial esm conversion of next package 2024-03-07 09:54:18 -05:00
James
afb93eda2c chore: restores submit 2024-03-07 09:54:11 -05:00
James
6d2f5fcb60 chore: converts some files to esm 2024-03-07 09:54:11 -05:00
Alessio Gravili
1fb37aec25 providers 2024-03-07 09:53:34 -05:00
Alessio Gravili
5174662fe8 providers up to Locale 2024-03-07 09:46:53 -05:00
Alessio Gravili
e47bafce29 ui/src/elements -> H through S, ui/src/utilities 2024-03-07 09:43:17 -05:00
Jacob Fletcher
7cf68a4b68 chore(next): esm imports 2024-03-07 09:29:16 -05:00
James
694d5d92b7 chore: begins next / ui esm transform 2024-03-07 09:03:08 -05:00
Jacob Fletcher
83d9d98ba3 fix(next): clears document info id when creating new 2024-03-06 23:12:02 -05:00
Jacob Fletcher
cf3d0fe78d fix(next): redirect after create 2024-03-06 22:36:57 -05:00
Jacob Fletcher
56aaf52430 fix(next): field read permissions 2024-03-06 22:15:21 -05:00
Dan Ribbens
40696ddea7 chore(release): v3.0.0-alpha.29 [skip ci] 2024-03-06 19:35:37 -05:00
Alessio Gravili
38d2dc8c8e Merge remote-tracking branch 'origin/feat/next-poc' into feat/next-poc 2024-03-06 19:32:32 -05:00
Alessio Gravili
69346c5b3e feat(eslint-config-payload): add no-restricted-exports to discourage default exports 2024-03-06 19:32:10 -05:00
James
a2aa527f50 chore: removes default exports from slate 2024-03-06 19:29:04 -05:00
Alessio Gravili
b2ae40c8c8 chore(richtext-lexical): replace all default exports with named exports 2024-03-06 19:15:43 -05:00
Alessio Gravili
11498dcc7f chore(richtext-slate): use normal exports for field and cell components 2024-03-06 18:54:36 -05:00
Alessio Gravili
140d5242cf fix: react-animate-height issues for esm 2024-03-06 18:36:18 -05:00
Dan Ribbens
e3dff56479 chore(release): v3.0.0-alpha.28 [skip ci] 2024-03-06 18:08:11 -05:00
Alessio Gravili
0fb7666b97 chore: add tsconfig to prettierignore, because tsconfig is being overwritten by a script, then overwritten by prettier again, then overwritten by a script,... endlessly 2024-03-06 18:07:21 -05:00
James
5c06de6abc chore: dev script adjustments 2024-03-06 18:05:58 -05:00
James
582a609d27 chore: removes payload packages from serverComponentsExternalPackages 2024-03-06 18:02:23 -05:00
Alessio Gravili
ec3d25e64e fix: esm fixes 2024-03-06 17:48:01 -05:00
Alessio Gravili
740c7510ea Merge remote-tracking branch 'origin/feat/next-poc' into feat/next-poc 2024-03-06 16:56:38 -05:00
Alessio Gravili
c9f6c707ac fix(richtext-lexical): error rendering clickableLink or RichTextPlugin components 2024-03-06 16:56:32 -05:00
Dan Ribbens
667eee07b1 chore(release): v3.0.0-alpha.27 [skip ci] 2024-03-06 16:53:19 -05:00
Alessio Gravili
deba38ab60 chore(translations): exclude all folder from eslint 2024-03-06 16:49:15 -05:00
James
25e44e54fb chore(release): v3.0.0-alpha.26 [skip ci] 2024-03-06 16:45:04 -05:00
James
62a2341ab4 chore: builds translations without swc 2024-03-06 16:42:55 -05:00
Jacob Fletcher
53b465b7bb fix(ui): wires delete document 2024-03-06 16:08:41 -05:00
Jarrod Flesch
fc6a3282ad chore: remove old import 2024-03-06 16:08:21 -05:00
Dan Ribbens
cecd1ccc96 chore(release): v3.0.0-alpha.25 [skip ci] 2024-03-06 16:03:46 -05:00
James
439987c149 chore: fixes types 2024-03-06 16:01:54 -05:00
James
61279ac119 chore: removes unused import 2024-03-06 16:00:08 -05:00
James
ca2fbf5cdf chore: build 2024-03-06 15:56:13 -05:00
Dan Ribbens
d3129224bd chore(release): v3.0.0-alpha.24 [skip ci] 2024-03-06 15:44:49 -05:00
Jarrod Flesch
57625b26c9 chore: adds strictNullHandling to query parsing 2024-03-06 15:42:46 -05:00
Jarrod Flesch
e345009e0a Merge branch 'feat/next/qs' into feat/next-poc 2024-03-06 15:40:51 -05:00
Jacob Fletcher
41f5071d7f fix(next): ssr document title 2024-03-06 15:39:02 -05:00
James
623969be82 chore: updates swcrc for keepImportAssertions 2024-03-06 15:37:19 -05:00
James
d106037f42 chore: wepback dev works, turbo still not 2024-03-06 15:30:24 -05:00
Dan Ribbens
a9f1b3eea9 chore(release): v3.0.0-alpha.23 [skip ci] 2024-03-06 15:17:30 -05:00
James Mikrut
a1f1067063 Merge pull request #5253 from payloadcms/feat/next-esm
Feat/next esm
2024-03-06 15:13:25 -05:00
PatrikKozak
f57dda5d09 Merge branch 'feat/next-esm' of https://github.com/payloadcms/payload into feat/next-esm 2024-03-06 15:10:22 -05:00
Alessio Gravili
93acb8b163 chore(richtext-lexical): it builds 2024-03-06 15:08:03 -05:00
PatrikKozak
4f32ab4421 Merge branch 'feat/next-esm' of https://github.com/payloadcms/payload into feat/next-esm 2024-03-06 15:05:28 -05:00
PatrikKozak
c52736372a chore: updates richtext-slate imports to ESM 2024-03-06 15:05:04 -05:00
PatrikKozak
eca11bc064 chore: updates plugin-seo imports to ESM 2024-03-06 15:03:56 -05:00
PatrikKozak
093fd2d638 chore: updates plugin-cloud-storage imports to ESM 2024-03-06 15:02:56 -05:00
PatrikKozak
194fb44fb5 chore: updates plugin-cloud imports to ESM 2024-03-06 15:01:33 -05:00
James
0c032d69ee chore: ui and next now build w/ bundler specification 2024-03-06 15:00:33 -05:00
James
b2219d879f chore: fixes package compat 2024-03-06 14:57:30 -05:00
James
304cf9d797 chore: proper tsconfig 2024-03-06 14:57:30 -05:00
Alessio Gravili
29963a04fc Merge remote-tracking branch 'origin/feat/next-esm' into feat/next-esm 2024-03-06 14:56:08 -05:00
Alessio Gravili
dff80d8276 chore(richtext-lexical): fixes 2024-03-06 14:56:02 -05:00
Tylan Davis
f33bb0d73f chore: updates live-preview imports for ESM 2024-03-06 14:53:54 -05:00
Tylan Davis
be09dd41fa chore: updates graphql imports for ESM 2024-03-06 14:53:02 -05:00
Dan Ribbens
36b12b645b Merge branch 'feat/next-esm' of github.com:payloadcms/payload into feat/next-esm 2024-03-06 14:49:00 -05:00
Dan Ribbens
bea15771b9 chore: fix utilities imported function calls 2024-03-06 14:48:46 -05:00
James
8c2cbce4a4 chore: esm 2024-03-06 14:48:02 -05:00
James
9674f4e739 chore: esm-ify payload 2024-03-06 14:48:02 -05:00
Alessio Gravili
137952af73 chore(richtext-lexical): migrate remaining stuff to esm 2024-03-06 14:46:10 -05:00
Dan Ribbens
66dcb1020a chore: import extensions added in uploads and utilities 2024-03-06 14:37:00 -05:00
Alessio Gravili
829d19dfc2 chore(richtext-lexical): migrate imports to esm 2024-03-06 14:26:50 -05:00
Jarrod Flesch
c73159d2d0 chore: adds qs, adds query to createPayloadRequest 2024-03-06 14:26:21 -05:00
Tylan Davis
4159fae8c9 chore: updates translations imports for ESM 2024-03-06 14:22:49 -05:00
Kendell Joseph
bff045fff2 chore: updates db-postgres imports for ESM 2024-03-06 14:19:13 -05:00
Kendell Joseph
3090e7c163 chore: updates db-mongodb imports for ESM 2024-03-06 14:19:13 -05:00
Alessio Gravili
38798aec73 Merge remote-tracking branch 'origin/feat/next-poc' into feat/next-esm 2024-03-06 13:33:12 -05:00
Alessio Gravili
bc7a69044b chore: add proper eslint types 2024-03-06 13:30:13 -05:00
Jacob Fletcher
ee6512567e fix(next): not found meta 2024-03-06 13:27:46 -05:00
James
1b7ded4560 chore: updates tsconfig to use NodeNext rather than Bundler 2024-03-06 13:10:13 -05:00
Jacob Fletcher
e9abe63b47 fix(next): 404 handling 2024-03-06 13:02:43 -05:00
Alessio Gravili
b70bf81d6c chore: fix all eslint configs to work with esm 2024-03-06 12:48:15 -05:00
Dan Ribbens
410fddbf7f chore(release): v3.0.0-alpha.22 [skip ci] 2024-03-06 12:46:13 -05:00
Dan Ribbens
c0c9026da6 chore(release): v3.0.0-alpha.21 [skip ci] 2024-03-06 12:38:58 -05:00
James
f76e534b64 chore: corrects translations build script 2024-03-06 12:37:52 -05:00
James
468148ceb2 chore: fixes jest config to esm 2024-03-06 12:28:14 -05:00
Dan Ribbens
cc69cac29e chore(release): v3.0.0-alpha.20 [skip ci] 2024-03-06 12:24:25 -05:00
Dan Ribbens
19d2a4d1cd chore: esm compatible scripts 2024-03-06 12:24:25 -05:00
James
a7dcdc8df2 chore: builds payload to esm 2024-03-06 12:23:00 -05:00
James
7815d5ac5d chore: successful build 2024-03-06 11:57:24 -05:00
James
23051db54a chore: converts dev script from cjs to esm 2024-03-06 11:38:26 -05:00
James
f51434880f chore: add type: module to all packages 2024-03-06 11:27:45 -05:00
Alessio Gravili
87d5b4d3af chore(plugin-seo): adjust prepublishOnly script 2024-03-06 11:26:52 -05:00
Dan Ribbens
dd335ac75b chore(release): v3.0.0-alpha.19 [skip ci] 2024-03-06 11:18:06 -05:00
Jarrod Flesch
16d5e5f906 chore: simplifies serverSideProps on document views 2024-03-06 11:13:41 -05:00
James
42114a3680 chore: adds db-postgres to serverComponentsExternalPackages 2024-03-06 11:09:41 -05:00
James
e7adaecb0f chore: converts bin script to commonjs, which imports esm 2024-03-06 11:06:14 -05:00
James
9818f3df46 chore: builds to esm 2024-03-06 10:59:27 -05:00
Dan Ribbens
ca832a01cb chore(release): v3.0.0-alpha.18 [skip ci] 2024-03-06 10:46:17 -05:00
Jacob Fletcher
aaa2b204ba fix(next): uses correct global slug in getViewsFromConfig 2024-03-06 09:56:19 -05:00
Alessio Gravili
78bf9e5993 feat(plugin-seo): working plugin-seo 2024-03-06 09:50:37 -05:00
Alessio Gravili
8be0296fc1 fix(translations): translations variable not resolved if provided value is 0 (the number, not null) 2024-03-06 09:48:55 -05:00
Alessio Gravili
26cd741c04 fix: payload cache: set cached.reload to false immediately to prevent parallel reloads from unnecessarily performing the reload 2024-03-05 18:56:18 -05:00
Alessio Gravili
bf655b3327 fix: make sure schemaPath of Edit View updates when switching collections 2024-03-05 18:55:32 -05:00
Jacob Fletcher
1793b37adc fix(next): field permissions 2024-03-05 16:39:53 -05:00
Dan Ribbens
d0ffe85abb chore(release): v3.0.0-alpha.16 [skip ci] 2024-03-05 16:28:45 -05:00
James
f9f7dcfc58 chore: attempts to build to es6 instead of commonjs for next / ui 2024-03-05 16:27:48 -05:00
Dan Ribbens
f06257e7ff chore(release): v3.0.0-alpha.15 [skip ci] 2024-03-05 16:13:34 -05:00
James
e490f0bce6 chore: attempts to abstract sharp to optional dependency 2024-03-05 16:12:17 -05:00
Dan Ribbens
770c7173ec chore(release): v3.0.0-alpha.14 [skip ci] 2024-03-05 15:57:54 -05:00
Dan Ribbens
661ab4867b chore(release): v3.0.0-alpha.13 [skip ci] 2024-03-05 15:55:14 -05:00
James
9ee3b5aae6 chore: rolls back simplificaiton to root layout 2024-03-05 15:45:30 -05:00
Jarrod Flesch
d202256c30 chore: fix locale setter 2024-03-05 15:39:26 -05:00
James
b8856d4ef7 Merge branch 'feat/server-hmr' into feat/next-poc 2024-03-05 15:35:32 -05:00
James
e1294ac210 chore: removes console log 2024-03-05 15:19:16 -05:00
James
b0edd2d137 chore: finishes pattern for server hmr 2024-03-05 15:18:36 -05:00
Jarrod Flesch
0d0e9bc953 chore: thread missing Link components to Button 2024-03-05 15:17:36 -05:00
James
2576291d9f chore: refactors layout / root page 2024-03-05 14:37:40 -05:00
James
d2aab87faa chore: server hmr 2024-03-05 14:24:05 -05:00
Jacob Fletcher
c2509b462c chore(next): wires create first user 2024-03-05 11:42:20 -05:00
Jarrod Flesch
0e378be769 chore: opt out of caching getGraphql and getFieldSchemaMap 2024-03-05 09:25:42 -05:00
James
2785eaab21 chore: adds @payloadcms/db-mongodb to serverComponentsExternalPackages 2024-03-04 22:39:17 -05:00
James
8a10fd1547 chore: rolls back payload sharp version 2024-03-04 20:29:28 -05:00
James
8f8ed817fb chore: attempts turbopack-safe Schema access from mongoose 2024-03-04 17:42:04 -05:00
Alessio Gravili
7a150254fe chore: remove console log 2024-03-04 17:14:43 -05:00
Alessio Gravili
9612a4a781 chore: fix conflicting UI export (Upload => UploadField) 2024-03-04 17:07:45 -05:00
Alessio Gravili
249b233dc2 chore: revert to working next.js version 2024-03-04 17:05:51 -05:00
Jarrod Flesch
c4d4a9b47b chore: bump next, simplify i18n types 2024-03-04 17:04:05 -05:00
Dan Ribbens
a55e991bfa chore: fix read migration require regression 2024-03-04 17:02:22 -05:00
Alessio Gravili
610276f66b Merge remote-tracking branch 'origin/feat/next-poc' into feat/next-poc 2024-03-04 16:56:22 -05:00
Alessio Gravili
de99aabf7f feat: separate Input from Upload, Text & TextArea fields, get plugin-seo to load without errors 2024-03-04 16:56:14 -05:00
Elliot DeNolf
40a0a0083f chore(create-payload-app): init-next now create payload config and modifies tsconfig.json (#5242) 2024-03-04 16:55:43 -05:00
James
56ecd2ac14 chore: fix next config 2024-03-04 16:51:14 -05:00
James
4617d58b6a chore: exports withPayload in a more versatile way 2024-03-04 16:46:31 -05:00
James
98aeff2f3e chore: rolls back next config testing 2024-03-04 16:46:31 -05:00
James
f2239decca chore: abstracts next get route 2024-03-04 16:46:31 -05:00
Jacob Fletcher
36bd25a9cc chore(next): exports view base classes 2024-03-04 16:38:06 -05:00
Jarrod Flesch
933ae663f0 chore: e2e improvements 2024-03-04 16:22:15 -05:00
Dan Ribbens
a08674f708 test: database int 2024-03-04 15:58:56 -05:00
Jacob Fletcher
7fe0855932 chore(next): wires document events provider 2024-03-04 15:48:37 -05:00
Elliot DeNolf
d7594c4a1c chore(release): v3.0.0-alpha.12 [skip ci] 2024-03-04 15:43:40 -05:00
Elliot DeNolf
d9c8fa6043 chore: fix lexical formstate types 2024-03-04 15:43:23 -05:00
Alessio Gravili
4140d3084e chore: update pnpm lock 2024-03-04 15:36:39 -05:00
Alessio Gravili
93d3c9c657 Merge remote-tracking branch 'origin/feat/next-poc' into feat/next-poc 2024-03-04 15:21:35 -05:00
Alessio Gravili
3433f1224a chore(plugin-cloud-storage): fix build command 2024-03-04 15:21:29 -05:00
Jacob Fletcher
95ac686f04 chore: flattens meta into single function 2024-03-04 15:11:23 -05:00
James
ae8d11825a chore: installs sass as dependency in next package 2024-03-04 14:59:32 -05:00
Alessio Gravili
ece796432a chore(plugin-seo): prettier, lint, adjust package.json 2024-03-04 14:40:45 -05:00
Alessio Gravili
995ae21075 chore: remove useless mock file 2024-03-04 14:37:55 -05:00
Alessio Gravili
4a2d52717c feat: maybe-working plugin-cloud 2024-03-04 14:36:00 -05:00
Dan Ribbens
c0a07a6144 chore: validate schema moved from loadConfig to init 2024-03-04 14:30:38 -05:00
Jarrod Flesch
b14560c07d chore: more e2e linting 2024-03-04 14:24:28 -05:00
Jarrod Flesch
5de7d7f882 chore: test improvements and fixes 2024-03-04 14:24:28 -05:00
Alessio Gravili
a4ae3b223c chore: add @payloadcms/plugin-cloud to tsconfig 2024-03-04 14:22:24 -05:00
Alessio Gravili
383571ef05 chore(plugin-cloud-storage): upgrade azure emulator azurite to latest supported version 2024-03-04 14:17:12 -05:00
Alessio Gravili
7e5459cc62 chore: fix plugin-cloud-storage int tests 2024-03-04 14:11:09 -05:00
Alessio Gravili
caa8d9c0ed feat: working @payloadcms/plugin-cloud-storage 2024-03-04 14:08:43 -05:00
Jarrod Flesch
df887dc0e9 chore: fix autologin and redirect 2024-03-04 13:46:16 -05:00
James
262e3bbee2 chore: types update 2024-03-04 12:25:44 -05:00
Jacob Fletcher
87463c7e70 fix: admin view props 2024-03-04 12:15:30 -05:00
Dan Ribbens
2dc3e9af5e test: fix hooks int 2024-03-04 12:12:29 -05:00
Jarrod Flesch
d1de99d48d chore: fix EditViewProps import path in e2e 2024-03-04 12:08:12 -05:00
Jarrod Flesch
db87a06cfd fix: updates incorrect e2e import paths 2024-03-04 12:05:21 -05:00
Dan Ribbens
fab38c1f4e test: startMemoryDB with replica set 2024-03-04 12:03:29 -05:00
James
298dbfb0e0 Merge branch 'feat/next-poc' of github.com:payloadcms/payload into feat/next-poc 2024-03-04 12:02:29 -05:00
James
b978517945 chore: fixes dynamic meta import paths 2024-03-04 12:02:23 -05:00
Alessio Gravili
5c55449a87 chore: add @payloadcms/plugin-cloud-storage to tsconfig path 2024-03-04 12:00:29 -05:00
Alessio Gravili
78425d1947 Merge remote-tracking branch 'origin/feat/next-poc' into feat/next-poc 2024-03-04 11:58:29 -05:00
Alessio Gravili
55529eb493 chore: add back admin redirect, thanks Jarrod 2024-03-04 11:58:23 -05:00
Elliot DeNolf
06b2d907b6 chore(release): v3.0.0-alpha.11 [skip ci] 2024-03-04 11:53:26 -05:00
Jacob Fletcher
f54d96d916 chore: moves view related types to payload core 2024-03-04 11:51:58 -05:00
Jacob Fletcher
2c3da88b44 chore: consolidates server-side edit view props 2024-03-04 11:51:58 -05:00
Alessio Gravili
a90b7a65de Merge remote-tracking branch 'origin/feat/next-poc' into feat/next-poc 2024-03-04 11:44:01 -05:00
Alessio Gravili
7ef0a5a550 chore: disable annoying deprecation warnings in other scripts 2024-03-04 11:43:56 -05:00
Elliot DeNolf
5433ea0762 chore(release): v3.0.0-alpha.10 [skip ci] 2024-03-04 11:42:20 -05:00
Jarrod Flesch
7162fd61fc chore: add exports for ui package, needed for e2e playwright 2024-03-04 11:38:34 -05:00
Jarrod Flesch
d4271cf618 chore: adjust lexical import paths to use @payloadcms/ui package import 2024-03-04 11:38:34 -05:00
James
cc7dbb19a5 chore: removes ts extensions from imports 2024-03-04 11:30:31 -05:00
Alessio Gravili
5381a23140 chore: silence very annoying node punycode deprecation warningd 2024-03-04 11:19:19 -05:00
Alessio Gravili
7bcffb9424 Merge remote-tracking branch 'origin/feat/next-poc' into feat/next-poc 2024-03-04 11:13:49 -05:00
Alessio Gravili
2fde4767a0 fix: file upload error due to undefined value in busboy.write() 2024-03-04 11:13:36 -05:00
Elliot DeNolf
2f6b0861d9 ci: split out plugins from core-build step 2024-03-04 11:12:54 -05:00
Dan Ribbens
c83eeefeb2 chore: release script tag and commit as default 2024-03-04 11:01:42 -05:00
Dan Ribbens
807227911a chore(release): v3.0.0-alpha.8 2024-03-04 11:01:22 -05:00
Dan Ribbens
db71c89e35 chore: turbo disable cache clean 2024-03-04 10:52:13 -05:00
Jacob Fletcher
8b29723317 chore: renames pages to views 2024-03-04 10:07:44 -05:00
Alessio Gravili
bef3ebf9cc Merge remote-tracking branch 'origin/feat/next-poc' into feat/next-poc 2024-03-04 10:04:12 -05:00
Alessio Gravili
061e021cd4 chore(plugin-cloud-storage): remove outdated dev folder, lint & prettier, 2024-03-04 10:04:06 -05:00
Elliot DeNolf
55728fe332 chore: pin to workspace version of payload for peer deps 2024-03-04 10:02:27 -05:00
Alessio Gravili
b1b04c7e35 chore: add missing 'use client' in fields test suite 2024-03-04 09:55:19 -05:00
Elliot DeNolf
5b86a8d7c9 ci: adjust whitelist of release script 2024-03-04 09:51:22 -05:00
Alessio Gravili
44a7a5e692 chore(richtext-lexical): fix failing int test due to usage of old GraphQL client 2024-03-04 09:44:13 -05:00
Alessio Gravili
da33c80735 fix(richtext-lexical): handle payload objects for html converters properly 2024-03-04 09:39:57 -05:00
James
25935abf3a chore: redirect unauthenticated users 2024-03-04 09:36:42 -05:00
James
93e7914a86 Merge branch 'feat/next-poc' of github.com:payloadcms/payload into feat/next-poc 2024-03-04 09:33:23 -05:00
James
36231b88db chore: adds custom scss import 2024-03-04 09:33:18 -05:00
Jarrod Flesch
14c1ecd515 chore: adjust classnames 2024-03-04 08:51:45 -05:00
Jarrod Flesch
dd38e11a5d chore: fix verify route routing 2024-03-04 08:34:13 -05:00
Jarrod Flesch
9572bdcbf9 chore: cleans up root routing 2024-03-04 08:33:12 -05:00
James
9ad0efd85b chore: fixes bad imports 2024-03-03 13:08:16 -05:00
Elliot DeNolf
399b799002 ci: update release script 2024-03-03 13:01:59 -05:00
Elliot DeNolf
48fbedd8ee chore: remove incorrect package.json 2024-03-03 12:59:49 -05:00
Elliot DeNolf
a85dba8b49 chore: bump versions 2024-03-03 12:58:51 -05:00
Elliot DeNolf
64240bf70a chore: add release:alpha npm script 2024-03-02 15:45:35 -05:00
James
cd06011b5e Merge branch 'feat/next-poc' of github.com:payloadcms/payload into feat/next-poc 2024-03-02 14:17:35 -05:00
James
4d29b74c29 chore: removes old unused files 2024-03-02 14:17:23 -05:00
Jarrod Flesch
e5a12ade90 chore: dynamically render all views with segment route 2024-03-02 01:55:19 -05:00
James
981fb7f330 chore: working poc for single admin view 2024-03-01 19:29:34 -05:00
James
7851cb81bb chore: renders Account within DefaultTemplate 2024-03-01 16:37:16 -05:00
James
4e586bf31f chore: poc for flattening routes 2024-03-01 16:34:48 -05:00
Elliot DeNolf
9860f1eb68 chore: update clean and clean:cache scripts 2024-03-01 16:33:54 -05:00
Alessio Gravili
9397f38929 fix(richtext-lexical): pass through correct lexical config in adapter 2024-03-01 16:18:25 -05:00
Alessio Gravili
540943109b chore: get fields test suite to run 2024-03-01 16:12:33 -05:00
James
73dee79a4c Merge branch 'feat/flatten-ui-routes' of github.com:payloadcms/payload into feat/flatten-ui-routes 2024-03-01 16:06:14 -05:00
James
894f8b8c77 chore: progress 2024-03-01 16:06:07 -05:00
Jarrod Flesch
056e24a653 chore: stub out required routes 2024-03-01 16:05:34 -05:00
Elliot DeNolf
4045bbb1bc ci: add feat/next-poc to build on push 2024-03-01 16:01:35 -05:00
Jarrod Flesch
2634557def chore: redirect user after login 2024-03-01 15:58:10 -05:00
Alessio Gravili
2af3d5b8b1 chore: add missing devDependencies 2024-03-01 15:58:10 -05:00
Elliot DeNolf
a9ea1b84cc chore(plugin-seo): fix import 2024-03-01 15:58:10 -05:00
Alessio Gravili
10fc2495cd chore(plugin-seo): include translations and ui 2024-03-01 15:58:10 -05:00
Alessio Gravili
e9f5e593ce chore: actually fix validations int test suite 2024-03-01 15:58:10 -05:00
Alessio Gravili
eec98c9674 chore: fix validations int test suite 2024-03-01 15:58:10 -05:00
Alessio Gravili
0fddeebbc6 chore: remove duplicate import from auth test suite 2024-03-01 15:58:10 -05:00
Alessio Gravili
125e9312c1 chore: correctly import lexical stuff in test suite 2024-03-01 15:58:10 -05:00
Jarrod Flesch
e6a305026d chore: redirect user after login 2024-03-01 15:56:53 -05:00
James
f5cf7c0ca7 chore: begins flattening admin ui pages 2024-03-01 15:54:47 -05:00
Alessio Gravili
4a903371ac chore: add missing devDependencies 2024-03-01 15:52:11 -05:00
Elliot DeNolf
13777c8773 chore(plugin-seo): fix import 2024-03-01 15:50:43 -05:00
Alessio Gravili
b38b749438 chore(plugin-seo): include translations and ui 2024-03-01 15:44:58 -05:00
Alessio Gravili
ff68a9f508 chore: actually fix validations int test suite 2024-03-01 15:38:45 -05:00
Alessio Gravili
4767ba6b9c chore: fix validations int test suite 2024-03-01 15:30:38 -05:00
Alessio Gravili
d7467d9b8e chore: remove duplicate import from auth test suite 2024-03-01 15:21:46 -05:00
Alessio Gravili
ab11081276 Merge remote-tracking branch 'origin/feat/next-poc' into feat/next-poc 2024-03-01 15:18:54 -05:00
Alessio Gravili
1e280928d8 chore: correctly import lexical stuff in test suite 2024-03-01 15:18:48 -05:00
James
e245689b85 Merge branch 'feat/next-poc' of github.com:payloadcms/payload into feat/next-poc 2024-03-01 15:16:52 -05:00
James
bd31694850 chore: updates app folder types / etc 2024-03-01 15:16:41 -05:00
Jacob Fletcher
97437838f8 chore(next): wires view actions (#5226) 2024-03-01 15:14:43 -05:00
Alessio Gravili
2c226a9c83 chore: _community test suite: remove rate limit config property 2024-03-01 15:11:58 -05:00
Alessio Gravili
7a06721e16 fix(richtext-lexical): Type issues 2024-03-01 15:09:23 -05:00
Alessio Gravili
ae0dd7b9c0 feat(richtext-lexical): working Cell 2024-03-01 15:03:18 -05:00
James
28d83c1e11 chore: merge 2024-03-01 14:47:48 -05:00
James
589d49af30 chore: attempts pre-building next 2024-03-01 14:47:21 -05:00
Alessio Gravili
9283e367b1 feat(richtext-lexical): uploads 2024-03-01 14:46:57 -05:00
Alessio Gravili
37fa2f8431 Merge remote-tracking branch 'origin/feat/next-poc' into feat/next-poc 2024-03-01 14:07:21 -05:00
Alessio Gravili
a3ffb80344 feat(richtext-lexical): relationships 2024-03-01 14:07:12 -05:00
Elliot DeNolf
5c0ffae67a chore(scripts): enable eslint for scripts/ 2024-03-01 14:06:24 -05:00
James
a216af40dc Merge branch 'feat/next-poc' of github.com:payloadcms/payload into feat/next-poc 2024-03-01 13:46:55 -05:00
James
51e2fffe7e chore: moves sharp to peer dependencies of payload 2024-03-01 13:46:46 -05:00
Alessio Gravili
b6af5dcb3a feat(richtext-lexical): paragraph feature 2024-03-01 13:44:57 -05:00
Jarrod Flesch
2aa943bef2 chore: staticaly import edit tab views 2024-03-01 13:39:54 -05:00
Alessio Gravili
27ea4f76f0 feat(richtext-lexical): slateToLexicalFeature 2024-03-01 13:38:39 -05:00
Jarrod Flesch
1a4b6a66ae chore: imports react into buildColumns 2024-03-01 13:12:50 -05:00
Alessio Gravili
cf14b32355 feat(richtext-lexical): lexicalPluginToLexical 2024-03-01 13:04:58 -05:00
Jarrod Flesch
707c5cba41 chore: fix hiddenInput export 2024-03-01 13:01:00 -05:00
Jarrod Flesch
c803f92104 chore: fix imports from exports 2024-03-01 12:57:22 -05:00
Jarrod Flesch
96d5d025dc feat: wire in preview sizes (#5223) 2024-03-01 12:53:05 -05:00
James
91061235d8 Merge branch 'feat/next-poc' of github.com:payloadcms/payload into feat/next-poc 2024-03-01 12:40:56 -05:00
James
105ce757d0 chore: corrects exports for slate package 2024-03-01 12:40:47 -05:00
Jacob Fletcher
031b3a9f51 fix(ui): auto theme 2024-03-01 12:35:51 -05:00
James
1fa9ea7a0e chore: corrects useTranslation import 2024-03-01 12:33:57 -05:00
James
641ede20f3 chore: adds withPayload export 2024-03-01 12:27:43 -05:00
James
b5051008e3 chore: corrects exports for payload, react toastify import 2024-03-01 12:19:35 -05:00
James
4eabb97821 Merge branch 'feat/next-poc' of github.com:payloadcms/payload into feat/next-poc 2024-03-01 12:08:12 -05:00
James
76bf1bde87 chore: corrects relative imports 2024-03-01 12:08:05 -05:00
Jarrod Flesch
dfe5591822 chore: moves toastify scss file to layout file 2024-03-01 11:50:44 -05:00
Jacob Fletcher
b27d86c1a5 chore(ui): removes all instances of react-router-dom 2024-03-01 11:27:00 -05:00
Jarrod Flesch
c7b064c751 chore: fix list cell components without values 2024-03-01 11:22:28 -05:00
James
06a3d0e500 Merge branch 'feat/next-poc' of github.com:payloadcms/payload into feat/next-poc 2024-03-01 11:14:14 -05:00
James
1ffe3c4813 chore: corrects payload import to validations 2024-03-01 11:14:09 -05:00
Elliot DeNolf
a8c99d7594 chore: fix ui package build, richtext-slate reference 2024-03-01 10:40:23 -05:00
Elliot DeNolf
144e13245a chore: fix graphql package 2024-03-01 10:40:23 -05:00
Alessio Gravili
4ea0c7e875 feat(richtext-lexical): slateToLexical 2024-03-01 10:02:01 -05:00
Alessio Gravili
d38bbd9603 feat(richtext-lexical): lists 2024-03-01 09:54:02 -05:00
Jarrod Flesch
881a502cbc chore: remove outdated config properties (#5221) 2024-03-01 09:36:38 -05:00
James
cbecd918fc Merge branch 'feat/next-poc' of github.com:payloadcms/payload into feat/next-poc 2024-03-01 09:30:49 -05:00
James
ff0044229a chore: merge 2024-03-01 09:30:37 -05:00
Alessio Gravili
175924d705 feat(richtext-lexical): indents 2024-03-01 09:29:52 -05:00
James
26c138908a chore: makes copy of scss for each package that needs it 2024-03-01 09:29:46 -05:00
Alessio Gravili
fd93a10376 Merge remote-tracking branch 'origin/feat/next-poc' into feat/next-poc 2024-03-01 09:24:11 -05:00
Alessio Gravili
486b3a1f44 feat(richtext-lexical): headings 2024-03-01 09:24:03 -05:00
Jacob Fletcher
cd63722e5e fix(ui): infinite rendering in document drawer 2024-03-01 09:17:24 -05:00
Jacob Fletcher
e75917a4d3 chore: sanitizes admin.preview from client config 2024-03-01 08:16:02 -05:00
Jacob Fletcher
b288bcbc18 chore(next): leave without saving (#5217) 2024-03-01 01:40:00 -05:00
Jarrod Flesch
5b2b104e37 feat: upload images rendering properly in admin panel (#5215) 2024-03-01 00:44:42 -05:00
Alessio Gravili
e9f2216f84 chore: update @faceless-ui/modal in all packages 2024-02-29 22:39:37 -05:00
Alessio Gravili
7d7d098efa feat(richtext-lexical): format features 2024-02-29 22:31:14 -05:00
Alessio Gravili
59494833b7 feat(richtext-lexical): treeview 2024-02-29 21:50:41 -05:00
Alessio Gravili
ddc059713d feat(richtext-lexical): testrecorder 2024-02-29 21:48:10 -05:00
Alessio Gravili
009703fabe feat(richtext-lexical): html converter 2024-02-29 21:44:21 -05:00
Alessio Gravili
b3b5f1b584 chore(richtext-lexical): make migrations feature folders lower-case 2024-02-29 21:37:21 -05:00
Alessio Gravili
7771f30270 chore(richtext-lexical): make feature folders lower-case 2024-02-29 21:36:27 -05:00
Alessio Gravili
8a26dddd08 chore: rename folders to make git recognize case changes 2024-02-29 21:31:26 -05:00
Alessio Gravili
98b4c1388e fix(richtext-lexical): Working Blocks 2024-02-29 21:26:18 -05:00
Elliot DeNolf
6d89f2160d ci: proper dependency graph for turbo to build in right order 2024-02-29 16:55:30 -05:00
James
3e8859b8dd Merge branch 'feat/next-poc' of github.com:payloadcms/payload into feat/next-poc 2024-02-29 16:29:08 -05:00
James
27babe6677 chore: adds next build script 2024-02-29 16:28:59 -05:00
Jacob Fletcher
2a6a3e624d chore(next): resolves type errors 2024-02-29 16:25:14 -05:00
Elliot DeNolf
6ff42d1627 ci: fixed versioning (#5214)
* chore(deps): add lerna-lite

* feat: update-1

* feat(db-mongodb): update 2

* chore: lerna init

* chore: add version option to lerna config

* chore(ci): add gh usernames to changelog and user root package.json for version

* chore(ci): whitelist poc branches

* chore(ci): add contributors section

* chore(ci): use turbo for prepublishOnly scripts, enable caching

* chore(deps): update turborepo, add execa

* feat(plugin-stripe): adjust type import

* chore: remove lerna-lite

* chore(ci): new and improved release script for fixed versioning

* chore: remove unused lerna-lite packages

* chore: sync root package.json version

* chore: remove remnants of bundler packages

* chore(plugin-seo): update packagea.json from main, disable build

* chore: disable turbo caching

* chore(ci): update release script

* chore: sync pnpm-lock.yaml

* chore: ci cleanup
2024-02-29 16:01:51 -05:00
Alessio Gravili
7188cfe85a feat(richtext-lexical): initial working BlocksFeature 2024-02-29 15:46:10 -05:00
Dan Ribbens
cccdba57fe chore: add hasMany text field feature to ui (#5213)
* chore: add hasMany text field feature to ui

* chore: remove bson dependency
2024-02-29 14:52:38 -05:00
James
b3bd502028 chore: slate types 2024-02-29 14:46:04 -05:00
Jacob Fletcher
423b33e088 chore: bumps faceless dependencies to latest and removes from next 2024-02-29 14:42:38 -05:00
Alessio Gravili
edb63380ed Merge remote-tracking branch 'origin/feat/next-poc' into feat/next-poc 2024-02-29 14:41:48 -05:00
Alessio Gravili
7175bb7b47 fix: @payloadcms/ui alias 2024-02-29 14:41:42 -05:00
Elliot DeNolf
c817916e0f chore(ui): package.json adjustments 2024-02-29 14:40:38 -05:00
James
426b48bd13 Merge branch 'feat/next-poc' of github.com:payloadcms/payload into feat/next-poc 2024-02-29 14:31:19 -05:00
Jarrod Flesch
88ba714b59 chore: adjusts ui package.json 2024-02-29 14:30:57 -05:00
James
795fdd477c chore: buildable slate 2024-02-29 14:30:47 -05:00
Jarrod Flesch
6f021049ab chore: fix upload test suite dirname referencing 2024-02-29 14:15:44 -05:00
Jacob Fletcher
bbdc137f64 chore(ui): properly types client-side field validations 2024-02-29 13:48:15 -05:00
James
843974d810 Merge branch 'feat/next-poc' of github.com:payloadcms/payload into feat/next-poc 2024-02-29 13:39:58 -05:00
James
b97f025ea7 chore: exports 2024-02-29 13:39:54 -05:00
Jacob Fletcher
670a32271a chore(ui): exports Modal and useModal hook 2024-02-29 13:22:54 -05:00
Jacob Fletcher
71a33f2f02 chore(ui): exports useWindowInfo hook 2024-02-29 13:20:57 -05:00
Jacob Fletcher
f477a215cf fix(next): metadata base url 2024-02-29 12:47:13 -05:00
Jacob Fletcher
12b09cf963 fix: beforeChange field validation args 2024-02-29 12:47:07 -05:00
Alessio Gravili
bedd7b6f41 Merge remote-tracking branch 'origin/feat/next-poc' into feat/next-poc 2024-02-29 12:37:54 -05:00
Alessio Gravili
ee5ae22779 fix: validation issues for Relationship and Upload fields 2024-02-29 12:37:44 -05:00
Jacob Fletcher
316f0722d8 chore(next): removes app dir 2024-02-29 12:31:17 -05:00
Elliot DeNolf
34cb30bb39 Merge pull request #5209 from payloadcms/feat/next-poc-ci
ci: next-poc updates
2024-02-29 12:27:26 -05:00
Alessio Gravili
84ec05a257 fix: validations 2024-02-29 12:26:25 -05:00
Jarrod Flesch
78bdfefc66 chore: use client i18n inside initPage 2024-02-29 12:24:56 -05:00
Elliot DeNolf
33899405ba chore(plugin-cloud-storage): disable build temporarily 2024-02-29 12:24:32 -05:00
Elliot DeNolf
b3fd720668 chore(plugin-cloud-storage): more req stuff 2024-02-29 12:24:07 -05:00
James
dc7a447baf chore: merge 2024-02-29 12:16:34 -05:00
James
138b56a429 chore: fixes doc preferences fetching 2024-02-29 12:15:51 -05:00
Elliot DeNolf
4699a37b4b chore(plugin-cloud): remove req refs, UNTESTED 2024-02-29 12:14:41 -05:00
Dan Ribbens
940e21e74f chore: reverts mongodb dependency update (#5211) 2024-02-29 12:08:05 -05:00
Alessio Gravili
b6f330cc91 fix: add back user to iterateFields condition 2024-02-29 12:04:34 -05:00
Alessio Gravili
f388a46484 fix: buildStateFromSchema call from buildFormState.ts 2024-02-29 12:00:58 -05:00
Elliot DeNolf
a66d023f84 chore: more reference and export fixes 2024-02-29 11:52:19 -05:00
James
188cad3a67 chore: returns req from initPage 2024-02-29 11:44:36 -05:00
Elliot DeNolf
4d5bdf6b6f chore(plugin-form-builder): fix some imports 2024-02-29 11:27:17 -05:00
Elliot DeNolf
96810788fc chore(ui): export TextFieldProps 2024-02-29 11:26:55 -05:00
Jarrod Flesch
2f356fe26d feat: 3.0 parity with array hook functions (#5210) 2024-02-29 10:59:38 -05:00
Alessio Gravili
ab9e2729cd fix: weakly typed ValidateOptions if no field config type is passed in 2024-02-29 10:58:52 -05:00
Jarrod Flesch
203f105974 feat: 3.0 bulk edit parity (#5208) 2024-02-29 10:51:02 -05:00
Elliot DeNolf
972b8e110f chore: proper lexical reference from test 2024-02-29 10:50:41 -05:00
Elliot DeNolf
31d0b8acbf ci: use turbo for build 2024-02-29 10:41:27 -05:00
Jacob Fletcher
0152560fd8 chore(ui): builds package 2024-02-29 10:12:43 -05:00
Elliot DeNolf
e78214c38d chore(plugin-sentry): disable build temporarily 2024-02-29 10:00:16 -05:00
James
79ca759774 Merge branch 'feat/next-poc' of github.com:payloadcms/payload into feat/next-poc 2024-02-29 09:56:13 -05:00
James
5d1e5ca2ff chore: builds graphql 2024-02-29 09:56:03 -05:00
Alessio Gravili
8d13ae9e1e feat(richtext-lexical): BlockQuotes 2024-02-29 09:54:07 -05:00
Alessio Gravili
b763df5730 fix(richtext-lexical): Link drawer: form state error on initial load 2024-02-28 21:17:53 -05:00
Alessio Gravili
a237388bd4 fix(richtext-*): Link Drawer conditions - missing updates from server 2024-02-28 20:59:52 -05:00
Alessio Gravili
610f3525a2 chore: remove deprecation tracing from dev script 2024-02-28 20:31:49 -05:00
Alessio Gravili
fff692bd0c feat(db-postgres): upgrade drizzle-orm and @libsql/client 2024-02-28 18:00:50 -05:00
Alessio Gravili
a2fff64bd8 feat: remove isomorphic-fetch 2024-02-28 17:47:29 -05:00
Alessio Gravili
c00074e40b chore: upgrade release-it and @release-it/conventional-changelog 2024-02-28 17:44:44 -05:00
Alessio Gravili
93319402cb feat: upgrade @google-cloud/storage 2024-02-28 17:41:13 -05:00
Alessio Gravili
4d2d359b06 feat: remove node-fetch 2024-02-28 17:36:48 -05:00
Elliot DeNolf
0cc4a7d238 chore: make packages public 2024-02-28 17:26:41 -05:00
Alessio Gravili
026c6fac2e feat!: upgrade sharp, bump minimum node version to 18.17.0 2024-02-28 17:11:58 -05:00
Alessio Gravili
d56ac18585 feat!: require node v18 as minimum version 2024-02-28 17:02:33 -05:00
Alessio Gravili
e90d8dcdb5 feat: initial lexical support (#5206)
* chore: explores pattern for rscs in lexical

* WORKING!!!!!!

* fix(richtext-slate): field map path

* Working Link Drawer

* fix issues after merge

* AlignFeature

* Fix AlignFeature

---------

Co-authored-by: James <james@trbl.design>
2024-02-28 16:55:37 -05:00
Jarrod Flesch
1a1c207a97 Merge branch 'feat/next-poc' of https://github.com/payloadcms/payload into feat/next-poc 2024-02-28 16:46:56 -05:00
Jarrod Flesch
9b1203185d chore: adjust richtext field editor type 2024-02-28 16:46:50 -05:00
Jacob Fletcher
3214af53b7 chore: fixes bad merge 2024-02-28 16:32:11 -05:00
James
ec6b58d7d4 Merge branch 'feat/next-poc' of github.com:payloadcms/payload into feat/next-poc 2024-02-28 16:27:42 -05:00
James
0d888c9eeb chore: debounces form state from server 2024-02-28 16:27:33 -05:00
Elliot DeNolf
f957f1d2bb chore: logging for init-next 2024-02-28 16:18:02 -05:00
Jacob Fletcher
730344a201 chore(next): ssr live preview (#5205) 2024-02-28 15:39:01 -05:00
James
c5e74ca5e0 Merge branch 'feat/next-poc' of github.com:payloadcms/payload into feat/next-poc 2024-02-28 15:30:06 -05:00
James
3216c29766 chore: simplifies form state revalidation 2024-02-28 15:29:57 -05:00
Elliot DeNolf
db5babf012 chore: package.json duplicate keys 2024-02-28 14:51:24 -05:00
James
da147aacd4 chore: improper searchParams.get 2024-02-28 14:46:33 -05:00
James
8c80c1d077 Merge branch 'feat/next-poc' of github.com:payloadcms/payload into feat/next-poc 2024-02-28 14:40:57 -05:00
James
7ff646d044 chore: cleans up a few merges 2024-02-28 14:40:44 -05:00
Elliot DeNolf
cdc1e024f1 chore: --init-next improvements and tests 2024-02-28 14:16:05 -05:00
Dan Ribbens
b9dec2f714 Chore/next poc merge main (#5204)
* wip moves payload, user and data into partial req

* chore: adjust req type

* chore(next): installs sass and resolves type errors

* feat: working login route/view

* fix: me route

* chore(next): scaffolds access routes (#4562)

* chore(next): scaffolds admin layout and dashboard view (#4566)

* chore(next): builds initPage utility (#4589)

* feat(3.0): next route handlers (#4590)

* chore: removes old files

* chore(next): ssr list view (#4594)

* chore: removes old files

* chore: adjusts graphql file imports to align with new operation exports

* chore: allows for custom endpoints

* chore: cleanup

* chore(next): ssr edit view (#4614)

* chore(ui): ssr main nav (#4619)

* chore(next): ssr account view (#4620)

* chore(next): ssr auth views and document create (#4631)

* chore(next): ssr globals view (#4640)

* chore(next): scaffolds document layout (#4644)

* chore(next): ssr versions view (#4645)

* chore(next): ssr field conditions (#4675)

* chore(next): ssr field validations (#4700)

* chore(next): moves dashboard view into next dir

* chore(next): moves account view into next dir

* chore(next): moves global edit view into next dir

* chore(next): returns isolated configs and locale from initPage

* chore(next): ssr api view (#4721)

* feat: adds i18n functionality within Rest API, Local and Client contexts (#4749)

* chore: separate client translation groups with empty line

* chore: add missing translation used in db adapters

* chore: simplify next/routes export and import paths

* chore: renames PayloadT to Payload

* chore(next): custom views (#4748)

* chore: fix translation tsconfig

* chore: adjust other package ts-configs that rely on translations

* chore(next): installs @payloadcms/ui as direct dependency

* chore(next): progress to build

* chore(next): migrates types (#4792)

* fixes acccept-language detection

* chore(next): moves remaining components out from payload core (#4794)

* chore(deps): removes all unused dependencies from payload core (#4797)

* chore(next): achieves buildable state (#4803)

* adds Translation component and removes more react-i18next

* fixes up remaining translation strings

* fixes a few i18n TODO's

* chore: remaining translation strings without colons

* chore: adds missing ja translations

* chore(next): ssr group field (#4830)

* chore: removes placeholder t function

* chore: removes old file

* chore(bundler-webpack): removes webpack bundler

* chore(bundler-vite): removes vite bundler

* chore(next): ssr tabs field (#4863)

* chore(next): ssr row field

* chore(next): ssr textarea field

* chore(next): wires server action into document edit view (#4873)

* chore(next): conditional logic (#4880)

* chore(next): ssr radio, point, code, json, ui, and hidden fields (#4891)

* chore(next): ssr collapsible field (#4894)

* chore: remove findByID from req

* chore: adjusts file property on request type

* comment clarification

* chore: wires up busboy with Requst readstream

* chore: ports over express-fileupload into a NextJS compatible format

* chore: adjust upload file structure

* chore: adds try/catch around routes, corrects a few route responses

* chore: renames file/function

* chore: improve req type safety in local operations, misc req.files replacements

* chore: misc type and fn export changes

* chore: ensures root routes take pass unmodified request to root routes

* chore: improve types

* chore: consolidates locale api req initialization (#4922)

* chore(next): overhauls field rendering strategy (#4924)

* chore(next): ssr array field (#4937)

* chore(next): ssr blocks field (#4942)

* chore(next): ssr upload field and document drawer (#4957)

* chore(next): wires form submissions (#4982)

* chore: api handler adjustments

* feat: adds graphql playground handler

* adds credentials include setting to playground

* remove old playground init, stub graphql handler location

* fix: allow for null fallbackLocale

* fix: correctly prioritize locales passed as null

* chore: move all graphql code into next package

* graphql changes

* chore: semi working version of graphql http layer

* gql fix attempts

* rm console log

* chore: partial gql changes

* chore: adds gql and gql-http back into payload

* chore: removes collection from req

* chore: separates graphql package out for schema generation

* chore: dep cleanup

* chore: move graphql handlers

* chore: removes unused deps

* chore(next): ssr list view (#5032)

* chore: refactor response handler order for custom endpoints

* chore: add back in condition for collection GET path with 2 slugs

* chore: rm optional chain

* chore: import sort route file

* chore: allows custom endpoints to attempt before erroring

* feat: adds memoization to translation functions (#5036)

* chore: fix APIError import

* chore: return attemptCustomEndpointBeforeError responses

* chore(next): properly instantiates table columns

* fix(next): attaches params to req and properly assigns prefs key (#5042)

* chore: reorganize next route order

* chore(next): adds RouteError handler to next routes

* chore: builds payload successfully

* chore: misc file omissions

* fix(ui): maintains proper column order

* fix(ui): ensures first cell is a link

* fix(next): properly copies url object in createPayloadRequest (#5064)

* fix(ui): bumps react-toastify to v10.0.4 to fix hydration warnings

* feat: add route for static file GET requests (#5065)

* chore(next): allows resolved config promise to be thread through initPage (#5071)

* chore(ui): conditionally renders field label from props

* feat(next): next install script

* chore: pass config to route handlers

* feat: initial test suite framework (#4929)

* chore(next): renderable account, api, and create first user views (#5084)

* fix(next): properly parses search params in find, update, and delete handlers (#5088)

* chore(next): ssr versions view (#5085)

* chore: adds homepage for scss testing

* chore: moves dev folder to top, establishes new test pattern

* chore: working turbopack

* chore: sets up working dynamic payload-config imports

* remove unused code

* chore: rm console log

* misc

* feat: correctly subs out ability to boot REST API within same process

* chore: WIP dev suites

* chore: removes need for REST_API folder in test dir

* removes duplicate bootAdminPanel fn

* misc

* specify default export

* chore: sets up jest to work with next/jest

* chore: progress to mongodb and sharp builds

* chore: passing community tests

* chore: sorta workin

* chore: adjust payload-config import

* chore: adds rest client for Next handlers

* chore: removes test garb

* chore: restores payload-config tsconfig path temporarily

* chore: establishes pattern for memory db during tests

* chore: bumps mongoose to 7

* chore(next): 404s on nested create urls

* chore: functional _community e2e

* chore: increases e2e expect timeout

* fix(next): sanitizes locale toString from client config

* chore: type fixes

* chore: pulls mongodb from main

* chore: uses graphql to log user in

* feat: passing auth test suite

* chore(ui): threads params through context and conditionally renders document tabs (#5094)

* feat(ui): adds params context (#5095)

* chore: removes unecessary memory allocation for urlPropertiesObject object

* chore: passing graphql test suite

* chore: removes references to bson

* chore: re-enables mongodb memory server for auth test suite

* chore: replace bson with bson-objectid

* feat: passing collections-rest int suite

* chore: fixes bad imports

* chore: more passing int suites

* feat: passing globals int tests

* feat: passing hooks int test suite

* chore: remove last express file

* chore: start live-preview int test migration

* chore: passing localization int tests

* passing relationships int tests

* chore: partial passing upload int tests

* chore: fixes scss imports

* chore(ui): renders document info provider at root (#5106)

* chore: adds schema path to useFieldPath provider, more passing tests

* chore: begins work to optimize translation imports

* chore: add translations to ui ts-config references

* chore: add exports folder to package json exports

* chore: adds readme how-to-use instructions

* chore: attempts refactor of translation imports

* chore: adds authentication:account translation key to server keys

* chore: finishes translation optimization

* chore: ignores warnings from mongodb

* chore(ui): renders live document title (#5115)

* chore(ui): ssr document tabs (#5116)

* chore: handles redirecting from login

* chore: handle redirect with no searchParams

* chore: handle missing segments

* chore(next): migrates server action into standalone api endpoint (#5122)

* chore: adjust dashboard colection segments

* test: update e2e suites

* fix(ui): prevents unnecessary calls to form state

* chore: fix finding global config fields from schema path

* fix(next): executes root POST endpoints

* chore(ui): ignores values returned by form state polling

* chore: scaffolds ssr rte

* chore: renders client leaves

* chore: server-side rendered rich text elements

* chore: defines ClientFunction pattern

* chore(ui): migrates relationship field

* chore: adds translations, cleans up slate

* chore: functional slate link

* chore: slate upload ssr

* chore: relationship slate ssr

* chore: remaining slate ssr

* chore: fixes circular workspace dep

* chore: correct broken int test import paths

* chore: remove media files from root

* chore: server renders custom edit view

* fix(ui): resolves infinite loading in versions view

* fix(next): resolves global edit view lookup

* chore: payload builds

* chore: delete unused files

* chore: removes local property from payload

* chore: adds mongodb as dev dep in db-mongodb package

* chore: hide deprecation warnings for tempfile and jest-environment-jsdom

* chore: remove all translations from translations dist

* chore: clean ts-config files

* chore: simple type fixes

* chore(ui): server renders custom list view

* chore: fix next config payload-config alias

* chore: adds turbo alias paths

* chore: adjusts translation generation

* chore: improve auth function

* chore: eslint config for packages/ui

* chore(ui): exports FormState

* chore(next): migrates account view to latest patterns

* chore: disable barbie mode

* chore(ui): lints

* chore(next): lints

* chore: for alexical

* chore: custom handler type signature adjustment

* fix: non-boolean condition result causes infinite looping (#4579)

* 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

* feat(richtext-lexical): Blocks: generate type definitions for blocks fields (#4529)

* 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

* chore: remove the 3

* chore: upgrade nodemon versions (#5059)

* feat: add more options to addFieldStatePromise so that it can be used for field flattening (#4799)

* feat(plugin-seo)!: remove support for payload <2.7.0 (#4765)

* chore(plugin-seo): remove test script from package.json (#4762)

* chore: upgrade @types/nodemailer from v6.4.8 to v6.4.14 (#4733)

* chore: revert auth and initPage changes

* chore(next): moves edit and list views (#5170)

* fix: "The punycode module is deprecated" warning by updating nodemailer

* chore: adjust translations tsconfig paths in root

* chore: fix merge build

---------

Co-authored-by: Jarrod Flesch <jarrodmflesch@gmail.com>
Co-authored-by: Jacob Fletcher <jacobsfletch@gmail.com>
Co-authored-by: Jarrod Flesch <30633324+JarrodMFlesch@users.noreply.github.com>
Co-authored-by: Elliot DeNolf <denolfe@gmail.com>
Co-authored-by: James <james@trbl.design>
Co-authored-by: Alessio Gravili <alessio@gravili.de>
Co-authored-by: Alessio Gravili <70709113+AlessioGr@users.noreply.github.com>
2024-02-28 13:44:17 -05:00
Elliot DeNolf
0b296cb271 chore: new dev script 2024-02-28 12:17:25 -05:00
Elliot DeNolf
e62cca40ac chore: fix up withPayload and devnew 2024-02-28 12:06:58 -05:00
Jarrod Flesch
170ae3602b feat: extends useSearchParams hook (#5203) 2024-02-28 09:33:59 -05:00
Jacob Fletcher
96349be350 chore(next): wires admin.hidden property (#5200) 2024-02-27 16:59:11 -05:00
Elliot DeNolf
62e4828b0d chore: swap @payload-config dynamically in devnew script 2024-02-27 16:45:07 -05:00
Elliot DeNolf
0d58a20d70 chore: change payload-config to @payload-config 2024-02-27 16:45:07 -05:00
Jacob Fletcher
448288834a chore: sanitizes admin.hidden from client config 2024-02-27 16:21:39 -05:00
Alessio Gravili
c0fc258848 lexical stuff 2024-02-27 16:13:09 -05:00
Elliot DeNolf
6f1da7ad1f chore: remove duplicative copyfiles 2024-02-27 15:00:51 -05:00
Elliot DeNolf
c0e2b6ac4d chore(create-payload-app): add --init-next 2024-02-27 14:59:40 -05:00
Elliot DeNolf
99ebce0462 chore: update next install script 2024-02-27 13:29:36 -05:00
Jacob Fletcher
9831629430 chore: consolidates createClientConfig 2024-02-27 13:23:20 -05:00
Jarrod Flesch
e0ce5b7d12 chore: organizes translations 2024-02-27 13:11:03 -05:00
Jarrod Flesch
e757bbc1b2 Merge branch 'feat/next-poc' of https://github.com/payloadcms/payload into feat/next-poc 2024-02-27 12:33:10 -05:00
Jarrod Flesch
f2d90fac26 chore: fixes find for fieldSchema globals 2024-02-27 12:33:03 -05:00
Alessio Gravili
a33e150312 feat(richtext-lexical): Lexical progress 2024-02-27 12:26:12 -05:00
Jarrod Flesch
e5e9a14de4 chore: make editor prop optional 2024-02-27 10:29:58 -05:00
Jarrod Flesch
07311579af Merge branch 'feat/next-poc' of https://github.com/payloadcms/payload into feat/next-poc 2024-02-27 09:04:04 -05:00
Jacob Fletcher
a517b7fb00 chore(next): generates metadata (#5178) 2024-02-26 23:47:36 -05:00
Jacob Fletcher
7474e7e7bb chore(i18n): adds missing version translation 2024-02-26 16:57:25 -05:00
Jacob Fletcher
7a8ecf7377 chore(next): migrates getNextT to getNextI18n (#5177) 2024-02-26 16:04:34 -05:00
Jarrod Flesch
def97afd9b chore: fix translations tsconfig alias 2024-02-26 16:02:42 -05:00
Elliot DeNolf
6ba41af6dc chore(scripts): devnew script 2024-02-26 15:54:47 -05:00
Alessio Gravili
a88b35f919 chore(richtext-*): lint & prettier 2024-02-26 15:45:28 -05:00
Alessio Gravili
a0cf2ea56b fix(richtext-*): RichText Cell components (#5174)
* fix(richtext-*): RichText Cell components

* better code
2024-02-26 15:37:50 -05:00
Alessio Gravili
75c4b4f234 fix: i18nInit doesn't have to be async, richtext i18n types (#5176) 2024-02-26 15:25:28 -05:00
Jarrod Flesch
37177f1226 chore: adds withPayload to next package 2024-02-26 14:55:47 -05:00
Jarrod Flesch
18fb27d2f7 chore: adjust translations tsconfig paths in root 2024-02-26 14:09:57 -05:00
Alessio Gravili
ee054c3181 chore: update lockfile 2024-02-26 13:48:45 -05:00
Alessio Gravili
594a3a1321 fix: "The punycode module is deprecated" warning by updating nodemailer 2024-02-26 13:44:17 -05:00
Alessio Gravili
fca72c2b95 chore(eslint-config-payload): improve perfectionist object sort order (#4678) 2024-02-26 13:41:58 -05:00
Alessio Gravili
4048f466c2 Merge remote-tracking branch 'origin/feat/next-poc' into feat/next-poc-more-merges 2024-02-26 13:39:59 -05:00
Alessio Gravili
5a28bbbc9b chore: upgrade @types/nodemailer from v6.4.8 to v6.4.14 (#4733) 2024-02-26 11:53:49 -05:00
Alessio Gravili
55294701f0 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-02-26 11:53:37 -05:00
Alessio Gravili
b36ddfb3c3 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-02-26 11:53:26 -05:00
Alessio Gravili
faef85b78f chore(plugin-seo): remove test script from package.json (#4762) 2024-02-26 11:52:23 -05:00
Alessio Gravili
06c8f5de32 feat(plugin-seo)!: remove support for payload <2.7.0 (#4765) 2024-02-26 11:51:01 -05:00
Jarrod Flesch
eb6af97b42 chore: properly type headers in auth fn 2024-02-26 11:44:21 -05:00
Jarrod Flesch
601e94d370 chore: return cookies from auth fn 2024-02-26 11:43:55 -05:00
Alessio Gravili
640ff152cc feat: add more options to addFieldStatePromise so that it can be used for field flattening (#4799) 2024-02-26 11:41:34 -05:00
Jarrod Flesch
de19cc8afe Merge branch 'feat/next-poc' of https://github.com/payloadcms/payload into feat/next-poc 2024-02-26 11:38:42 -05:00
Jarrod Flesch
214f852a98 chore: revert auth and initPage changes 2024-02-26 11:38:32 -05:00
Jacob Fletcher
c6b684df89 chore(next): moves edit and list views (#5170) 2024-02-26 11:20:30 -05:00
Alessio Gravili
cb3efb157f chore: upgrade nodemon versions (#5059) 2024-02-26 11:11:39 -05:00
Alessio Gravili
17df48f9fa chore: remove the 3 2024-02-26 10:42:06 -05:00
Alessio Gravili
728d87028b chore: commit intellij run configurations (#4653)
* chore: update .gitignore

* chore: update .gitignore

* chore: commit IntelliJ run configurations
2024-02-26 10:17:26 -05:00
Jarrod Flesch
131feabafe Merge branch 'feat/next-poc' of https://github.com/payloadcms/payload into feat/next-poc 2024-02-26 09:41:31 -05:00
Jarrod Flesch
a6cf73b6d1 chore: custom handler type signature adjustment 2024-02-26 09:41:19 -05:00
Alessio Gravili
1d7fb0e43c Merge pull request #5168 from payloadcms/feat/next-poc-merger
feat: merge lexical changes from main to next-poc
2024-02-26 09:30:48 -05:00
Jarrod Flesch
bf11eacf5a chore: for alexical 2024-02-26 08:50:24 -05:00
Jarrod Flesch
513c29d349 Merge branch 'feat/next-poc' of https://github.com/payloadcms/payload into feat/next-poc 2024-02-26 08:41:15 -05:00
Jarrod Flesch
b68f9f157c chore: improve auth function 2024-02-26 08:36:02 -05:00
Jacob Fletcher
6b9b98ffdd chore(next): lints 2024-02-25 22:44:35 -05:00
Jacob Fletcher
5f7b4a9434 chore(ui): lints 2024-02-25 22:43:33 -05:00
Elliot DeNolf
8e7d110a7a chore(release): richtext-lexical/0.7.0 [skip ci] 2024-02-25 16:55:32 -05:00
Alessio Gravili
782053a6ec 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-25 16:55:10 -05:00
Alessio Gravili
fdc72c27b6 feat(richtext-lexical): AddBlock handle for all nodes, even if they aren't empty paragraphs (#5063) 2024-02-25 16:49:11 -05:00
Alessio Gravili
8d502d2cb7 fix(richtext-lexical): do not remove adjacent paragraph node when inserting certain nodes in empty editor (#5061) 2024-02-25 16:48:54 -05:00
Máté Tallósi
1df3065884 feat(richtext-lexical): add justify aligment to AlignFeature (#4035) (#4868) 2024-02-25 16:48:46 -05:00
Elliot DeNolf
cc2ff8e3cb chore(release): richtext-lexical/0.6.1 [skip ci] 2024-02-25 16:48:33 -05:00
Alessio Gravili
bce821dee9 fix(richtext-lexical): make editor reactive to initialValue changes (#5010) 2024-02-25 16:48:20 -05:00
Elliot DeNolf
9e67efbd1b chore(release): richtext-lexical/0.6.0 [skip ci] 2024-02-25 16:48:01 -05:00
Alessio Gravili
5f081d038e feat(richtext-lexical): Blocks: generate type definitions for blocks fields (#4529) 2024-02-25 16:47:50 -05:00
Elliot DeNolf
d434925f0b chore(release): richtext-lexical/0.5.2 [skip ci] 2024-02-25 16:42:43 -05:00
Alessio Gravili
1b62a57e7c 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-02-25 16:42:40 -05:00
Alessio Gravili
13447f0b4f fix: non-boolean condition result causes infinite looping (#4579) 2024-02-25 16:41:01 -05:00
Elliot DeNolf
327810390e chore(release): richtext-lexical/0.5.1 [skip ci] 2024-02-25 16:22:28 -05:00
Alessio Gravili
f8071ce942 fix(richtext-lexical): z-index issues (#4570) 2024-02-25 16:22:16 -05:00
Elliot DeNolf
2f858e29cb chore(release): richtext-lexical/0.5.0 [skip ci] 2024-02-25 16:21:57 -05:00
Alessio Gravili
1eaecf7568 chore: disable barbie mode 2024-02-25 16:09:06 -05:00
Jacob Fletcher
e83747e7ed chore(next): migrates account view to latest patterns 2024-02-23 17:18:11 -05:00
Jacob Fletcher
3260d9376e chore(ui): exports FormState 2024-02-23 16:53:13 -05:00
Alessio Gravili
827e825e53 chore: eslint config for packages/ui 2024-02-23 15:48:21 -06:00
Jarrod Flesch
0521ae4c75 chore: adjusts translation generation 2024-02-23 14:34:54 -05:00
Jarrod Flesch
3deb5dbb9b Merge remote-tracking branch 'refs/remotes/origin/feat/next-poc' into feat/next-poc 2024-02-23 13:20:55 -05:00
Jarrod Flesch
d58c3bd3d1 chore: adds turbo alias paths 2024-02-23 13:19:26 -05:00
Jacob Fletcher
298bfa81b6 chore: fixes jarrods negligence 2024-02-23 13:17:57 -05:00
Jarrod Flesch
a9d1d1a63a chore: fix next config payload-config alias 2024-02-23 13:16:45 -05:00
Jarrod Flesch
e5c2a7f176 Merge branch 'feat/next-poc' of https://github.com/payloadcms/payload into feat/next-poc 2024-02-23 13:05:08 -05:00
Jarrod Flesch
da05003a5c chore: simple type fixes 2024-02-23 13:04:50 -05:00
Jacob Fletcher
b9dfa1aafe chore(ui): server renders custom list view 2024-02-23 12:58:48 -05:00
Jarrod Flesch
a57410133a chore: clean ts-config files 2024-02-23 12:23:07 -05:00
Jarrod Flesch
f26e646cfc chore: remove all translations from translations dist 2024-02-23 11:04:33 -05:00
Jarrod Flesch
2a755b0e65 Merge branch 'feat/next-poc' of https://github.com/payloadcms/payload into feat/next-poc 2024-02-23 10:39:05 -05:00
Jarrod Flesch
5fdcb322c8 chore: adds mongodb as dev dep in db-mongodb package 2024-02-23 10:38:38 -05:00
Elliot DeNolf
76afc2b3ff chore: hide deprecation warnings for tempfile and jest-environment-jsdom 2024-02-23 10:17:55 -05:00
Jarrod Flesch
6eb4f7e4a1 chore: removes local property from payload 2024-02-23 10:02:59 -05:00
James
80412a7c2b chore: delete unused files 2024-02-23 09:59:07 -05:00
James
478b2cb7a2 chore: payload builds 2024-02-23 09:57:59 -05:00
James
bdc00a152c Merge branch 'feat/next-poc' of github.com:payloadcms/payload into feat/next-poc 2024-02-23 09:55:23 -05:00
James
c7cec1b2f1 chore: fixes circular workspace dep 2024-02-23 09:55:12 -05:00
Jacob Fletcher
178f3cd4a3 fix(next): resolves global edit view lookup 2024-02-22 17:12:56 -05:00
Jacob Fletcher
3340d39f67 fix(ui): resolves infinite loading in versions view 2024-02-22 17:10:48 -05:00
Jacob Fletcher
5e7c39e42c chore: server renders custom edit view 2024-02-22 16:45:08 -05:00
Jarrod Flesch
ab479ab885 chore: remove media files from root 2024-02-22 16:23:35 -05:00
Jarrod Flesch
65081d995e chore: correct broken int test import paths 2024-02-22 16:19:40 -05:00
James
05b2692eb5 chore: remaining slate ssr 2024-02-22 14:48:09 -05:00
James
ca7b8e589e chore: relationship slate ssr 2024-02-22 14:37:59 -05:00
James
56c325b526 chore: slate upload ssr 2024-02-22 14:20:13 -05:00
James
732402159c chore: functional slate link 2024-02-22 12:13:19 -05:00
James
1ef3b9ed13 chore: adds translations, cleans up slate 2024-02-22 11:51:07 -05:00
James
ef43a76b0b Merge branch 'feat/next-poc' of github.com:payloadcms/payload into chore/next-rte 2024-02-22 11:18:38 -05:00
James
4003a8023c chore: defines ClientFunction pattern 2024-02-22 10:55:51 -05:00
Jacob Fletcher
102205ff71 chore(ui): migrates relationship field 2024-02-22 09:31:18 -05:00
Jarrod Flesch
b736e5d971 chore: partity change from main 2024-02-22 08:24:15 -05:00
James
5720009e29 chore: server-side rendered rich text elements 2024-02-21 17:34:53 -05:00
Jacob Fletcher
04e2d1a89a chore: renders client leaves 2024-02-21 14:24:59 -05:00
Jacob Fletcher
bc0525589c chore: scaffolds ssr rte 2024-02-21 13:56:04 -05:00
Jacob Fletcher
122e8ac9d6 chore(ui): ignores values returned by form state polling 2024-02-21 10:35:34 -05:00
Jacob Fletcher
dc7b110da2 fix(next): executes root POST endpoints 2024-02-21 09:51:19 -05:00
Jarrod Flesch
37259baf08 chore: fix finding global config fields from schema path 2024-02-21 09:27:07 -05:00
Jarrod Flesch
d87d095fe9 Merge branch 'feat/next-poc' of https://github.com/payloadcms/payload into feat/next-poc 2024-02-21 09:22:11 -05:00
Jacob Fletcher
44a1baa41f fix(ui): prevents unnecessary calls to form state 2024-02-21 09:11:19 -05:00
Jarrod Flesch
a1bc60145c chore: adjusts endpoint for buildFormState 2024-02-20 23:13:48 -05:00
Elliot DeNolf
802919e6ea test: update e2e suites 2024-02-20 16:26:09 -05:00
Elliot DeNolf
1f674b5b86 chore: adjust dashboard colection segments 2024-02-20 16:25:51 -05:00
Jarrod Flesch
53b15f4507 Merge remote-tracking branch 'origin/feat/next-poc' into feat/next/test-suite 2024-02-20 15:56:26 -05:00
Jarrod Flesch
a5e2fa80e8 chore: adds schema path to useFieldPath provider, more passing tests 2024-02-20 15:56:11 -05:00
Jacob Fletcher
f10f62cebd chore(next): migrates server action into standalone api endpoint (#5122) 2024-02-20 15:14:42 -05:00
Elliot DeNolf
37ac4d30e5 chore: handle missing segments 2024-02-20 10:47:35 -05:00
Elliot DeNolf
0ac43cefa2 chore: handle redirect with no searchParams 2024-02-20 10:46:23 -05:00
James
4c60173b02 Merge branch 'feat/next-poc' of github.com:payloadcms/payload into feat/next-poc 2024-02-20 10:06:15 -05:00
James
dbcdc22b26 chore: handles redirecting from login 2024-02-20 10:06:05 -05:00
Jarrod Flesch
726596d568 Merge branch 'feat/next-poc' into feat/next/test-suite 2024-02-19 14:37:38 -05:00
Jacob Fletcher
3e3f223bb2 chore(ui): ssr document tabs (#5116) 2024-02-19 14:27:37 -05:00
James
17eb760928 Merge branch 'feat/next-poc' of github.com:payloadcms/payload into feat/next-poc 2024-02-19 13:20:26 -05:00
James
4cbfbdd621 chore: ignores warnings from mongodb 2024-02-19 13:19:43 -05:00
James
aeb8e89b69 chore: finishes translation optimization 2024-02-19 13:09:21 -05:00
Jarrod Flesch
0759e1ece2 chore: adds authentication:account translation key to server keys 2024-02-19 12:09:15 -05:00
Jacob Fletcher
fd7b2b7c4b chore(ui): renders live document title (#5115) 2024-02-19 11:39:15 -05:00
James
7ef8f9ac13 chore: attempts refactor of translation imports 2024-02-19 11:03:25 -05:00
Jarrod Flesch
dbb6c2bd9f chore: adds readme how-to-use instructions 2024-02-19 10:31:48 -05:00
Jarrod Flesch
b18bd735c9 chore: add exports folder to package json exports 2024-02-19 10:08:32 -05:00
Jarrod Flesch
b7752cc8a2 chore: add translations to ui ts-config references 2024-02-19 10:05:58 -05:00
Jarrod Flesch
e8bc88eace Merge branch 'feat/optimize-translations' of https://github.com/payloadcms/payload into feat/optimize-translations 2024-02-19 10:04:21 -05:00
Jarrod Flesch
19a4a99e76 chore: partial passing upload int tests 2024-02-19 10:03:35 -05:00
James
bc213888e8 chore: begins work to optimize translation imports 2024-02-19 10:02:09 -05:00
Jacob Fletcher
c784b46a5e chore(ui): renders document info provider at root (#5106) 2024-02-17 13:23:22 -05:00
Jarrod Flesch
1c9ba5b512 passing relationships int tests 2024-02-17 01:00:48 -05:00
Jarrod Flesch
3d99ea5cbf chore: passing localization int tests 2024-02-16 23:22:01 -05:00
Jarrod Flesch
28dc5a5b8c chore: start live-preview int test migration 2024-02-16 22:49:08 -05:00
Jarrod Flesch
dcf23d0952 chore: remove last express file 2024-02-16 22:48:46 -05:00
Jarrod Flesch
e597ecfe78 feat: passing hooks int test suite 2024-02-16 22:27:43 -05:00
Jarrod Flesch
1c75ac12e8 feat: passing globals int tests 2024-02-16 21:45:04 -05:00
Jarrod Flesch
28c4046300 chore: more passing int suites 2024-02-16 15:09:51 -05:00
James
762b5444f5 Merge branch 'feat/next-poc' of github.com:payloadcms/payload into feat/next-poc 2024-02-16 13:59:01 -05:00
James
a0e34c3a21 chore: fixes scss imports 2024-02-16 13:58:33 -05:00
Jarrod Flesch
504892ddb9 Merge branch 'feat/next-poc' of https://github.com/payloadcms/payload into feat/next-poc 2024-02-16 13:47:08 -05:00
Jarrod Flesch
5927bf8149 feat: passing collections-rest int suite 2024-02-16 13:41:48 -05:00
James
45069604e1 Merge branch 'feat/next-poc' of github.com:payloadcms/payload into feat/next-poc 2024-02-16 12:02:17 -05:00
James
b7f42f47a1 chore: fixes bad imports 2024-02-16 12:02:02 -05:00
Jarrod Flesch
2175562b9a chore: replace bson with bson-objectid 2024-02-16 11:46:57 -05:00
James
311ae5c4c5 chore: re-enables mongodb memory server for auth test suite 2024-02-16 11:32:41 -05:00
James
8f29df541f chore: removes references to bson 2024-02-16 11:31:05 -05:00
James
80e61206fd chore: merge 2024-02-16 11:29:00 -05:00
James
354d15cbf1 chore: uses graphql to log user in 2024-02-16 11:27:52 -05:00
James
12c5100bc8 chore: pulls mongodb from main 2024-02-16 11:27:23 -05:00
Jarrod Flesch
366db1623b chore: passing graphql test suite 2024-02-16 09:08:37 -05:00
Jarrod Flesch
88457d726b chore: removes unecessary memory allocation for urlPropertiesObject object 2024-02-15 21:44:37 -05:00
Jacob Fletcher
ac754f86f3 feat(ui): adds params context (#5095) 2024-02-15 15:52:04 -05:00
Jacob Fletcher
4bb1024041 chore(ui): threads params through context and conditionally renders document tabs (#5094) 2024-02-15 15:14:29 -05:00
Jarrod Flesch
a0d97ff7ed Merge branch 'feat/next-poc' of https://github.com/payloadcms/payload into feat/next-poc 2024-02-15 14:57:59 -05:00
Jarrod Flesch
6a1a83cc2b feat: passing auth test suite 2024-02-15 14:57:53 -05:00
James
abf0f7111d chore: type fixes 2024-02-15 14:12:59 -05:00
James
ef82489040 Merge branch 'feat/next-poc' of github.com:payloadcms/payload into feat/next-poc 2024-02-15 13:41:20 -05:00
James
49474c6fc8 chore: increases e2e expect timeout 2024-02-15 13:41:12 -05:00
Jacob Fletcher
7ee0dc48a7 fix(next): sanitizes locale toString from client config 2024-02-15 13:40:14 -05:00
James
ca531f0c13 chore: functional _community e2e 2024-02-15 13:39:18 -05:00
James
e1ef1efdb5 Merge branch 'feat/next-poc' of github.com:payloadcms/payload into feat/next-poc 2024-02-15 13:28:19 -05:00
James
c8c393eff9 chore: bumps mongoose to 7 2024-02-15 13:28:07 -05:00
James
6fd80cd16f chore: establishes pattern for memory db during tests 2024-02-15 11:48:00 -05:00
James
6f7a3ed031 chore: restores payload-config tsconfig path temporarily 2024-02-15 11:34:50 -05:00
James
be597ed467 chore: merge 2024-02-15 11:04:52 -05:00
James
a5267bcb5b Merge branch 'feat/next-scss' into feat/next-poc 2024-02-15 11:02:05 -05:00
Jacob Fletcher
c512693b9d chore(next): ssr versions view (#5085) 2024-02-15 10:42:55 -05:00
Jarrod Flesch
95b19864d3 chore: removes test garb 2024-02-15 10:02:38 -05:00
Jarrod Flesch
db6758f7f7 chore: adds rest client for Next handlers 2024-02-15 10:01:13 -05:00
Jacob Fletcher
f11f3fdee1 fix(next): properly parses search params in find, update, and delete handlers (#5088) 2024-02-15 08:46:54 -05:00
Jacob Fletcher
497d055b63 chore(next): 404s on nested create urls 2024-02-14 17:25:14 -05:00
James
8f9ecdcfb5 Merge branch 'feat/next-scss' of github.com:payloadcms/payload into feat/next-scss 2024-02-14 16:53:08 -05:00
James
fb47b28318 chore: working turbopack 2024-02-14 16:52:55 -05:00
Jarrod Flesch
6fa72cf912 Merge branch 'feat/next-scss' of https://github.com/payloadcms/payload into feat/next-scss 2024-02-14 16:05:49 -05:00
James
df6fa0be24 chore: moves dev folder to top, establishes new test pattern 2024-02-14 15:58:03 -05:00
Jacob Fletcher
edb7cfc08d chore(next): renderable account, api, and create first user views (#5084) 2024-02-14 12:20:46 -05:00
James
559c132d17 chore: adds homepage for scss testing 2024-02-14 11:40:23 -05:00
Jarrod Flesch
4e006e9481 Merge branch 'feat/next-poc' into feat/next/test-suite 2024-02-14 09:46:48 -05:00
Jarrod Flesch
717a6b6d07 feat: initial test suite framework (#4929) 2024-02-14 09:46:11 -05:00
Jarrod Flesch
04c101018a chore: adjust payload-config import 2024-02-14 09:44:13 -05:00
Jarrod Flesch
d6a298cffd Merge branch 'feat/next-poc' into feat/next/test-suite 2024-02-13 23:32:46 -05:00
Jarrod Flesch
018755516b chore: pass config to route handlers 2024-02-13 23:30:02 -05:00
Jarrod Flesch
31e17daa34 chore: sorta workin 2024-02-13 16:22:30 -05:00
James
0748743fe0 chore: passing community tests 2024-02-13 12:58:02 -05:00
James
0a7ff53fc7 chore: progress to mongodb and sharp builds 2024-02-13 10:59:19 -05:00
Elliot DeNolf
da9ca18fe3 feat(next): next install script 2024-02-13 10:28:41 -05:00
Jacob Fletcher
d292ab72d2 chore(ui): conditionally renders field label from props 2024-02-13 00:24:22 -05:00
Jacob Fletcher
9c77af0d67 chore(next): allows resolved config promise to be thread through initPage (#5071) 2024-02-12 18:09:01 -05:00
Jarrod Flesch
03f3d295c9 chore: sets up jest to work with next/jest 2024-02-12 16:53:27 -05:00
Jarrod Flesch
9aa5ca022d Merge branch 'feat/next-poc' into feat/next/test-suite 2024-02-12 16:52:49 -05:00
Jarrod Flesch
35e2e1848a feat: add route for static file GET requests (#5065) 2024-02-12 16:52:20 -05:00
Jacob Fletcher
087ee35ece fix(ui): bumps react-toastify to v10.0.4 to fix hydration warnings 2024-02-12 12:18:04 -05:00
Jarrod Flesch
399809ee6b chore: merge 2024-02-12 12:09:13 -05:00
Jacob Fletcher
cf6b12842f fix(next): properly copies url object in createPayloadRequest (#5064) 2024-02-12 10:58:30 -05:00
Jacob Fletcher
702c138f44 fix(ui): ensures first cell is a link 2024-02-12 10:49:10 -05:00
Jacob Fletcher
b0f0066f28 fix(ui): maintains proper column order 2024-02-10 13:32:03 -05:00
Jarrod Flesch
47c9a1d80f chore: misc file omissions 2024-02-09 14:14:38 -05:00
Jarrod Flesch
239f65d04d chore: builds payload successfully 2024-02-09 14:08:09 -05:00
Jarrod Flesch
2cd534526f chore(next): adds RouteError handler to next routes 2024-02-09 14:06:56 -05:00
Jarrod Flesch
604ecbbf95 chore: reorganize next route order 2024-02-09 13:37:00 -05:00
Jarrod Flesch
5e6191f235 merge with next-poc 2024-02-09 10:58:57 -05:00
Jacob Fletcher
026f269bdf fix(next): attaches params to req and properly assigns prefs key (#5042) 2024-02-09 10:50:16 -05:00
Jacob Fletcher
7970955c00 chore(next): properly instantiates table columns 2024-02-09 09:17:13 -05:00
Jarrod Flesch
3a0ea03a9c chore: return attemptCustomEndpointBeforeError responses 2024-02-09 09:00:45 -05:00
Jarrod Flesch
4ea07940f8 chore: fix APIError import 2024-02-08 16:23:11 -05:00
Jarrod Flesch
a8ac42037b feat: adds memoization to translation functions (#5036) 2024-02-08 15:23:50 -05:00
Jarrod Flesch
78a45fc92d chore: allows custom endpoints to attempt before erroring 2024-02-08 15:21:59 -05:00
Jarrod Flesch
a6a12335f1 chore: import sort route file 2024-02-08 12:29:31 -05:00
Jarrod Flesch
d82c1427f7 chore: rm optional chain 2024-02-08 12:28:19 -05:00
Jarrod Flesch
f2c766ddaf chore: add back in condition for collection GET path with 2 slugs 2024-02-08 12:27:20 -05:00
Jarrod Flesch
33aefb69f4 chore: refactor response handler order for custom endpoints 2024-02-08 12:18:39 -05:00
Jarrod Flesch
2751624b2b Merge branch 'feat/next-poc' of https://github.com/payloadcms/payload into feat/next-poc 2024-02-08 10:54:19 -05:00
Jarrod Flesch
fc55267dc3 chore: removes unused deps 2024-02-08 10:06:54 -05:00
Jacob Fletcher
9ea1bb492f chore(next): ssr list view (#5032) 2024-02-08 10:05:28 -05:00
Jarrod Flesch
42c4b95df1 chore: move graphql handlers 2024-02-07 17:10:42 -05:00
Jarrod Flesch
55325a0812 chore: dep cleanup 2024-02-07 17:04:42 -05:00
Jarrod Flesch
86bfc0a7f9 chore: separates graphql package out for schema generation 2024-02-07 16:38:01 -05:00
Jarrod Flesch
166fce793f chore: merge conflict resolutions 2024-02-07 14:04:26 -05:00
Jarrod Flesch
df53489498 chore: removes collection from req 2024-02-07 14:03:24 -05:00
Jarrod Flesch
d050f48d4f chore: adds gql and gql-http back into payload 2024-02-07 14:02:12 -05:00
Jarrod Flesch
d204418530 chore: partial gql changes 2024-02-07 14:01:46 -05:00
Jarrod Flesch
a4d21586d0 rm console log 2024-02-07 08:42:23 -05:00
Jarrod Flesch
bf5c7a41d6 merge resolution 2024-02-07 08:38:39 -05:00
Jarrod Flesch
73cae2e726 chore: semi working version of graphql http layer 2024-02-07 08:37:23 -05:00
Jarrod Flesch
019a83bd83 gql fix attempts 2024-02-06 13:42:52 -05:00
Jarrod Flesch
826b14b54f graphql changes 2024-02-06 12:08:52 -05:00
Jarrod Flesch
8a81d59240 chore: move all graphql code into next package 2024-02-05 17:08:58 -05:00
Jarrod Flesch
4581e1daf9 specify default export 2024-02-05 15:08:13 -05:00
Jarrod Flesch
1d619b0954 Merge branch 'feat/next-poc' into feat/next/graphql 2024-02-05 11:01:22 -05:00
Jarrod Flesch
6b666bf304 fix: correctly prioritize locales passed as null 2024-02-05 10:52:33 -05:00
Jarrod Flesch
cbb784637a Merge branch 'feat/next-poc' into feat/next/graphql 2024-02-05 10:35:17 -05:00
Jarrod Flesch
175dc33b01 fix: allow for null fallbackLocale 2024-02-05 10:34:47 -05:00
Jarrod Flesch
aa1b98aef8 remove old playground init, stub graphql handler location 2024-02-05 10:34:19 -05:00
Jarrod Flesch
c842a1e8d4 adds credentials include setting to playground 2024-02-02 17:02:38 -05:00
Jarrod Flesch
7e8be87da2 feat: adds graphql playground handler 2024-02-02 17:01:45 -05:00
Jarrod Flesch
97b9bd0593 misc 2024-02-02 15:35:59 -05:00
Jarrod Flesch
389865ba13 removes duplicate bootAdminPanel fn 2024-02-02 15:35:35 -05:00
Jarrod Flesch
bdaceedc91 chore: removes need for REST_API folder in test dir 2024-02-02 15:34:30 -05:00
Jarrod Flesch
2c910b0778 chore: WIP dev suites 2024-02-02 15:26:14 -05:00
Jarrod Flesch
f01721ce64 merge with next-poc 2024-02-02 15:24:42 -05:00
Jarrod Flesch
35b16d421e chore: api handler adjustments 2024-02-02 15:23:21 -05:00
Jacob Fletcher
147def5059 chore(next): wires form submissions (#4982) 2024-02-02 15:04:15 -05:00
Jarrod Flesch
bf16dd2cf8 Merge branch 'feat/next-poc' into feat/next/test-suite 2024-02-01 14:21:42 -05:00
Jarrod Flesch
24feace60b feat: correctly subs out ability to boot REST API within same process 2024-02-01 14:07:13 -05:00
Jacob Fletcher
3ab8a8e25f chore(next): ssr upload field and document drawer (#4957) 2024-02-01 11:23:12 -05:00
Jarrod Flesch
e96c7bf987 chore: files for running tests 2024-01-30 14:54:47 -05:00
Jacob Fletcher
e7c39cb53f chore(next): ssr blocks field (#4942) 2024-01-29 15:41:50 -05:00
Jacob Fletcher
a8aca3ad0f chore(next): ssr array field (#4937) 2024-01-28 15:51:11 -05:00
Jarrod Flesch
b531f6ab8b misc 2024-01-26 15:36:06 -05:00
Jarrod Flesch
bd83d995fa chore: rm console log 2024-01-26 15:34:50 -05:00
Jarrod Flesch
7962303c72 remove unused code 2024-01-26 15:34:13 -05:00
Jarrod Flesch
991056a861 chore: sets up working dynamic payload-config imports 2024-01-26 15:33:04 -05:00
Jacob Fletcher
369a1a8ad9 chore(next): overhauls field rendering strategy (#4924) 2024-01-26 14:12:41 -05:00
Jarrod Flesch
b8e7b9c8b3 chore: align fallbackLocale determination with new fallbackLocale property on Locale 2024-01-25 12:00:50 -05:00
Jarrod Flesch
df40bafcfe chore: consolidates locale api req initialization (#4922) 2024-01-25 10:18:23 -05:00
Jarrod Flesch
0cd8ac6754 chore: improve types 2024-01-25 09:25:35 -05:00
Jarrod Flesch
ad416ca14f chore: ensures root routes take pass unmodified request to root routes 2024-01-24 17:26:02 -05:00
Jarrod Flesch
70784517e4 chore: misc type and fn export changes 2024-01-24 10:26:29 -05:00
Jarrod Flesch
2c3dc6ceef chore: improve req type safety in local operations, misc req.files replacements 2024-01-24 09:47:28 -05:00
Jarrod Flesch
db935b20a7 chore: renames file/function 2024-01-24 09:07:01 -05:00
Jarrod Flesch
a1fd0318f1 chore: adds try/catch around routes, corrects a few route responses 2024-01-23 17:04:43 -05:00
Jarrod Flesch
c2151c1b59 merge with next-poc 2024-01-23 16:21:16 -05:00
Jarrod Flesch
8f729bba41 chore: remove findByID from req 2024-01-23 16:19:45 -05:00
Jarrod Flesch
08bf0b6d4d chore: adjust upload file structure 2024-01-23 15:50:39 -05:00
Jarrod Flesch
1ff30c5e54 chore: ports over express-fileupload into a NextJS compatible format 2024-01-23 14:23:44 -05:00
Jacob Fletcher
80e7fb9020 chore(next): ssr collapsible field (#4894) 2024-01-22 17:52:24 -05:00
Jarrod Flesch
1bd0106c2b chore: wires up busboy with Requst readstream 2024-01-22 17:22:24 -05:00
Jacob Fletcher
6c59192340 chore(next): ssr radio, point, code, json, ui, and hidden fields (#4891) 2024-01-22 13:55:26 -05:00
Jacob Fletcher
29c1498842 chore(next): conditional logic (#4880) 2024-01-19 16:43:18 -05:00
Jacob Fletcher
75c12e8966 chore(next): wires server action into document edit view (#4873) 2024-01-19 14:51:56 -05:00
Jarrod Flesch
23291d4627 comment clarification 2024-01-19 12:54:20 -05:00
Jarrod Flesch
8b89767907 chore: adjusts file property on request type 2024-01-19 12:51:39 -05:00
Jacob Fletcher
7bc43b4fe8 chore(next): ssr textarea field 2024-01-17 18:07:44 -05:00
Jacob Fletcher
0aaf4c1f32 chore(next): ssr row field 2024-01-17 17:41:11 -05:00
Jacob Fletcher
16394e6dbd chore(next): ssr tabs field (#4863) 2024-01-17 17:17:03 -05:00
Jacob Fletcher
3b531f863d chore(bundler-vite): removes vite bundler 2024-01-17 10:48:41 -05:00
Jacob Fletcher
0bc1a6a22a chore(bundler-webpack): removes webpack bundler 2024-01-17 10:48:13 -05:00
Jarrod Flesch
6dac9f769a chore: removes old file 2024-01-17 10:36:33 -05:00
Jarrod Flesch
5871ae1a59 chore: removes placeholder t function 2024-01-17 08:37:20 -05:00
Jacob Fletcher
0a9329ec56 chore(next): ssr group field (#4830) 2024-01-16 14:12:29 -05:00
Jarrod Flesch
00e34bb6fe chore: adds missing ja translations 2024-01-16 12:52:53 -05:00
Jarrod Flesch
75777dafc6 chore: remaining translation strings without colons 2024-01-16 12:44:20 -05:00
Jarrod Flesch
85ca07c521 fixes a few i18n TODO's 2024-01-16 12:20:25 -05:00
Jarrod Flesch
b781e5cc88 fixes up remaining translation strings 2024-01-16 12:15:09 -05:00
Jarrod Flesch
13313028b5 adds Translation component and removes more react-i18next 2024-01-16 09:36:35 -05:00
Jacob Fletcher
0bc7c452c3 chore(next): achieves buildable state (#4803) 2024-01-13 22:49:04 -05:00
Jacob Fletcher
b549003054 chore(db-postgres): removes vite and webpack config extensions 2024-01-12 15:32:37 -05:00
Jacob Fletcher
2ee425bdf1 chore(db-mongodb): removes vite and webpack config extensions 2024-01-12 15:31:57 -05:00
Jacob Fletcher
fe6160663a chore(deps): removes all unused dependencies from payload core (#4797) 2024-01-12 14:46:07 -05:00
Jacob Fletcher
6549e6136c chore(next): moves remaining components out from payload core (#4794) 2024-01-12 11:38:33 -05:00
Jarrod Flesch
9b1668cbcd fixes acccept-language detection 2024-01-12 10:25:28 -05:00
Jacob Fletcher
1c615b7fbf chore(next): migrates types (#4792) 2024-01-12 09:14:38 -05:00
Jarrod Flesch
7c54012caa chore: remoeve old import 2024-01-12 08:58:01 -05:00
Jacob Fletcher
abee872931 chore(next): progress to build 2024-01-10 14:49:07 -05:00
Jacob Fletcher
1cbcec87d8 chore(next): installs @payloadcms/ui as direct dependency 2024-01-10 14:49:07 -05:00
Jarrod Flesch
0f1960f22a chore: adjust other package ts-configs that rely on translations 2024-01-10 14:48:05 -05:00
Jarrod Flesch
fb0c000b54 chore: fix translation tsconfig 2024-01-10 14:45:04 -05:00
Jarrod Flesch
87bb6e9995 Merge branch 'feat/next-poc' of https://github.com/payloadcms/payload into feat/next-poc 2024-01-10 14:31:03 -05:00
Jarrod Flesch
45ceabf49e chore: renames PayloadT to Payload 2024-01-10 14:30:56 -05:00
Jacob Fletcher
8202629f62 chore(next): custom views (#4748) 2024-01-10 11:55:21 -05:00
Jarrod Flesch
d3d15301f7 chore: simplify next/routes export and import paths 2024-01-10 11:03:20 -05:00
Jarrod Flesch
8817ade510 chore: add missing translation used in db adapters 2024-01-09 16:26:47 -05:00
Jarrod Flesch
4423bfdaa1 chore: separate client translation groups with empty line 2024-01-09 16:23:31 -05:00
Jarrod Flesch
56c766c7b8 feat: adds i18n functionality within Rest API, Local and Client contexts (#4749) 2024-01-09 14:37:17 -05:00
Jacob Fletcher
f8d2f44f82 chore(next): ssr api view (#4721) 2024-01-08 10:21:55 -05:00
Jacob Fletcher
d86e736b33 chore(next): returns isolated configs and locale from initPage 2024-01-08 10:20:13 -05:00
Jacob Fletcher
e2db15ed4d Merge pull request #4708 from payloadcms/chore/next-views
chore(next): moves various views into next dir
2024-01-05 16:58:26 -05:00
Jacob Fletcher
d5af131144 chore(next): moves global edit view into next dir 2024-01-05 16:51:54 -05:00
Jacob Fletcher
1401e0ab5a chore(next): moves account view into next dir 2024-01-05 14:19:53 -05:00
Jacob Fletcher
49817ee0fa chore(next): moves dashboard view into next dir 2024-01-05 14:19:43 -05:00
Jacob Fletcher
e4e5cab60f chore(next): ssr field validations (#4700) 2024-01-05 12:15:14 -05:00
Jacob Fletcher
bd6a3a633d chore(next): ssr field conditions (#4675) 2024-01-03 17:08:46 -05:00
Jacob Fletcher
3d5500e69b chore(next): ssr versions view (#4645) 2024-01-03 10:08:34 -05:00
Jarrod Flesch
b5fc236d43 Merge branch 'feat/next-poc' of https://github.com/payloadcms/payload into feat/next-poc 2024-01-02 10:51:38 -05:00
Jarrod Flesch
9915e560b2 chore: cleanup 2024-01-02 10:51:31 -05:00
Jacob Fletcher
4cf07f143c chore(next): scaffolds document layout (#4644) 2023-12-31 13:57:57 -05:00
Jacob Fletcher
9c0994219e chore(next): ssr globals view (#4640) 2023-12-30 10:03:28 -05:00
Jacob Fletcher
1287412383 chore(next): ssr auth views and document create (#4631) 2023-12-29 09:14:02 -05:00
Jacob Fletcher
0712207ff2 chore(next): ssr account view (#4620) 2023-12-27 22:21:12 -05:00
Jacob Fletcher
3e11a5200e chore(ui): ssr main nav (#4619) 2023-12-27 22:17:24 -05:00
Jacob Fletcher
723b470284 chore(next): ssr edit view (#4614) 2023-12-27 08:09:10 -05:00
Jarrod Flesch
a267aad709 chore: allows for custom endpoints 2023-12-22 13:18:45 -05:00
Jarrod Flesch
b1b318e282 chore: adjusts graphql file imports to align with new operation exports 2023-12-22 08:08:18 -05:00
Jarrod Flesch
31a8d35bb9 Merge branch 'feat/next-poc' into feat/next-custom-endpoints 2023-12-22 08:01:20 -05:00
Jarrod Flesch
f5a63998ce chore: removes old files 2023-12-22 08:00:58 -05:00
Jacob Fletcher
921f568d2d chore(next): ssr list view (#4594) 2023-12-21 23:04:25 -05:00
Jarrod Flesch
f43ac8554c chore: removes old files 2023-12-21 16:58:25 -05:00
Jarrod Flesch
988a21e94d feat(3.0): next route handlers (#4590) 2023-12-21 16:54:20 -05:00
Jacob Fletcher
a7172d8782 chore(next): builds initPage utility (#4589) 2023-12-21 16:07:45 -05:00
Jacob Fletcher
cc8c23db85 chore(next): scaffolds admin layout and dashboard view (#4566) 2023-12-20 10:13:28 -05:00
Jacob Fletcher
a6d7852903 chore(next): scaffolds access routes (#4562) 2023-12-20 01:14:19 -05:00
Jarrod Flesch
af88fb8af4 fix: me route 2023-12-19 15:33:09 -05:00
Jarrod Flesch
d16c710caa feat: working login route/view 2023-12-19 15:21:18 -05:00
Jarrod Flesch
23d362757c Merge branch 'feat/next-poc' of https://github.com/payloadcms/payload into feat/next-poc 2023-12-19 12:11:15 -05:00
Jacob Fletcher
ef7bea6d2d chore(next): installs sass and resolves type errors 2023-12-19 12:10:00 -05:00
Jarrod Flesch
4d0fa60a7a Merge branch 'feat/access-slim' into feat/next-poc 2023-12-19 12:00:52 -05:00
Jarrod Flesch
e25fc2da88 chore: adjust req type 2023-12-19 11:57:38 -05:00
Jacob Fletcher
5558e0c62f Merge branch 'main' into feat/next-poc 2023-12-19 10:34:34 -05:00
Jacob Fletcher
10315ed240 chore: splits login form from page and moves to next 2023-12-19 10:09:37 -05:00
Jarrod Flesch
754fb2397e wip moves payload, user and data into partial req 2023-12-18 16:58:57 -05:00
Jarrod Flesch
df2d144590 tie it into the next package 2023-12-14 16:52:07 -05:00
Jarrod Flesch
432e47032e chore: passes payload and user through to access control functions instead of the full req 2023-12-14 16:43:40 -05:00
Jarrod Flesch
507d40b6f5 chore: adds base for access crossoads 2023-12-14 16:18:07 -05:00
Jarrod Flesch
97eb814f21 chore: remove passing of cookies, we will handle this internally 2023-12-08 10:15:01 -05:00
Jarrod Flesch
0ef80e6d3e chore: integrates getAuthenticatedUser function into the next repo 2023-12-08 09:39:27 -05:00
Jarrod Flesch
b651b5cb48 chore: start to remove reliance on express specific functionality 2023-12-08 08:51:23 -05:00
Jacob Fletcher
02d95e90b4 chore: scaffolds auth utility 2023-12-07 16:13:23 -05:00
Jacob Fletcher
99e160686a chore: scaffolds metadata 2023-12-07 16:13:16 -05:00
Jacob Fletcher
fc9ada5f18 chore(next): scaffolds auth layout 2023-12-06 16:28:12 -05:00
Jacob Fletcher
ce3c084ea1 chore(ui): migrates theme provider 2023-12-06 14:37:08 -05:00
Jacob Fletcher
ab24796316 chore(next): exports root page and adds admin redirect 2023-12-06 12:03:06 -05:00
Jacob Fletcher
aa2ee060f1 chore(next): exports root layout from layouts dir 2023-12-06 12:02:42 -05:00
Jacob Fletcher
66e47990ac Merge branch 'main' into feat/next-poc 2023-12-06 10:41:29 -05:00
Jacob Fletcher
bd9f7bda29 chore: successfully renders login view 2023-12-05 16:38:11 -05:00
Jacob Fletcher
b002cf3031 chore: moves forms and related components 2023-12-02 03:44:52 -05:00
Jacob Fletcher
77407f0879 Merge branch 'main' into feat/next-poc 2023-12-01 22:50:58 -05:00
Jacob Fletcher
ff4c76e3a2 chore: moves login view and begins i18n 2023-12-01 22:49:59 -05:00
Jacob Fletcher
533e0fb10d chore: moves auth provider 2023-12-01 22:49:59 -05:00
Jacob Fletcher
c5bc3e27a8 chore: moves dashboard view and related components 2023-12-01 22:49:59 -05:00
Jacob Fletcher
fad0398a48 chore: moves ui components 2023-12-01 22:49:52 -05:00
Jacob Fletcher
5ce519aef9 fix: properly cleans field configs 2023-11-16 12:31:41 -05:00
Jacob Fletcher
a0719275e6 fix: removes webpack and vite from client config 2023-11-16 10:13:51 -05:00
James
01a2fc6b75 chore: progress to ui scaffolding 2023-11-16 09:50:57 -05:00
James
c232983e63 chore: progress to ui scaffolding 2023-11-15 17:22:40 -05:00
James
fe956d4617 chore: excludes pino from builds in next poc 2023-11-15 16:28:02 -05:00
James
fee8838e7b chore: establishes package pattern 2023-11-15 16:00:45 -05:00
James
0996f8cccb chore: initial next poc 2023-11-07 13:59:59 -05:00
5554 changed files with 300097 additions and 203622 deletions

View File

@@ -8,3 +8,7 @@
**/dist/**
**/node_modules
**/temp
playwright.config.ts
jest.config.js
test/live-preview/next-app
tsconfig.tsbuildinfo

72
.eslintrc.cjs Normal file
View File

@@ -0,0 +1,72 @@
/** @type {import('eslint').Linter.Config} */
module.exports = {
extends: ['@payloadcms'],
ignorePatterns: ['README.md', 'packages/**/*.spec.ts'],
overrides: [
{
files: ['packages/**'],
plugins: ['payload'],
rules: {
'payload/no-jsx-import-statements': 'warn',
'payload/no-relative-monorepo-imports': 'error',
'payload/no-imports-from-exports-dir': 'error',
},
},
{
files: ['scripts/**'],
rules: {
'@typescript-eslint/no-unused-vars': 'off',
'no-console': 'off',
'perfectionist/sort-object-types': 'off',
'perfectionist/sort-objects': 'off',
},
},
{
extends: ['plugin:@typescript-eslint/disable-type-checked'],
files: ['*.js', '*.cjs', '*.json', '*.md', '*.yml', '*.yaml'],
},
{
files: ['packages/eslint-config-payload/**'],
rules: {
'perfectionist/sort-objects': 'off',
},
},
{
files: ['templates/vercel-postgres/**'],
rules: {
'no-restricted-exports': 'off',
},
},
{
files: ['package.json', 'tsconfig.json'],
rules: {
'perfectionist/sort-array-includes': 'off',
'perfectionist/sort-astro-attributes': 'off',
'perfectionist/sort-classes': 'off',
'perfectionist/sort-enums': 'off',
'perfectionist/sort-exports': 'off',
'perfectionist/sort-imports': 'off',
'perfectionist/sort-interfaces': 'off',
'perfectionist/sort-jsx-props': 'off',
'perfectionist/sort-keys': 'off',
'perfectionist/sort-maps': 'off',
'perfectionist/sort-named-exports': 'off',
'perfectionist/sort-named-imports': 'off',
'perfectionist/sort-object-types': 'off',
'perfectionist/sort-objects': 'off',
'perfectionist/sort-svelte-attributes': 'off',
'perfectionist/sort-union-types': 'off',
'perfectionist/sort-vue-attributes': 'off',
},
},
],
parserOptions: {
project: ['./tsconfig.json'],
tsconfigRootDir: __dirname,
EXPERIMENTAL_useSourceOfProjectReferenceRedirect: true,
EXPERIMENTAL_useProjectService: true,
sourceType: 'module',
ecmaVersion: 'latest',
},
root: true,
}

View File

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

View File

@@ -16,3 +16,6 @@ fb7d1be2f3325d076b7c967b1730afcef37922c2
# lint and format create-payload-app
5fd3d430001efe86515262ded5e26f00c1451181
# 3.0 prettier & lint everywhere
6789e61488a1d3de56f472ac3214faf344030005

56
.github/CODEOWNERS vendored
View File

@@ -1,50 +1,30 @@
# Order matters. The last matching pattern takes precedence.
### Catch-all ###
* @denolfe @jmikrut @DanRibbens
.* @denolfe @jmikrut @DanRibbens
### Package Exports ###
/**/exports/ @denolfe @jmikrut
### Core ###
/packages/payload/ @denolfe @jmikrut @DanRibbens
/packages/payload/src/uploads/ @denolfe
/packages/payload/src/admin/ @jmikrut @jacobsfletch @JarrodMFlesch
### Adapters ###
/packages/bundler-*/ @denolfe @jmikrut @DanRibbens @JarrodMFlesch
/packages/db-*/ @denolfe @jmikrut @DanRibbens
/packages/richtext-*/ @denolfe @jmikrut @DanRibbens @AlessioGr
### Plugins ###
/packages/plugin-*/ @denolfe @jmikrut @DanRibbens @jacobsfletch @JarrodMFlesch @AlessioGr
### Packages ###
/packages/richtext-*/ @AlessioGr
/packages/plugin-cloud*/ @denolfe
/packages/plugin-form-builder/ @jacobsfletch
/packages/plugin-live-preview*/ @jacobsfletch
/packages/plugin-nested-docs/ @jacobsfletch
/packages/plugin-password-protection/ @jmikrut
/packages/plugin-redirects/ @jacobsfletch
/packages/plugin-search/ @jacobsfletch
/packages/plugin-sentry/ @JessChowdhury
/packages/plugin-seo/ @jacobsfletch
/packages/plugin-stripe/ @jacobsfletch
/packages/plugin-zapier/ @JarrodMFlesch
### Examples ###
/examples/ @jacobsfletch
/examples/testing/ @JarrodMFlesch
/examples/email/ @JessChowdhury
/examples/whitelabel/ @JessChowdhury
/packages/email-*/ @denolfe
/packages/storage-*/ @denolfe
/packages/create-payload-app/ @denolfe
/packages/eslint-*/ @denolfe
### Templates ###
/templates/ @jacobsfletch
/templates/blank/ @denolfe
/templates/ @jacobsfletch @denolfe
### Misc ###
/packages/create-payload-app/ @denolfe
/packages/eslint-config-payload/ @denolfe
/packages/payload-admin-bar/ @jacobsfletch
### 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
/.github/CODEOWNERS @denolfe

View File

@@ -1,6 +1,6 @@
name: Bug Report
description: Create a bug report for Payload
labels: ['possible-bug']
labels: ['[possible-bug]']
body:
- type: markdown
attributes:

48
.github/actions/setup/action.yml vendored Normal file
View File

@@ -0,0 +1,48 @@
name: Setup node and pnpm
description: Configure the Node.js and pnpm versions
inputs:
node-version:
description: 'The Node.js version to use'
required: true
default: 18.20.2
pnpm-version:
description: 'The pnpm version to use'
required: true
default: 8.15.7
runs:
using: composite
steps:
# https://github.com/actions/virtual-environments/issues/1187
- name: tune linux network
shell: bash
run: sudo ethtool -K eth0 tx off rx off
- name: Setup Node@${{ inputs.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node-version }}
- name: Install pnpm
uses: pnpm/action-setup@v3
with:
version: ${{ inputs.pnpm-version }}
run_install: false
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- name: Setup pnpm cache
uses: actions/cache@v4
with:
path: ${{ env.STORE_PATH }}
key: pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
pnpm-store-
pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
- shell: bash
run: pnpm install

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

@@ -0,0 +1,50 @@
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 type = context.payload.pull_request ? 'pull_request' : 'issue';
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 created-by: Payload team label');

View File

@@ -2,9 +2,25 @@ name: build
on:
pull_request:
types: [opened, reopened, synchronize]
types:
- opened
- reopened
- synchronize
push:
branches: ['main']
branches:
- main
- beta
concurrency:
# <workflow_name>-<branch_name>-<true || commit_sha if branch is protected>
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.ref_protected && github.sha || ''}}
cancel-in-progress: true
env:
NODE_VERSION: 18.20.2
PNPM_VERSION: 8.15.7
DO_NOT_TRACK: 1 # Disable Turbopack telemetry
NEXT_TELEMETRY_DISABLED: 1 # Disable Next telemetry
jobs:
changes:
@@ -15,27 +31,76 @@ jobs:
needs_build: ${{ steps.filter.outputs.needs_build }}
templates: ${{ steps.filter.outputs.templates }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 25
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
needs_build:
- '.github/workflows/**'
- '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 }}"
# https://github.com/actions/virtual-environments/issues/1187
- name: tune linux network
run: sudo ethtool -K eth0 tx off rx off
core-build:
- uses: actions/checkout@v4
with:
fetch-depth: 25
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
needs_build:
- '.github/workflows/**'
- '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 }}"
lint:
if: >
github.event_name == 'pull_request' && !contains(github.event.pull_request.title, 'no-lint') && !contains(github.event.pull_request.title, 'skip-lint')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
# https://github.com/actions/virtual-environments/issues/1187
- name: tune linux network
run: sudo ethtool -K eth0 tx off rx off
- name: Setup Node@${{ env.NODE_VERSION }}
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: Install pnpm
uses: pnpm/action-setup@v3
with:
version: ${{ env.PNPM_VERSION }}
run_install: false
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- name: Setup pnpm cache
uses: actions/cache@v4
timeout-minutes: 720
with:
path: ${{ env.STORE_PATH }}
key: pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
pnpm-store-
pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
- run: pnpm install
- name: Lint staged
run: |
git diff --name-only --diff-filter=d origin/${GITHUB_BASE_REF}...${GITHUB_SHA}
npx lint-staged --diff="origin/${GITHUB_BASE_REF}...${GITHUB_SHA}"
build:
needs: changes
if: ${{ needs.changes.outputs.needs_build == 'true' }}
runs-on: ubuntu-latest
@@ -45,15 +110,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: Setup Node@${{ env.NODE_VERSION }}
uses: actions/setup-node@v4
with:
node-version: 18
node-version: ${{ env.NODE_VERSION }}
- name: Install pnpm
uses: pnpm/action-setup@v2
uses: pnpm/action-setup@v3
with:
version: 8
version: ${{ env.PNPM_VERSION }}
run_install: false
- name: Get pnpm store directory
@@ -61,73 +130,148 @@ jobs:
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v3
name: Setup pnpm cache
- name: Setup pnpm cache
uses: actions/cache@v4
timeout-minutes: 720
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
key: pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
pnpm-store-
pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
- run: pnpm install
- run: pnpm run build
- run: pnpm run build:all
env:
DO_NOT_TRACK: 1 # Disable Turbopack telemetry
- name: Cache build
uses: actions/cache@v3
uses: actions/cache@v4
timeout-minutes: 10
with:
path: ./*
key: ${{ github.sha }}-${{ github.run_number }}
tests:
tests-unit:
runs-on: ubuntu-latest
needs: core-build
needs: build
steps:
# https://github.com/actions/virtual-environments/issues/1187
- name: tune linux network
run: sudo ethtool -K eth0 tx off rx off
- name: Setup Node@${{ env.NODE_VERSION }}
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: Install pnpm
uses: pnpm/action-setup@v3
with:
version: ${{ env.PNPM_VERSION }}
run_install: false
- name: Restore build
uses: actions/cache@v4
timeout-minutes: 10
with:
path: ./*
key: ${{ github.sha }}-${{ github.run_number }}
- name: Unit Tests
run: pnpm test:unit
env:
NODE_OPTIONS: --max-old-space-size=8096
tests-int:
runs-on: ubuntu-latest
needs: build
strategy:
fail-fast: false
matrix:
database: [mongoose, postgres]
database:
- mongodb
- 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: Setup Node@${{ env.NODE_VERSION }}
uses: actions/setup-node@v4
with:
node-version: 18
node-version: ${{ env.NODE_VERSION }}
- name: Install pnpm
uses: pnpm/action-setup@v2
uses: pnpm/action-setup@v3
with:
version: 8
version: ${{ env.PNPM_VERSION }}
run_install: false
- name: Restore build
uses: actions/cache@v3
uses: actions/cache@v4
timeout-minutes: 10
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:
postgresql version: '14' # See https://hub.docker.com/_/postgres for available versions
postgresql version: '14' # See https://hub.docker.com/_/postgres for available versions
postgresql db: ${{ env.POSTGRES_DB }}
postgresql user: ${{ env.POSTGRES_USER }}
postgresql password: ${{ env.POSTGRES_PASSWORD }}
if: matrix.database == 'postgres'
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: Component Tests
run: pnpm test:components
- 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: Integration Tests
run: pnpm test:int
@@ -138,63 +282,180 @@ jobs:
tests-e2e:
runs-on: ubuntu-latest
needs: core-build
needs: build
strategy:
fail-fast: false
matrix:
part: [1/8, 2/8, 3/8, 4/8, 5/8, 6/8, 7/8, 8/8]
# find test -type f -name 'e2e.spec.ts' | sort | xargs dirname | xargs -I {} basename {}
suite:
- _community
- access-control
- admin__e2e__1
- admin__e2e__2
- auth
- field-error-states
- fields-relationship
- fields
- fields__collections__Blocks
- fields__collections__Array
- fields__collections__Relationship
- fields__collections__RichText
- fields__collections__Lexical__e2e__main
- fields__collections__Lexical__e2e__blocks
- fields__collections__Date
- fields__collections__Number
- fields__collections__Point
- fields__collections__Tabs
- fields__collections__Text
- fields__collections__Upload
- live-preview
- localization
- i18n
- plugin-cloud-storage
- plugin-form-builder
- plugin-nested-docs
- plugin-seo
- versions
- uploads
env:
SUITE_NAME: ${{ matrix.suite }}
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: Setup Node@${{ env.NODE_VERSION }}
uses: actions/setup-node@v4
with:
node-version: 18
node-version: ${{ env.NODE_VERSION }}
- name: Install pnpm
uses: pnpm/action-setup@v2
uses: pnpm/action-setup@v3
with:
version: 8
version: ${{ env.PNPM_VERSION }}
run_install: false
- name: Restore build
uses: actions/cache@v3
uses: actions/cache@v4
timeout-minutes: 10
with:
path: ./*
key: ${{ github.sha }}-${{ github.run_number }}
- name: E2E Tests
uses: nick-fields/retry@v2
with:
retry_on: error
max_attempts: 2
timeout_minutes: 15
command: pnpm test:e2e --part ${{ matrix.part }} --bail
- name: Start LocalStack
run: pnpm docker:start
if: ${{ matrix.suite == 'plugin-cloud-storage' }}
- uses: actions/upload-artifact@v3
- name: Store Playwright's Version
run: |
# Extract the version number using a more targeted regex pattern with awk
PLAYWRIGHT_VERSION=$(pnpm ls @playwright/test --depth=0 | awk '/@playwright\/test/ {print $2}')
echo "Playwright's Version: $PLAYWRIGHT_VERSION"
echo "PLAYWRIGHT_VERSION=$PLAYWRIGHT_VERSION" >> $GITHUB_ENV
- name: Cache Playwright Browsers for Playwright's Version
id: cache-playwright-browsers
uses: actions/cache@v4
with:
path: ~/.cache/ms-playwright
key: playwright-browsers-${{ env.PLAYWRIGHT_VERSION }}
- name: Setup Playwright - Browsers and Dependencies
if: steps.cache-playwright-browsers.outputs.cache-hit != 'true'
run: pnpm exec playwright install --with-deps chromium
- name: Setup Playwright - Dependencies-only
if: steps.cache-playwright-browsers.outputs.cache-hit == 'true'
run: pnpm exec playwright install-deps chromium
- name: E2E Tests
run: PLAYWRIGHT_JSON_OUTPUT_NAME=results_${{ matrix.suite }}.json pnpm test:e2e ${{ matrix.suite }}
env:
PLAYWRIGHT_JSON_OUTPUT_NAME: results_${{ matrix.suite }}.json
NEXT_TELEMETRY_DISABLED: 1
- uses: actions/upload-artifact@v4
if: always()
with:
name: test-results
path: test-results/
name: test-results-${{ matrix.suite }}
path: test/test-results/
if-no-files-found: ignore
retention-days: 1
tests-type-generation:
# Disabled until this is fixed: https://github.com/daun/playwright-report-summary/issues/156
# - uses: daun/playwright-report-summary@v3
# with:
# report-file: results_${{ matrix.suite }}.json
# report-tag: ${{ matrix.suite }}
# job-summary: true
app-build-with-packed:
runs-on: ubuntu-latest
needs: core-build
needs: 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: Setup Node@${{ env.NODE_VERSION }}
uses: actions/setup-node@v4
with:
node-version: 18
node-version: ${{ env.NODE_VERSION }}
- name: Install pnpm
uses: pnpm/action-setup@v2
uses: pnpm/action-setup@v3
with:
version: 8
version: ${{ env.PNPM_VERSION }}
run_install: false
- name: Restore build
uses: actions/cache@v3
uses: actions/cache@v4
timeout-minutes: 10
with:
path: ./*
key: ${{ github.sha }}-${{ github.run_number }}
- name: Start MongoDB
uses: supercharge/mongodb-github-action@1.10.0
with:
mongodb-version: 6.0
- name: Pack and build app
run: |
set -ex
pnpm run script:pack --dest templates/blank-3.0
cd templates/blank-3.0
cp .env.example .env
ls -la
pnpm add ./*.tgz --ignore-workspace
pnpm install --ignore-workspace --no-frozen-lockfile
cat package.json
pnpm run build
tests-type-generation:
runs-on: ubuntu-latest
needs: build
steps:
# https://github.com/actions/virtual-environments/issues/1187
- name: tune linux network
run: sudo ethtool -K eth0 tx off rx off
- name: Setup Node@${{ env.NODE_VERSION }}
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: Install pnpm
uses: pnpm/action-setup@v3
with:
version: ${{ env.PNPM_VERSION }}
run_install: false
- name: Restore build
uses: actions/cache@v4
timeout-minutes: 10
with:
path: ./*
key: ${{ github.sha }}-${{ github.run_number }}
@@ -205,86 +466,9 @@ jobs:
- name: Generate GraphQL schema file
run: pnpm dev:generate-graphql-schema graphql-schema-gen
build-packages:
runs-on: ubuntu-latest
needs: core-build
strategy:
fail-fast: false
matrix:
pkg:
- db-mongodb
- db-postgres
- bundler-webpack
- bundler-vite
- richtext-slate
- richtext-lexical
- live-preview
- live-preview-react
steps:
- name: Use Node.js 18
uses: actions/setup-node@v3
with:
node-version: 18
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8
run_install: false
- name: Restore build
uses: actions/cache@v3
with:
path: ./*
key: ${{ github.sha }}-${{ github.run_number }}
- name: Build ${{ matrix.pkg }}
run: pnpm turbo run build --filter=${{ matrix.pkg }}
plugins:
runs-on: ubuntu-latest
needs: core-build
strategy:
fail-fast: false
matrix:
pkg:
- create-payload-app
- plugin-cloud
- plugin-cloud-storage
- plugin-form-builder
- plugin-nested-docs
- plugin-search
- plugin-sentry
steps:
- name: Use Node.js 18
uses: actions/setup-node@v3
with:
node-version: 18
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8
run_install: false
- name: Restore build
uses: actions/cache@v3
with:
path: ./*
key: ${{ github.sha }}-${{ github.run_number }}
- name: Build ${{ matrix.pkg }}
run: pnpm turbo run build --filter=${{ matrix.pkg }}
- 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' }}
if: false # Disable until templates are updated for 3.0
runs-on: ubuntu-latest
strategy:
fail-fast: false
@@ -295,20 +479,69 @@ jobs:
- 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 18
uses: actions/setup-node@v3
- name: Setup Node@${{ env.NODE_VERSION }}
uses: actions/setup-node@v4
with:
node-version: 18
node-version: ${{ env.NODE_VERSION }}
- name: Start MongoDB
uses: supercharge/mongodb-github-action@1.10.0
with:
mongodb-version: 6.0
- name: Build Website
- name: Build Template
run: |
cd templates/${{ matrix.template }}
cp .env.example .env
yarn install
yarn build
yarn generate:types
generated-templates:
needs: build
runs-on: ubuntu-latest
steps:
# https://github.com/actions/virtual-environments/issues/1187
- name: tune linux network
run: sudo ethtool -K eth0 tx off rx off
- name: Setup Node@${{ env.NODE_VERSION }}
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: Install pnpm
uses: pnpm/action-setup@v3
with:
version: ${{ env.PNPM_VERSION }}
run_install: false
- name: Restore build
uses: actions/cache@v4
timeout-minutes: 10
with:
path: ./*
key: ${{ github.sha }}-${{ github.run_number }}
- name: Build all generated templates
run: pnpm tsx ./scripts/build-generated-templates.ts
all-green:
name: All Green
if: always()
runs-on: ubuntu-latest
needs:
- lint
- build
- tests-unit
- tests-int
- tests-e2e
steps:
- if: ${{ always() && (contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')) }}
run: exit 1

103
.github/workflows/pr-title.yml vendored Normal file
View File

@@ -0,0 +1,103 @@
name: pr-title
on:
pull_request:
types:
- opened
- edited
- synchronize
permissions:
pull-requests: write
jobs:
main:
name: lint-pr-title
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v5
id: lint_pr_title
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
types: |
build
chore
ci
docs
feat
fix
perf
refactor
revert
style
test
types
scopes: |
cpa
db-\*
db-mongodb
db-postgres
email-nodemailer
eslint
graphql
live-preview
live-preview-react
next
payload
plugin-cloud
plugin-cloud-storage
plugin-form-builder
plugin-nested-docs
plugin-redirects
plugin-relationship-object-ids
plugin-search
plugin-sentry
plugin-seo
plugin-stripe
richtext-\*
richtext-lexical
richtext-slate
storage-\*
storage-azure
storage-gcs
storage-vercel-blob
storage-s3
translations
ui
templates
examples(\/(\w|-)+)?
deps
# Disallow uppercase letters at the beginning of the subject
subjectPattern: ^(?![A-Z]).+$
subjectPatternError: |
The subject "{subject}" found in the pull request title "{title}"
didn't match the configured pattern. Please ensure that the subject
doesn't start with an uppercase character.
- uses: marocchino/sticky-pull-request-comment@v2
# When the previous steps fails, the workflow would stop. By adding this
# condition you can continue the execution with the populated error message.
if: always() && (steps.lint_pr_title.outputs.error_message != null)
with:
header: pr-title-lint-error
message: |
Pull Request titles must follow the [Conventional Commits specification](https://www.conventionalcommits.org/en/v1.0.0/) and have valid scopes.
${{ steps.lint_pr_title.outputs.error_message }}
```
feat(ui): add Button component
^ ^ ^
| | |__ Subject
| |_______ Scope
|____________ Type
```
# Delete a previous comment when the issue has been resolved
- if: ${{ steps.lint_pr_title.outputs.error_message == null }}
uses: marocchino/sticky-pull-request-comment@v2
with:
header: pr-title-lint-error
delete: true

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

@@ -0,0 +1,36 @@
name: release-canary
on:
workflow_dispatch:
branches:
- beta
env:
NODE_VERSION: 18.20.2
PNPM_VERSION: 8.15.7
DO_NOT_TRACK: 1 # Disable Turbopack telemetry
NEXT_TELEMETRY_DISABLED: 1 # Disable Next telemetry
jobs:
release:
permissions:
id-token: write
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup
uses: ./.github/actions/setup
with:
node-version: ${{ env.NODE_VERSION }}
pnpm-version: ${{ env.PNPM_VERSION }}
- name: Load npm token
run: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Canary release script
# dry run hard-coded to true for testing and no npm token provided
run: pnpm tsx ./scripts/publish-canary.ts
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_CONFIG_PROVENANCE: true

118
.gitignore vendored
View File

@@ -1,10 +1,28 @@
coverage
package-lock.json
dist
.idea
/.idea/*
!/.idea/runConfigurations
!/.idea/payload.iml
test-results
.devcontainer
.localstack
/migrations
.localstack
.turbo
meta_client.json
meta_server.json
meta_index.json
meta_shared.json
.turbo
# Ignore test directory media folder/files
/media
test/media
/versions
# 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
@@ -230,119 +248,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 +294,5 @@ $RECYCLE.BIN/
# End of https://www.toptal.com/developers/gitignore/api/node,macos,windows,webstorm,sublimetext,visualstudiocode
/build
/build
.swc

82
.idea/payload.iml generated Normal file
View File

@@ -0,0 +1,82 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/.tmp" />
<excludeFolder url="file://$MODULE_DIR$/temp" />
<excludeFolder url="file://$MODULE_DIR$/tmp" />
<excludeFolder url="file://$MODULE_DIR$/packages/payload/.turbo" />
<excludeFolder url="file://$MODULE_DIR$/packages/payload/components" />
<excludeFolder url="file://$MODULE_DIR$/packages/payload/dist" />
<excludeFolder url="file://$MODULE_DIR$/.swc" />
<excludeFolder url="file://$MODULE_DIR$/.turbo" />
<excludeFolder url="file://$MODULE_DIR$/examples" />
<excludeFolder url="file://$MODULE_DIR$/media" />
<excludeFolder url="file://$MODULE_DIR$/packages/create-payload-app/.turbo" />
<excludeFolder url="file://$MODULE_DIR$/packages/create-payload-app/dist" />
<excludeFolder url="file://$MODULE_DIR$/packages/db-mongodb/.turbo" />
<excludeFolder url="file://$MODULE_DIR$/packages/db-mongodb/dist" />
<excludeFolder url="file://$MODULE_DIR$/packages/db-postgres/.turbo" />
<excludeFolder url="file://$MODULE_DIR$/packages/db-postgres/dist" />
<excludeFolder url="file://$MODULE_DIR$/packages/graphql/.turbo" />
<excludeFolder url="file://$MODULE_DIR$/packages/graphql/dist" />
<excludeFolder url="file://$MODULE_DIR$/packages/live-preview-react/.turbo" />
<excludeFolder url="file://$MODULE_DIR$/packages/live-preview-react/dist" />
<excludeFolder url="file://$MODULE_DIR$/packages/live-preview/.turbo" />
<excludeFolder url="file://$MODULE_DIR$/packages/live-preview/dist" />
<excludeFolder url="file://$MODULE_DIR$/packages/next/.swc" />
<excludeFolder url="file://$MODULE_DIR$/packages/next/.turbo" />
<excludeFolder url="file://$MODULE_DIR$/packages/payload/fields" />
<excludeFolder url="file://$MODULE_DIR$/packages/plugin-cloud-storage/.turbo" />
<excludeFolder url="file://$MODULE_DIR$/packages/plugin-cloud-storage/dist" />
<excludeFolder url="file://$MODULE_DIR$/packages/plugin-cloud/.turbo" />
<excludeFolder url="file://$MODULE_DIR$/packages/plugin-cloud/dist" />
<excludeFolder url="file://$MODULE_DIR$/packages/plugin-form-builder/.turbo" />
<excludeFolder url="file://$MODULE_DIR$/packages/plugin-nested-docs/.turbo" />
<excludeFolder url="file://$MODULE_DIR$/packages/plugin-nested-docs/dist" />
<excludeFolder url="file://$MODULE_DIR$/packages/plugin-redirects/.turbo" />
<excludeFolder url="file://$MODULE_DIR$/packages/plugin-redirects/dist" />
<excludeFolder url="file://$MODULE_DIR$/packages/plugin-search/.turbo" />
<excludeFolder url="file://$MODULE_DIR$/packages/plugin-search/dist" />
<excludeFolder url="file://$MODULE_DIR$/packages/plugin-sentry/.turbo" />
<excludeFolder url="file://$MODULE_DIR$/packages/plugin-seo/.turbo" />
<excludeFolder url="file://$MODULE_DIR$/packages/plugin-seo/dist" />
<excludeFolder url="file://$MODULE_DIR$/packages/plugin-stripe/.turbo" />
<excludeFolder url="file://$MODULE_DIR$/packages/richtext-lexical/.turbo" />
<excludeFolder url="file://$MODULE_DIR$/packages/richtext-lexical/dist" />
<excludeFolder url="file://$MODULE_DIR$/templates" />
<excludeFolder url="file://$MODULE_DIR$/test/.swc" />
<excludeFolder url="file://$MODULE_DIR$/versions" />
<excludeFolder url="file://$MODULE_DIR$/packages/richtext-slate/dist" />
<excludeFolder url="file://$MODULE_DIR$/packages/richtext-slate/.turbo" />
<excludeFolder url="file://$MODULE_DIR$/packages/email-nodemailer/.turbo" />
<excludeFolder url="file://$MODULE_DIR$/packages/email-nodemailer/dist" />
<excludeFolder url="file://$MODULE_DIR$/packages/email-resend/.turbo" />
<excludeFolder url="file://$MODULE_DIR$/packages/email-resend/dist" />
<excludeFolder url="file://$MODULE_DIR$/packages/live-preview-vue/.turbo" />
<excludeFolder url="file://$MODULE_DIR$/packages/live-preview-vue/dist" />
<excludeFolder url="file://$MODULE_DIR$/packages/payload/.swc" />
<excludeFolder url="file://$MODULE_DIR$/packages/plugin-form-builder/dist" />
<excludeFolder url="file://$MODULE_DIR$/packages/plugin-relationship-object-ids/.turbo" />
<excludeFolder url="file://$MODULE_DIR$/packages/plugin-relationship-object-ids/dist" />
<excludeFolder url="file://$MODULE_DIR$/packages/plugin-stripe/dist" />
<excludeFolder url="file://$MODULE_DIR$/packages/storage-azure/.turbo" />
<excludeFolder url="file://$MODULE_DIR$/packages/storage-azure/dist" />
<excludeFolder url="file://$MODULE_DIR$/packages/storage-gcs/.turbo" />
<excludeFolder url="file://$MODULE_DIR$/packages/storage-gcs/dist" />
<excludeFolder url="file://$MODULE_DIR$/packages/storage-s3/.turbo" />
<excludeFolder url="file://$MODULE_DIR$/packages/storage-s3/dist" />
<excludeFolder url="file://$MODULE_DIR$/packages/storage-uploadthing/.turbo" />
<excludeFolder url="file://$MODULE_DIR$/packages/storage-uploadthing/dist" />
<excludeFolder url="file://$MODULE_DIR$/packages/storage-vercel-blob/.turbo" />
<excludeFolder url="file://$MODULE_DIR$/packages/storage-vercel-blob/dist" />
<excludeFolder url="file://$MODULE_DIR$/packages/translations/.turbo" />
<excludeFolder url="file://$MODULE_DIR$/packages/translations/dist" />
<excludeFolder url="file://$MODULE_DIR$/packages/ui/.swc" />
<excludeFolder url="file://$MODULE_DIR$/packages/ui/.turbo" />
<excludeFolder url="file://$MODULE_DIR$/packages/ui/dist" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

View File

@@ -0,0 +1,8 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Run Dev Fields" type="NodeJSConfigurationType" application-parameters="--no-deprecation fields" path-to-js-file="test/dev.js" working-dir="$PROJECT_DIR$">
<envs>
<env name="NODE_OPTIONS" value="--no-deprecation" />
</envs>
<method v="2" />
</configuration>
</component>

View File

@@ -0,0 +1,8 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Run Dev _community" type="NodeJSConfigurationType" application-parameters="--no-deprecation _community" path-to-js-file="test/dev.js" working-dir="$PROJECT_DIR$">
<envs>
<env name="NODE_OPTIONS" value="--no-deprecation" />
</envs>
<method v="2" />
</configuration>
</component>

View File

@@ -0,0 +1,9 @@
<component name="ProjectRunConfigurationManager">
<configuration default="true" type="JavaScriptTestRunnerJest">
<node-interpreter value="project" />
<node-options value="--experimental-vm-modules --no-deprecation" />
<envs />
<scope-kind value="ALL" />
<method v="2" />
</configuration>
</component>

View File

@@ -1 +1 @@
v18.17.1
v18.20.2

2
.nvmrc
View File

@@ -1 +1 @@
v18.17.1
v18.20.2

View File

@@ -9,3 +9,8 @@
**/node_modules
**/temp
**/docs/**
tsconfig.json
packages/payload/*.js
packages/payload/*.d.ts
payload-types.ts
tsconfig.tsbuildinfo

View File

@@ -1,16 +0,0 @@
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'],
},
}

24
.swcrc Normal file
View File

@@ -0,0 +1,24 @@
{
"$schema": "https://json.schemastore.org/swcrc",
"sourceMaps": "inline",
"jsc": {
"target": "esnext",
"parser": {
"syntax": "typescript",
"tsx": true,
"dts": true
},
"transform": {
"react": {
"runtime": "automatic",
"pragmaFrag": "React.Fragment",
"throwIfNamespace": true,
"development": false,
"useBuiltins": true
}
}
},
"module": {
"type": "es6"
}
}

View File

@@ -1,3 +1,8 @@
{
"recommendations": ["esbenp.prettier-vscode", "dbaeumer.vscode-eslint"]
"recommendations": [
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"firsttris.vscode-jest-runner",
"ms-playwright.playwright"
]
}

91
.vscode/launch.json vendored
View File

@@ -3,12 +3,59 @@
// Hover to view descriptions of existing attributes.
"configurations": [
{
"command": "pnpm run dev _community",
"command": "pnpm generate:types",
"name": "Generate Types CLI",
"request": "launch",
"type": "node-terminal",
"cwd": "${workspaceFolder}"
},
{
"command": "node --no-deprecation test/dev.js _community",
"cwd": "${workspaceFolder}",
"name": "Run Dev Community",
"request": "launch",
"type": "node-terminal"
},
{
"command": "node --no-deprecation test/dev.js storage-uploadthing",
"cwd": "${workspaceFolder}",
"name": "Uploadthing",
"request": "launch",
"type": "node-terminal",
"envFile": "${workspaceFolder}/test/storage-uploadthing/.env"
},
{
"command": "node --no-deprecation test/dev.js live-preview",
"cwd": "${workspaceFolder}",
"name": "Run Dev Live Preview",
"request": "launch",
"type": "node-terminal"
},
{
"command": "node --no-deprecation test/loader/init.js",
"cwd": "${workspaceFolder}",
"name": "Run Loader",
"request": "launch",
"type": "node-terminal",
"env": {
"LOADER_TEST_FILE_PATH": "./dependency-test.js"
// "LOADER_TEST_FILE_PATH": "../fields/config.ts"
}
},
{
"command": "node --no-deprecation test/dev.js admin",
"cwd": "${workspaceFolder}",
"name": "Run Dev Admin",
"request": "launch",
"type": "node-terminal"
},
{
"command": "node --no-deprecation test/dev.js auth",
"cwd": "${workspaceFolder}",
"name": "Run Dev Auth",
"request": "launch",
"type": "node-terminal"
},
{
"command": "pnpm run dev plugin-cloud-storage",
"cwd": "${workspaceFolder}",
@@ -20,49 +67,56 @@
}
},
{
"command": "pnpm run dev fields",
"command": "node --no-deprecation test/dev.js collections-graphql",
"cwd": "${workspaceFolder}",
"name": "Run Dev GraphQL",
"request": "launch",
"type": "node-terminal"
},
{
"command": "node --no-deprecation test/dev.js fields",
"cwd": "${workspaceFolder}",
"name": "Run Dev Fields",
"request": "launch",
"type": "node-terminal"
},
{
"command": "pnpm run dev:postgres fields",
"command": "node --no-deprecation test/dev.js versions",
"cwd": "${workspaceFolder}",
"name": "Run Dev Postgres",
"request": "launch",
"type": "node-terminal"
"type": "node-terminal",
"env": {
"PAYLOAD_DATABASE": "postgres"
}
},
{
"command": "pnpm run dev versions",
"command": "node --no-deprecation test/dev.js versions",
"cwd": "${workspaceFolder}",
"name": "Run Dev Versions",
"request": "launch",
"type": "node-terminal"
},
{
"command": "pnpm run dev localization",
"command": "node --no-deprecation test/dev.js localization",
"cwd": "${workspaceFolder}",
"name": "Run Dev Localization",
"request": "launch",
"type": "node-terminal"
},
{
"command": "pnpm run dev uploads",
"command": "node --no-deprecation test/dev.js uploads",
"cwd": "${workspaceFolder}",
"name": "Run Dev Uploads",
"request": "launch",
"type": "node-terminal"
},
{
"command": "PAYLOAD_BUNDLER=vite pnpm run dev fields",
"command": "node --no-deprecation test/dev.js field-error-states",
"cwd": "${workspaceFolder}",
"name": "Run Dev Fields (Vite)",
"name": "Run Dev Field Error States",
"request": "launch",
"type": "node-terminal",
"env": {
"NODE_ENV": "production"
}
"type": "node-terminal"
},
{
"command": "pnpm run test:int live-preview",
@@ -102,17 +156,6 @@
"request": "launch",
"type": "node-terminal"
},
{
"command": "ts-node ./packages/payload/src/bin/index.ts generate:types",
"env": {
"PAYLOAD_CONFIG_PATH": "test/_community/config.ts",
"DISABLE_SWC": "true" // SWC messes up debugging the bin scripts
},
"name": "Generate Types CLI",
"outputCapture": "std",
"request": "launch",
"type": "node-terminal"
},
{
"command": "ts-node ./packages/payload/src/bin/index.ts migrate:status",
"env": {

18
.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,15 @@
"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"],
"[javascript][typescript][typescriptreact]": {
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
}
},
"files.insertFinalNewline": true,
"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"]
}
}

View File

@@ -1,3 +1,353 @@
## [2.11.2](https://github.com/payloadcms/payload/compare/v2.11.1...v2.11.2) (2024-02-23)
### Features
* **db-postgres:** configurable custom schema to use ([#5047](https://github.com/payloadcms/payload/issues/5047)) ([e8f2ca4](https://github.com/payloadcms/payload/commit/e8f2ca484ee56cd7767d5111e46ebd24752ff8de))
### Bug Fixes
* Add Context Provider in EditMany Component ([#5005](https://github.com/payloadcms/payload/issues/5005)) ([70e57fe](https://github.com/payloadcms/payload/commit/70e57fef184f7fcf56344ea755465f246f2253a5))
* **db-mongodb:** unique sparse for not required fields ([#5114](https://github.com/payloadcms/payload/issues/5114)) ([815bdfa](https://github.com/payloadcms/payload/commit/815bdfac0b0afbff2a20e54d5aee64b90f6b3a77))
* **db-postgres:** set _parentID for array nested localized fields ([#5117](https://github.com/payloadcms/payload/issues/5117)) ([ceca5c4](https://github.com/payloadcms/payload/commit/ceca5c4e97f53f1346797a31b6abfc0375e98215))
* disabling API Key does not remove the key ([#5145](https://github.com/payloadcms/payload/issues/5145)) ([7a7f0ed](https://github.com/payloadcms/payload/commit/7a7f0ed7e8132253be607c111c160163b84bd770))
* handle thrown errors in config-level afterError hook ([#5147](https://github.com/payloadcms/payload/issues/5147)) ([32ed95e](https://github.com/payloadcms/payload/commit/32ed95e1ee87409db234f1b7bd6d2e462fd9ed5d))
* only replace the drawer content with full edit component if it exists ([#5144](https://github.com/payloadcms/payload/issues/5144)) ([0a07f60](https://github.com/payloadcms/payload/commit/0a07f607b9fb1217ad956cd05b2a84a4042a19ca))
* transaction error from access endpoint ([#5156](https://github.com/payloadcms/payload/issues/5156)) ([ad42d54](https://github.com/payloadcms/payload/commit/ad42d541b342ed56463b81cee6d6307df6f06d7f))
## [2.11.1](https://github.com/payloadcms/payload/compare/v2.11.0...v2.11.1) (2024-02-16)
### Features
* **db-postgres:** adds idType to use uuid or serial id columns ([#3864](https://github.com/payloadcms/payload/issues/3864)) ([d6c2578](https://github.com/payloadcms/payload/commit/d6c25783cfa97983bf9db27ceb5ccd39a62c62f1))
* **db-postgres:** reconnect after disconnection from database ([#5086](https://github.com/payloadcms/payload/issues/5086)) ([bf942fd](https://github.com/payloadcms/payload/commit/bf942fdfa6ea9c26cf05295cc9db646bf31fa622))
* **plugin-search:** add req to beforeSync args for transactions ([#5068](https://github.com/payloadcms/payload/issues/5068)) ([98b87e2](https://github.com/payloadcms/payload/commit/98b87e22782c0a788f79326f22be05a6b176ad74))
* **richtext-lexical:** add justify aligment to AlignFeature ([#4035](https://github.com/payloadcms/payload/issues/4035)) ([#4868](https://github.com/payloadcms/payload/issues/4868)) ([6d6823c](https://github.com/payloadcms/payload/commit/6d6823c3e5609a58eeeeb8d043945a762f9463df))
* **richtext-lexical:** AddBlock handle for all nodes, even if they aren't empty paragraphs ([#5063](https://github.com/payloadcms/payload/issues/5063)) ([00fc034](https://github.com/payloadcms/payload/commit/00fc0343dabf184d5bab418d47c403b3ad11698f))
* **richtext-lexical:** Update lexical from 0.12.6 to 0.13.1, port over all useful changes from playground ([#5066](https://github.com/payloadcms/payload/issues/5066)) ([0d18822](https://github.com/payloadcms/payload/commit/0d18822062275c1826c8e2c3da2571a2b3483310))
### Bug Fixes
* **db-mongodb:** find versions pagination ([#5091](https://github.com/payloadcms/payload/issues/5091)) ([5d4022f](https://github.com/payloadcms/payload/commit/5d4022f1445e2809c01cb1dd599280f0a56cdc6e))
* **db-postgres:** query using blockType ([#5044](https://github.com/payloadcms/payload/issues/5044)) ([35c2a08](https://github.com/payloadcms/payload/commit/35c2a085efa6d5ad59779960874bc9728a17e3a0))
* filterOptions errors cause transaction to abort ([#5079](https://github.com/payloadcms/payload/issues/5079)) ([5f3d016](https://github.com/payloadcms/payload/commit/5f3d0169bee21e1c0963dbd7ede9fe5f1c46a5a5))
* **plugin-form-builder:** hooks do not respect transactions ([#5069](https://github.com/payloadcms/payload/issues/5069)) ([82e9d31](https://github.com/payloadcms/payload/commit/82e9d31127c8df83c5bed92a5ffdab76d331900f))
* remove collection findByID caching ([#5034](https://github.com/payloadcms/payload/issues/5034)) ([1ac943e](https://github.com/payloadcms/payload/commit/1ac943ed5e8416883b863147fdf3c23380955559))
* **richtext-lexical:** do not remove adjacent paragraph node when inserting certain nodes in empty editor ([#5061](https://github.com/payloadcms/payload/issues/5061)) ([6323965](https://github.com/payloadcms/payload/commit/6323965c652ea68dffeb716957b124d165b9ce96))
* **uploads:** account for serverURL when retrieving external file ([#5102](https://github.com/payloadcms/payload/issues/5102)) ([25cee8b](https://github.com/payloadcms/payload/commit/25cee8bb102bf80b3a4bfb4b4e46712722cc7f0d))
### ⚠ BREAKING CHANGES: @payloadcms/richtext-lexical
* **richtext-lexical:** Update lexical from 0.12.6 to 0.13.1, port over all useful changes from playground (#5066)
- You HAVE to make sure that any versions of the lexical packages (IF you have any installed) match the lexical version which richtext-lexical uses: v0.13.1. If you do not do this, you may be plagued by React useContext / "cannot find active editor state" errors
- Updates to lexical's API, e.g. the removal of INTERNAL_isPointSelection, could be breaking depending on your code. Please consult the [lexical changelog](https://github.com/facebook/lexical/blob/main/CHANGELOG.md).
## [2.11.0](https://github.com/payloadcms/payload/compare/v2.10.1...v2.11.0) (2024-02-09)
### Features
* exposes collapsible provider with more functionality ([#5043](https://github.com/payloadcms/payload/issues/5043)) ([df39602](https://github.com/payloadcms/payload/commit/df39602758ae8dc3765bb48e51f7a657babfa559))
## [2.10.1](https://github.com/payloadcms/payload/compare/v2.10.0...v2.10.1) (2024-02-09)
### Bug Fixes
* clearable cells handle null values ([#5038](https://github.com/payloadcms/payload/issues/5038)) ([f6d7da7](https://github.com/payloadcms/payload/commit/f6d7da751039df25066b51bb91d6453e1a4efd82))
* **db-mongodb:** handle null values with exists ([#5037](https://github.com/payloadcms/payload/issues/5037)) ([cdc4cb9](https://github.com/payloadcms/payload/commit/cdc4cb971b9180ba2ed09741f5af1a3c18292828))
* **db-postgres:** handle nested docs with drafts ([#5012](https://github.com/payloadcms/payload/issues/5012)) ([da184d4](https://github.com/payloadcms/payload/commit/da184d40ece74bffb224002eb5df8f6987d65043))
* ensures docs with the same id are shown in relationship field select ([#4859](https://github.com/payloadcms/payload/issues/4859)) ([e1813fb](https://github.com/payloadcms/payload/commit/e1813fb884e0dc84203fcbab87527a99a4d3a5d7))
* query relationships by explicit id field ([#5022](https://github.com/payloadcms/payload/issues/5022)) ([a0a58e7](https://github.com/payloadcms/payload/commit/a0a58e7fd20dff54d210c968f4d5defd67441bdd))
* **richtext-lexical:** make editor reactive to initialValue changes ([#5010](https://github.com/payloadcms/payload/issues/5010)) ([2315781](https://github.com/payloadcms/payload/commit/2315781f1891ddde4b4c5f2f0cfa1c17af85b7a9))
## [2.10.0](https://github.com/payloadcms/payload/compare/v2.9.0...v2.10.0) (2024-02-06)
### Features
* add more options to addFieldStatePromise so that it can be used for field flattening ([#4799](https://github.com/payloadcms/payload/issues/4799)) ([8725d41](https://github.com/payloadcms/payload/commit/8725d411645bb0270376e235669f46be2227ecc0))
* extend transactions to cover after and beforeOperation hooks ([#4960](https://github.com/payloadcms/payload/issues/4960)) ([1e8a6b7](https://github.com/payloadcms/payload/commit/1e8a6b7899f7b1e6451cc4d777602208478b483c))
* previousValue and previousSiblingDoc args added to beforeChange field hooks ([#4958](https://github.com/payloadcms/payload/issues/4958)) ([5d934ba](https://github.com/payloadcms/payload/commit/5d934ba02d07d98f781ce983228858ee5ce5c226))
* re-use existing logger instance passed to payload.init ([#3124](https://github.com/payloadcms/payload/issues/3124)) ([471d211](https://github.com/payloadcms/payload/commit/471d2113a790dc0d54b2f8ed84e6899310efd600))
* **richtext-lexical:** Blocks: generate type definitions for blocks fields ([#4529](https://github.com/payloadcms/payload/issues/4529)) ([90d7ee3](https://github.com/payloadcms/payload/commit/90d7ee3e6535d51290fc734b284ff3811dbda1f8))
* use deletion success message from server if provided ([#4966](https://github.com/payloadcms/payload/issues/4966)) ([e3c8105](https://github.com/payloadcms/payload/commit/e3c8105cc2ed6fdf8007d97cd7b5556fc71ed724))
### Bug Fixes
* **db-postgres:** filtering relationships with drafts enabled ([#4998](https://github.com/payloadcms/payload/issues/4998)) ([c3a3942](https://github.com/payloadcms/payload/commit/c3a39429697e9d335e9be199e7caafb82eb26219))
* **db-postgres:** handle schema changes with supabase ([#4968](https://github.com/payloadcms/payload/issues/4968)) ([5d3659d](https://github.com/payloadcms/payload/commit/5d3659d48ad8bbf5d96fbcd80434d2287cab97e0))
* **db-postgres:** indexes not created for non unique field names ([#4967](https://github.com/payloadcms/payload/issues/4967)) ([64f705c](https://github.com/payloadcms/payload/commit/64f705c3c94148972f67e8175e718015760d6430))
* **db-postgres:** indexes not creating for relationships, arrays, hasmany and blocks ([#4976](https://github.com/payloadcms/payload/issues/4976)) ([47106d5](https://github.com/payloadcms/payload/commit/47106d5a1af2ebd073fbbc6e474174c3d3835e5c))
* **db-postgres:** localized field sort count ([#4997](https://github.com/payloadcms/payload/issues/4997)) ([f3876c2](https://github.com/payloadcms/payload/commit/f3876c2a39efe19a1864213306725aadcc14f130))
* ensures docPermissions fallback to collection permissions on create ([#4969](https://github.com/payloadcms/payload/issues/4969)) ([afa2b94](https://github.com/payloadcms/payload/commit/afa2b942e0aad90c55744ae13e0ffe1cefa4585d))
* **migrations:** safely create migration file when no name passed ([#4995](https://github.com/payloadcms/payload/issues/4995)) ([0740d50](https://github.com/payloadcms/payload/commit/0740d5095ee1aef13e4e37f6b174d529f0f2d993))
* **plugin-seo:** tabbedUI with email field causes duplicate field ([#4944](https://github.com/payloadcms/payload/issues/4944)) ([db22cbd](https://github.com/payloadcms/payload/commit/db22cbdf21a39ed0604ab96c57ca4242eac82ce7))
## [2.9.0](https://github.com/payloadcms/payload/compare/v2.8.2...v2.9.0) (2024-01-26)
### Features
* forceAcceptWarning migration arg added to accept prompts ([#4874](https://github.com/payloadcms/payload/issues/4874)) ([eba53ba](https://github.com/payloadcms/payload/commit/eba53ba60afd7c5d37389377ed06a9b556058d49))
### Bug Fixes
* afterLogin hook write conflicts ([#4904](https://github.com/payloadcms/payload/issues/4904)) ([3eb681e](https://github.com/payloadcms/payload/commit/3eb681e847e9c55eaaa69c22bea4f4e66c7eac36))
* **db-postgres:** migrate down error ([#4861](https://github.com/payloadcms/payload/issues/4861)) ([dfba522](https://github.com/payloadcms/payload/commit/dfba5222f3abf3f236dc9212a28e1aec7d7214d5))
* **db-postgres:** query unset relation ([#4862](https://github.com/payloadcms/payload/issues/4862)) ([8ce15c8](https://github.com/payloadcms/payload/commit/8ce15c8b07800397a50dcf790c263ed5b3cfad53))
* migrate down missing filter for latest batch ([#4860](https://github.com/payloadcms/payload/issues/4860)) ([b99d24f](https://github.com/payloadcms/payload/commit/b99d24fcfa698c493ea01c41621201abe18fabe3))
* **plugin-cloud-storage:** slow get file performance large collections ([#4927](https://github.com/payloadcms/payload/issues/4927)) ([f73d503](https://github.com/payloadcms/payload/commit/f73d503fecdfa5cefdc26ab9aad60b00563f881e))
* remove No Options dropdown from hasMany fields ([#4899](https://github.com/payloadcms/payload/issues/4899)) ([e5a7907](https://github.com/payloadcms/payload/commit/e5a7907a72c1371447ac2f71fce213ed22246092))
* upload input drawer does not show draft versions ([#4903](https://github.com/payloadcms/payload/issues/4903)) ([6930c4e](https://github.com/payloadcms/payload/commit/6930c4e9f2200853121391ad8f8df48ea66c40a4))
## [2.8.2](https://github.com/payloadcms/payload/compare/v2.8.1...v2.8.2) (2024-01-16)
### Features
* **db-postgres:** support drizzle logging config ([#4809](https://github.com/payloadcms/payload/issues/4809)) ([371353f](https://github.com/payloadcms/payload/commit/371353f1535fbab4ebd9f56fc14fd10a30eec289))
* **plugin-form-builder:** add validation for form ID when creating a submission ([#4730](https://github.com/payloadcms/payload/pull/4730))
* **plugin-seo:** add support for interfaceName and fieldOverrides ([#4695](https://github.com/payloadcms/payload/pull/4695))
### Bug Fixes
* **db-mongodb:** mongodb versions creating duplicates ([#4825](https://github.com/payloadcms/payload/issues/4825)) ([a861311](https://github.com/payloadcms/payload/commit/a861311c5a98126700f98f9a2ab380782e754717))
* **db-mongodb:** transactionOptions=false typeErrors ([82383a5](https://github.com/payloadcms/payload/commit/82383a5b5f52785115c0feb970da70e91971b7ca))
* **db-postgres:** Remove duplicate keys from response ([#4747](https://github.com/payloadcms/payload/issues/4747)) ([eb9e771](https://github.com/payloadcms/payload/commit/eb9e771a9ca03636486d36654f215b73435574cb))
* **db-postgres:** validateExistingBlockIsIdentical with arrays ([3b88adc](https://github.com/payloadcms/payload/commit/3b88adc7d0594af63ce190c40c9ee3905df67a31))
* **db-postgres:** validateExistingBlockIsIdentical with other tables ([0647c87](https://github.com/payloadcms/payload/commit/0647c870f15dc1b122734b678c2abeb6f56377d4))
* **plugin-seo:** fix missing spread operator in URL generator function ([#4723](https://github.com/payloadcms/payload/pull/4723))
* removes max-width from field-types class & correctly sets it on uploads ([#4829](https://github.com/payloadcms/payload/issues/4829)) ([ee5390a](https://github.com/payloadcms/payload/commit/ee5390aaca37a4154cde8392b60f091ec3e5175c))
## [2.8.1](https://github.com/payloadcms/payload/compare/v2.8.0...v2.8.1) (2024-01-12)
### Bug Fixes
* corrects config usage in build bin script ([#4796](https://github.com/payloadcms/payload/issues/4796)) ([775502b](https://github.com/payloadcms/payload/commit/775502b1616c1bd35a3044438e253a0e84219f99))
## [2.8.0](https://github.com/payloadcms/payload/compare/v2.7.0...v2.8.0) (2024-01-12)
### Features
* allow custom config properties in blocks ([#4766](https://github.com/payloadcms/payload/issues/4766)) ([d92af29](https://github.com/payloadcms/payload/commit/d92af295ebe253160ac4c8fb788a1fb143ab85ae))
* **logger:** show local time ([#4663](https://github.com/payloadcms/payload/issues/4663)) ([493fde5](https://github.com/payloadcms/payload/commit/493fde5ccceb9a95d0b950a028a1d2f8888b4e64))
* **plugin-cloud:** use resend smtp instead of custom transport ([#4746](https://github.com/payloadcms/payload/issues/4746)) ([5cfde54](https://github.com/payloadcms/payload/commit/5cfde542b19988985746e220829d429a84ba3976))
* **plugin-seo:** add fr translations ([#4774](https://github.com/payloadcms/payload/issues/4774)) ([4319fe1](https://github.com/payloadcms/payload/commit/4319fe1c6e332d35124356ce5d5d0fb48fe199e7))
* **plugin-seo:** remove support for payload <2.7.0 ([#4765](https://github.com/payloadcms/payload/issues/4765)) ([5e08368](https://github.com/payloadcms/payload/commit/5e083689d016fbff6c83419336e920f248932993))
### Bug Fixes
* allow a custom ID field to be nested inside unnamed tabs and rows ([#4701](https://github.com/payloadcms/payload/issues/4701)) ([6d5ac1d](https://github.com/payloadcms/payload/commit/6d5ac1de1ef55c4d51b253b4cf959bb703316c49))
* build payload without initializing ([#4028](https://github.com/payloadcms/payload/issues/4028)) ([1115387](https://github.com/payloadcms/payload/commit/11153877447af68389dde80fff2f9ee869468acb))
* **db-mongodb:** limit=0 returns unpaginated ([63e5c43](https://github.com/payloadcms/payload/commit/63e5c43fe620458936e2ebc4f5468aff9cb23e02))
* **db-postgres:** totalPages value when limit=0 ([5702b83](https://github.com/payloadcms/payload/commit/5702b83e829b5b1a3d95ce4a1c1967c3ec630373))
* migration regression ([#4777](https://github.com/payloadcms/payload/issues/4777)) ([fa3b3dd](https://github.com/payloadcms/payload/commit/fa3b3dd62d0a060f7419fd21d69eafff9bf99a61))
* **db-mongodb:** migration regression ([#4777](https://github.com/payloadcms/payload/issues/4777)) ([fa3b3dd](https://github.com/payloadcms/payload/commit/fa3b3dd62d0a060f7419fd21d69eafff9bf99a61))
* **db-postgres:**migration regression ([#4777](https://github.com/payloadcms/payload/issues/4777)) ([fa3b3dd](https://github.com/payloadcms/payload/commit/fa3b3dd62d0a060f7419fd21d69eafff9bf99a61))
* passes `draft=true` in fetch for relationships ([#4784](https://github.com/payloadcms/payload/issues/4784)) ([0a259d2](https://github.com/payloadcms/payload/commit/0a259d27b5ef0d632ca54cd0a9ab99629f94c2a0))
* **plugin-form-builder:** replaces curly brackets with lexical editor ([#4753](https://github.com/payloadcms/payload/issues/4753)) ([8481846](https://github.com/payloadcms/payload/commit/84818469ea50d43276915d36bd92769422eadeb0))
* prioritizes `value` key when filtering / querying for relationships ([#4727](https://github.com/payloadcms/payload/issues/4727)) ([d0f7677](https://github.com/payloadcms/payload/commit/d0f7677d5ff2e0109fc348260d87e2606fdbd293))
* text hasMany validation ([#4789](https://github.com/payloadcms/payload/issues/4789)) ([e2e56a4](https://github.com/payloadcms/payload/commit/e2e56a4d58a9e1c31c05a0624f35642f58da162b))
### ⚠ BREAKING CHANGES
#### @payloadcms/plugin-seo
* remove support for payload <2.7.0 ([#4765](https://github.com/payloadcms/payload/pull/4765))
## [2.7.0](https://github.com/payloadcms/payload/compare/v2.6.0...v2.7.0) (2024-01-09)
### Features
* **db-mongodb:** improve transaction support by passing req to migrations ([682eca2](https://github.com/payloadcms/payload/commit/682eca21860a4e2b2ab0bfd85613818790247224))
* **db-postgres:** improve transaction support by passing req to migrations ([555d027](https://github.com/payloadcms/payload/commit/555d02769a8731aeebbff9b67f9b0e1022904ade))
* hasMany property for text fields ([#4605](https://github.com/payloadcms/payload/issues/4605)) ([f43cf18](https://github.com/payloadcms/payload/commit/f43cf185d45b3c75fa0d78acd91e6cb60d87f166))
* improve transaction support by passing req to migrations ([1d14d9f](https://github.com/payloadcms/payload/commit/1d14d9f8b8ed077691175030182f094bb300ed17))
* **plugin-seo:** add i18n ([#4665](https://github.com/payloadcms/payload/issues/4665)) ([3027a03](https://github.com/payloadcms/payload/commit/3027a03ad11ecd679278e44a013e4dea4aa42b8d))
* provide document info to ActionsProvider ([#4696](https://github.com/payloadcms/payload/issues/4696)) ([6a8a6e4](https://github.com/payloadcms/payload/commit/6a8a6e4ef4913e0889e4d2eac82b28b9e4e8db22))
### Bug Fixes
* adds objectID validation to isValidID if of type `text` ([#4689](https://github.com/payloadcms/payload/issues/4689)) ([d419275](https://github.com/payloadcms/payload/commit/d419275fb50f0922307f2d3b4c0fcf80ac5ec98b))
* allow json field to be saved empty and reflect value changes ([#4687](https://github.com/payloadcms/payload/issues/4687)) ([0fb3a9c](https://github.com/payloadcms/payload/commit/0fb3a9ca89d1b63faea179bfa9b5b3d0a69c9398))
* custom ids in versions ([#4680](https://github.com/payloadcms/payload/issues/4680)) ([5d15955](https://github.com/payloadcms/payload/commit/5d15955f839d3f0cc557d8a8d7cc3a9e52e2f6b1))
* custom overrides of breadcrumb and parent fields ([7db58b4](https://github.com/payloadcms/payload/commit/7db58b482bba7e715c5be23cfe1a84295e95da29))
* **db-mongodb:** migration error calling beginTransaction with transactionOptions false ([21b9453](https://github.com/payloadcms/payload/commit/21b9453cf4e6eebf145d89a0190942015658413d))
* **db-mongodb:** querying plan for collections ignoring indexes ([#4655](https://github.com/payloadcms/payload/issues/4655)) ([63bc4ca](https://github.com/payloadcms/payload/commit/63bc4cabe1dea5f233aa1d9d4e64f3af93a8e081))
* **db-postgres:** incorrect results querying json field using exists operator ([9d9ac0e](https://github.com/payloadcms/payload/commit/9d9ac0ec28c97281bfdc7d6fb78c52baea492380))
* **db-postgres:** migrate down only runs latest batch size ([6acfae8](https://github.com/payloadcms/payload/commit/6acfae8ee7614746797e1fa91e1fd41c0240fdcd))
* **db-postgres:** query on json properties ([ec4d2f9](https://github.com/payloadcms/payload/commit/ec4d2f97cbf1c89d837372059bf3bb77f3ea6594))
* **db-postgres:** validation prevents group fields in blocks ([#4699](https://github.com/payloadcms/payload/issues/4699)) ([cab6bab](https://github.com/payloadcms/payload/commit/cab6babd608daeaabf9b63b1b446fded6804b60f))
* non-boolean condition result causes infinite looping ([#4579](https://github.com/payloadcms/payload/issues/4579)) ([a3e7816](https://github.com/payloadcms/payload/commit/a3e78161b551e8286063a173645a1d3dee162ad1))
* **plugin-form-builder:** slate serializer should replace curly braces in links ([#4703](https://github.com/payloadcms/payload/issues/4703)) ([28a3012](https://github.com/payloadcms/payload/commit/28a30120dd1aa3279fb2133aa0a0b1638d144be4))
* **plugin-nested-docs:** breadcrumbsFieldSlug used in resaveSelfAfterCreate hook ([a5a91c0](https://github.com/payloadcms/payload/commit/a5a91c08a9ade1482c512d3fa4c4f519ad85cf74))
* **plugin-nested-docs:** children wrongly publishing draft data ([#4692](https://github.com/payloadcms/payload/issues/4692)) ([5539942](https://github.com/payloadcms/payload/commit/55399424a13b1e0532d9eeefd09d442c107c3eda))
* **plugin-nested-docs:** custom parent field slug ([635e7c2](https://github.com/payloadcms/payload/commit/635e7c26e8b3b5138cf5a9bcb29e8ddd4b1e69b6))
* **plugin-nested-docs:** parent filterOptions errors when specifying breadcrumbsFieldSlug ([c4a4678](https://github.com/payloadcms/payload/commit/c4a4678afb097cf94c682595a78e416767a1fea8))
* prevents row overflow ([#4704](https://github.com/payloadcms/payload/issues/4704)) ([9828772](https://github.com/payloadcms/payload/commit/98287728900cb88fa6a465899f030f81df28fc69))
* relations with number based ids (postgres) show untitled ID: x ([1b91408](https://github.com/payloadcms/payload/commit/1b914083c8ee0c1b1d64fa7d4471ede0a24cfdb7))
* sidebar fields not disabled by access permissions ([#4682](https://github.com/payloadcms/payload/issues/4682)) ([85e38b7](https://github.com/payloadcms/payload/commit/85e38b7cfd5c0772344c4a8fb5100f7c48eb508f))
* unlock user condition always passes due to seconds conversion ([#4610](https://github.com/payloadcms/payload/issues/4610)) ([d543665](https://github.com/payloadcms/payload/commit/d543665995410256f77fe136173339aee6dcc7da))
## [2.6.0](https://github.com/payloadcms/payload/compare/v2.5.0...v2.6.0) (2024-01-03)
### Features
* **db-mongodb:** add transactionOptions ([f2c8ac4](https://github.com/payloadcms/payload/commit/f2c8ac4a9aa9120339af6759170f5a708469698d))
* extend locales to have fallbackLocales ([9fac2ef](https://github.com/payloadcms/payload/commit/9fac2ef24e2ade4cf55b0d6a0e7f67e0edf57539))
### Bug Fixes
* "The punycode module is deprecated" warning by updating nodemailer ([00d8480](https://github.com/payloadcms/payload/commit/00d8480062d99dee56ef61a955f48a92efa6cbea))
* adjusts json field joi schema to allow editorOptions ([bff4cf5](https://github.com/payloadcms/payload/commit/bff4cf518f748efb9179f112c606d11d25db3d99))
* **db-postgres:** Wait for transaction to complete on commit ([#4582](https://github.com/payloadcms/payload/issues/4582)) ([a71d37b](https://github.com/payloadcms/payload/commit/a71d37b39806cd5956378a10246802d01d06c2dd))
* detect language from request headers accept-language ([#4656](https://github.com/payloadcms/payload/issues/4656)) ([69a9944](https://github.com/payloadcms/payload/commit/69a99445c9f1638a962a9c08ffe0bdc22e538bf6))
* graphql multiple locales ([98890ee](https://github.com/payloadcms/payload/commit/98890eee1f527c8f245b2353d7e1caca4d2a7d8c))
* navigation locks when modal is closed with esc ([#4664](https://github.com/payloadcms/payload/issues/4664)) ([be3beab](https://github.com/payloadcms/payload/commit/be3beabb9bafa137aa89e84cf47246017e969be8))
* req.locale and req.fallbackLocale get reassigned in local operations ([aa048d5](https://github.com/payloadcms/payload/commit/aa048d5409acd42b8f56367a16934085df9fbce2))
* resets actions array when navigating out of view with actions ([#4585](https://github.com/payloadcms/payload/issues/4585)) ([5c55231](https://github.com/payloadcms/payload/commit/5c5523195ccfa94a9bf42441e2a378f87836e64d))
* **richtext-lexical:** z-index issues ([#4570](https://github.com/payloadcms/payload/issues/4570)) ([8015e99](https://github.com/payloadcms/payload/commit/8015e999cd5834f532a200ef03fd392d04b3209f))
* tab field error when using the same interface name ([#4657](https://github.com/payloadcms/payload/issues/4657)) ([f1fa374](https://github.com/payloadcms/payload/commit/f1fa374ed12b50fdf210f17ae1dda603f09a9726))
## [2.5.0](https://github.com/payloadcms/payload/compare/v2.4.0...v2.5.0) (2023-12-19)
### Features
* add Chinese Traditional translation ([#4372](https://github.com/payloadcms/payload/issues/4372)) ([50253f6](https://github.com/payloadcms/payload/commit/50253f617c22d0d185bbac7f9d4304cddbc01f06))
* add context to auth and globals local API ([#4449](https://github.com/payloadcms/payload/issues/4449)) ([168d629](https://github.com/payloadcms/payload/commit/168d6296974042c3ff2a113f9f6c2bded7ba2b3e))
* adds new `actions` property to admin customization ([#4468](https://github.com/payloadcms/payload/issues/4468)) ([9e8f14a](https://github.com/payloadcms/payload/commit/9e8f14a897e77f6933eedb2410956a468f4187c3))
* async live preview urls ([#4339](https://github.com/payloadcms/payload/issues/4339)) ([5f17324](https://github.com/payloadcms/payload/commit/5f173241df6dc316d498767b1c81718e9c2b9a51))
* pass path to FieldDescription ([#4364](https://github.com/payloadcms/payload/issues/4364)) ([3b8a27d](https://github.com/payloadcms/payload/commit/3b8a27d199b3969cbca6ca750450798cb70f21e8))
* **plugin-form-builder:** Lexical support ([#4487](https://github.com/payloadcms/payload/issues/4487)) ([c6c5cab](https://github.com/payloadcms/payload/commit/c6c5cabfbb7eb954eea51170a6af7582b1f9b84b))
* prevent querying relationship when filterOptions returns false ([#4392](https://github.com/payloadcms/payload/issues/4392)) ([c1bd338](https://github.com/payloadcms/payload/commit/c1bd338d0d5e899f3892f1d18e355c00b265447a))
* **richtext-lexical:** improve floating select menu Dropdown classNames ([#4444](https://github.com/payloadcms/payload/issues/4444)) ([9331204](https://github.com/payloadcms/payload/commit/9331204295bfeaf7dd10bc075f42995b2cab2de4))
* **richtext-lexical:** improve link URL validation ([#4442](https://github.com/payloadcms/payload/issues/4442)) ([9babf68](https://github.com/payloadcms/payload/commit/9babf6804ce04d5828167eb8e7717727fe1cd472))
* **richtext-lexical:** lazy import React components to prevent client-only code from leaking into the server ([#4290](https://github.com/payloadcms/payload/issues/4290)) ([5de347f](https://github.com/payloadcms/payload/commit/5de347ffffca3bf38315d3d87d2ccc5c28cd2723))
* **richtext-lexical:** Link & Relationship Feature: field-level configurable allowed relationships ([#4182](https://github.com/payloadcms/payload/issues/4182)) ([7af8f29](https://github.com/payloadcms/payload/commit/7af8f29b4a8dddf389356e4db142f8d434cdc964))
* **richtext-lexical:** link node: change doc data format to be consistent with relationship field ([#4504](https://github.com/payloadcms/payload/issues/4504)) ([cc0ba89](https://github.com/payloadcms/payload/commit/cc0ba895188f40181c6ba3779f66d547d4ea66f9))
* **richtext-lexical:** rename TreeviewFeature into TreeViewFeature ([#4520](https://github.com/payloadcms/payload/issues/4520)) ([c49fd66](https://github.com/payloadcms/payload/commit/c49fd6692231b68ca61b079103a0fd7aa4673be1))
* **richtext-lexical:** Slate to Lexical converter: add blockquote conversion, convert custom link fields ([#4486](https://github.com/payloadcms/payload/issues/4486)) ([31f8f3c](https://github.com/payloadcms/payload/commit/31f8f3cac6bfd08f3adfa0a026a57c4b1b510045))
* **richtext-lexical:** Upload html serializer: Output picture element if the image has multiple sizes, improve absolute URL creation ([e558894](https://github.com/payloadcms/payload/commit/e55889480fceb8995646621923159d92de6e89c9))
### Bug Fixes
* adds bg color for year/month select options in datepicker ([#4508](https://github.com/payloadcms/payload/issues/4508)) ([07371b9](https://github.com/payloadcms/payload/commit/07371b9cad111999f2df4e1f709d6b95cd511c15))
* correctly fetches externally stored files when passing uploadEdits ([#4505](https://github.com/payloadcms/payload/issues/4505)) ([228d45c](https://github.com/payloadcms/payload/commit/228d45cf52e592cea6377cd93648fba75d73c88d))
* cursor jumping around inside json field ([#4453](https://github.com/payloadcms/payload/issues/4453)) ([6300037](https://github.com/payloadcms/payload/commit/63000373e66fb39443f882689e0ecf5c11ed8ad0))
* **db-mongodb:** documentDB unique constraint throws incorrect error ([#4513](https://github.com/payloadcms/payload/issues/4513)) ([05e8914](https://github.com/payloadcms/payload/commit/05e8914db70fa64bfb2d15ecfb58e9c229d71108))
* **db-postgres:** findOne correctly querying with where queries ([#4550](https://github.com/payloadcms/payload/issues/4550)) ([8bc31cd](https://github.com/payloadcms/payload/commit/8bc31cd5923517ab39ae1427aa0d0fb19d876dab))
* **db-postgres:** querying nested blocks fields ([#4404](https://github.com/payloadcms/payload/issues/4404)) ([6e9ae65](https://github.com/payloadcms/payload/commit/6e9ae65374124ee000cc2988ef77247c94b0dd18))
* **db-postgres:** sorting on a not-configured field throws error ([#4382](https://github.com/payloadcms/payload/issues/4382)) ([dbaecda](https://github.com/payloadcms/payload/commit/dbaecda0e92fcb0fa67b4c5ac085e025f02de53a))
* defaultValues computed on new globals ([#4380](https://github.com/payloadcms/payload/issues/4380)) ([b6cffce](https://github.com/payloadcms/payload/commit/b6cffcea07b9fa21698b00b8bbed6f27197ded41))
* disallow duplicate fieldNames to be used on the same level in the config ([#4381](https://github.com/payloadcms/payload/issues/4381)) ([a1d66b8](https://github.com/payloadcms/payload/commit/a1d66b83e0dbea21e8da549b73cd25c537a57938))
* ensure ui fields do not make it into gql schemas ([#4457](https://github.com/payloadcms/payload/issues/4457)) ([3a20ddc](https://github.com/payloadcms/payload/commit/3a20ddc5f85162a316006f22ba66ee1c7aab99e3))
* format fields within tab for list controls ([#4516](https://github.com/payloadcms/payload/issues/4516)) ([2650c70](https://github.com/payloadcms/payload/commit/2650c70960a7374307a8862c3940c97d337d1d30))
* formats locales with multiple labels for versions locale selector ([#4495](https://github.com/payloadcms/payload/issues/4495)) ([8257661](https://github.com/payloadcms/payload/commit/8257661c47b5b968a57fb2228d7045d876a3f484))
* graphql schema generation for fields without queryable subfields ([#4463](https://github.com/payloadcms/payload/issues/4463)) ([13e3e06](https://github.com/payloadcms/payload/commit/13e3e0671353ca34e603fece57a12199f2082ca0))
* handles null upload field values ([#4397](https://github.com/payloadcms/payload/issues/4397)) ([cf9a370](https://github.com/payloadcms/payload/commit/cf9a3704df21ce8b32feb0680793cba804cd66f7))
* **live-preview:** populates rte uploads and relationships ([#4379](https://github.com/payloadcms/payload/issues/4379)) ([4090aeb](https://github.com/payloadcms/payload/commit/4090aebb0e94e776258f0c1c761044a4744a1857))
* **live-preview:** sends raw js objects through window.postMessage instead of json ([#4354](https://github.com/payloadcms/payload/issues/4354)) ([03a3872](https://github.com/payloadcms/payload/commit/03a387233d1b8876a2fcaa5f3b3fd5ed512c0bc4))
* make admin navigation transition smoother ([#4217](https://github.com/payloadcms/payload/issues/4217)) ([eb6572e](https://github.com/payloadcms/payload/commit/eb6572e9e56e680cad331c1bc5da47e91306deb9))
* omit field default value if read access returns false ([#4518](https://github.com/payloadcms/payload/issues/4518)) ([3e9ef84](https://github.com/payloadcms/payload/commit/3e9ef849cd8e69e1e8d7f2f653f0647e93c8ab39))
* pin ts-node versions which are causing swc errors ([#4447](https://github.com/payloadcms/payload/issues/4447)) ([b9c0248](https://github.com/payloadcms/payload/commit/b9c024882350d14edd57f0f662a2269ed37975e3))
* properly spreads collection fields into non-tabbed configs [#50](https://github.com/payloadcms/payload/issues/50) ([#51](https://github.com/payloadcms/payload/issues/51)) ([7e88159](https://github.com/payloadcms/payload/commit/7e88159e99e2afdc10addc02cf299c11fe188be7))
* **plugin-form-builder:** removes use of slate in rich-text serializer ([#4451](https://github.com/payloadcms/payload/issues/4451)) ([3df52a8](https://github.com/payloadcms/payload/commit/3df52a88568622f8fafeabad47c7501229e4ea5f))
* **plugin-nested-docs:** properly exports field utilities ([#4462](https://github.com/payloadcms/payload/issues/4462)) ([1cc87bd](https://github.com/payloadcms/payload/commit/1cc87bd8ea575dfa2e1f5ce5b38414bbba95b2cb))
* **richtext-*:** loosen RichTextAdapter types due to re-occuring ts strict mode errors ([#4416](https://github.com/payloadcms/payload/issues/4416)) ([48f1299](https://github.com/payloadcms/payload/commit/48f1299fcba3e3811c6a7f31499f238537f9a5e3))
* **richtext-lexical:** Blocks field: should not prompt for unsaved changes due to value comparison between null and non-existent props ([#4450](https://github.com/payloadcms/payload/issues/4450)) ([548e78c](https://github.com/payloadcms/payload/commit/548e78c598cb6d029e7cc40f80d9855754f043bc))
* **richtext-lexical:** do not add unnecessary paragraph before upload, relationship and blocks nodes ([#4441](https://github.com/payloadcms/payload/issues/4441)) ([5c2739e](https://github.com/payloadcms/payload/commit/5c2739ebd144620cfd4ff02531f5812dd62ac61d))
* **richtext-lexical:** lexicalHTML field not working when used inside of Blocks field ([128f9c4](https://github.com/payloadcms/payload/commit/128f9c4e7e6e20dd1ee221f49428a5bce5179c5f))
* **richtext-lexical:** lexicalHTML field now works when used inside of row fields ([#4440](https://github.com/payloadcms/payload/issues/4440)) ([0421173](https://github.com/payloadcms/payload/commit/0421173f9e2d6db1b6a94b25884ea807921f2d09))
* **richtext-lexical:** not all types of URLs are validated correctly ([ac7f980](https://github.com/payloadcms/payload/commit/ac7f9809bc2b9fb6a52b48c10f7d51414801e4de))
* searching by id sends undefined in where query param ([#4464](https://github.com/payloadcms/payload/issues/4464)) ([46e8c01](https://github.com/payloadcms/payload/commit/46e8c01fbed68856be68804f2bd9744c4c6f5a95))
* simplifies query validation and fixes nested relationship fields ([#4391](https://github.com/payloadcms/payload/issues/4391)) ([4b5453e](https://github.com/payloadcms/payload/commit/4b5453e8e5484f7afcadbf5bccf8369b552969c6))
* updates return value of empty arrays in getDataByPath ([#4553](https://github.com/payloadcms/payload/issues/4553)) ([f3748a1](https://github.com/payloadcms/payload/commit/f3748a1534a13e6d844aadd9f0e3e6acbe483d03))
* upload editing error with plugin-cloud ([#4170](https://github.com/payloadcms/payload/issues/4170)) ([fcbe574](https://github.com/payloadcms/payload/commit/fcbe5744d945dc43642cdaa2007ddc252ecafafa))
* upload related issues, cropping, fetching local file, external preview image ([#4461](https://github.com/payloadcms/payload/issues/4461)) ([45c472d](https://github.com/payloadcms/payload/commit/45c472d6b35c41e597038089ad1755cdb88193b6))
* uploads files after validation ([#4218](https://github.com/payloadcms/payload/issues/4218)) ([65adfd2](https://github.com/payloadcms/payload/commit/65adfd21ed538b79628dc4f8ce9e1a5a1bba6aed))
### ⚠ BREAKING CHANGES
#### @payloadcms/richtext-lexical
* **richtext-lexical:** rename TreeviewFeature into TreeViewFeature ([#4520](https://github.com/payloadcms/payload/issues/4520)) ([c49fd66](https://github.com/payloadcms/payload/commit/c49fd6692231b68ca61b079103a0fd7aa4673be1))
If you import TreeviewFeature, you have to rename the import to use TreeViewFeature (capitalized "V")
* **richtext-lexical:** link node: change doc data format to be consistent with relationship field ([#4504](https://github.com/payloadcms/payload/issues/4504)) ([cc0ba89](https://github.com/payloadcms/payload/commit/cc0ba895188f40181c6ba3779f66d547d4ea66f9))
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.
* **richtext-lexical:** improve floating select menu Dropdown classNames ([#4444](https://github.com/payloadcms/payload/issues/4444)) ([9331204](https://github.com/payloadcms/payload/commit/9331204295bfeaf7dd10bc075f42995b2cab2de4))
Dropdown component has a new mandatory sectionKey prop
* **richtext-lexical:** lazy import React components to prevent client-only code from leaking into the server ([#4290](https://github.com/payloadcms/payload/issues/4290)) ([5de347f](https://github.com/payloadcms/payload/commit/5de347ffffca3bf38315d3d87d2ccc5c28cd2723))
1. Most important: If you are updating `@payloadcms/richtext-lexical` to v0.4.0 or higher, you will HAVE to update payload to the latest version as well. If you don't update it, payload likely won't start up due to validation errors. It's generally good practice to upgrade packages prefixed with @payloadcms/ together with payload and keep the versions in sync.
2. `@payloadcms/richtext-slate` is not affected by this.
3. Every single property in the `Feature` interface which accepts a React component now no longer accepts a React component, but a function which imports a React component instead. This is done to ensure no unnecessary client-only code is leaked to the server when importing Features on a server.
Here's an example migration:
Old:
```ts
import { BlockIcon } from '../../lexical/ui/icons/Block'
...
Icon: BlockIcon,
```
New:
```ts
// import { BlockIcon } from '../../lexical/ui/icons/Block' // <= Remove this import
...
Icon: () =>
// @ts-expect-error
import('../../lexical/ui/icons/Block').then((module) => module.BlockIcon),
```
Or alternatively, if you're using default exports instead of named exports:
```ts
// import BlockIcon from '../../lexical/ui/icons/Block' // <= Remove this import
...
Icon: () =>
// @ts-expect-error
import('../../lexical/ui/icons/Block'),
```
4. The types for `SanitizedEditorConfig` and `EditorConfig` have changed. Their respective `lexical` property no longer expects the `LexicalEditorConfig`. It now expects a function returning the `LexicalEditorConfig`. You will have to adjust this if you adjusted that property anywhere, e.g. when initializing the lexical field editor property, or when initializing a new headless editor.
5. The following exports are now exported from the `@payloadcms/richtext-lexical/components` subpath exports instead of `@payloadcms/richtext-lexical`:
- `ToolbarButton`
- `ToolbarDropdown`
- `RichTextCell`
- `RichTextField`
- `defaultEditorLexicalConfig`
You will have to adjust your imports, only if you import any of those properties in your project.
## @payloadcms/richtext-*
### [@payloadcms/richtext-lexical 0.4.1](https://github.com/payloadcms/payload/compare/richtext-lexical/0.4.0...richtext-lexical/0.4.1) (2023-12-07)

View File

@@ -0,0 +1,22 @@
/* THIS FILE WAS GENERATED AUTOMATICALLY BY PAYLOAD. */
import type { Metadata } from 'next'
import config from '@payload-config'
/* DO NOT MODIFY IT BECAUSE IT COULD BE REWRITTEN AT ANY TIME. */
import { NotFoundPage, generatePageMetadata } from '@payloadcms/next/views'
type Args = {
params: {
segments: string[]
}
searchParams: {
[key: string]: string | string[]
}
}
export const generateMetadata = ({ params, searchParams }: Args): Promise<Metadata> =>
generatePageMetadata({ config, params, searchParams })
const NotFound = ({ params, searchParams }: Args) => NotFoundPage({ config, params, searchParams })
export default NotFound

View File

@@ -0,0 +1,22 @@
/* THIS FILE WAS GENERATED AUTOMATICALLY BY PAYLOAD. */
import type { Metadata } from 'next'
import config from '@payload-config'
/* DO NOT MODIFY IT BECAUSE IT COULD BE REWRITTEN AT ANY TIME. */
import { RootPage, generatePageMetadata } from '@payloadcms/next/views'
type Args = {
params: {
segments: string[]
}
searchParams: {
[key: string]: string | string[]
}
}
export const generateMetadata = ({ params, searchParams }: Args): Promise<Metadata> =>
generatePageMetadata({ config, params, searchParams })
const Page = ({ params, searchParams }: Args) => RootPage({ config, params, searchParams })
export default Page

View File

@@ -0,0 +1,10 @@
/* THIS FILE WAS GENERATED AUTOMATICALLY BY PAYLOAD. */
/* DO NOT MODIFY it because it could be re-written at any time. */
import config from '@payload-config'
import { REST_DELETE, REST_GET, REST_OPTIONS, REST_PATCH, REST_POST } from '@payloadcms/next/routes'
export const GET = REST_GET(config)
export const POST = REST_POST(config)
export const DELETE = REST_DELETE(config)
export const PATCH = REST_PATCH(config)
export const OPTIONS = REST_OPTIONS(config)

View File

@@ -0,0 +1,6 @@
/* THIS FILE WAS GENERATED AUTOMATICALLY BY PAYLOAD. */
/* DO NOT MODIFY it because it could be re-written at any time. */
import config from '@payload-config'
import { GRAPHQL_PLAYGROUND_GET } from '@payloadcms/next/routes'
export const GET = GRAPHQL_PLAYGROUND_GET(config)

View File

@@ -0,0 +1,6 @@
/* THIS FILE WAS GENERATED AUTOMATICALLY BY PAYLOAD. */
/* DO NOT MODIFY it because it could be re-written at any time. */
import config from '@payload-config'
import { GRAPHQL_POST } from '@payloadcms/next/routes'
export const POST = GRAPHQL_POST(config)

16
app/(payload)/layout.tsx Normal file
View File

@@ -0,0 +1,16 @@
/* THIS FILE WAS GENERATED AUTOMATICALLY BY PAYLOAD. */
import configPromise from '@payload-config'
import { RootLayout } from '@payloadcms/next/layouts'
// import '@payloadcms/ui/styles.css' // Uncomment this line if `@payloadcms/ui/client` in `tsconfig.json` points to `/ui/dist` instead of `/ui/src`
/* DO NOT MODIFY IT BECAUSE IT COULD BE REWRITTEN AT ANY TIME. */
import React from 'react'
import './custom.scss'
type Args = {
children: React.ReactNode
}
const Layout = ({ children }: Args) => <RootLayout config={configPromise}>{children}</RootLayout>
export default Layout

5
app/my-route/route.ts Normal file
View File

@@ -0,0 +1,5 @@
export const GET = () => {
return Response.json({
hello: 'elliot',
})
}

View File

@@ -1,39 +0,0 @@
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

@@ -3,7 +3,7 @@ title: Collection Access Control
label: Collections
order: 20
desc: With Collection-level Access Control you can define which users can create, read, update or delete Collections.
keywords: collections, access control, permissions, documentation, Content Management System, cms, headless, javascript, node, react, express
keywords: collections, access control, permissions, documentation, Content Management System, cms, headless, javascript, node, react, nextjs
---
You can define Collection-level Access Control within each Collection's `access` property. All Access Control functions accept one `args` argument.
@@ -51,10 +51,10 @@ Returns a boolean which allows/denies access to the `create` request.
**Available argument properties:**
| Option | Description |
| ---------- | -------------------------------------------------------------------------- |
| **`req`** | The Express `request` object containing the currently authenticated `user` |
| **`data`** | The data passed to create the document with. |
| Option | Description |
| ---------- | ---------------------------------------------------------------------------------------------------------------------------- |
| **`req`** | The [Request](https://developer.mozilla.org/en-US/docs/Web/API/Request) object containing the currently authenticated `user` |
| **`data`** | The data passed to create the document with. |
**Example:**
@@ -80,7 +80,7 @@ Read access functions can return a boolean result or optionally return a [query
| Option | Description |
| --------- | -------------------------------------------------------------------------- |
| **`req`** | The Express `request` object containing the currently authenticated `user` |
| **`req`** | The [Request](https://developer.mozilla.org/en-US/docs/Web/API/Request) object containing the currently authenticated `user` |
| **`id`** | `id` of document requested, if within `findByID` |
**Example:**
@@ -111,7 +111,7 @@ Update access functions can return a boolean result or optionally return a [quer
| Option | Description |
| ---------- | -------------------------------------------------------------------------- |
| **`req`** | The Express `request` object containing the currently authenticated `user` |
| **`req`** | The [Request](https://developer.mozilla.org/en-US/docs/Web/API/Request) object containing the currently authenticated `user` |
| **`id`** | `id` of document requested to update |
| **`data`** | The data passed to update the document with |
@@ -138,7 +138,7 @@ Similarly to the Update function, returns a boolean or a [query constraint](/doc
| Option | Description |
| --------- | --------------------------------------------------------------------------------------------------- |
| **`req`** | The Express `request` object with additional `user` property, which is the currently logged in user |
| **`req`** | The [Request](https://developer.mozilla.org/en-US/docs/Web/API/Request) object with additional `user` property, which is the currently logged in user |
| **`id`** | `id` of document requested to delete |
**Example:**
@@ -173,7 +173,7 @@ If the Collection is [used to access the Payload Admin panel](/docs/admin/overvi
| Option | Description |
| --------- | -------------------------------------------------------------------------- |
| **`req`** | The Express `request` object containing the currently authenticated `user` |
| **`req`** | The [Request](https://developer.mozilla.org/en-US/docs/Web/API/Request) object containing the currently authenticated `user` |
### Unlock
@@ -183,4 +183,4 @@ Determines which users can [unlock](/docs/authentication/operations#unlock) othe
| Option | Description |
| --------- | -------------------------------------------------------------------------- |
| **`req`** | The Express `request` object containing the currently authenticated `user` |
| **`req`** | The [Request](https://developer.mozilla.org/en-US/docs/Web/API/Request) object containing the currently authenticated `user` |

View File

@@ -3,7 +3,7 @@ title: Field-level Access Control
label: Fields
order: 30
desc: Field-level Access Control is specified within a field's config, and allows you to define which users can create, read or update Fields.
keywords: fields, access control, permissions, documentation, Content Management System, cms, headless, javascript, node, react, express
keywords: fields, access control, permissions, documentation, Content Management System, cms, headless, javascript, node, react, nextjs
---
Field Access Control is specified with functions inside a field's config. All field-level Controls return a boolean value to allow or deny access for the specified operation. No field-level Access Controls support returning query constraints. All Access Control functions accept one `args` argument.
@@ -47,7 +47,7 @@ Returns a boolean which allows or denies the ability to set a field's value when
| Option | Description |
| ----------------- | -------------------------------------------------------------------------- |
| **`req`** | The Express `request` object containing the currently authenticated `user` |
| **`req`** | The [Request](https://developer.mozilla.org/en-US/docs/Web/API/Request) object containing the currently authenticated `user` |
| **`data`** | The full data passed to create the document. |
| **`siblingData`** | Immediately adjacent field data passed to create the document. |
@@ -59,7 +59,7 @@ Returns a boolean which allows or denies the ability to read a field's value. If
| Option | Description |
| ----------------- | -------------------------------------------------------------------------- |
| **`req`** | The Express `request` object containing the currently authenticated `user` |
| **`req`** | The [Request](https://developer.mozilla.org/en-US/docs/Web/API/Request) object containing the currently authenticated `user` |
| **`id`** | `id` of the document being read |
| **`doc`** | The full document data. |
| **`siblingData`** | Immediately adjacent field data of the document being read. |
@@ -74,7 +74,7 @@ If `false` is returned and you attempt to update the field's value, the operatio
| Option | Description |
| ----------------- | -------------------------------------------------------------------------- |
| **`req`** | The Express `request` object containing the currently authenticated `user` |
| **`req`** | The [Request](https://developer.mozilla.org/en-US/docs/Web/API/Request) object containing the currently authenticated `user` |
| **`id`** | `id` of the document being updated |
| **`data`** | The full data passed to update the document. |
| **`siblingData`** | Immediately adjacent field data passed to update the document with. |

View File

@@ -3,13 +3,11 @@ title: Globals Access Control
label: Globals
order: 40
desc: Global-level Access Control is specified within each Global's `access` property and allows you to define which users can read or update Globals.
keywords: globals, access control, permissions, documentation, Content Management System, cms, headless, javascript, node, react, express
keywords: globals, access control, permissions, documentation, Content Management System, cms, headless, javascript, node, react, nextjs
---
You can define Global-level Access Control within each Global's `access` property. All Access Control functions accept one `args` argument.
\*\*Available argument properties:
## Available Controls
| Function | Allows/Denies Access |
@@ -47,7 +45,7 @@ Returns a boolean result or optionally a [query constraint](/docs/queries/overvi
| Option | Description |
| --------- | -------------------------------------------------------------------------- |
| **`req`** | The Express `request` object containing the currently authenticated `user` |
| **`req`** | The [Request](https://developer.mozilla.org/en-US/docs/Web/API/Request) object containing the currently authenticated `user` |
### Update
@@ -57,5 +55,5 @@ Returns a boolean result or optionally a [query constraint](/docs/queries/overvi
| Option | Description |
| ---------- | -------------------------------------------------------------------------- |
| **`req`** | The Express `request` object containing the currently authenticated `user` |
| **`req`** | The [Request](https://developer.mozilla.org/en-US/docs/Web/API/Request) object containing the currently authenticated `user` |
| **`data`** | The data passed to update the global with. |

View File

@@ -3,7 +3,7 @@ title: Access Control
label: Overview
order: 10
desc: Payload makes it simple to define and manage access control. By declaring roles, you can set permissions and restrict what your users can interact with.
keywords: overview, access control, permissions, documentation, Content Management System, cms, headless, javascript, node, react, express
keywords: overview, access control, permissions, documentation, Content Management System, cms, headless, javascript, node, react, nextjs
---
Access control within Payload is extremely powerful while remaining easy and intuitive to manage. Declaring who should have access to what documents is no more complex than writing a simple JavaScript function that either returns a `boolean` or a [`query`](/docs/queries/overview) constraint to restrict which documents users can interact with.
@@ -19,9 +19,9 @@ Access control within Payload is extremely powerful while remaining easy and int
- Restricting a `User` to only be able to see their own `Order`(s), but no others
- Allowing `User`s that belong to a certain `Organization` to access only that `Organization`'s `Resource`s
### Default Settings
## Default Settings
**By default, all Collections and Globals require that a user is logged in to be able to interact in any way.** The default Access Control function evaluates the `user` from the Express `req` and returns `true` if a user is logged in, and `false` if not.
**By default, all Collections and Globals require that a user is logged in to be able to interact in any way.** The default Access Control function evaluates the `user` from the `req` and returns `true` if a user is logged in, and `false` if not.
**Default Access function:**
@@ -37,13 +37,15 @@ 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>
### Access Control Types
## Access Control Types
You can manage access within Payload on three different levels:
@@ -51,7 +53,7 @@ You can manage access within Payload on three different levels:
- [Fields](/docs/access-control/fields)
- [Globals](/docs/access-control/globals)
### When Access Control is Executed
## When Access Control is Executed
<Banner type="success">
<strong>Note:</strong>
@@ -60,17 +62,17 @@ You can manage access within Payload on three different levels:
your access control is executed.
</Banner>
#### As you execute operations
### As you execute operations
When you perform Payload operations like `create`, `read`, `update`, and `delete`, your access control functions will be executed before any changes or operations are completed.
#### Within the Admin UI
### Within the Admin UI
The Payload Admin UI responds dynamically to the access control that you define. For example, if you restrict editing a `ExampleCollection` to only users that feature a `role` of `admin`, the Payload Admin UI will **hide** the `ExampleCollection` from the Admin UI entirely. This is super powerful and allows you to control who can do what with your Admin UI.
To accomplish this, Payload ships with an `Access` operation, which is executed when a user logs into the Admin UI. Payload will execute each one of your access control functions, across all collections, globals, and fields, at the top level and return a response that contains a reflection of what the currently authenticated user can do with your application.
### Argument Availability
## Argument Availability
<Banner type="warning">
<strong>Important:</strong>

View File

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

View File

@@ -3,39 +3,43 @@ title: Swap in your own React components
label: Custom Components
order: 20
desc: Fully customize your Admin Panel by swapping in your own React components. Add fields, remove views, update routes and change functions to sculpt your perfect Dashboard.
keywords: admin, components, custom, documentation, Content Management System, cms, headless, javascript, node, react, express
keywords: admin, components, custom, documentation, Content Management System, cms, headless, javascript, node, react, nextjs
---
While designing the Payload Admin panel, we determined it should be as minimal and straightforward as possible to allow easy customization and control. There are many times where you may want to completely control how a whole view or a field works. You might even want to add in new views entirely. In order for Payload to support this level of customization without introducing versioning / future-proofing issues, Payload provides for a pattern to supply your own React components via your Payload config.
The [Payload Admin](./overview) panel is designed to be as minimal and straightforward as possible to allow easy customization and control. In order for Payload to support this level of customization without introducing versioning or future-proofing issues, Payload provides a pattern for you to supply your own React components via your Payload config.
To swap in your own React component, first, consult the list of available component overrides below. Determine the scope that corresponds to what you are trying to accomplish, and then author your React component accordingly.
<Banner type="warning">
All Custom Components in the Admin Panel are [React Server Components](https://react.dev/reference/rsc/server-components). This means they are rendered on the server
</Banner>
To swap in your own React component, first, consult the list of available components below. Determine the scope that corresponds to what you are trying to accomplish, and then author your React component accordingly.
<Banner type="success">
<strong>Tip:</strong>
<br />
Custom components will automatically be provided with all props that the default component normally
accepts.
Custom components will automatically be provided with all props that the default component
normally accepts.
</Banner>
### Base Component Overrides
## Base Component Overrides
You can override a set of admin panel-wide components by providing a component to your base Payload config's `admin.components` property. The following options are available:
| Path | Description |
| --------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **`Nav`** | Contains the sidebar / mobile menu in its entirety. |
| **`BeforeNavLinks`** | Array of components to inject into the built-in Nav, _before_ the links themselves. |
| **`AfterNavLinks`** | Array of components to inject into the built-in Nav, _after_ the links. |
| **`BeforeDashboard`** | Array of components to inject into the built-in Dashboard, _before_ the default dashboard contents. |
| **`AfterDashboard`** | Array of components to inject into the built-in Dashboard, _after_ the default dashboard contents. [Demo](https://github.com/payloadcms/payload/tree/main/test/admin/components/AfterDashboard/index.tsx) |
| **`BeforeLogin`** | Array of components to inject into the built-in Login, _before_ the default login form. |
| **`AfterLogin`** | Array of components to inject into the built-in Login, _after_ the default login form. |
| **`logout.Button`** | A custom React component. |
| **`graphics.Icon`** | Used as a graphic within the `Nav` component. Often represents a condensed version of a full logo. |
| **`graphics.Logo`** | The full logo to be used in contexts like the `Login` view. |
| **`providers`** | Define your own provider components that will wrap the Payload Admin UI. [More](#custom-providers) |
| **`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) |
| Path | Description |
|-----------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **`Nav`** | Contains the sidebar / mobile menu in its entirety. |
| **`BeforeNavLinks`** | Array of components to inject into the built-in Nav, _before_ the links themselves. |
| **`AfterNavLinks`** | Array of components to inject into the built-in Nav, _after_ the links. |
| **`BeforeDashboard`** | Array of components to inject into the built-in Dashboard, _before_ the default dashboard contents. |
| **`AfterDashboard`** | Array of components to inject into the built-in Dashboard, _after_ the default dashboard contents. [Demo](https://github.com/payloadcms/payload/tree/main/test/admin/components/AfterDashboard/index.tsx) |
| **`BeforeLogin`** | Array of components to inject into the built-in Login, _before_ the default login form. |
| **`AfterLogin`** | Array of components to inject into the built-in Login, _after_ the default login form. |
| **`logout.Button`** | A custom React component. |
| **`graphics.Icon`** | Used as a graphic within the `Nav` component. Often represents a condensed version of a full logo. |
| **`graphics.Logo`** | The full logo to be used in contexts like the `Login` view. |
| **`providers`** | Define your own provider components that will wrap the [Admin Panel](./overview). [More](#custom-providers) |
| **`actions`** | Array of custom components to be rendered in the [Admin Panel](./overview) header, providing additional interactivity and functionality. |
| **`views`** | Override or create new [Views](./views) within the [Admin Panel](./overview). |
Here is a full example showing how to swap some of these components for your own.
@@ -73,76 +77,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 by default, all of which can be overridden:
| Property | Description |
| ------------------ | ---------------------------------------------------------------------------------------------------------------------------- |
| **`Account`** | The Account view is used to show the currently logged in user's Account page. |
| **`Dashboard`** | The main landing page of the Admin panel. |
To swap out any of these views, simply pass in your custom component to the `admin.components.views` property of your Payload config. For example:
```ts
// payload.config.ts
{
// ...
admin: {
components: {
views: {
Account: MyCustomAccountView,
Dashboard: MyCustomDashboardView,
},
},
},
}
```
For more granular control, pass a configuration object instead. 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 |
| ------------------ | ---------------------------------------------------------------------------------------------------------------------------- |
| **`Component`** \* | Pass in the component that should be rendered when a user navigates to this route. |
| **`path`** \* | React Router `path`. [See the React Router docs](https://v5.reactrouter.com/web/api/Route/path-string-string) for more info. |
| **`exact`** | React Router `exact` property. [More](https://v5.reactrouter.com/web/api/Route/exact-bool) |
| **`strict`** | React Router `strict` property. [More](https://v5.reactrouter.com/web/api/Route/strict-bool) |
| **`sensitive`** | React Router `sensitive` property. [More](https://v5.reactrouter.com/web/api/Route/sensitive-bool) |
_\* An asterisk denotes that a property is required._
#### Adding new views
To add a _new_ view to the Admin Panel, simply add another key to the `views` object with at least a `path` and `Component` property. For example:
```ts
// payload.config.ts
{
// ...
admin: {
components: {
views: {
MyCustomView: {
Component: MyCustomView,
path: '/my-custom-view',
},
},
},
},
}
```
<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
## Collections
You can override components on a collection-by-collection basis via the `admin.components` property.
@@ -156,25 +91,33 @@ You can override components on a collection-by-collection basis via the `admin.c
| **`edit.SaveDraftButton`** | Replace the default `Save Draft` button with a custom component. Drafts must be enabled and autosave must be disabled. |
| **`edit.PublishButton`** | Replace the default `Publish` button with a custom component. Drafts must be enabled. |
| **`edit.PreviewButton`** | Replace the default `Preview` button with a custom component. |
| **`views`** | Override or create new views within the Payload Admin UI. [More](#collection-views) |
| **`views`** | Override or create new [Views](./views) within the [Admin Panel](./overview). |
Here is a full example showing how to swap some of these components for your own:
`Collection.ts`
`CustomSaveButton.tsx`
```tsx
import * as React from 'react'
import { CustomSaveButtonProps } from 'payload/types'
import {
CustomSaveButtonProps,
CustomSaveDraftButtonProps,
CustomPublishButtonProps,
CustomPreviewButtonProps,
} from 'payload/types'
export const CustomSaveButton: CustomSaveButtonProps = ({ DefaultButton, label, save }) => {
return <DefaultButton label={label} save={save} />
const CustomSaveButton: CustomSaveButtonProps = ({
DefaultButton,
label,
save
}) => {
return (
<DefaultButton
label={label}
save={save}
/>
)
}
```
`CustomSaveDraftButton.tsx`
```tsx
import { CustomSaveDraftButtonProps } from 'payload/types'
export const CustomSaveDraftButton: CustomSaveDraftButtonProps = ({
DefaultButton,
@@ -182,8 +125,20 @@ export const CustomSaveDraftButton: CustomSaveDraftButtonProps = ({
label,
saveDraft,
}) => {
return <DefaultButton label={label} disabled={disabled} saveDraft={saveDraft} />
return (
<DefaultButton
label={label}
disabled={disabled}
saveDraft={saveDraft}
/>
)
}
```
`CustomPublishButton.tsx`
```tsx
import { CustomPreviewButtonProps } from 'payload/types'
export const CustomPublishButton: CustomPublishButtonProps = ({
DefaultButton,
@@ -191,8 +146,20 @@ export const CustomPublishButton: CustomPublishButtonProps = ({
label,
publish,
}) => {
return <DefaultButton label={label} disabled={disabled} publish={publish} />
return (
<DefaultButton
label={label}
disabled={disabled}
publish={publish}
/>
)
}
```
`CustomPreviewButton`
```tsx
import { CustomPreviewButtonProps } from 'payload/types'
export const CustomPreviewButton: CustomPreviewButtonProps = ({
DefaultButton,
@@ -200,8 +167,25 @@ export const CustomPreviewButton: CustomPreviewButtonProps = ({
label,
preview,
}) => {
return <DefaultButton label={label} disabled={disabled} preview={preview} />
return (
<DefaultButton
label={label}
disabled={disabled}
preview={preview}
/>
)
}
```
`collection.ts`
```tsx
import * as React from 'react'
import { CustomSaveButton } from './CustomSaveButton'
import { CustomSaveDraftButton } from './CustomSaveDraftButton'
import { CustomPublishButton } from './CustomPublishButton'
import { CustomPreviewButton } from './CustomPreviewButton'
export const MyCollection: SanitizedCollectionConfig = {
slug: 'my-collection',
@@ -214,87 +198,11 @@ export const MyCollection: SanitizedCollectionConfig = {
PreviewButton: CustomPreviewButton,
},
},
}
}
```
#### Collection views
To swap out entire views on collections, you can use the `admin.components.views` property on the collection's config. Payload renders the following views by default, all of which can be overridden:
| Property | Description |
| ------------------ | ---------------------------------------------------------------------------------------------------------------------------- |
| **`Edit`** | The Edit view is used to edit a single document for a given collection. |
| **`List`** | The List view is used to show a list of documents for a given collection. |
To swap out any of these views, simply pass in your custom component to the `admin.components.views` property of your Payload config. This will replace the entire view, including the page breadcrumbs, title, tabs, etc, _as well as all nested routes_.
```ts
// Collection.ts
{
// ...
admin: {
components: {
views: {
Edit: MyCustomEditView,
List: MyCustomListView,
},
},
},
}
```
_For help on how to build your own custom view components, see [building a custom view component](#building-a-custom-view-component)._
**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
{
// ...
admin: {
components: {
views: {
Edit: {
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],
},
},
},
},
}
```
**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
## Globals
As with Collections, you can override components on a global-by-global basis via the `admin.components` property.
@@ -304,359 +212,18 @@ As with Collections, you can override components on a global-by-global basis via
| **`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 by default, all of which can be overridden:
| Property | Description |
| ------------------ | ---------------------------------------------------------------------------------------------------------------------------- |
| **`Edit`** | The Edit view is used to edit a single document for a given Global. |
To swap out any of these views, simply pass in your custom component to the `admin.components.views` property of your Payload config. This will replace the entire view, including the page breadcrumbs, title, and tabs, _as well as all nested views_.
```ts
// Global.ts
{
// ...
admin: {
components: {
views: {
Edit: MyCustomEditView,
},
},
},
}
```
_For help on how to build your own custom view components, see [building a custom view component](#building-a-custom-view-component)._
**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
{
// ...
admin: {
components: {
views: {
Edit: {
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
},
},
},
},
},
}
```
You can also add _new_ tabs to the `Edit` view by adding another key to the `components.views.Edit[key]` object with a `path` and `Component` property. See [Custom Tabs](#custom-tabs) for more information.
### Custom Tabs
You can easily swap individual collection or global edit views. To do this, pass an _object_ to the `admin.components.views.Edit` property of the config. Payload renders the following views by default, all of which can be overridden:
| Property | Description |
| ------------------ | ---------------------------------------------------------------------------------------------------------------------------- |
| **`Default`** | The Default view is the primary view in which your document is edited. |
| **`Versions`** | The Versions view is used to view the version history of a single document. [More details](../versions) |
| **`Version`** | The Version view is used to view a single version of a single document for a given collection. [More details](../versions). |
| **`API`** | The API view is used to display the REST API JSON response for a given document. |
| **`LivePreview`** | The LivePreview view is used to display the Live Preview interface. [More details](../live-preview) |
Here is an example:
```ts
// Collection.ts or Global.ts
export const MyCollection: SanitizedCollectionConfig = {
slug: 'my-collection',
admin: {
components: {
views: {
Edit: { // You can also define `components.views.Edit` as a component, this will override _all_ nested views
Default: MyCustomDefaultTab,
Versions: MyCustomVersionsTab,
Version: MyCustomVersionTab,
API: MyCustomAPITab,
LivePreview: MyCustomLivePreviewTab,
},
},
},
},
}
```
To add a _new_ tab to the `Edit` view, simply add another key to `components.views.Edit[key]` with at least a `path` and `Component` property. For example:
```ts
// `Collection.ts` or `Global.ts`
export const MyCollection: SanitizedCollectionConfig = {
slug: 'my-collection',
admin: {
components: {
views: {
Edit: {
MyCustomTab: {
Component: MyCustomTab,
path: '/my-custom-tab',
// You an swap the entire tab component out for your own
Tab: MyCustomTab
},
AnotherCustomView: {
Component: AnotherCustomView,
path: '/another-custom-view',
// Or you can use the default tab component and just pass in your own label and href
Tab: {
label: 'Another Custom View',
href: '/another-custom-view',
}
},
},
},
},
},
}
```
### Building a custom view component
Your custom view components will be given all the props that a React Router `<Route />` typically would receive, as well as two props from Payload:
| Prop | Description |
| ----------------------- | ---------------------------------------------------------------------------- |
| **`user`** | The currently logged in user. Will be `null` if no user is logged in. |
| **`canAccessAdmin`** \* | If the currently logged in user is allowed to access the admin panel or not. |
<Banner type="warning">
<strong>Note:</strong>
<br />
It's up to you to secure your custom views. If your view requires a user to be logged in or to
have certain access rights, you should handle that within your view component yourself.
</Banner>
#### Example
You can find examples of custom views in the [Payload source code `/test/admin/components/views` folder](https://github.com/payloadcms/payload/tree/main/test/admin/components/views). There, you'll find two custom views:
1. A custom view that uses the `DefaultTemplate`, which is the built-in Payload template that displays the sidebar and "eyebrow nav"
1. A custom view that uses the `MinimalTemplate` - which is just a centered template used for things like logging in or out
To see how to pass in your custom views to create custom views of your own, take a look at the `admin.components.views` property of the [Payload test admin config](https://github.com/payloadcms/payload/blob/main/test/admin/config.ts).
### Fields
All Payload fields support the ability to swap in your own React components. So, for example, instead of rendering a default Text input, you might need to render a color picker that provides the editor with a custom color picker interface to restrict the data entered to colors only.
<Banner type="success">
<strong>Tip:</strong>
<br />
Don't see a built-in field type that you need? Build it! Using a combination of custom validation
and custom components, you can override the entirety of how a component functions within the admin
panel and effectively create your own field type.
</Banner>
**Fields support the following custom components:**
| Component | Description |
| ------------ | --------------------------------------------------------------------------------------------------------------------------- |
| **`Filter`** | Override the text input that is presented in the `List` view when a user is filtering documents by the customized field. |
| **`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 Label 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.
| Property | Description |
| ---------------- | ----------------------------------------------------------------- |
| **`field`** | An object that includes the field configuration. |
| **`colIndex`** | A unique number for the column in the list. |
| **`collection`** | An object with the config of the collection that the field is in. |
| **`cellData`** | The data for the field that the cell represents. |
| **`rowData`** | An object with all the field values for the row. |
#### Example
```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) => {
const { field, colIndex, collection, cellData, rowData } = props
return <span className={baseClass}>{cellData}</span>
}
```
## Field Component
When writing your own custom components you can make use of a number of hooks to set data, get reactive changes to other fields, get the id of the document or interact with a context from a custom provider.
### Sending and receiving values from the form
When swapping out the `Field` component, you'll be responsible for sending and receiving the field's `value` from the form itself. To do so, import the `useField` hook as follows:
```tsx
import { useField } from 'payload/components/forms'
type Props = { path: string }
const CustomTextField: React.FC<Props> = ({ path }) => {
// highlight-start
const { value, setValue } = useField<Props>({ path })
// highlight-end
return <input onChange={(e) => setValue(e.target.value)} value={value.path} />
}
```
<Banner type="success">
For more information regarding the hooks that are available to you while you build custom
components, including the <strong>useField</strong> hook, [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;
```
| **`views`** | Override or create new [Views](./views) within the [Admin Panel](./overview). |
## 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 do add your own context to any Payload app for use in other custom components within the [Admin Panel](./overview). Within your config add `admin.components.providers`, these can be used to share context or provide other custom functionality. See the [React Context](https://reactjs.org/docs/context.html) docs to learn more.
<Banner type="warning">
<strong>Reminder:</strong> Don't forget to pass the **children** prop through the provider
component for the admin UI to show
</Banner>
### Styling Custom Components
## 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.
@@ -666,23 +233,23 @@ To make use of Payload SCSS variables / mixins to use directly in your own compo
@import '~payload/scss';
```
### Getting the current language
## Getting the current language
When developing custom components you can support multiple languages to be consistent with Payload's i18n support. The best way to do this is to add your translation resources to the [i18n configuration](https://payloadcms.com/docs/configuration/i18n) and import `useTranslation` from `react-i18next` in your components.
When developing custom components you can support multiple languages to be consistent with Payload's i18n support. The best way to do this is to add your translation resources to the [i18n configuration](https://payloadcms.com/docs/configuration/i18n) and import `useTranslation` from `@payloadcms/ui/providers/Translation` in your components.
For example:
```tsx
import { useTranslation } from 'react-i18next'
import { useTranslation } from '@payloadcms/ui/providers/Translation'
const CustomComponent: React.FC = () => {
// highlight-start
const { t, i18n } = useTranslation('namespace1')
const { t, i18n } = useTranslation()
// highlight-end
return (
<ul>
<li>{t('key', { variable: 'value' })}</li>
<li>{t('namespace1:key', { variable: 'value' })}</li>
<li>{t('namespace2:key', { variable: 'value' })}</li>
<li>{i18n.language}</li>
</ul>
@@ -690,7 +257,7 @@ const CustomComponent: React.FC = () => {
}
```
### Getting the current locale
## Getting the current locale
In any custom component you can get the selected locale with `useLocale` hook. `useLocale` returns the full locale object, consisting of a `label`, `rtl`(right-to-left) property, and then `code`. Here is a simple example:

View File

@@ -1,12 +1,12 @@
---
title: Customizing CSS & SCSS
label: Customizing CSS
order: 40
order: 60
desc: Customize your Payload admin panel further by adding your own CSS or SCSS style sheet to the configuration, powerful theme and design options are waiting for you.
keywords: admin, css, scss, documentation, Content Management System, cms, headless, javascript, node, react, express
keywords: admin, css, scss, documentation, Content Management System, cms, headless, javascript, node, react, nextjs
---
### Adding your own CSS / SCSS
## Adding your own CSS / SCSS
You can add your own CSS by providing your base Payload config with a path to your own CSS or SCSS. Customize the styling of any part of the Payload dashboard as necessary.
@@ -25,7 +25,7 @@ const config = buildConfig({
})
```
### Overriding built-in styles
## Overriding built-in styles
To make it as easy as possible for you to override our styles, Payload uses [BEM naming conventions](http://getbem.com/) for all CSS within the Admin UI. If you provide your own CSS, you can override any built-in styles easily.
@@ -41,7 +41,7 @@ You can find the built-in Payload CSS variables within [`./src/admin/scss/app.sc
- Fonts
- Horizontal gutter
#### Dark mode
### Dark mode
<Banner type="warning">
If you're overriding colors or theme elevations, make sure to consider how your changes will

View File

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

194
docs/admin/fields.mdx Normal file
View File

@@ -0,0 +1,194 @@
---
title: Customizing Fields
label: Customizing Fields
order: 40
desc:
keywords:
---
All Payload fields support the ability to swap in your own React components. So, for example, instead of rendering a default Text input, you might need to render a color picker that provides the editor with a custom color picker interface to restrict the data entered to colors only.
<Banner type="success">
<strong>Tip:</strong>
<br />
Don't see a built-in field type that you need? Build it! Using a combination of custom validation
and custom components, you can override the entirety of how a component functions within the admin
panel and effectively create your own field type.
</Banner>
**Fields support the following custom components:**
| Component | Description |
| ------------ | --------------------------------------------------------------------------------------------------------------------------- |
| **`Filter`** | Override the text input that is presented in the `List` view when a user is filtering documents by the customized field. |
| **`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 Label 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.
| Property | Description |
| ---------------- | ----------------------------------------------------------------- |
| **`field`** | An object that includes the field configuration. |
| **`colIndex`** | A unique number for the column in the list. |
| **`collection`** | An object with the config of the collection that the field is in. |
| **`cellData`** | The data for the field that the cell represents. |
| **`rowData`** | An object with all the field values for the row. |
#### Example
```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) => {
const { field, colIndex, collection, cellData, rowData } = props
return <span className={baseClass}>{cellData}</span>
}
```
## Field Component
When writing your own custom components you can make use of a number of hooks to set data, get reactive changes to other fields, get the id of the document or interact with a context from a custom provider.
### Sending and receiving values from the form
When swapping out the `Field` component, you'll be responsible for sending and receiving the field's `value` from the form itself. To do so, import the `useField` hook as follows:
```tsx
import { useField } from 'payload/components/forms'
const CustomTextField: React.FC<{ path: string }> = ({ path }) => {
// highlight-start
const { value, setValue } = useField<string>({ path })
// highlight-end
return <input onChange={(e) => setValue(e.target.value)} value={value} />
}
```
<Banner type="success">
For more information regarding the hooks that are available to you while you build custom
components, including the <strong>useField</strong> hook, [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
```

View File

@@ -1,14 +1,14 @@
---
title: React Hooks
label: React Hooks
order: 30
order: 50
desc: Make use of all of the powerful React hooks that Payload provides.
keywords: admin, components, custom, documentation, Content Management System, cms, headless, javascript, node, react, express
keywords: admin, components, custom, documentation, Content Management System, cms, headless, javascript, node, react, nextjs
---
Payload provides a variety of powerful hooks that can be used within your own React components. With them, you can interface with Payload itself and build just about any type of complex customization you can think of—directly in familiar React code.
### useField
## useField
The `useField` hook is used internally within every applicable Payload field component, and it manages sending and receiving a field's state from its parent form.
@@ -52,7 +52,7 @@ const {
// The rest of your component goes here
```
### useFormFields
## useFormFields
There are times when a custom field component needs to have access to data from other fields, and you have a few options to do so. The `useFormFields` hook is a powerful and highly performant way to retrieve a form's field state, as well as to retrieve the `dispatchFields` method, which can be helpful for setting other fields' form states from anywhere within a form.
@@ -81,7 +81,7 @@ const MyComponent: React.FC = () => {
}
```
### useAllFormFields
## useAllFormFields
**To retrieve more than one field**, you can use the `useAllFormFields` hook. Your component will re-render when _any_ field changes, so use this hook only if you absolutely need to. Unlike the `useFormFields` hook, this hook does not accept a "selector", and it always returns an array with type of `[fields: Fields, dispatch: React.Dispatch<Action>]]`.
@@ -109,7 +109,7 @@ const ExampleComponent: React.FC = () => {
};
```
##### Updating other fields' values
#### Updating other fields' values
If you are building a custom component, then you should use `setValue` which is returned from the `useField` hook to programmatically set your field's value. But if you're looking to update _another_ field's value, you can use `dispatchFields` returned from `useFormFields`.
@@ -128,7 +128,7 @@ You can send the following actions to the `dispatchFields` function.
To see types for each action supported within the `dispatchFields` hook, check out the Form types [here](https://github.com/payloadcms/payload/blob/main/packages/payload/src/admin/components/forms/Form/types.ts).
### useForm
## useForm
The `useForm` hook can be used to interact with the form itself, and sends back many methods that can be used to reactively fetch form state without causing rerenders within your components each time a field is changed. This is useful if you have action-based callbacks that your components fire, and need to interact with form state _based on a user action_.
@@ -635,12 +635,44 @@ export const CustomArrayManager = () => {
]}
/>
### useDocumentInfo
## useCollapsible
The `useCollapsible` hook allows you to control parent collapsibles:
| Property | Description |
| ------------------------- | ------------------------------------------------------------------------------------------------------------ | --- |
| **`isCollapsed`** | 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 |
| **`isWithinCollapsible`** | Determine when you are within another collaspible | |
**Example:**
```tsx
import React from 'react'
import { useCollapsible } from 'payload/components/utilities'
const CustomComponent: React.FC = () => {
const { isCollapsed, toggle } = useCollapsible()
return (
<div>
<p className="field-type">I am {isCollapsed ? '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:
| Property | Description |
|---------------------------|--------------------------------------------------------------------------------------------------------------------|
| ------------------------- | ------------------------------------------------------------------------------------------------------------------ |
| **`collection`** | If the doc is a collection, its collection config will be returned |
| **`global`** | If the doc is a global, its global config will be returned |
| **`id`** | If the doc is a collection, its ID will be returned |
@@ -675,7 +707,7 @@ const LinkFromCategoryToPosts: React.FC = () => {
}
```
### useLocale
## useLocale
In any custom component you can get the selected locale object with the `useLocale` hook. `useLocale`gives you the full locale object, consisting of a `label`, `rtl`(right-to-left) property, and then `code`. Here is a simple example:
@@ -696,7 +728,7 @@ const Greeting: React.FC = () => {
}
```
### useAuth
## useAuth
Useful to retrieve info about the currently logged in user as well as methods for interacting with it. It sends back an object with the following properties:
@@ -723,7 +755,7 @@ const Greeting: React.FC = () => {
}
```
### useConfig
## useConfig
Used to easily fetch the full Payload config.
@@ -739,7 +771,7 @@ const MyComponent: React.FC = () => {
}
```
### useEditDepth
## useEditDepth
Sends back how many editing levels "deep" the current component is. Edit depth is relevant while adding new documents / editing documents in modal windows and other cases.
@@ -755,11 +787,39 @@ const MyComponent: React.FC = () => {
}
```
### usePreferences
## usePreferences
Returns methods to set and get user preferences. More info can be found [here](https://payloadcms.com/docs/admin/preferences).
### useTableColumns
## 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
@@ -776,24 +836,21 @@ const MyComponent: React.FC = () => {
// highlight-end
return (
<button
type="button"
onClick={resetColumns}
>
<button type="button" onClick={resetColumns}>
Reset columns
</button>
)
}
```
### useDocumentEvents
## 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. |
| 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:**
@@ -803,14 +860,11 @@ import { useDocumentEvents } from 'payload/components/hooks'
const ListenForUpdates: React.FC = () => {
const { mostRecentUpdate } = useDocumentEvents()
return (
<span>
{JSON.stringify(mostRecentUpdate)}
</span>
)
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.
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

@@ -3,16 +3,15 @@ title: The Admin Panel
label: Overview
order: 10
desc: Manage your data and customize the Admin Panel by swapping in your own React components. Create, modify or remove views, fields, styles and much more.
keywords: admin, components, custom, customize, documentation, Content Management System, cms, headless, javascript, node, react, express
keywords: admin, components, custom, customize, documentation, Content Management System, cms, headless, javascript, node, react, nextjs
---
Payload dynamically generates a beautiful, fully functional React admin panel to manage your data. It's extremely powerful and can be customized / extended upon easily by swapping in your own React components. You can add additional views, modify how built-in views look / work, swap out Payload branding for your client's, build your own field types and much more.
Payload dynamically generates a beautiful, fully functional Admin Panel to manage your users and data. The Payload Admin Panel is highly performant, even with 100+ fields, and is written fully in TypeScript. It is built with [React](https://react.dev) using the [Next.js App Router](https://nextjs.org/docs/app) and fully supports [React Server Components](https://react.dev/reference/rsc/server-components) which enables the use of the [Local API](/docs/local-api/overview) on the front-end.
The Payload Admin panel can be bundled with our officially supported [Vite](/docs/admin/vite) and [webpack](/docs/admin/webpack) bundlers or you can integrate another bundler following our adapter pattern approach.
When bundled, it is code-split, highly performant (even with 100+ fields), and written fully in TypeScript.
You can endlessly customize and extend the Admin UI by swapping your own in [Custom Components](./components) for everything from field labels to entire views. You can also modify built-in views, build your own fields, [swap out Payload branding for your own](https://payloadcms.com/blog/white-label-admin-ui), and so much more.
<Banner type="success">
The Admin panel is meant to be simple enough to give you a starting point but not bring too much
The Admin Panel is meant to be simple enough to give you a starting point but not bring too much
complexity, so that you can easily customize it to suit the needs of your application and your
editors.
</Banner>
@@ -20,44 +19,36 @@ When bundled, it is code-split, highly performant (even with 100+ fields), and w
<LightDarkImage
srcLight="https://payloadcms.com/images/docs/admin.jpg"
srcDark="https://payloadcms.com/images/docs/admin-dark.jpg"
alt="Admin panel with collapsible sidebar"
caption="Redesigned admin panel with a collapsible sidebar that's open by default, providing greater extensibility and enhanced horizontal real estate."
alt="Admin Panel with collapsible sidebar"
caption="Redesigned Admin Panel with a collapsible sidebar that's open by default, providing greater extensibility and enhanced horizontal real estate."
/>
## Admin Options
All options for the Admin panel are defined in your base Payload config file.
All high-level options for the Admin Panel are defined in your Payload config under the `admin` key:
| Option | Description |
| ----------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `bundler` | The bundler that you would like to use to bundle the admin panel. Officially supported bundlers: [Webpack](/docs/admin/webpack) and [Vite](/docs/admin/vite). |
| `user` | The `slug` of a Collection that you want be used to log in to the Admin dashboard. [More](/docs/admin/overview#the-admin-user-collection) |
| `buildPath` | Specify an absolute path for where to store the built Admin panel bundle used in production. Defaults to `path.resolve(process.cwd(), 'build')`. |
| `meta` | Base meta data to use for the Admin panel. Included properties are `titleSuffix`, `ogImage`, and `favicon`. |
| `disable` | If set to `true`, the entire Admin panel will be disabled. |
| `indexHTML` | Optionally replace the entirety of the `index.html` file used by the Admin panel. Reference the [base index.html file](https://github.com/payloadcms/payload/blob/main/packages/payload/src/admin/index.html) to ensure your replacement has the appropriate HTML elements. |
| `css` | Absolute path to a stylesheet that you can use to override / customize the Admin panel styling. [More](/docs/admin/customizing-css). |
| `scss` | Absolute path to a Sass variables / mixins stylesheet meant to override Payload styles to make for an easy re-skinning of the Admin panel. [More](/docs/admin/customizing-css#overriding-scss-variables). |
| `dateFormat` | Global date format that will be used for all dates in the Admin panel. Any valid [date-fns](https://date-fns.org/) format pattern can be used. |
| `user` | The `slug` of a Collection that you want to be used to log in to the Admin Panel. [More](/docs/admin/overview#the-admin-user-collection) |
| `buildPath` | Specify an absolute path for where to store the built Admin bundle used in production. Defaults to `path.resolve(process.cwd(), 'build')`. |
| `meta` | Base meta data to use for the Admin Panel. Included properties are `titleSuffix`, `icons`, and `openGraph`. Can be overridden on a per collection or per global basis. |
| `disable` | If set to `true`, the entire Admin Panel will be disabled. |
| `dateFormat` | Global date format that will be used for all dates in the Admin Panel. Any valid [date-fns](https://date-fns.org/) format pattern can be used. |
| `avatar` | Set account profile picture. Options: `gravatar`, `default` or a custom React component. |
| `autoLogin` | Used to automate admin log-in for dev and demonstration convenience. [More](/docs/authentication/config). |
| `livePreview` | Enable real-time editing for instant visual feedback of your front-end application. [More](/docs/live-preview/overview). |
| `components` | Component overrides that affect the entirety of the Admin panel. [More](/docs/admin/components) |
| `webpack` | Customize the Webpack config that's used to generate the Admin panel. [More](/docs/admin/webpack) |
| `vite` | Customize the Vite config that's used to generate the Admin panel. [More](/docs/admin/vite) |
| `logoutRoute` | The route for the `logout` page. |
| `inactivityRoute` | The route for the `logout` inactivity page. |
| `components` | Component overrides that affect the entirety of the Admin Panel. [More](/docs/admin/components) |
| `routes` | Replace built-in Admin Panel routes with your own custom routes. [More](#custom-admin-panel-routes) |
### The Admin User Collection
<Banner type="warning">
<strong>Important:</strong>
<br />
The Payload Admin panel can only be used by one Collection that supports
[Authentication](/docs/authentication/overview).
The Admin Panel can only be used by a single auth-enabled Collection. To enable authentication for a Collection, simply set `auth: true` in the Collection's configuration. See [Authentication](/docs/authentication/overview) for more information.
</Banner>
To specify which Collection to use to log in to the Admin panel, pass the `admin` options a `user` key equal to the slug of the Collection that you'd like to use.
To specify which Collection to allow to login to the Admin Panel, pass the `admin.user` key equal to the slug of any auth-enabled Collection. See [Authentication](/docs/authentication/overview) for more information.
`payload.config.js`:
@@ -71,21 +62,67 @@ const config = buildConfig({
})
```
By default, if you have not specified a Collection, Payload will automatically provide you with a `User` Collection which will be used to access the Admin panel. You can customize or override the fields and settings of the default `User` Collection by passing your own collection using `users` as its `slug` to Payload. When this is done, Payload will use your provided `User` Collection instead of its default version.
<Banner type="info">
By default, if you have not specified a Collection, Payload will automatically provide a `User` Collection with access the Admin Panel. You can customize or override the fields and settings of the default `User` Collection by adding your own Collection with `slug: 'users'`. Doing this will force Payload to use your provided `User` Collection instead of its default version.
</Banner>
**Note: you can use whatever Collection you'd like to access the Admin panel as long as the Collection supports Authentication. It doesn't need to be called `users`!**
<Banner type="warning">
<strong>Note:</strong>
<br />
You can use whatever Collection you'd like to access the Admin Panel as long as the Collection supports [Authentication](/docs/authentication/overview). It doesn't need to be called `users`. For example, you could use a Collection called `admins` or `editors` instead.
</Banner>
For example, you may wish to have two Collections that both support `Authentication`:
For example, you may wish to have two Collections that both support Authentication:
- `admins` - meant to have a higher level of permissions to manage your data and access the Admin panel
- `customers` - meant for end users of your app that should not be allowed to log into the Admin panel
- `admins` - meant to have a higher level of permissions to manage your data and access the Admin Panel
- `customers` - meant for end users of your app that should not be allowed to log into the Admin Panel
This is totally possible. For the above scenario, by specifying `admin: { user: 'admins' }`, your Payload Admin panel will use `admins`. Any users logged in as `customers` will not be able to log in via the Admin panel.
### Light and dark modes
Users in the admin panel have access to choosing between light mode and dark mode for their editing experience. The setting is managed while logged into the admin UI within the user account page and will be stored with the browser. By default, the operating system preference is detected and used.
This is totally possible. For the above scenario, by specifying `admin: { user: 'admins' }`, your Admin Panel will use `admins`. Any users logged in as `customers` will not be able to log in via the Admin Panel.
### Restricting user access
If you would like to restrict which users from a single Collection can access the Admin panel, you can use the `admin` access control function. [Click here](/docs/access-control/overview#admin) to learn more.
It is also possible to allow _multiple admin user types_ into the Admin Panel with limited permissions. To do this, add a `roles` or similar field to your auth-enabled Collection and use the `access.admin` property to limit access. See [Access Control](/docs/access-control/overview) for full details. For a working example, check out the [Auth Example](https://github.com/payloadcms/payload/tree/main/examples/auth/payload).
### I18n
The Payload Admin Panel is translated in over 30 languages and counting. Languages are automatically detected based on the user's browser and all text displays in that language. If no language was detected, or if the user's language is not yet supported, English will be chosen. Users can easily specify their language by selecting one from their account page. See [I18n](../configuration/i18n) for more information.
<Banner>
<strong>Note:</strong>
<br />
If there is a language that Payload does not yet support, we accept code
[contributions](https://github.com/payloadcms/payload/blob/main/CONTRIBUTING.md).
</Banner>
### Light and dark modes
Users in the Admin Panel have access to choosing between light mode and dark mode for their editing experience. The setting is managed while logged into the admin UI within the user account page and will be stored with the browser. By default, the operating system preference is detected and used.
### Custom admin panel routes
You can configure custom routes in the Admin Panel for the following routes:
| Option | Default route |
| ----------------- | ----------------------- |
| `account` | `/account` |
| `createFirstUser` | `/create-first-user` |
| `forgot` | `/forgot` |
| `inactivity` | `/logout-inactivity` |
| `login` | `/login` |
| `logout` | `/logout` |
| `reset` | `/reset` |
| `unauthorized` | `/unauthorized` |
`payload.config.js`:
```ts
import { buildConfig } from 'payload/config'
const config = buildConfig({
admin: {
routes: {
admin: '/custom-admin-route'
}
},
})
```

View File

@@ -3,7 +3,7 @@ title: Managing User Preferences
label: Preferences
order: 50
desc: Store the preferences of your users as they interact with the Admin panel.
keywords: admin, preferences, custom, customize, documentation, Content Management System, cms, headless, javascript, node, react, express
keywords: admin, preferences, custom, customize, documentation, Content Management System, cms, headless, javascript, node, react, nextjs
---
As your users interact with your Admin panel, you might want to store their preferences in a persistent manner, so that when they revisit the Admin panel, they can pick right back up where they left off.
@@ -21,7 +21,7 @@ Out of the box, Payload handles the persistence of your users' preferences in a
that is reading or setting a preference via all provided authentication methods.
</Banner>
### Use cases
## Use cases
This API is used significantly for internal operations of the Admin panel, as mentioned above. But, if you're building your own React components for use in the Admin panel, you can allow users to set their own preferences in correspondence to their usage of your components. For example:
@@ -30,7 +30,7 @@ This API is used significantly for internal operations of the Admin panel, as me
- You might want to store `recentlyAccessed` documents to give admin editors an easy shortcut back to their recently accessed documents on the `Dashboard` or similar
- Many other use cases exist. Invent your own! Give your editors an intelligent and persistent editing experience.
### Database
## Database
Payload automatically creates an internally used `payload-preferences` collection that stores user preferences. Each document in the `payload-preferences` collection contains the following shape:
@@ -44,15 +44,15 @@ Payload automatically creates an internally used `payload-preferences` collectio
| `createdAt` | A timestamp of when the preference was created. |
| `updatedAt` | A timestamp set to the last time the preference was updated. |
### APIs
## APIs
Preferences are available to both [GraphQL](/docs/graphql/overview#preferences) and [REST](/docs/rest-api/overview#) APIs.
### Adding or reading Preferences in your own components
## Adding or reading Preferences in your own components
The Payload admin panel offers a `usePreferences` hook. The hook is only meant for use within the admin panel itself. It provides you with two methods:
##### `getPreference`
#### `getPreference`
This async method provides an easy way to retrieve a user's preferences by `key`. It will return a promise containing the resulting preference value.
@@ -60,7 +60,7 @@ This async method provides an easy way to retrieve a user's preferences by `key`
- `key`: the `key` of your preference to retrieve.
##### `setPreference`
#### `setPreference`
Also async, this method provides you with an easy way to set a user preference. It returns `void`.

315
docs/admin/views.mdx Normal file
View File

@@ -0,0 +1,315 @@
---
title: Customizing Views
label: Customizing Views
order: 30
desc:
keywords:
---
### Root
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 |
| --------------- | ----------------------------------------------------------------------------- |
| **`Account`** | The Account view is used to show the currently logged in user's Account page. |
| **`Dashboard`** | The main landing page of the [Admin Panel](./overview). |
To swap out any of these views, simply pass in your custom component to the `admin.components.views` property of your Payload config. For example:
```ts
// payload.config.ts
{
// ...
admin: {
components: {
views: {
Account: MyCustomAccountView,
Dashboard: MyCustomDashboardView,
},
},
},
}
```
For more granular control, pass a configuration object instead. Payload exposes the following properties for each view:
| Property | Description |
| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **`Component`** \* | Pass in the component that should be rendered when a user navigates to this route. |
| **`path`** \* | Any valid URL path or array of paths that [`path-to-regexp`](https://www.npmjs.com/package/path-to-regex) understands. |
| **`exact`** | Boolean. When true, will only match if the path matches the `usePathname()` exactly. |
| **`strict`** | When true, a path that has a trailing slash will only match a location.pathname with a trailing slash. This has no effect when there are additional URL segments in the location.pathname. |
| **`sensitive`** | When true, will match if the path is case sensitive. |
_\* An asterisk denotes that a property is required._
#### Adding new root views
To add a _new_ view to the [Admin Panel](./overview), simply add another key to the `views` object with at least a `path` and `Component` property. For example:
```ts
// payload.config.ts
{
// ...
admin: {
components: {
views: {
MyCustomView: {
Component: MyCustomView,
path: '/my-custom-view',
},
},
},
},
}
```
<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 help on how to build your own custom view components, see [Building Custom View Components](#building-custom-view-components). For more examples regarding how to customize components, [look at the following examples](https://github.com/payloadcms/payload/tree/main/test/admin/components)._
### Collections
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 |
| ---------- | ------------------------------------------------------------------------- |
| **`Edit`** | The Edit view is used to edit a single document for a given collection. |
| **`List`** | The List view is used to show a list of documents for a given collection. |
To swap out any of these views, simply pass in your custom component to the `admin.components.views` property of your Payload config. This will replace the entire view, including the page breadcrumbs, title, tabs, etc, _as well as all nested routes_.
```ts
// Collection.ts
{
// ...
admin: {
components: {
views: {
Edit: MyCustomEditView,
List: MyCustomListView,
},
},
},
}
```
For help on how to build your own custom view components, see [Building Custom View Components](#building-custom-view-components).
**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
{
// ...
admin: {
components: {
views: {
Edit: {
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],
},
},
},
},
}
```
**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
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 |
| ---------- | ------------------------------------------------------------------- |
| **`Edit`** | The Edit view is used to edit a single document for a given Global. |
To swap out any of these views, simply pass in your custom component to the `admin.components.views` property of your Payload config. This will replace the entire view, including the page breadcrumbs, title, and tabs, _as well as all nested views_.
```ts
// Global.ts
{
// ...
admin: {
components: {
views: {
Edit: MyCustomEditView,
},
},
},
}
```
For help on how to build your own custom view components, see [Building Custom View Components](#building-custom-view-components).
**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
{
// ...
admin: {
components: {
views: {
Edit: {
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
},
},
},
},
},
}
```
You can also add _new_ tabs to the `Edit` view by adding another key to the `components.views.Edit[key]` object with a `path` and `Component` property. See [Custom Tabs](#custom-tabs) for more information.
### Custom Tabs
You can easily swap individual collection or global edit views. To do this, pass an _object_ to the `admin.components.views.Edit` property of the config. Payload renders the following views by default, all of which can be overridden:
| Property | Description |
| ----------------- | --------------------------------------------------------------------------------------------------------------------------- |
| **`Default`** | The Default view is the primary view in which your document is edited. |
| **`Versions`** | The Versions view is used to view the version history of a single document. [More details](../versions) |
| **`Version`** | The Version view is used to view a single version of a single document for a given collection. [More details](../versions). |
| **`API`** | The API view is used to display the REST API JSON response for a given document. |
| **`LivePreview`** | The LivePreview view is used to display the Live Preview interface. [More details](../live-preview) |
Here is an example:
```ts
// Collection.ts or Global.ts
export const MyCollection: SanitizedCollectionConfig = {
slug: 'my-collection',
admin: {
components: {
views: {
Edit: {
// You can also define `components.views.Edit` as a component, this will override _all_ nested views
Default: MyCustomDefaultTab,
Versions: MyCustomVersionsTab,
Version: MyCustomVersionTab,
API: MyCustomAPITab,
LivePreview: MyCustomLivePreviewTab,
},
},
},
},
}
```
To add a _new_ tab to the `Edit` view, simply add another key to `components.views.Edit[key]` with at least a `path` and `Component` property. For example:
```ts
// `Collection.ts` or `Global.ts`
export const MyCollection: SanitizedCollectionConfig = {
slug: 'my-collection',
admin: {
components: {
views: {
Edit: {
MyCustomTab: {
Component: MyCustomTab,
path: '/my-custom-tab',
// You an swap the entire tab component out for your own
Tab: MyCustomTab,
},
AnotherCustomView: {
Component: AnotherCustomView,
path: '/another-custom-view',
// Or you can use the default tab component and just pass in your own label and href
Tab: {
label: 'Another Custom View',
href: '/another-custom-view',
},
},
},
},
},
},
}
```
### Building Custom View Components
Your custom view components will be provided with the following props:
| Prop | Description |
| ----------------------- | ---------------------------------------------------------------------------- |
| **`user`** | The currently logged in user. Will be `null` if no user is logged in. |
| **`canAccessAdmin`** \* | If the currently logged in user is allowed to access the [Admin Panel](./overview) or not. |
<Banner type="warning">
<strong>Note:</strong>
<br />
It's up to you to secure your custom views. If your view requires a user to be logged in or to
have certain access rights, you should handle that within your view component yourself.
</Banner>
### Examples
You can find examples of custom views in the [Payload source code `/test/admin/components/views` folder](https://github.com/payloadcms/payload/tree/main/test/admin/components/views). There, you'll find two custom views:
1. A custom view that uses the `DefaultTemplate`, which is the built-in Payload template that displays the sidebar and "eyebrow nav"
1. A custom view that uses the `MinimalTemplate` - which is just a centered template used for things like logging in or out
To see how to pass in your custom views to create custom views of your own, take a look at the `admin.components.views` property of the [Payload test admin config](https://github.com/payloadcms/payload/blob/main/test/admin/config.ts).

View File

@@ -1,161 +0,0 @@
---
title: Vite
label: Vite
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:
```bash
yarn add @payloadcms/bundler-vite
```
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.
It then uses Rollup to create production builds of your admin UI. With Vite, you should see a decent performance boost—especially after your first cold start. However, that first cold start might take a few more seconds.
<Banner type="warning">
In most cases, Vite should work out of the box. But existing Payload plugins may need to make compatibility changes to support Vite.
</Banner>
This is because Vite aliases work fundamentally differently than Webpack aliases, and Payload relies on aliasing server-only code out of the Payload config to ensure that the bundled admin JS works within your browser.
Here are the main differences between how Vite aliases work and how Webpack aliases work.
**Vite aliases do not work with absolute paths.**
In Vite, 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.**
This especially affects plugins, as plugins will be pre-bundled by Vite using `esbuild`. To get around this and support Vite, plugin authors need to configure an alias to their plugin at the top level, so that the alias will work accordingly.
Here's an example. Say your plugin is called `payload-plugin-cool`. It's imported as follows:
```ts
import { myCoolPlugin } from 'payload-plugin-cool'
```
That plugin should create an alias to support Vite as follows:
```ts
{
// aliases go here
find: 'payload-plugin-cool',
replacement: path.resolve(__dirname, './my-admin-plugin.js')
}
```
This will effectively alias the entire plugin and work with Vite. If the plugin requires admin-specific code, then the `./my-admin-plugin.js` alias target file should reflect any changes necessary to the admin UI that the main server-side plugin performs.
### Extending the Vite config
The Payload config supports a new property for plugins to be able to extend the Vite config specifically. That property exists on the main Payload config under `admin.vite`. 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:
```ts
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')
});
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.

View File

@@ -1,67 +0,0 @@
---
title: Webpack
label: Webpack
order: 80
desc: The Payload admin panel uses Webpack 5 and supports many common functionalities such as SCSS and Typescript out of the box to give you more freedom.
keywords: admin, webpack, documentation, Content Management System, cms, headless, javascript, node, react, express
---
Payload has a Webpack (v5) bundler that you can build the Admin panel with. For now, we recommended using it because it is stable. If you are feeling a bit more adventurous you can give the [Vite](/docs/admin/vite) bundler a shot.
Out of the box, the Webpack bundler supports common functionalities such as SCSS and Typescript, but there are many cases where you may need to add support for additional functionalities.
#### Installation
```bash
yarn add @payloadcms/bundler-webpack
```
#### Import the bundler
```ts
// payload.config.ts
import { buildConfig } from 'payload/config'
import { webpackBundler } from '@payloadcms/bundler-webpack'
export default buildConfig({
// highlight-start
admin: {
bundler: webpackBundler()
},
// highlight-end
})
```
### Extending Webpack
If you need to extend the Webpack config, you can do so by passing a function to the `admin.webpack` property on your Payload config.
The function will receive the Webpack config as an argument and should return the modified config.
```ts
// payload.config.ts
import { buildConfig } from 'payload/config'
import { webpackBundler } from '@payloadcms/bundler-webpack'
export default buildConfig({
admin: {
bundler: webpackBundler()
// highlight-start
webpack: (config) => {
// full control of the Webpack config
return config
},
// highlight-end
},
})
```
<Banner type="success">
<strong>Tip:</strong>
<br />
If changes to your Webpack aliases are not surfacing, they might be
[cached](https://webpack.js.org/configuration/cache/) in `node_modules/.cache/webpack`. Try
deleting that folder and restarting your server.
</Banner>

View File

@@ -3,7 +3,7 @@ title: Authentication Config
label: Config
order: 20
desc: Enable and customize options in the Authentication config for features including Forgot Password, Login Attempts, API key usage and more.
keywords: authentication, config, configuration, documentation, Content Management System, cms, headless, javascript, node, react, express
keywords: authentication, config, configuration, documentation, Content Management System, cms, headless, javascript, node, react, nextjs
---
Payload's Authentication is extremely powerful and gives you everything you need when you go to build a new app or site in a secure and responsible manner.
@@ -13,12 +13,12 @@ To enable Authentication on a collection, define an `auth` property and set it t
## Options
| Option | Description |
| -------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|----------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **`useAPIKey`** | Payload Authentication provides for API keys to be set on each user within an Authentication-enabled Collection. [More](/docs/authentication/config#api-keys) |
| **`tokenExpiration`** | How long (in seconds) to keep the user logged in. JWTs and HTTP-only cookies will both expire at the same time. |
| **`maxLoginAttempts`** | Only allow a user to attempt logging in X amount of times. Automatically locks out a user from authenticating if this limit is passed. Set to `0` to disable. |
| **`lockTime`** | Set the time (in milliseconds) that a user should be locked out if they fail authentication more times than `maxLoginAttempts` allows for. |
| **`depth`** | How many levels deep a `user` document should be populated when creating the JWT and binding the `user` to the express `req`. Defaults to `0` and should only be modified if absolutely necessary, as this will affect performance. |
| **`depth`** | How many levels deep a `user` document should be populated when creating the JWT and binding the `user` to the `req`. Defaults to `0` and should only be modified if absolutely necessary, as this will affect performance. |
| **`cookies`** | Set cookie options, including `secure`, `sameSite`, and `domain`. For advanced users. |
| **`forgotPassword`** | Customize the way that the `forgotPassword` operation functions. [More](/docs/authentication/config#forgot-password) |
| **`verify`** | Set to `true` or pass an object with verification options to require users to verify by email before they are allowed to log into your app. [More](/docs/authentication/config#email-verification) |
@@ -49,7 +49,8 @@ To enable API keys on a collection, set the `useAPIKey` auth option to `true`. F
<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.
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

View File

@@ -3,12 +3,12 @@ title: Authentication Operations
label: Operations
order: 30
desc: Enabling Authentication automatically makes key operations available such as Login, Logout, Verify, Unlock, Reset Password and more.
keywords: authentication, config, configuration, documentation, Content Management System, cms, headless, javascript, node, react, express
keywords: authentication, config, configuration, documentation, Content Management System, cms, headless, javascript, node, react, nextjs
---
Enabling Authentication on a Collection automatically exposes additional auth-based operations in the Local, REST, and GraphQL APIs.
### Access
## Access
The Access operation returns what a logged in user can and can't do with the collections and globals that are registered via your config. This data can be immensely helpful if your app needs to show and hide certain features based on access control, as the Payload Admin panel does.
@@ -69,7 +69,7 @@ query {
Document access can also be queried on a collection/global basis. Access on a global can queried like `http://localhost:3000/api/global-slug/access`, Collection document access can be queried like `http://localhost:3000/api/collection-slug/access/:id`.
### Me
## Me
Returns either a logged in user with token or null when there is no logged in user.
@@ -105,9 +105,9 @@ query {
}
```
### Login
## Login
Accepts an `email` and `password`. On success, it will return the logged in user as well as a token that can be used to authenticate. In the GraphQL and REST APIs, this operation also automatically sets an HTTP-only cookie including the user's token. If you pass an Express `res` to the Local API operation, Payload will set a cookie there as well.
Accepts an `email` and `password`. On success, it will return the logged in user as well as a token that can be used to authenticate. In the GraphQL and REST APIs, this operation also automatically sets an HTTP-only cookie including the user's token. If you pass a `res` to the Local API operation, Payload will set a cookie there as well.
**Example REST API login**:
@@ -166,7 +166,7 @@ const result = await payload.login({
})
```
### Logout
## Logout
As Payload sets HTTP-only cookies, logging out cannot be done by just removing a cookie in JavaScript, as HTTP-only cookies are inaccessible by JS within the browser. So, Payload exposes a `logout` operation to delete the token in a safe way.
@@ -189,7 +189,7 @@ mutation {
}
```
### Refresh
## 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.
@@ -244,7 +244,7 @@ mutation {
`token` arg.
</Banner>
### Verify by Email
## 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.
@@ -276,7 +276,7 @@ const result = await payload.verifyEmail({
})
```
### Unlock
## Unlock
If a user locks themselves out and you wish to deliberately unlock them, you can utilize the Unlock operation. The Admin panel features an Unlock control automatically for all collections that feature max login attempts, but you can programmatically unlock users as well by using the Unlock operation.
@@ -309,7 +309,7 @@ const result = await payload.unlock({
})
```
### Forgot Password
## Forgot Password
Payload comes with built-in forgot password functionality. Submitting an email address to the Forgot Password operation will generate an email and send it to the respective email address with a link to reset their password.
@@ -361,7 +361,7 @@ const token = await payload.forgotPassword({
use the token to "reset" their password.
</Banner>
### Reset Password
## Reset Password
After a user has "forgotten" their password and a token is generated, that token can be used to send to the reset password operation along with a new password which will allow the user to reset their password securely.

View File

@@ -3,7 +3,7 @@ title: Authentication Overview
label: Overview
order: 10
desc: Payload provides highly secure user Authentication out of the box, and you can fully customize, override, or remove the default Authentication support.
keywords: authentication, config, configuration, overview, documentation, Content Management System, cms, headless, javascript, node, react, express
keywords: authentication, config, configuration, overview, documentation, Content Management System, cms, headless, javascript, node, react, nextjs
---
<YouTube
@@ -30,7 +30,7 @@ _Admin panel screenshot depicting an Admins Collection with Auth enabled_
By default, Payload provides you with a `User` collection that supports Authentication, which is used to access the Admin panel. But, you can add support to one or many Collections of your own. For more information on how to customize, override, or remove the default `User` collection, [click here](/docs/admin/overview#the-admin-user-collection).
### Enabling Auth on a collection
## Enabling Auth on a collection
Every Payload Collection can opt-in to supporting Authentication by specifying the `auth` property on the Collection's config to either `true` or to an object containing `auth` options.
@@ -57,12 +57,7 @@ export const Admins: CollectionConfig = {
name: 'role',
type: 'select',
required: true,
options: [
'user',
'admin',
'editor',
'developer',
],
options: ['user', 'admin', 'editor', 'developer'],
},
],
}
@@ -76,33 +71,33 @@ export const Admins: CollectionConfig = {
Once enabled, each document that is created within the Collection can be thought of as a `user` - who can make use of commonly required authentication functions such as logging in / out, resetting their password, and more.
### Logging in / out, resetting password, etc.
## Logging in / out, resetting password, etc.
[Click here](/docs/authentication/operations) for a list of all automatically-enabled Auth operations, including `login`, `logout`, `refresh`, and others.
### Token-based auth
## 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: 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.
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 `req`, which is available throughout Payload including within access control, hooks, and more.
You can specify what data gets encoded to the JWT token by setting `saveToJWT` to true in your auth collection fields. If you wish to use a different key other than the field `name`, you can provide it to `saveToJWT` as a string. It is also possible to use `saveToJWT` on fields that are nested in inside groups and tabs. If a group has a `saveToJWT` set it will include the object with all sub-fields in the token. You can set `saveToJWT: false` for any fields you wish to omit. If a field inside a group has `saveToJWT` set, but the group does not, the field will be included at the top level of the token.
<Banner type="success">
<strong>Tip:</strong>
<br />
You can access the logged-in user from access control functions and hooks via the Express{' '}
You can access the logged-in user from access control functions and hooks via the{' '}
<strong>req</strong>. The logged-in user is automatically added as the <strong>user</strong>{' '}
property.
</Banner>
### HTTP-only cookies
## HTTP-only cookies
Payload `login`, `logout`, and `refresh` operations make use of HTTP-only cookies for authentication purposes. HTTP-only cookies are a highly secure method of storing identifiable data on a user's device so that Payload can automatically recognize a returning user until their cookie expires. They are totally protected from common XSS attacks and cannot be read at all via JavaScript in the browser.
##### Automatic browser inclusion
#### Automatic browser inclusion
Modern browsers automatically include `http-only` cookies when making requests directly to URLs—meaning that if you are running your API on http://example.com, and you have logged in and visit http://example.com/test-page, your browser will automatically include the Payload authentication cookie for you.
##### Using Fetch or other HTTP APIs
#### Using Fetch or other HTTP APIs
However, if you use `fetch` or similar APIs to retrieve Payload resources from its REST or GraphQL API, you need to specify to include credentials (cookies).
@@ -126,7 +121,7 @@ For more about how to automatically include cookies in requests from your app to
will still show HTTP-only cookies, even when JavaScript running on the page can't.
</Banner>
### CSRF Protection
## CSRF Protection
CSRF (cross-site request forgery) attacks are common and dangerous. By using an HTTP-only cookie, Payload removes many XSS vulnerabilities, however, CSRF attacks can still be possible.
@@ -164,7 +159,7 @@ const config = buildConfig({
export default config
```
### Identifying users via the Authorization Header
## Identifying users via the Authorization Header
In addition to authenticating via an HTTP-only cookie, you can also identify users via the `Authorization` header on an HTTP request.

View File

@@ -1,56 +0,0 @@
---
title: Using the Payload Auth Middleware
label: Using the Middleware
order: 40
desc: Make full use of Payload's built-in authentication with your own custom Express endpoints by adding Payload's authentication middleware.
keywords: authentication, middleware, config, configuration, documentation, Content Management System, cms, headless, javascript, node, react, express
---
Because Payload uses your existing Express server, you are free to add whatever logic you need to your app through endpoints of your own. However, Payload does not add its middleware to your Express app itself—instead, it scopes all of its middleware to Payload-specific routers.
This approach has a ton of benefits - it's great for isolation of concerns and limiting scope, but it also means that your additional routes won't have access to Payload's user authentication.
<Banner type="success">
You can make full use of Payload's built-in authentication within your own custom Express
endpoints by adding Payload's authentication middleware.
</Banner>
<Banner type="warning">
Payload must be initialized before the `payload.authenticate` middleware can be used. This is done
by calling `payload.init()` prior to adding the middleware.
</Banner>
Example in `server.js`:
```ts
import express from 'express'
import payload from 'payload'
const app = express()
const start = async () => {
await payload.init({
secret: 'PAYLOAD_SECRET_KEY',
express: app,
})
const router = express.Router()
// Note: Payload must be initialized before the `payload.authenticate` middleware can be used
router.use(payload.authenticate) // highlight-line
router.get('/', (req, res) => {
if (req.user) {
return res.send(`Authenticated successfully as ${req.user.email}.`)
}
return res.send('Not authenticated')
})
app.use('/some-route-here', router)
app.listen(3000)
}
start()
```

View File

@@ -6,7 +6,7 @@ desc: Quickly configure and deploy your Payload Cloud project in a few simple st
keywords: configuration, config, settings, project, cloud, payload cloud, deploy, deployment
---
### Select your plan
## Select your plan
Once you have created a project, you will need to select your plan. This will determine the resources that are allocated to your project and the features that are available to you.
@@ -17,7 +17,7 @@ Once you have created a project, you will need to select your plan. This will de
anytime.
</Banner>
### Project Details
## Project Details
| Option | Description |
| ---------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
@@ -26,7 +26,7 @@ Once you have created a project, you will need to select your plan. This will de
| **Project Slug** | Choose a unique slug to identify your project. This needs to be unique for your team and you can change it any time. |
| **Team** | Select the team you want to create the project under. If this is your first project, a personal team will be created for you automatically. You can modify your team settings and invite new members at any time from the Team Settings page. |
### Build Settings
## Build Settings
If you are deploying a new project from a template, the following settings will be automatically configured for you. If you are using your own repository, you need to make sure your build settings are accurate for your project to deploy correctly.
@@ -39,17 +39,17 @@ If you are deploying a new project from a template, the following settings will
| **Branch to Deploy** | Select the branch of your repository that you want to deploy from. This is the branch that will be used to build your project when you commit new changes. |
| **Default Domain** | Set a default domain for your project. This must be unique and you will not able to change it. You can always add a custom domain later in your project settings. |
### Environment Variables
## Environment Variables
Any of the features in Payload Cloud that require environment variables will automatically be provided to your application. If your app requires any custom environment variables, you can set them here.
<Banner type="warning">
Note: For security reasons, any variables you wish to provide to the Admin panel must be prefixed
with `PAYLOAD_PUBLIC_`.  Learn more
[here](https://payloadcms.com/docs/admin/webpack#admin-environment-vars).
[here](https://payloadcms.com/docs/admin/environment-vars).
</Banner>
### Payment
## Payment
Payment methods can be set per project and can be updated any time. You can use teams default payment method, or add a new one. Modify your payment methods in your Project settings / Team settings.

View File

@@ -6,7 +6,7 @@ desc: Manage your Payload Cloud projects.
keywords: cloud, payload cloud, projects, project, overview, database, file storage, build settings, environment variables, custom domains, email, developing locally
---
### Overview
## Overview
<Banner>
The overview tab shows your most recent deployment, along with build and deployment logs. From
@@ -18,33 +18,53 @@ keywords: cloud, payload cloud, projects, project, overview, database, file stor
![Payload Cloud Overview Page](https://payloadcms.com/images/docs/cloud/overview-page.jpg)
_A screenshot of the Overview page for a Cloud project._
### Database
## Database
Your Payload Cloud project comes with a MongoDB serverless Atlas DB instance or a Dedicated Atlas cluster, depending on your plan. To interact with your cloud database, you will be provided with a MongoDB connection string. This can be found under the **Database** tab of your project.
`mongodb+srv://your_connection_string`
### File Storage
## File Storage
Payload Cloud gives you S3 file storage backed by Cloudflare as a CDN, and this plugin extends Payload so that all of your media will be stored in S3 rather than locally.
AWS Cognito is used for authentication to your S3 bucket. The [Payload Cloud Plugin](https://github.com/payloadcms/plugin-cloud) will automatically pick up these values. These values are only if you'd like to access your files directly, outside of Payload Cloud.
### Build Settings
### 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.
### Environment Variables
## Environment Variables
From the Environment Variables page of the Settings tab, you can add, update and delete variables for use in your project. Like build settings, these changes will trigger a redeployment of your project.
<Banner>
Note: For security reasons, any variables you wish to provide to the Admin panel must be prefixed
with `PAYLOAD_PUBLIC_`.  Learn more
[here](https://payloadcms.com/docs/admin/webpack#admin-environment-vars).
[here](https://payloadcms.com/docs/admin/environment-vars).
</Banner>
### Custom Domains
## Custom Domains
With Payload Cloud, you can add custom domain names to your project. To do so, first go to the Domains page of the Settings tab of your project. Here you can see your default domain. To add a new domain, type in the domain name you wish to use.
@@ -64,19 +84,19 @@ export default buildConfig({
})
```
### Email
## Email
Powered by [Resend](https://resend.com), Payload Cloud comes with integrated email support out of the box. No configuration is needed, and you can use `payload.sendEmail()` to send email right from your Payload app. To learn more about sending email with Payload, checkout the [Email Configuration](https://payloadcms.com/docs/email/overview) overview.
If you are on the Pro or Enterprise plan, you can add your own custom Email domain name. From the Email page of your projects Settings, add the domain you wish to use for email delivery. This will generate a set of DNS records. Add these records to your DNS provider and click verify to check that your records are resolving properly. Once verified, your emails will now be sent from your custom domain name.
### Developing Locally
## Developing Locally
To make changes to your project, you will need to clone the repository defined in your project settings to your local machine. In order to run your project locally, you will need configure your local environment first. Refer to your repositorys `README.md` file to see the steps needed for your specific template.
From there, you are ready to make updates to your project. When you are ready to make your changes live, commit your changes to the branch you specified in your Project settings, and your application will automatically trigger a redeploy and build from your latest commit.
### Cloud Plugin
## Cloud Plugin
Projects generated from a template will come pre-configured with the official Cloud Plugin, but if you are using your own repository you will need to add this into your project. To do so, add the plugin to your Payload config:
@@ -97,7 +117,7 @@ export default buildConfig({
over Payload Cloud's email service.
</Banner>
##### **Optional configuration**
#### **Optional configuration**
If you wish to opt-out of any Payload cloud features, the plugin also accepts options to do so.

View File

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

View File

@@ -3,7 +3,7 @@ title: Collection Configs
label: Collections
order: 20
desc: Structure your Collections for your needs by defining fields, adding slugs and labels, establishing access control, tying in hooks, setting timestamps and more.
keywords: collections, config, configuration, documentation, Content Management System, cms, headless, javascript, node, react, express
keywords: collections, config, configuration, documentation, Content Management System, cms, headless, javascript, node, react, nextjs
---
Payload Collections are defined through configs of their own, and you can define as many as your application needs. Each
@@ -13,27 +13,29 @@ It's often best practice to write your Collections in separate files and then im
## Options
| Option | Description |
|-------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **`slug`** \* | Unique, URL-friendly string that will act as an identifier for this Collection. |
| **`fields`** \* | Array of field types that will determine the structure and functionality of the data stored within this Collection. [Click here](/docs/fields/overview) for a full list of field types as well as how to configure them. |
| **`labels`** | Singular and plural labels for use in identifying this Collection throughout Payload. Auto-generated from slug if not defined. |
| **`admin`** | Admin-specific configuration. See below for [more detail](#admin-options). |
| **`hooks`** | Entry points to "tie in" to Collection actions at specific points. [More](/docs/hooks/overview#collection-hooks) |
| **`access`** | Provide access control functions to define exactly who should be able to do what with Documents in this Collection. [More](/docs/access-control/overview/#collections) |
| **`auth`** | Specify options if you would like this Collection to feature authentication. For more, consult the [Authentication](/docs/authentication/config) documentation. |
| **`upload`** | Specify options if you would like this Collection to support file uploads. For more, consult the [Uploads](/docs/upload/overview) documentation. |
| **`timestamps`** | Set to false to disable documents' automatically generated `createdAt` and `updatedAt` timestamps. |
| **`versions`** | Set to true to enable default options, or configure with object properties. [More](/docs/versions/overview#collection-config) |
| **`endpoints`** | Add custom routes to the REST API. Set to `false` to disable routes. [More](/docs/rest-api/overview#custom-endpoints) |
| **`graphQL`** | An object with `singularName` and `pluralName` strings used in schema generation. Auto-generated from slug if not defined. Set to `false` to disable GraphQL. |
| **`typescript`** | An object with property `interface` as the text used in schema generation. Auto-generated from slug if not defined. |
| **`defaultSort`** | Pass a top-level field to sort by default in the collection List view. Prefix the name of the field with a minus symbol ("-") to sort in descending order. |
| **`custom`** | Extension point for adding custom data (e.g. for plugins) |
| Option | Description |
|------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **`slug`** \* | Unique, URL-friendly string that will act as an identifier for this Collection. |
| **`fields`** \* | Array of field types that will determine the structure and functionality of the data stored within this Collection. [Click here](/docs/fields/overview) for a full list of field types as well as how to configure them. |
| **`labels`** | Singular and plural labels for use in identifying this Collection throughout Payload. Auto-generated from slug if not defined. |
| **`admin`** | Admin-specific configuration. See below for [more detail](#admin-options). |
| **`hooks`** | Entry points to "tie in" to Collection actions at specific points. [More](/docs/hooks/overview#collection-hooks) |
| **`access`** | Provide access control functions to define exactly who should be able to do what with Documents in this Collection. [More](/docs/access-control/overview/#collections) |
| **`auth`** | Specify options if you would like this Collection to feature authentication. For more, consult the [Authentication](/docs/authentication/config) documentation. |
| **`upload`** | Specify options if you would like this Collection to support file uploads. For more, consult the [Uploads](/docs/upload/overview) documentation. |
| **`timestamps`** | Set to false to disable documents' automatically generated `createdAt` and `updatedAt` timestamps. |
| **`versions`** | Set to true to enable default options, or configure with object properties. [More](/docs/versions/overview#collection-config) |
| **`endpoints`** | Add custom routes to the REST API. Set to `false` to disable routes. [More](/docs/rest-api/overview#custom-endpoints) |
| **`graphQL`** | An object with `singularName` and `pluralName` strings used in schema generation. Auto-generated from slug if not defined. Set to `false` to disable GraphQL. |
| **`typescript`** | An object with property `interface` as the text used in schema generation. Auto-generated from slug if not defined. |
| **`disableDuplicate`** | When true, do not show the "Duplicate" button while editing documents within this collection and prevent `duplicate` from all APIs. |
| **`defaultSort`** | Pass a top-level field to sort by default in the collection List view. Prefix the name of the field with a minus symbol ("-") to sort in descending order. |
| **`dbName`** | Custom table or collection name depending on the database adapter. Auto-generated from slug if not defined.
| **`custom`** | Extension point for adding custom data (e.g. for plugins) |
_\* An asterisk denotes that a property is required._
#### Simple collection example
### Simple collection example
```ts
import { CollectionConfig } from 'payload/types'
@@ -56,36 +58,36 @@ export const Orders: CollectionConfig = {
}
```
#### More collection config examples
### More collection config examples
You can find an assortment
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
## Admin options
You can customize the way that the Admin panel behaves on a collection-by-collection basis by defining the `admin`
property on a collection's config.
| 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 collection from navigation and admin routing. |
| `hooks` | Admin-specific hooks for this collection. [More](#admin-hooks) |
| `useAsTitle` | Specify a top-level field to use for a document title throughout the Admin panel. If no field is defined, the ID of the document is used as the title. |
| `description` | Text or React component to display below the Collection label in the List view to give editors more information. |
| `defaultColumns` | Array of field names that correspond to which columns to show by default in this collection's List view. |
| `disableDuplicate ` | Disables the "Duplicate" button while editing documents within this collection. |
| `hideAPIURL` | Hides the "API URL" meta field while editing documents within this collection. |
| `enableRichTextLink` | The [Rich Text](/docs/fields/rich-text) field features a `Link` element which allows for users to automatically reference related documents within their rich text. Set to `true` by default. |
| `enableRichTextRelationship` | The [Rich Text](/docs/fields/rich-text) field features a `Relationship` element which allows for users to automatically reference related documents within their rich text. Set to `true` by default. |
| `meta` | Metadata overrides to apply to the [Admin panel](../admin/overview). Included properties are `description` and `openGraph`. |
| `preview` | Function to generate preview URLS within the Admin panel that can point to your app. [More](#preview). |
| `livePreview` | Enable real-time editing for instant visual feedback of your front-end application. [More](/docs/live-preview/overview). |
| `components` | Swap in your own React components to be used within this collection. [More](/docs/admin/components#collections) |
| `listSearchableFields` | Specify which fields should be searched in the List search view. [More](#list-searchable-fields) |
| **`pagination`** | Set pagination-specific options for this collection. [More](#pagination) |
### Preview
## Preview
Collection `admin` options can accept a `preview` function that will be used to generate a link pointing to the frontend
of your app to preview data.
@@ -124,32 +126,32 @@ export const Posts: CollectionConfig = {
}
```
### Pagination
## Pagination
Here are a few options that you can specify options for pagination on a collection-by-collection basis:
| Option | Description |
|----------------|-----------------------------------------------------------------------------------------------------|
| -------------- | --------------------------------------------------------------------------------------------------- |
| `defaultLimit` | Integer that specifies the default per-page limit that should be used. Defaults to 10. |
| `limits` | Provide an array of integers to use as per-page options for admins to choose from in the List view. |
### Access control
## Access control
You can specify extremely granular access control (what users can do with documents in a collection) on a collection by
collection basis. To learn more, go to the [Access Control](/docs/access-control/overview) docs.
### Hooks
## Hooks
Hooks are a powerful way to extend collection functionality and execute your own logic, and can be defined on a
collection by collection basis. To learn more, go to the [Hooks](/docs/hooks/overview) documentation.
### Field types
## Field types
Collections support all field types that Payload has to offer—including simple fields like text and checkboxes all the
way to more complicated layout-building field groups like Blocks. [Click here](/docs/fields/overview) to learn more
about field types.
### List Searchable Fields
## List Searchable Fields
In the List view, there is a "search" box that allows you to quickly find a document with a search. By default, it
searches on the ID field. If you have `admin.useAsTitle` defined, the list search will use that field. However, you can
@@ -167,54 +169,7 @@ those three fields plus the ID field.
so your admin queries can remain performant.
</Banner>
### Admin Hooks
In addition to collection hooks themselves, Payload provides for admin UI-specific hooks that you can leverage.
**`beforeDuplicate`**
The `beforeDuplicate` hook is an async function that accepts an object containing the data to duplicate, as well as the
locale of the doc to duplicate. Within this hook, you can modify the data to be duplicated, which is useful in cases
where you have unique fields that need to be incremented or similar, as well as if you want to automatically modify a
document's `title`.
Example:
```ts
import { BeforeDuplicate, CollectionConfig } from 'payload/types'
// Your auto-generated Page type
import { Page } from '../payload-types.ts'
const beforeDuplicate: BeforeDuplicate<Page> = ({ data }) => {
return {
...data,
title: `${data.title} Copy`,
uniqueField: data.uniqueField ? `${data.uniqueField}-copy` : '',
}
}
export const Page: CollectionConfig = {
slug: 'pages',
admin: {
hooks: {
beforeDuplicate,
},
},
fields: [
{
name: 'title',
type: 'text',
},
{
name: 'uniqueField',
type: 'text',
unique: true,
},
],
}
```
### TypeScript
## TypeScript
You can import collection types as follows:

View File

@@ -1,81 +0,0 @@
---
title: Express
label: Express
order: 60
desc: Payload utilizes Express middleware packages, you can customize how they work by passing in configuration options.
keywords: config, configuration, documentation, Content Management System, cms, headless, javascript, node, react, express
---
Payload utilizes a few Express-specific middleware packages within its own routers. You can customize how they work by passing in configuration options to the main Payload config's `express` property.
### Custom Middleware
Payload allows you to pass in custom Express middleware to be used on all of the routes it opens. This is useful for adding logging or any other custom functionality to your endpoints.
There are 2 exposed properties. Each property is an array of middleware functions.
- `preMiddleware` - runs before any of the Payload middleware
- `postMiddleware` - runs after all of the Payload middleware
```ts
{
express: {
preMiddleware: [
(req, res, next) => {
// do something
next()
}
],
postMiddleware: [
(req, res, next) => {
// do something
next()
}
]
}
}
// Example logging middleware function
const requestLoggerMiddleware = (req, res, next) => {
req.payload.logger.info(`request: ${req.method} ${req.url}`)
next()
}
```
### JSON
`express.json()` is used to parse JSON body content into JavaScript objects accessible on the Express `req`. Payload allows you to customize all of the `json` method's options. Common examples of customization use-cases are increasing the max allowed JSON body size which defaults to `2MB`.
**Example payload.config.js for how to increase the max JSON size allowed to be sent to Payload endpoints:**
```js
{
express: {
json: {
limit: '4mb',
}
}
}
```
You can find a list of all available options that are able to be passed to `express.json()` [here](https://expressjs.com/en/api.html).
### Compression
Payload uses the `compression` package to optimize transfer size for all of the routes it opens, and you can pass customization options through the Payload config.
To customize compression options, pass an object to the Payload config's `express` property.
**Example payload.config.js:**
```js
{
express: {
compression: {
// settings go here
}
}
}
```
Typically, the default options for this package are suitable. However, for a list of all available customization options, [click here](http://expressjs.com/en/resources/middleware/compression.html).

View File

@@ -3,7 +3,7 @@ title: Global Configs
label: Globals
order: 30
desc: Set up your Global config for your needs by defining fields, adding slugs and labels, establishing access control, tying in hooks and more.
keywords: globals, config, configuration, documentation, Content Management System, cms, headless, javascript, node, react, express
keywords: globals, config, configuration, documentation, Content Management System, cms, headless, javascript, node, react, nextjs
---
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.
@@ -26,10 +26,11 @@ 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._
#### Simple Global example
### Simple Global example
```ts
import { GlobalConfig } from 'payload/types'
@@ -57,24 +58,25 @@ const Nav: GlobalConfig = {
export default Nav
```
#### Global config example
### Global config example
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
## 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.
| 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. |
| `meta` | Metadata overrides to apply to the [Admin panel](../admin/overview). Included properties are `description` and `openGraph`. |
### Preview
## 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.
@@ -111,19 +113,19 @@ export const MyGlobal: GlobalConfig = {
}
```
### Access control
## 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.
### Hooks
## Hooks
Globals also fully support a smaller subset of Hooks. To learn more, go to the [Hooks](/docs/hooks/overview) documentation.
### Field types
## 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
## TypeScript
You can import global types as follows:

View File

@@ -3,12 +3,43 @@ title: I18n
label: I18n
order: 40
desc: Manage and customize internationalization support in your CMS editor experience
keywords: internationalization, i18n, config, configuration, documentation, Content Management System, cms, headless, javascript, node, react, express
keywords: internationalization, i18n, config, configuration, documentation, Content Management System, cms, headless, javascript, node, react, nextjs
---
Not only does Payload support managing localized content, it also has internationalization support so that admin users can work in their preferred language. Payload's i18n support is built on top of [i18next](https://www.i18next.com). It comes included by default and can be extended in your config.
Not only does Payload support managing localized content, it also has internationalization support so that users in the [Admin Panel](../admin/overview) can work in their preferred language. Payload's i18n comes by default without any additional setup, and you can extend the default settings to customize the language settings to your needs.
While Payload's built-in features come translated, you may want to also translate parts of your project's configuration too. This is possible in places like collections and globals labels and groups, field labels, descriptions and input placeholder text. The admin UI will display all the correct translations you provide based on the user's language.
### Configuration Options
In your Payload config, you can add translations and customize the settings in `i18n`. Payload will use your custom options and merge it with the default, allowing you to override the settings Payload provides.
**Example Payload config extending i18n:**
```ts
import { buildConfig } from 'payload/config'
export default buildConfig({
//...
i18n: {
fallbackLng: 'en', // default
debug: false, // default
resources: {
en: {
custom: {
// namespace can be anything you want
key1: 'Translation with {{variable}}', // translation
},
// override existing translation keys
general: {
dashboard: 'Home',
},
},
},
},
//...
})
```
While Payload's built-in features come translated, you may want to also translate parts of your project's configuration too. This is possible in places like Collections and Globals labels and groups, field labels, descriptions and input placeholder text. The admin UI will display all the correct translations you provide based on the user's language.
Here is an example of a simple collection supporting both English and Spanish editors:
@@ -56,9 +87,9 @@ export const Articles: CollectionConfig = {
}
```
### Admin UI
## Admin UI
The Payload admin panel reads the language settings of a user's browser and display all text in that language, or will fall back to English if the user's language is not yet supported.
The [Admin Panel](../admin/overview) reads the language settings of a user's browser and display all text in that language, or will fall back to English if the user's language is not yet supported.
After a user logs in, they can change their language selection in the `/account` view.
<Banner>
@@ -68,15 +99,13 @@ After a user logs in, they can change their language selection in the `/account`
[contributions](https://github.com/payloadcms/payload/blob/main/CONTRIBUTING.md).
</Banner>
### Node Express
## Node
Payload's backend uses express middleware to set the language on incoming requests before they are handled. This allows backend validation to return error messages in the user's own language or system generated emails to be sent using the correct translation. You can make HTTP requests with the `accept-language` header and Payload will use that language.
Payload's backend sets the language on incoming requests before they are handled. This allows backend validation to return error messages in the user's own language or system generated emails to be sent using the correct translation. You can make HTTP requests with the `accept-language` header and Payload will use that language.
Anywhere in your Payload app that you have access to the `req` object, you can access i18next's extensive internationalization features assigned to `req.i18n`. To access text translations you can use `req.t('namespace:key')`.
Anywhere in your Payload app that you have access to the `req` object, you can access payload's extensive internationalization features assigned to `req.i18n`. To access text translations you can use `req.t('namespace:key')`.
Read the i18next [API documentation](https://www.i18next.com/overview/api) to learn more.
### Configuration Options
## Configuration Options
In your Payload config, you can add translations and customize the settings in `i18n`. Payload will use your custom options and merge it with the default, allowing you to override the settings Payload provides.
@@ -88,9 +117,8 @@ import { buildConfig } from 'payload/config'
export default buildConfig({
//...
i18n: {
fallbackLng: 'en', // default
debug: false, // default
resources: {
fallbackLanguage: 'en', // default
translations: {
en: {
custom: {
// namespace can be anything you want
@@ -107,4 +135,63 @@ export default buildConfig({
})
```
See the i18next [configuration options](https://www.i18next.com/overview/configuration-options) to learn more.
## Types for custom translations
In order to use custom translations in your project, you need to provide the types for the translations. Here is an example of how you can define the types for the custom translations in a custom react component:
```ts
'use client'
import type { NestedKeysStripped } from '@payloadcms/translations'
import type React from 'react'
import { useTranslation } from '@payloadcms/ui/providers/Translation'
const customTranslations = {
en: {
general: {
test: 'Custom Translation',
},
},
}
type CustomTranslationObject = typeof customTranslations.en
type CustomTranslationKeys = NestedKeysStripped<CustomTranslationObject>
export const MyComponent: React.FC = () => {
const { i18n, t } = useTranslation<CustomTranslationObject, CustomTranslationKeys>() // These generics merge your custom translations with the default client translations
return t('general:test')
}
```
Additionally, payload exposes the `t` function in various places, for example in labels. Here is how you would type those:
```ts
import type {
DefaultTranslationKeys,
NestedKeysStripped,
TFunction,
} from '@payloadcms/translations'
import type { Field } from 'payload/types'
const customTranslations = {
en: {
general: {
test: 'Custom Translation',
},
},
}
type CustomTranslationObject = typeof customTranslations.en
type CustomTranslationKeys = NestedKeysStripped<CustomTranslationObject>
const field: Field = {
name: 'myField',
type: 'text',
label: (
{ t }: { t: TFunction<CustomTranslationKeys | DefaultTranslationKeys> }, // The generic passed to TFunction does not automatically merge the custom translations with the default translations. We need to merge them ourselves here
) => t('fields:addLabel'),
}
```

View File

@@ -3,14 +3,16 @@ title: Localization
label: Localization
order: 50
desc: Add and maintain as many locales as you need by adding Localization to your Payload config, set options for default locale, fallbacks, fields and more.
keywords: localization, internationalization, i18n, config, configuration, documentation, Content Management System, cms, headless, javascript, node, react, express
keywords: localization, internationalization, i18n, config, configuration, documentation, Content Management System, cms, headless, javascript, node, react, nextjs
---
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
## 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:**
@@ -47,7 +49,8 @@ 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,
},
],
@@ -57,7 +60,8 @@ export default buildConfig({
})
```
**Example Payload config set up for localization with full locales objects (including [internationalization](/docs/configuration/i18n) support):**
**Example Payload config set up for localization with full locales objects (
including [internationalization](/docs/configuration/i18n) support):**
```ts
import { buildConfig } from 'payload/config'
@@ -93,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 Object 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
## 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:**
@@ -119,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>
@@ -141,11 +166,12 @@ All field types with a `name` property support the `localized` property—even t
strategy.
</Banner>
### Retrieving localized docs
## 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
#### REST API
REST API locale functionality relies on URL query parameters.
@@ -155,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:**
@@ -163,11 +190,13 @@ Specify fallback locale to be used by providing the `fallback-locale` query para
fetch('https://localhost:3000/api/pages?locale=es&fallback-locale=none');
```
##### GraphQL API
#### GraphQL API
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.
@@ -189,9 +218,11 @@ query {
arguments in nested related document queries.
</Banner>
##### Local API
#### 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

@@ -3,7 +3,7 @@ title: The Payload Config
label: Overview
order: 10
desc: The Payload config is central to everything that Payload does, from adding custom React components, to modifying collections, controlling localization and much more.
keywords: overview, config, configuration, documentation, Content Management System, cms, headless, javascript, node, react, express
keywords: overview, config, configuration, documentation, Content Management System, cms, headless, javascript, node, react, nextjs
---
Payload is a _config-based_, code-first CMS and application framework. The Payload config is central to everything that Payload does. It scaffolds the data that Payload stores as well as maintains custom React components, hook logic, custom validations, and much more.
@@ -13,59 +13,52 @@ Payload is a _config-based_, code-first CMS and application framework. The Paylo
<Banner type="warning">
<strong>Important:</strong>
<br />
This file is included in the Payload admin bundle, so make sure you do not embed any sensitive
The serializable portions of this config are included in the Payload Admin bundle, so make sure you do not embed any sensitive
information.
</Banner>
## Options
| Option | Description |
| --------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `admin` \* | Base Payload admin configuration. Specify bundler*, custom components, control metadata, set the Admin user collection, and [more](/docs/admin/overview#admin-options). Required. |
| `editor` \* | Rich Text Editor which will be used by richText fields. Required. |
| `db` \* | Database Adapter which will be used by Payload. Read more [here](/docs/database/overview). Required. |
| `serverURL` | A string used to define the absolute URL of your app including the protocol, for example `https://example.com`. No paths allowed, only protocol, domain and (optionally) port |
| `collections` | An array of all Collections that Payload will manage. To read more about how to define your collection configs, [click here](/docs/configuration/collections). |
| `globals` | An array of all Globals that Payload will manage. For more on Globals and their configs, [click here](/docs/configuration/globals). |
| `cors` | Either a whitelist array of URLS to allow CORS requests from, or a wildcard string (`'*'`) to accept incoming requests from any domain. |
| `localization` | Opt-in and control how Payload handles the translation of your content into multiple locales. [More](/docs/configuration/localization) |
| `graphQL` | Manage GraphQL-specific functionality here. Define your own queries and mutations, manage query complexity limits, and [more](/docs/graphql/overview#graphql-options). |
| `cookiePrefix` | A string that will be prefixed to all cookies that Payload sets. |
| `csrf` | A whitelist array of URLs to allow Payload cookies to be accepted from as a form of CSRF protection. [More](/docs/authentication/overview#csrf-protection) |
| `defaultDepth` | If a user does not specify `depth` while requesting a resource, this depth will be used. [More](/docs/getting-started/concepts#depth) |
| `maxDepth` | The maximum allowed depth to be permitted application-wide. This setting helps prevent against malicious queries. Defaults to `10`. |
| `indexSortableFields` | Automatically index all sortable top-level fields in the database to improve sort performance and add database compatibility for Azure Cosmos and similar. |
| `upload` | Base Payload upload configuration. [More](/docs/upload/overview#payload-wide-upload-options). |
| `routes` | Control the routing structure that Payload binds itself to. Specify `admin`, `api`, `graphQL`, and `graphQLPlayground`. |
| `email` | Base email settings to allow Payload to generate email such as Forgot Password requests and other requirements. [More](/docs/email/overview#configuration) |
| `express` | Express-specific middleware options such as compression and JSON parsing. [More](/docs/configuration/express) |
| `debug` | Enable to expose more detailed error information. |
| `telemetry` | Disable Payload telemetry by passing `false`. [More](/docs/configuration/overview#telemetry) |
| `rateLimit` | Control IP-based rate limiting for all Payload resources. Used to prevent DDoS attacks and [more](/docs/production/preventing-abuse#rate-limiting-requests). |
| `hooks` | Tap into Payload-wide hooks. [More](/docs/hooks/overview) |
| `plugins` | An array of Payload plugins. [More](/docs/plugins/overview) |
| `endpoints` | An array of custom API endpoints added to the Payload router. [More](/docs/rest-api/overview#custom-endpoints) |
| `custom` | Extension point for adding custom data (e.g. for plugins) |
| Option | Description |
| --------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `admin` \* | Base Payload admin configuration. Specify, custom components, control metadata, set the Admin user collection, and [more](/docs/admin/overview#admin-options). Required. |
| `editor` \* | Rich Text Editor which will be used by richText fields. Required. |
| `db` \* | Database Adapter which will be used by Payload. Read more [here](/docs/database/overview). Required. |
| `serverURL` | A string used to define the absolute URL of your app including the protocol, for example `https://example.com`. No paths allowed, only protocol, domain and (optionally) port |
| `collections` | An array of all Collections that Payload will manage. To read more about how to define your collection configs, [click here](/docs/configuration/collections). |
| `globals` | An array of all Globals that Payload will manage. For more on Globals and their configs, [click here](/docs/configuration/globals). |
| `cors` | Either a whitelist array of URLS to allow CORS requests from, or a wildcard string (`'*'`) to accept incoming requests from any domain. |
| `localization` | Opt-in and control how Payload handles the translation of your content into multiple locales. [More](/docs/configuration/localization) |
| `graphQL` | Manage GraphQL-specific functionality here. Define your own queries and mutations, manage query complexity limits, and [more](/docs/graphql/overview#graphql-options). |
| `cookiePrefix` | A string that will be prefixed to all cookies that Payload sets. |
| `csrf` | A whitelist array of URLs to allow Payload cookies to be accepted from as a form of CSRF protection. [More](/docs/authentication/overview#csrf-protection) |
| `defaultDepth` | If a user does not specify `depth` while requesting a resource, this depth will be used. [More](/docs/getting-started/concepts#depth) |
| `maxDepth` | The maximum allowed depth to be permitted application-wide. This setting helps prevent against malicious queries. Defaults to `10`. |
| `indexSortableFields` | Automatically index all sortable top-level fields in the database to improve sort performance and add database compatibility for Azure Cosmos and similar. |
| `upload` | Base Payload upload configuration. [More](/docs/upload/overview#payload-wide-upload-options). |
| `routes` | Control the routing structure that Payload binds itself to. Specify `admin`, `api`, `graphQL`, and `graphQLPlayground`. |
| `email` | Base email settings to allow Payload to generate email such as Forgot Password requests and other requirements. [More](/docs/email/overview#configuration) |
| `debug` | Enable to expose more detailed error information. |
| `telemetry` | Disable Payload telemetry by passing `false`. [More](/docs/configuration/overview#telemetry) |
| `rateLimit` | Control IP-based rate limiting for all Payload resources. Used to prevent DDoS attacks and [more](/docs/production/preventing-abuse#rate-limiting-requests). |
| `hooks` | Tap into Payload-wide hooks. [More](/docs/hooks/overview) |
| `plugins` | An array of Payload plugins. [More](/docs/plugins/overview) |
| `endpoints` | An array of custom API endpoints added to the Payload router. [More](/docs/rest-api/overview#custom-endpoints) |
| `custom` | Extension point for adding custom data (e.g. for plugins) |
_\* An asterisk denotes that a property is required._
#### Simple example
### Simple example
```ts
import { buildConfig } from 'payload/config'
import { mongooseAdapter } from '@payloadcms/db-mongodb'
import { postgresAdapter } from '@payloadcms/db-postgres' // beta
import { viteBundler } from '@payloadcms/bundler-vite'
import { webpackBundler } from '@payloadcms/bundler-webpack'
import { lexicalEditor } from '@payloadcms/richtext-lexical' // beta
import { slateEditor } from '@payloadcms/richtext-slate'
export default buildConfig({
admin: {
bundler: webpackBundler(), // or viteBundler()
},
db: mongooseAdapter({}) // or postgresAdapter({}),
editor: lexicalEditor({}) // or slateEditor({})
collections: [
@@ -106,11 +99,11 @@ export default buildConfig({
})
```
#### Full example config
### Full example config
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
## Using environment variables in your config
We suggest using the `dotenv` package to handle environment variables alongside of Payload. All that's necessary to do is to require the package as high up in your application as possible (for example, at the top of your `server.js` file), and ensure that it can find an `.env` file that you create.
@@ -139,10 +132,10 @@ project-name
<br />
If you use an environment variable to configure any properties that are required for the Admin
panel to function (ex. serverURL or any routes), you need to make sure that your Admin panel code
can access it. [Click here](/docs/admin/webpack#admin-environment-vars) for more info.
can access it. [Click here](/docs/admin/environment-vars) for more info.
</Banner>
### Customizing & Automating Config Location Detection
## Customizing & Automating Config Location Detection
Payload is designed to automatically locate your configuration file. By default, it will first look in the root of your current working directory for a file named `payload.config.js` or `payload.config.ts` if you're using TypeScript.
@@ -152,7 +145,7 @@ In production mode, Payload will first attempt to find the config file in the ou
Please ensure your `tsconfig.json` is properly configured if you want Payload to accurately auto-detect your configuration file location. If `tsconfig.json` does not exist or doesn't specify `rootDir` or `outDir`, Payload will default to the current working directory.
#### Overriding the Config Location
### Overriding the Config Location
In addition to the above automated detection, you can specify your own location for the Payload config file. This is done by using the environment variable `PAYLOAD_CONFIG_PATH`. The path you provide via this environment variable can either be absolute or relative to your current working directory. This can be useful in situations where your Payload config is not in a standard location, or you wish to switch between multiple configurations.
@@ -168,11 +161,11 @@ In addition to the above automated detection, you can specify your own location
When `PAYLOAD_CONFIG_PATH` is set, Payload will use this path to load the configuration, bypassing all automated detection.
### Developing within the Config
## Developing within the Config
Payload comes with `isomorphic-fetch` installed which means that even in Node, you can use the `fetch` API just as you would within the browser. No need to import `axios` or similar, unless you want to!
### TypeScript
## TypeScript
You can import config types as follows:
@@ -190,7 +183,7 @@ import { SanitizedConfig } from 'payload/config'
// Generally, this is only used internally by Payload.
```
### Telemetry
## Telemetry
Payload collects **completely anonymous** telemetry data about general usage. This data is super important to us and helps us accurately understand how we're growing and what we can do to build the software into everything that it can possibly be. The telemetry that we collect also help us demonstrate our growth in an accurate manner, which helps us as we seek investment to build and scale our team. If we can accurately demonstrate our growth, we can more effectively continue to support Payload as free and open-source software. To opt out of telemetry, you can pass `telemetry: false` within your Payload config.

View File

@@ -2,11 +2,12 @@
title: Migrations
label: Migrations
order: 20
keywords: database, migrations, ddl, sql, mongodb, postgres, documentation, Content Management System, cms, headless, typescript, node, react, express
keywords: database, migrations, ddl, sql, mongodb, postgres, documentation, Content Management System, cms, headless, typescript, node, react, nextjs
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.
@@ -19,38 +20,48 @@ Ensure you have an npm script called "payload" in your `package.json` file.
```
<Banner>
Note that you need to run Payload migrations through the package manager that you are using, because Payload should not be globally installed on your system.
Note that you need to run Payload migrations through the package manager that you are using,
because Payload should not be globally installed on your system.
</Banner>
### Migration file contents
## 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
};
}
```
### Migrations Directory
## 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.
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.
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
@@ -64,7 +75,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
@@ -72,7 +84,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

@@ -3,10 +3,11 @@ title: MongoDB
label: MongoDB
order: 40
desc: Payload has supported MongoDB natively since we started. The flexible nature of MongoDB lends itself well to Payload's powerful fields.
keywords: MongoDB, documentation, typescript, Content Management System, cms, headless, javascript, node, react, express
keywords: MongoDB, documentation, typescript, Content Management System, cms, headless, javascript, node, react, nextjs
---
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:
@@ -27,18 +28,20 @@ export default buildConfig({
})
```
### Options
## 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. |
| `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. |
| 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. |
| `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. | |
### Access to Mongoose models
## 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:

View File

@@ -2,7 +2,7 @@
title: Database
label: Overview
order: 10
keywords: database, mongodb, postgres, documentation, Content Management System, cms, headless, typescript, node, react, express
keywords: database, mongodb, postgres, documentation, Content Management System, cms, headless, typescript, node, react, nextjs
desc: With Payload, you bring your own database and own your data. You have full control.
---
@@ -19,7 +19,7 @@ To use a specific database adapter, you need to install it and configure it acco
There are several factors to consider when choosing which database technology and hosting option is right for your project and workload. Payload can theoretically support any database, but it's up to you to decide which database to use.
#### When to use MongoDB
### When to use MongoDB
If your project has a lot of dynamic fields, and you are comfortable with allowing Payload to enforce data integrity across your documents, MongoDB is a great choice. With it, your Payload documents are stored as _one_ document in your database—no matter if you have localization enabled, how many block or array fields you have, etc. This means that the shape of your data in your database will very closely reflect your field schema, and there is minimal complexity involved in storing or retrieving your data.
@@ -30,7 +30,7 @@ You should prefer MongoDB if:
- Most (or everything) in your project is localized
- You leverage a lot of array fields, block fields, or `hasMany` select fields and similar
#### When to use a relational DB
### When to use a relational DB
Many projects might call for more rigid database architecture where the shape of your data is strongly enforced at the database level. For example, if you know the shape of your data and it's relatively "flat", and you don't anticipate it to change often, your workload might suit relational databases like Postgres very well.
@@ -40,17 +40,17 @@ You should prefer a relational DB like Postgres if:
- You require enforced data consistency at the database level
- You have a lot of relationships between collections and require relationships to be enforced
#### Differences in Payload features
### Differences in Payload features
It's important to note that almost everything Payload does is available in all of our officially supported database adapters, including localization, arrays, blocks, etc.
It's important to note that almost everything Payload does is available in all of our officially supported database adapters, including localization, arrays, blocks, etc.
The only thing that is not supported in Postgres yet is the [Point field](/docs/fields/point), but that should be added soon.
The only thing that is not supported in Postgres yet is the [Point field](/docs/fields/point), but that should be added soon.
It's up to you to choose which database you would like to use.
## Configuration
To configure the database for your Payload application, an adapter can be assigned to `config.db`. This property is required within your Payload config.
To configure the database for your Payload application, an adapter can be assigned to `config.db`. This property is required within your Payload config.
Here's an example:
@@ -67,7 +67,7 @@ export default buildConfig({
db: postgresAdapter({
pool: {
connectionString: process.env.DATABASE_URI,
}
},
}),
})
```
```

View File

@@ -2,14 +2,15 @@
title: Postgres
label: Postgres
order: 50
desc: Payload supports Postgres through an officially supported Drizzle database adapter.
keywords: Postgres, documentation, typescript, Content Management System, cms, headless, javascript, node, react, express
desc: Payload supports Postgres through an officially supported Drizzle database adapter.
keywords: Postgres, documentation, typescript, Content Management System, cms, headless, javascript, node, react, nextjs
---
To use Payload with Postgres, install the package `@payloadcms/db-postgres`. It leverages Drizzle ORM and `node-postgres` to interact with a Postgres database that you provide.
<Banner>
The Postgres database adapter 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!
The Postgres database adapter 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>
It automatically manages changes to your database for you in development mode, and exposes a full suite of migration controls for you to leverage in order to keep other database environments in sync with your schema. DDL transformations are automatically generated.
@@ -30,20 +31,27 @@ export default buildConfig({
// `pool` is required.
pool: {
connectionString: process.env.DATABASE_URI,
}
},
}),
})
```
### Options
## 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
## Access to Drizzle
After Payload is initialized, this adapter will expose the full power of Drizzle to you for use if you need it.
@@ -53,7 +61,7 @@ You can access Drizzle as follows:
payload.db.drizzle
```
### Tables, relations, and enums
## Tables, relations, and enums
In addition to exposing Drizzle directly, all of the tables, Drizzle relations, and enum configs are exposed for you via the `payload.db` property as well.
@@ -61,27 +69,29 @@ In addition to exposing Drizzle directly, all of the tables, Drizzle relations,
- Enums - `payload.db.enums`
- Relations - `payload.db.relations`
### Prototyping in development mode
## Prototyping in development mode
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.
Alternatively, you can disable `push` and rely solely on migrations to keep your local database in sync with your Payload config.
### Migration workflows
## Migration workflows
Migrations are extremely powerful thanks to the seamless way that Payload and Drizzle work together. Let's take the following scenario:
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>
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>

View File

@@ -2,7 +2,7 @@
title: Transactions
label: Transactions
order: 30
keywords: database, transactions, sql, mongodb, postgres, documentation, Content Management System, cms, headless, typescript, node, react, express
keywords: database, transactions, sql, mongodb, postgres, documentation, Content Management System, cms, headless, typescript, node, react, nextjs
desc: Database transactions are fully supported within Payload.
---
@@ -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',
@@ -31,7 +32,7 @@ const afterChange: CollectionAfterChangeHook = async ({ req }) => {
}
```
### Async Hooks with Transactions
## Async Hooks with Transactions
Since Payload hooks can be async and be written to not await the result, it is possible to have an incorrect success response returned on a request that is rolled back. If you have a hook where you do not `await` the result, then you should **not** pass the `req.transactionID`.
@@ -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: {
@@ -58,7 +59,7 @@ const afterChange: CollectionAfterChangeHook = async ({ req }) => {
}
```
### Direct Transaction Access
## 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.
@@ -66,4 +67,4 @@ 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.rollbackTransaction` - Takes the identifier for the transaction, discards any changes.

View File

@@ -2,169 +2,165 @@
title: Email Functionality
label: Overview
order: 10
desc: Payload uses NodeMailer to allow you to send emails smoothly from your app. Set up email functions such as password resets, order confirmations and more.
keywords: email, overview, config, configuration, documentation, Content Management System, cms, headless, javascript, node, react, express
desc: Payload uses an adapter pattern to enable email functionality. Set up email functions such as password resets, order confirmations and more.
keywords: email, overview, config, configuration, documentation, Content Management System, cms, headless, javascript, node, react, nextjs
---
### Introduction
## Introduction
Payload comes ready to send your application's email. Whether you simply need built-in password reset
email to work or you want customers to get an order confirmation email, you're almost there. Payload makes use of
[NodeMailer](https://nodemailer.com) for email and won't get in your way for those already familiar.
Payload has a few email adapters that can be imported to enable email functionality. The [@payloadcms/email-nodemailer](https://www.npmjs.com/package/@payloadcms/email-nodemailer) package will be the package most will want to install. This package provides an easy way to use [Nodemailer](https://nodemailer.com) for email and won't get in your way for those already familiar.
For email to send from your Payload server, some configuration is required. The settings you provide will be set
in the `email` property object of your payload init call. Payload will make use of the transport that you have configured for it for things like reset password or verifying new user accounts and email send methods are available to you as well on your payload instance.
The email adapter should be passed into the `email` property of the Payload config. This will allow Payload to send emails for things like password resets, new user verification, and any other email sending needs you may have.
### Configuration
## Configuration
**Three ways to set it up**
### Default Configuration
1. **Default**: When email is not needed, a mock email handler will be created and used when nothing is provided. This is ideal for development environments and can be changed later when ready to [go to production](/docs/production/deployment).
1. **Recommended**: Set the `transportOptions` and Payload will do the set up for you.
1. **Advanced**: The `transport` object can be assigned a nodemailer transport object set up in your server scripts and given for Payload to use.
When email is not needed or desired, Payload will log a warning on startup notifying that email is not configured. A warning message will also be logged on any attempt to send an email.
The following options are configurable in the `email` property object as part of the options object when calling payload.init().
### Email Adapter
| Option | Description |
| ------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **`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 |
| **`logMockCredentials`** | If set to true and no transport/transportOptions, ethereal credentials will be logged to console on startup |
An email adapter will require at least the following fields:
_\* An asterisk denotes that a property is required._
| Option | Description |
| --------------------------- | -------------------------------------------------------------------------------- |
| **`defaultFromName`** \* | The name part of the From field that will be seen on the delivered email |
| **`defaultFromAddress`** \* | The email address part of the From field that will be used when delivering email |
### Use SMTP
Simple Mail Transfer Protocol, also known as SMTP can be passed in using the `transportOptions` object on the `email` options.
### Official Email Adapters
**Example email part using SMTP:**
| Name | Package | Description |
| ---------- | ------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Nodemailer | [@payloadcms/email-nodemailer](https://www.npmjs.com/package/@payloadcms/email-nodemailer) | Use any [Nodemailer transport](https://nodemailer.com/transports), including SMTP, Resend, SendGrid, and more. This was provided by default in Payload 2.x. This is the easiest migration path. |
| Resend | [@payloadcms/email-resend](https://www.npmjs.com/package/@payloadcms/email-resend) | Resend email via their REST API. This is preferred for serverless platforms such as Vercel because it is much more lightweight than the nodemailer adapter. |
## Nodemailer Configuration
| Option | Description |
| ---------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **`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) or see the examples below |
## Use SMTP
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 options using SMTP:**
```ts
payload.init({
email: {
import { buildConfig } from 'payload/config'
import { nodemailerAdapter } from '@payloadcms/email-nodemailer'
export default buildConfig({
email: nodemailerAdapter({
defaultFromAddress: 'info@payloadcms.com',
defaultFromName: 'Payload',
// Nodemailer transportOptions
transportOptions: {
host: process.env.SMTP_HOST,
port: 587,
auth: {
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,
},
},
fromName: 'hello',
fromAddress: 'hello@example.com',
},
// ...
}),
})
```
<Banner type="warning">
It is best practice to avoid saving credentials or API keys directly in your code, use
[environment variables](/docs/configuration/overview#using-environment-variables-in-your-config).
</Banner>
### 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.
**Example email options using nodemailer.createTransport:**
```ts
import payload from 'payload'
import nodemailerSendgrid from 'nodemailer-sendgrid'
const sendGridAPIKey = process.env.SENDGRID_API_KEY
payload.init({
...(sendGridAPIKey
? {
email: {
transportOptions: nodemailerSendgrid({
apiKey: sendGridAPIKey,
}),
fromName: 'Admin',
fromAddress: 'admin@example.com',
},
}
: {}),
})
```
### Use a custom NodeMailer transport
To take full control of the mail transport you may wish to use `nodemailer.createTransport()` on your server and provide it to Payload init.
```ts
import payload from 'payload'
import { buildConfig } from 'payload/config'
import { nodemailerAdapter } from '@payloadcms/email-nodemailer'
import nodemailer from 'nodemailer'
const payload = require('payload')
const nodemailer = require('nodemailer')
const transport = await nodemailer.createTransport({
host: process.env.SMTP_HOST,
port: 587,
auth: {
user: process.env.SMTP_USER,
pass: process.env.SMTP_PASS,
},
})
payload.init({
email: {
fromName: 'Admin',
fromAddress: 'admin@example.com',
transport,
},
// ...
export default buildConfig({
email: nodemailerAdapter({
defaultFromAddress: 'info@payloadcms.com',
defaultFromName: 'Payload',
// Any Nodemailer transport can be used
transport: nodemailer.createTransport({
host: process.env.SMTP_HOST,
port: 587,
auth: {
user: process.env.SMTP_USER,
pass: process.env.SMTP_PASS,
},
}),
}),
})
```
### Sending Mail
**Custom Transport:**
With a working transport you can call it anywhere you have access to payload by calling `payload.sendEmail(message)`. The `message` will contain the `to`, `subject` and `email` or `text` for the email being sent. To see all available message configuration options see [NodeMailer](https://nodemailer.com/message).
You also have the ability to bring your own nodemailer transport. This is an example of using the SendGrid nodemailer transport.
### Mock transport
By default, Payload uses a mock implementation that only sends mail to the [ethereal](https://ethereal.email) capture service that will never reach a user's inbox. While in development you may wish to make use of the captured messages which is why the payload output during server output helpfully logs this out on the server console.
To see ethereal credentials, add `logMockCredentials: true` to the email options. This will cause them to be logged to console on startup.
```ts
payload.init({
email: {
fromName: 'Admin',
fromAddress: 'admin@example.com',
logMockCredentials: true, // Optional
},
// ...
import { buildConfig } from 'payload/config'
import { nodemailerAdapter } from '@payloadcms/email-nodemailer'
import nodemailerSendgrid from 'nodemailer-sendgrid'
export default buildConfig({
email: nodemailerAdapter({
defaultFromAddress: 'info@payloadcms.com',
defaultFromName: 'Payload',
transportOptions: nodemailerSendgrid({
apiKey: process.env.SENDGRID_API_KEY,
}),
}),
})
```
**Console output when starting payload with a mock email instance and logMockCredentials: true**
During development, if you pass nothing to `nodemailerAdapter`, it will use the [ethereal.email](https://ethereal.email) service.
```
[06:37:21] INFO (payload): Starting Payload...
[06:37:22] INFO (payload): Payload Demo Initialized
[06:37:22] INFO (payload): listening on 3000...
[06:37:22] INFO (payload): Connected to MongoDB server successfully!
[06:37:23] INFO (payload): E-mail configured with mock configuration
[06:37:23] INFO (payload): Log into mock email provider at https://ethereal.email
[06:37:23] INFO (payload): Mock email account username: hhav5jw7doo4euev@ethereal.email
[06:37:23] INFO (payload): Mock email account password: VNdGcvDZeyEhtuPBqf
This will log the ethereal.email details to console on startup.
```ts
import { nodemailerAdapter } from '@payloadcms/email-nodemailer'
export default buildConfig({
email: nodemailerAdapter(),
})
```
The mock email handler is used when payload is started with neither `transport` or `transportOptions` to know how to deliver email.
## Resend Configuration
<Banner type="warning">
The randomly generated email account username and password will be different each time the Payload
server starts.
</Banner>
The Resend adapter requires an API key to be passed in the options. This can be found in the Resend dashboard. This is the preferred package if you are deploying on Vercel because this is much more lightweight than the Nodemailer adapter.
### Using multiple mail providers
| Option | Description |
| ------ | ----------------------------------- |
| apiKey | The API key for the Resend service. |
```ts
import { buildConfig } from 'payload/config'
import { resendAdapter } from '@payloadcms/email-resend'
export default buildConfig({
email: resendAdapter({
defaultFromAddress: 'dev@payloadcms.com',
defaultFromName: 'Payload CMS',
apiKey: process.env.RESEND_API_KEY || '',
}),
})
```
## Sending Mail
With a working transport you can call it anywhere you have access to payload by calling `payload.sendEmail(message)`. The `message` will contain the `to`, `subject` and `html` or `text` for the email being sent. Other options are also available and can be seen in the sendEmail args. Support for these will depend on the adapter being used.
```ts
// Example of sending an email
const email = await payload.sendEmail({
to: 'test@example.com',
subject: 'This is a test email',
text: 'This is my message body',
})
```
## Using multiple mail providers
Payload supports the use of a single transporter of email, but there is nothing stopping you from having more. Consider a use case where sending bulk email is handled differently than transactional email and could be done using a [hook](/docs/hooks/overview).

View File

@@ -0,0 +1,40 @@
---
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)
- [Tailwind / Shadcn-ui](https://github.com/payloadcms/payload/tree/main/examples/tailwind-shadcn-ui)
- [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)
When 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

@@ -3,7 +3,7 @@ title: Array Field
label: Array
order: 20
desc: Array fields are intended for sets of repeating fields, that you define. Learn how to use array fields, see examples and options.
keywords: array, fields, config, configuration, documentation, Content Management System, cms, headless, javascript, node, react, express
keywords: array, fields, config, configuration, documentation, Content Management System, cms, headless, javascript, node, react, nextjs
---
<Banner>
@@ -24,7 +24,7 @@ keywords: array, fields, config, configuration, documentation, Content Managemen
- 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
## Config
| Option | Description |
| ------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
@@ -45,10 +45,11 @@ 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
## Admin Config
In addition to the default [field admin config](/docs/fields/overview#admin-config), you can adjust the following properties:
@@ -56,8 +57,9 @@ In addition to the default [field admin config](/docs/fields/overview#admin-conf
| ------------------------- | -------------------------------------------------------------------------------------------------------------------- |
| **`initCollapsed`** | Set the initial collapsed state |
| **`components.RowLabel`** | Function or React component to be rendered as the label on the array row. Receives `({ data, index, path })` as args |
| **`isSortable`** | Disable order sorting by setting this value to `false` |
### Example
## Example
`collections/ExampleCollection.ts`

View File

@@ -3,7 +3,7 @@ title: Blocks Field
label: Blocks
order: 30
desc: The Blocks field type is a great layout build and can be used to construct any flexible content model. Learn how to use Block fields, see examples and options.
keywords: blocks, fields, config, configuration, documentation, Content Management System, cms, headless, javascript, node, react, express
keywords: blocks, fields, config, configuration, documentation, Content Management System, cms, headless, javascript, node, react, nextjs
---
<Banner>
@@ -26,7 +26,7 @@ keywords: blocks, fields, config, configuration, documentation, Content Manageme
- 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
## Field config
| Option | Description |
| ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
@@ -49,15 +49,16 @@ keywords: blocks, fields, config, configuration, documentation, Content Manageme
_\* An asterisk denotes that a property is required._
### Admin Config
## Admin Config
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 |
| Option | Description |
| ------------------- | ---------------------------------- |
| **`initCollapsed`** | Set the initial collapsed state |
| **`isSortable`** | Disable order sorting by setting this value to `false` |
### Block configs
## Block configs
Blocks are defined as separate configs of their own.
@@ -80,8 +81,10 @@ 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
### Auto-generated data per block
In addition to the field data that you define on each block, Payload will store two additional properties on each block:
@@ -93,7 +96,7 @@ The `blockType` is saved as the slug of the block that has been selected.
The Admin panel provides each block with a `blockName` field which optionally allows editors to label their blocks for better editability and readability.
### Example
## Example
`collections/ExampleCollection.js`
@@ -136,7 +139,7 @@ export const ExampleCollection: CollectionConfig = {
}
```
### TypeScript
## 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:

View File

@@ -3,7 +3,7 @@ title: Checkbox Field
label: Checkbox
order: 40
desc: Checkbox field types allow the developer to save a boolean value in the database. Learn how to use Checkbox fields, see examples and options.
keywords: checkbox, fields, config, configuration, documentation, Content Management System, cms, headless, javascript, node, react, express
keywords: checkbox, fields, config, configuration, documentation, Content Management System, cms, headless, javascript, node, react, nextjs
---
<Banner>The Checkbox field type saves a boolean in the database.</Banner>
@@ -15,27 +15,27 @@ keywords: checkbox, fields, config, configuration, documentation, Content Manage
caption="Admin panel screenshot of Checkbox field with Text field below"
/>
### Config
## 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 a field label in the Admin panel or an object with keys for each language. |
| **`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) |
| **`label`** | Text used as a field label in the Admin panel or an object with keys for each language. |
| **`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, will default to false if field is also `required`. [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, will default to false if field is also `required`. [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._
### Example
## Example
`collections/ExampleCollection.ts`

View File

@@ -4,7 +4,7 @@ label: Code
order: 50
desc: The Code field type will store any string in the Database. Learn how to use Code fields, see examples and options.
keywords: code, fields, config, configuration, documentation, Content Management System, cms, headless, javascript, node, react, express
keywords: code, fields, config, configuration, documentation, Content Management System, cms, headless, javascript, node, react, nextjs
---
<Banner>
@@ -21,30 +21,30 @@ keywords: code, fields, config, configuration, documentation, Content Management
This field uses the `monaco-react` editor syntax highlighting.
### Config
## 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 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. |
| 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 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 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. |
| **`minLength`** | Used by the default validation function to ensure values are of a minimum character length. |
| **`maxLength`** | Used by the default validation function to ensure values are of a maximum character length. |
| **`validate`** | Provide a custom validation function that will be executed on both the Admin panel and the backend. [More](/docs/fields/overview#validation) |
| **`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 below for [more detail](#admin-config). |
| **`custom`** | Extension point for adding custom data (e.g. for plugins) |
| **`minLength`** | Used by the default validation function to ensure values are of a minimum character length. |
| **`maxLength`** | Used by the default validation function to ensure values are of a maximum character length. |
| **`validate`** | Provide a custom validation function that will be executed on both the Admin panel and the backend. [More](/docs/fields/overview#validation) |
| **`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 below for [more detail](#admin-config). |
| **`custom`** | Extension point for adding custom data (e.g. for plugins) |
_\* An asterisk denotes that a property is required._
### Admin Config
## Admin Config
In addition to the default [field admin config](/docs/fields/overview#admin-config), you can adjust the following properties:
@@ -53,7 +53,7 @@ In addition to the default [field admin config](/docs/fields/overview#admin-conf
| **`language`** | This property can be set to any language listed [here](https://github.com/microsoft/monaco-editor/tree/main/src/basic-languages). |
| **`editorOptions`** | Options that can be passed to the monaco editor, [view the full list](https://microsoft.github.io/monaco-editor/typedoc/interfaces/editor.IDiffEditorConstructionOptions.html). |
### Example
## Example
`collections/ExampleCollection.ts

View File

@@ -3,7 +3,7 @@ title: Collapsible Field
label: Collapsible
order: 60
desc: With the Collapsible field, you can place fields within a collapsible layout component that can be collapsed / expanded.
keywords: row, fields, config, configuration, documentation, Content Management System, cms, headless, javascript, node, react, express
keywords: row, fields, config, configuration, documentation, Content Management System, cms, headless, javascript, node, react, nextjs
---
<Banner>
@@ -18,7 +18,7 @@ keywords: row, fields, config, configuration, documentation, Content Management
caption="Admin panel screenshot of a Collapsible field"
/>
### Config
## Config
| Option | Description |
| --------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
@@ -29,7 +29,7 @@ keywords: row, fields, config, configuration, documentation, Content Management
_\* An asterisk denotes that a property is required._
### Admin Config
## Admin Config
In addition to the default [field admin config](/docs/fields/overview#admin-config), you can adjust the following properties:
@@ -37,7 +37,7 @@ In addition to the default [field admin config](/docs/fields/overview#admin-conf
| ------------------- | ------------------------------- |
| **`initCollapsed`** | Set the initial collapsed state |
### Example
## Example
`collections/ExampleCollection.ts`

View File

@@ -3,7 +3,7 @@ title: Date Field
label: Date
order: 70
desc: The Date field type stores a Date in the database. Learn how to use and customize the Date field, see examples and options.
keywords: date, fields, config, configuration, documentation, Content Management System, cms, headless, javascript, node, react, express
keywords: date, fields, config, configuration, documentation, Content Management System, cms, headless, javascript, node, react, nextjs
---
<Banner>
@@ -20,48 +20,48 @@ keywords: date, fields, config, configuration, documentation, Content Management
This field uses [`react-datepicker`](https://www.npmjs.com/package/react-datepicker) for the Admin panel component.
### Config
## 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 a field label in the Admin panel or an object with keys for each language. |
| 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 a field label in the Admin panel or an object with keys for each language. |
| **`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) |
| **`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 below for [more detail](#admin-config). |
| **`custom`** | Extension point for adding custom data (e.g. for plugins) |
| **`validate`** | Provide a custom validation function that will be executed on both the Admin panel and the backend. [More](/docs/fields/overview#validation) |
| **`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 below for [more detail](#admin-config). |
| **`custom`** | Extension point for adding custom data (e.g. for plugins) |
_\* An asterisk denotes that a property is required._
### Admin Config
## Admin Config
In addition to the default [field admin config](/docs/fields/overview#admin-config), you can customize the following fields that will adjust how the component displays in the admin panel via the `date` property.
| Property | Description |
| ------------------------------ | ------------------------------------------------------------------------------------------- |
| **`placeholder`** | Placeholder text for the field. |
| **`date`** | Pass options to customize date field appearance. |
| **`date.displayFormat`** | Format date to be shown in field **cell**. |
| **`date.pickerAppearance`** \* | Determines the appearance of the datepicker: `dayAndTime` `timeOnly` `dayOnly` `monthOnly`. |
| **`date.monthsToShow`** \* | Number of months to display max is 2. Defaults to 1. |
| **`date.minDate`** \* | Min date value to allow. |
| **`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'`. |
| Property | Description |
| ------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------- |
| **`placeholder`** | Placeholder text for the field. |
| **`date`** | Pass options to customize date field appearance. |
| **`date.displayFormat`** | Format date to be shown in field **cell**. |
| **`date.pickerAppearance`** \* | Determines the appearance of the datepicker: `dayAndTime` `timeOnly` `dayOnly` `monthOnly`. |
| **`date.monthsToShow`** \* | Number of months to display max is 2. Defaults to 1. |
| **`date.minDate`** \* | Min date value to allow. |
| **`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'`. |
_\* This property is passed directly to [react-datepicker](https://github.com/Hacker0x01/react-datepicker/blob/master/docs/datepicker.md). ._
#### Display Format and Picker Appearance
### Display Format and Picker Appearance
These properties only affect how the date is displayed in the UI. The full date is always stored in the format `YYYY-MM-DDTHH:mm:ss.SSSZ` (e.g. `1999-01-01T8:00:00.000+05:00`).
@@ -71,7 +71,7 @@ These properties only affect how the date is displayed in the UI. The full date
When only `pickerAppearance` is set, an equivalent format will be rendered in the date field cell. To overwrite this format, set `displayFormat`.
### Example
## Example
`collections/ExampleCollection.ts`

View File

@@ -3,7 +3,7 @@ title: Email Field
label: Email
order: 80
desc: The Email field enforces that the value provided is a valid email address. Learn how to use Email fields, see examples and options.
keywords: email, fields, config, configuration, documentation, Content Management System, cms, headless, javascript, node, react, express
keywords: email, fields, config, configuration, documentation, Content Management System, cms, headless, javascript, node, react, nextjs
---
<Banner>The Email field enforces that the value provided is a valid email address.</Banner>
@@ -15,28 +15,28 @@ keywords: email, fields, config, configuration, documentation, Content Managemen
caption="Admin panel screenshot of an Email field"
/>
### Config
## 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 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. |
| 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 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 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) |
| **`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 below for [more detail](#admin-config). |
| **`custom`** | Extension point for adding custom data (e.g. for plugins) |
| **`validate`** | Provide a custom validation function that will be executed on both the Admin panel and the backend. [More](/docs/fields/overview#validation) |
| **`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 below for [more detail](#admin-config). |
| **`custom`** | Extension point for adding custom data (e.g. for plugins) |
_\* An asterisk denotes that a property is required._
### Admin config
## Admin config
In addition to the default [field admin config](/docs/fields/overview#admin-config), this field type allows for the following `admin` properties:
@@ -48,7 +48,7 @@ Set this property to define a placeholder string for the field.
Set this property to a string that will be used for browser autocomplete.
### Example
## Example
`collections/ExampleCollection.ts`

View File

@@ -3,7 +3,7 @@ title: Group Field
label: Group
order: 90
desc: The Group field allows other fields to be nested under a common property. Learn how to use Group fields, see examples and options.
keywords: group, fields, config, configuration, documentation, Content Management System, cms, headless, javascript, node, react, express
keywords: group, fields, config, configuration, documentation, Content Management System, cms, headless, javascript, node, react, nextjs
---
<Banner>
@@ -18,7 +18,7 @@ keywords: group, fields, config, configuration, documentation, Content Managemen
caption="Admin panel screenshot of a Group field"
/>
### Config
## Config
| Option | Description |
| ------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
@@ -38,7 +38,7 @@ keywords: group, fields, config, configuration, documentation, Content Managemen
_\* An asterisk denotes that a property is required._
### Admin config
## Admin config
In addition to the default [field admin config](/docs/fields/overview#admin-config), the Group allows for the following admin property:
@@ -46,7 +46,7 @@ In addition to the default [field admin config](/docs/fields/overview#admin-conf
Set this property to `true` to hide this field's gutter within the admin panel. The field gutter is rendered as a vertical line and padding, but often if this field is nested within a Group, Block, or Array, you may want to hide the gutter.
### Example
## Example
`collections/ExampleCollection.ts`

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, nextjs
---
<Banner>
@@ -21,38 +21,39 @@ keywords: json, fields, config, configuration, documentation, Content Management
This field uses the `monaco-react` editor syntax highlighting.
### Config
## 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 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. |
| **`validate`** | Provide a custom validation function that will be executed on both the Admin panel and the backend. [More](/docs/fields/overview#validation) |
| **`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 below for [more detail](#admin-config). |
| **`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) |
| **`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 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) |
| **`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 below for [more detail](#admin-config). |
| **`custom`** | Extension point for adding custom data (e.g. for plugins) |
_\* An asterisk denotes that a property is required._
### Admin Config
## Admin Config
In addition to the default [field admin config](/docs/fields/overview#admin-config), you can adjust the following properties:
| Option | Description |
| ------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Option | Description |
| ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **`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
## Example
`collections/ExampleCollection.ts
`collections/ExampleCollection.ts`
```ts
import { CollectionConfig } from 'payload/types'
@@ -68,3 +69,67 @@ 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

@@ -3,7 +3,7 @@ title: Number Field
label: Number
order: 100
desc: Number fields store and validate numeric data. Learn how to use and format Number fields, see examples and Number field options.
keywords: number, fields, config, configuration, documentation, Content Management System, cms, headless, javascript, node, react, express
keywords: number, fields, config, configuration, documentation, Content Management System, cms, headless, javascript, node, react, nextjs
---
<Banner>
@@ -18,33 +18,33 @@ keywords: number, fields, config, configuration, documentation, Content Manageme
caption="Admin panel screenshot of a Number field"
/>
### Config
## 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 a field label in the Admin panel or an object with keys for each language. |
| **`min`** | Minimum value accepted. Used in the default `validation` function. |
| **`max`** | Maximum value accepted. Used in the default `validation` function. |
| **`hasMany`** | Makes this field an ordered array of numbers instead of just a single number. |
| **`minRows`** | Minimum number of numbers in the numbers array, if `hasMany` is set to true. |
| **`maxRows`** | Maximum number of numbers in the numbers array, if `hasMany` is set to true. |
| **`unique`** | Enforce that each entry in the Collection has a unique value for this field. |
| **`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) |
| **`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 below for [more detail](#admin-config). |
| **`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) |
| **`label`** | Text used as a field label in the Admin panel or an object with keys for each language. |
| **`min`** | Minimum value accepted. Used in the default `validation` function. |
| **`max`** | Maximum value accepted. Used in the default `validation` function. |
| **`hasMany`** | Makes this field an ordered array of numbers instead of just a single number. |
| **`minRows`** | Minimum number of numbers in the numbers array, if `hasMany` is set to true. |
| **`maxRows`** | Maximum number of numbers in the numbers array, if `hasMany` is set to true. |
| **`unique`** | Enforce that each entry in the Collection has a unique value for this field. |
| **`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) |
| **`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 below for [more detail](#admin-config). |
| **`custom`** | Extension point for adding custom data (e.g. for plugins) |
_\* An asterisk denotes that a property is required._
### Admin config
## Admin config
In addition to the default [field admin config](/docs/fields/overview#admin-config), this field type allows for the following `admin` properties:
@@ -60,7 +60,7 @@ Set this property to define a placeholder string for the field.
Set this property to a string that will be used for browser autocomplete.
### Example
## Example
`collections/ExampleCollection.ts`

View File

@@ -3,7 +3,7 @@ title: Fields Overview
label: Overview
order: 10
desc: Fields are the building blocks of Payload, find out how to add or remove a field, change field type, add hooks, define access control and validation.
keywords: overview, fields, config, configuration, documentation, Content Management System, cms, headless, javascript, node, react, express
keywords: overview, fields, config, configuration, documentation, Content Management System, cms, headless, javascript, node, react, nextjs
---
<Banner type="info">
@@ -36,7 +36,7 @@ export const Page: CollectionConfig = {
}
```
### Field types
## Field types
- [Array](/docs/fields/array) - for repeating content, supports nested fields
- [Blocks](/docs/fields/blocks) - block-based fields, allowing powerful layout creation
@@ -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
@@ -59,19 +60,19 @@ export const Page: CollectionConfig = {
- [Upload](/docs/fields/upload) - allows local file and image upload
- [UI](/docs/fields/ui) - inject your own custom components and do whatever you need
### Field-level hooks
## Field-level hooks
One of the most powerful parts about Payload is its ability for you to define field-level hooks that can control the logic of your fields to a fine-grained level. for more information about how to define field hooks, [click here](/docs/hooks/overview#field-hooks).
### Field-level access control
## Field-level access control
In addition to being able to define access control on a document-level, you can define extremely granular permissions on a field by field level. For more information about field-level access control, [click here](/docs/access-control/overview#fields).
### Field names
## 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.
### Validation
## Validation
Field validation is enforced automatically based on the field type and other properties such as `required` or `min` and `max` value constraints on certain field types. This default behavior can be replaced by providing your own validate function for any field. It will be used on both the frontend and the backend, so it should not rely on any Node-specific packages. The validation function can be either synchronous or asynchronous and expects to return either `true` or a string error message to display in both API responses and within the Admin panel.
@@ -82,15 +83,15 @@ There are two arguments available to custom validation functions.
| Property | Description |
| ------------- | ------------------------------------------------------------------------------------------------------------------------ |
| `data` | An object of the full collection or global document. |
| `siblingData` | An object of the document data limited to fields within the same parent to the field. |
| `operation` | Will be "create" or "update" depending on the UI action or API call. |
| `id` | The value of the collection `id`, will be `undefined` on create request. |
| `t` | The function for translating text, [more](/docs/configuration/i18n). |
| `user` | The currently authenticated user object. |
| `data` | An object containing the full collection or global document currently being edited |
| `siblingData` | An object containing document data that is scoped to only fields within the same parent of this field |
| `operation` | Will be `create` or `update` depending on the UI action or API call |
| `id` | The `id` of the current document being edited. `id` is `undefined` during the `create` operation |
| `t` | The function for translating text, [more](/docs/configuration/i18n) |
| `user` | An object containing the currently authenticated user |
| `payload` | If the `validate` function is being executed on the server, Payload will be exposed for easily running local operations. |
Example:
## Example
```ts
import { CollectionConfig } from 'payload/types'
@@ -139,7 +140,7 @@ const field: Field = {
}
```
### Customizable ID
## Customizable ID
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.
@@ -158,29 +159,31 @@ Example:
}
```
### Admin config
## Admin config
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
## Custom components
All Payload fields support the ability to swap in your own React components with ease. For more information, including examples, [click here](/docs/admin/components#fields).
### Conditional logic
## Conditional logic
You can show and hide fields based on what other fields are doing by utilizing conditional logic on a field by field basis. The `condition` property on a field's admin config accepts a function which takes three arguments:
@@ -219,7 +222,7 @@ The `condition` function should return a boolean that will control if the field
}
```
### Default values
## Default values
Fields can be prefilled with starting values using the `defaultValue` property. This is used in the admin UI and also on the backend as API requests will be populated with missing or undefined field values. You can assign the defaultValue directly in the field configuration or supply a function for dynamic behavior. Values assigned during a create request on the server are added before validation occurs.
@@ -249,7 +252,7 @@ const field = {
You can use async defaultValue functions to fill fields with data from API requests.
</Banner>
### Description
## Description
A description can be configured in three ways.
@@ -311,7 +314,7 @@ This example will display the number of characters allowed as the user types.
This component will count the number of characters entered, as well as display the path of the field.
### TypeScript
## TypeScript
You can import the internal Payload `Field` type as well as other common field types as follows:

View File

@@ -4,7 +4,7 @@ label: Point
order: 110
desc: The Point field type stores coordinates in the database. Learn how to use Point field for geolocation and geometry.
keywords: point, geolocation, geospatial, geojson, 2dsphere, config, configuration, documentation, Content Management System, cms, headless, javascript, node, react, express
keywords: point, geolocation, geospatial, geojson, 2dsphere, config, configuration, documentation, Content Management System, cms, headless, javascript, node, react, nextjs
---
<Banner>
@@ -25,24 +25,24 @@ keywords: point, geolocation, geospatial, geojson, 2dsphere, config, configurati
The data structure in the database matches the GeoJSON structure to represent point. The Payload APIs simplifies the object data to only the [longitude, latitude] location.
### Config
## 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`** | Used as a field label in the Admin panel and to name the generated GraphQL type. |
| **`unique`** | Enforce that each entry in the Collection has a unique value for this field. |
| Option | Description |
| ------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **`name`** \* | To be used as the property name when stored and retrieved from the database. [More](/docs/fields/overview#field-names) |
| **`label`** | Used as a field label in the Admin panel and to name the generated GraphQL type. |
| **`unique`** | Enforce that each entry in the Collection has a unique value for this field. |
| **`index`** | Build an [index](/docs/database/overview) for this field to produce faster queries. To support location queries, point index defaults to `2dsphere`, to disable the index set to `false`. |
| **`validate`** | Provide a custom validation function that will be executed on both the Admin panel and the backend. [More](/docs/fields/overview#validation) |
| **`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 below for [more detail](#admin-config). |
| **`custom`** | Extension point for adding custom data (e.g. for plugins) |
| **`validate`** | Provide a custom validation function that will be executed on both the Admin panel and the backend. [More](/docs/fields/overview#validation) |
| **`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 below for [more detail](#admin-config). |
| **`custom`** | Extension point for adding custom data (e.g. for plugins) |
_\* An asterisk denotes that a property is required._
@@ -50,7 +50,7 @@ _\* An asterisk denotes that a property is required._
<strong>Note:</strong> The Point field type is currently only supported in MongoDB.
</Banner>
### Example
## Example
`collections/ExampleCollection.ts`
@@ -69,6 +69,6 @@ export const ExampleCollection: CollectionConfig = {
}
```
### Querying
## Querying
In order to do query based on the distance to another point, you can use the `near` operator. When querying using the near operator, the returned documents will be sorted by nearest first.

View File

@@ -3,7 +3,7 @@ title: Radio Group Field
label: Radio Group
order: 120
desc: The Radio field type allows for the selection of one value from a predefined set of possible values. Learn how to use Radio fields, see examples and options.
keywords: radio, fields, config, configuration, documentation, Content Management System, cms, headless, javascript, node, react, express
keywords: radio, fields, config, configuration, documentation, Content Management System, cms, headless, javascript, node, react, nextjs
---
<Banner>
@@ -18,24 +18,25 @@ keywords: radio, fields, config, configuration, documentation, Content Managemen
caption="Admin panel screenshot of a Radio field"
/>
### Config
## 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 an `label` string and a `value` string. |
| **`label`** | Text used as a field label in the Admin panel or an object with keys for each language. |
| **`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) |
| **`options`** \* | Array of options to allow the field to store. Can either be an array of strings, or an array of objects containing an `label` string and a `value` string. |
| **`label`** | Text used as a field label in the Admin panel or an object with keys for each language. |
| **`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. The default value must exist within provided values in `options`. [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 below for [more detail](#admin-config). |
| **`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. The default value must exist within provided values in `options`. [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 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._
@@ -48,7 +49,7 @@ _\* An asterisk denotes that a property is required._
being used as a GraphQL enum.
</Banner>
### Admin config
## Admin config
In addition to the default [field admin config](/docs/fields/overview#admin-config), the Radio Group field type allows for the specification of the following `admin` properties:
@@ -56,7 +57,7 @@ In addition to the default [field admin config](/docs/fields/overview#admin-conf
The `layout` property allows for the radio group to be styled as a horizonally or vertically distributed list. The default value is `horizontal`.
### Example
## Example
`collections/ExampleCollection.ts`

View File

@@ -3,7 +3,7 @@ title: Relationship Field
label: Relationship
order: 130
desc: The Relationship field provides the ability to relate documents together. Learn how to use Relationship fields, see examples and options.
keywords: relationship, fields, config, configuration, documentation, Content Management System, cms, headless, javascript, node, react, express
keywords: relationship, fields, config, configuration, documentation, Content Management System, cms, headless, javascript, node, react, nextjs
---
<Banner>
@@ -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:**
@@ -24,30 +24,30 @@ caption="Admin panel screenshot of a Relationship field"
- To allow for an `Order` to feature a `placedBy` relationship to either an `Organization` or `User` collection
- To assign `Category` documents to `Post` documents
### Config
## 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 maximum population depth for this field, regardless of the remaining depth when this field is reached. [Max Depth](/docs/getting-started/concepts#field-level-max-depth) |
| **`label`** | Text used as a field label in the Admin panel or an object with keys for each language. |
| **`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._
@@ -58,7 +58,7 @@ _\* An asterisk denotes that a property is required._
related documents that are returned by the API.
</Banner>
### Admin config
## 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:
@@ -122,7 +122,7 @@ In this configuration:
Note: If `sortOptions` is not defined, the default sorting behavior of the Relationship field dropdown will be used.
### Filtering relationship options
## 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.
@@ -131,15 +131,15 @@ The `filterOptions` property can either be a `Where` query, or a function return
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 |
| `id` | The value of the collection `id`, will be `undefined` on create request |
| `user` | The currently authenticated user object |
| Property | Description |
| ------------- | ----------------------------------------------------------------------------------------------------- |
| `relationTo` | The collection `slug` to filter against, limited to this field's `relationTo` property |
| `data` | An object containing the full collection or global document currently being edited |
| `siblingData` | An object containing document data that is scoped to only fields within the same parent of this field |
| `id` | The `id` of the current document being edited. `id` is `undefined` during the `create` operation |
| `user` | An object containing the currently authenticated user |
### Example
## Example
```ts
import { CollectionConfig } from 'payload/types'
@@ -181,13 +181,13 @@ You can learn more about writing queries [here](/docs/queries/overview).
<strong>payload/fields/validations</strong> in your validate function.
</Banner>
### How the data is saved
## 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.
#### Has One
### 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.
@@ -221,7 +221,7 @@ When querying documents in this collection via REST API, you could query as foll
`?where[owner][equals]=6031ac9e1289176380734024`.
#### Has One - Polymorphic
### 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.
@@ -263,7 +263,7 @@ You can also query for documents where a field has a relationship to a specific
This query would return only documents that have an owner relationship to organizations.
#### Has Many
### Has Many
The `hasMany` tells Payload that there may be more than one collection saved to the field.
@@ -287,10 +287,7 @@ To save the to `hasMany` relationship field we need to send an array of IDs:
```json
{
"owners": [
"6031ac9e1289176380734024",
"602c3c327b811235943ee12b"
]
"owners": ["6031ac9e1289176380734024", "602c3c327b811235943ee12b"]
}
```
@@ -298,7 +295,7 @@ When querying documents, the format does not change for arrays:
`?where[owners][equals]=6031ac9e1289176380734024`.
#### Has Many - Polymorphic
### Has Many - Polymorphic
```ts
{
@@ -339,7 +336,7 @@ Querying is done in the same way as the earlier Polymorphic example:
`?where[owners.value][equals]=6031ac9e1289176380734024`.
#### Querying and Filtering Polymorphic Relationships
### 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
@@ -362,5 +359,6 @@ Since we are referencing multiple collections, the field you are querying on may
<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.
You <strong>cannot</strong> query on a field within a polymorphic relationship as you would with a
non-polymorphic relationship.
</Banner>

View File

@@ -3,7 +3,7 @@ title: Rich Text Field
label: Rich Text
order: 140
desc: The Rich Text field allows dynamic content to be written through the Admin Panel. Learn how to use Rich Text fields, see examples and options.
keywords: rich text, fields, config, configuration, documentation, Content Management System, cms, headless, javascript, node, react, express
keywords: rich text, fields, config, configuration, documentation, Content Management System, cms, headless, javascript, node, react, nextjs
---
<Banner>
@@ -18,7 +18,7 @@ keywords: rich text, fields, config, configuration, documentation, Content Manag
caption="Admin panel screenshot of a Rich Text field"
/>
Payload's rich text field is built on an "adapter pattern" which lets you specify which rich text editor you'd like to use.
Payload's rich text field is built on an "adapter pattern" which lets you specify which rich text editor you'd like to use.
Right now, Payload is officially supporting two rich text editors:
@@ -26,10 +26,17 @@ Right now, Payload is officially supporting two rich text editors:
2. [Lexical](/docs/rich-text/lexical) - beta, where things will be moving
<Banner type="success">
<strong>Consistent with Payload's goal of making you learn as little of Payload as possible, customizing and using the Rich Text Editor does not involve learning how to develop for a <em>Payload</em> rich text editor.</strong> Instead, you can invest your time and effort into learning the underlying open-source tools that will allow you to apply your learnings elsewhere as well.
<strong>
Consistent with Payload's goal of making you learn as little of Payload as possible, customizing
and using the Rich Text Editor does not involve learning how to develop for a <em>Payload</em>{' '}
rich text editor.
</strong>
Instead, you can invest your time and effort into learning the underlying open-source tools that
will allow you to apply your learnings elsewhere as well.
</Banner>
### Config
## Config
| Option | Description |
| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
@@ -49,7 +56,7 @@ Right now, Payload is officially supporting two rich text editors:
_\* An asterisk denotes that a property is required._
### Admin config
## Admin config
In addition to the default [field admin config](/docs/fields/overview#admin-config), the Rich Text editor allows for the following admin properties:
@@ -65,6 +72,6 @@ Set this property to `true` to hide this field's gutter within the admin panel.
Override the default text direction of the Admin panel for this field. Set to `true` to force right-to-left text direction.
### Editor-specific options
## Editor-specific options
For a ton more editor-specific options, including how to build custom rich text elements directly into your editor, take a look at either the [Slate docs](/docs/rich-text/slate) or the [Lexical docs](/docs/rich-text/lexical) depending on which editor you're using.
For a ton more editor-specific options, including how to build custom rich text elements directly into your editor, take a look at either the [Slate docs](/docs/rich-text/slate) or the [Lexical docs](/docs/rich-text/lexical) depending on which editor you're using.

View File

@@ -3,7 +3,7 @@ title: Row Field
label: Row
order: 150
desc: With the Row field you can arrange fields next to each other in the Admin Panel to help you customize your Dashboard.
keywords: row, fields, config, configuration, documentation, Content Management System, cms, headless, javascript, node, react, express
keywords: row, fields, config, configuration, documentation, Content Management System, cms, headless, javascript, node, react, nextjs
---
<Banner>
@@ -18,7 +18,7 @@ keywords: row, fields, config, configuration, documentation, Content Management
caption="Admin panel screenshot of a Row field"
/>
### Config
## Config
| Option | Description |
| --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
@@ -28,7 +28,7 @@ keywords: row, fields, config, configuration, documentation, Content Management
_\* An asterisk denotes that a property is required._
### Example
## Example
`collections/ExampleCollection.ts`

View File

@@ -3,7 +3,7 @@ title: Select Field
label: Select
order: 160
desc: The Select field provides a dropdown-style interface for choosing options from a predefined list. Learn how to use Select fields, see examples and options.
keywords: select, multi-select, fields, config, configuration, documentation, Content Management System, cms, headless, javascript, node, react, express
keywords: select, multi-select, fields, config, configuration, documentation, Content Management System, cms, headless, javascript, node, react, nextjs
---
<Banner>
@@ -18,26 +18,28 @@ keywords: select, multi-select, fields, config, configuration, documentation, Co
caption="Admin panel screenshot of a Select field"
/>
### Config
## 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) |
| 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) |
| **`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._
@@ -50,7 +52,7 @@ _\* An asterisk denotes that a property is required._
being used as a GraphQL enum.
</Banner>
### Admin config
## 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:
@@ -62,7 +64,7 @@ Set to `true` if you'd like this field to be clearable within the Admin UI.
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
## Example
`collections/ExampleCollection.ts`
@@ -99,7 +101,7 @@ export const ExampleCollection: CollectionConfig = {
}
```
### Customization
## Customization
The Select field UI component can be customized by providing a custom React component to the `components` object in the Base config.
@@ -122,7 +124,7 @@ export const CustomSelectField: Field = {
],
}),
},
}
},
}
```
@@ -133,7 +135,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;
@@ -164,7 +166,7 @@ export const CustomSelectComponent: React.FC<CustomSelectProps> = ({ path, optio
name={path}
options={adjustedOptions}
value={value}
onChange={() => setValue(e.value)}
onChange={(e) => setValue(e.value)}
/>
</div>
)
@@ -174,9 +176,9 @@ export const CustomSelectComponent: React.FC<CustomSelectProps> = ({ path, optio
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.

View File

@@ -3,7 +3,7 @@ title: Tabs Field
label: Tabs
order: 170
desc: The Tabs field is a great way to organize complex editing experiences into specific tab-based areas.
keywords: tabs, fields, config, configuration, documentation, Content Management System, cms, headless, javascript, node, react, express
keywords: tabs, fields, config, configuration, documentation, Content Management System, cms, headless, javascript, node, react, nextjs
---
<Banner>
@@ -19,7 +19,7 @@ keywords: tabs, fields, config, configuration, documentation, Content Management
caption="Tabs field type used to separate Hero fields from Page Layout"
/>
### Config
## Config
| Option | Description |
| ------------- | ------------------------------------------------------------------------------------------------------------------------ |
@@ -27,7 +27,7 @@ keywords: tabs, fields, config, configuration, documentation, Content Management
| **`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) |
#### Tab-specific Config
### Tab-specific Config
Each tab must have either a `name` or `label` and the required `fields` array. You can also optionally pass a `description` to render within each individual tab.
@@ -41,7 +41,7 @@ Each tab must have either a `name` or `label` and the required `fields` array. Y
_\* An asterisk denotes that a property is required._
### Example
## Example
`collections/ExampleCollection.ts`

View File

@@ -3,7 +3,7 @@ title: Text Field
label: Text
order: 180
desc: Text field types simply save a string to the database and provide the Admin panel with a text input. Learn how to use Text fields, see examples and options.
keywords: text, fields, config, configuration, documentation, Content Management System, cms, headless, javascript, node, react, express
keywords: text, fields, config, configuration, documentation, Content Management System, cms, headless, javascript, node, react, nextjs
---
<Banner>
@@ -18,30 +18,33 @@ keywords: text, fields, config, configuration, documentation, Content Management
caption="Admin panel screenshot of a Text field and read-only Text field"
/>
### Config
## 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 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. |
| **`minLength`** | Used by the default validation function to ensure values are of a minimum character length. |
| **`maxLength`** | Used by the default validation function to ensure values are of a maximum character length. |
| **`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) |
| **`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. |
| **`minLength`** | Used by the default validation function to ensure values are of a minimum character length. |
| **`maxLength`** | Used by the default validation function to ensure values are of a maximum character length. |
| **`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 below for [more detail](#admin-config). |
| **`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) |
| **`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 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
## Admin config
In addition to the default [field admin config](/docs/fields/overview#admin-config), the Text field type allows for the following `admin` properties:
@@ -57,7 +60,7 @@ Set this property to a string that will be used for browser autocomplete.
Override the default text direction of the Admin panel for this field. Set to `true` to force right-to-left text direction.
### Example
## Example
`collections/ExampleCollection.ts`

View File

@@ -3,7 +3,7 @@ title: Textarea Field
label: Textarea
order: 190
desc: Textarea field types save a string to the database, similar to the Text field type but equipped for longer text. Learn how to use Textarea fields, see examples and options.
keywords: textarea, fields, config, configuration, documentation, Content Management System, cms, headless, javascript, node, react, express
keywords: textarea, fields, config, configuration, documentation, Content Management System, cms, headless, javascript, node, react, nextjs
---
<Banner>
@@ -18,30 +18,30 @@ keywords: textarea, fields, config, configuration, documentation, Content Manage
caption="Admin panel screenshot of a Textarea field and read-only Textarea field"
/>
### Config
## 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 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. |
| **`minLength`** | Used by the default validation function to ensure values are of a minimum character length. |
| **`maxLength`** | Used by the default validation function to ensure values are of a maximum character length. |
| **`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) |
| **`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. |
| **`minLength`** | Used by the default validation function to ensure values are of a minimum character length. |
| **`maxLength`** | Used by the default validation function to ensure values are of a maximum character length. |
| **`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 below for [more detail](#admin-config). |
| **`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) |
| **`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 below for [more detail](#admin-config). |
| **`custom`** | Extension point for adding custom data (e.g. for plugins) |
_\* An asterisk denotes that a property is required._
### Admin config
## Admin config
In addition to the default [field admin config](/docs/fields/overview#admin-config), the Textarea field type allows for the following `admin` properties:
@@ -57,7 +57,7 @@ Set this property to a string that will be used for browser autocomplete.
Override the default text direction of the Admin panel for this field. Set to `true` to force right-to-left text direction.
### Example
## Example
`collections/ExampleCollection.ts`

View File

@@ -3,7 +3,7 @@ title: UI Field
label: UI
order: 200
desc: UI fields are purely presentational and allow developers to customize the admin panel to a very fine degree, including adding actions and other functions.
keywords: custom field, react component, fields, config, configuration, documentation, Content Management System, cms, headless, javascript, node, react, express
keywords: custom field, react component, fields, config, configuration, documentation, Content Management System, cms, headless, javascript, node, react, nextjs
---
<Banner>
@@ -23,7 +23,7 @@ With this field, you can also inject custom `Cell` components that appear as add
- Add a "view page" button into a Pages List view to give editors a shortcut to view a page on the frontend of the site
- Build a "clear cache" button or similar mechanism to manually clear caches of specific documents
### Config
## Config
| Option | Description |
| ------------------------------- | ---------------------------------------------------------------------------------------------------------------------- |
@@ -31,11 +31,12 @@ 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._
### Example
## Example
`collections/ExampleCollection.ts`

View File

@@ -3,7 +3,7 @@ title: Upload Field
label: Upload
order: 210
desc: Upload fields will allow a file to be uploaded, only from a collection supporting Uploads. Learn how to use Upload fields, see examples and options.
keywords: upload, images media, fields, config, configuration, documentation, Content Management System, cms, headless, javascript, node, react, express
keywords: upload, images media, fields, config, configuration, documentation, Content Management System, cms, headless, javascript, node, react, nextjs
---
<Banner>
@@ -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:**
@@ -32,10 +32,10 @@ caption="Admin panel screenshot of an Upload field"
- To allow for a `Product` to deliver a downloadable asset like PDF or MP3
- To give a layout building block the ability to feature a background image
### Config
## 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). |
@@ -56,7 +56,7 @@ caption="Admin panel screenshot of an Upload field"
_\* An asterisk denotes that a property is required._
### Example
## Example
`collections/ExampleCollection.ts`
@@ -76,7 +76,7 @@ export const ExampleCollection: CollectionConfig = {
}
```
### Filtering upload options
## 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.
@@ -85,15 +85,15 @@ The `filterOptions` property can either be a `Where` query, or a function return
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 |
| `id` | The value of the collection `id`, will be `undefined` on create request |
| `user` | The currently authenticated user object |
| Property | Description |
| ------------- | ----------------------------------------------------------------------------------------------------- |
| `relationTo` | The collection `slug` to filter against, limited to this field's `relationTo` property |
| `data` | An object containing the full collection or global document currently being edited |
| `siblingData` | An object containing document data that is scoped to only fields within the same parent of this field |
| `id` | The `id` of the current document being edited. `id` is `undefined` during the `create` operation |
| `user` | An object containing the currently authenticated user |
**Example:**
## Example
```ts
const uploadField = {

View File

@@ -3,18 +3,18 @@ title: Payload Concepts
label: Concepts
order: 20
desc: Payload is based around a small and intuitive set of concepts. Key concepts include collections, globals, fields and more.
keywords: documentation, getting started, guide, Content Management System, cms, headless, javascript, node, react, express
keywords: documentation, getting started, guide, Content Management System, cms, headless, javascript, node, react, nextjs
---
Payload is based around a small and intuitive set of concepts. Before starting to work with Payload, it's a good idea to familiarize yourself with the following:
### Config
## Config
<Banner type="info">The Payload config is where you configure everything that Payload does.</Banner>
By default, the Payload config lives in the root folder of your code and is named `payload.config.js` (`payload.config.ts` if you're using TypeScript), but you can customize its name and where you store it. You can write full functions and even full React components right into your config.
### Collections
## Collections
<Banner type="info">
A Collection represents a type of content that Payload will store and can contain many documents.
@@ -24,7 +24,7 @@ Collections define the shape of your data as well as all functionalities attache
They can represent anything you can store in a database - for example - pages, posts, users, people, orders, categories, events, customers, transactions, and anything else your app needs.
### Globals
## Globals
<Banner type="info">
A Global is a "one-off" piece of content that is perfect for storing navigational structures,
@@ -33,7 +33,7 @@ They can represent anything you can store in a database - for example - pages, p
Globals are in many ways similar to Collections, but there is only ever **one** instance of a Global, whereas Collections can contain many documents.
### Fields
## Fields
<Banner type="info">
Fields are the building blocks of Payload. Collections and Globals both use Fields to define the
@@ -42,7 +42,7 @@ Globals are in many ways similar to Collections, but there is only ever **one**
Payload comes with [many different field types](../fields/overview) that give you a ton of flexibility while designing your API. Each Field type has its own potential properties that allow you to customize how they work.
### Hooks
## Hooks
<Banner type="info">
Hooks are where you can "tie in" to existing Payload actions to perform your own additional logic
@@ -53,7 +53,7 @@ Hooks are an extremely powerful concept and are central to extending and customi
There are many more potential reasons to use Hooks. For more, visit the [Hooks documentation](/docs/hooks/overview).
### Access Control
## Access Control
<Banner type="info">
Access Control refers to Payload's system of defining who can do what to your API.
@@ -63,7 +63,7 @@ Access Control is extremely powerful but easy and intuitive to manage. You can e
For more, visit the [Access Control documentation](/docs/access-control/overview).
### Depth
## Depth
<Banner type="info">
"Depth" gives you control over how many levels down related documents should be automatically
@@ -156,6 +156,28 @@ To populate `user.author.department` in it's entirety you could specify `?depth=
}
```
### Field-level max depth
Fields like relationships or uploads can have a `maxDepth` property that limits the depth of the population for that field. Here are some examples:
Depth: 10
Current depth when field is accessed: 1
`maxDepth`: undefined
In this case, the field would be populated to 9 levels of population.
Depth: 10
Current depth when field is accessed: 0
`maxDepth`: 2
In this case, the field would be populated to 2 levels of population, despite there being a remaining depth of 8.
Depth: 10
Current depth when field is accessed: 2
`maxDepth`: 1
In this case, the field would not be populated, as the current depth (2) has exceeded the `maxDepth` for this field (1).
<Banner type="warning">
<strong>Note:</strong>
<br />

View File

@@ -3,15 +3,15 @@ title: Installation
label: Installation
order: 30
desc: To quickly get started with Payload, simply run npx create-payload-app or install from scratch.
keywords: documentation, getting started, guide, Content Management System, cms, headless, javascript, node, react, express
keywords: documentation, getting started, guide, Content Management System, cms, headless, javascript, node, react, nextjs
---
#### Software Requirements
## Software Requirements
Payload requires the following software:
- Any JavaScript package manager (Yarn, NPM, or pnpm)
- Node.js version 16+
- Node.js version 18+
- Any [compatible database](/docs/database/overview) (MongoDB or Postgres)
<Banner type="warning">
@@ -30,7 +30,7 @@ Then just follow the prompts! You'll get set up with a new folder and a function
## Adding to an existing app
Adding Payload to either a new or existing TypeScript + Express app is super straightforward. To add to an existing app, just run `npm install --save --legacy-peer-deps payload`.
Adding Payload to either a new or existing TypeScript + Next.js app is super straightforward. To add to an existing app, just run `npm install --save --legacy-peer-deps payload`.
From there, the first step is writing a baseline config. Create a new `payload.config.ts` in your project's `/src` directory (or whatever your root TS dir is). The simplest config contains the following:
@@ -48,7 +48,7 @@ Write the above code into your newly created config file. This baseline config w
Although this is just the bare minimum config, there are _many_ more options that you can control here. To reference the full config and all of its options, [click here](/docs/configuration/overview).
### Server
## Server
Now that you've got a baseline Payload config, it's time to initialize Payload. It requires an Express server that you provide, so if you're not familiar with how to set up a baseline Express server, please read up on exactly what Express is and why to use it. Express' own [Documentation](https://expressjs.com/en/starter/hello-world.html) is a good place to start. Otherwise, follow along below for how to build your own Express server to use with Payload.
@@ -62,9 +62,7 @@ import express from 'express'
const app = express()
app.listen(3000, async () => {
console.log(
"Express is now listening for incoming connections on port 3000."
)
console.log('Express is now listening for incoming connections on port 3000.')
})
```
@@ -86,9 +84,7 @@ const start = async () => {
})
app.listen(3000, async () => {
console.log(
"Express is now listening for incoming connections on port 3000."
)
console.log('Express is now listening for incoming connections on port 3000.')
})
}
@@ -104,52 +100,54 @@ PAYLOAD_SECRET=your-payload-secret
Here is a list of all properties available to pass through `payload.init`:
##### secret
#### secret
**Required**. This is a secure string that will be used to authenticate with Payload. It can be random but should be at least 14 characters and be very difficult to guess.
Payload uses this secret key to generate secure user tokens (JWT). Behind the scenes, we do not use your secret key to encrypt directly - instead, we first take the secret key and create an encrypted string using the SHA-256 hash function. Then, we reduce the encrypted string to its first 32 characters. This final value is what Payload uses for encryption.
##### config
#### config
Allows you to pass your config directly to the onInit function. The config passed here should match the payload.config file.
##### disableOnInit
#### disableOnInit
A boolean that disables running your `onInit` function when Payload starts up.
##### disableDBConnect
#### disableDBConnect
A boolean that disables the database connection when Payload starts up.
##### email
#### email
An object used to configure SMTP. [Read more](/docs/email/overview).
##### express
#### express
This is your Express app as shown above. Payload will tie into your existing `app` and scope all of its functionalities to sub-routers. By default, Payload will add an `/admin` router and an `/api` router, but you can customize these paths.
##### local
#### local
A boolean that when set to `true` tells Payload to start in local-only mode which will bypass setting up API routes. When set to `true`, `express` is not required. This is useful when running scripts that need to use Payload's [local-api](/docs/local-api/overview).
##### loggerDestination
#### loggerDestination
Specify destination stream for the built-in Pino logger that Payload uses for internal logging. See [Pino Docs](https://getpino.io/#/docs/api?id=pino-destination) for more info on what is available.
##### loggerOptions
#### loggerOptions
Specify options for the built-in Pino logger that Payload uses for internal logging. See [Pino Docs](https://getpino.io/#/docs/api?id=options) for more info on what is available.
##### onInit
#### onInit
A function that is called immediately following startup that receives the Payload instance as it's only argument.
### Test it out
## Test it out
After you've gotten this far, it's time to boot up Payload. Start your project in your application's folder to get going.
After it starts, you can go to `http://localhost:3000/admin` to create your first Payload user!
### Docker
## Docker
Looking to deploy Payload with Docker? New projects with `create-payload-app` come with a Dockerfile and docker-compose.yml file ready to go. Examples of these files can be seen in our [Deployment docs](/docs/production/deployment#docker).

View File

@@ -3,7 +3,7 @@ title: What is Payload?
label: What is Payload?
order: 10
desc: Payload is a next-gen headless Content Management System (CMS) and application framework.
keywords: documentation, getting started, guide, Content Management System, cms, headless, javascript, node, react, express
keywords: documentation, getting started, guide, Content Management System, cms, headless, javascript, node, react, nextjs
---
<YouTube
@@ -17,7 +17,8 @@ development process, but importantly, stay out of your way as your apps get more
<Banner type="success">
<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>.
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:
@@ -37,7 +38,7 @@ In this way, the CMS can ensure that its content editing experience is highly po
At this point this concept is [widely](https://en.wikipedia.org/wiki/Headless_content_management_system) [discussed](https://css-tricks.com/what-is-a-headless-cms/) online, and for good reason. The web has become more complicated and with complexity comes the demand for developers to better structure their code. The rise of interface libraries like React and Vue are now the de-facto standard for building modern applications and traditional content management systems are often not designed to make use of them.
### Why Payload?
## Why Payload?
The team behind Payload has been building websites and apps with existing content management systems and application frameworks for over a decade. We know what works and what doesn't about each of the existing solutions, and to this day have found no silver bullet solution.

View File

@@ -3,7 +3,7 @@ title: Adding your own Queries and Mutations
label: Custom Queries and Mutations
order: 20
desc: Payload allows you to add your own GraphQL queries and mutations, simply set up GraphQL in your main Payload config by following these instructions.
keywords: graphql, resolvers, mutations, custom, queries, config, configuration, documentation, Content Management System, cms, headless, javascript, node, react, express
keywords: graphql, resolvers, mutations, custom, queries, config, configuration, documentation, Content Management System, cms, headless, javascript, node, react, nextjs
---
You can add your own GraphQL queries and mutations to Payload, making use of all the types that Payload has defined for you.
@@ -25,11 +25,11 @@ This is Payload's GraphQL dependency. You should not install your own copy of Gr
This is a copy of the currently running Payload instance, which provides you with existing GraphQL types for all of your Collections and Globals - among other things.
##### Return value
## Return value
Both `graphQL.queries` and `graphQL.mutations` functions should return an object with properties equal to your newly written GraphQL queries and mutations.
### Example
## Example
`payload.config.js`:
@@ -68,7 +68,7 @@ export default buildConfig({
})
```
### Resolver function
## Resolver function
In your resolver, make sure you set `depth: 0` if you're returning data directly from the local API so that GraphQL can correctly resolve queries to nested values such as relationship data.
@@ -96,7 +96,7 @@ An object containing the `req` and `res` objects that will provide you with the
Contextual information about the currently running GraphQL operation. You can get schema information from this as well as contextual information about where this resolver function is being run.
### Types
## Types
We've exposed a few types and utilities to help you extend the API further. Payload uses the GraphQL.js package for which you can view the full list of available types in the [official documentation](https://graphql.org/graphql-js/type/).
@@ -138,7 +138,7 @@ graphQL?: {
}
```
### Best practices
## Best practices
There are a few ways to structure your code, we recommend using a dedicated `graphql` directory so you can keep all of your logic in one place. You have total freedom of how you want to structure this but a common pattern is to group functions by type and with their resolver.

View File

@@ -3,12 +3,12 @@ title: GraphQL Schema
label: GraphQL Schema
order: 30
desc: Output your own GraphQL schema based on your collections and globals to a file.
keywords: headless cms, typescript, documentation, Content Management System, cms, headless, javascript, node, react, express
keywords: headless cms, typescript, documentation, Content Management System, cms, headless, javascript, node, react, nextjs
---
When working with GraphQL it is useful to have the schema for development of other projects that need to call on your GraphQL endpoint. In Payload the schema is controlled by your collections and globals and is made available to the developer or third parties, it is not necessary for developers using Payload to write schema types manually.
### Schema generation script
## Schema generation script
Run the following command in a Payload project to generate your project's GraphQL schema from Payload:
@@ -16,20 +16,7 @@ Run the following command in a Payload project to generate your project's GraphQ
payload generate:graphQLSchema
```
You can run this command whenever you need to regenerate your GraphQL schema and output it to a file, and then you can use the schema for writing your own GraphQL elsewhere in other projects.
### Custom output file path
```js
{
// the remainder of your config
graphQL: {
schemaOutputFile: path.resolve(__dirname, './graphql/schema.graphql'),
},
}
```
### Custom Field Schemas
## Custom Field Schemas
For `array`, `block`, `group` and named `tab` fields, you can generate top level reusable interfaces. The following group field config:
@@ -69,7 +56,7 @@ type Collection1 {
The above example outputs all your definitions to a file relative from your payload config as `./graphql/schema.graphql`. By default, the file will be output to your current working directory as `schema.graphql`.
#### Adding an NPM script
### Adding an NPM script
<Banner type="warning">
<strong>Important</strong>

View File

@@ -3,7 +3,7 @@ title: GraphQL Overview
label: Overview
order: 10
desc: Payload ships with a fully featured and extensible GraphQL API, which can be used in addition to the REST and Local APIs to give you more flexibility.
keywords: graphql, resolvers, mutations, config, configuration, documentation, Content Management System, cms, headless, javascript, node, react, express
keywords: graphql, resolvers, mutations, config, configuration, documentation, Content Management System, cms, headless, javascript, node, react, nextjs
---
In addition to its REST and Local APIs, Payload ships with a fully featured and extensible GraphQL API.
@@ -16,14 +16,13 @@ The labels you provide for your Collections and Globals are used to name the Gra
At the top of your Payload config you can define all the options to manage GraphQL.
| Option | Description |
| ------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `mutations` | Any custom Mutations to be added in addition to what Payload provides. [More](/docs/graphql/extending) |
| `queries` | Any custom Queries to be added in addition to what Payload provides. [More](/docs/graphql/extending) |
| `maxComplexity` | A number used to set the maximum allowed complexity allowed by requests [More](/docs/graphql/overview#query-complexity-limits) |
| `disablePlaygroundInProduction` | A boolean that if false will enable the GraphQL playground, defaults to true. [More](/docs/graphql/overview#graphql-playground) |
| `disable` | A boolean that if true will disable the GraphQL entirely, defaults to false. |
| `schemaOutputFile` | A string for the file path used by the generate schema command. Defaults to `graphql.schema` next to `payload.config.ts` [More](/docs/graphql/graphql-schema) |
| Option | Description |
| ------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
| `mutations` | Any custom Mutations to be added in addition to what Payload provides. [More](/docs/graphql/extending) |
| `queries` | Any custom Queries to be added in addition to what Payload provides. [More](/docs/graphql/extending) |
| `maxComplexity` | A number used to set the maximum allowed complexity allowed by requests [More](/docs/graphql/overview#query-complexity-limits) |
| `disablePlaygroundInProduction` | A boolean that if false will enable the GraphQL playground, defaults to true. [More](/docs/graphql/overview#graphql-playground) |
| `disable` | A boolean that if true will disable the GraphQL entirely, defaults to false. |
## Collections
@@ -43,11 +42,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

@@ -3,7 +3,7 @@ title: Collection Hooks
label: Collections
order: 20
desc: You can add hooks to any Collection, several hook types are available including beforeChange, afterRead, afterDelete and more.
keywords: hooks, collections, config, configuration, documentation, Content Management System, cms, headless, javascript, node, react, express
keywords: hooks, collections, config, configuration, documentation, Content Management System, cms, headless, javascript, node, react, nextjs
---
Collections feature the ability to define the following hooks:
@@ -75,6 +75,7 @@ import { CollectionBeforeOperationHook } from 'payload/types'
const beforeOperationHook: CollectionBeforeOperationHook = async ({
args, // original arguments passed into the operation
operation, // name of the operation
req, // full Request object
}) => {
return args // return modified operation arguments as necessary
}
@@ -95,7 +96,7 @@ import { CollectionBeforeValidateHook } from 'payload/types'
const beforeValidateHook: CollectionBeforeValidateHook = async ({
data, // incoming data to update or create with
req, // full express request
req, // full Request object
operation, // name of the operation ie. 'create', 'update'
originalDoc, // original document
}) => {
@@ -112,7 +113,7 @@ import { CollectionBeforeChangeHook } from 'payload/types'
const beforeChangeHook: CollectionBeforeChangeHook = async ({
data, // incoming data to update or create with
req, // full express request
req, // full Request object
operation, // name of the operation ie. 'create', 'update'
originalDoc, // original document
}) => {
@@ -129,7 +130,7 @@ import { CollectionAfterChangeHook } from 'payload/types'
const afterChangeHook: CollectionAfterChangeHook = async ({
doc, // full document data
req, // full express request
req, // full Request object
previousDoc, // document data before updating the collection
operation, // name of the operation ie. 'create', 'update'
}) => {
@@ -146,7 +147,7 @@ import { CollectionBeforeReadHook } from 'payload/types'
const beforeReadHook: CollectionBeforeReadHook = async ({
doc, // full document data
req, // full express request
req, // full Request object
query, // JSON formatted query
}) => {
return doc
@@ -162,7 +163,7 @@ import { CollectionAfterReadHook } from 'payload/types'
const afterReadHook: CollectionAfterReadHook = async ({
doc, // full document data
req, // full express request
req, // full Request object
query, // JSON formatted query
findMany, // boolean to denote if this hook is running against finding one, or finding many
}) => {
@@ -178,7 +179,7 @@ Runs before the `delete` operation. Returned values are discarded.
import { CollectionBeforeDeleteHook } from 'payload/types';
const beforeDeleteHook: CollectionBeforeDeleteHook = async ({
req, // full express request
req, // full Request object
id, // id of document to delete
}) => {...}
```
@@ -191,7 +192,7 @@ Runs immediately after the `delete` operation removes records from the database.
import { CollectionAfterDeleteHook } from 'payload/types';
const afterDeleteHook: CollectionAfterDeleteHook = async ({
req, // full express request
req, // full Request object
id, // id of document to delete
doc, // deleted document
}) => {...}
@@ -209,6 +210,7 @@ import { CollectionAfterOperationHook } from 'payload/types'
const afterOperationHook: CollectionAfterOperationHook = async ({
args, // arguments passed into the operation
operation, // name of the operation
req, // full Request object
result, // the result of the operation, before modifications
}) => {
return result // return modified result as necessary
@@ -223,7 +225,7 @@ For auth-enabled Collections, this hook runs during `login` operations where a u
import { CollectionBeforeLoginHook } from 'payload/types'
const beforeLoginHook: CollectionBeforeLoginHook = async ({
req, // full express request
req, // full Request object
user, // user being logged in
}) => {
return user
@@ -238,7 +240,7 @@ For auth-enabled Collections, this hook runs after successful `login` operations
import { CollectionAfterLoginHook } from 'payload/types';
const afterLoginHook: CollectionAfterLoginHook = async ({
req, // full express request
req, // full Request object
user, // user that was logged in
token, // user token
}) => {...}
@@ -252,7 +254,7 @@ For auth-enabled Collections, this hook runs after `logout` operations.
import { CollectionAfterLogoutHook } from 'payload/types';
const afterLogoutHook: CollectionAfterLogoutHook = async ({
req, // full express request
req, // full Request object
}) => {...}
```
@@ -264,8 +266,8 @@ For auth-enabled Collections, this hook runs after `refresh` operations.
import { CollectionAfterRefreshHook } from 'payload/types';
const afterRefreshHook: CollectionAfterRefreshHook = async ({
req, // full express request
res, // full express response
req, // full Request object
res, // full Response object
token, // newly refreshed user token
}) => {...}
```
@@ -278,7 +280,7 @@ For auth-enabled Collections, this hook runs after `me` operations.
import { CollectionAfterMeHook } from 'payload/types';
const afterMeHook: CollectionAfterMeHook = async ({
req, // full express request
req, // full Request object
response, // response to return
}) => {...}
```
@@ -290,13 +292,11 @@ 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
}) => {...}
```
## TypeScript

View File

@@ -3,10 +3,11 @@ title: Field Hooks
label: Fields
order: 30
desc: Hooks can be added to any fields, and optionally modify the return value of the field before the operation continues.
keywords: hooks, fields, config, configuration, documentation, Content Management System, cms, headless, javascript, node, react, express
keywords: hooks, fields, config, configuration, documentation, Content Management System, cms, headless, javascript, node, react, nextjs
---
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:**
@@ -20,6 +21,7 @@ Field-level hooks offer incredible potential for encapsulating your logic. They
- [beforeValidate](#beforevalidate)
- [beforeChange](#beforechange)
- beforeDuplicate(#beforeduplicate)
- [afterChange](#afterchange)
- [afterRead](#afterread)
@@ -37,6 +39,7 @@ const ExampleField: Field = {
hooks: {
beforeValidate: [(args) => {...}],
beforeChange: [(args) => {...}],
beforeDuplicate: [(args) => {...}],
afterChange: [(args) => {...}],
afterRead: [(args) => {...}],
}
@@ -46,7 +49,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,17 +66,17 @@ 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. |
| **`req`** | The Express `request` object. It is mocked for Local API operations. |
| **`previousSiblingDoc`** | The sibling data of the document before changes being applied, only in `beforeChange` and `afterChange` hook. |
| **`req`** | The [Request](https://developer.mozilla.org/en-US/docs/Web/API/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. |
@@ -80,7 +84,8 @@ Field Hooks receive one `args` argument that contains the following properties:
#### 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>
@@ -92,11 +97,14 @@ All field hooks can optionally modify the return value of the field before the o
## 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.
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.
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'
@@ -105,19 +113,25 @@ const usernameField: Field = {
name: 'username',
type: 'text',
hooks: {
beforeValidate: [({ value }) => {
// Trim whitespace and convert to lowercase
return value.trim().toLowerCase()
}],
}
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.
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.
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'
@@ -126,21 +140,26 @@ const emailField: Field = {
name: 'email',
type: 'email',
hooks: {
beforeChange: [({ value, operation }) => {
if (operation === 'create') {
// Perform additional validation or transformation for 'create' operation
}
return value
}],
}
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.
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.
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'
@@ -151,25 +170,33 @@ const membershipStatusField: Field = {
options: [
{ label: 'Standard', value: 'standard' },
{ label: 'Premium', value: 'premium' },
{ label: 'VIP', value: 'vip' }
{ 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
}
}],
}
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.
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.
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'
@@ -178,17 +205,45 @@ const dateField: Field = {
name: 'createdAt',
type: 'date',
hooks: {
afterRead: [({ value }) => {
// Format date for display
return new Date(value).toLocaleDateString()
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.
### beforeDuplicate
The `beforeDuplicate` field hook is called on each locale (when using localization), when duplicating a document. It may be used when documents having the
exact same properties may cause issue. This gives you a way to avoid duplicate names on `unique`, `required` fields or when external systems expect non-repeating values on documents.
This hook gets called after `beforeChange` hooks are called and before the document is saved to the database.
By Default, unique and required text fields Payload will append "- Copy" to the original document value. The default is not added if your field has its own, you must return non-unique values from your beforeDuplicate hook to avoid errors or enable the `disableDuplicate` option on the collection.
Here is an example of a number field with a hook that increments the number to avoid unique constraint errors when duplicating a document:
```ts
import { Field } from 'payload/types'
const numberField: Field = {
name: 'number',
type: 'number',
hooks: {
// increment existing value by 1
beforeDuplicate: [({ value }) => {
return (value ?? 0) + 1
}],
}
}
```
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

@@ -3,7 +3,7 @@ title: Global Hooks
label: Globals
order: 40
desc: Hooks can be added to any Global and allow you to validate data, flatten locales, hide protected fields, remove fields and more.
keywords: hooks, globals, config, configuration, documentation, Content Management System, cms, headless, javascript, node, react, express
keywords: hooks, globals, config, configuration, documentation, Content Management System, cms, headless, javascript, node, react, nextjs
---
Globals feature the ability to define the following hooks:
@@ -47,7 +47,7 @@ import { GlobalBeforeValidateHook } from 'payload/types'
const beforeValidateHook: GlobalBeforeValidateHook = async ({
data, // incoming data to update or create with
req, // full express request
req, // full Request object
originalDoc, // original document
}) => {
return data // Return data to update the document with
@@ -63,7 +63,7 @@ import { GlobalBeforeChangeHook } from 'payload/types'
const beforeChangeHook: GlobalBeforeChangeHook = async ({
data, // incoming data to update or create with
req, // full express request
req, // full Request object
originalDoc, // original document
}) => {
return data // Return data to update the document with
@@ -80,7 +80,7 @@ import { GlobalAfterChangeHook } from 'payload/types'
const afterChangeHook: GlobalAfterChangeHook = async ({
doc, // full document data
previousDoc, // document data before updating the collection
req, // full express request
req, // full Request object
}) => {
return data
}
@@ -95,7 +95,7 @@ import { GlobalBeforeReadHook } from 'payload/types'
const beforeReadHook: GlobalBeforeReadHook = async ({
doc, // full document data
req, // full express request
req, // full Request object
}) => {...}
```
@@ -108,7 +108,7 @@ import { GlobalAfterReadHook } from 'payload/types'
const afterReadHook: GlobalAfterReadHook = async ({
doc, // full document data
req, // full express request
req, // full Request object
findMany, // boolean to denote if this hook is running against finding one, or finding many (useful in versions)
}) => {...}
```

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