Skip to content

Commit 7ffe3d6

Browse files
committed
feat(view): enhance ListViewSchema to support filterable fields and update documentation
1 parent 34367af commit 7ffe3d6

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

packages/spec/src/ui/view.test.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,16 @@ describe('ListViewSchema', () => {
253253
expect(() => ListViewSchema.parse(listView)).not.toThrow();
254254
});
255255

256+
it('should accept list view with top filter fields', () => {
257+
const listView: ListView = {
258+
type: 'grid',
259+
columns: ['name', 'status'],
260+
filterableFields: ['status', 'category', 'owner'],
261+
};
262+
263+
expect(() => ListViewSchema.parse(listView)).not.toThrow();
264+
});
265+
256266
it('should accept kanban view with config', () => {
257267
const kanbanView: ListView = {
258268
type: 'kanban',

packages/spec/src/ui/view.zod.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,9 @@ export const ListViewSchema = z.object({
193193
}))
194194
]).optional(),
195195

196-
/** Search */
196+
/** Search & Filter */
197197
searchableFields: z.array(z.string()).optional().describe('Fields enabled for search'),
198+
filterableFields: z.array(z.string()).optional().describe('Fields enabled for end-user filtering in the top bar'),
198199

199200
/** Grid Features */
200201
resizable: z.boolean().optional().describe('Enable column resizing'),

0 commit comments

Comments
 (0)