-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ReviewEntries] Persist column order/visibility state in project (#3309)
- Loading branch information
1 parent
f08ded3
commit 6bbfc5b
Showing
5 changed files
with
126 additions
and
35 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
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 |
---|---|---|
@@ -1,15 +1,27 @@ | ||
import { | ||
type MRT_ColumnOrderState, | ||
type MRT_VisibilityState, | ||
} from "material-react-table"; | ||
|
||
import { type Project, type Speaker, type User } from "api/models"; | ||
import { type Hash } from "types/hash"; | ||
import { newProject } from "types/project"; | ||
|
||
export interface CurrentProjectState { | ||
project: Project; | ||
/** For project-level persistance of ReviewEntriesTable's managed states | ||
* per https://www.material-react-table.com/docs/guides/state-management */ | ||
reviewEntriesColumns: { | ||
columnOrder: MRT_ColumnOrderState; | ||
columnVisibility: MRT_VisibilityState; | ||
}; | ||
semanticDomains?: Hash<string>; | ||
speaker?: Speaker; | ||
users: User[]; | ||
} | ||
|
||
export const defaultState: CurrentProjectState = { | ||
project: newProject(), | ||
reviewEntriesColumns: { columnOrder: [], columnVisibility: {} }, | ||
users: [], | ||
}; |
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