From dd5d7503e05962fa9a22baa9f5fa00373393ac11 Mon Sep 17 00:00:00 2001
From: fawn <fangrui_tong@brown.edu>
Date: Tue, 30 Jul 2019 15:52:32 -0400
Subject: schema column menu stylign

---
 src/client/views/collections/CollectionSchemaView.tsx | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

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

diff --git a/src/client/views/collections/CollectionSchemaView.tsx b/src/client/views/collections/CollectionSchemaView.tsx
index 722d8b1f9..86d3d01ef 100644
--- a/src/client/views/collections/CollectionSchemaView.tsx
+++ b/src/client/views/collections/CollectionSchemaView.tsx
@@ -612,7 +612,9 @@ export class SchemaTable extends React.Component<SchemaTableProps> {
             } else {
                 const index = columns.map(c => c.heading).indexOf(oldKey);
                 if (index > -1) {
-                    columns[index] = new SchemaHeaderField(newKey, columns[index].color);
+                    let column = columns[index];
+                    column.setHeading(newKey);
+                    columns[index] = column;
                     this.columns = columns;
                 }
             }
@@ -643,8 +645,7 @@ export class SchemaTable extends React.Component<SchemaTableProps> {
         let columns = this.columns;
         let index = columns.indexOf(columnField);
         if (index > -1) {
-            // let column = columns[index];
-            columnField.type = NumCast(type);
+            columnField.setType(NumCast(type));
             columns[index] = columnField;
             this.columns = columns;
         }
@@ -664,9 +665,9 @@ export class SchemaTable extends React.Component<SchemaTableProps> {
         let columns = this.columns;
         let index = columns.indexOf(columnField);
         if (index > -1) {
-            columnField.color = color;
+            columnField.setColor(color);
             columns[index] = columnField;
-            this.columns = columns;
+            this.columns = columns; // need to set the columns to trigger rerender
         }
     }
 
-- 
cgit v1.2.3-70-g09d2

