Skip to content

Commit cb7a24a

Browse files
authored
fix(ui): undefined access with polymorphic joins and fix joins test config (#14057)
Currently integration / e2e tests on `main` fail because of this PR #12738
1 parent 1e23882 commit cb7a24a

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

packages/ui/src/utilities/getColumns.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export const getColumns = ({
5656
)
5757
: getInitialColumns(
5858
isPolymorphic ? fields : filterFields(fields),
59-
collectionConfig.admin?.useAsTitle,
59+
collectionConfig?.admin?.useAsTitle,
6060
isPolymorphic ? [] : collectionConfig?.admin?.defaultColumns,
6161
)
6262
}

test/joins/collections/Categories.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@ import type { CollectionConfig } from 'payload'
22

33
import { ValidationError } from 'payload'
44

5-
import { categoriesSlug, hiddenPostsSlug, postsSlug } from '../shared.js'
5+
import { categoriesSlug, hiddenPostsSlug, postsSlug, versionsSlug } from '../shared.js'
66
import { singularSlug } from './Singular.js'
7-
import { versionsSlug } from './Versions.js'
87

98
export const Categories: CollectionConfig = {
109
slug: categoriesSlug,

test/joins/e2e.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ describe('Join Field', () => {
429429
await expect(joinField).toBeVisible()
430430

431431
const editButton = joinField.locator(
432-
'tbody tr:first-child td:nth-child(2) button.drawer-link__doc-drawer-toggler',
432+
'tbody tr:first-child td:nth-child(1) button.drawer-link__doc-drawer-toggler',
433433
)
434434

435435
await expect(editButton).toBeVisible()

0 commit comments

Comments
 (0)