From 7d9fae09e8906e5636f6ea695ad560797b08d023 Mon Sep 17 00:00:00 2001
From: Nathan-SR <144961007+Nathan-SR@users.noreply.github.com>
Date: Wed, 26 Feb 2025 21:11:36 -0500
Subject: something broke, reverting

---
 .../DataVizBox/DocCreatorMenu/DocCreatorMenu.tsx     | 20 +++++++-------------
 1 file changed, 7 insertions(+), 13 deletions(-)

(limited to 'src/client/views/nodes/DataVizBox/DocCreatorMenu/DocCreatorMenu.tsx')

diff --git a/src/client/views/nodes/DataVizBox/DocCreatorMenu/DocCreatorMenu.tsx b/src/client/views/nodes/DataVizBox/DocCreatorMenu/DocCreatorMenu.tsx
index faa6cffa8..ffdc6626d 100644
--- a/src/client/views/nodes/DataVizBox/DocCreatorMenu/DocCreatorMenu.tsx
+++ b/src/client/views/nodes/DataVizBox/DocCreatorMenu/DocCreatorMenu.tsx
@@ -47,6 +47,8 @@ export enum LayoutType {
 export class DocCreatorMenu extends ObservableReactComponent<FieldViewProps> {
     static Instance: DocCreatorMenu;
 
+    private DEBUG_MODE: boolean = false;
+
     private _disposers: { [name: string]: IDisposer } = {};
 
     private _ref: HTMLDivElement | null = null;
@@ -122,8 +124,11 @@ export class DocCreatorMenu extends ObservableReactComponent<FieldViewProps> {
     };
 
     @computed get docsToRender() {
-        return [1, 2, 3, 4];
-        //this._selectedTemplate ? NumListCast(this._dataViz?.layoutDoc.dataViz_selectedRows) : []; !!! put this back for GPT rendering
+        if (this.DEBUG_MODE){
+            return [1, 2, 3, 4];
+        } else {
+            return this._selectedTemplate ? NumListCast(this._dataViz?.layoutDoc.dataViz_selectedRows) : []; 
+        }
     }
 
     @computed get rowsCount() {
@@ -620,8 +625,6 @@ export class DocCreatorMenu extends ObservableReactComponent<FieldViewProps> {
 
         const renderedTemplates: (Template | undefined)[] = await Promise.all(renderedTemplatePromises);
 
-        templates.forEach(template => template.mainField.initRenderedDoc())
-
         setTimeout(() => {
             this.setSuggestedTemplates(templates);
             this._GPTLoading = false;
@@ -712,15 +715,6 @@ export class DocCreatorMenu extends ObservableReactComponent<FieldViewProps> {
         const fields: string[] = Array.from(Object.keys(dv.records[0]));  
         const selectedRows = NumListCast(dv.layoutDoc.dataViz_selectedRows);
     
-        const rowContents: { [title: string]: string }[] = selectedRows.map(row => {
-            let values: { [title: string]: string } = {};
-            fields.forEach(col => {
-                values[col] = dv.records[row][col];
-            });
-    
-            return values;
-        });
-    
         const processContent = async (content: {[title: string]: string}) => {
 
             const templateCopy = template.cloneBase(); 
-- 
cgit v1.2.3-70-g09d2

