Adding camelcase for plugin reducers 🎉 <3

This commit is contained in:
Belen Curcio
2017-06-07 13:14:52 -03:00
parent 8872248d63
commit f6ad9c9373
3 changed files with 6 additions and 3 deletions
+2 -1
View File
@@ -8,6 +8,7 @@ import flattenDeep from 'lodash/flattenDeep';
import {getDefinitionName, mergeDocuments} from 'coral-framework/utils';
import {loadTranslations} from 'coral-framework/services/i18n';
import {injectReducers} from 'coral-framework/services/store';
import camelize from './camelize';
/**
* Returns React Elements for given slot.
@@ -98,7 +99,7 @@ export function injectPluginsReducers() {
const reducers = merge(
...plugins
.filter((o) => o.module.reducer)
.map((o) => ({[o.plugin] : o.module.reducer}))
.map((o) => ({[camelize(o.plugin)] : o.module.reducer}))
);
injectReducers(reducers);
}
@@ -10,7 +10,7 @@ import {
removeCommentClassName
} from 'plugin-api/alpha/client/actions';
const mapStateToProps = ({comment, ['coral-plugin-offtopic']: offTopic}) => ({
const mapStateToProps = ({comment, coralPluginOfftopic: offTopic}) => ({
commentClassNames: comment.commentClassNames,
checked: offTopic.checked
});
@@ -3,7 +3,9 @@ import {bindActionCreators} from 'redux';
import ViewingOptions from '../components/ViewingOptions';
import {openViewingOptions, closeViewingOptions} from '../actions';
const mapStateToProps = ({['coral-plugin-viewing-options']: state}) => ({open: state.open});
const mapStateToProps = ({coralPluginViewingOptions: state}) => ({
open: state.open
});
const mapDispatchToProps = (dispatch) =>
bindActionCreators({openViewingOptions, closeViewingOptions}, dispatch);