Commit Graph

12190 Commits

Author SHA1 Message Date
Alessio Gravili
51ec6b2fa4 Merge remote-tracking branch 'origin/beta' into feat/on-demand-rsc 2024-11-07 10:17:40 -07:00
Alessio Gravili
fdbf86d394 fix document drawer abort controller madness 2024-11-07 09:52:38 -07:00
Elliot DeNolf
e907724af7 chore(cpa): use git tags for template urls (#9065)
`create-payload-app` will now use git tags when cloning down the
templates instead of using latest from a branch.

The mechanism is cpa will read its own package.json version and use that
as a git tag prefixed w/ `v`
2024-11-07 11:47:26 -05:00
Jacob Fletcher
b9c41ee095 fix existing doc drawer initialization 2024-11-07 11:37:14 -05:00
Alessio Gravili
652e6910c9 fix some lexical tests again 2024-11-07 09:11:52 -07:00
James
a749617a04 Merge branch 'feat/on-demand-rsc' of github.com:payloadcms/payload into feat/on-demand-rsc 2024-11-07 11:07:38 -05:00
James
f3cf304b6a chore: type fixes 2024-11-07 11:07:19 -05:00
Elliot DeNolf
320916f542 ci: build templates with packed deps (#8970)
Build templates using packed deps from the repo.
2024-11-07 10:49:21 -05:00
Alessio Gravili
9d5dd5a61a fix flakes 2024-11-07 08:40:23 -07:00
Alessio Gravili
aa5abeea7e fix: re-render entire field when removing a row. Otherwise, the array index in paths of RSC sibling fields will not change 2024-11-07 08:40:09 -07:00
James
e11ad3371b Merge branch 'feat/on-demand-rsc' of github.com:payloadcms/payload into feat/on-demand-rsc 2024-11-07 10:05:17 -05:00
James
d352c35c22 chore: type fixes 2024-11-07 10:04:35 -05:00
Jarrod Flesch
ac85bc4d04 Merge remote-tracking branch 'refs/remotes/origin/feat/on-demand-rsc' into feat/on-demand-rsc 2024-11-07 09:56:28 -05:00
Jarrod Flesch
4b2e86328a fix: upload allowCreate 2024-11-07 09:56:16 -05:00
Jarrod Flesch
5e3eab7db4 chore: revert list header classname to current beta css class name 2024-11-07 09:55:51 -05:00
Jacob Fletcher
cde1135106 fix relationship drawers 2024-11-07 09:38:31 -05:00
Jarrod Flesch
fcecad6b2f Merge remote-tracking branch 'refs/remotes/origin/feat/on-demand-rsc' into feat/on-demand-rsc 2024-11-07 09:16:53 -05:00
Jarrod Flesch
1e696bdbde chore: passing fields->relationships 2024-11-07 09:16:40 -05:00
Alessio Gravili
0c8debe71d fix some slate tests due to new class names 2024-11-06 22:19:07 -07:00
Alessio Gravili
2bba6c80c5 fix: ensure drawers increase editdepth 2024-11-06 22:18:13 -07:00
Alessio Gravili
301666006c reduce lexical flakes 2024-11-06 21:14:32 -07:00
Alessio Gravili
205650d26d reduce lexical flakes 2024-11-06 21:12:09 -07:00
Paul
015580aa32 feat(templates): add adminThumbnail to media in website template (#9059) 2024-11-07 03:25:27 +00:00
Jarrod Flesch
05b83f71de Merge remote-tracking branch 'refs/remotes/origin/feat/on-demand-rsc' into feat/on-demand-rsc 2024-11-06 21:10:34 -05:00
Jarrod Flesch
f097287c8c chore: passing fields->blocks 2024-11-06 21:08:47 -05:00
Jarrod Flesch
1caf5d9327 chore: passing fields->email 2024-11-06 21:07:43 -05:00
James
23afac9b01 chore: passing form-builder tests 2024-11-06 17:52:36 -05:00
James
4548d30f03 Merge branch 'feat/on-demand-rsc' of github.com:payloadcms/payload into feat/on-demand-rsc 2024-11-06 17:47:17 -05:00
James
b7a1f4c773 chore: passing plugin-seo 2024-11-06 17:47:03 -05:00
Patrik
f1ba9ca82a chore: updates flaky locked-documents e2e tests (#9055) 2024-11-06 16:49:06 -05:00
Elliot DeNolf
f878e35cc7 chore(release): v3.0.0-beta.126 [skip ci] v3.0.0-beta.126 2024-11-06 16:23:57 -05:00
Jacob Fletcher
6cc18e9a21 renames renderFieldMethod to renderFieldFn 2024-11-06 16:05:01 -05:00
Dan Ribbens
f0f96e7558 fix: allow workflows to be empty or undefined (#9039)
### What?

- Makes `jobs.workflows` optional
- Dynamically include the `workflowSlugs` select field in the jobs
collection as needed

### Why?

When configuring jobs, it should be possible to define `job` with just
some simple tasks and not be forced to define workflows.

### How?

Workflows type was made optional and optional chaining is added where
needed. The workflowSlugs field is added to the jobs collection if
workflows are defined.

Fixes #

When using postgres, the workflowSlugs being an empty enum cause an
error when drizzle fails to detect the enum already exists. This results
in the error `"enum_payload_jobs_workflow_slug" already exists`. Drizzle
tries to make the enum as: `enum_payload_jobs_workflow_slug as enum();`
and the check for existing enums only works when it has values.
2024-11-06 15:50:17 -05:00
Javier
0165ab8930 fix: replace console.error with logger.errors (#9044)
## Problem
When `PayloadRequest` objects are logged using `console.log`, it creates
unstructured, multiline entries in logging services like DataDog and
Sentry. This circumvents the structured logging approach used throughout
the rest of the codebase.

## Solution
Replace `console.x` calls with the structured logging system when
logging `payload.logger.x` objects. This ensures consistent log
formatting and better integration with monitoring tools.

## Changes
- Replaced instances of `console.log` with structured logging methods
only in `@payloadcms/next`
- Maintains logging consistency across the codebase
- Improves log readability in DataDog, Sentry, and other monitoring
services

## First

<img width="914" alt="Screenshot 2024-11-06 at 09 53 44"
src="https://github.com/user-attachments/assets/019b6f4b-40ed-4e54-a92a-8d1b50baa303">

## Then

<img width="933" alt="Screenshot 2024-11-06 at 00 50 29"
src="https://github.com/user-attachments/assets/0a339db4-d706-4ff9-ba8c-80445bbef5d0">
2024-11-06 15:49:27 -05:00
Sasha
213b7c6fb6 feat: generate types for joins (#9054)
### What?
Generates types for `joins` property.
Example from our `joins` test, keys are type-safe:
<img width="708" alt="image"
src="https://github.com/user-attachments/assets/f1fbbb9d-7c39-49a2-8aa2-a4793ae4ad7e">

Output in `payload-types.ts`:
```ts
 collectionsJoins: {
    categories: {
      relatedPosts: 'posts';
      hasManyPosts: 'posts';
      hasManyPostsLocalized: 'posts';
      'group.relatedPosts': 'posts';
      'group.camelCasePosts': 'posts';
      filtered: 'posts';
      singulars: 'singular';
    };
  };
```
Additionally, we include type information about on which collection the
join is, it will help when we have types generation for `where` and
`sort`.

### Why?
It provides a better DX as you don't need to memoize your keys.

### How?
Modifies `configToJSONSchema` to generate the json schema for
`collectionsJoins`, uses that type within `JoinQuery`
2024-11-06 22:43:07 +02:00
Jacob Fletcher
0a61160665 deflakes custom logout route e2e 2024-11-06 15:35:10 -05:00
Jarrod Flesch
3c288facda Merge remote-tracking branch 'refs/remotes/origin/feat/on-demand-rsc' into feat/on-demand-rsc 2024-11-06 15:12:49 -05:00
Jarrod Flesch
f9ea396955 chore: passing fields->array 2024-11-06 15:12:32 -05:00
Alessio Gravili
9cccbba2e1 increase expect timeout. 2.5s is sometimes not enough for saving document 2024-11-06 13:09:28 -07:00
Jacob Fletcher
29c9e45ce6 deflakes routing e2e 2024-11-06 15:05:19 -05:00
Jarrod Flesch
f70ef8dac3 Merge remote-tracking branch 'refs/remotes/origin/feat/on-demand-rsc' into feat/on-demand-rsc 2024-11-06 14:59:29 -05:00
Jarrod Flesch
d6d214b745 implement RowLabels 2024-11-06 14:59:14 -05:00
Jessica Chowdhury
7dc52567f1 fix: publish locale with autosave enabled and close dropdown (#8719)
1. Fix publish specific locale option when no published versions exist
2. Close the publish locale dropdown on click
2024-11-06 14:36:28 -05:00
Alessio Gravili
90d9d6e17d speed up reinitDB for mongodb by not waiting for index creation to be completed 2024-11-06 12:13:25 -07:00
Alessio Gravili
f2d2630336 log time for reInitializeDB 2024-11-06 11:57:53 -07:00
Sasha
a22c0e62fa feat: add populate property to Local / REST API (#8969)
### What?
Adds `populate` property to Local API and REST API operations that can
be used to specify `select` for a specific collection when it's
populated
```ts
const result = await payload.findByID({
  populate: {
   // type safe if you have generated types
    posts: {
      text: true,
    },
  },
  collection: 'pages',
  depth: 1,
  id: aboutPage.id,
})

result.relatedPost // only has text and id properties
``` 

```ts
fetch('https://localhost:3000/api/pages?populate[posts][text]=true') // highlight-line
  .then((res) => res.json())
  .then((data) => console.log(data))
```

It also overrides
[`defaultPopulate`](https://github.com/payloadcms/payload/pull/8934)

Ensures `defaultPopulate` doesn't affect GraphQL.

### How?
Implements the property for all operations that have the `depth`
argument.
2024-11-06 13:50:19 -05:00
James
62724b54df Merge branch 'feat/on-demand-rsc' of github.com:payloadcms/payload into feat/on-demand-rsc 2024-11-06 13:32:56 -05:00
Alessio Gravili
096eefd005 do not let playwright handle starting up the dev server, as playwrights babel black magic was messing up our code. A dev server can now be re-used for multiple, separate test runs 2024-11-06 11:31:47 -07:00
Sasha
147d28e62c fix(db-postgres): handle special characters in createDatabase (#9022)
### What?
Handles database name with special characters. For example: `-` -
`my-awesome-app`.

### Why?
Previously, `my-awesome-app` led to this error:
```
Error: failed to create database my-awesome-app.
Details: syntax error at or near "-"
```
This can reproduced for example with `create-payload-app`, as the
generated db name is based on project's name.

### How?
Wraps the query variable to quotes, `create database "my-awesome-app"`
instead of `create database my-awesome-app`.
2024-11-06 13:29:57 -05:00
James
4d75c56ef1 perf: loads document dependencies in parallel to reduce load time 2024-11-06 13:25:05 -05:00