Merge branch 'slots-debug' of git+ssh://github.com/coralproject/talk into slots-debug

This commit is contained in:
Kim Gardner
2018-03-20 13:05:09 -04:00
3 changed files with 23 additions and 15 deletions
@@ -465,9 +465,6 @@ const mapStateToProps = state => ({
activeStreamTab: state.stream.activeTab,
previousStreamTab: state.stream.previousTab,
commentClassNames: state.stream.commentClassNames,
// @Deprecated plugin_config
pluginsConfig: state.config.plugins_config || state.config.plugin_config,
sortOrder: state.stream.sortOrder,
sortBy: state.stream.sortBy,
});
+6 -9
View File
@@ -8,6 +8,7 @@ import isEqual from 'lodash/isEqual';
import get from 'lodash/get';
import { getShallowChanges } from 'coral-framework/utils';
import omit from 'lodash/omit';
import merge from 'lodash/merge';
const emptyConfig = {};
@@ -75,9 +76,10 @@ class Slot extends React.Component {
// @Deprecated plugin_config
const pluginsConfig =
get(reduxState, 'config.plugins_config') ||
get(reduxState, 'config.plugin_config') ||
emptyConfig;
merge(
get(reduxState, 'config.plugins_config'),
get(reduxState, 'config.plugin_config')
) || emptyConfig;
if (children.length === 0 && DefaultComponent) {
const props = plugins.getSlotComponentProps(
@@ -93,11 +95,7 @@ class Slot extends React.Component {
children = children.map(childFactory);
}
const debugProps = pluginsConfig.debug
? {
'data-slot-name': fill,
}
: {};
// console.log('pluginsConfig', pluginsConfig);
return (
<Component
@@ -109,7 +107,6 @@ class Slot extends React.Component {
className,
`talk-slot-${kebabCase(fill)}`
)}
{...debugProps}
>
{children}
</Component>
+17 -3
View File
@@ -97,13 +97,27 @@ class PluginsService {
this.showPluginsConfigWarning = false;
}
console.log(
'slot plugins_config',
get(reduxState, 'config.plugins_config')
);
// @Deprecated plugin_config
const pluginsConfig =
get(reduxState, 'config.plugins_config') ||
get(reduxState, 'config.plugin_config') ||
emptyConfig;
merge(
get(reduxState, 'config.plugins_config'),
get(reduxState, 'config.plugin_config')
) || emptyConfig;
const debugProps = pluginsConfig.debug
? {
'data-slot-name': props.fill,
}
: {};
return {
...props,
...debugProps,
config: pluginsConfig,
...(component.fragments
? pick(queryData, Object.keys(component.fragments))