aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/DataVizBox/DocCreatorMenu/DocCreatorMenu.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/views/nodes/DataVizBox/DocCreatorMenu/DocCreatorMenu.tsx')
-rw-r--r--src/client/views/nodes/DataVizBox/DocCreatorMenu/DocCreatorMenu.tsx11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/client/views/nodes/DataVizBox/DocCreatorMenu/DocCreatorMenu.tsx b/src/client/views/nodes/DataVizBox/DocCreatorMenu/DocCreatorMenu.tsx
index 444f0a29d..3253cefb9 100644
--- a/src/client/views/nodes/DataVizBox/DocCreatorMenu/DocCreatorMenu.tsx
+++ b/src/client/views/nodes/DataVizBox/DocCreatorMenu/DocCreatorMenu.tsx
@@ -616,18 +616,15 @@ export class DocCreatorMenu extends ObservableReactComponent<DocCreateMenuProps>
} else {
this._dataViz?.updateColDefaults();
- const cols = this.fieldsInfos;
- templates.push(...this.templateManager.getValidTemplates(cols));
+ templates.push(...this.templateManager.getValidTemplates(this.fieldsInfos));
- const assignments: [Template, { [field: number]: Col }][] = await this.assignColsToFields(templates, cols);
+ const assignments = await this.assignColsToFields(templates, this.fieldsInfos);
- const renderedTemplatePromises: Promise<Template | undefined>[] = assignments.map(([template, assgns]) => this.applyGPTContentToTemplate(template, assgns));
+ const renderedTemplatePromises = assignments.map(([template, assgns]) => this.applyGPTContentToTemplate(template, assgns));
await Promise.all(renderedTemplatePromises);
}
- templates.forEach(template => template.mainField.initializeDocument({ title: template.title, opts: {}, viewType: ViewType.FREEFORM, tl: [0, 0], br: [900, 900] }, []));
-
setTimeout(() => {
this.setSuggestedTemplates(templates);
this._GPTLoading = false;
@@ -731,7 +728,7 @@ export class DocCreatorMenu extends ObservableReactComponent<DocCreateMenuProps>
}
});
- return Promise.all(gptPromises).then(() => (this._DOCCC = templateCopy.mainField.renderedDoc));
+ return Promise.all(gptPromises).then(() => (this._DOCCC = templateCopy._mainField?.renderedDoc));
};
const rowContents = this.DEBUG_MODE