Move plugin installer away from immutable
Summary: Trying to get rid of immutable_table, which is used in only 3 places. One of them being the plugin installer. Reviewed By: jknoxville Differential Revision: D29295534 fbshipit-source-id: dfae9476635c3a8ebba9f1439905bae693fdfd57
This commit is contained in:
committed by
Facebook GitHub Bot
parent
729922e8ad
commit
5b4179d482
@@ -10,22 +10,21 @@
|
|||||||
import {
|
import {
|
||||||
FlexColumn,
|
FlexColumn,
|
||||||
styled,
|
styled,
|
||||||
ManagedTable_immutable,
|
|
||||||
SearchInput,
|
SearchInput,
|
||||||
SearchBox,
|
SearchBox,
|
||||||
Button,
|
Button,
|
||||||
colors,
|
colors,
|
||||||
Spacer,
|
Spacer,
|
||||||
TableRows_immutable,
|
|
||||||
FlexRow,
|
FlexRow,
|
||||||
Glyph,
|
Glyph,
|
||||||
Link,
|
Link,
|
||||||
Text,
|
Text,
|
||||||
LoadingIndicator,
|
LoadingIndicator,
|
||||||
Tooltip,
|
Tooltip,
|
||||||
|
TableRows,
|
||||||
|
ManagedTable,
|
||||||
} from '../../ui';
|
} from '../../ui';
|
||||||
import React, {useCallback, useState, useEffect} from 'react';
|
import React, {useCallback, useState, useEffect} from 'react';
|
||||||
import {List} from 'immutable';
|
|
||||||
import {reportPlatformFailures, reportUsage} from '../../utils/metrics';
|
import {reportPlatformFailures, reportUsage} from '../../utils/metrics';
|
||||||
import reloadFlipper from '../../utils/reloadFlipper';
|
import reloadFlipper from '../../utils/reloadFlipper';
|
||||||
import {registerInstalledPlugins} from '../../reducers/plugins';
|
import {registerInstalledPlugins} from '../../reducers/plugins';
|
||||||
@@ -144,7 +143,7 @@ const PluginInstaller = function ({
|
|||||||
/>
|
/>
|
||||||
</SearchBox>
|
</SearchBox>
|
||||||
</Toolbar>
|
</Toolbar>
|
||||||
<ManagedTable_immutable
|
<ManagedTable
|
||||||
rowLineHeight={28}
|
rowLineHeight={28}
|
||||||
floating={false}
|
floating={false}
|
||||||
multiline
|
multiline
|
||||||
@@ -289,7 +288,7 @@ function useNPMSearch(
|
|||||||
query: string,
|
query: string,
|
||||||
onInstall: () => void,
|
onInstall: () => void,
|
||||||
installedPlugins: Map<string, InstalledPluginDetails>,
|
installedPlugins: Map<string, InstalledPluginDetails>,
|
||||||
): TableRows_immutable {
|
): TableRows {
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
reportUsage(`${TAG}:open`);
|
reportUsage(`${TAG}:open`);
|
||||||
}, []);
|
}, []);
|
||||||
@@ -358,7 +357,7 @@ function useNPMSearch(
|
|||||||
})();
|
})();
|
||||||
}, [query, installedPlugins]);
|
}, [query, installedPlugins]);
|
||||||
|
|
||||||
const rows: TableRows_immutable = List(searchResults.map(createRow));
|
const rows = searchResults.map(createRow);
|
||||||
return rows;
|
return rows;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,8 @@ exports[`load PluginInstaller list 1`] = `
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
class="css-1n5hbjk-View-FlexBox-FlexColumn-Container e11hk09w0"
|
class="css-p5h61d-View-FlexBox-FlexColumn-Container esta8x30"
|
||||||
|
tabindex="0"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="css-18abd42-View-FlexBox-FlexColumn ecr18to0"
|
class="css-18abd42-View-FlexBox-FlexColumn ecr18to0"
|
||||||
@@ -95,7 +96,10 @@ exports[`load PluginInstaller list 1`] = `
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
class="css-1n5hbjk-View-FlexBox-FlexColumn-Container e11hk09w0"
|
class="css-p5h61d-View-FlexBox-FlexColumn-Container esta8x30"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
class="css-18abd42-View-FlexBox-FlexColumn ecr18to0"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="css-1xll39b-View-FlexBox-FlexRow-TableBodyRowContainer ehuguum1"
|
class="css-1xll39b-View-FlexBox-FlexRow-TableBodyRowContainer ehuguum1"
|
||||||
@@ -240,6 +244,7 @@ exports[`load PluginInstaller list 1`] = `
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
<div
|
<div
|
||||||
class="css-1lxv8hi-Container-Horizontal-SandyToolbarContainer e1ecpah20"
|
class="css-1lxv8hi-Container-Horizontal-SandyToolbarContainer e1ecpah20"
|
||||||
>
|
>
|
||||||
@@ -322,7 +327,8 @@ exports[`load PluginInstaller list with one plugin installed 1`] = `
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
class="css-1n5hbjk-View-FlexBox-FlexColumn-Container e11hk09w0"
|
class="css-p5h61d-View-FlexBox-FlexColumn-Container esta8x30"
|
||||||
|
tabindex="0"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="css-18abd42-View-FlexBox-FlexColumn ecr18to0"
|
class="css-18abd42-View-FlexBox-FlexColumn ecr18to0"
|
||||||
@@ -397,7 +403,10 @@ exports[`load PluginInstaller list with one plugin installed 1`] = `
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
class="css-1n5hbjk-View-FlexBox-FlexColumn-Container e11hk09w0"
|
class="css-p5h61d-View-FlexBox-FlexColumn-Container esta8x30"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
class="css-18abd42-View-FlexBox-FlexColumn ecr18to0"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="css-1xll39b-View-FlexBox-FlexRow-TableBodyRowContainer ehuguum1"
|
class="css-1xll39b-View-FlexBox-FlexRow-TableBodyRowContainer ehuguum1"
|
||||||
@@ -542,6 +551,7 @@ exports[`load PluginInstaller list with one plugin installed 1`] = `
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
<div
|
<div
|
||||||
class="css-1lxv8hi-Container-Horizontal-SandyToolbarContainer e1ecpah20"
|
class="css-1lxv8hi-Container-Horizontal-SandyToolbarContainer e1ecpah20"
|
||||||
>
|
>
|
||||||
|
|||||||
Reference in New Issue
Block a user