Create Support Requests from Flipper

Summary: This diff adds an initial support to prefill the app information and the revision information. This diff also copies the workplace url in the clipboard.

Reviewed By: passy

Differential Revision: D16990925

fbshipit-source-id: 4f354e52de5fea07c2ea36336761d6963c27ef66
This commit is contained in:
Pritesh Nandgaonkar
2019-09-20 11:37:21 -07:00
committed by Facebook Github Bot
parent b041da6d61
commit 84c5067210
7 changed files with 192 additions and 8 deletions

View File

@@ -18,7 +18,12 @@ import {Actions} from '.';
const WelcomeScreen = isHeadless()
? require('../chrome/WelcomeScreenHeadless').default
: require('../chrome/WelcomeScreen').default;
export type StaticView = null | typeof WelcomeScreen;
import SupportRequestForm from '../fb-stubs/SupportRequestForm';
export type StaticView =
| null
| typeof WelcomeScreen
| typeof SupportRequestForm;
export type State = {
devices: Array<BaseDevice>;
@@ -135,9 +140,11 @@ const reducer = (state: State = INITAL_STATE, action: Actions): State => {
switch (action.type) {
case 'SET_STATIC_VIEW': {
const {payload} = action;
const {selectedPlugin} = state;
return {
...state,
staticView: payload,
selectedPlugin: payload != null ? null : selectedPlugin,
};
}
case 'SELECT_DEVICE': {
@@ -256,6 +263,7 @@ const reducer = (state: State = INITAL_STATE, action: Actions): State => {
return {
...state,
...payload,
staticView: null,
userPreferredApp: userPreferredApp,
userPreferredPlugin: selectedPlugin,
userLRUPlugins: selectedAppName
@@ -452,6 +460,11 @@ export const selectDevice = (payload: BaseDevice): Action => ({
payload,
});
export const setStaticView = (payload: StaticView): Action => ({
type: 'SET_STATIC_VIEW',
payload,
});
export const preferDevice = (payload: string): Action => ({
type: 'PREFER_DEVICE',
payload,