Attach Flipper Trace in the support form

Summary: This diff sets up Flipper to attach flipper trace to the support form. This diff adds a property named `exportResult` in the redux store. This will hold the export url or the path of the export, depending on the type of the flipper export. Once the exportResult is populated, we listen for this change and update the button style and fill the comment box.

Reviewed By: passy

Differential Revision: D17478491

fbshipit-source-id: 10dd5e130a9e3df5f41afde42b92b08959d9ed9e
This commit is contained in:
Pritesh Nandgaonkar
2019-09-25 06:07:41 -07:00
committed by Facebook Github Bot
parent 053cfc09f3
commit 8d4d642330
5 changed files with 42 additions and 7 deletions

View File

@@ -47,7 +47,10 @@ type SubShareType =
type: 'file';
file: string;
}
| {type: 'link'};
| {
type: 'link';
url?: string;
};
export type ShareType = {
statusComponent?: React.ReactNode;
@@ -117,6 +120,10 @@ export type Action =
| {
type: 'SET_EXPORT_STATUS_MESSAGE';
payload: React.ReactNode;
}
| {
type: 'SET_EXPORT_URL';
payload: string;
};
const initialState: () => State = () => ({
@@ -208,6 +215,12 @@ export default function reducer(
return state;
} else if (action.type === 'UNSET_SHARE') {
return {...state, share: null};
} else if (action.type === 'SET_EXPORT_URL') {
const share = state.share;
if (share && share.type === 'link') {
return {...state, share: {...share, url: action.payload}};
}
return state;
} else {
return state;
}
@@ -270,3 +283,8 @@ export const setFlipperRating = (rating: number): Action => ({
rating,
},
});
export const setExportURL = (result: string): Action => ({
type: 'SET_EXPORT_URL',
payload: result,
});