Remove sidebar extensions from accessibility inspector
Summary: Sidebar extensions are automatically added to main inspector sidebar but kept from accessibility side menu. Reviewed By: xiphirx Differential Revision: D9438644 fbshipit-source-id: 47a9cc630117e15be3368d78f2396f02796c998d
This commit is contained in:
committed by
Facebook Github Bot
parent
d82fa3c2b5
commit
7acf0ff9af
@@ -26,6 +26,7 @@ import {
|
|||||||
} from 'sonar';
|
} from 'sonar';
|
||||||
|
|
||||||
import type {TrackType} from '../../fb-stubs/Logger.js';
|
import type {TrackType} from '../../fb-stubs/Logger.js';
|
||||||
|
import SidebarExtensions from '../../fb-stubs/LayoutInspectorSidebarExtensions.js';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
AXElementsInspector,
|
AXElementsInspector,
|
||||||
@@ -979,6 +980,7 @@ export default class Layout extends SonarPlugin<InspectorState> {
|
|||||||
onValueChanged={this.onDataValueChanged}
|
onValueChanged={this.onDataValueChanged}
|
||||||
client={this.client}
|
client={this.client}
|
||||||
logger={this.props.logger}
|
logger={this.props.logger}
|
||||||
|
extensions={SidebarExtensions}
|
||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ import ManagedDataInspector from '../data-inspector/ManagedDataInspector.js';
|
|||||||
import {Component} from 'react';
|
import {Component} from 'react';
|
||||||
import {Console} from '../console';
|
import {Console} from '../console';
|
||||||
import {GK} from 'sonar';
|
import {GK} from 'sonar';
|
||||||
import SidebarExtensions from '../../../fb-stubs/LayoutInspectorSidebarExtensions.js';
|
|
||||||
|
|
||||||
const deepEqual = require('deep-equal');
|
const deepEqual = require('deep-equal');
|
||||||
|
|
||||||
@@ -80,7 +79,9 @@ type Props = {|
|
|||||||
onValueChanged: ?OnValueChanged,
|
onValueChanged: ?OnValueChanged,
|
||||||
client: PluginClient,
|
client: PluginClient,
|
||||||
logger: Logger,
|
logger: Logger,
|
||||||
|
extensions?: Array<any>,
|
||||||
|};
|
|};
|
||||||
|
|
||||||
type State = {|
|
type State = {|
|
||||||
isConsoleEnabled: boolean,
|
isConsoleEnabled: boolean,
|
||||||
|};
|
|};
|
||||||
@@ -110,14 +111,17 @@ export class InspectorSidebar extends Component<Props, State> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const {element} = this.props;
|
const {element, extensions} = this.props;
|
||||||
if (!element || !element.data) {
|
if (!element || !element.data) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
const sections = SidebarExtensions.map(ext =>
|
const sections =
|
||||||
ext(this.props.client, element.id, this.props.logger),
|
(extensions &&
|
||||||
);
|
extensions.map(ext =>
|
||||||
|
ext(this.props.client, element.id, this.props.logger),
|
||||||
|
)) ||
|
||||||
|
[];
|
||||||
|
|
||||||
for (const key in element.data) {
|
for (const key in element.data) {
|
||||||
sections.push(
|
sections.push(
|
||||||
|
|||||||
Reference in New Issue
Block a user