mirror of
https://github.com/wassname/talk.git
synced 2026-07-04 01:42:19 +08:00
Merge branch 'slots-debug' of git+ssh://github.com/coralproject/talk into slots-debug
This commit is contained in:
@@ -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,
|
||||
});
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user