feat: relationship sortOptions property (#4301)

* feat: adds sortOptions property to relationship field

* chore: fix lexical int tests

* feat: simplifies logic & updates joi schema definition

* feat: revert to default when searching in relationship select

* fix types and joi schema

* type adjustments

---------

Co-authored-by: Alessio Gravili <alessio@bonfireleads.com>
Co-authored-by: Jarrod Flesch <jarrodmflesch@gmail.com>
This commit is contained in:
Patrik
2023-11-29 16:22:47 -05:00
committed by GitHub
parent 3502ce720b
commit 224cddd045
15 changed files with 176 additions and 27 deletions

View File

@@ -10,6 +10,11 @@ const ArrayFields: CollectionConfig = {
enableRichTextLink: false,
},
fields: [
{
name: 'title',
type: 'text',
required: false,
},
{
name: 'items',
defaultValue: arrayDefaultValue,

View File

@@ -1,6 +1,7 @@
import type { ArrayField } from '../../payload-types'
export const arrayDoc: Partial<ArrayField> = {
title: 'array doc 1',
items: [
{
text: 'first row',
@@ -35,3 +36,31 @@ export const arrayDoc: Partial<ArrayField> = {
},
],
}
export const anotherArrayDoc: Partial<ArrayField> = {
title: 'array doc 2',
items: [
{
text: 'first row',
},
{
text: 'second row',
},
{
text: 'third row',
},
],
collapsedArray: [
{
text: 'initialize collapsed',
},
],
arrayWithMinRows: [
{
text: 'first row',
},
{
text: 'second row',
},
],
}