Delete Notification Plugin Code
Summary: Delete dead code as we change to static view Reviewed By: passy Differential Revision: D18810148 fbshipit-source-id: 17b5a2355abb39a711a95b4ffcd0bcd387259787
This commit is contained in:
committed by
Facebook Github Bot
parent
07487e8122
commit
d4acdf8504
@@ -21,14 +21,12 @@ import {
|
|||||||
styled,
|
styled,
|
||||||
colors,
|
colors,
|
||||||
} from 'flipper';
|
} from 'flipper';
|
||||||
import {FlipperDevicePlugin, BaseAction} from './plugin';
|
import {FlipperDevicePlugin} from './plugin';
|
||||||
import {connect, ReactReduxContext} from 'react-redux';
|
import {connect} from 'react-redux';
|
||||||
import {store} from './store';
|
|
||||||
import React, {Component, Fragment} from 'react';
|
import React, {Component, Fragment} from 'react';
|
||||||
import {clipboard} from 'electron';
|
import {clipboard} from 'electron';
|
||||||
import {
|
import {
|
||||||
PluginNotification,
|
PluginNotification,
|
||||||
clearAllNotifications,
|
|
||||||
updatePluginBlacklist,
|
updatePluginBlacklist,
|
||||||
updateCategoryBlacklist,
|
updateCategoryBlacklist,
|
||||||
} from './reducers/notifications';
|
} from './reducers/notifications';
|
||||||
@@ -36,70 +34,6 @@ import {selectPlugin} from './reducers/connections';
|
|||||||
import {State as StoreState} from './reducers/index';
|
import {State as StoreState} from './reducers/index';
|
||||||
import textContent from './utils/textContent';
|
import textContent from './utils/textContent';
|
||||||
import createPaste from './fb-stubs/createPaste';
|
import createPaste from './fb-stubs/createPaste';
|
||||||
import {KeyboardActions} from './MenuBar';
|
|
||||||
import {Store} from 'redux';
|
|
||||||
|
|
||||||
export default class Notifications<
|
|
||||||
S,
|
|
||||||
A extends BaseAction,
|
|
||||||
P
|
|
||||||
> extends FlipperDevicePlugin<S, A, P> {
|
|
||||||
static id = 'notifications';
|
|
||||||
static title = 'Notifications';
|
|
||||||
static icon = 'bell';
|
|
||||||
static keyboardActions: KeyboardActions = ['clear'];
|
|
||||||
|
|
||||||
static supportsDevice() {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
onKeyboardAction = (action: string) => {
|
|
||||||
if (action === 'clear') {
|
|
||||||
this.onClear(store)();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
onClear = (store: Store<StoreState>) => () => {
|
|
||||||
store.dispatch(clearAllNotifications());
|
|
||||||
};
|
|
||||||
|
|
||||||
render() {
|
|
||||||
return (
|
|
||||||
<ReactReduxContext.Consumer>
|
|
||||||
{({store}) => {
|
|
||||||
const {blacklistedPlugins, blacklistedCategories} = (store as Store<
|
|
||||||
StoreState
|
|
||||||
>).getState().notifications;
|
|
||||||
return (
|
|
||||||
<ConnectedNotificationsTable
|
|
||||||
onClear={this.onClear(store)}
|
|
||||||
selectedID={this.props.deepLinkPayload}
|
|
||||||
onSelectPlugin={this.props.selectPlugin}
|
|
||||||
logger={this.props.logger}
|
|
||||||
defaultFilters={[
|
|
||||||
...blacklistedPlugins.map(value => ({
|
|
||||||
value,
|
|
||||||
type: 'exclude',
|
|
||||||
key: 'plugin',
|
|
||||||
})),
|
|
||||||
...blacklistedCategories.map(value => ({
|
|
||||||
value,
|
|
||||||
type: 'exclude',
|
|
||||||
key: 'category',
|
|
||||||
})),
|
|
||||||
]}
|
|
||||||
actions={
|
|
||||||
<Fragment>
|
|
||||||
<Button onClick={this.onClear(store)}>Clear</Button>
|
|
||||||
</Fragment>
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
}}
|
|
||||||
</ReactReduxContext.Consumer>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
type OwnProps = {
|
type OwnProps = {
|
||||||
onClear: () => void;
|
onClear: () => void;
|
||||||
|
|||||||
@@ -30,7 +30,6 @@ import {connect} from 'react-redux';
|
|||||||
import {setPluginState} from './reducers/pluginStates';
|
import {setPluginState} from './reducers/pluginStates';
|
||||||
import {selectPlugin} from './reducers/connections';
|
import {selectPlugin} from './reducers/connections';
|
||||||
import {State as Store} from './reducers/index';
|
import {State as Store} from './reducers/index';
|
||||||
import NotificationsHub from './NotificationsHub';
|
|
||||||
import {activateMenuItems} from './MenuBar';
|
import {activateMenuItems} from './MenuBar';
|
||||||
|
|
||||||
const Container = styled(FlexColumn)({
|
const Container = styled(FlexColumn)({
|
||||||
@@ -196,11 +195,7 @@ export default connect<StateFromProps, DispatchFromProps, OwnProps, Store>(
|
|||||||
| null = null;
|
| null = null;
|
||||||
|
|
||||||
if (selectedPlugin) {
|
if (selectedPlugin) {
|
||||||
if (selectedPlugin === NotificationsHub.id) {
|
activePlugin = devicePlugins.get(selectedPlugin) || null;
|
||||||
activePlugin = NotificationsHub;
|
|
||||||
} else if (selectedPlugin) {
|
|
||||||
activePlugin = devicePlugins.get(selectedPlugin) || null;
|
|
||||||
}
|
|
||||||
target = selectedDevice;
|
target = selectedDevice;
|
||||||
if (selectedDevice && activePlugin) {
|
if (selectedDevice && activePlugin) {
|
||||||
pluginKey = getPluginKey(selectedDevice.serial, activePlugin.id);
|
pluginKey = getPluginKey(selectedDevice.serial, activePlugin.id);
|
||||||
|
|||||||
Reference in New Issue
Block a user