(core) Fix bug preventing changes to ref list table

Summary:
Fixes bug that prevented the table of a reference list from being
changed in the column transform UI.

Test Plan: Browser test.

Reviewers: jarek

Reviewed By: jarek

Differential Revision: https://phab.getgrist.com/D3666
This commit is contained in:
George Gevoian
2022-10-17 00:33:30 -07:00
parent bfd7243fe2
commit 7682b3c320
2 changed files with 120 additions and 1 deletions

View File

@@ -196,7 +196,7 @@ export async function prepTransformColInfo(docModel: DocModel, origCol: ColumnRe
let suggestedColRef: number;
let suggestedTableId: string;
const origColTypeInfo = gristTypes.extractInfoFromColType(origCol.type.peek());
if (!optTableId && origColTypeInfo.type === "Ref" || origColTypeInfo.type === "RefList") {
if (!optTableId && (origColTypeInfo.type === "Ref" || origColTypeInfo.type === "RefList")) {
// When converting between Ref and Reflist, initially suggest the same table and visible column.
// When converting, if the table is the same, it's a special case.
// The visible column will not affect conversion.