From 96aa0ac02b6cedbf3674bbbb6e0d79da7afd80cd Mon Sep 17 00:00:00 2001 From: Andrey Goncharov Date: Tue, 25 Oct 2022 05:31:48 -0700 Subject: [PATCH] Automatically export all plugins as a part of a universal export Summary: Design doc: https://docs.google.com/document/d/1HLCFl46RfqG0o1mSt8SWrwf_HMfOCRg_oENioc1rkvQ/edit# Reviewed By: passy Differential Revision: D40550440 fbshipit-source-id: 2f88c84124c35524d020fd2bcd8487dc2c64d8f3 --- desktop/flipper-ui-core/src/utils/exportData.tsx | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/desktop/flipper-ui-core/src/utils/exportData.tsx b/desktop/flipper-ui-core/src/utils/exportData.tsx index f78415a1a..b67c7bd7f 100644 --- a/desktop/flipper-ui-core/src/utils/exportData.tsx +++ b/desktop/flipper-ui-core/src/utils/exportData.tsx @@ -35,6 +35,7 @@ import {uploadFlipperMedia} from '../fb-stubs/user'; import {exportLogs} from '../chrome/ConsoleLogs'; import JSZip from 'jszip'; import {safeFilename} from './safeFilename'; +import {getExportablePlugins} from '../selectors/connections'; export const IMPORT_FLIPPER_TRACE_EVENT = 'import-flipper-trace'; export const EXPORT_FLIPPER_TRACE_EVENT = 'export-flipper-trace'; @@ -660,14 +661,10 @@ export async function exportEverythingEverywhereAllAtOnce( }); // Step 3: Export Flipper State - // TODO: Export all plugins automatically - const plugins = await selectPlugins(); - if (plugins === false) { - return; // cancelled - } + const exportablePlugins = getExportablePlugins(store.getState()); // TODO: no need to put this in the store, // need to be cleaned up later in combination with SupportForm - store.dispatch(selectedPlugins(plugins)); + store.dispatch(selectedPlugins(exportablePlugins.map(({id}) => id))); const {serializedString} = await exportStore(store); zip.file('flipper_export', serializedString);