feat(dashboard): DataGrid improvements [4/4] (#8798)

**What**
- Changes cell state strategy from tracking from lazy to eager. This has required some changes to the API of the DataGrid component, and createDataGridColumnHelper function.
- Displays error messages in both affected cells and their rows. The row indicator also provides an option to quickly jump to an error.
- Allows the user to hide all rows and columns that don't have errors, to help quickly get an overview of the errors in a large grid.
- The first column of a DataGrid is now pinned, making it easier for a user to tell which entity they are editing.
- Fixes and improvements to column visibility menu.
- Adds a shortcuts modal that explains the different available keyboard commands.
- Updates `@tanstack/react-table` to the latest version.

Resolves CC-269
This commit is contained in:
Kasper Fabricius Kristensen
2024-08-28 19:06:38 +00:00
committed by GitHub
parent d8fdf4d0b2
commit b8572165cb
68 changed files with 4116 additions and 2381 deletions
@@ -30,15 +30,17 @@ export function transformNullableFormData<
}, {} as K extends true ? Nullable<T> : Optional<T>)
}
export function transformNullableFormNumber(
export function transformNullableFormNumber<K extends boolean = true>(
value?: string | number,
nullify = true
) {
nullify: K = true as K
): K extends true ? number | null : number | undefined {
if (
typeof value === "undefined" ||
(typeof value === "string" && value.trim() === "")
) {
return nullify ? null : undefined
return (nullify ? null : undefined) as K extends true
? number | null
: number | undefined
}
if (typeof value === "string") {