enable date filtering
This commit is contained in:
parent
36a37d1ea5
commit
7479369abd
|
@ -9,7 +9,7 @@
|
|||
:place_city "",
|
||||
:contact_phone nil,
|
||||
:place_zip "",
|
||||
:time_from_str "",
|
||||
:time_from_str "10/04/2022",
|
||||
:place_country "",
|
||||
:animals_present false,
|
||||
:languages (),
|
||||
|
@ -26,7 +26,7 @@
|
|||
:place_city "",
|
||||
:contact_phone nil,
|
||||
:place_zip "",
|
||||
:time_from_str "",
|
||||
:time_from_str "03/04/2022",
|
||||
:place_country nil,
|
||||
:animals_present true,
|
||||
:languages (),
|
||||
|
@ -43,7 +43,7 @@
|
|||
:place_city nil,
|
||||
:contact_phone "Q",
|
||||
:place_zip "RD",
|
||||
:time_from_str "q",
|
||||
:time_from_str "03/04/2022",
|
||||
:place_country nil,
|
||||
:animals_present true,
|
||||
:languages (),
|
||||
|
@ -60,7 +60,7 @@
|
|||
:place_city "1bh",
|
||||
:contact_phone nil,
|
||||
:place_zip "PG4",
|
||||
:time_from_str "8az",
|
||||
:time_from_str "03/04/2022",
|
||||
:place_country "I7",
|
||||
:animals_present false,
|
||||
:languages ("x" "ni"),
|
||||
|
@ -77,7 +77,7 @@
|
|||
:place_city "x",
|
||||
:contact_phone "w8l",
|
||||
:place_zip "1E",
|
||||
:time_from_str "6",
|
||||
:time_from_str "01/01/2022",
|
||||
:place_country "8",
|
||||
:animals_present nil,
|
||||
:languages (),
|
||||
|
@ -94,7 +94,7 @@
|
|||
:place_city "6",
|
||||
:contact_phone "OI",
|
||||
:place_zip "1",
|
||||
:time_from_str "hS192",
|
||||
:time_from_str "03/04/2022",
|
||||
:place_country "",
|
||||
:animals_present false,
|
||||
:languages ("DX" "E" "G3wuv"),
|
||||
|
@ -111,7 +111,7 @@
|
|||
:place_city "cj1A2",
|
||||
:contact_phone "r",
|
||||
:place_zip "cJ9z7",
|
||||
:time_from_str "",
|
||||
:time_from_str "03/04/2022",
|
||||
:place_country "5",
|
||||
:animals_present true,
|
||||
:languages nil,
|
||||
|
@ -128,7 +128,7 @@
|
|||
:place_city "4ML4yG",
|
||||
:contact_phone "7uQ3Px",
|
||||
:place_zip "kp5IS",
|
||||
:time_from_str "Y5lSe",
|
||||
:time_from_str "03/04/2022",
|
||||
:place_country nil,
|
||||
:animals_present true,
|
||||
:languages (),
|
||||
|
@ -145,7 +145,7 @@
|
|||
:place_city "u6k41v",
|
||||
:contact_phone "354VW",
|
||||
:place_zip "DI19",
|
||||
:time_from_str "Z0QGzI8",
|
||||
:time_from_str "09/04/2022",
|
||||
:place_country nil,
|
||||
:animals_present true,
|
||||
:languages nil,
|
||||
|
@ -162,7 +162,7 @@
|
|||
:place_city "f",
|
||||
:contact_phone "sQdB",
|
||||
:place_zip "cid1",
|
||||
:time_from_str "KSAFC",
|
||||
:time_from_str "03/05/2022",
|
||||
:place_country "toTz5B",
|
||||
:animals_present false,
|
||||
:languages ("vMR0zyECr"),
|
||||
|
|
|
@ -8,6 +8,9 @@ import BoolFilter from '@inovua/reactdatagrid-community/BoolFilter'
|
|||
import {GetOffersQuery} from "../../codegen/generates";
|
||||
import {TypeColumn, TypeFilterValue, TypeSingleFilterValue} from "@inovua/reactdatagrid-community/types";
|
||||
import NumberFilter from "@inovua/reactdatagrid-community/NumberFilter";
|
||||
import moment from "moment";
|
||||
|
||||
global.moment = moment
|
||||
|
||||
type HostOfferLookupTableProps = {
|
||||
data: GetOffersQuery
|
||||
|
@ -111,7 +114,7 @@ const operatorsForType = {
|
|||
const columns: TypeColumn[] = columnsRaw
|
||||
.map(c => ({
|
||||
...c,
|
||||
filterEditor: filterMappings[c.type as 'string' | 'number' | 'boolean']
|
||||
filterEditor: filterMappings[c.type as 'string' | 'number' | 'boolean' | 'date']
|
||||
}))
|
||||
|
||||
const defaultFilterValue: TypeFilterValue = columns
|
||||
|
@ -132,8 +135,7 @@ const makeColumnDefinition = (data: any ) => Object.keys(data)
|
|||
type: typeof data[k]}))
|
||||
|
||||
const HostOfferLookupTable = ({ data }: HostOfferLookupTableProps) => {
|
||||
console.log({columns})
|
||||
const dataSource = data.get_offers?.map((d, index) => ({...d, id: index})) || []
|
||||
const dataSource = data.get_offers || []
|
||||
return <>
|
||||
<DataGrid
|
||||
idProperty="id"
|
||||
|
|
Loading…
Reference in New Issue