aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/DataVizBox/DocCreatorMenu/TemplateManager.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/views/nodes/DataVizBox/DocCreatorMenu/TemplateManager.ts')
-rw-r--r--src/client/views/nodes/DataVizBox/DocCreatorMenu/TemplateManager.ts15
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);