Setup of the bug creation screen

Summary: This diff sets up the create form for the new support request project. The current screen is very basic. I will be iterating through it in the upcoming diffs.

Reviewed By: passy

Differential Revision: D18327464

fbshipit-source-id: af01fc10f68a135f32f0ae98551986852019e8aa
This commit is contained in:
Pritesh Nandgaonkar
2019-11-06 10:44:11 -08:00
committed by Facebook Github Bot
parent 2ae2352972
commit 994546b24a
5 changed files with 92 additions and 19 deletions

View File

@@ -15,12 +15,15 @@ import {
ACTIVE_SHEET_PLUGINS,
ACTIVE_SHEET_SETTINGS,
} from './reducers/application';
import {setStaticView} from './reducers/connections';
import SupportRequestFormV2 from './fb-stubs/SupportRequestFormV2';
import {Store} from './reducers/';
import electron, {MenuItemConstructorOptions} from 'electron';
import {notNull} from './utils/typeUtils';
import constants from './fb-stubs/constants';
import os from 'os';
import path from 'path';
import GK from './fb-stubs/GK';
export type DefaultKeyboardAction = 'clear' | 'goToBottom' | 'createPaste';
export type TopLevelMenu = 'Edit' | 'View' | 'Window' | 'Help';
@@ -221,28 +224,44 @@ function getTemplate(
},
});
}
const fileSubmenu: MenuItemConstructorOptions[] = [
{
label: 'Preferences',
accelerator: 'Cmd+,',
click: () => store.dispatch(setActiveSheet(ACTIVE_SHEET_SETTINGS)),
},
{
label: 'Import Flipper File...',
accelerator: 'CommandOrControl+O',
click: function() {
showOpenDialog(store);
},
},
{
label: 'Export',
submenu: exportSubmenu,
},
];
if (GK.get('support_requests_v2')) {
const supportRequestSubmenu = [
{
label: 'Create...',
click: function() {
// Dispatch an action to open the export screen of Support Request form
store.dispatch(setStaticView(SupportRequestFormV2));
},
},
];
fileSubmenu.push({
label: 'Support Requests',
submenu: supportRequestSubmenu,
});
}
const template: MenuItemConstructorOptions[] = [
{
label: 'File',
submenu: [
{
label: 'Preferences',
accelerator: 'Cmd+,',
click: () => store.dispatch(setActiveSheet(ACTIVE_SHEET_SETTINGS)),
},
{
label: 'Import Flipper File...',
accelerator: 'CommandOrControl+O',
click: function() {
showOpenDialog(store);
},
},
{
label: 'Export',
submenu: exportSubmenu,
},
],
submenu: fileSubmenu,
},
{
label: 'Edit',