test: consolidates custom id e2e tests (#10061)
Although we have a dedicated e2e test suite for custom IDs, tests for custom unnamed tab and row IDs were still located within the admin test suite. This consolidates these tests into the appropriate test suite as expected.
This commit is contained in:
25
test/fields/collections/CustomID/CustomRowID.ts
Normal file
25
test/fields/collections/CustomID/CustomRowID.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import type { CollectionConfig } from 'payload'
|
||||
|
||||
import { customRowIDSlug } from '../../slugs.js'
|
||||
|
||||
export const CustomRowID: CollectionConfig = {
|
||||
slug: customRowIDSlug,
|
||||
admin: {
|
||||
useAsTitle: 'id',
|
||||
},
|
||||
fields: [
|
||||
{
|
||||
type: 'row',
|
||||
fields: [
|
||||
{
|
||||
name: 'id',
|
||||
type: 'text',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
labels: {
|
||||
plural: 'Custom Row IDs',
|
||||
singular: 'Custom Row ID',
|
||||
},
|
||||
}
|
||||
30
test/fields/collections/CustomID/CustomTabID.ts
Normal file
30
test/fields/collections/CustomID/CustomTabID.ts
Normal file
@@ -0,0 +1,30 @@
|
||||
import type { CollectionConfig } from 'payload'
|
||||
|
||||
import { customTabIDSlug } from '../../slugs.js'
|
||||
|
||||
export const CustomTabID: CollectionConfig = {
|
||||
slug: customTabIDSlug,
|
||||
admin: {
|
||||
useAsTitle: 'id',
|
||||
},
|
||||
fields: [
|
||||
{
|
||||
type: 'tabs',
|
||||
tabs: [
|
||||
{
|
||||
fields: [
|
||||
{
|
||||
name: 'id',
|
||||
type: 'text',
|
||||
},
|
||||
],
|
||||
label: 'Tab 1',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
labels: {
|
||||
plural: 'Custom Tab IDs',
|
||||
singular: 'Custom Tab ID',
|
||||
},
|
||||
}
|
||||
@@ -14,7 +14,8 @@ import { initPayloadE2ENoConfig } from '../../../helpers/initPayloadE2ENoConfig.
|
||||
import { reInitializeDB } from '../../../helpers/reInitializeDB.js'
|
||||
import { RESTClient } from '../../../helpers/rest.js'
|
||||
import { TEST_TIMEOUT_LONG } from '../../../playwright.config.js'
|
||||
import { customIdSlug } from '../../slugs.js'
|
||||
import { customIDSlug, customRowIDSlug, customTabIDSlug } from '../../slugs.js'
|
||||
import { customRowID, customTabID, nonStandardID } from './shared.js'
|
||||
|
||||
const filename = fileURLToPath(import.meta.url)
|
||||
const currentFolder = path.dirname(filename)
|
||||
@@ -27,8 +28,10 @@ let client: RESTClient
|
||||
let page: Page
|
||||
let serverURL: string
|
||||
let url: AdminUrlUtil
|
||||
let customTabIDURL: AdminUrlUtil
|
||||
let customRowIDURL: AdminUrlUtil
|
||||
|
||||
describe('Radio', () => {
|
||||
describe('Custom IDs', () => {
|
||||
beforeAll(async ({ browser }, testInfo) => {
|
||||
testInfo.setTimeout(TEST_TIMEOUT_LONG)
|
||||
process.env.SEED_IN_CONFIG_ONINIT = 'false' // Makes it so the payload config onInit seed is not run. Otherwise, the seed would be run unnecessarily twice for the initial test run - once for beforeEach and once for onInit
|
||||
@@ -37,7 +40,9 @@ describe('Radio', () => {
|
||||
// prebuild,
|
||||
}))
|
||||
|
||||
url = new AdminUrlUtil(serverURL, customIdSlug)
|
||||
url = new AdminUrlUtil(serverURL, customIDSlug)
|
||||
customTabIDURL = new AdminUrlUtil(serverURL, customTabIDSlug)
|
||||
customRowIDURL = new AdminUrlUtil(serverURL, customRowIDSlug)
|
||||
|
||||
const context = await browser.newContext()
|
||||
page = await context.newPage()
|
||||
@@ -60,23 +65,22 @@ describe('Radio', () => {
|
||||
await ensureCompilationIsDone({ page, serverURL })
|
||||
})
|
||||
|
||||
function createCustomIDDoc(id: string) {
|
||||
return payload.create({
|
||||
collection: customIdSlug,
|
||||
data: {
|
||||
id,
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
test('allow create of non standard ID', async () => {
|
||||
await createCustomIDDoc('id 1')
|
||||
await page.goto(url.list)
|
||||
|
||||
await navigateToDoc(page, url)
|
||||
await expect(page.locator('#field-id')).toHaveValue(nonStandardID)
|
||||
await expect(page.locator('.id-label')).toContainText(nonStandardID)
|
||||
})
|
||||
|
||||
// Page should load and ID should be correct
|
||||
await expect(page.locator('#field-id')).toHaveValue('id 1')
|
||||
await expect(page.locator('.id-label')).toContainText('id 1')
|
||||
test('should use custom ID field nested within unnamed tab', async () => {
|
||||
await page.goto(customTabIDURL.edit(customTabID))
|
||||
const idField = page.locator('#field-id')
|
||||
await expect(idField).toHaveValue(customTabID)
|
||||
})
|
||||
|
||||
test('should use custom ID field nested within row', async () => {
|
||||
await page.goto(customRowIDURL.edit(customRowID))
|
||||
const idField = page.locator('#field-id')
|
||||
await expect(idField).toHaveValue(customRowID)
|
||||
})
|
||||
})
|
||||
|
||||
@@ -1,14 +1,21 @@
|
||||
import type { CollectionConfig } from 'payload'
|
||||
|
||||
import { customIdSlug } from '../../slugs.js'
|
||||
import { customIDSlug } from '../../slugs.js'
|
||||
|
||||
export const CustomIdCollection: CollectionConfig = {
|
||||
slug: customIdSlug,
|
||||
export const CustomID: CollectionConfig = {
|
||||
slug: customIDSlug,
|
||||
versions: true,
|
||||
admin: {
|
||||
useAsTitle: 'id',
|
||||
},
|
||||
fields: [
|
||||
{
|
||||
name: 'id',
|
||||
type: 'text',
|
||||
},
|
||||
],
|
||||
labels: {
|
||||
plural: 'Custom IDs',
|
||||
singular: 'Custom ID',
|
||||
},
|
||||
}
|
||||
|
||||
3
test/fields/collections/CustomID/shared.ts
Normal file
3
test/fields/collections/CustomID/shared.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
export const nonStandardID = 'id 1'
|
||||
export const customRowID = '111111111111111111111111'
|
||||
export const customTabID = '111111111111111111111111'
|
||||
@@ -12,7 +12,9 @@ import CheckboxFields from './collections/Checkbox/index.js'
|
||||
import CodeFields from './collections/Code/index.js'
|
||||
import CollapsibleFields from './collections/Collapsible/index.js'
|
||||
import ConditionalLogic from './collections/ConditionalLogic/index.js'
|
||||
import { CustomIdCollection } from './collections/CustomID/index.js'
|
||||
import { CustomRowID } from './collections/CustomID/CustomRowID.js'
|
||||
import { CustomTabID } from './collections/CustomID/CustomTabID.js'
|
||||
import { CustomID } from './collections/CustomID/index.js'
|
||||
import DateFields from './collections/Date/index.js'
|
||||
import EmailFields from './collections/Email/index.js'
|
||||
import GroupFields from './collections/Group/index.js'
|
||||
@@ -72,7 +74,9 @@ export const collectionSlugs: CollectionConfig[] = [
|
||||
CodeFields,
|
||||
CollapsibleFields,
|
||||
ConditionalLogic,
|
||||
CustomIdCollection,
|
||||
CustomID,
|
||||
CustomTabID,
|
||||
CustomRowID,
|
||||
DateFields,
|
||||
EmailFields,
|
||||
RadioFields,
|
||||
|
||||
@@ -41,6 +41,8 @@ export interface Config {
|
||||
'collapsible-fields': CollapsibleField;
|
||||
'conditional-logic': ConditionalLogic;
|
||||
'custom-id': CustomId;
|
||||
'custom-tab-id': CustomTabId;
|
||||
'custom-row-id': CustomRowId;
|
||||
'date-fields': DateField;
|
||||
'email-fields': EmailField;
|
||||
'radio-fields': RadioField;
|
||||
@@ -84,6 +86,8 @@ export interface Config {
|
||||
'collapsible-fields': CollapsibleFieldsSelect<false> | CollapsibleFieldsSelect<true>;
|
||||
'conditional-logic': ConditionalLogicSelect<false> | ConditionalLogicSelect<true>;
|
||||
'custom-id': CustomIdSelect<false> | CustomIdSelect<true>;
|
||||
'custom-tab-id': CustomTabIdSelect<false> | CustomTabIdSelect<true>;
|
||||
'custom-row-id': CustomRowIdSelect<false> | CustomRowIdSelect<true>;
|
||||
'date-fields': DateFieldsSelect<false> | DateFieldsSelect<true>;
|
||||
'email-fields': EmailFieldsSelect<false> | EmailFieldsSelect<true>;
|
||||
'radio-fields': RadioFieldsSelect<false> | RadioFieldsSelect<true>;
|
||||
@@ -935,6 +939,24 @@ export interface CustomId {
|
||||
updatedAt: string;
|
||||
createdAt: string;
|
||||
}
|
||||
/**
|
||||
* This interface was referenced by `Config`'s JSON-Schema
|
||||
* via the `definition` "custom-tab-id".
|
||||
*/
|
||||
export interface CustomTabId {
|
||||
id: string;
|
||||
updatedAt: string;
|
||||
createdAt: string;
|
||||
}
|
||||
/**
|
||||
* This interface was referenced by `Config`'s JSON-Schema
|
||||
* via the `definition` "custom-row-id".
|
||||
*/
|
||||
export interface CustomRowId {
|
||||
id: string;
|
||||
updatedAt: string;
|
||||
createdAt: string;
|
||||
}
|
||||
/**
|
||||
* This interface was referenced by `Config`'s JSON-Schema
|
||||
* via the `definition` "date-fields".
|
||||
@@ -1750,6 +1772,14 @@ export interface PayloadLockedDocument {
|
||||
relationTo: 'custom-id';
|
||||
value: string | CustomId;
|
||||
} | null)
|
||||
| ({
|
||||
relationTo: 'custom-tab-id';
|
||||
value: string | CustomTabId;
|
||||
} | null)
|
||||
| ({
|
||||
relationTo: 'custom-row-id';
|
||||
value: string | CustomRowId;
|
||||
} | null)
|
||||
| ({
|
||||
relationTo: 'date-fields';
|
||||
value: string | DateField;
|
||||
@@ -2083,42 +2113,257 @@ export interface BlockFieldsSelect<T extends boolean = true> {
|
||||
blocks?:
|
||||
| T
|
||||
| {
|
||||
content?: T | ContentBlockSelect<T>;
|
||||
number?: T | NumberBlockSelect<T>;
|
||||
subBlocks?: T | SubBlocksBlockSelect<T>;
|
||||
tabs?: T | TabsBlockSelect<T>;
|
||||
content?:
|
||||
| T
|
||||
| {
|
||||
text?: T;
|
||||
richText?: T;
|
||||
id?: T;
|
||||
blockName?: T;
|
||||
};
|
||||
number?:
|
||||
| T
|
||||
| {
|
||||
number?: T;
|
||||
id?: T;
|
||||
blockName?: T;
|
||||
};
|
||||
subBlocks?:
|
||||
| T
|
||||
| {
|
||||
subBlocks?:
|
||||
| T
|
||||
| {
|
||||
text?:
|
||||
| T
|
||||
| {
|
||||
text?: T;
|
||||
id?: T;
|
||||
blockName?: T;
|
||||
};
|
||||
number?:
|
||||
| T
|
||||
| {
|
||||
number?: T;
|
||||
id?: T;
|
||||
blockName?: T;
|
||||
};
|
||||
};
|
||||
id?: T;
|
||||
blockName?: T;
|
||||
};
|
||||
tabs?:
|
||||
| T
|
||||
| {
|
||||
textInCollapsible?: T;
|
||||
textInRow?: T;
|
||||
id?: T;
|
||||
blockName?: T;
|
||||
};
|
||||
};
|
||||
duplicate?:
|
||||
| T
|
||||
| {
|
||||
content?: T | ContentBlockSelect<T>;
|
||||
number?: T | NumberBlockSelect<T>;
|
||||
subBlocks?: T | SubBlocksBlockSelect<T>;
|
||||
tabs?: T | TabsBlockSelect<T>;
|
||||
content?:
|
||||
| T
|
||||
| {
|
||||
text?: T;
|
||||
richText?: T;
|
||||
id?: T;
|
||||
blockName?: T;
|
||||
};
|
||||
number?:
|
||||
| T
|
||||
| {
|
||||
number?: T;
|
||||
id?: T;
|
||||
blockName?: T;
|
||||
};
|
||||
subBlocks?:
|
||||
| T
|
||||
| {
|
||||
subBlocks?:
|
||||
| T
|
||||
| {
|
||||
text?:
|
||||
| T
|
||||
| {
|
||||
text?: T;
|
||||
id?: T;
|
||||
blockName?: T;
|
||||
};
|
||||
number?:
|
||||
| T
|
||||
| {
|
||||
number?: T;
|
||||
id?: T;
|
||||
blockName?: T;
|
||||
};
|
||||
};
|
||||
id?: T;
|
||||
blockName?: T;
|
||||
};
|
||||
tabs?:
|
||||
| T
|
||||
| {
|
||||
textInCollapsible?: T;
|
||||
textInRow?: T;
|
||||
id?: T;
|
||||
blockName?: T;
|
||||
};
|
||||
};
|
||||
collapsedByDefaultBlocks?:
|
||||
| T
|
||||
| {
|
||||
localizedContent?: T | LocalizedContentBlockSelect<T>;
|
||||
localizedNumber?: T | LocalizedNumberBlockSelect<T>;
|
||||
localizedSubBlocks?: T | LocalizedSubBlocksBlockSelect<T>;
|
||||
localizedTabs?: T | LocalizedTabsBlockSelect<T>;
|
||||
localizedContent?:
|
||||
| T
|
||||
| {
|
||||
text?: T;
|
||||
richText?: T;
|
||||
id?: T;
|
||||
blockName?: T;
|
||||
};
|
||||
localizedNumber?:
|
||||
| T
|
||||
| {
|
||||
number?: T;
|
||||
id?: T;
|
||||
blockName?: T;
|
||||
};
|
||||
localizedSubBlocks?:
|
||||
| T
|
||||
| {
|
||||
subBlocks?:
|
||||
| T
|
||||
| {
|
||||
text?:
|
||||
| T
|
||||
| {
|
||||
text?: T;
|
||||
id?: T;
|
||||
blockName?: T;
|
||||
};
|
||||
number?:
|
||||
| T
|
||||
| {
|
||||
number?: T;
|
||||
id?: T;
|
||||
blockName?: T;
|
||||
};
|
||||
};
|
||||
id?: T;
|
||||
blockName?: T;
|
||||
};
|
||||
localizedTabs?:
|
||||
| T
|
||||
| {
|
||||
textInCollapsible?: T;
|
||||
textInRow?: T;
|
||||
id?: T;
|
||||
blockName?: T;
|
||||
};
|
||||
};
|
||||
disableSort?:
|
||||
| T
|
||||
| {
|
||||
localizedContent?: T | LocalizedContentBlockSelect<T>;
|
||||
localizedNumber?: T | LocalizedNumberBlockSelect<T>;
|
||||
localizedSubBlocks?: T | LocalizedSubBlocksBlockSelect<T>;
|
||||
localizedTabs?: T | LocalizedTabsBlockSelect<T>;
|
||||
localizedContent?:
|
||||
| T
|
||||
| {
|
||||
text?: T;
|
||||
richText?: T;
|
||||
id?: T;
|
||||
blockName?: T;
|
||||
};
|
||||
localizedNumber?:
|
||||
| T
|
||||
| {
|
||||
number?: T;
|
||||
id?: T;
|
||||
blockName?: T;
|
||||
};
|
||||
localizedSubBlocks?:
|
||||
| T
|
||||
| {
|
||||
subBlocks?:
|
||||
| T
|
||||
| {
|
||||
text?:
|
||||
| T
|
||||
| {
|
||||
text?: T;
|
||||
id?: T;
|
||||
blockName?: T;
|
||||
};
|
||||
number?:
|
||||
| T
|
||||
| {
|
||||
number?: T;
|
||||
id?: T;
|
||||
blockName?: T;
|
||||
};
|
||||
};
|
||||
id?: T;
|
||||
blockName?: T;
|
||||
};
|
||||
localizedTabs?:
|
||||
| T
|
||||
| {
|
||||
textInCollapsible?: T;
|
||||
textInRow?: T;
|
||||
id?: T;
|
||||
blockName?: T;
|
||||
};
|
||||
};
|
||||
localizedBlocks?:
|
||||
| T
|
||||
| {
|
||||
localizedContent?: T | LocalizedContentBlockSelect<T>;
|
||||
localizedNumber?: T | LocalizedNumberBlockSelect<T>;
|
||||
localizedSubBlocks?: T | LocalizedSubBlocksBlockSelect<T>;
|
||||
localizedTabs?: T | LocalizedTabsBlockSelect<T>;
|
||||
localizedContent?:
|
||||
| T
|
||||
| {
|
||||
text?: T;
|
||||
richText?: T;
|
||||
id?: T;
|
||||
blockName?: T;
|
||||
};
|
||||
localizedNumber?:
|
||||
| T
|
||||
| {
|
||||
number?: T;
|
||||
id?: T;
|
||||
blockName?: T;
|
||||
};
|
||||
localizedSubBlocks?:
|
||||
| T
|
||||
| {
|
||||
subBlocks?:
|
||||
| T
|
||||
| {
|
||||
text?:
|
||||
| T
|
||||
| {
|
||||
text?: T;
|
||||
id?: T;
|
||||
blockName?: T;
|
||||
};
|
||||
number?:
|
||||
| T
|
||||
| {
|
||||
number?: T;
|
||||
id?: T;
|
||||
blockName?: T;
|
||||
};
|
||||
};
|
||||
id?: T;
|
||||
blockName?: T;
|
||||
};
|
||||
localizedTabs?:
|
||||
| T
|
||||
| {
|
||||
textInCollapsible?: T;
|
||||
textInRow?: T;
|
||||
id?: T;
|
||||
blockName?: T;
|
||||
};
|
||||
};
|
||||
i18nBlocks?:
|
||||
| T
|
||||
@@ -2256,116 +2501,6 @@ export interface BlockFieldsSelect<T extends boolean = true> {
|
||||
updatedAt?: T;
|
||||
createdAt?: T;
|
||||
}
|
||||
/**
|
||||
* This interface was referenced by `Config`'s JSON-Schema
|
||||
* via the `definition` "ContentBlock_select".
|
||||
*/
|
||||
export interface ContentBlockSelect<T extends boolean = true> {
|
||||
text?: T;
|
||||
richText?: T;
|
||||
id?: T;
|
||||
blockName?: T;
|
||||
}
|
||||
/**
|
||||
* This interface was referenced by `Config`'s JSON-Schema
|
||||
* via the `definition` "NumberBlock_select".
|
||||
*/
|
||||
export interface NumberBlockSelect<T extends boolean = true> {
|
||||
number?: T;
|
||||
id?: T;
|
||||
blockName?: T;
|
||||
}
|
||||
/**
|
||||
* This interface was referenced by `Config`'s JSON-Schema
|
||||
* via the `definition` "SubBlocksBlock_select".
|
||||
*/
|
||||
export interface SubBlocksBlockSelect<T extends boolean = true> {
|
||||
subBlocks?:
|
||||
| T
|
||||
| {
|
||||
text?:
|
||||
| T
|
||||
| {
|
||||
text?: T;
|
||||
id?: T;
|
||||
blockName?: T;
|
||||
};
|
||||
number?:
|
||||
| T
|
||||
| {
|
||||
number?: T;
|
||||
id?: T;
|
||||
blockName?: T;
|
||||
};
|
||||
};
|
||||
id?: T;
|
||||
blockName?: T;
|
||||
}
|
||||
/**
|
||||
* This interface was referenced by `Config`'s JSON-Schema
|
||||
* via the `definition` "TabsBlock_select".
|
||||
*/
|
||||
export interface TabsBlockSelect<T extends boolean = true> {
|
||||
textInCollapsible?: T;
|
||||
textInRow?: T;
|
||||
id?: T;
|
||||
blockName?: T;
|
||||
}
|
||||
/**
|
||||
* This interface was referenced by `Config`'s JSON-Schema
|
||||
* via the `definition` "localizedContentBlock_select".
|
||||
*/
|
||||
export interface LocalizedContentBlockSelect<T extends boolean = true> {
|
||||
text?: T;
|
||||
richText?: T;
|
||||
id?: T;
|
||||
blockName?: T;
|
||||
}
|
||||
/**
|
||||
* This interface was referenced by `Config`'s JSON-Schema
|
||||
* via the `definition` "localizedNumberBlock_select".
|
||||
*/
|
||||
export interface LocalizedNumberBlockSelect<T extends boolean = true> {
|
||||
number?: T;
|
||||
id?: T;
|
||||
blockName?: T;
|
||||
}
|
||||
/**
|
||||
* This interface was referenced by `Config`'s JSON-Schema
|
||||
* via the `definition` "localizedSubBlocksBlock_select".
|
||||
*/
|
||||
export interface LocalizedSubBlocksBlockSelect<T extends boolean = true> {
|
||||
subBlocks?:
|
||||
| T
|
||||
| {
|
||||
text?:
|
||||
| T
|
||||
| {
|
||||
text?: T;
|
||||
id?: T;
|
||||
blockName?: T;
|
||||
};
|
||||
number?:
|
||||
| T
|
||||
| {
|
||||
number?: T;
|
||||
id?: T;
|
||||
blockName?: T;
|
||||
};
|
||||
};
|
||||
id?: T;
|
||||
blockName?: T;
|
||||
}
|
||||
/**
|
||||
* This interface was referenced by `Config`'s JSON-Schema
|
||||
* via the `definition` "localizedTabsBlock_select".
|
||||
*/
|
||||
export interface LocalizedTabsBlockSelect<T extends boolean = true> {
|
||||
textInCollapsible?: T;
|
||||
textInRow?: T;
|
||||
id?: T;
|
||||
blockName?: T;
|
||||
}
|
||||
/**
|
||||
* This interface was referenced by `Config`'s JSON-Schema
|
||||
* via the `definition` "checkbox-fields_select".
|
||||
@@ -2491,6 +2626,24 @@ export interface CustomIdSelect<T extends boolean = true> {
|
||||
updatedAt?: T;
|
||||
createdAt?: T;
|
||||
}
|
||||
/**
|
||||
* This interface was referenced by `Config`'s JSON-Schema
|
||||
* via the `definition` "custom-tab-id_select".
|
||||
*/
|
||||
export interface CustomTabIdSelect<T extends boolean = true> {
|
||||
id?: T;
|
||||
updatedAt?: T;
|
||||
createdAt?: T;
|
||||
}
|
||||
/**
|
||||
* This interface was referenced by `Config`'s JSON-Schema
|
||||
* via the `definition` "custom-row-id_select".
|
||||
*/
|
||||
export interface CustomRowIdSelect<T extends boolean = true> {
|
||||
id?: T;
|
||||
updatedAt?: T;
|
||||
createdAt?: T;
|
||||
}
|
||||
/**
|
||||
* This interface was referenced by `Config`'s JSON-Schema
|
||||
* via the `definition` "date-fields_select".
|
||||
@@ -2928,10 +3081,53 @@ export interface TabsFieldsSelect<T extends boolean = true> {
|
||||
blocks?:
|
||||
| T
|
||||
| {
|
||||
content?: T | ContentBlockSelect<T>;
|
||||
number?: T | NumberBlockSelect<T>;
|
||||
subBlocks?: T | SubBlocksBlockSelect<T>;
|
||||
tabs?: T | TabsBlockSelect<T>;
|
||||
content?:
|
||||
| T
|
||||
| {
|
||||
text?: T;
|
||||
richText?: T;
|
||||
id?: T;
|
||||
blockName?: T;
|
||||
};
|
||||
number?:
|
||||
| T
|
||||
| {
|
||||
number?: T;
|
||||
id?: T;
|
||||
blockName?: T;
|
||||
};
|
||||
subBlocks?:
|
||||
| T
|
||||
| {
|
||||
subBlocks?:
|
||||
| T
|
||||
| {
|
||||
text?:
|
||||
| T
|
||||
| {
|
||||
text?: T;
|
||||
id?: T;
|
||||
blockName?: T;
|
||||
};
|
||||
number?:
|
||||
| T
|
||||
| {
|
||||
number?: T;
|
||||
id?: T;
|
||||
blockName?: T;
|
||||
};
|
||||
};
|
||||
id?: T;
|
||||
blockName?: T;
|
||||
};
|
||||
tabs?:
|
||||
| T
|
||||
| {
|
||||
textInCollapsible?: T;
|
||||
textInRow?: T;
|
||||
id?: T;
|
||||
blockName?: T;
|
||||
};
|
||||
};
|
||||
group?:
|
||||
| T
|
||||
@@ -2941,7 +3137,24 @@ export interface TabsFieldsSelect<T extends boolean = true> {
|
||||
textInRow?: T;
|
||||
numberInRow?: T;
|
||||
json?: T;
|
||||
tab?: T | TabWithNameSelect<T>;
|
||||
tab?:
|
||||
| T
|
||||
| {
|
||||
array?:
|
||||
| T
|
||||
| {
|
||||
text?: T;
|
||||
id?: T;
|
||||
};
|
||||
text?: T;
|
||||
defaultValue?: T;
|
||||
arrayInRow?:
|
||||
| T
|
||||
| {
|
||||
textInArrayInRow?: T;
|
||||
id?: T;
|
||||
};
|
||||
};
|
||||
namedTabWithDefaultValue?:
|
||||
| T
|
||||
| {
|
||||
@@ -2991,26 +3204,6 @@ export interface TabsFieldsSelect<T extends boolean = true> {
|
||||
updatedAt?: T;
|
||||
createdAt?: T;
|
||||
}
|
||||
/**
|
||||
* This interface was referenced by `Config`'s JSON-Schema
|
||||
* via the `definition` "TabWithName_select".
|
||||
*/
|
||||
export interface TabWithNameSelect<T extends boolean = true> {
|
||||
array?:
|
||||
| T
|
||||
| {
|
||||
text?: T;
|
||||
id?: T;
|
||||
};
|
||||
text?: T;
|
||||
defaultValue?: T;
|
||||
arrayInRow?:
|
||||
| T
|
||||
| {
|
||||
textInArrayInRow?: T;
|
||||
id?: T;
|
||||
};
|
||||
}
|
||||
/**
|
||||
* This interface was referenced by `Config`'s JSON-Schema
|
||||
* via the `definition` "text-fields_select".
|
||||
|
||||
@@ -11,6 +11,7 @@ import { blocksDoc } from './collections/Blocks/shared.js'
|
||||
import { codeDoc } from './collections/Code/shared.js'
|
||||
import { collapsibleDoc } from './collections/Collapsible/shared.js'
|
||||
import { conditionalLogicDoc } from './collections/ConditionalLogic/shared.js'
|
||||
import { customRowID, customTabID, nonStandardID } from './collections/CustomID/shared.js'
|
||||
import { dateDoc } from './collections/Date/shared.js'
|
||||
import { anotherEmailDoc, emailDoc } from './collections/Email/shared.js'
|
||||
import { groupDoc } from './collections/Group/shared.js'
|
||||
@@ -34,6 +35,9 @@ import {
|
||||
collapsibleFieldsSlug,
|
||||
collectionSlugs,
|
||||
conditionalLogicSlug,
|
||||
customIDSlug,
|
||||
customRowIDSlug,
|
||||
customTabIDSlug,
|
||||
dateFieldsSlug,
|
||||
emailFieldsSlug,
|
||||
groupFieldsSlug,
|
||||
@@ -491,6 +495,27 @@ export const seed = async (_payload: Payload) => {
|
||||
],
|
||||
},
|
||||
})
|
||||
|
||||
await Promise.all([
|
||||
_payload.create({
|
||||
collection: customIDSlug,
|
||||
data: {
|
||||
id: nonStandardID,
|
||||
},
|
||||
}),
|
||||
_payload.create({
|
||||
collection: customTabIDSlug,
|
||||
data: {
|
||||
id: customTabID,
|
||||
},
|
||||
}),
|
||||
_payload.create({
|
||||
collection: customRowIDSlug,
|
||||
data: {
|
||||
id: customRowID,
|
||||
},
|
||||
}),
|
||||
])
|
||||
}
|
||||
|
||||
export async function clearAndSeedEverything(_payload: Payload) {
|
||||
|
||||
@@ -5,7 +5,9 @@ export const checkboxFieldsSlug = 'checkbox-fields'
|
||||
export const codeFieldsSlug = 'code-fields'
|
||||
export const collapsibleFieldsSlug = 'collapsible-fields'
|
||||
export const conditionalLogicSlug = 'conditional-logic'
|
||||
export const customIdSlug = 'custom-id'
|
||||
export const customIDSlug = 'custom-id'
|
||||
export const customRowIDSlug = 'custom-row-id'
|
||||
export const customTabIDSlug = 'custom-tab-id'
|
||||
export const dateFieldsSlug = 'date-fields'
|
||||
export const emailFieldsSlug = 'email-fields'
|
||||
export const groupFieldsSlug = 'group-fields'
|
||||
|
||||
Reference in New Issue
Block a user