Filter out the ones that have slots

This commit is contained in:
Belen Curcio
2017-07-06 11:40:35 -03:00
parent 7c753ee518
commit 60608af8b2
+2 -3
View File
@@ -16,7 +16,7 @@ function getSlotComponents(slot) {
// Filter out components that have been disabled in `plugin_config`
return flatten(plugins
// Filter out components that have been disabled in `plugin_config`
// Filter out components that have slots and have been disabled in `plugin_config`
.filter((o) => o.module.slots && (!pluginConfig || !pluginConfig[o.plugin] || !pluginConfig[o.plugin].disable_components))
.filter((o) => o.module.slots[slot])
@@ -78,8 +78,7 @@ export function getSlotsFragments(slots) {
}
const components = uniq(flattenDeep(slots.map((slot) => {
return plugins
.filter((o) => o.module.slots)
.filter((o) => o.module.slots[slot])
.filter((o) => o.module.slots ? o.module.slots[slot] : false)
.map((o) => o.module.slots[slot]);
})));