Elliot DeNolf
7e2f4e62de
chore(templates): more next.js promises ( #8599 )
...
Continuation of #8547 . Missed some type updates.
2024-10-08 09:50:31 -04:00
Jarrod Flesch
1b63ad4cb3
fix: verify view is inaccessible ( #8557 )
...
Fixes https://github.com/payloadcms/payload/issues/8470
Cleans up the way we redirect and where it happens.
## Improvements
- When you verify, the admin panel will display a toast when it
redirects you to the login route. This is contextually helpful as to
what is happening.
- Removes dead code path, as we always set the _verifiedToken to null
after it is used.
## `handleAdminPage` renamed to `getRouteInfo`
This function no longer handles routing. It kicks that responsibility
back up to the initPage function.
## `isAdminAuthRoute` renamed to `isPublicAdminRoute`
This was inversely named as it determines if a given route is public.
Also simplifies deterministic logic here.
## `redirectUnauthenticatedUser` argument
This is no longer used or needed. We can determine these things by using
the `isPublicAdminRoute` function.
## View Style fixes
- Reset Password
- Forgot Password
- Unauthorized
2024-10-07 14:20:07 -04:00
Paul
2a1321c813
fix(ui): add unstyled prop to react-select so that payload styles take priority ( #8572 )
...
Adds `unstyled={true}` prop to the react-select element so that
payload's styles take priority. Due to the way react-select adds its own
styles (injected into the page) they were higher specificity due to not
being in a layer.
Fixes this bug with our styles' specificity not being applied

Also fixes https://github.com/payloadcms/payload/issues/8507
2024-10-07 10:36:15 -06:00
Patrik
67e6ad8168
docs: specifies defaultLocale as a required property for localization ( #8585 )
...
Fixes #8567
2024-10-07 12:07:03 -04:00
Germán Jabloñski
6cb128aa60
fix(richtext-lexical): linkFeature doesn't respect admin.routes from payload.config.ts ( #8513 )
...
Fix #8452
2024-10-07 09:48:04 -04:00
Because789
bb3496d7b5
feat(plugin-seo): adds german translation ( #8580 )
...
Adds a a German translation to the SEO Plugin. Credits to @fsyntax, since he got it rolling.
2024-10-06 22:07:32 -04:00
Sasha
bf50716fc5
docs: updates array field admin.components.RowLabel example ( #8548 )
...
Fixes https://github.com/payloadcms/payload/issues/8536
2024-10-06 21:37:59 -04:00
Because789
c473db7879
docs: fix typo in array.mdx ( #8561 )
2024-10-06 21:34:23 -04:00
Elliot DeNolf
7aed0d7c2e
chore(eslint): payload logger usage ( #8578 )
...
Payload uses `pino` for a logger. When using the error logger
`payload.logger.error` it is possible to pass any number of arguments
like this: `payload.logger.error('Some error ocurred', err)`. However,
in this scenario, the full error will not be serialized by `pino`. It
must be passed as the `err` property inside of an object in order to be
properly serialized.
This rule ensures that a user is using this function call to properly serialize the error.
2024-10-06 13:23:30 -07:00
Elliot DeNolf
d88e0617d6
chore: sort release note sections
2024-10-06 09:59:51 -07:00
Jacob Fletcher
2ba40f3335
chore: removes duplicative join field test ( #8558 )
...
There are two of the exact same e2e tests for the join field, which
throws an error when running these tests locally because they have
identical names.
2024-10-05 09:13:43 -04:00
Elliot DeNolf
463490f670
fix(templates): await params/cookies properly ( #8560 )
2024-10-04 18:38:27 -07:00
Jacob Fletcher
d564cd44e9
chore: deflakes lexical e2e test ( #8559 )
...
This has caused me great pain. The problem with this test is that the
page was waiting for a URL which includes a search query that never
arrives. This moves the check into a regex pattern for a more accurate
catch.
2024-10-04 21:29:38 +00:00
Paul
7c62e2a327
feat(ui)!: scope all payload css to payload-default layer ( #8545 )
...
All payload css is now encapsulated inside CSS layers under `@layer
payload-default`
Any custom css will now have the highest possible specificity.
We have also provided a new layer `@layer payload` if you want to use
layers and ensure that your styles are applied after payload.
To override existing styles in a way that the existing rules of
specificity would be respected you can use the default layer like so
```css
@layer payload-default {
// my styles within the payload specificity
}
```
2024-10-04 13:02:56 -06:00
Sasha
400293b8ee
fix: duplicate with upload collections ( #8552 )
...
Fixes the duplicate operation with uploads
Enables duplicate for upload collections by default
2024-10-04 21:46:41 +03:00
Elliot DeNolf
e4a413eb9a
chore(release): v3.0.0-beta.111 [skip ci]
v3.0.0-beta.111
2024-10-04 11:31:06 -07:00
Sasha
b99590f477
chore(templates): update templates with next.js promises ( #8547 )
...
Updates templates according to this PR
https://github.com/payloadcms/payload/pull/8489
2024-10-04 21:28:43 +03:00
Alessio Gravili
0d3416c96d
fix(db-postgres): missing types for db.pool by moving @types/pg from devDependencies to dependencies ( #8556 )
...
Fixes lack of types in installed project:

Since we expose stuff from @types/pg to the end user, we need it to be
installed in the end users project => move to dependencies.
2024-10-04 17:39:03 +00:00
Sasha
0128eedf70
fix(drizzle)!: make radio and select column names to snake_case ( #8439 )
...
Fixes https://github.com/payloadcms/payload/issues/8402 and
https://github.com/payloadcms/payload/issues/8027
Before DB column names were camelCase:

After this change, they are snake_case:

#### Breaking SQLite / Postgres ⚠️
If you had any select (not `hasMany: true`) or radio fields with the
name in camelCase, for example:
```ts
{
name: 'selectReadOnly',
type: 'select',
admin: {
readOnly: true,
},
options: [
{
label: 'Value One',
value: 'one',
},
{
label: 'Value Two',
value: 'two',
},
],
},
```
This previously was mapped to the db column name `"selectReadOnly"`. Now
it's `select_read_only`.
Generate a new migration to rename your columns.
```sh
pnpm payload migrate:create
```
Then select "rename column" for targeted columns and Drizzle will handle
the migration.
---------
Co-authored-by: Dan Ribbens <dan.ribbens@gmail.com >
2024-10-04 16:25:05 +00:00
Sasha
414030e1f1
fix(drizzle): row / collapsible inside of localized fields ( #8539 )
...
Fixes https://github.com/payloadcms/payload/issues/8405
2024-10-04 11:48:54 -04:00
Jacob Fletcher
f6eb027f23
chore: repairs auto-generated file comments ( #8549 )
...
The comments injected into auto-generated files have gotten misformatted
due to linting. Here is the proper format, where both comments are
adjacent to one another:
```js
/* THIS FILE WAS GENERATED AUTOMATICALLY BY PAYLOAD. */
/* DO NOT MODIFY IT BECAUSE IT COULD BE REWRITTEN AT ANY TIME. */
```
Some comments were also written with casing issues, here's an example:
```js
/* DO NOT MODIFY it because it could be re-written at any time. */
```
2024-10-03 23:37:08 -04:00
Sasha
cf8347f208
fix(ui): disableBulkEdit on ui fields, defaults to true ( #8540 )
...
Fixes https://github.com/payloadcms/payload/issues/8534
UI fields are now excluded by default from the bulk edit view fields
options.
If you need to have the UI field there, you can provide:
```ts
admin: {
disableBulkEdit: false
}
```
2024-10-04 01:07:47 +00:00
Paul
157b1e13ac
fix(plugin-seo): now respects serverURL and api routes configuration ( #8546 )
2024-10-04 00:04:20 +00:00
Sasha
a735f40310
docs: change req.params to req.routeParams ( #8380 )
...
`req.params` is an old notation, now we use `req.routeParams`
2024-10-04 02:59:05 +03:00
Alessio Gravili
e306c927a8
docs: fix broken link ( #8543 )
2024-10-03 18:46:23 +00:00
Paul
dffdb22a69
fix(templates): dark and light mode not correctly working on website template's header ( #8542 )
2024-10-03 17:42:20 +00:00
Alessio Gravili
8789b0b20d
chore: enable databaseAdapter writing again for pnpm dev ( #8532 )
2024-10-02 23:08:49 +00:00
Paul
eb4e3711ac
fix(templates): add no search results text to website template search page ( #8531 )
2024-10-02 22:16:29 +00:00
Paul
132131a4b9
fix(templates): static generation from incorrect params provided ( #8530 )
2024-10-02 21:36:46 +00:00
Dan Ribbens
9ef4fab65d
fix: ui crashes editing doc with deleted upload ( #8526 )
...
fix #8133
UI of a deleted item (will need another iteration).

2024-10-02 15:22:57 -04:00
Paul
65015aa750
fix(templates): add force-static to pages and posts ( #8527 )
2024-10-02 18:41:54 +00:00
Patrik
0f7d444e6d
fix(next): safely checks user within useEffect ( #8524 )
2024-10-02 14:17:15 -04:00
Jacob Fletcher
ca90d2b1c9
fix: properly resolves cjs withPayload export ( #8521 )
...
Importing `withPayload` as CommonJS using `require` does not properly
resolve. This was because the exported file path was using the `.cjs`
extension instead of `.js`.
2024-10-02 12:38:49 -04:00
Elliot DeNolf
ecfd90bc58
fix(templates): remove lock from website template ( #8520 )
...
Including this file was causing the dependency checker to error because
it was installing all `@lexical` packages on version 0.17.0, instead of
0.18.0.
![Uploading image.png…]()
2024-10-02 10:59:26 -04:00
Paul
86371449b8
fix(templates): fixed drafts not being unpublished in the frontend of the website template ( #8514 )
2024-10-01 23:01:06 +00:00
Paul
69203c5515
docs: fix formatting on join field specifying additional fields section ( #8509 )
2024-10-01 20:24:26 +00:00
Sasha
a8eceb03b6
fix(next): current published version label ( #8505 )
...
Fixes https://github.com/payloadcms/payload/issues/8502
includes `parent` to the `getLatestVersion` query
2024-10-01 21:22:00 +03:00
Sasha
fa59d4c0b2
feat!: update next@15.0.0-canary.173, react@19.0.0-rc-3edc000d-20240926 ( #8489 )
...
Updates the minimal supported versions of next.js to
[`15.0.0-canary.173`](https://github.com/vercel/next.js/releases/tag/v15.0.0-canary.173 )
and react to `19.0.0-rc-3edc000d-20240926`.
Adds neccessary awaits according to this breaking change
https://github.com/vercel/next.js/pull/68812
## Breaking Changes
The `params` and `searchParams` types in
`app/(payload)/admin/[[...segments]]/page.tsx` and
`app/(payload)/admin/[[...segments]]/not-found.tsx` must be changed to
promises:
```diff
- type Args = {
- params: {
- segments: string[]
- }
- searchParams: {
- [key: string]: string | string[]
- }
- }
+ type Args = {
+ params: Promise<{
+ segments: string[]
+ }>
+ searchParams: Promise<{
+ [key: string]: string | string[]
+ }>
+ }
```
2024-10-01 13:16:11 -04:00
Germán Jabloñski
d80410b228
fix(ui): admin.allowCreate in upload field ( #8484 )
...
The admin.allowCreate property on the upload field was not doing what it
was supposed to do. In fact, it was doing nothing.
From now on, when set to false, the option to create a new upload from
the UI disappears.



The tests cover:
- the create new button disappears.
- the option to create one by drag and drop disappears.
- the create new button inside the drawer disappears.
2024-09-30 18:54:34 -03:00
Dan Ribbens
27b1629927
fix(db-postgres, db-sqlite): joins relation name ( #8491 )
...
A join field on a relationship with a camelCase name would cause an
error from drizzle due to the relation name not matching.
2024-09-30 16:47:21 -04:00
Paul
dfdea0d4eb
chore: update vscode launch settings for debugging test suites ( #8399 )
2024-09-30 15:18:03 -04:00
Elliot DeNolf
96d99cb361
chore(release): v3.0.0-beta.110 [skip ci]
v3.0.0-beta.110
2024-09-30 13:19:32 -04:00
Dan Ribbens
3f375cc6ee
feat: join field on upload fields ( #8379 )
...
This PR makes it possible to use the new `join` field in connection with
an `upload` field. Previously `join` was reserved only for
relationships.
2024-09-30 13:12:30 -04:00
Dan Ribbens
3847428f0a
fix(db-*): make db.begintransactions required ( #8419 )
...
Changing the transcations functions on the db so that projects using
typescript `strict: true` do not need to type narrow before using it.
2024-09-30 13:12:07 -04:00
Sasha
7b6a760e97
fix(db-mongodb): duplicate versions with parent string ids ( #8487 )
...
Fixes https://github.com/payloadcms/payload/issues/8441
we may want to add a predifined migration that changes all what's needed
to ObjectIDs @DanRibbens
2024-09-30 13:06:48 -04:00
James Mikrut
0c1004537d
fix: draft status access control checks ( #8486 )
2024-09-30 16:41:54 +00:00
Sasha
e765a5e866
fix: reset password link extra slash and thread admin.routes.reset property ( #8448 )
...
Removes extra slash
from:
`http://host/admin//reset/token `
to:
`http://host/admin/reset/token `
Threads `admin.routes.reset`:
```ts
const config: Config = {
admin: {
routes: {
reset: '/custom-reset',
},
},
}
```
2024-09-30 19:06:19 +03:00
Ante
f543e8963e
chore(translations): croatian translation improvements ( #7413 )
...
Croatian translation is improved for better choice of words in given
context, typos, extra whitespaces and consistency of formal pronouns
use.
2024-09-30 12:04:34 -04:00
Alessio Gravili
163f3c0692
feat(richtext-lexical): export $createInlineBlockNode, $isInlineBlockNode and InlineBlockNode ( #8480 )
2024-09-30 13:42:49 +00:00
Dan Ribbens
4241811fa9
fix: sorting by id incorrectly orders by version.id ( #8442 )
...
fixes #7187
2024-09-30 09:16:41 -04:00