plugins-functionality #43
|
@ -143,33 +143,30 @@ export class PluginsComponent implements OnInit {
|
|||
}
|
||||
let self = this;
|
||||
this.pluginTemplates.forEach(_ => {
|
||||
console.log("pl template", _.code, _.custom)
|
||||
let plugin: Plugin = null;
|
||||
if(!_.custom) {
|
||||
|
||||
|
||||
for (let pl of plugins) {
|
||||
if (pl.templateId == _._id) {
|
||||
plugin = pl;
|
||||
}
|
||||
}
|
||||
if (!plugin && !_.custom) {
|
||||
if (!plugin) {
|
||||
plugin = new Plugin(this.selectedPageId, this.selectedCommunityPid, _);
|
||||
this.plugins.push(plugin);
|
||||
}
|
||||
|
||||
if (plugin) {
|
||||
console.log("plugin found", plugin.custom)
|
||||
if (plugin.custom) {
|
||||
console.log(plugin, _)
|
||||
}
|
||||
plugin.object = PluginUtils.initializeObjectAndCompare(_.code, plugin.object)
|
||||
this.pluginsByPlacement.get(plugin.placement).push({plugin: plugin, template: _, openPreview: false});
|
||||
}
|
||||
}
|
||||
});
|
||||
/* console.log("________", )
|
||||
//add custom plugins in the list
|
||||
this.plugins.forEach(_ => {
|
||||
|
||||
if(_.custom){
|
||||
console.log("custom plugin", _.templateCode)
|
||||
let customTemplate = null;
|
||||
this.pluginTemplates.forEach(template => {
|
||||
if (_.templateId == template._id) {
|
||||
|
@ -177,13 +174,10 @@ export class PluginsComponent implements OnInit {
|
|||
}
|
||||
});
|
||||
if(customTemplate){
|
||||
console.log("template found!")
|
||||
this.pluginsByPlacement.get(customTemplate.placement).push({plugin: _, template: customTemplate, openPreview: false});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
});*/
|
||||
});
|
||||
let availablePlacements = [];
|
||||
for (let placement of this.pluginUtils.placementsOptions) {
|
||||
if (this.pluginsByPlacement.get(placement.value).length > 0) {
|
||||
|
|
Loading…
Reference in New Issue