Add archived device visualizer

Summary:
Adds a visual indicator of layout nodes when using an archived device.

The "device" window isn't movable for some reason. I've tried the movable and draggable attributes but with no luck. It would obviously be good to fix that but I think its probably shippable as is, and I don't have any more ideas about how to do it.

Reviewed By: passy

Differential Revision: D19885719

fbshipit-source-id: 186ba38c85afee18ce111e30187bdccd9b919025
This commit is contained in:
John Knox
2020-02-21 07:17:32 -08:00
committed by Facebook Github Bot
parent c2dfa6ca6b
commit 20db85adf4
14 changed files with 302 additions and 9 deletions

View File

@@ -274,6 +274,7 @@ const addSaltToDeviceSerial = async (
device.title,
device.os,
selectedPlugins.includes('DeviceLogs') ? device.getLogs() : [],
deviceScreenshot,
);
statusUpdate &&
statusUpdate('Adding salt to the selected device id in the client data...');
@@ -674,11 +675,12 @@ export const exportStoreToFile = (
export function importDataToStore(source: string, data: string, store: Store) {
getLogger().track('usage', IMPORT_FLIPPER_TRACE_EVENT);
const json: ExportType = JSON.parse(data);
const {device, clients, supportRequestDetails} = json;
const {device, clients, supportRequestDetails, deviceScreenshot} = json;
if (device == null) {
return;
}
const {serial, deviceType, title, os, logs} = device;
const archivedDevice = new ArchivedDevice(
serial,
deviceType,
@@ -689,6 +691,7 @@ export function importDataToStore(source: string, data: string, store: Store) {
return {...l, date: new Date(l.date)};
})
: [],
deviceScreenshot,
source,
supportRequestDetails,
);