piccolo-orm / piccolo_admin

A powerful web admin for your database.
https://piccolo-orm.com/ecosystem/
MIT License
322 stars 39 forks source link

Fix regression with nullable boolean columns in filter sidebar #339

Closed dantownsend closed 1 year ago

dantownsend commented 1 year ago

We had this issue in the past, and it was fixed, but has resurfaced in Piccolo Admin v1.

It's because of the JSON schema changes in Pydantic v2.

This approach for checking the type of a column no longer works:

https://github.com/piccolo-orm/piccolo_admin/blob/d527b37332306812cf67502e381d4eec34eb6c95/admin_ui/src/components/FilterForm.vue#L77

We need to use the getType helper function in interfaces.ts instead.

As part of this, we need to add a Playwright test to make sure that these fields are defaulting to all and not null in the filter sidebar.