aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/DataVizBox/DocCreatorMenu/DocCreatorMenu.tsx
diff options
context:
space:
mode:
authorNathan-SR <144961007+Nathan-SR@users.noreply.github.com>2025-02-26 21:11:36 -0500
committerNathan-SR <144961007+Nathan-SR@users.noreply.github.com>2025-02-26 21:11:36 -0500
commit7d9fae09e8906e5636f6ea695ad560797b08d023 (patch)
tree3a994072fc1b724c49531e20e546e54469b4d8f4 /src/client/views/nodes/DataVizBox/DocCreatorMenu/DocCreatorMenu.tsx
parentb623446ec0e71a3f696d14c3f169781c99f7e7b7 (diff)
something broke, reverting
Diffstat (limited to 'src/client/views/nodes/DataVizBox/DocCreatorMenu/DocCreatorMenu.tsx')
-rw-r--r--src/client/views/nodes/DataVizBox/DocCreatorMenu/DocCreatorMenu.tsx20
1 files changed, 7 insertions, 13 deletions
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();