-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add default value to track table and cache filters (#1991)
- Loading branch information
1 parent
8ed4151
commit f0ca71f
Showing
6 changed files
with
74 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
epictrack-web/src/components/shared/MasterTrackTable/FiltersCache.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import React, { useEffect } from "react"; | ||
import { MRT_TableInstance, MRT_RowData } from "material-react-table"; | ||
|
||
export const FiltersCache = <TData extends MRT_RowData>({ | ||
cacheFilters, | ||
table, | ||
}: { | ||
cacheFilters: (columnFilters: any) => void; | ||
table: MRT_TableInstance<TData>; | ||
}) => { | ||
useEffect(() => { | ||
cacheFilters(table.getState().columnFilters); | ||
}, [table.getState().columnFilters]); | ||
return null; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export const All_WORKS_FILTERS_CACHE_KEY = "all-works-filters"; |