({ path })
const [options, setOptions] = React.useState<{ label: string; value: string }[]>([])
diff --git a/test/admin/collections/CustomFields/fields/Text/Description.tsx b/test/admin/collections/CustomFields/fields/Text/Description.tsx
new file mode 100644
index 000000000..e166bbbb7
--- /dev/null
+++ b/test/admin/collections/CustomFields/fields/Text/Description.tsx
@@ -0,0 +1,9 @@
+import type { TextFieldDescriptionComponent } from 'payload'
+
+import React from 'react'
+
+export const CustomDescription: TextFieldDescriptionComponent = (props) => {
+ return (
+ {`The max length of this field is: ${props?.maxLength}`}
+ )
+}
diff --git a/test/admin/collections/CustomFields/fields/Text/Label.tsx b/test/admin/collections/CustomFields/fields/Text/Label.tsx
new file mode 100644
index 000000000..1274beed0
--- /dev/null
+++ b/test/admin/collections/CustomFields/fields/Text/Label.tsx
@@ -0,0 +1,7 @@
+import type { TextFieldLabelComponent } from 'payload'
+
+import React from 'react'
+
+export const CustomLabel: TextFieldLabelComponent = (props) => {
+ return {`The max length of this field is: ${props?.maxLength}`}
+}
diff --git a/test/admin/collections/CustomFields/index.ts b/test/admin/collections/CustomFields/index.ts
index de155bef3..1e3c8ab9b 100644
--- a/test/admin/collections/CustomFields/index.ts
+++ b/test/admin/collections/CustomFields/index.ts
@@ -1,11 +1,55 @@
import type { CollectionConfig } from 'payload'
import { customFieldsSlug } from '../../slugs.js'
-import { CustomSelect } from './components/CustomSelect.js'
+import { AfterInput } from './AfterInput.js'
+import { BeforeInput } from './BeforeInput.js'
+import { CustomError } from './CustomError.js'
+import { FieldDescriptionComponent } from './FieldDescription/index.js'
+import { CustomSelect } from './fields/Select/index.js'
+import { CustomDescription } from './fields/Text/Description.js'
+import { CustomLabel } from './fields/Text/Label.js'
export const CustomFields: CollectionConfig = {
slug: customFieldsSlug,
fields: [
+ {
+ name: 'customTextField',
+ type: 'text',
+ maxLength: 100,
+ admin: {
+ components: {
+ afterInput: [AfterInput],
+ beforeInput: [BeforeInput],
+ Label: CustomLabel,
+ Description: CustomDescription,
+ Error: CustomError,
+ },
+ },
+ minLength: 3,
+ },
+ {
+ name: 'descriptionAsString',
+ type: 'text',
+ admin: {
+ description: 'Static field description.',
+ },
+ },
+ {
+ name: 'descriptionAsFunction',
+ type: 'text',
+ admin: {
+ description: () => 'Function description',
+ },
+ },
+ {
+ name: 'descriptionAsComponent',
+ type: 'text',
+ admin: {
+ components: {
+ Description: FieldDescriptionComponent,
+ },
+ },
+ },
{
name: 'customSelectField',
type: 'text',
diff --git a/test/admin/collections/Posts.ts b/test/admin/collections/Posts.ts
index e9051cfac..8e1d6008f 100644
--- a/test/admin/collections/Posts.ts
+++ b/test/admin/collections/Posts.ts
@@ -5,7 +5,6 @@ import { slateEditor } from '@payloadcms/richtext-slate'
import { CustomCell } from '../components/CustomCell/index.js'
import { DemoUIFieldCell } from '../components/DemoUIField/Cell.js'
import { DemoUIField } from '../components/DemoUIField/Field.js'
-import { FieldDescriptionComponent } from '../components/FieldDescription/index.js'
import { slugPluralLabel, slugSingularLabel } from '../shared.js'
import { postsCollectionSlug } from '../slugs.js'
@@ -108,29 +107,6 @@ export const Posts: CollectionConfig = {
position: 'sidebar',
},
},
- {
- name: 'descriptionAsString',
- type: 'text',
- admin: {
- description: 'Static field description.',
- },
- },
- {
- name: 'descriptionAsFunction',
- type: 'text',
- admin: {
- description: () => 'Function description',
- },
- },
- {
- name: 'descriptionAsComponent',
- type: 'text',
- admin: {
- components: {
- Description: FieldDescriptionComponent,
- },
- },
- },
],
labels: {
plural: slugPluralLabel,
diff --git a/test/admin/e2e/1/e2e.spec.ts b/test/admin/e2e/1/e2e.spec.ts
index b858b5093..f79987a1c 100644
--- a/test/admin/e2e/1/e2e.spec.ts
+++ b/test/admin/e2e/1/e2e.spec.ts
@@ -500,9 +500,90 @@ describe('admin1', () => {
})
describe('custom fields', () => {
+ test('renders custom label component', async () => {
+ await page.goto(customFieldsURL.create)
+ await page.waitForURL(customFieldsURL.create)
+ await expect(page.locator('#custom-field-label')).toBeVisible()
+ })
+
+ test('renders custom description component', async () => {
+ await page.goto(customFieldsURL.create)
+ await page.waitForURL(customFieldsURL.create)
+ await expect(page.locator('#custom-field-description')).toBeVisible()
+ })
+
+ test('ensure custom components receive field props', async () => {
+ await page.goto(customFieldsURL.create)
+ await page.waitForURL(customFieldsURL.create)
+ await expect(page.locator('#custom-field-label')).toContainText(
+ 'The max length of this field is: 100',
+ )
+ await expect(page.locator('#custom-field-description')).toContainText(
+ 'The max length of this field is: 100',
+ )
+ })
+
+ describe('field descriptions', () => {
+ test('should render static field description', async () => {
+ await page.goto(customFieldsURL.create)
+ await page.waitForURL(customFieldsURL.create)
+ await expect(page.locator('.field-description-descriptionAsString')).toContainText(
+ 'Static field description.',
+ )
+ })
+
+ test('should render functional field description', async () => {
+ await page.goto(customFieldsURL.create)
+ await page.waitForURL(customFieldsURL.create)
+ await page.locator('#field-descriptionAsFunction').fill('functional')
+ await expect(page.locator('.field-description-descriptionAsFunction')).toContainText(
+ 'Function description',
+ )
+ })
+ })
+
+ test('should render component field description', async () => {
+ await page.goto(customFieldsURL.create)
+ await page.waitForURL(customFieldsURL.create)
+ await page.locator('#field-descriptionAsComponent').fill('component')
+ await expect(page.locator('.field-description-descriptionAsComponent')).toContainText(
+ 'Component description: descriptionAsComponent - component',
+ )
+ })
+
+ test('should render custom error component', async () => {
+ await page.goto(customFieldsURL.create)
+ await page.waitForURL(customFieldsURL.create)
+ const input = page.locator('input[id="field-customTextField"]')
+ await input.fill('ab')
+ await expect(input).toHaveValue('ab')
+ const error = page.locator('.custom-error:near(input[id="field-customTextField"])')
+ const submit = page.locator('button[type="button"][id="action-save"]')
+ await submit.click()
+ await expect(error).toHaveText('#custom-error')
+ })
+
+ test('should render beforeInput and afterInput', async () => {
+ await page.goto(customFieldsURL.create)
+ const input = page.locator('input[id="field-customTextField"]')
+
+ const prevSibling = await input.evaluateHandle((el) => {
+ return el.previousElementSibling
+ })
+ const prevSiblingText = await page.evaluate((el) => el.textContent, prevSibling)
+ expect(prevSiblingText).toEqual('#before-input')
+
+ const nextSibling = await input.evaluateHandle((el) => {
+ return el.nextElementSibling
+ })
+ const nextSiblingText = await page.evaluate((el) => el.textContent, nextSibling)
+ expect(nextSiblingText).toEqual('#after-input')
+ })
+
describe('select field', () => {
test('should render custom select options', async () => {
await page.goto(customFieldsURL.create)
+ await page.waitForURL(customFieldsURL.create)
await page.locator('#field-customSelectField .rs__control').click()
await expect(page.locator('#field-customSelectField .rs__option')).toHaveCount(2)
})
diff --git a/test/admin/e2e/2/e2e.spec.ts b/test/admin/e2e/2/e2e.spec.ts
index c0b7db8db..4e8a061e5 100644
--- a/test/admin/e2e/2/e2e.spec.ts
+++ b/test/admin/e2e/2/e2e.spec.ts
@@ -782,29 +782,6 @@ describe('admin2', () => {
})
})
})
-
- describe('field descriptions', () => {
- test('should render static field description', async () => {
- await page.goto(postsUrl.create)
- await expect(page.locator('.field-description-descriptionAsString')).toContainText(
- 'Static field description.',
- )
- })
- test('should render functional field description', async () => {
- await page.goto(postsUrl.create)
- await page.locator('#field-descriptionAsFunction').fill('functional')
- await expect(page.locator('.field-description-descriptionAsFunction')).toContainText(
- 'Function description',
- )
- })
- test('should render component field description', async () => {
- await page.goto(postsUrl.create)
- await page.locator('#field-descriptionAsComponent').fill('component')
- await expect(page.locator('.field-description-descriptionAsComponent')).toContainText(
- 'Component description: descriptionAsComponent - component',
- )
- })
- })
})
async function createPost(overrides?: Partial): Promise {
diff --git a/test/admin/payload-types.ts b/test/admin/payload-types.ts
index d13e67114..bd0ee8ff8 100644
--- a/test/admin/payload-types.ts
+++ b/test/admin/payload-types.ts
@@ -102,9 +102,6 @@ export interface Post {
relationship?: (string | null) | Post;
customCell?: string | null;
sidebarField?: string | null;
- descriptionAsString?: string | null;
- descriptionAsFunction?: string | null;
- descriptionAsComponent?: string | null;
updatedAt: string;
createdAt: string;
_status?: ('draft' | 'published') | null;
@@ -173,6 +170,10 @@ export interface CustomViewsTwo {
*/
export interface CustomField {
id: string;
+ customTextField?: string | null;
+ descriptionAsString?: string | null;
+ descriptionAsFunction?: string | null;
+ descriptionAsComponent?: string | null;
customSelectField?: string | null;
updatedAt: string;
createdAt: string;
diff --git a/test/fields/collections/Number/e2e.spec.ts b/test/fields/collections/Number/e2e.spec.ts
index 8a1d7d716..918dc7133 100644
--- a/test/fields/collections/Number/e2e.spec.ts
+++ b/test/fields/collections/Number/e2e.spec.ts
@@ -53,19 +53,16 @@ describe('Number', () => {
})
await ensureCompilationIsDone({ page, serverURL })
})
+
beforeEach(async () => {
await reInitializeDB({
serverURL,
snapshotKey: 'fieldsNumberTest',
uploadsDir: path.resolve(dirname, './collections/Upload/uploads'),
})
-
- if (client) {
- await client.logout()
- }
+ if (client) await client.logout()
client = new RESTClient(null, { defaultSlug: 'users', serverURL })
await client.login()
-
await ensureCompilationIsDone({ page, serverURL })
})
@@ -77,26 +74,17 @@ describe('Number', () => {
test('should filter Number fields in the collection view - greaterThanOrEqual', async () => {
await page.goto(url.list)
-
- // should have 3 entries
await expect(page.locator('table >> tbody >> tr')).toHaveCount(3)
-
- // open the filter options
await page.locator('.list-controls__toggle-where').click()
await expect(page.locator('.list-controls__where.rah-static--height-auto')).toBeVisible()
await page.locator('.where-builder__add-first-filter').click()
-
const initialField = page.locator('.condition__field')
const operatorField = page.locator('.condition__operator')
const valueField = page.locator('.condition__value >> input')
-
- // select Number field to filter on
await initialField.click()
const initialFieldOptions = initialField.locator('.rs__option')
await initialFieldOptions.locator('text=number').first().click()
await expect(initialField.locator('.rs__single-value')).toContainText('Number')
-
- // select >= operator
await operatorField.click()
const operatorOptions = operatorField.locator('.rs__option')
await operatorOptions.last().click()
@@ -108,14 +96,11 @@ describe('Number', () => {
await valueField.fill('3')
await expect(valueField).toHaveValue('3')
await wait(300)
-
- // should have 2 entries after filtering
await expect(page.locator('table >> tbody >> tr')).toHaveCount(2)
})
test('should create', async () => {
const input = 5
-
await page.goto(url.create)
const field = page.locator('#field-number')
await field.fill(String(input))
@@ -125,7 +110,6 @@ describe('Number', () => {
test('should create hasMany', async () => {
const input = 5
-
await page.goto(url.create)
const field = page.locator('.field-hasMany')
await field.click()
@@ -138,19 +122,16 @@ describe('Number', () => {
test('should bypass min rows validation when no rows present and field is not required', async () => {
await page.goto(url.create)
await saveDocAndAssert(page)
- await expect(page.locator('.payload-toast-container')).toContainText('successfully')
+ expect(true).toBe(true) // the above fn contains the assertion
})
test('should fail min rows validation when rows are present', async () => {
const input = 5
-
await page.goto(url.create)
await page.locator('.field-withMinRows').click()
-
await page.keyboard.type(String(input))
await page.keyboard.press('Enter')
await page.click('#action-save', { delay: 100 })
-
await expect(page.locator('.payload-toast-container')).toContainText(
'The following field is invalid: withMinRows',
)
diff --git a/test/fields/collections/Text/CustomLabel.tsx b/test/fields/collections/Text/CustomLabel.tsx
deleted file mode 100644
index 96ad9b403..000000000
--- a/test/fields/collections/Text/CustomLabel.tsx
+++ /dev/null
@@ -1,18 +0,0 @@
-'use client'
-
-import { useFieldProps } from '@payloadcms/ui'
-import React from 'react'
-
-const CustomLabel = ({ schemaPath }) => {
- const { path: pathFromContext } = useFieldProps()
-
- const path = pathFromContext ?? schemaPath // pathFromContext will be undefined in list view
-
- return (
-
- )
-}
-
-export default CustomLabel
diff --git a/test/fields/collections/Text/e2e.spec.ts b/test/fields/collections/Text/e2e.spec.ts
index 36ec866e4..1526382cf 100644
--- a/test/fields/collections/Text/e2e.spec.ts
+++ b/test/fields/collections/Text/e2e.spec.ts
@@ -154,40 +154,6 @@ describe('Text', () => {
await expect(description).toHaveText('en description')
})
- test('should render custom label', async () => {
- await page.goto(url.create)
- const label = page.locator('label.custom-label[for="field-customLabel"]')
- await expect(label).toHaveText('#label')
- })
-
- test('should render custom error', async () => {
- await page.goto(url.create)
- const input = page.locator('input[id="field-customError"]')
- await input.fill('ab')
- await expect(input).toHaveValue('ab')
- const error = page.locator('.custom-error:near(input[id="field-customError"])')
- const submit = page.locator('button[type="button"][id="action-save"]')
- await submit.click()
- await expect(error).toHaveText('#custom-error')
- })
-
- test('should render beforeInput and afterInput', async () => {
- await page.goto(url.create)
- const input = page.locator('input[id="field-beforeAndAfterInput"]')
-
- const prevSibling = await input.evaluateHandle((el) => {
- return el.previousElementSibling
- })
- const prevSiblingText = await page.evaluate((el) => el.textContent, prevSibling)
- expect(prevSiblingText).toEqual('#before-input')
-
- const nextSibling = await input.evaluateHandle((el) => {
- return el.nextElementSibling
- })
- const nextSiblingText = await page.evaluate((el) => el.textContent, nextSibling)
- expect(nextSiblingText).toEqual('#after-input')
- })
-
test('should create hasMany with multiple texts', async () => {
const input = 'five'
const furtherInput = 'six'
diff --git a/test/fields/collections/Text/index.ts b/test/fields/collections/Text/index.ts
index 1c7c54716..24aa8ac48 100644
--- a/test/fields/collections/Text/index.ts
+++ b/test/fields/collections/Text/index.ts
@@ -1,9 +1,5 @@
import type { CollectionConfig } from 'payload'
-import { AfterInput } from './AfterInput.js'
-import { BeforeInput } from './BeforeInput.js'
-import CustomError from './CustomError.js'
-import CustomLabel from './CustomLabel.js'
import { defaultText, textFieldsSlug } from './shared.js'
const TextFields: CollectionConfig = {
@@ -93,35 +89,6 @@ const TextFields: CollectionConfig = {
],
},
},
- {
- name: 'customLabel',
- type: 'text',
- admin: {
- components: {
- Label: CustomLabel,
- },
- },
- },
- {
- name: 'customError',
- type: 'text',
- admin: {
- components: {
- Error: CustomError,
- },
- },
- minLength: 3,
- },
- {
- name: 'beforeAndAfterInput',
- type: 'text',
- admin: {
- components: {
- afterInput: [AfterInput],
- beforeInput: [BeforeInput],
- },
- },
- },
{
name: 'hasMany',
type: 'text',
diff --git a/test/fields/payload-types.ts b/test/fields/payload-types.ts
index 3e8c6a7ee..85031f46d 100644
--- a/test/fields/payload-types.ts
+++ b/test/fields/payload-types.ts
@@ -61,7 +61,7 @@ export interface Config {
'payload-migrations': PayloadMigration;
};
db: {
- defaultIDType: number;
+ defaultIDType: string;
};
globals: {
tabsWithRichText: TabsWithRichText;
@@ -92,7 +92,7 @@ export interface UserAuthOperations {
* via the `definition` "lexical-fields".
*/
export interface LexicalField {
- id: number;
+ id: string;
title: string;
lexicalSimple?: {
root: {
@@ -133,7 +133,7 @@ export interface LexicalField {
* via the `definition` "lexical-migrate-fields".
*/
export interface LexicalMigrateField {
- id: number;
+ id: string;
title: string;
lexicalWithLexicalPluginData?: {
root: {
@@ -228,7 +228,7 @@ export interface LexicalMigrateField {
* via the `definition` "lexical-localized-fields".
*/
export interface LexicalLocalizedField {
- id: number;
+ id: string;
title: string;
lexicalBlocksSubLocalized?: {
root: {
@@ -268,7 +268,7 @@ export interface LexicalLocalizedField {
* via the `definition` "users".
*/
export interface User {
- id: number;
+ id: string;
canViewConditionalField?: boolean | null;
updatedAt: string;
createdAt: string;
@@ -286,7 +286,7 @@ export interface User {
* via the `definition` "array-fields".
*/
export interface ArrayField {
- id: number;
+ id: string;
title?: string | null;
items: {
text: string;
@@ -350,7 +350,7 @@ export interface ArrayField {
* via the `definition` "block-fields".
*/
export interface BlockField {
- id: number;
+ id: string;
blocks: (
| {
text: string;
@@ -677,7 +677,7 @@ export interface BlockField {
| null;
relationshipBlocks?:
| {
- relationship?: (number | null) | TextField;
+ relationship?: (string | null) | TextField;
id?: string | null;
blockName?: string | null;
blockType: 'relationships';
@@ -691,7 +691,7 @@ export interface BlockField {
* via the `definition` "text-fields".
*/
export interface TextField {
- id: number;
+ id: string;
text: string;
localizedText?: string | null;
i18nText?: string | null;
@@ -702,9 +702,6 @@ export interface TextField {
overrideLength?: string | null;
fieldWithDefaultValue?: string | null;
dependentOnFieldWithDefaultValue?: string | null;
- customLabel?: string | null;
- customError?: string | null;
- beforeAndAfterInput?: string | null;
hasMany?: string[] | null;
validatesHasMany?: string[] | null;
localizedHasMany?: string[] | null;
@@ -720,7 +717,7 @@ export interface TextField {
* via the `definition` "checkbox-fields".
*/
export interface CheckboxField {
- id: number;
+ id: string;
checkbox: boolean;
updatedAt: string;
createdAt: string;
@@ -730,7 +727,7 @@ export interface CheckboxField {
* via the `definition` "code-fields".
*/
export interface CodeField {
- id: number;
+ id: string;
javascript?: string | null;
typescript?: string | null;
json?: string | null;
@@ -744,7 +741,7 @@ export interface CodeField {
* via the `definition` "collapsible-fields".
*/
export interface CollapsibleField {
- id: number;
+ id: string;
text: string;
group?: {
textWithinGroup?: string | null;
@@ -776,7 +773,7 @@ export interface CollapsibleField {
* via the `definition` "conditional-logic".
*/
export interface ConditionalLogic {
- id: number;
+ id: string;
text: string;
toggleField?: boolean | null;
fieldToToggle?: string | null;
@@ -801,7 +798,7 @@ export interface ConditionalLogic {
* via the `definition` "date-fields".
*/
export interface DateField {
- id: number;
+ id: string;
default: string;
timeOnly?: string | null;
timeOnlyWithCustomFormat?: string | null;
@@ -816,9 +813,10 @@ export interface DateField {
* via the `definition` "email-fields".
*/
export interface EmailField {
- id: number;
+ id: string;
email: string;
localizedEmail?: string | null;
+ emailWithAutocomplete?: string | null;
i18nEmail?: string | null;
defaultEmail?: string | null;
defaultEmptyString?: string | null;
@@ -837,7 +835,7 @@ export interface EmailField {
* via the `definition` "radio-fields".
*/
export interface RadioField {
- id: number;
+ id: string;
radio?: ('one' | 'two' | 'three') | null;
updatedAt: string;
createdAt: string;
@@ -847,7 +845,7 @@ export interface RadioField {
* via the `definition` "group-fields".
*/
export interface GroupField {
- id: number;
+ id: string;
group: {
text: string;
defaultParent?: string | null;
@@ -922,7 +920,7 @@ export interface RowField {
* via the `definition` "indexed-fields".
*/
export interface IndexedField {
- id: number;
+ id: string;
text: string;
uniqueText?: string | null;
uniqueRequiredText: string;
@@ -951,7 +949,7 @@ export interface IndexedField {
* via the `definition` "json-fields".
*/
export interface JsonField {
- id: number;
+ id: string;
json?: {
foo?: 'bar' | 'foobar';
number?: 10 | 5;
@@ -976,7 +974,7 @@ export interface JsonField {
* via the `definition` "number-fields".
*/
export interface NumberField {
- id: number;
+ id: string;
number?: number | null;
min?: number | null;
max?: number | null;
@@ -997,7 +995,7 @@ export interface NumberField {
* via the `definition` "point-fields".
*/
export interface PointField {
- id: number;
+ id: string;
/**
* @minItems 2
* @maxItems 2
@@ -1023,49 +1021,49 @@ export interface PointField {
* via the `definition` "relationship-fields".
*/
export interface RelationshipField {
- id: number;
+ id: string;
text?: string | null;
relationship:
| {
relationTo: 'text-fields';
- value: number | TextField;
+ value: string | TextField;
}
| {
relationTo: 'array-fields';
- value: number | ArrayField;
+ value: string | ArrayField;
};
relationHasManyPolymorphic?:
| (
| {
relationTo: 'text-fields';
- value: number | TextField;
+ value: string | TextField;
}
| {
relationTo: 'array-fields';
- value: number | ArrayField;
+ value: string | ArrayField;
}
)[]
| null;
- relationToSelf?: (number | null) | RelationshipField;
- relationToSelfSelectOnly?: (number | null) | RelationshipField;
- relationWithDynamicDefault?: (number | null) | User;
+ relationToSelf?: (string | null) | RelationshipField;
+ relationToSelfSelectOnly?: (string | null) | RelationshipField;
+ relationWithDynamicDefault?: (string | null) | User;
relationHasManyWithDynamicDefault?: {
relationTo: 'users';
- value: number | User;
+ value: string | User;
} | null;
- relationshipWithMin?: (number | TextField)[] | null;
- relationshipWithMax?: (number | TextField)[] | null;
- relationshipHasMany?: (number | TextField)[] | null;
+ relationshipWithMin?: (string | TextField)[] | null;
+ relationshipWithMax?: (string | TextField)[] | null;
+ relationshipHasMany?: (string | TextField)[] | null;
array?:
| {
- relationship?: (number | null) | TextField;
+ relationship?: (string | null) | TextField;
id?: string | null;
}[]
| null;
relationshipWithMinRows?:
| {
relationTo: 'text-fields';
- value: number | TextField;
+ value: string | TextField;
}[]
| null;
updatedAt: string;
@@ -1076,7 +1074,7 @@ export interface RelationshipField {
* via the `definition` "rich-text-fields".
*/
export interface RichTextField {
- id: number;
+ id: string;
title: string;
lexicalCustomFields: {
root: {
@@ -1151,7 +1149,7 @@ export interface RichTextField {
* via the `definition` "select-fields".
*/
export interface SelectField {
- id: number;
+ id: string;
select?: ('one' | 'two' | 'three') | null;
selectReadOnly?: ('one' | 'two' | 'three') | null;
selectHasMany?: ('one' | 'two' | 'three' | 'four' | 'five' | 'six')[] | null;
@@ -1169,7 +1167,7 @@ export interface SelectField {
* via the `definition` "tabs-fields-2".
*/
export interface TabsFields2 {
- id: number;
+ id: string;
tabsInArray?:
| {
text?: string | null;
@@ -1187,7 +1185,7 @@ export interface TabsFields2 {
* via the `definition` "tabs-fields".
*/
export interface TabsField {
- id: number;
+ id: string;
sidebarField?: string | null;
array: {
text: string;
@@ -1296,9 +1294,9 @@ export interface TabsField {
* via the `definition` "uploads".
*/
export interface Upload {
- id: number;
+ id: string;
text?: string | null;
- media?: number | Upload | null;
+ media?: string | Upload | null;
richText?: {
root: {
type: string;
@@ -1331,9 +1329,9 @@ export interface Upload {
* via the `definition` "uploads2".
*/
export interface Uploads2 {
- id: number;
+ id: string;
text?: string | null;
- media?: number | Uploads2 | null;
+ media?: string | Uploads2 | null;
updatedAt: string;
createdAt: string;
url?: string | null;
@@ -1351,8 +1349,8 @@ export interface Uploads2 {
* via the `definition` "uploads3".
*/
export interface Uploads3 {
- id: number;
- media?: number | Uploads3 | null;
+ id: string;
+ media?: string | Uploads3 | null;
richText?: {
root: {
type: string;
@@ -1385,7 +1383,7 @@ export interface Uploads3 {
* via the `definition` "ui-fields".
*/
export interface UiField {
- id: number;
+ id: string;
text: string;
updatedAt: string;
createdAt: string;
@@ -1395,10 +1393,10 @@ export interface UiField {
* via the `definition` "payload-preferences".
*/
export interface PayloadPreference {
- id: number;
+ id: string;
user: {
relationTo: 'users';
- value: number | User;
+ value: string | User;
};
key?: string | null;
value?:
@@ -1418,7 +1416,7 @@ export interface PayloadPreference {
* via the `definition` "payload-migrations".
*/
export interface PayloadMigration {
- id: number;
+ id: string;
name?: string | null;
batch?: number | null;
updatedAt: string;
@@ -1429,7 +1427,7 @@ export interface PayloadMigration {
* via the `definition` "tabsWithRichText".
*/
export interface TabsWithRichText {
- id: number;
+ id: string;
tab1?: {
rt1?: {
root: {
diff --git a/test/live-preview/payload-types.ts b/test/live-preview/payload-types.ts
index 2816a3130..906006fba 100644
--- a/test/live-preview/payload-types.ts
+++ b/test/live-preview/payload-types.ts
@@ -22,6 +22,9 @@ export interface Config {
'payload-preferences': PayloadPreference;
'payload-migrations': PayloadMigration;
};
+ db: {
+ defaultIDType: string;
+ };
globals: {
header: Header;
footer: Footer;
@@ -36,13 +39,16 @@ export interface UserAuthOperations {
email: string;
};
login: {
- password: string;
email: string;
+ password: string;
};
registerFirstUser: {
email: string;
password: string;
};
+ unlock: {
+ email: string;
+ };
}
/**
* This interface was referenced by `Config`'s JSON-Schema
diff --git a/test/plugin-form-builder/payload-types.ts b/test/plugin-form-builder/payload-types.ts
index 9e976d94d..aacc681db 100644
--- a/test/plugin-form-builder/payload-types.ts
+++ b/test/plugin-form-builder/payload-types.ts
@@ -18,6 +18,9 @@ export interface Config {
'payload-preferences': PayloadPreference;
'payload-migrations': PayloadMigration;
};
+ db: {
+ defaultIDType: string;
+ };
globals: {};
locale: 'en' | 'es' | 'de';
user: User & {
@@ -29,13 +32,16 @@ export interface UserAuthOperations {
email: string;
};
login: {
- password: string;
email: string;
+ password: string;
};
registerFirstUser: {
email: string;
password: string;
};
+ unlock: {
+ email: string;
+ };
}
/**
* This interface was referenced by `Config`'s JSON-Schema
diff --git a/test/plugin-seo/payload-types.ts b/test/plugin-seo/payload-types.ts
index 8ee16f98c..fedbade76 100644
--- a/test/plugin-seo/payload-types.ts
+++ b/test/plugin-seo/payload-types.ts
@@ -18,6 +18,9 @@ export interface Config {
'payload-preferences': PayloadPreference;
'payload-migrations': PayloadMigration;
};
+ db: {
+ defaultIDType: string;
+ };
globals: {};
locale: 'en' | 'es' | 'de';
user: User & {
@@ -29,13 +32,16 @@ export interface UserAuthOperations {
email: string;
};
login: {
- password: string;
email: string;
+ password: string;
};
registerFirstUser: {
email: string;
password: string;
};
+ unlock: {
+ email: string;
+ };
}
/**
* This interface was referenced by `Config`'s JSON-Schema
diff --git a/test/versions/payload-types.ts b/test/versions/payload-types.ts
index 0f0262c78..f9846c56a 100644
--- a/test/versions/payload-types.ts
+++ b/test/versions/payload-types.ts
@@ -22,6 +22,9 @@ export interface Config {
'payload-preferences': PayloadPreference;
'payload-migrations': PayloadMigration;
};
+ db: {
+ defaultIDType: string;
+ };
globals: {
'autosave-global': AutosaveGlobal;
'draft-global': DraftGlobal;
@@ -38,13 +41,16 @@ export interface UserAuthOperations {
email: string;
};
login: {
- password: string;
email: string;
+ password: string;
};
registerFirstUser: {
email: string;
password: string;
};
+ unlock: {
+ email: string;
+ };
}
/**
* This interface was referenced by `Config`'s JSON-Schema