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:
Chaiwat Ekkaewnumchai
2019-12-05 03:24:51 -08:00
committed by Facebook Github Bot
parent 07487e8122
commit d4acdf8504
2 changed files with 3 additions and 74 deletions

View File

@@ -21,14 +21,12 @@ import {
styled,
colors,
} from 'flipper';
import {FlipperDevicePlugin, BaseAction} from './plugin';
import {connect, ReactReduxContext} from 'react-redux';
import {store} from './store';
import {FlipperDevicePlugin} from './plugin';
import {connect} from 'react-redux';
import React, {Component, Fragment} from 'react';
import {clipboard} from 'electron';
import {
PluginNotification,
clearAllNotifications,
updatePluginBlacklist,
updateCategoryBlacklist,
} from './reducers/notifications';
@@ -36,70 +34,6 @@ import {selectPlugin} from './reducers/connections';
import {State as StoreState} from './reducers/index';
import textContent from './utils/textContent';
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 = {
onClear: () => void;