From 9b42bf8ab277979194e4ef73152b6b23c479786b Mon Sep 17 00:00:00 2001 From: Nathan-SR <144961007+Nathan-SR@users.noreply.github.com> Date: Thu, 7 Nov 2024 03:36:50 -0500 Subject: gpt text gen working for previews --- .../DataVizBox/DocCreatorMenu/DocCreatorMenu.tsx | 40 ++++++++-------------- 1 file changed, 15 insertions(+), 25 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 a08686a36..379a33a99 100644 --- a/src/client/views/nodes/DataVizBox/DocCreatorMenu/DocCreatorMenu.tsx +++ b/src/client/views/nodes/DataVizBox/DocCreatorMenu/DocCreatorMenu.tsx @@ -123,7 +123,7 @@ export class DocCreatorMenu extends ObservableReactComponent { }; @action setSuggestedTemplates = (templates: Template[]) => { this._suggestedTemplates = templates; - templates.forEach(template => { this._suggestedTemplatePreviews.push({template: template, doc: template.mainField.renderedDoc()}) }); //prettier-ignore + this._suggestedTemplatePreviews = templates.map(template => {return {template: template, doc: template.mainField.renderedDoc()}}); //prettier-ignore }; @computed get docsToRender() { @@ -497,7 +497,7 @@ export class DocCreatorMenu extends ObservableReactComponent { * @param assignments a list of template field numbers (from top to bottom) and their assigned columns from the linked dataviz * @returns a doc containing the fully rendered template */ - applyGPTContentToTemplate = async (template: Template, assignments: { [field: string]: Col }): Promise