Pass the Layout plugin's logger to the sidebar and sidebar extensions

Summary: Lets the sidebar + sidebar extensions log custom events

Reviewed By: danielbuechele

Differential Revision: D9411001

fbshipit-source-id: 37704e805eda56347cd95c155f81ad31b34bd508
This commit is contained in:
Hilal Alsibai
2018-08-21 02:49:14 -07:00
committed by Facebook Github Bot
parent c428de3948
commit 1aee2cdaa3
2 changed files with 5 additions and 1 deletions

View File

@@ -966,6 +966,7 @@ export default class Layout extends SonarPlugin<InspectorState> {
tooltips={this.getAccessibilityTooltips()}
onValueChanged={this.onDataValueChanged}
client={this.client}
logger={this.props.logger}
/>
)
);
@@ -977,6 +978,7 @@ export default class Layout extends SonarPlugin<InspectorState> {
element={this.state.elements[this.state.selected]}
onValueChanged={this.onDataValueChanged}
client={this.client}
logger={this.props.logger}
/>
)
);

View File

@@ -7,6 +7,7 @@
import type {Element} from './ElementsInspector.js';
import type {PluginClient} from '../../../plugin';
import type Logger from '../../../fb-stubs/Logger.js';
import Panel from '../Panel.js';
import ManagedDataInspector from '../data-inspector/ManagedDataInspector.js';
import {Component} from 'react';
@@ -78,6 +79,7 @@ type Props = {|
tooltips?: Object,
onValueChanged: ?OnValueChanged,
client: PluginClient,
logger: Logger,
|};
type State = {|
isConsoleEnabled: boolean,
@@ -114,7 +116,7 @@ export class InspectorSidebar extends Component<Props, State> {
}
const sections = SidebarExtensions.map(ext =>
ext(this.props.client, element.id),
ext(this.props.client, element.id, this.props.logger),
);
for (const key in element.data) {