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';
|
||||
|
||||
import type {TrackType} from '../../fb-stubs/Logger.js';
|
||||
import SidebarExtensions from '../../fb-stubs/LayoutInspectorSidebarExtensions.js';
|
||||
|
||||
import {
|
||||
AXElementsInspector,
|
||||
@@ -979,6 +980,7 @@ export default class Layout extends SonarPlugin<InspectorState> {
|
||||
onValueChanged={this.onDataValueChanged}
|
||||
client={this.client}
|
||||
logger={this.props.logger}
|
||||
extensions={SidebarExtensions}
|
||||
/>
|
||||
)
|
||||
);
|
||||
|
||||
@@ -13,7 +13,6 @@ import ManagedDataInspector from '../data-inspector/ManagedDataInspector.js';
|
||||
import {Component} from 'react';
|
||||
import {Console} from '../console';
|
||||
import {GK} from 'sonar';
|
||||
import SidebarExtensions from '../../../fb-stubs/LayoutInspectorSidebarExtensions.js';
|
||||
|
||||
const deepEqual = require('deep-equal');
|
||||
|
||||
@@ -80,7 +79,9 @@ type Props = {|
|
||||
onValueChanged: ?OnValueChanged,
|
||||
client: PluginClient,
|
||||
logger: Logger,
|
||||
extensions?: Array<any>,
|
||||
|};
|
||||
|
||||
type State = {|
|
||||
isConsoleEnabled: boolean,
|
||||
|};
|
||||
@@ -110,14 +111,17 @@ export class InspectorSidebar extends Component<Props, State> {
|
||||
}
|
||||
|
||||
render() {
|
||||
const {element} = this.props;
|
||||
const {element, extensions} = this.props;
|
||||
if (!element || !element.data) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const sections = SidebarExtensions.map(ext =>
|
||||
ext(this.props.client, element.id, this.props.logger),
|
||||
);
|
||||
const sections =
|
||||
(extensions &&
|
||||
extensions.map(ext =>
|
||||
ext(this.props.client, element.id, this.props.logger),
|
||||
)) ||
|
||||
[];
|
||||
|
||||
for (const key in element.data) {
|
||||
sections.push(
|
||||
|
||||
Reference in New Issue
Block a user