refactor: block writing to base fields in run mode

This commit is contained in:
Carlos Valente
2025-07-17 06:44:21 +02:00
committed by Carlos Valente
parent 90105a199a
commit 44508ce8b4
8 changed files with 177 additions and 103 deletions
+15 -1
View File
@@ -21,7 +21,15 @@ declare global {
}
/**
* We pass a custom property to the table meta to allow field update
* Declare custom data we pass to the table
* - `handleUpdate` callback to update the entry when the user edits a cell
* - `handleUpdateTimer` callback to update the timer for a specific event
* - `options-showDelayedTimes` whether to show or hide delayed times
* - `options-hideTableSeconds` whether to hide seconds in the table
*
* And metadata specific for each column
* - `canWrite` whether the user can write to this column
* - `colour` background colour associated with a custom field
*/
declare module '@tanstack/react-table' {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
@@ -33,6 +41,12 @@ declare module '@tanstack/react-table' {
hideTableSeconds: boolean;
};
}
// eslint-disable-next-line @typescript-eslint/no-unused-vars
interface ColumnMeta<TData extends RowData, TValue> {
canWrite: boolean;
colour?: string;
}
}
/**