From cc6b30d2824ad5ff686fe728587d89d17aa3c8b2 Mon Sep 17 00:00:00 2001
From: Bob Zeleznik <zzzman@gmail.com>
Date: Wed, 22 Jan 2020 01:00:09 -0500
Subject: fixed pivot viewer to not have multiple columns with the same value. 
 fixed imagebox to show fade views.  cleaned up makeMetadataFieldTemplate

---
 .../collectionFreeForm/CollectionFreeFormLayoutEngines.tsx            | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

(limited to 'src/client/views/collections/collectionFreeForm/CollectionFreeFormLayoutEngines.tsx')

diff --git a/src/client/views/collections/collectionFreeForm/CollectionFreeFormLayoutEngines.tsx b/src/client/views/collections/collectionFreeForm/CollectionFreeFormLayoutEngines.tsx
index 5924c3afb..5c6336248 100644
--- a/src/client/views/collections/collectionFreeForm/CollectionFreeFormLayoutEngines.tsx
+++ b/src/client/views/collections/collectionFreeForm/CollectionFreeFormLayoutEngines.tsx
@@ -8,7 +8,6 @@ import { emptyFunction } from "../../../../Utils";
 import React = require("react");
 import { ObservableMap, runInAction } from "mobx";
 import { Id, ToString } from "../../../../new_fields/FieldSymbols";
-import { DateField } from "../../../../new_fields/DateField";
 import { ObjectField } from "../../../../new_fields/ObjectField";
 import { RefField } from "../../../../new_fields/RefField";
 
@@ -47,8 +46,9 @@ export function computePivotLayout(poolData: ObservableMap<string, any>, pivotDo
     const pivotAxisWidth = NumCast(pivotDoc.pivotWidth, 200);
     const pivotColumnGroups = new Map<FieldResult<Field>, Doc[]>();
 
+    const pivotFieldKey = toLabel(pivotDoc.pivotField);
     for (const doc of childDocs) {
-        const val = doc[StrCast(pivotDoc.pivotField, "title")];
+        const val = Field.toString(doc[pivotFieldKey] as Field);
         if (val) {
             !pivotColumnGroups.get(val) && pivotColumnGroups.set(val, []);
             pivotColumnGroups.get(val)!.push(doc);
-- 
cgit v1.2.3-70-g09d2

