Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds fieldPosition to ui.itemView allowing fields to be moved to the sidebar #8075

Merged
merged 14 commits into from
Nov 10, 2022
Prev Previous commit
Next Next commit
add testing example to sandbox
  • Loading branch information
dcousens committed Nov 10, 2022
commit 0d2a8a7c1927b7ad992b99921ee0cbacc56fb3fc
29 changes: 29 additions & 0 deletions tests/sandbox/configs/all-the-things.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,35 @@ export const lists = {
{ value: 'three', label: 'Three' },
],
}),
selectOnSide: select({
ui: {
description,
itemView: {
fieldPosition: 'sidebar',
},
},
options: [
{ value: 'one', label: 'One' },
{ value: 'two', label: 'Two' },
{ value: 'three', label: 'Three' },
],
}),
selectOnSideItemViewOnly: select({
ui: {
description,
createView: {
fieldMode: 'hidden',
},
itemView: {
fieldPosition: 'sidebar',
},
},
options: [
{ value: 'one', label: 'One' },
{ value: 'two', label: 'Two' },
{ value: 'three', label: 'Three' },
],
}),
selectSegmentedControl: select({
options: [
{ value: 'one', label: 'One' },
Expand Down
10 changes: 10 additions & 0 deletions tests/sandbox/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ type Thing {
calendarDay: CalendarDay
randomNumberVirtual: Float
select: String
selectOnSide: String
selectOnSideItemViewOnly: String
selectSegmentedControl: String
multiselect: [String!]
json: JSON
Expand Down Expand Up @@ -82,6 +84,8 @@ input ThingWhereInput {
timestamp: DateTimeNullableFilter
calendarDay: CalendarDayNullableFilter
select: StringNullableFilter
selectOnSide: StringNullableFilter
selectOnSideItemViewOnly: StringNullableFilter
selectSegmentedControl: StringNullableFilter
integer: IntNullableFilter
bigInt: BigIntNullableFilter
Expand Down Expand Up @@ -232,6 +236,8 @@ input ThingOrderByInput {
timestamp: OrderDirection
calendarDay: OrderDirection
select: OrderDirection
selectOnSide: OrderDirection
selectOnSideItemViewOnly: OrderDirection
selectSegmentedControl: OrderDirection
integer: OrderDirection
bigInt: OrderDirection
Expand All @@ -254,6 +260,8 @@ input ThingUpdateInput {
timestamp: DateTime
calendarDay: CalendarDay
select: String
selectOnSide: String
selectOnSideItemViewOnly: String
selectSegmentedControl: String
multiselect: [String!]
json: JSON
Expand Down Expand Up @@ -305,6 +313,8 @@ input ThingCreateInput {
timestamp: DateTime
calendarDay: CalendarDay
select: String
selectOnSide: String
selectOnSideItemViewOnly: String
selectSegmentedControl: String
multiselect: [String!]
json: JSON
Expand Down
56 changes: 29 additions & 27 deletions tests/sandbox/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -13,33 +13,35 @@ generator client {
}

model Thing {
id String @id @default(cuid())
checkbox Boolean @default(false)
password String?
toOneRelationship User? @relation("Thing_toOneRelationship", fields: [toOneRelationshipId], references: [id])
toOneRelationshipId String? @map("toOneRelationship")
toManyRelationship Todo[] @relation("Thing_toManyRelationship")
toOneRelationshipCard User? @relation("Thing_toOneRelationshipCard", fields: [toOneRelationshipCardId], references: [id])
toOneRelationshipCardId String? @map("toOneRelationshipCard")
toManyRelationshipCard Todo[] @relation("Thing_toManyRelationshipCard")
text String @default("")
timestamp DateTime?
calendarDay String?
select String?
selectSegmentedControl String?
multiselect String @default("[]")
json String?
integer Int?
bigInt BigInt?
float Float?
image_filesize Int?
image_extension String?
image_width Int?
image_height Int?
image_id String?
file_filesize Int?
file_filename String?
document String @default("[{\"type\":\"paragraph\",\"children\":[{\"text\":\"\"}]}]")
id String @id @default(cuid())
checkbox Boolean @default(false)
password String?
toOneRelationship User? @relation("Thing_toOneRelationship", fields: [toOneRelationshipId], references: [id])
toOneRelationshipId String? @map("toOneRelationship")
toManyRelationship Todo[] @relation("Thing_toManyRelationship")
toOneRelationshipCard User? @relation("Thing_toOneRelationshipCard", fields: [toOneRelationshipCardId], references: [id])
toOneRelationshipCardId String? @map("toOneRelationshipCard")
toManyRelationshipCard Todo[] @relation("Thing_toManyRelationshipCard")
text String @default("")
timestamp DateTime?
calendarDay String?
select String?
selectOnSide String?
selectOnSideItemViewOnly String?
selectSegmentedControl String?
multiselect String @default("[]")
json String?
integer Int?
bigInt BigInt?
float Float?
image_filesize Int?
image_extension String?
image_width Int?
image_height Int?
image_id String?
file_filesize Int?
file_filename String?
document String @default("[{\"type\":\"paragraph\",\"children\":[{\"text\":\"\"}]}]")

@@index([toOneRelationshipId])
@@index([toOneRelationshipCardId])
Expand Down