Remove bugnub

Summary:
Good bye, sweet prince.
We've decided to remove the internal bugnub as its usage is quite low
and the experience is subpar. In the future, we'd rather reuse the
support form v2 and integrate it with our group.

Reviewed By: mweststrate

Differential Revision: D21300627

fbshipit-source-id: d3c7271efcee4ad22ec76394870902f2712e392d
This commit is contained in:
Pascal Hartig
2020-04-30 06:04:04 -07:00
committed by Facebook GitHub Bot
parent 4a777df617
commit 1011042bdb
7 changed files with 1 additions and 392 deletions

View File

@@ -12,7 +12,6 @@ import {FlexColumn, FlexRow, styled} from 'flipper';
import {connect} from 'react-redux'; import {connect} from 'react-redux';
import TitleBar from './chrome/TitleBar'; import TitleBar from './chrome/TitleBar';
import MainSidebar2 from './chrome/mainsidebar/MainSidebar2'; import MainSidebar2 from './chrome/mainsidebar/MainSidebar2';
import BugReporterDialog from './chrome/BugReporterDialog';
import ErrorBar from './chrome/ErrorBar'; import ErrorBar from './chrome/ErrorBar';
import DoctorBar from './chrome/DoctorBar'; import DoctorBar from './chrome/DoctorBar';
import ShareSheetExportUrl from './chrome/ShareSheetExportUrl'; import ShareSheetExportUrl from './chrome/ShareSheetExportUrl';
@@ -26,7 +25,6 @@ import {ipcRenderer, remote} from 'electron';
import { import {
ActiveSheet, ActiveSheet,
ShareType, ShareType,
ACTIVE_SHEET_BUG_REPORTER,
ACTIVE_SHEET_PLUGINS, ACTIVE_SHEET_PLUGINS,
ACTIVE_SHEET_SHARE_DATA, ACTIVE_SHEET_SHARE_DATA,
ACTIVE_SHEET_SIGN_IN, ACTIVE_SHEET_SIGN_IN,
@@ -41,7 +39,6 @@ import {
ACTIVE_SHEET_CHANGELOG_RECENT_ONLY, ACTIVE_SHEET_CHANGELOG_RECENT_ONLY,
} from './reducers/application'; } from './reducers/application';
import {Logger} from './fb-interfaces/Logger'; import {Logger} from './fb-interfaces/Logger';
import BugReporter from './fb-stubs/BugReporter';
import {State as Store} from './reducers/index'; import {State as Store} from './reducers/index';
import {StaticView, FlipperError} from './reducers/connections'; import {StaticView, FlipperError} from './reducers/connections';
import PluginManager from './chrome/plugin-manager/PluginManager'; import PluginManager from './chrome/plugin-manager/PluginManager';
@@ -54,7 +51,6 @@ const version = remote.app.getVersion();
type OwnProps = { type OwnProps = {
logger: Logger; logger: Logger;
bugReporter: BugReporter;
}; };
type StateFromProps = { type StateFromProps = {
@@ -99,13 +95,6 @@ export class App extends React.Component<Props> {
getSheet = (onHide: () => any) => { getSheet = (onHide: () => any) => {
const {activeSheet} = this.props; const {activeSheet} = this.props;
switch (activeSheet) { switch (activeSheet) {
case ACTIVE_SHEET_BUG_REPORTER:
return (
<BugReporterDialog
bugReporter={this.props.bugReporter}
onHide={onHide}
/>
);
case ACTIVE_SHEET_PLUGINS: case ACTIVE_SHEET_PLUGINS:
return <PluginManager onHide={onHide} />; return <PluginManager onHide={onHide} />;
case ACTIVE_SHEET_SIGN_IN: case ACTIVE_SHEET_SIGN_IN:

View File

@@ -1,345 +0,0 @@
/**
* 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 BugReporter from '../fb-stubs/BugReporter';
import {FlipperPlugin, FlipperDevicePlugin} from '../plugin';
import React, {Fragment, Component} from 'react';
import {connect} from 'react-redux';
import {
Button,
colors,
Link,
Input,
FlexColumn,
FlexRow,
FlexCenter,
Textarea,
Text,
Glyph,
styled,
} from 'flipper';
import {State as Store} from '../reducers';
import LoadingIndicator from '../ui/components/LoadingIndicator';
const Container = styled(FlexColumn)({
padding: 10,
width: 400,
height: 300,
});
const CenteredContainer = styled(FlexColumn)<{size: number}>(({size}) => ({
justifyContent: 'center',
alignItems: 'center',
width: size,
height: size,
}));
const Icon = styled(Glyph)({
marginRight: 8,
marginLeft: 3,
});
const Center = styled(Text)({
textAlign: 'center',
lineHeight: '130%',
paddingLeft: 20,
paddingRight: 20,
});
const Title = styled.div({
fontWeight: 500,
marginTop: 8,
marginLeft: 2,
marginBottom: 8,
});
const textareaStyle = {
margin: 0,
marginBottom: 10,
};
const TitleInput = styled(Input)({
...textareaStyle,
height: 30,
});
const DescriptionTextarea = styled(Textarea)({
...textareaStyle,
flexGrow: 1,
});
const SubmitButtonContainer = styled.div({
marginLeft: 'auto',
});
const Footer = styled(FlexRow)({
lineHeight: '24px',
});
const CloseDoneButton = styled(Button)({
marginTop: 20,
marginLeft: 'auto !important',
marginRight: 'auto',
});
const InfoBox = styled(FlexRow)({
marginBottom: 20,
lineHeight: '130%',
});
type State = {
description: string;
title: string;
submitting: boolean;
success: number | null | undefined;
error: string | null | undefined;
};
type OwnProps = {
bugReporter: BugReporter;
onHide: () => any;
};
type DispatchFromProps = {};
type StateFromProps = {
activePlugin:
| typeof FlipperPlugin
| typeof FlipperDevicePlugin
| null
| undefined;
};
type Props = OwnProps & StateFromProps & DispatchFromProps;
class BugReporterDialog extends Component<Props, State> {
state = {
description: '',
title: '',
submitting: false,
success: null,
error: null,
};
titleRef?: HTMLElement | null;
descriptionRef?: HTMLElement | null;
onDescriptionChange = (e: React.ChangeEvent<HTMLTextAreaElement>) => {
this.setState({description: e.target.value});
};
onTitleChange = (e: React.ChangeEvent<HTMLInputElement>) => {
this.setState({title: e.target.value});
};
onSubmit = () => {
// validate fields
const {title, description} = this.state;
if (!title) {
this.setState({
error: 'Title required.',
});
if (this.titleRef) {
this.titleRef.focus();
}
return;
}
if (!description) {
this.setState({
error: 'Description required.',
});
if (this.descriptionRef) {
this.descriptionRef.focus();
}
return;
}
this.setState(
{
error: null,
submitting: true,
},
() => {
// this will be called before the next repaint
requestAnimationFrame(() => {
// we have to call this again to ensure a repaint has actually happened
// as requestAnimationFrame is called BEFORE a repaint, not after which
// means we have to queue up twice to actually ensure a repaint has
// happened
requestAnimationFrame(() => {
this.props.bugReporter
.report(title, description)
.then((id: number) => {
this.setState({
submitting: false,
success: id,
});
})
.catch((err) => {
this.setState({
error: err.message,
submitting: false,
});
});
});
});
},
);
};
setTitleRef = (ref: HTMLElement | null) => {
this.titleRef = ref;
};
setDescriptionRef = (ref: HTMLElement | null) => {
this.descriptionRef = ref;
};
onCancel = () => {
if (this.state.submitting) {
this.props.bugReporter.abort();
}
this.setState({
error: null,
title: '',
description: '',
submitting: false,
});
this.props.onHide();
};
render() {
let content;
const {title, success, error, description, submitting} = this.state;
const {activePlugin} = this.props;
if (success) {
content = (
<FlexCenter grow={true}>
<FlexColumn>
<Center>
<Glyph
name="checkmark-circle"
size={24}
variant="outline"
color={colors.light30}
/>
<br />
<Title>Bug Report created</Title>
The bug report{' '}
<Link
href={`https://our.intern.facebook.com/intern/bug/${success}`}>
{success}
</Link>{' '}
was successfully created. Thank you for your help making Flipper
better!
</Center>
<CloseDoneButton onClick={this.onCancel} compact type="primary">
Close
</CloseDoneButton>
</FlexColumn>
</FlexCenter>
);
} else {
if (submitting) {
content = (
<Fragment>
<FlexCenter grow={true}>
<CenteredContainer size={200}>
<LoadingIndicator size={16} />
<Title> Submitting... </Title>
</CenteredContainer>
</FlexCenter>
<Footer>
<SubmitButtonContainer>
<Button onClick={this.onCancel} disabled={false} compact padded>
Cancel
</Button>
</SubmitButtonContainer>
</Footer>
</Fragment>
);
} else {
content = (
<Fragment>
<Title>Report a bug in Flipper</Title>
<TitleInput
placeholder="Title"
value={title}
ref={this.setTitleRef}
onChange={this.onTitleChange}
/>
<DescriptionTextarea
placeholder="Describe your problem in as much detail as possible."
value={description}
ref={this.setDescriptionRef}
onChange={this.onDescriptionChange}
/>
{activePlugin && activePlugin.bugs && (
<InfoBox>
<Icon color={colors.light50} name="info-circle" />
<span>
If your bug is related to the{' '}
<strong>
{(activePlugin && activePlugin.title) || activePlugin.id}{' '}
plugin
</strong>
{activePlugin && activePlugin.bugs && activePlugin.bugs.url && (
<span>
, you might find useful information about it here:{' '}
<Link href={activePlugin.bugs.url || ''}>
{activePlugin.bugs.url}
</Link>
</span>
)}
{activePlugin &&
activePlugin.bugs &&
activePlugin.bugs.email && (
<span>
, you might also want contact{' '}
<Link
href={'mailto:' + String(activePlugin.bugs.email)}>
{activePlugin.bugs.email}
</Link>
, the author/oncall of this plugin, directly
</span>
)}
.
</span>
</InfoBox>
)}
<Footer>
{error != null && <Text color={colors.red}>{error}</Text>}
<SubmitButtonContainer>
<Button onClick={this.onCancel} compact padded>
Cancel
</Button>
<Button type="primary" onClick={this.onSubmit} compact padded>
Submit Report
</Button>
</SubmitButtonContainer>
</Footer>
</Fragment>
);
}
}
return <Container>{content}</Container>;
}
}
export default connect<StateFromProps, DispatchFromProps, OwnProps, Store>(
({
plugins: {devicePlugins, clientPlugins},
connections: {selectedPlugin},
}) => ({
activePlugin: selectedPlugin
? devicePlugins.get(selectedPlugin) || clientPlugins.get(selectedPlugin)
: null,
}),
)(BugReporterDialog);

View File

@@ -14,7 +14,6 @@ import {
setActiveSheet, setActiveSheet,
toggleLeftSidebarVisible, toggleLeftSidebarVisible,
toggleRightSidebarVisible, toggleRightSidebarVisible,
ACTIVE_SHEET_BUG_REPORTER,
ACTIVE_SHEET_SETTINGS, ACTIVE_SHEET_SETTINGS,
ACTIVE_SHEET_DOCTOR, ACTIVE_SHEET_DOCTOR,
} from '../reducers/application'; } from '../reducers/application';
@@ -192,14 +191,6 @@ class TitleBar extends React.Component<Props, StateFromProps> {
reportUsage('settings:opened:fromTitleBar'); reportUsage('settings:opened:fromTitleBar');
}} }}
/> />
{config.bugReportButtonVisible && (
<Button
compact={true}
onClick={() => this.props.setActiveSheet(ACTIVE_SHEET_BUG_REPORTER)}
title="Report Bug in Flipper"
icon="bug"
/>
)}
<Button <Button
icon="first-aid" icon="first-aid"
title="Doctor" title="Doctor"

View File

@@ -1,21 +0,0 @@
/**
* 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 {Logger} from '../fb-interfaces/Logger';
import {Store} from '../reducers/index';
export default class BugReporter {
constructor(_logManager: Logger, _store: Store) {}
public abort() {
console.log('Stub implementation of an abort function.');
}
async report(_title: string, _body: string): Promise<number> {
return Promise.resolve(-1);
}
}

View File

@@ -9,7 +9,6 @@
export default { export default {
updateServer: 'https://www.facebook.com/fbflipper/public/latest.json', updateServer: 'https://www.facebook.com/fbflipper/public/latest.json',
bugReportButtonVisible: false,
showLogin: false, showLogin: false,
showFlipperRating: false, showFlipperRating: false,
warnFBEmployees: true, warnFBEmployees: true,

View File

@@ -14,7 +14,6 @@ import ContextMenuProvider from './ui/components/ContextMenuProvider';
import GK from './fb-stubs/GK'; import GK from './fb-stubs/GK';
import {init as initLogger} from './fb-stubs/Logger'; import {init as initLogger} from './fb-stubs/Logger';
import App from './App'; import App from './App';
import BugReporter from './fb-stubs/BugReporter';
import setupPrefetcher from './fb-stubs/Prefetcher'; import setupPrefetcher from './fb-stubs/Prefetcher';
import {persistStore} from 'redux-persist'; import {persistStore} from 'redux-persist';
import {Store} from './reducers/index'; import {Store} from './reducers/index';
@@ -36,7 +35,6 @@ import {CacheProvider} from '@emotion/core';
import {enableMapSet} from 'immer'; import {enableMapSet} from 'immer';
const logger = initLogger(store); const logger = initLogger(store);
const bugReporter = new BugReporter(logger, store);
enableMapSet(); enableMapSet();
@@ -64,7 +62,7 @@ const AppFrame = () => {
}} }}
/> />
) : ( ) : (
<App logger={logger} bugReporter={bugReporter} /> <App logger={logger} />
)} )}
</CacheProvider> </CacheProvider>
</Provider> </Provider>

View File

@@ -13,7 +13,6 @@ import {ReactElement} from 'react';
import CancellableExportStatus from '../chrome/CancellableExportStatus'; import CancellableExportStatus from '../chrome/CancellableExportStatus';
import {Actions} from './'; import {Actions} from './';
export const ACTIVE_SHEET_PLUGIN_SHEET: 'PLUGIN_SHEET' = 'PLUGIN_SHEET'; export const ACTIVE_SHEET_PLUGIN_SHEET: 'PLUGIN_SHEET' = 'PLUGIN_SHEET';
export const ACTIVE_SHEET_BUG_REPORTER: 'BUG_REPORTER' = 'BUG_REPORTER';
export const ACTIVE_SHEET_PLUGINS: 'PLUGINS' = 'PLUGINS'; export const ACTIVE_SHEET_PLUGINS: 'PLUGINS' = 'PLUGINS';
export const ACTIVE_SHEET_SELECT_PLUGINS_TO_EXPORT: 'SELECT_PLUGINS_TO_EXPORT' = export const ACTIVE_SHEET_SELECT_PLUGINS_TO_EXPORT: 'SELECT_PLUGINS_TO_EXPORT' =
'SELECT_PLUGINS_TO_EXPORT'; 'SELECT_PLUGINS_TO_EXPORT';
@@ -34,7 +33,6 @@ export const ACTIVE_SHEET_CHANGELOG_RECENT_ONLY =
export type ActiveSheet = export type ActiveSheet =
| typeof ACTIVE_SHEET_PLUGIN_SHEET | typeof ACTIVE_SHEET_PLUGIN_SHEET
| typeof ACTIVE_SHEET_BUG_REPORTER
| typeof ACTIVE_SHEET_PLUGINS | typeof ACTIVE_SHEET_PLUGINS
| typeof ACTIVE_SHEET_SHARE_DATA | typeof ACTIVE_SHEET_SHARE_DATA
| typeof ACTIVE_SHEET_SIGN_IN | typeof ACTIVE_SHEET_SIGN_IN