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:
committed by
Facebook Github Bot
parent
2ae2352972
commit
994546b24a
@@ -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,11 +224,7 @@ function getTemplate(
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
const template: MenuItemConstructorOptions[] = [
|
||||
{
|
||||
label: 'File',
|
||||
submenu: [
|
||||
const fileSubmenu: MenuItemConstructorOptions[] = [
|
||||
{
|
||||
label: 'Preferences',
|
||||
accelerator: 'Cmd+,',
|
||||
@@ -242,7 +241,27 @@ function getTemplate(
|
||||
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: fileSubmenu,
|
||||
},
|
||||
{
|
||||
label: 'Edit',
|
||||
|
||||
17
src/fb-stubs/SupportRequestFormV2.tsx
Normal file
17
src/fb-stubs/SupportRequestFormV2.tsx
Normal file
@@ -0,0 +1,17 @@
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
*/
|
||||
|
||||
import React, {Component} from 'react';
|
||||
import {Text} from '../ui';
|
||||
|
||||
export default class extends Component<void, void> {
|
||||
render() {
|
||||
return <Text>Build your support request creation form.</Text>;
|
||||
}
|
||||
}
|
||||
@@ -20,11 +20,13 @@ const WelcomeScreen = isHeadless()
|
||||
? require('../chrome/WelcomeScreenHeadless').default
|
||||
: require('../chrome/WelcomeScreen').default;
|
||||
import SupportRequestForm from '../fb-stubs/SupportRequestFormManager';
|
||||
import SupportRequestFormV2 from '../fb-stubs/SupportRequestFormV2';
|
||||
|
||||
export type StaticView =
|
||||
| null
|
||||
| typeof WelcomeScreen
|
||||
| typeof SupportRequestForm;
|
||||
| typeof SupportRequestForm
|
||||
| typeof SupportRequestFormV2;
|
||||
|
||||
export type FlipperError = {
|
||||
occurrences?: number;
|
||||
|
||||
34
src/ui/components/MultiLineInput.tsx
Normal file
34
src/ui/components/MultiLineInput.tsx
Normal file
@@ -0,0 +1,34 @@
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
*/
|
||||
|
||||
import styled from 'react-emotion';
|
||||
import {colors} from './colors';
|
||||
|
||||
export const multilineStyle = {
|
||||
border: `1px solid ${colors.light15}`,
|
||||
borderRadius: 4,
|
||||
font: 'inherit',
|
||||
fontSize: '1em',
|
||||
height: '28px',
|
||||
lineHeight: '28px',
|
||||
marginRight: 5,
|
||||
|
||||
'&:disabled': {
|
||||
backgroundColor: '#ddd',
|
||||
borderColor: '#ccc',
|
||||
cursor: 'not-allowed',
|
||||
},
|
||||
};
|
||||
|
||||
const MultiLineInput = styled('textarea')({
|
||||
...multilineStyle,
|
||||
padding: '0 10px',
|
||||
});
|
||||
|
||||
export default MultiLineInput;
|
||||
@@ -70,6 +70,7 @@ export {default as TabsContainer} from './components/TabsContainer';
|
||||
|
||||
// inputs
|
||||
export {default as Input} from './components/Input';
|
||||
export {default as MultiLineInput} from './components/MultiLineInput';
|
||||
export {default as Textarea} from './components/Textarea';
|
||||
export {default as Select} from './components/Select';
|
||||
export {default as Checkbox} from './components/Checkbox';
|
||||
|
||||
Reference in New Issue
Block a user