2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-18 18:56:31 +00:00

Table default cols (#9868)

* Work in progress

- Seems to reset the columns on page refresh
- Probably related to the useLocalStorage hook

* Do not overwrite until the tablestate is loaded

* Prevent table fetch until data has been loaded from localStorage

* Improved persistance

* Adjust default column visibility

* Adjust playwright test
This commit is contained in:
Oliver
2025-06-26 15:27:26 +10:00
committed by GitHub
parent 8b4f9efa44
commit c283beedb3
21 changed files with 197 additions and 72 deletions

View File

@@ -52,7 +52,7 @@ export type TableState = {
hasSelectedRecords: boolean;
setSelectedRecords: (records: any[]) => void;
clearSelectedRecords: () => void;
hiddenColumns: string[];
hiddenColumns: string[] | null;
setHiddenColumns: (columns: string[]) => void;
searchTerm: string;
setSearchTerm: (term: string) => void;
@@ -62,6 +62,7 @@ export type TableState = {
setPage: (page: number) => void;
pageSize: number;
setPageSize: (pageSize: number) => void;
storedDataLoaded: boolean;
records: any[];
setRecords: (records: any[]) => void;
updateRecord: (record: any) => void;