You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-`actionMode` (default: `'enabled'`): Can be `'enabled'`, `'disabled'`, or `'hidden'`, or a function that returns one of those values.
137
+
-`actionMode` (default: `'enabled'`): Can be `'enabled'`, `'disabled'`, or `'hidden'`, a conditional filter object, or a function that returns one of those values. Conditional filter objects can combine field predicates with nested `AND`, `OR`, and `NOT` groups.
122
138
-`navigation` (default: `'follow'`): Controls navigation after the action completes. `'follow'` navigates to the returned item (or list view if `null`), `'refetch'` stays and refreshes the item, `'return'` goes back to the list view.
123
139
-`hidePrompt` (default: `false`): Do not show a confirmation dialog.
124
140
-`hideToast` (default: `false`): Do not show a toast notification.
125
141
-`listView`: Controls for the list view.
126
-
-`actionMode` (default: `'enabled'`): Can be `'enabled'` or `'hidden'`, or a function that returns one of those values.
142
+
-`actionMode` (default: `'enabled'`): Can be `'enabled'` or `'hidden'`, a conditional filter object, or a function that returns one of those values. Conditional filter objects can combine field predicates with nested `AND`, `OR`, and `NOT` groups.
127
143
128
144
## access
129
145
@@ -169,7 +185,7 @@ Options:
169
185
Option `field` is the name of the field to sort by, and `direction` is either `'ASC'` or `'DESC'` for ascending and descending sorting respectively.
170
186
If undefined then data will be unsorted.
171
187
-`pageSize` (default: lower of `50` or [`graphql.maxTake`](#graphql)): Sets the number of items to show per page in the list view.
172
-
-`initialFilter` (default: `undefined`): Sets a default filter to apply to the list view. Accepts a where input object (excluding `AND`, `OR`, `NOT`), or an async function with an argument `{ session, context }` that returns a where input object.
188
+
-`initialFilter` (default: `undefined`): Sets a default column filter to apply to the list view. Accepts a where input object (excluding `AND`, `OR`, `NOT`), or an async function with an argument `{ session, context }` that returns a where input object.
173
189
-`label`: The label used to identify the list in navigation etc.
174
190
-`singular`: The singular form of the list key. It is used in sentences like `Are you sure you want to delete this {singular}?`
175
191
-`plural`: The plural form of the list key. It is used in sentences like `Are you sure you want to delete these {plural}?`
@@ -243,7 +259,7 @@ Options:
243
259
-`omit.delete` (default: `false`): If set to true, the delete mutation will be omitted from the GraphQL API for this list.
244
260
245
261
```typescript
246
-
import { config, list } from'@keystone-6/core';
262
+
import { config, list } from'@keystone-6/core'
247
263
248
264
exportdefaultconfig({
249
265
lists: {
@@ -266,7 +282,7 @@ export default config({
266
282
/* ... */
267
283
},
268
284
/* ... */
269
-
});
285
+
})
270
286
```
271
287
272
288
## db
@@ -281,7 +297,7 @@ Options:
281
297
-`map`: Adds a [Prisma `@@map`](https://www.prisma.io/docs/reference/api-reference/prisma-schema-reference#map-1) attribute to the Prisma model for this list which specifies a custom database table name for the list, instead of using the list key
Defaults to the list's `ui.itemView.defaultFieldMode` config if defined.
93
95
See the [Lists API](../config/lists#ui) for details.
94
96
-`itemView.fieldPosition` (default: `form`): Controls which side of the page the field is placed in the Admin UI.
95
-
Can be either `form` or `sidebar`, or an async function with an argument `{ session, context, listKey, fieldKey, item, itemField }` that returns one of `['form', 'sidebar']`. The `item` argument may be `null`. `form` or blank places the field on the left hand side of the item view. `sidebar` places the field on the right hand side under the ID field
97
+
Can be either `form` or `sidebar`, or an async function with an argument `{ session, context, listKey, fieldKey, item, itemField }` that returns one of `['form', 'sidebar']`. The `item` argument may be `null`. `form` or blank places the field on the left hand side of the item view. `sidebar` places the field on the right hand side under the ID field
96
98
-`itemView.isRequired` (default: `undefined`): Controls whether the field is marked as required in the item view. Can be a boolean or an async function with an argument `{ session, context }` that returns a boolean. When `true`, the Admin UI will show the field as required.
97
99
-`listView.fieldMode` (default: `'read'`): Controls the list view page of the Admin UI.
98
100
Can be one of `['read', 'hidden']`, or an async function with an argument `{ session, context }` that returns one of `['read', 'hidden']`.
@@ -115,6 +117,8 @@ Options:
115
117
-`omit.create` (default: `false`): If you specify `true`, then the field will be excluded from the list's CreateInput GraphQL type.
116
118
-`omit.update` (default: `false`): If you specify `true`, then the field will be excluded from the list's UpdateInput GraphQL type.
117
119
120
+
For Admin UI conditional config such as `fieldMode` and `isRequired`, filter objects can combine field predicates with nested `AND`, `OR`, and `NOT` groups. These are evaluated client-side in the Admin UI and do not change the GraphQL `where` input API.
Fields can be grouped together in the Admin UI using the `group` function, with a customisable `label` and `description`.
162
175
163
176
```typescript
164
-
import { config, list, group } from'@keystone-6/core';
165
-
import { text } from'@keystone-6/core/fields';
177
+
import { config, list, group } from'@keystone-6/core'
178
+
import { text } from'@keystone-6/core/fields'
166
179
167
180
exportdefaultconfig({
168
181
lists: {
@@ -172,7 +185,9 @@ export default config({
172
185
label: 'Group label',
173
186
description: 'Group description',
174
187
fields: {
175
-
someFieldName: text({ /* ... */ }),
188
+
someFieldName: text({
189
+
/* ... */
190
+
}),
176
191
/* ... */
177
192
},
178
193
}),
@@ -182,7 +197,7 @@ export default config({
182
197
/* ... */
183
198
},
184
199
/* ... */
185
-
});
200
+
})
186
201
```
187
202
188
203
Groups also support `defaultFieldMode` overrides for `createView`, `itemView`, and `listView`, which apply to all fields within the group unless overridden at the field level:
0 commit comments