diff --git a/dashboard/plugins/components/openaireProducts/plugin-openaire-products.component.ts b/dashboard/plugins/components/openaireProducts/plugin-openaire-products.component.ts index df6d312b..a8c5601b 100644 --- a/dashboard/plugins/components/openaireProducts/plugin-openaire-products.component.ts +++ b/dashboard/plugins/components/openaireProducts/plugin-openaire-products.component.ts @@ -81,7 +81,7 @@ export class PluginOpenaireProductsComponent extends PluginBaseComponent{ } ngOnInit(): void { - if(this.pluginTemplate && !this.pluginDefaultObject){ + if(this.pluginTemplate && (!this.pluginDefaultObject || !this.pluginDefaultObject.title)){ this.pluginTemplate.object = new PluginOpenAIREProducts(); } } diff --git a/dashboard/plugins/components/test/plugin-test.component.ts b/dashboard/plugins/components/test/plugin-test.component.ts index 80664fb8..46c3c757 100644 --- a/dashboard/plugins/components/test/plugin-test.component.ts +++ b/dashboard/plugins/components/test/plugin-test.component.ts @@ -63,7 +63,7 @@ export class PluginTestComponent extends PluginBaseComponent{ } ngOnInit(): void { - if(this.pluginTemplate && !this.pluginDefaultObject){ + if(this.pluginTemplate && (!this.pluginDefaultObject || !this.pluginDefaultObject.title)){ this.pluginTemplate.object = new PluginTest(); } } diff --git a/dashboard/plugins/plugins.component.ts b/dashboard/plugins/plugins.component.ts index 8c79435c..698a8b93 100644 --- a/dashboard/plugins/plugins.component.ts +++ b/dashboard/plugins/plugins.component.ts @@ -274,7 +274,7 @@ export class PluginsComponent implements OnInit { active: this._fb.control(plugin.active), isPriorTo: this._fb.control(plugin.priorTo), values: this._fb.array([]), - object: this._fb.group(plugin.object?plugin.object:this.selectedTemplate.object) + object: this._fb.group(plugin.object?plugin.object:(this.selectedTemplate.object?this.selectedTemplate.object:{})) }); if (template.settings) { for (let attrKey of Object.keys(template.settings)) { @@ -310,7 +310,7 @@ export class PluginsComponent implements OnInit { active: this._fb.control(false), isPriorTo: this._fb.control(false), values: this._fb.array([]), - object: this._fb.control(null) + object: this._fb.control({}) }); for (let attrKey of Object.keys(this.selectedTemplate.settings)) { (this.templateForm.get("values") as FormArray).push(this._fb.group({ diff --git a/dashboard/plugins/templates/pluginTemplates.component.html b/dashboard/plugins/templates/pluginTemplates.component.html index 2c7b62b2..28437b1c 100644 --- a/dashboard/plugins/templates/pluginTemplates.component.html +++ b/dashboard/plugins/templates/pluginTemplates.component.html @@ -111,13 +111,13 @@ [okDisabled]="templateForm && (templateForm.invalid || !templateForm.dirty)" classTitle="uk-background-primary uk-light">
-
+
-
+
-
+