Files
payload/test/admin/collections/CustomIdRow.ts
Paul 6d5ac1de1e fix: allow a custom ID field to be nested inside unnamed tabs and rows (#4701)
* Adds a check for the first tab and e2e test for custom ID

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

* Update tests for rows

* Minor fixes and remove dead commented code
2024-01-11 10:17:24 -05:00

42 lines
846 B
TypeScript

import type { CollectionConfig } from 'payload/dist/collections/config/types'
import { customIdCollectionSlug } from '../slugs'
export const CustomIdRow: CollectionConfig = {
slug: 'customIdRow',
labels: {
singular: 'Custom Id Row',
plural: 'Custom Ids Row',
},
admin: {
description: 'Description',
listSearchableFields: ['id', 'title', 'description', 'number'],
group: 'One',
useAsTitle: 'title',
defaultColumns: ['id', 'number', 'title'],
},
fields: [
{
type: 'row',
fields: [
{
name: 'title',
type: 'text',
},
{
name: 'id',
type: 'text',
},
{
name: 'description',
type: 'text',
},
{
name: 'number',
type: 'number',
},
],
},
],
}