Export power search enabled components and types by default
Summary: Provides power search typings to all users by default Reviewed By: LukeDefeo Differential Revision: D51306600 fbshipit-source-id: c1f0d318d8b6953dd02af16d2c51abbf0e6e9590
This commit is contained in:
committed by
Facebook GitHub Bot
parent
b34718ac32
commit
bfc4e959bc
@@ -38,9 +38,8 @@ export {Sidebar as _Sidebar} from './ui/Sidebar';
|
||||
export {DetailSidebar} from './ui/DetailSidebar';
|
||||
export {Toolbar} from './ui/Toolbar';
|
||||
|
||||
export {MasterDetail} from './ui/MasterDetail';
|
||||
export {MasterDetailWithPowerSearch as MasterDetail} from './ui/MasterDetailWithPowerSearch';
|
||||
export {MasterDetail as MasterDetailLegacy} from './ui/MasterDetail';
|
||||
export {MasterDetailWithPowerSearch as _MasterDetailWithPowerSearch} from './ui/MasterDetailWithPowerSearch';
|
||||
export {CodeBlock} from './ui/CodeBlock';
|
||||
|
||||
export {renderReactRoot, _PortalsManager} from './utils/renderReactRoot';
|
||||
@@ -59,19 +58,17 @@ export {DataFormatter} from './ui/DataFormatter';
|
||||
|
||||
export {useLogger, _LoggerContext} from './utils/useLogger';
|
||||
|
||||
export {DataTable, DataTableColumn} from './ui/data-table/DataTable';
|
||||
export {
|
||||
DataTable,
|
||||
DataTableColumn,
|
||||
} from './ui/data-table/DataTableWithPowerSearch';
|
||||
export {
|
||||
DataTable as DataTableLegacy,
|
||||
DataTableColumn as DataTableColumnLegacy,
|
||||
} from './ui/data-table/DataTable';
|
||||
export {DataTableManager} from './ui/data-table/DataTableManager';
|
||||
export {DataTableManager} from './ui/data-table/DataTableWithPowerSearchManager';
|
||||
export {DataTableManager as DataTableManagerLegacy} from './ui/data-table/DataTableManager';
|
||||
export {
|
||||
DataTable as _DataTableWithPowerSearch,
|
||||
DataTableColumn as _DataTableColumnWithPowerSearch,
|
||||
} from './ui/data-table/DataTableWithPowerSearch';
|
||||
export {dataTablePowerSearchOperators} from './ui/data-table/DataTableDefaultPowerSearchOperators';
|
||||
export {DataTableManager as _DataTableWithPowerSearchManager} from './ui/data-table/DataTableWithPowerSearchManager';
|
||||
export {DataList} from './ui/DataList';
|
||||
export {Spinner} from './ui/Spinner';
|
||||
export * from './ui/PowerSearch';
|
||||
|
||||
@@ -120,6 +120,9 @@ test('It can render rows', async () => {
|
||||
expect(
|
||||
(await renderer.findByText('unique-string')).parentElement?.parentElement,
|
||||
).toMatchInlineSnapshot(`
|
||||
<div
|
||||
style="position: absolute; top: 0px; left: 0px; width: 100%; height: 24px; transform: translateY(24px);"
|
||||
>
|
||||
<div
|
||||
class="ant-dropdown-trigger css-1k3kr6b-TableBodyRowContainer e1luu51r1"
|
||||
>
|
||||
@@ -127,76 +130,40 @@ test('It can render rows', async () => {
|
||||
class="css-12luweq-TableBodyColumnContainer e1luu51r0"
|
||||
width="14%"
|
||||
>
|
||||
<span>
|
||||
<span
|
||||
style="background-color: rgb(255, 245, 102);"
|
||||
/>
|
||||
00:00:00.000
|
||||
</span>
|
||||
</div>
|
||||
<div
|
||||
class="css-12luweq-TableBodyColumnContainer e1luu51r0"
|
||||
width="14%"
|
||||
>
|
||||
<span>
|
||||
<span
|
||||
style="background-color: rgb(255, 245, 102);"
|
||||
/>
|
||||
Android Phone
|
||||
</span>
|
||||
</div>
|
||||
<div
|
||||
class="css-12luweq-TableBodyColumnContainer e1luu51r0"
|
||||
width="14%"
|
||||
>
|
||||
<span>
|
||||
<span
|
||||
style="background-color: rgb(255, 245, 102);"
|
||||
/>
|
||||
FB4A
|
||||
</span>
|
||||
</div>
|
||||
<div
|
||||
class="css-12luweq-TableBodyColumnContainer e1luu51r0"
|
||||
width="14%"
|
||||
>
|
||||
<span>
|
||||
<span
|
||||
style="background-color: rgb(255, 245, 102);"
|
||||
/>
|
||||
unique-string
|
||||
</span>
|
||||
</div>
|
||||
<div
|
||||
class="css-12luweq-TableBodyColumnContainer e1luu51r0"
|
||||
width="14%"
|
||||
>
|
||||
<span>
|
||||
<span
|
||||
style="background-color: rgb(255, 245, 102);"
|
||||
/>
|
||||
</span>
|
||||
</div>
|
||||
<div
|
||||
class="css-12luweq-TableBodyColumnContainer e1luu51r0"
|
||||
width="14%"
|
||||
/>
|
||||
<div
|
||||
class="css-12luweq-TableBodyColumnContainer e1luu51r0"
|
||||
width="14%"
|
||||
>
|
||||
<span>
|
||||
<span
|
||||
style="background-color: rgb(255, 245, 102);"
|
||||
/>
|
||||
</span>
|
||||
</div>
|
||||
<div
|
||||
class="css-12luweq-TableBodyColumnContainer e1luu51r0"
|
||||
width="14%"
|
||||
>
|
||||
<span>
|
||||
<span
|
||||
style="background-color: rgb(255, 245, 102);"
|
||||
/>
|
||||
toClient:send
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`);
|
||||
|
||||
@@ -105,11 +105,11 @@ class UIPluginInitializer extends AbstractPluginInitializer {
|
||||
let uiPluginInitializer: UIPluginInitializer;
|
||||
export default async (store: Store, _logger: Logger) => {
|
||||
let FlipperPlugin = FlipperPluginSDK;
|
||||
if (getRenderHostInstance().GK('flipper_power_search')) {
|
||||
if (!getRenderHostInstance().GK('flipper_power_search')) {
|
||||
FlipperPlugin = {
|
||||
...FlipperPlugin,
|
||||
MasterDetail: FlipperPlugin._MasterDetailWithPowerSearch as any,
|
||||
DataTable: FlipperPlugin._DataTableWithPowerSearch as any,
|
||||
MasterDetail: FlipperPlugin.MasterDetailLegacy as any,
|
||||
DataTable: FlipperPlugin.DataTableLegacy as any,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -13,10 +13,10 @@ import {
|
||||
usePlugin,
|
||||
createDataSource,
|
||||
dataTablePowerSearchOperators,
|
||||
_DataTableColumnWithPowerSearch,
|
||||
_DataTableWithPowerSearch,
|
||||
DataTableColumn,
|
||||
DataTable,
|
||||
theme,
|
||||
_DataTableWithPowerSearchManager,
|
||||
DataTableManager,
|
||||
createState,
|
||||
useValue,
|
||||
DataFormatter,
|
||||
@@ -48,7 +48,7 @@ const logLevelEnumLabels = Object.entries(logTypes).reduce(
|
||||
|
||||
function createColumnConfig(
|
||||
_os: 'iOS' | 'Android' | 'Metro',
|
||||
): _DataTableColumnWithPowerSearch<ExtendedLogEntry>[] {
|
||||
): DataTableColumn<ExtendedLogEntry>[] {
|
||||
return [
|
||||
{
|
||||
key: 'type',
|
||||
@@ -153,7 +153,7 @@ export function devicePlugin(client: DevicePluginClient) {
|
||||
});
|
||||
const isPaused = createState(true);
|
||||
const tableManagerRef = createRef<
|
||||
undefined | _DataTableWithPowerSearchManager<ExtendedLogEntry>
|
||||
undefined | DataTableManager<ExtendedLogEntry>
|
||||
>();
|
||||
|
||||
client.onDeepLink((payload: unknown) => {
|
||||
@@ -264,7 +264,7 @@ export function Component() {
|
||||
const plugin = usePlugin(devicePlugin);
|
||||
const paused = useValue(plugin.isPaused);
|
||||
return (
|
||||
<_DataTableWithPowerSearch<ExtendedLogEntry>
|
||||
<DataTable<ExtendedLogEntry>
|
||||
dataSource={plugin.rows}
|
||||
columns={plugin.columns}
|
||||
enableAutoScroll
|
||||
|
||||
@@ -28,9 +28,9 @@ import {
|
||||
usePlugin,
|
||||
useValue,
|
||||
createDataSource,
|
||||
_DataTableWithPowerSearch as DataTable,
|
||||
_DataTableColumnWithPowerSearch as DataTableColumn,
|
||||
_DataTableWithPowerSearchManager as DataTableManager,
|
||||
DataTable,
|
||||
DataTableColumn,
|
||||
DataTableManager,
|
||||
theme,
|
||||
renderReactRoot,
|
||||
batch,
|
||||
|
||||
@@ -7,11 +7,7 @@
|
||||
* @format
|
||||
*/
|
||||
|
||||
import {
|
||||
Atom,
|
||||
_DataTableWithPowerSearchManager as DataTableManager,
|
||||
getFlipperLib,
|
||||
} from 'flipper-plugin';
|
||||
import {Atom, DataTableManager, getFlipperLib} from 'flipper-plugin';
|
||||
import {createContext} from 'react';
|
||||
import {Header, Request} from '../types';
|
||||
|
||||
|
||||
@@ -9,12 +9,11 @@
|
||||
|
||||
import {DeleteOutlined, PartitionOutlined} from '@ant-design/icons';
|
||||
import {
|
||||
_DataTableWithPowerSearch as DataTable,
|
||||
DataTable,
|
||||
DataTableColumn,
|
||||
DetailSidebar,
|
||||
Layout,
|
||||
_DataTableColumnWithPowerSearch,
|
||||
_DataTableWithPowerSearchManager,
|
||||
DataTableManager,
|
||||
dataTablePowerSearchOperators,
|
||||
usePlugin,
|
||||
useValue,
|
||||
@@ -44,8 +43,7 @@ export function FrameworkEventsTable({
|
||||
|
||||
const focusedNode = useValue(instance.uiState.focusedNode);
|
||||
|
||||
const managerRef =
|
||||
useRef<_DataTableWithPowerSearchManager<AugmentedFrameworkEvent> | null>(
|
||||
const managerRef = useRef<DataTableManager<AugmentedFrameworkEvent> | null>(
|
||||
null,
|
||||
);
|
||||
|
||||
@@ -175,8 +173,7 @@ const inferredEnum = [
|
||||
dataTablePowerSearchOperators.enum_is_not({}),
|
||||
];
|
||||
|
||||
const staticColumns: _DataTableColumnWithPowerSearch<AugmentedFrameworkEvent>[] =
|
||||
[
|
||||
const staticColumns: DataTableColumn<AugmentedFrameworkEvent>[] = [
|
||||
{
|
||||
key: 'timestamp',
|
||||
sortable: true,
|
||||
@@ -245,4 +242,4 @@ const staticColumns: _DataTableColumnWithPowerSearch<AugmentedFrameworkEvent>[]
|
||||
powerSearchConfig: stringConfig,
|
||||
formatters: MonoSpace,
|
||||
},
|
||||
];
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user