Bump prettier from 2.2.1 to 2.3.0 in /desktop (#2300)
Summary: Bumps [prettier](https://github.com/prettier/prettier) from 2.2.1 to 2.3.0. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/prettier/prettier/releases">prettier's releases</a>.</em></p> <blockquote> <h2>2.3.0</h2> <p><a href="https://github.com/prettier/prettier/compare/2.2.1...2.3.0">diff</a></p> <p>{emoji:1f517} <a href="https://prettier.io/blog/2021/05/09/2.3.0.html">Release Notes</a></p> </blockquote> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/prettier/prettier/blob/main/CHANGELOG.md">prettier's changelog</a>.</em></p> <blockquote> <h1>2.3.0</h1> <p><a href="https://github.com/prettier/prettier/compare/2.2.1...2.3.0">diff</a></p> <p>{emoji:1f517} <a href="https://prettier.io/blog/2021/05/09/2.3.0.html">Release Notes</a></p> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="2afc3b9ae6"><code>2afc3b9</code></a> Release 2.3.0</li> <li><a href="7cfa9aa89b"><code>7cfa9aa</code></a> Fix pre-commit hook setup command (<a href="https://github-redirect.dependabot.com/prettier/prettier/issues/10710">#10710</a>)</li> <li><a href="c8c02b4753"><code>c8c02b4</code></a> Build(deps-dev): Bump concurrently from 6.0.2 to 6.1.0 in /website (<a href="https://github-redirect.dependabot.com/prettier/prettier/issues/10834">#10834</a>)</li> <li><a href="6506e0f50e"><code>6506e0f</code></a> Build(deps-dev): Bump webpack-cli from 4.6.0 to 4.7.0 in /website (<a href="https://github-redirect.dependabot.com/prettier/prettier/issues/10836">#10836</a>)</li> <li><a href="69fae9c291"><code>69fae9c</code></a> Build(deps): Bump flow-parser from 0.150.0 to 0.150.1 (<a href="https://github-redirect.dependabot.com/prettier/prettier/issues/10839">#10839</a>)</li> <li><a href="164a6e2351"><code>164a6e2</code></a> Switch CLI to async (<a href="https://github-redirect.dependabot.com/prettier/prettier/issues/10804">#10804</a>)</li> <li><a href="d3e7e2f634"><code>d3e7e2f</code></a> Build(deps): Bump codecov/codecov-action from v1.4.1 to v1.5.0 (<a href="https://github-redirect.dependabot.com/prettier/prettier/issues/10833">#10833</a>)</li> <li><a href="9e09845da0"><code>9e09845</code></a> Build(deps): Bump <code>@angular/compiler</code> from 11.2.12 to 11.2.13 (<a href="https://github-redirect.dependabot.com/prettier/prettier/issues/10838">#10838</a>)</li> <li><a href="1bfab3d045"><code>1bfab3d</code></a> Build(deps-dev): Bump eslint from 7.25.0 to 7.26.0 (<a href="https://github-redirect.dependabot.com/prettier/prettier/issues/10840">#10840</a>)</li> <li><a href="387fce4ed8"><code>387fce4</code></a> Minor formatting tweaks (<a href="https://github-redirect.dependabot.com/prettier/prettier/issues/10807">#10807</a>)</li> <li>Additional commits viewable in <a href="https://github.com/prettier/prettier/compare/2.2.1...2.3.0">compare view</a></li> </ul> </details> <br /> [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `dependabot rebase` will rebase this PR - `dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `dependabot merge` will merge this PR after your CI passes on it - `dependabot squash and merge` will squash and merge this PR after your CI passes on it - `dependabot cancel merge` will cancel a previously requested merge and block automerging - `dependabot reopen` will reopen this PR if it is closed - `dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> Pull Request resolved: https://github.com/facebook/flipper/pull/2300 Reviewed By: passy Differential Revision: D28323849 Pulled By: cekkaewnumchai fbshipit-source-id: 1842877ccc9a9587af7f0d9ff9432c2075c8ee22
This commit is contained in:
committed by
Facebook GitHub Bot
parent
b3bacc4812
commit
674f71a426
@@ -157,42 +157,41 @@ class NotificationsTable extends Component<Props & SearchableProps, State> {
|
||||
);
|
||||
};
|
||||
|
||||
getFilter = (): ((n: PluginNotification) => boolean) => (
|
||||
n: PluginNotification,
|
||||
) => {
|
||||
const searchTerm = this.props.searchTerm.toLowerCase();
|
||||
getFilter =
|
||||
(): ((n: PluginNotification) => boolean) => (n: PluginNotification) => {
|
||||
const searchTerm = this.props.searchTerm.toLowerCase();
|
||||
|
||||
// filter plugins
|
||||
const blocklistedPlugins = new Set(
|
||||
this.props.blocklistedPlugins.map((p) => p.toLowerCase()),
|
||||
);
|
||||
if (blocklistedPlugins.has(n.pluginId.toLowerCase())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// filter categories
|
||||
const {category} = n.notification;
|
||||
if (category) {
|
||||
const blocklistedCategories = new Set(
|
||||
this.props.blocklistedCategories.map((p) => p.toLowerCase()),
|
||||
// filter plugins
|
||||
const blocklistedPlugins = new Set(
|
||||
this.props.blocklistedPlugins.map((p) => p.toLowerCase()),
|
||||
);
|
||||
if (blocklistedCategories.has(category.toLowerCase())) {
|
||||
if (blocklistedPlugins.has(n.pluginId.toLowerCase())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (searchTerm.length === 0) {
|
||||
return true;
|
||||
} else if (n.notification.title.toLowerCase().indexOf(searchTerm) > -1) {
|
||||
return true;
|
||||
} else if (
|
||||
typeof n.notification.message === 'string' &&
|
||||
n.notification.message.toLowerCase().indexOf(searchTerm) > -1
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
};
|
||||
// filter categories
|
||||
const {category} = n.notification;
|
||||
if (category) {
|
||||
const blocklistedCategories = new Set(
|
||||
this.props.blocklistedCategories.map((p) => p.toLowerCase()),
|
||||
);
|
||||
if (blocklistedCategories.has(category.toLowerCase())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (searchTerm.length === 0) {
|
||||
return true;
|
||||
} else if (n.notification.title.toLowerCase().indexOf(searchTerm) > -1) {
|
||||
return true;
|
||||
} else if (
|
||||
typeof n.notification.message === 'string' &&
|
||||
n.notification.message.toLowerCase().indexOf(searchTerm) > -1
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
getPlugin = (id: string) =>
|
||||
this.props.clientPlugins.get(id) || this.props.devicePlugins.get(id);
|
||||
|
||||
@@ -207,13 +207,8 @@ class PluginContainer extends PureComponent<Props, State> {
|
||||
}
|
||||
|
||||
processMessageQueue() {
|
||||
const {
|
||||
pluginKey,
|
||||
pendingMessages,
|
||||
activePlugin,
|
||||
pluginIsEnabled,
|
||||
target,
|
||||
} = this.props;
|
||||
const {pluginKey, pendingMessages, activePlugin, pluginIsEnabled, target} =
|
||||
this.props;
|
||||
if (pluginKey !== this.pluginBeingProcessed) {
|
||||
this.pluginBeingProcessed = pluginKey;
|
||||
this.cancelCurrentQueue();
|
||||
@@ -273,13 +268,8 @@ class PluginContainer extends PureComponent<Props, State> {
|
||||
}
|
||||
|
||||
render() {
|
||||
const {
|
||||
activePlugin,
|
||||
pluginKey,
|
||||
target,
|
||||
pendingMessages,
|
||||
pluginIsEnabled,
|
||||
} = this.props;
|
||||
const {activePlugin, pluginKey, target, pendingMessages, pluginIsEnabled} =
|
||||
this.props;
|
||||
if (!activePlugin || !target || !pluginKey) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -150,13 +150,8 @@ test('PluginContainer can render Sandy plugins', async () => {
|
||||
Component: MySandyPlugin,
|
||||
},
|
||||
);
|
||||
const {
|
||||
renderer,
|
||||
act,
|
||||
sendMessage,
|
||||
client,
|
||||
store,
|
||||
} = await renderMockFlipperWithPlugin(definition);
|
||||
const {renderer, act, sendMessage, client, store} =
|
||||
await renderMockFlipperWithPlugin(definition);
|
||||
|
||||
expect(client.rawSend).toBeCalledWith('init', {plugin: 'TestPlugin'});
|
||||
|
||||
@@ -211,9 +206,8 @@ test('PluginContainer can render Sandy plugins', async () => {
|
||||
`);
|
||||
|
||||
// make sure the plugin gets connected
|
||||
const pluginInstance: ReturnType<
|
||||
typeof plugin
|
||||
> = client.sandyPluginStates.get(definition.id)!.instanceApi;
|
||||
const pluginInstance: ReturnType<typeof plugin> =
|
||||
client.sandyPluginStates.get(definition.id)!.instanceApi;
|
||||
expect(pluginInstance.connectedStub).toBeCalledTimes(1);
|
||||
expect(pluginInstance.disconnectedStub).toBeCalledTimes(0);
|
||||
expect(pluginInstance.activatedStub).toBeCalledTimes(1);
|
||||
@@ -359,9 +353,8 @@ test('PluginContainer triggers correct lifecycles for background plugin', async
|
||||
expect(client.rawSend).toBeCalledWith('init', {plugin: 'TestPlugin'});
|
||||
(client.rawSend as jest.Mock).mockClear();
|
||||
// make sure the plugin gets connected
|
||||
const pluginInstance: ReturnType<
|
||||
typeof plugin
|
||||
> = client.sandyPluginStates.get(definition.id)!.instanceApi;
|
||||
const pluginInstance: ReturnType<typeof plugin> =
|
||||
client.sandyPluginStates.get(definition.id)!.instanceApi;
|
||||
expect(pluginInstance.connectedStub).toBeCalledTimes(1);
|
||||
expect(pluginInstance.disconnectedStub).toBeCalledTimes(0);
|
||||
expect(pluginInstance.activatedStub).toBeCalledTimes(1);
|
||||
@@ -440,9 +433,8 @@ test('PluginContainer triggers correct lifecycles for background plugin', async
|
||||
expect(pluginInstance.activatedStub).toBeCalledTimes(2);
|
||||
expect(pluginInstance.deactivatedStub).toBeCalledTimes(2);
|
||||
|
||||
const newPluginInstance: ReturnType<
|
||||
typeof plugin
|
||||
> = client.sandyPluginStates.get('TestPlugin')!.instanceApi;
|
||||
const newPluginInstance: ReturnType<typeof plugin> =
|
||||
client.sandyPluginStates.get('TestPlugin')!.instanceApi;
|
||||
expect(newPluginInstance.connectedStub).toBeCalledTimes(1);
|
||||
expect(newPluginInstance.disconnectedStub).toBeCalledTimes(0);
|
||||
expect(newPluginInstance.activatedStub).toBeCalledTimes(0);
|
||||
@@ -705,9 +697,8 @@ test('PluginContainer can render Sandy device plugins', async () => {
|
||||
`);
|
||||
|
||||
// make sure the plugin gets connected
|
||||
const pluginInstance: ReturnType<
|
||||
typeof devicePlugin
|
||||
> = device.sandyPluginStates.get(definition.id)!.instanceApi;
|
||||
const pluginInstance: ReturnType<typeof devicePlugin> =
|
||||
device.sandyPluginStates.get(definition.id)!.instanceApi;
|
||||
expect(pluginInstance.activatedStub).toBeCalledTimes(1);
|
||||
expect(pluginInstance.deactivatedStub).toBeCalledTimes(0);
|
||||
|
||||
@@ -959,9 +950,8 @@ test('Sandy plugins support isPluginSupported + selectPlugin', async () => {
|
||||
`);
|
||||
expect(renders).toBe(1);
|
||||
|
||||
const pluginInstance: ReturnType<
|
||||
typeof plugin
|
||||
> = client.sandyPluginStates.get(definition.id)!.instanceApi;
|
||||
const pluginInstance: ReturnType<typeof plugin> =
|
||||
client.sandyPluginStates.get(definition.id)!.instanceApi;
|
||||
expect(pluginInstance.isPluginAvailable(definition.id)).toBeTruthy();
|
||||
expect(pluginInstance.isPluginAvailable('nonsense')).toBeFalsy();
|
||||
expect(pluginInstance.isPluginAvailable(definition2.id)).toBeFalsy(); // not enabled yet
|
||||
@@ -1076,12 +1066,10 @@ test('PluginContainer can render Sandy plugins for archived devices', async () =
|
||||
Component: MySandyPlugin,
|
||||
},
|
||||
);
|
||||
const {
|
||||
renderer,
|
||||
act,
|
||||
client,
|
||||
store,
|
||||
} = await renderMockFlipperWithPlugin(definition, {archivedDevice: true});
|
||||
const {renderer, act, client, store} = await renderMockFlipperWithPlugin(
|
||||
definition,
|
||||
{archivedDevice: true},
|
||||
);
|
||||
|
||||
expect(client.rawSend).not.toBeCalled();
|
||||
|
||||
@@ -1106,9 +1094,8 @@ test('PluginContainer can render Sandy plugins for archived devices', async () =
|
||||
expect(renders).toBe(1);
|
||||
|
||||
// make sure the plugin gets activated, but not connected!
|
||||
const pluginInstance: ReturnType<
|
||||
typeof plugin
|
||||
> = client.sandyPluginStates.get(definition.id)!.instanceApi;
|
||||
const pluginInstance: ReturnType<typeof plugin> =
|
||||
client.sandyPluginStates.get(definition.id)!.instanceApi;
|
||||
expect(pluginInstance.connectedStub).toBeCalledTimes(0);
|
||||
expect(pluginInstance.disconnectedStub).toBeCalledTimes(0);
|
||||
expect(pluginInstance.activatedStub).toBeCalledTimes(1);
|
||||
@@ -1210,9 +1197,8 @@ test('PluginContainer triggers correct lifecycles for background plugin', async
|
||||
|
||||
expect(client.rawSend).not.toBeCalled();
|
||||
// make sure the plugin gets connected
|
||||
const pluginInstance: ReturnType<
|
||||
typeof plugin
|
||||
> = client.sandyPluginStates.get(definition.id)!.instanceApi;
|
||||
const pluginInstance: ReturnType<typeof plugin> =
|
||||
client.sandyPluginStates.get(definition.id)!.instanceApi;
|
||||
expect(pluginInstance.connectedStub).toBeCalledTimes(0);
|
||||
expect(pluginInstance.disconnectedStub).toBeCalledTimes(0);
|
||||
expect(pluginInstance.activatedStub).toBeCalledTimes(1);
|
||||
|
||||
@@ -40,12 +40,8 @@ class TestPlugin extends FlipperPlugin<any, any, any> {
|
||||
}
|
||||
|
||||
test('can create a Fake flipper', async () => {
|
||||
const {
|
||||
client,
|
||||
device,
|
||||
store,
|
||||
sendMessage,
|
||||
} = await createMockFlipperWithPlugin(TestPlugin);
|
||||
const {client, device, store, sendMessage} =
|
||||
await createMockFlipperWithPlugin(TestPlugin);
|
||||
expect(client).toBeTruthy();
|
||||
expect(device).toBeTruthy();
|
||||
expect(store).toBeTruthy();
|
||||
|
||||
@@ -66,10 +66,7 @@ test('persistedStateReducer is adding data', () => {
|
||||
const tablePlugin = createTablePlugin({...PROPS, method});
|
||||
const id = '1';
|
||||
|
||||
const {
|
||||
rows,
|
||||
datas,
|
||||
} = tablePlugin.persistedStateReducer(
|
||||
const {rows, datas} = tablePlugin.persistedStateReducer(
|
||||
tablePlugin.defaultPersistedState,
|
||||
method,
|
||||
{id},
|
||||
|
||||
@@ -213,14 +213,10 @@ test('new clients replace old ones', async () => {
|
||||
},
|
||||
},
|
||||
);
|
||||
const {
|
||||
client,
|
||||
store,
|
||||
device,
|
||||
createClient,
|
||||
} = await createMockFlipperWithPlugin(plugin, {
|
||||
asBackgroundPlugin: true,
|
||||
});
|
||||
const {client, store, device, createClient} =
|
||||
await createMockFlipperWithPlugin(plugin, {
|
||||
asBackgroundPlugin: true,
|
||||
});
|
||||
|
||||
const instance = client.sandyPluginStates.get(plugin.id)!;
|
||||
instance.instanceApi.counter.set(1);
|
||||
|
||||
@@ -372,10 +372,8 @@ class RatingButton extends Component<PropsFromState, State> {
|
||||
}
|
||||
|
||||
export function SandyRatingButton() {
|
||||
const [
|
||||
promptData,
|
||||
setPromptData,
|
||||
] = useState<UserFeedback.FeedbackPrompt | null>(null);
|
||||
const [promptData, setPromptData] =
|
||||
useState<UserFeedback.FeedbackPrompt | null>(null);
|
||||
const [isShown, setIsShown] = useState(false);
|
||||
const [hasTriggered, setHasTriggered] = useState(false);
|
||||
const sessionId = useStore((store) => store.application.sessionId);
|
||||
|
||||
@@ -122,13 +122,11 @@ export default class ShareSheetExportUrl extends Component<Props, State> {
|
||||
this.setState({statusUpdate: msg});
|
||||
}
|
||||
};
|
||||
const {
|
||||
serializedString,
|
||||
fetchMetaDataErrors,
|
||||
} = await reportPlatformFailures(
|
||||
exportStore(this.store, false, this.idler, statusUpdate),
|
||||
`${EXPORT_FLIPPER_TRACE_EVENT}:UI_LINK`,
|
||||
);
|
||||
const {serializedString, fetchMetaDataErrors} =
|
||||
await reportPlatformFailures(
|
||||
exportStore(this.store, false, this.idler, statusUpdate),
|
||||
`${EXPORT_FLIPPER_TRACE_EVENT}:UI_LINK`,
|
||||
);
|
||||
const uploadMarker = `${EXPORT_FLIPPER_TRACE_EVENT}:upload`;
|
||||
performance.mark(uploadMarker);
|
||||
statusUpdate('Uploading Flipper Export...');
|
||||
|
||||
@@ -32,10 +32,8 @@ export type VersionCheckResult =
|
||||
};
|
||||
|
||||
export default function UpdateIndicator() {
|
||||
const [
|
||||
versionCheckResult,
|
||||
setVersionCheckResult,
|
||||
] = useState<VersionCheckResult>({kind: 'up-to-date'});
|
||||
const [versionCheckResult, setVersionCheckResult] =
|
||||
useState<VersionCheckResult>({kind: 'up-to-date'});
|
||||
const launcherMsg = useStore((state) => state.application.launcherMsg);
|
||||
|
||||
// Effect to show notification if details change
|
||||
|
||||
@@ -42,15 +42,10 @@ TestDevicePlugin.defaultPersistedState = {msg: 'TestDevicePlugin'};
|
||||
|
||||
test('SettingsSheet snapshot with nothing enabled', async () => {
|
||||
let root: ReactTestRenderer;
|
||||
const {
|
||||
store,
|
||||
togglePlugin,
|
||||
client,
|
||||
device,
|
||||
pluginKey,
|
||||
} = await createMockFlipperWithPlugin(TestPlugin, {
|
||||
additionalPlugins: [TestDevicePlugin],
|
||||
});
|
||||
const {store, togglePlugin, client, device, pluginKey} =
|
||||
await createMockFlipperWithPlugin(TestPlugin, {
|
||||
additionalPlugins: [TestDevicePlugin],
|
||||
});
|
||||
|
||||
togglePlugin();
|
||||
|
||||
|
||||
@@ -185,17 +185,16 @@ function InstallButton(props: {
|
||||
| {kind: 'Remove'; error?: string}
|
||||
| {kind: 'Update'; error?: string};
|
||||
|
||||
const catchError = (
|
||||
actionKind: 'Install' | 'Remove' | 'Update',
|
||||
fn: () => Promise<void>,
|
||||
) => async () => {
|
||||
try {
|
||||
await fn();
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
setAction({kind: actionKind, error: err.toString()});
|
||||
}
|
||||
};
|
||||
const catchError =
|
||||
(actionKind: 'Install' | 'Remove' | 'Update', fn: () => Promise<void>) =>
|
||||
async () => {
|
||||
try {
|
||||
await fn();
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
setAction({kind: actionKind, error: err.toString()});
|
||||
}
|
||||
};
|
||||
|
||||
const mkInstallCallback = (action: 'Install' | 'Update') =>
|
||||
catchError(action, async () => {
|
||||
|
||||
@@ -112,12 +112,10 @@ const KeyboardShortcutInput = (props: {
|
||||
const [initialPressedKeys] = useState<PressedKeys>(
|
||||
getInitialStateFromProps(),
|
||||
);
|
||||
const [pressedKeys, setPressedKeys] = useState<PressedKeys>(
|
||||
initialPressedKeys,
|
||||
);
|
||||
const [isShortcutValid, setIsShortcutValid] = useState<boolean | undefined>(
|
||||
undefined,
|
||||
);
|
||||
const [pressedKeys, setPressedKeys] =
|
||||
useState<PressedKeys>(initialPressedKeys);
|
||||
const [isShortcutValid, setIsShortcutValid] =
|
||||
useState<boolean | undefined>(undefined);
|
||||
|
||||
useEffect(() => {
|
||||
if (!isShortcutValid) {
|
||||
|
||||
@@ -69,8 +69,8 @@ const iosEmulatorDevicePlugin = new _SandyPluginDefinition(
|
||||
iosEmulatorlDevicePluginDetails,
|
||||
DeviceTestPluginModule,
|
||||
);
|
||||
const androiKaiosPhysicalDevicePluginDetails = TestUtils.createMockPluginDetails(
|
||||
{
|
||||
const androiKaiosPhysicalDevicePluginDetails =
|
||||
TestUtils.createMockPluginDetails({
|
||||
id: 'androidPhysicalDevicePlugin',
|
||||
name: 'flipper-plugin-android-physical-device',
|
||||
version: '0.0.1',
|
||||
@@ -82,8 +82,7 @@ const androiKaiosPhysicalDevicePluginDetails = TestUtils.createMockPluginDetails
|
||||
specs: ['KaiOS'],
|
||||
},
|
||||
],
|
||||
},
|
||||
);
|
||||
});
|
||||
const androidKaiosPhysicalDevicePlugin = new _SandyPluginDefinition(
|
||||
androiKaiosPhysicalDevicePluginDetails,
|
||||
DeviceTestPluginModule,
|
||||
|
||||
@@ -47,16 +47,9 @@ function createDevice(
|
||||
const isKaiOSDevice = Object.keys(props).some(
|
||||
(name) => name.startsWith('kaios') || name.startsWith('ro.kaios'),
|
||||
);
|
||||
const androidLikeDevice = new (isKaiOSDevice
|
||||
? KaiOSDevice
|
||||
: AndroidDevice)(
|
||||
device.id,
|
||||
type,
|
||||
name,
|
||||
adbClient,
|
||||
abiList,
|
||||
sdkVersion,
|
||||
);
|
||||
const androidLikeDevice = new (
|
||||
isKaiOSDevice ? KaiOSDevice : AndroidDevice
|
||||
)(device.id, type, name, adbClient, abiList, sdkVersion);
|
||||
if (ports) {
|
||||
await androidLikeDevice
|
||||
.reverse([ports.secure, ports.insecure])
|
||||
|
||||
@@ -100,9 +100,8 @@ export default (store: Store, logger: Logger) => {
|
||||
return;
|
||||
}
|
||||
|
||||
const persistingPlugin: undefined | PluginDefinition = getPlugin(
|
||||
pluginName,
|
||||
);
|
||||
const persistingPlugin: undefined | PluginDefinition =
|
||||
getPlugin(pluginName);
|
||||
if (
|
||||
persistingPlugin &&
|
||||
!isSandyPlugin(persistingPlugin) &&
|
||||
@@ -129,11 +128,8 @@ export default (store: Store, logger: Logger) => {
|
||||
}
|
||||
});
|
||||
|
||||
const {
|
||||
activeNotifications,
|
||||
blocklistedPlugins,
|
||||
blocklistedCategories,
|
||||
} = notifications;
|
||||
const {activeNotifications, blocklistedPlugins, blocklistedCategories} =
|
||||
notifications;
|
||||
|
||||
activeNotifications
|
||||
.map((n) => ({
|
||||
|
||||
@@ -124,7 +124,7 @@ function reportVersion(pluginDetails: ActivatablePluginDetails) {
|
||||
|
||||
export function filterNewestVersionOfEachPlugin<
|
||||
T1 extends PluginDetails,
|
||||
T2 extends PluginDetails
|
||||
T2 extends PluginDetails,
|
||||
>(bundledPlugins: T1[], dynamicPlugins: T2[]): (T1 | T2)[] {
|
||||
const pluginByName: {[key: string]: T1 | T2} = {};
|
||||
for (const plugin of bundledPlugins) {
|
||||
@@ -170,23 +170,23 @@ export async function getDynamicPlugins() {
|
||||
}
|
||||
}
|
||||
|
||||
export const checkGK = (gatekeepedPlugins: Array<ActivatablePluginDetails>) => (
|
||||
plugin: ActivatablePluginDetails,
|
||||
): boolean => {
|
||||
try {
|
||||
if (!plugin.gatekeeper) {
|
||||
return true;
|
||||
export const checkGK =
|
||||
(gatekeepedPlugins: Array<ActivatablePluginDetails>) =>
|
||||
(plugin: ActivatablePluginDetails): boolean => {
|
||||
try {
|
||||
if (!plugin.gatekeeper) {
|
||||
return true;
|
||||
}
|
||||
const result = GK.get(plugin.gatekeeper);
|
||||
if (!result) {
|
||||
gatekeepedPlugins.push(plugin);
|
||||
}
|
||||
return result;
|
||||
} catch (err) {
|
||||
console.error(`Failed to check GK for plugin ${plugin.id}`, err);
|
||||
return false;
|
||||
}
|
||||
const result = GK.get(plugin.gatekeeper);
|
||||
if (!result) {
|
||||
gatekeepedPlugins.push(plugin);
|
||||
}
|
||||
return result;
|
||||
} catch (err) {
|
||||
console.error(`Failed to check GK for plugin ${plugin.id}`, err);
|
||||
return false;
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
export const checkDisabled = (
|
||||
disabledPlugins: Array<ActivatablePluginDetails>,
|
||||
|
||||
@@ -89,11 +89,8 @@ export default (store: Store, logger: Logger) => {
|
||||
timeSinceLastStartup,
|
||||
});
|
||||
// create fresh exit data
|
||||
const {
|
||||
selectedDevice,
|
||||
selectedApp,
|
||||
selectedPlugin,
|
||||
} = store.getState().connections;
|
||||
const {selectedDevice, selectedApp, selectedPlugin} =
|
||||
store.getState().connections;
|
||||
persistExitData(
|
||||
{
|
||||
selectedDevice,
|
||||
@@ -142,12 +139,8 @@ export default (store: Store, logger: Logger) => {
|
||||
);
|
||||
return;
|
||||
}
|
||||
const {
|
||||
selectedDevice,
|
||||
selectedPlugin,
|
||||
selectedApp,
|
||||
clients,
|
||||
} = state.connections;
|
||||
const {selectedDevice, selectedPlugin, selectedApp, clients} =
|
||||
state.connections;
|
||||
|
||||
persistExitData(
|
||||
{selectedDevice, selectedPlugin, selectedApp},
|
||||
|
||||
@@ -20,9 +20,10 @@ const instance = {
|
||||
debug: jest.fn(),
|
||||
};
|
||||
|
||||
export function extractError(
|
||||
...data: Array<any>
|
||||
): {message: string; error: Error} {
|
||||
export function extractError(...data: Array<any>): {
|
||||
message: string;
|
||||
error: Error;
|
||||
} {
|
||||
const message = data.map(getStringFromErrorLike).join(' ');
|
||||
const error = data.find((e) => e instanceof Error) || new Error(message);
|
||||
return {
|
||||
|
||||
@@ -206,11 +206,9 @@ function init() {
|
||||
dark: state.settingsState.darkMode,
|
||||
}),
|
||||
(theme) => {
|
||||
(document.getElementById(
|
||||
'flipper-theme-import',
|
||||
) as HTMLLinkElement).href = `themes/${
|
||||
theme.dark ? 'dark' : 'light'
|
||||
}.css`;
|
||||
(
|
||||
document.getElementById('flipper-theme-import') as HTMLLinkElement
|
||||
).href = `themes/${theme.dark ? 'dark' : 'light'}.css`;
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
@@ -96,7 +96,7 @@ type StaticPersistedState = any;
|
||||
export abstract class FlipperBasePlugin<
|
||||
State,
|
||||
Actions extends BaseAction,
|
||||
PersistedState
|
||||
PersistedState,
|
||||
> extends Component<Props<PersistedState>, State> {
|
||||
abstract ['constructor']: any;
|
||||
static title: string | null = null;
|
||||
@@ -197,7 +197,7 @@ export abstract class FlipperBasePlugin<
|
||||
export class FlipperDevicePlugin<
|
||||
S,
|
||||
A extends BaseAction,
|
||||
P
|
||||
P,
|
||||
> extends FlipperBasePlugin<S, A, P> {
|
||||
['constructor']: typeof FlipperPlugin;
|
||||
device: BaseDevice;
|
||||
@@ -226,7 +226,7 @@ export class FlipperDevicePlugin<
|
||||
export class FlipperPlugin<
|
||||
S,
|
||||
A extends BaseAction,
|
||||
P
|
||||
P,
|
||||
> extends FlipperBasePlugin<S, A, P> {
|
||||
['constructor']: typeof FlipperPlugin;
|
||||
constructor(props: Props<P>) {
|
||||
|
||||
@@ -470,13 +470,8 @@ export default function createTableNativePlugin(id: string, title: string) {
|
||||
if (!this.props.persistedState.tableMetadata) {
|
||||
return 'Loading...';
|
||||
}
|
||||
const {
|
||||
topToolbar,
|
||||
bottomToolbar,
|
||||
columns,
|
||||
columnSizes,
|
||||
columnOrder,
|
||||
} = this.props.persistedState.tableMetadata;
|
||||
const {topToolbar, bottomToolbar, columns, columnSizes, columnOrder} =
|
||||
this.props.persistedState.tableMetadata;
|
||||
const {rows} = this.props.persistedState;
|
||||
|
||||
const topToolbarComponent = topToolbar ? renderToolbar(topToolbar) : null;
|
||||
|
||||
@@ -71,8 +71,9 @@ test('it should initialize device sandy plugins', async () => {
|
||||
expect(device.sandyPluginStates.get(TestPlugin.id)).toBeInstanceOf(
|
||||
_SandyDevicePluginInstance,
|
||||
);
|
||||
const instanceApi: PluginApi = device.sandyPluginStates.get(TestPlugin.id)!
|
||||
.instanceApi;
|
||||
const instanceApi: PluginApi = device.sandyPluginStates.get(
|
||||
TestPlugin.id,
|
||||
)!.instanceApi;
|
||||
|
||||
expect(instanceApi.activateStub).toBeCalledTimes(0);
|
||||
selectTestPlugin(store);
|
||||
|
||||
@@ -85,8 +85,9 @@ test('it should initialize starred sandy plugins', async () => {
|
||||
expect(client.sandyPluginStates.get(TestPlugin.id)).toBeInstanceOf(
|
||||
_SandyPluginInstance,
|
||||
);
|
||||
const instanceApi: PluginApi = client.sandyPluginStates.get(TestPlugin.id)!
|
||||
.instanceApi;
|
||||
const instanceApi: PluginApi = client.sandyPluginStates.get(
|
||||
TestPlugin.id,
|
||||
)!.instanceApi;
|
||||
|
||||
expect(instanceApi.connectStub).toBeCalledTimes(0);
|
||||
selectTestPlugin(store, client);
|
||||
@@ -104,8 +105,9 @@ test('it should cleanup a plugin if disabled', async () => {
|
||||
const {client, store} = await createMockFlipperWithPlugin(TestPlugin);
|
||||
|
||||
expect(TestPlugin.asPluginModule().plugin).toBeCalledTimes(1);
|
||||
const pluginInstance: PluginApi = client.sandyPluginStates.get(TestPlugin.id)!
|
||||
.instanceApi;
|
||||
const pluginInstance: PluginApi = client.sandyPluginStates.get(
|
||||
TestPlugin.id,
|
||||
)!.instanceApi;
|
||||
expect(pluginInstance.destroyStub).toHaveBeenCalledTimes(0);
|
||||
client.initPlugin(TestPlugin.id);
|
||||
expect(pluginInstance.connectStub).toHaveBeenCalledTimes(1);
|
||||
@@ -210,8 +212,9 @@ test('it trigger hooks for background plugins', async () => {
|
||||
const {client} = await createMockFlipperWithPlugin(TestPlugin, {
|
||||
asBackgroundPlugin: true,
|
||||
});
|
||||
const pluginInstance: PluginApi = client.sandyPluginStates.get(TestPlugin.id)!
|
||||
.instanceApi;
|
||||
const pluginInstance: PluginApi = client.sandyPluginStates.get(
|
||||
TestPlugin.id,
|
||||
)!.instanceApi;
|
||||
expect(client.isBackgroundPlugin(TestPlugin.id)).toBeTruthy();
|
||||
expect(pluginInstance.destroyStub).toHaveBeenCalledTimes(0);
|
||||
expect(pluginInstance.connectStub).toHaveBeenCalledTimes(1);
|
||||
@@ -234,8 +237,9 @@ test('it can send messages from sandy clients', async () => {
|
||||
}
|
||||
},
|
||||
});
|
||||
const pluginInstance: PluginApi = client.sandyPluginStates.get(TestPlugin.id)!
|
||||
.instanceApi;
|
||||
const pluginInstance: PluginApi = client.sandyPluginStates.get(
|
||||
TestPlugin.id,
|
||||
)!.instanceApi;
|
||||
// without rendering, non-bg plugins won't connect automatically,
|
||||
client.initPlugin(TestPlugin.id);
|
||||
await pluginInstance.send('test', {test: 3});
|
||||
|
||||
@@ -124,8 +124,8 @@ export class Group {
|
||||
let errorMessage: string | undefined = undefined;
|
||||
if (selectedApp) {
|
||||
const {app} = deconstructClientId(selectedApp);
|
||||
const enabledPlugins: Array<string> | null = store.getState().connections
|
||||
.enabledPlugins[app];
|
||||
const enabledPlugins: Array<string> | null =
|
||||
store.getState().connections.enabledPlugins[app];
|
||||
const unsupportedPlugins = [];
|
||||
for (const requiredPlugin of this.requiredPlugins) {
|
||||
const requiredPluginEnabled =
|
||||
|
||||
@@ -61,10 +61,8 @@ export function SandyApp() {
|
||||
* The logic here is to sync both, but without modifying the navigation related reducers to not break classic Flipper.
|
||||
* It is possible to simplify this in the future.
|
||||
*/
|
||||
const [
|
||||
toplevelSelection,
|
||||
setStoredToplevelSelection,
|
||||
] = useState<ToplevelNavItem>('appinspect');
|
||||
const [toplevelSelection, setStoredToplevelSelection] =
|
||||
useState<ToplevelNavItem>('appinspect');
|
||||
|
||||
// Handle toplevel nav clicks from LeftRail
|
||||
const setToplevelSelection = useCallback(
|
||||
|
||||
@@ -212,9 +212,10 @@ export default function SetupDoctorScreen(props: {
|
||||
const [acknowlodgeProblem, setAcknowlodgeProblem] = useState(
|
||||
checkHasNewProblem(healthcheckReport.result),
|
||||
);
|
||||
const hasProblem = useMemo(() => checkHasProblem(healthcheckReport.result), [
|
||||
healthcheckReport,
|
||||
]);
|
||||
const hasProblem = useMemo(
|
||||
() => checkHasProblem(healthcheckReport.result),
|
||||
[healthcheckReport],
|
||||
);
|
||||
const onCloseModal = useCallback(() => {
|
||||
const hasNewProblem = checkHasNewProblem(healthcheckReport.result);
|
||||
if (acknowlodgeProblem) {
|
||||
|
||||
@@ -49,13 +49,8 @@ function getOsIcon(os?: OS) {
|
||||
|
||||
export function AppSelector() {
|
||||
const dispatch = useDispatch();
|
||||
const {
|
||||
devices,
|
||||
selectedDevice,
|
||||
clients,
|
||||
uninitializedClients,
|
||||
selectedApp,
|
||||
} = useStore((state) => state.connections);
|
||||
const {devices, selectedDevice, clients, uninitializedClients, selectedApp} =
|
||||
useStore((state) => state.connections);
|
||||
useValue(selectedDevice?.connected, false); // subscribe to future archived state changes
|
||||
|
||||
const onSelectDevice = useTrackedCallback(
|
||||
|
||||
@@ -46,10 +46,10 @@ function BookmarkSectionInput({navPlugin}: {navPlugin: NavigationPlugin}) {
|
||||
const bookmarks = useValue(navPlugin.bookmarks);
|
||||
const patterns = useValue(navPlugin.appMatchPatterns);
|
||||
|
||||
const isBookmarked = useMemo(() => bookmarks.has(currentURI), [
|
||||
bookmarks,
|
||||
currentURI,
|
||||
]);
|
||||
const isBookmarked = useMemo(
|
||||
() => bookmarks.has(currentURI),
|
||||
[bookmarks, currentURI],
|
||||
);
|
||||
|
||||
const autoCompleteItems = useMemoize(
|
||||
navPlugin.getAutoCompleteAppMatchPatterns,
|
||||
|
||||
@@ -493,33 +493,36 @@ const PluginMenu = styled(Menu)({
|
||||
'.ant-menu-sub.ant-menu-inline': {
|
||||
background: theme.backgroundDefault,
|
||||
},
|
||||
'.ant-menu-inline .ant-menu-item, .ant-menu-inline .ant-menu-submenu-title ': {
|
||||
width: '100%', // reset to remove weird bonus pixel from ANT
|
||||
},
|
||||
'.ant-menu-submenu > .ant-menu-submenu-title, .ant-menu-sub.ant-menu-inline > .ant-menu-item': {
|
||||
borderRadius: theme.borderRadius,
|
||||
height: '32px',
|
||||
lineHeight: '24px',
|
||||
padding: `4px 8px !important`,
|
||||
'&:hover': {
|
||||
color: theme.textColorPrimary,
|
||||
background: theme.backgroundTransparentHover,
|
||||
'.ant-menu-inline .ant-menu-item, .ant-menu-inline .ant-menu-submenu-title ':
|
||||
{
|
||||
width: '100%', // reset to remove weird bonus pixel from ANT
|
||||
},
|
||||
'&.ant-menu-item-selected::after': {
|
||||
border: 'none',
|
||||
'.ant-menu-submenu > .ant-menu-submenu-title, .ant-menu-sub.ant-menu-inline > .ant-menu-item':
|
||||
{
|
||||
borderRadius: theme.borderRadius,
|
||||
height: '32px',
|
||||
lineHeight: '24px',
|
||||
padding: `4px 8px !important`,
|
||||
'&:hover': {
|
||||
color: theme.textColorPrimary,
|
||||
background: theme.backgroundTransparentHover,
|
||||
},
|
||||
'&.ant-menu-item-selected::after': {
|
||||
border: 'none',
|
||||
},
|
||||
'&.ant-menu-item-selected': {
|
||||
color: theme.white,
|
||||
background: theme.primaryColor,
|
||||
border: 'none',
|
||||
},
|
||||
'&.ant-menu-item-selected .ant-typography': {
|
||||
color: theme.white,
|
||||
},
|
||||
},
|
||||
'&.ant-menu-item-selected': {
|
||||
color: theme.white,
|
||||
background: theme.primaryColor,
|
||||
border: 'none',
|
||||
'.ant-menu-submenu-inline > .ant-menu-submenu-title .ant-menu-submenu-arrow':
|
||||
{
|
||||
right: 8,
|
||||
},
|
||||
'&.ant-menu-item-selected .ant-typography': {
|
||||
color: theme.white,
|
||||
},
|
||||
},
|
||||
'.ant-menu-submenu-inline > .ant-menu-submenu-title .ant-menu-submenu-arrow': {
|
||||
right: 8,
|
||||
},
|
||||
'.ant-badge-count': {
|
||||
color: theme.textColorSecondary,
|
||||
// border: `1px solid ${theme.dividerColor}`,
|
||||
|
||||
@@ -292,16 +292,8 @@ class Server extends EventEmitter {
|
||||
});
|
||||
this.connectionTracker.logConnectionAttempt(clientData);
|
||||
|
||||
const {
|
||||
app,
|
||||
os,
|
||||
device,
|
||||
device_id,
|
||||
sdk_version,
|
||||
csr,
|
||||
csr_path,
|
||||
medium,
|
||||
} = clientData;
|
||||
const {app, os, device, device_id, sdk_version, csr, csr_path, medium} =
|
||||
clientData;
|
||||
const transformedMedium = transformCertificateExchangeMediumToType(medium);
|
||||
if (transformedMedium === 'WWW') {
|
||||
this.store.dispatch({
|
||||
@@ -518,16 +510,19 @@ class Server extends EventEmitter {
|
||||
// otherwise, use given device_id
|
||||
const {csr_path, csr} = csrQuery;
|
||||
// For iOS we do not need to confirm the device id, as it never changes unlike android.
|
||||
return (csr_path && csr && query.os != 'iOS'
|
||||
? this.certificateProvider.extractAppNameFromCSR(csr).then((appName) => {
|
||||
return this.certificateProvider.getTargetDeviceId(
|
||||
query.os,
|
||||
appName,
|
||||
csr_path,
|
||||
csr,
|
||||
);
|
||||
})
|
||||
: Promise.resolve(query.device_id)
|
||||
return (
|
||||
csr_path && csr && query.os != 'iOS'
|
||||
? this.certificateProvider
|
||||
.extractAppNameFromCSR(csr)
|
||||
.then((appName) => {
|
||||
return this.certificateProvider.getTargetDeviceId(
|
||||
query.os,
|
||||
appName,
|
||||
csr_path,
|
||||
csr,
|
||||
);
|
||||
})
|
||||
: Promise.resolve(query.device_id)
|
||||
).then(async (csrId) => {
|
||||
query.device_id = csrId;
|
||||
query.app = appNameWithUpdateHint(query);
|
||||
|
||||
@@ -22,9 +22,8 @@ const Container = styled.div({
|
||||
});
|
||||
Container.displayName = 'ContextMenuProvider:Container';
|
||||
|
||||
export const ContextMenuContext = createContext<ContextMenuManager | undefined>(
|
||||
undefined,
|
||||
);
|
||||
export const ContextMenuContext =
|
||||
createContext<ContextMenuManager | undefined>(undefined);
|
||||
/**
|
||||
* Flipper's root is already wrapped with this component, so plugins should not
|
||||
* need to use this. ContextMenu is what you probably want to use.
|
||||
|
||||
@@ -63,10 +63,11 @@ const PopoverElement = (props: {
|
||||
children: ReactNode;
|
||||
}) => {
|
||||
const ref = useRef<HTMLDivElement | null>(null);
|
||||
const [dimensions, setDimensions] = useState<{
|
||||
width: number;
|
||||
height: number;
|
||||
} | null>(null);
|
||||
const [dimensions, setDimensions] =
|
||||
useState<{
|
||||
width: number;
|
||||
height: number;
|
||||
} | null>(null);
|
||||
useEffect(() => {
|
||||
if (!ref.current) {
|
||||
return;
|
||||
|
||||
@@ -69,15 +69,8 @@ export default class Select extends Component<{
|
||||
};
|
||||
|
||||
render() {
|
||||
const {
|
||||
className,
|
||||
options,
|
||||
selected,
|
||||
label,
|
||||
grow,
|
||||
disabled,
|
||||
style,
|
||||
} = this.props;
|
||||
const {className, options, selected, label, grow, disabled, style} =
|
||||
this.props;
|
||||
|
||||
let select = (
|
||||
<SelectMenu
|
||||
|
||||
@@ -115,9 +115,9 @@ export default class StackTrace extends Component<{
|
||||
return null;
|
||||
}
|
||||
|
||||
const columns = (Object.keys(children[0]) as Array<
|
||||
keyof Child
|
||||
>).reduce<TableColumns>((acc, cv) => {
|
||||
const columns = (
|
||||
Object.keys(children[0]) as Array<keyof Child>
|
||||
).reduce<TableColumns>((acc, cv) => {
|
||||
if (cv !== 'isBold') {
|
||||
acc[cv] = {
|
||||
value: cv,
|
||||
@@ -131,9 +131,9 @@ export default class StackTrace extends Component<{
|
||||
visible: Boolean(columns[key]),
|
||||
}));
|
||||
|
||||
const columnSizes = (Object.keys(COLUMNS) as Array<
|
||||
keyof typeof COLUMNS
|
||||
>).reduce<TableColumnSizes>((acc, cv: keyof typeof COLUMNS) => {
|
||||
const columnSizes = (
|
||||
Object.keys(COLUMNS) as Array<keyof typeof COLUMNS>
|
||||
).reduce<TableColumnSizes>((acc, cv: keyof typeof COLUMNS) => {
|
||||
acc[cv] =
|
||||
COLUMNS[cv] === 'flex'
|
||||
? 'flex'
|
||||
|
||||
@@ -208,11 +208,8 @@ export default function Searchable(
|
||||
const filters = new Set(
|
||||
savedDefaultFilter.enum.map((filter) => filter.value),
|
||||
);
|
||||
savedStateFilters[
|
||||
filterIndex
|
||||
].value = savedDefaultFilter.value.filter((value) =>
|
||||
filters.has(value),
|
||||
);
|
||||
savedStateFilters[filterIndex].value =
|
||||
savedDefaultFilter.value.filter((value) => filters.has(value));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -91,14 +91,16 @@ export function rowMatchesSearchTerm(
|
||||
);
|
||||
}
|
||||
|
||||
export const filterRowsFactory = (
|
||||
filters: Array<Filter>,
|
||||
searchTerm: string,
|
||||
regexSearch: boolean,
|
||||
contentSearch: boolean,
|
||||
) => (row: TableBodyRow): boolean =>
|
||||
rowMatchesFilters(filters, row) &&
|
||||
rowMatchesSearchTerm(searchTerm, regexSearch, contentSearch, row);
|
||||
export const filterRowsFactory =
|
||||
(
|
||||
filters: Array<Filter>,
|
||||
searchTerm: string,
|
||||
regexSearch: boolean,
|
||||
contentSearch: boolean,
|
||||
) =>
|
||||
(row: TableBodyRow): boolean =>
|
||||
rowMatchesFilters(filters, row) &&
|
||||
rowMatchesSearchTerm(searchTerm, regexSearch, contentSearch, row);
|
||||
|
||||
class SearchableManagedTable extends PureComponent<Props, State> {
|
||||
static defaultProps = {
|
||||
|
||||
@@ -540,8 +540,9 @@ export class ManagedTable extends React.Component<
|
||||
.map((column, index) => ({
|
||||
label: this.props.columns[column].value,
|
||||
click: () => {
|
||||
const rowId = this.state.highlightedRows.values().next()
|
||||
.value;
|
||||
const rowId = this.state.highlightedRows
|
||||
.values()
|
||||
.next().value;
|
||||
rowId && this.onCopyCell(rowId, index);
|
||||
},
|
||||
})),
|
||||
@@ -665,13 +666,8 @@ export class ManagedTable extends React.Component<
|
||||
};
|
||||
|
||||
render() {
|
||||
const {
|
||||
columns,
|
||||
rows,
|
||||
rowLineHeight,
|
||||
hideHeader,
|
||||
horizontallyScrollable,
|
||||
} = this.props;
|
||||
const {columns, rows, rowLineHeight, hideHeader, horizontallyScrollable} =
|
||||
this.props;
|
||||
const {columnOrder, columnSizes} = this.state;
|
||||
|
||||
let computedWidth = 0;
|
||||
|
||||
@@ -499,8 +499,9 @@ class ManagedTable extends React.Component<
|
||||
.map((column, index) => ({
|
||||
label: this.props.columns[column].value,
|
||||
click: () => {
|
||||
const rowId = this.state.highlightedRows.values().next()
|
||||
.value;
|
||||
const rowId = this.state.highlightedRows
|
||||
.values()
|
||||
.next().value;
|
||||
rowId && this.onCopyCell(rowId, index);
|
||||
},
|
||||
})),
|
||||
@@ -632,13 +633,8 @@ class ManagedTable extends React.Component<
|
||||
};
|
||||
|
||||
render() {
|
||||
const {
|
||||
columns,
|
||||
rows,
|
||||
rowLineHeight,
|
||||
hideHeader,
|
||||
horizontallyScrollable,
|
||||
} = this.props;
|
||||
const {columns, rows, rowLineHeight, hideHeader, horizontallyScrollable} =
|
||||
this.props;
|
||||
const {columnOrder, columnSizes} = this.state;
|
||||
|
||||
let computedWidth = 0;
|
||||
|
||||
@@ -286,18 +286,15 @@ export default class CertificateProvider {
|
||||
const deviceIdPromise = appNamePromise.then((app) =>
|
||||
this.getTargetAndroidDeviceId(app, destination, csr),
|
||||
);
|
||||
return Promise.all([
|
||||
deviceIdPromise,
|
||||
appNamePromise,
|
||||
this.adb,
|
||||
]).then(([deviceId, appName, adbClient]) =>
|
||||
androidUtil.push(
|
||||
adbClient,
|
||||
deviceId,
|
||||
appName,
|
||||
destination + filename,
|
||||
contents,
|
||||
),
|
||||
return Promise.all([deviceIdPromise, appNamePromise, this.adb]).then(
|
||||
([deviceId, appName, adbClient]) =>
|
||||
androidUtil.push(
|
||||
adbClient,
|
||||
deviceId,
|
||||
appName,
|
||||
destination + filename,
|
||||
contents,
|
||||
),
|
||||
);
|
||||
}
|
||||
if (os === 'iOS' || os === 'windows' || os == 'MacOS') {
|
||||
@@ -305,9 +302,8 @@ export default class CertificateProvider {
|
||||
(err) => {
|
||||
if (os === 'iOS') {
|
||||
// Writing directly to FS failed. It's probably a physical device.
|
||||
const relativePathInsideApp = this.getRelativePathInAppContainer(
|
||||
destination,
|
||||
);
|
||||
const relativePathInsideApp =
|
||||
this.getRelativePathInAppContainer(destination);
|
||||
return appNamePromise
|
||||
.then((appName) => {
|
||||
return this.getTargetiOSDeviceId(appName, destination, csr);
|
||||
|
||||
@@ -1127,12 +1127,8 @@ const sandyTestPlugin = new _SandyPluginDefinition(
|
||||
);
|
||||
|
||||
test('Sandy plugins are exported properly', async () => {
|
||||
const {
|
||||
client,
|
||||
sendMessage,
|
||||
store,
|
||||
device,
|
||||
} = await createMockFlipperWithPlugin(sandyTestPlugin);
|
||||
const {client, sendMessage, store, device} =
|
||||
await createMockFlipperWithPlugin(sandyTestPlugin);
|
||||
|
||||
// We do select another plugin, to verify that pending message queues are indeed processed before exporting
|
||||
store.dispatch(
|
||||
@@ -1266,8 +1262,7 @@ test('Sandy plugins are imported properly', async () => {
|
||||
const data = {
|
||||
clients: [
|
||||
{
|
||||
id:
|
||||
'TestApp#Android#MockAndroidDevice#2e52cea6-94b0-4ea1-b9a8-c9135ede14ca-serial',
|
||||
id: 'TestApp#Android#MockAndroidDevice#2e52cea6-94b0-4ea1-b9a8-c9135ede14ca-serial',
|
||||
query: {
|
||||
app: 'TestApp',
|
||||
device: 'MockAndroidDevice',
|
||||
@@ -1288,14 +1283,15 @@ test('Sandy plugins are imported properly', async () => {
|
||||
fileVersion: '0.9.99',
|
||||
flipperReleaseRevision: undefined,
|
||||
pluginStates2: {
|
||||
'TestApp#Android#MockAndroidDevice#2e52cea6-94b0-4ea1-b9a8-c9135ede14ca-serial': {
|
||||
TestPlugin: {
|
||||
otherState: {
|
||||
testCount: -3,
|
||||
'TestApp#Android#MockAndroidDevice#2e52cea6-94b0-4ea1-b9a8-c9135ede14ca-serial':
|
||||
{
|
||||
TestPlugin: {
|
||||
otherState: {
|
||||
testCount: -3,
|
||||
},
|
||||
counter: 3,
|
||||
},
|
||||
counter: 3,
|
||||
},
|
||||
},
|
||||
},
|
||||
store: {
|
||||
activeNotifications: [],
|
||||
@@ -1484,8 +1480,7 @@ test('Sandy plugin with custom import', async () => {
|
||||
const data = {
|
||||
clients: [
|
||||
{
|
||||
id:
|
||||
'TestApp#Android#MockAndroidDevice#2e52cea6-94b0-4ea1-b9a8-c9135ede14ca-serial',
|
||||
id: 'TestApp#Android#MockAndroidDevice#2e52cea6-94b0-4ea1-b9a8-c9135ede14ca-serial',
|
||||
query: {
|
||||
app: 'TestApp',
|
||||
device: 'MockAndroidDevice',
|
||||
@@ -1506,11 +1501,12 @@ test('Sandy plugin with custom import', async () => {
|
||||
fileVersion: '0.9.99',
|
||||
flipperReleaseRevision: undefined,
|
||||
pluginStates2: {
|
||||
'TestApp#Android#MockAndroidDevice#2e52cea6-94b0-4ea1-b9a8-c9135ede14ca-serial': {
|
||||
[plugin.id]: {
|
||||
count: 4,
|
||||
'TestApp#Android#MockAndroidDevice#2e52cea6-94b0-4ea1-b9a8-c9135ede14ca-serial':
|
||||
{
|
||||
[plugin.id]: {
|
||||
count: 4,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
store: {
|
||||
activeNotifications: [],
|
||||
|
||||
@@ -109,12 +109,8 @@ test('queue - events are processed immediately if plugin is selected', async ()
|
||||
});
|
||||
|
||||
test('queue - events are NOT processed immediately if plugin is NOT selected (but enabled)', async () => {
|
||||
const {
|
||||
store,
|
||||
client,
|
||||
sendMessage,
|
||||
device,
|
||||
} = await createMockFlipperWithPlugin(TestPlugin);
|
||||
const {store, client, sendMessage, device} =
|
||||
await createMockFlipperWithPlugin(TestPlugin);
|
||||
selectDeviceLogs(store);
|
||||
expect(store.getState().connections.selectedPlugin).not.toBe('TestPlugin');
|
||||
|
||||
@@ -203,12 +199,8 @@ test('queue - events are NOT processed immediately if plugin is NOT selected (bu
|
||||
});
|
||||
|
||||
test('queue - events are queued for plugins that are favorite when app is not selected', async () => {
|
||||
const {
|
||||
device,
|
||||
store,
|
||||
sendMessage,
|
||||
createClient,
|
||||
} = await createMockFlipperWithPlugin(TestPlugin);
|
||||
const {device, store, sendMessage, createClient} =
|
||||
await createMockFlipperWithPlugin(TestPlugin);
|
||||
selectDeviceLogs(store);
|
||||
expect(store.getState().connections.selectedPlugin).not.toBe('TestPlugin');
|
||||
|
||||
@@ -235,13 +227,8 @@ test('queue - events are queued for plugins that are favorite when app is not se
|
||||
});
|
||||
|
||||
test('queue - events are queued for plugins that are favorite when app is selected on different device', async () => {
|
||||
const {
|
||||
client,
|
||||
store,
|
||||
sendMessage,
|
||||
createDevice,
|
||||
createClient,
|
||||
} = await createMockFlipperWithPlugin(TestPlugin);
|
||||
const {client, store, sendMessage, createDevice, createClient} =
|
||||
await createMockFlipperWithPlugin(TestPlugin);
|
||||
selectDeviceLogs(store);
|
||||
expect(store.getState().connections.selectedPlugin).not.toBe('TestPlugin');
|
||||
|
||||
@@ -282,12 +269,8 @@ test('queue - events are queued for plugins that are favorite when app is select
|
||||
});
|
||||
|
||||
test('queue - events processing will be paused', async () => {
|
||||
const {
|
||||
client,
|
||||
device,
|
||||
store,
|
||||
sendMessage,
|
||||
} = await createMockFlipperWithPlugin(TestPlugin);
|
||||
const {client, device, store, sendMessage} =
|
||||
await createMockFlipperWithPlugin(TestPlugin);
|
||||
selectDeviceLogs(store);
|
||||
|
||||
sendMessage('inc', {});
|
||||
@@ -330,12 +313,8 @@ test('queue - events processing will be paused', async () => {
|
||||
});
|
||||
|
||||
test('queue - messages that arrive during processing will be queued', async () => {
|
||||
const {
|
||||
client,
|
||||
device,
|
||||
store,
|
||||
sendMessage,
|
||||
} = await createMockFlipperWithPlugin(TestPlugin);
|
||||
const {client, device, store, sendMessage} =
|
||||
await createMockFlipperWithPlugin(TestPlugin);
|
||||
selectDeviceLogs(store);
|
||||
|
||||
sendMessage('inc', {});
|
||||
@@ -380,12 +359,8 @@ test('queue - messages that arrive during processing will be queued', async () =
|
||||
});
|
||||
|
||||
test('queue - processing can be cancelled', async () => {
|
||||
const {
|
||||
client,
|
||||
device,
|
||||
store,
|
||||
sendMessage,
|
||||
} = await createMockFlipperWithPlugin(TestPlugin);
|
||||
const {client, device, store, sendMessage} =
|
||||
await createMockFlipperWithPlugin(TestPlugin);
|
||||
selectDeviceLogs(store);
|
||||
|
||||
sendMessage('inc', {});
|
||||
@@ -415,12 +390,8 @@ test('queue - processing can be cancelled', async () => {
|
||||
});
|
||||
|
||||
test('queue - make sure resetting plugin state clears the message queue', async () => {
|
||||
const {
|
||||
client,
|
||||
device,
|
||||
store,
|
||||
sendMessage,
|
||||
} = await createMockFlipperWithPlugin(TestPlugin);
|
||||
const {client, device, store, sendMessage} =
|
||||
await createMockFlipperWithPlugin(TestPlugin);
|
||||
selectDeviceLogs(store);
|
||||
|
||||
sendMessage('inc', {});
|
||||
@@ -486,12 +457,8 @@ test('client - incoming messages are buffered and flushed together', async () =>
|
||||
static persistedStateReducer = jest.fn();
|
||||
}
|
||||
|
||||
const {
|
||||
client,
|
||||
store,
|
||||
device,
|
||||
sendMessage,
|
||||
} = await createMockFlipperWithPlugin(TestPlugin);
|
||||
const {client, store, device, sendMessage} =
|
||||
await createMockFlipperWithPlugin(TestPlugin);
|
||||
selectDeviceLogs(store);
|
||||
|
||||
store.dispatch(registerPlugins([StubDeviceLogs]));
|
||||
@@ -646,12 +613,8 @@ test('client - incoming messages are buffered and flushed together', async () =>
|
||||
});
|
||||
|
||||
test('queue - messages that have not yet flushed be lost when disabling the plugin', async () => {
|
||||
const {
|
||||
client,
|
||||
store,
|
||||
sendMessage,
|
||||
pluginKey,
|
||||
} = await createMockFlipperWithPlugin(TestPlugin);
|
||||
const {client, store, sendMessage, pluginKey} =
|
||||
await createMockFlipperWithPlugin(TestPlugin);
|
||||
selectDeviceLogs(store);
|
||||
|
||||
sendMessage('inc', {});
|
||||
|
||||
@@ -116,12 +116,8 @@ test('queue - events are processed immediately if plugin is selected', async ()
|
||||
});
|
||||
|
||||
test('queue - events are NOT processed immediately if plugin is NOT selected (but enabled)', async () => {
|
||||
const {
|
||||
store,
|
||||
client,
|
||||
sendMessage,
|
||||
device,
|
||||
} = await createMockFlipperWithPlugin(TestPlugin);
|
||||
const {store, client, sendMessage, device} =
|
||||
await createMockFlipperWithPlugin(TestPlugin);
|
||||
selectDeviceLogs(store);
|
||||
expect(store.getState().connections.selectedPlugin).not.toBe('TestPlugin');
|
||||
|
||||
@@ -260,13 +256,8 @@ test('queue - events ARE processed immediately if plugin is NOT selected / enabl
|
||||
});
|
||||
|
||||
test('queue - events are queued for plugins that are favorite when app is not selected', async () => {
|
||||
const {
|
||||
client,
|
||||
device,
|
||||
store,
|
||||
sendMessage,
|
||||
createClient,
|
||||
} = await createMockFlipperWithPlugin(TestPlugin);
|
||||
const {client, device, store, sendMessage, createClient} =
|
||||
await createMockFlipperWithPlugin(TestPlugin);
|
||||
selectDeviceLogs(store);
|
||||
expect(store.getState().connections.selectedPlugin).not.toBe('TestPlugin');
|
||||
|
||||
@@ -293,13 +284,8 @@ test('queue - events are queued for plugins that are favorite when app is not se
|
||||
});
|
||||
|
||||
test('queue - events are queued for plugins that are favorite when app is selected on different device', async () => {
|
||||
const {
|
||||
client,
|
||||
store,
|
||||
sendMessage,
|
||||
createDevice,
|
||||
createClient,
|
||||
} = await createMockFlipperWithPlugin(TestPlugin);
|
||||
const {client, store, sendMessage, createDevice, createClient} =
|
||||
await createMockFlipperWithPlugin(TestPlugin);
|
||||
selectDeviceLogs(store);
|
||||
expect(store.getState().connections.selectedPlugin).not.toBe('TestPlugin');
|
||||
|
||||
@@ -340,12 +326,8 @@ test('queue - events are queued for plugins that are favorite when app is select
|
||||
});
|
||||
|
||||
test('queue - events processing will be paused', async () => {
|
||||
const {
|
||||
client,
|
||||
device,
|
||||
store,
|
||||
sendMessage,
|
||||
} = await createMockFlipperWithPlugin(TestPlugin);
|
||||
const {client, device, store, sendMessage} =
|
||||
await createMockFlipperWithPlugin(TestPlugin);
|
||||
selectDeviceLogs(store);
|
||||
|
||||
sendMessage('inc', {});
|
||||
@@ -390,12 +372,8 @@ test('queue - events processing will be paused', async () => {
|
||||
});
|
||||
|
||||
test('queue - messages that arrive during processing will be queued', async () => {
|
||||
const {
|
||||
client,
|
||||
device,
|
||||
store,
|
||||
sendMessage,
|
||||
} = await createMockFlipperWithPlugin(TestPlugin);
|
||||
const {client, device, store, sendMessage} =
|
||||
await createMockFlipperWithPlugin(TestPlugin);
|
||||
selectDeviceLogs(store);
|
||||
|
||||
sendMessage('inc', {});
|
||||
@@ -446,12 +424,8 @@ test('queue - messages that arrive during processing will be queued', async () =
|
||||
});
|
||||
|
||||
test('queue - processing can be cancelled', async () => {
|
||||
const {
|
||||
client,
|
||||
device,
|
||||
store,
|
||||
sendMessage,
|
||||
} = await createMockFlipperWithPlugin(TestPlugin);
|
||||
const {client, device, store, sendMessage} =
|
||||
await createMockFlipperWithPlugin(TestPlugin);
|
||||
selectDeviceLogs(store);
|
||||
|
||||
sendMessage('inc', {});
|
||||
@@ -487,12 +461,8 @@ test('queue - processing can be cancelled', async () => {
|
||||
});
|
||||
|
||||
test('queue - make sure resetting plugin state clears the message queue', async () => {
|
||||
const {
|
||||
client,
|
||||
device,
|
||||
store,
|
||||
sendMessage,
|
||||
} = await createMockFlipperWithPlugin(TestPlugin);
|
||||
const {client, device, store, sendMessage} =
|
||||
await createMockFlipperWithPlugin(TestPlugin);
|
||||
selectDeviceLogs(store);
|
||||
|
||||
sendMessage('inc', {});
|
||||
@@ -522,13 +492,8 @@ test('client - incoming messages are buffered and flushed together', async () =>
|
||||
static persistedStateReducer = jest.fn();
|
||||
}
|
||||
|
||||
const {
|
||||
client,
|
||||
store,
|
||||
device,
|
||||
sendMessage,
|
||||
pluginKey,
|
||||
} = await createMockFlipperWithPlugin(TestPlugin);
|
||||
const {client, store, device, sendMessage, pluginKey} =
|
||||
await createMockFlipperWithPlugin(TestPlugin);
|
||||
selectDeviceLogs(store);
|
||||
|
||||
store.dispatch(registerPlugins([StubDeviceLogs]));
|
||||
@@ -687,12 +652,8 @@ test('client - incoming messages are buffered and flushed together', async () =>
|
||||
});
|
||||
|
||||
test('queue - messages that have not yet flushed be lost when disabling the plugin', async () => {
|
||||
const {
|
||||
client,
|
||||
store,
|
||||
sendMessage,
|
||||
pluginKey,
|
||||
} = await createMockFlipperWithPlugin(TestPlugin);
|
||||
const {client, store, sendMessage, pluginKey} =
|
||||
await createMockFlipperWithPlugin(TestPlugin);
|
||||
selectDeviceLogs(store);
|
||||
|
||||
sendMessage('inc', {});
|
||||
|
||||
@@ -201,13 +201,8 @@ export function processPluginStates(
|
||||
export function processNotificationStates(
|
||||
options: ProcessNotificationStatesOptions,
|
||||
): Array<PluginNotification> {
|
||||
const {
|
||||
clients,
|
||||
serial,
|
||||
allActiveNotifications,
|
||||
devicePlugins,
|
||||
statusUpdate,
|
||||
} = options;
|
||||
const {clients, serial, allActiveNotifications, devicePlugins, statusUpdate} =
|
||||
options;
|
||||
statusUpdate &&
|
||||
statusUpdate('Filtering the notifications for the filtered Clients...');
|
||||
const activeNotifications = allActiveNotifications.filter((notif) => {
|
||||
|
||||
@@ -34,9 +34,10 @@ export function getIcons(): Icons {
|
||||
|
||||
// Takes a string like 'star', or 'star-outline', and converts it to
|
||||
// {trimmedName: 'star', variant: 'filled'} or {trimmedName: 'star', variant: 'outline'}
|
||||
function getIconPartsFromName(
|
||||
icon: string,
|
||||
): {trimmedName: string; variant: 'outline' | 'filled'} {
|
||||
function getIconPartsFromName(icon: string): {
|
||||
trimmedName: string;
|
||||
variant: 'outline' | 'filled';
|
||||
} {
|
||||
const isOutlineVersion = icon.endsWith('-outline');
|
||||
const trimmedName = isOutlineVersion ? icon.replace('-outline', '') : icon;
|
||||
const variant = isOutlineVersion ? 'outline' : 'filled';
|
||||
|
||||
@@ -157,7 +157,8 @@ export function launchJsEmulator(url: string, height: number, width: number) {
|
||||
}
|
||||
|
||||
export class JSClientFlipperConnection<M>
|
||||
implements FlipperClientConnection<string, M> {
|
||||
implements FlipperClientConnection<string, M>
|
||||
{
|
||||
webContentsId: number;
|
||||
connStatusSubscribers: Set<ISubscriber<ConnectionStatus>> = new Set();
|
||||
connStatus: ConnectionStatus;
|
||||
|
||||
@@ -13,7 +13,8 @@ import {Payload, ConnectionStatus, ISubscriber} from 'rsocket-types';
|
||||
import WebSocket from 'ws';
|
||||
|
||||
export class WebsocketClientFlipperConnection<M>
|
||||
implements FlipperClientConnection<string, M> {
|
||||
implements FlipperClientConnection<string, M>
|
||||
{
|
||||
websocket: WebSocket;
|
||||
connStatusSubscribers: Set<ISubscriber<ConnectionStatus>> = new Set();
|
||||
connStatus: ConnectionStatus;
|
||||
|
||||
@@ -26,13 +26,12 @@ const getPackageJSON = async () => {
|
||||
return JSON.parse(content);
|
||||
};
|
||||
|
||||
export const readCurrentRevision: () => Promise<
|
||||
string | undefined
|
||||
> = lodash.memoize(async () => {
|
||||
// This is provided as part of the bundling process for headless.
|
||||
if (global.__REVISION__) {
|
||||
return global.__REVISION__;
|
||||
}
|
||||
const json = await getPackageJSON();
|
||||
return json.revision;
|
||||
});
|
||||
export const readCurrentRevision: () => Promise<string | undefined> =
|
||||
lodash.memoize(async () => {
|
||||
// This is provided as part of the bundling process for headless.
|
||||
if (global.__REVISION__) {
|
||||
return global.__REVISION__;
|
||||
}
|
||||
const json = await getPackageJSON();
|
||||
return json.revision;
|
||||
});
|
||||
|
||||
@@ -26,7 +26,8 @@ interface IFutureSubject<T> {
|
||||
|
||||
export class SelfInspectionFlipperClient<M>
|
||||
extends FlipperClient
|
||||
implements FlipperClientConnection<string, M> {
|
||||
implements FlipperClientConnection<string, M>
|
||||
{
|
||||
connStatusSubscribers: Set<ISubscriber<ConnectionStatus>> = new Set();
|
||||
connStatus: ConnectionStatus = {kind: 'CONNECTED'};
|
||||
|
||||
|
||||
@@ -15,12 +15,9 @@ export async function serialize(
|
||||
statusUpdate?: (msg: string) => void,
|
||||
statusMsg?: string,
|
||||
): Promise<string> {
|
||||
return makeObjectSerializable(
|
||||
obj,
|
||||
idler,
|
||||
statusUpdate,
|
||||
statusMsg,
|
||||
).then((obj) => JSON.stringify(obj));
|
||||
return makeObjectSerializable(obj, idler, statusUpdate, statusMsg).then(
|
||||
(obj) => JSON.stringify(obj),
|
||||
);
|
||||
}
|
||||
|
||||
export function deserialize(str: string): any {
|
||||
|
||||
@@ -25,7 +25,7 @@ import {shallowEqual} from 'react-redux';
|
||||
export function sideEffect<
|
||||
Store extends ReduxStore<any, any>,
|
||||
V,
|
||||
State = Store extends ReduxStore<infer S, any> ? S : never
|
||||
State = Store extends ReduxStore<infer S, any> ? S : never,
|
||||
>(
|
||||
store: Store,
|
||||
options: {
|
||||
|
||||
Reference in New Issue
Block a user