Skip to content

Commit 1aab74b

Browse files
authored
Add table column filter support for JSON type (#1747)
1 parent ff15fd7 commit 1aab74b

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/Table/Column/FilterModel.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@ public static function factoryType(App $app, Field $field): self
6565
Types::DATETIME_MUTABLE => FilterModel\TypeDatetime::class,
6666
Types::DATETIME_IMMUTABLE => FilterModel\TypeDatetime::class,
6767

68+
Types::JSON => FilterModel\TypeString::class,
69+
Types::OBJECT => FilterModel\TypeString::class,
70+
6871
'TODO we do not support enum type, any type can be enum' => FilterModel\TypeEnum::class,
6972
][$field->type ?? 'string'];
7073

src/Table/Column/FilterModel/TypeString.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ protected function init(): void
1313
{
1414
parent::init();
1515

16-
$this->op->values = ['is' => 'Is', 'contains' => 'Contains', 'start' => 'Start with', 'end' => 'End with'];
16+
$this->op->values = ['is' => 'Is', 'is not' => 'Is Not', 'contains' => 'Contains', 'start' => 'Start with', 'end' => 'End with'];
1717
$this->op->default = 'is';
1818
}
1919

0 commit comments

Comments
 (0)