Introduce support request details form

Summary: Initial setup for a support detail form. Will only show up if meta data is present in the flipper file, so use the attached one to see it.

Reviewed By: jknoxville

Differential Revision: D18479193

fbshipit-source-id: 61da089f1e883fea20b2422a6bea99b2f8a4434b
This commit is contained in:
Michel Weststrate
2019-11-14 05:44:31 -08:00
committed by Facebook Github Bot
parent a578b4d559
commit d2ab55a6f8
6 changed files with 89 additions and 17 deletions

View File

@@ -48,6 +48,7 @@ export type ExportType = {
pluginStates: PluginStatesExportState;
activeNotifications: Array<PluginNotification>;
};
supportRequestDetails?: SupportRequestDetailsMetaData;
};
type ProcessPluginStatesOptions = {
@@ -81,6 +82,15 @@ type AddSaltToDeviceSerialOptions = {
statusUpdate?: (msg: string) => void;
};
export type SupportRequestDetailsMetaData = {
title: string;
app: string;
description: string;
commitHash: string;
screenshots: {image: string; description: string}[];
videos: {url: string; description: string}[];
};
export function processClients(
clients: Array<ClientExport>,
serial: string,
@@ -577,7 +587,7 @@ 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} = json;
const {device, clients, supportRequestDetails} = json;
if (device == null) {
return;
}
@@ -593,6 +603,7 @@ export function importDataToStore(source: string, data: string, store: Store) {
})
: [],
source,
supportRequestDetails,
);
const devices = store.getState().connections.devices;
const matchedDevices = devices.filter(