Remove SearchableDataInspector
Summary: Fury was the last user of this component Reviewed By: nikoant Differential Revision: D29426804 fbshipit-source-id: 793135119e70b41eda0391d3fedee1c9b6834cbd
This commit is contained in:
committed by
Facebook GitHub Bot
parent
16154e1343
commit
1dafe351f7
@@ -89,7 +89,6 @@ export {
|
||||
MarkerTimeline,
|
||||
} from 'flipper-plugin';
|
||||
export {DataInspector as ManagedDataInspector} from 'flipper-plugin';
|
||||
export {default as SearchableDataInspector} from './ui/components/data-inspector/SearchableDataInspector';
|
||||
export {HighlightManager} from 'flipper-plugin';
|
||||
export {default as Tabs} from './ui/components/Tabs';
|
||||
export {default as Tab} from './ui/components/Tab';
|
||||
|
||||
@@ -1,42 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
import debounceRender from 'react-debounce-render';
|
||||
|
||||
import {DataInspector} from 'flipper-plugin';
|
||||
import Searchable, {SearchableProps} from '../searchable/Searchable';
|
||||
|
||||
type ManagedDataInspectorProps = any; // TODO!
|
||||
|
||||
type Props = ManagedDataInspectorProps & SearchableProps;
|
||||
|
||||
function filter(data: any, searchTerm: string): any {
|
||||
if (searchTerm === '') {
|
||||
return data;
|
||||
}
|
||||
const res: any = {};
|
||||
const lowerSearch = searchTerm.toLowerCase();
|
||||
|
||||
for (const key in data) {
|
||||
if (key.toLowerCase().indexOf(lowerSearch) != -1) {
|
||||
res[key] = data[key];
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
// Naive shallow filters matching wrapper for ManagedDataInspector
|
||||
function SearchableDataInspector(props: Props) {
|
||||
return (
|
||||
<DataInspector {...props} data={filter(props.data, props.searchTerm)} />
|
||||
);
|
||||
}
|
||||
|
||||
export default Searchable(debounceRender(SearchableDataInspector, 250, {}));
|
||||
@@ -39,7 +39,6 @@ export {ManagedTableProps} from './components/table/ManagedTable';
|
||||
|
||||
export {DataValueExtractor, DataInspectorExpanded} from 'flipper-plugin';
|
||||
export {DataInspector as ManagedDataInspector} from 'flipper-plugin';
|
||||
export {default as SearchableDataInspector} from './components/data-inspector/SearchableDataInspector';
|
||||
|
||||
// tabs
|
||||
export {default as Tabs} from './components/Tabs';
|
||||
|
||||
Reference in New Issue
Block a user