Filter displayed plugins by selected device
Summary: Now that android devices know their own serial, we can filter plugins by the selected device. Reviewed By: passy Differential Revision: D9481461 fbshipit-source-id: 4a53eea1e61caa09c3d63ca0076fbc1b6dceb99f
This commit is contained in:
committed by
Facebook Github Bot
parent
edff177c3f
commit
0f08b04571
@@ -198,12 +198,22 @@ class MainSidebar extends Component<MainSidebarProps> {
|
|||||||
plugin={plugin}
|
plugin={plugin}
|
||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
{clients.map((client: Client) => (
|
{clients
|
||||||
|
.filter(
|
||||||
|
(client: Client) =>
|
||||||
|
(selectedDevice &&
|
||||||
|
client.query.device_id === selectedDevice.serial) ||
|
||||||
|
// Old android sdk versions don't know their device_id
|
||||||
|
// Display their plugins under all selected devices until they die out
|
||||||
|
client.query.device_id === 'unknown',
|
||||||
|
)
|
||||||
|
.map((client: Client) => (
|
||||||
<React.Fragment key={client.id}>
|
<React.Fragment key={client.id}>
|
||||||
<SidebarHeader>{client.query.app}</SidebarHeader>
|
<SidebarHeader>{client.query.app}</SidebarHeader>
|
||||||
{plugins
|
{plugins
|
||||||
.filter(
|
.filter(
|
||||||
(p: Class<SonarPlugin<>>) => client.plugins.indexOf(p.id) > -1,
|
(p: Class<SonarPlugin<>>) =>
|
||||||
|
client.plugins.indexOf(p.id) > -1,
|
||||||
)
|
)
|
||||||
.map((plugin: Class<SonarPlugin<>>) => (
|
.map((plugin: Class<SonarPlugin<>>) => (
|
||||||
<PluginSidebarListItem
|
<PluginSidebarListItem
|
||||||
|
|||||||
Reference in New Issue
Block a user