UI for sharable URLs

Summary:
Uploading the Flipper data could take some while. With the current implementation the user didn't know what was happening. This is why this diff immediately shows a sheet with a spinner, until the upload is finished.

The URL is still copied to the clipboard and a notifications is displayed. Additionally the user can copy the URL from the sheet.

Reviewed By: priteshrnandgaonkar

Differential Revision: D14441759

fbshipit-source-id: c853526a7da76e2dea5e1aaf6b6eff21e4268789
This commit is contained in:
Daniel Büchele
2019-03-14 04:19:28 -07:00
committed by Facebook Github Bot
parent 50a1fa64d8
commit aad970defd
5 changed files with 173 additions and 4 deletions

View File

@@ -8,11 +8,11 @@
import type {FlipperPlugin, FlipperDevicePlugin} from './plugin.js';
import {
exportStoreToFile,
exportStore,
importFileToStore,
IMPORT_FLIPPER_TRACE_EVENT,
EXPORT_FLIPPER_TRACE_EVENT,
} from './utils/exportData.js';
import {setActiveSheet, ACTIVE_SHEET_SHARE_DATA} from './reducers/application';
import type {Store} from './reducers/';
import electron from 'electron';
import {GK} from 'flipper';
@@ -20,7 +20,6 @@ import {remote} from 'electron';
const {dialog} = remote;
import os from 'os';
import path from 'path';
import {shareFlipperData} from './fb-stubs/user';
import {
reportPlatformFailures,
tryCatchReportPlatformFailures,
@@ -374,7 +373,7 @@ function getTemplate(
label: 'Sharable Link',
accelerator: 'CommandOrControl+Shift+E',
click: async function(item: Object, focusedWindow: Object) {
shareFlipperData(await exportStore(store));
store.dispatch(setActiveSheet(ACTIVE_SHEET_SHARE_DATA));
},
},
],