mirror of
https://github.com/gristlabs/grist-core.git
synced 2024-10-27 20:44:07 +00:00
(core) Treating null in toggle column as a valid value
Summary: When action is pruned by ACL rules, the rule engine sometimes rewrites actions, setting NULLs for boolean columns as a default value. Null was not considered a valid value and it resulted in a bug in the UI where the editor for the Toggle column was not rendered. Test Plan: Added new Reviewers: paulfitz Reviewed By: paulfitz Differential Revision: https://phab.getgrist.com/D4110
This commit is contained in:
parent
68801474b1
commit
67dc41776d
@ -172,6 +172,7 @@ export function isEmptyList(value: CellValue): boolean {
|
||||
function isNumber(v: CellValue) { return typeof v === 'number' || typeof v === 'boolean'; }
|
||||
function isNumberOrNull(v: CellValue) { return isNumber(v) || v === null; }
|
||||
function isBoolean(v: CellValue) { return typeof v === 'boolean' || v === 1 || v === 0; }
|
||||
function isBooleanOrNull(v: CellValue) { return isBoolean(v) || v === null; }
|
||||
|
||||
// These values are not regular cell values, even in a column of type Any.
|
||||
const abnormalValueTypes: string[] = [GristObjCode.Exception, GristObjCode.Pending, GristObjCode.Skip,
|
||||
@ -191,7 +192,7 @@ const rightType: {[key in GristType]: (value: CellValue) => boolean} = {
|
||||
Text: isString,
|
||||
Blob: isString,
|
||||
Int: isNumberOrNull,
|
||||
Bool: isBoolean,
|
||||
Bool: isBooleanOrNull,
|
||||
Date: isNumberOrNull,
|
||||
DateTime: isNumberOrNull,
|
||||
Numeric: isNumberOrNull,
|
||||
|
Loading…
Reference in New Issue
Block a user