diff --git a/client/coral-framework/components/Slot.js b/client/coral-framework/components/Slot.js index 4e9dca9ac..75a71fee4 100644 --- a/client/coral-framework/components/Slot.js +++ b/client/coral-framework/components/Slot.js @@ -2,9 +2,6 @@ import React, {Component} from 'react'; import { importer as injectPlugins } from 'coral-framework/helpers/importer'; class Slot extends Component { - componentDidMount() { - console.log('Slot Mounted'); - } render() { const {fill} = this.props; return ( diff --git a/client/coral-framework/helpers/importer.js b/client/coral-framework/helpers/importer.js index e42441ff7..1613dfc73 100644 --- a/client/coral-framework/helpers/importer.js +++ b/client/coral-framework/helpers/importer.js @@ -63,7 +63,7 @@ function importer (fill) { .map(addProps) .filter(filterBySlot) .reduce((entry, plugin, i) => { - entry.push(context(plugin.key)(plugin.props)); + entry.push(context(plugin.key)({...plugin.props, key: i})); return entry; }, []); } @@ -85,25 +85,29 @@ function shapeData(test) { }; } -function actionsImporter () { - const context = require.context('plugins', true, /\.\/(.*)\/client\/actions.js$/); - +function importAll(context) { return context .keys() .map(key => shapeData(key)) - .reduce((entry, actionsPlugin, i) => { + .reduce((entry, actionsPlugin) => { entry[actionsPlugin.name] = context(actionsPlugin.key); return entry; }, {}); } +function actionsImporter () { + return importAll(require.context('plugins', true, /\.\/(.*)\/client\/actions.js$/)) + + +} + function reducersImporter () { const context = require.context('plugins', true, /\.\/(.*)\/client\/reducer.js$/); return context .keys() .map(key => shapeData(key)) - .reduce((entry, reducerPlugin, i) => { + .reduce((entry, reducerPlugin) => { entry[reducerPlugin.name] = context(reducerPlugin.key); return entry; }, {}); diff --git a/plugins/coral-plugin-respect/client/index.js b/plugins/coral-plugin-respect/client/index.js index 9969420b5..2ea5751a8 100644 --- a/plugins/coral-plugin-respect/client/index.js +++ b/plugins/coral-plugin-respect/client/index.js @@ -2,7 +2,7 @@ import React from 'react'; import styles from './style.css'; export default (props) => ( -