Allow selecting disabled, unsupported and not installed plugins

Summary:
This diffs removes restrictions on selecting disabled, uninstalled and unsupported plugins. Now it will be possible to select them, however for now empty view will be shown in such case.

In next diffs I'll add Plugin Info view which will be shown in case disabled plugin is selected. It will show static info about plugin - readme, version, oncall, user feedback group etc. This will make it possible for users to browse info about all plugins, even unsupported by selected device/app.

There is one problem that our analytics will be screwed by this change as even disabled plugins will be counted as used. I'll address this later in this stack.

If you see other potential problems with removing restrictions on selecting disabled plugins - please let me know.

Reviewed By: passy

Differential Revision: D29186005

fbshipit-source-id: 2e55c5fd3bb402594f4dbace6e287725de65bc6f
This commit is contained in:
Anton Nikolaev
2021-06-29 13:00:18 -07:00
committed by Facebook GitHub Bot
parent bf1b10c130
commit 7bc38c1735
14 changed files with 13 additions and 115 deletions

View File

@@ -51,11 +51,6 @@ export type DevicePluginPredicate = (device: Device) => boolean;
export type DevicePluginFactory = (client: DevicePluginClient) => object;
export interface DevicePluginClient extends BasePluginClient {
/**
* Checks if the provided plugin is available for the current device
*/
isPluginAvailable(pluginId: string): boolean;
/**
* opens a different plugin by id, optionally providing a deeplink to bring the plugin to a certain state
*/
@@ -77,7 +72,6 @@ export interface RealFlipperDevice {
addLogListener(callback: DeviceLogListener): Symbol;
removeLogListener(id: Symbol): void;
addLogEntry(entry: DeviceLogEntry): void;
devicePlugins: string[];
}
export class SandyDevicePluginInstance extends BasePluginInstance {
@@ -98,13 +92,8 @@ export class SandyDevicePluginInstance extends BasePluginInstance {
super(flipperLib, definition, realDevice, pluginKey, initialStates);
this.client = {
...this.createBasePluginClient(),
isPluginAvailable(pluginId: string) {
return flipperLib.isPluginAvailable(realDevice, null, pluginId);
},
selectPlugin(pluginId: string, deeplink?: unknown) {
if (this.isPluginAvailable(pluginId)) {
flipperLib.selectPlugin(realDevice, null, pluginId, deeplink);
}
flipperLib.selectPlugin(realDevice, null, pluginId, deeplink);
},
get isConnected() {
return realDevice.connected.get();