(core) Use visible column formatting when converting RefList to Text

Summary: Tweaked ReferenceListFormatter and ValueConverter to sensibly convert to Text. Fixes an embarrassing bug exposed during checkin 😱

Test Plan: Add test for converting from RefList displaying formatted dates to Text

Reviewers: paulfitz

Reviewed By: paulfitz

Differential Revision: https://phab.getgrist.com/D3254
This commit is contained in:
Alex Hall
2022-02-08 20:25:50 +02:00
parent 0de0cb0f4a
commit f877f3859d
2 changed files with 9 additions and 6 deletions

View File

@@ -250,7 +250,7 @@ class ReferenceListFormatter extends ReferenceFormatter {
// Part of this repeats the logic in BaseFormatter.formatAny which is overridden in ReferenceFormatter
// It also ensures that complex lists (e.g. if this RefList is displaying a ChoiceList)
// are formatted as JSON instead of CSV.
if (!isList(value) || hasNestedObjects(value)) {
if (!isList(value) || hasNestedObjects(decodeObject(value) as CellValue[])) {
return formatUnknown(value);
}
// In the most common case, lists of simple objects like strings or dates