Paul
e258cd73ef
feat: allow group fields to have an optional name (#12318)
Adds the ability to completely omit `name` from group fields now so that
they're entirely presentational.
New config:
```ts
import type { CollectionConfig } from 'payload'
export const ExampleCollection: CollectionConfig = {
slug: 'posts',
fields: [
{
label: 'Page header',
type: 'group', // required
fields: [
{
name: 'title',
type: 'text',
required: true,
},
],
},
],
}
```
will create
<img width="332" alt="image"
src="https://github.com/user-attachments/assets/10b4315e-92d6-439e-82dd-7c815a844035"
/>
but the data response will still be
```
{
"createdAt": "2025-05-05T13:42:20.326Z",
"updatedAt": "2025-05-05T13:42:20.326Z",
"title": "example post",
"id": "6818c03ce92b7f92be1540f0"
}
```
Checklist:
- [x] Added int tests
- [x] Modify mongo, drizzle and graphql packages
- [x] Add type tests
- [x] Add e2e tests
2025-05-14 23:45:34 +00:00
..
2025-04-10 12:11:54 -04:00
2025-04-10 12:11:54 -04:00
2025-02-11 09:45:41 -05:00
2025-03-10 15:17:58 -04:00
2025-02-07 02:38:38 +00:00
2025-04-16 15:38:53 -04:00
2025-02-07 02:38:38 +00:00
2025-05-12 12:34:15 -07:00
2025-02-11 09:45:41 -05:00
2025-05-14 23:45:34 +00:00
2025-04-01 14:11:11 -04:00
2025-03-05 00:04:03 +00:00
2025-04-10 08:54:50 -04:00
2025-02-26 16:54:39 -05:00
2025-03-14 09:14:28 -04:00
2025-05-02 13:03:51 -04:00
2025-02-07 02:38:38 +00:00
2025-03-14 09:14:28 -04:00
2025-02-06 23:47:53 +02:00
2025-03-13 13:32:53 +00:00
2025-02-07 02:38:38 +00:00
2025-04-10 08:54:50 -04:00
2025-02-07 02:38:38 +00:00
2025-03-06 15:34:25 -05:00
2024-06-17 14:25:36 -04:00
2024-08-21 20:44:04 -04:00
2024-08-21 20:44:04 -04:00
2024-08-21 20:44:04 -04:00
2025-02-07 02:38:38 +00:00
2024-11-11 13:59:05 -05:00