diff options
author | bobzel <zzzman@gmail.com> | 2025-03-17 01:35:46 -0400 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2025-03-17 01:35:46 -0400 |
commit | c54d3f4338d16c907273762758853a183b543630 (patch) | |
tree | 2aa249a51a8f7beae2b3768bb97b093fdd12c7ed /src/client/views/nodes/DataVizBox/DocCreatorMenu/TemplateManager.ts | |
parent | 9254c4ea7e633c4e1a5eefda9a9d8d2bbe61f6b1 (diff) |
hopefully last changes doc creator templates.
Diffstat (limited to 'src/client/views/nodes/DataVizBox/DocCreatorMenu/TemplateManager.ts')
-rw-r--r-- | src/client/views/nodes/DataVizBox/DocCreatorMenu/TemplateManager.ts | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/src/client/views/nodes/DataVizBox/DocCreatorMenu/TemplateManager.ts b/src/client/views/nodes/DataVizBox/DocCreatorMenu/TemplateManager.ts index 1959cf9d6..0978444e3 100644 --- a/src/client/views/nodes/DataVizBox/DocCreatorMenu/TemplateManager.ts +++ b/src/client/views/nodes/DataVizBox/DocCreatorMenu/TemplateManager.ts @@ -11,20 +11,11 @@ export class TemplateManager { this.templates = this.initializeTemplates(templateSettings); } - initializeTemplates = (templateSettings: FieldSettings[]): Template[] => { - const initializedTemplates: Template[] = []; - templateSettings.forEach(settings => initializedTemplates.push(new Template(settings))); - return initializedTemplates; - }; + initializeTemplates = (templateSettings: FieldSettings[]) => templateSettings.map(settings => new Template(settings)); - getValidTemplates = (cols: Col[]): Template[] => { - console.log('called in manager with templates: ', this.templates); - return this.templates.filter(template => template.isValidTemplate(cols)); - }; + getValidTemplates = (cols: Col[]) => this.templates.filter(template => template.isValidTemplate(cols)); - addTemplate = (newTemplate: Template) => { - this.templates.push(newTemplate); - }; + addTemplate = (newTemplate: Template) => this.templates.push(newTemplate); removeTemplate = (template: Template) => { this.templates.splice(this.templates.indexOf(template), 1); |