fix(ui): removes array & blocks & group fields from sort (#6576)

## Description

V2 PR [here](https://github.com/payloadcms/payload/pull/6574)

- [x] I have read and understand the
[CONTRIBUTING.md](https://github.com/payloadcms/payload/blob/main/CONTRIBUTING.md)
document in this repository.

## Type of change

- [x] Bug fix (non-breaking change which fixes an issue)

## Checklist:

- [x] Existing test suite passes locally with my changes
This commit is contained in:
Patrik
2024-06-10 14:09:50 -04:00
committed by GitHub
parent 7309d474ee
commit 9f525621c8

View File

@@ -110,14 +110,15 @@ export const buildColumnState = (args: Args): Column[] => {
/>
)
const fieldAffectsDataSubFields =
field &&
field.type &&
(field.type === 'array' || field.type === 'group' || field.type === 'blocks')
const Heading = (
<SortColumn
Label={Label}
disable={
('disableSort' in field && Boolean(field.disableSort)) ||
fieldIsPresentationalOnly(field) ||
undefined
}
disable={fieldAffectsDataSubFields || fieldIsPresentationalOnly(field) || undefined}
// eslint-disable-next-line react/jsx-no-duplicate-props
label={
'fieldComponentProps' in field && 'label' in field.fieldComponentProps