Commit Graph

8 Commits

Author SHA1 Message Date
Pritesh Nandgaonkar
08cdb5e2e8 Fix improper plugin id assignment
Summary: This diff fixes the improper plugin id getting assigned to the variable which lead to notifications not getting shown. The client id has `#` so pluginId is no longer the second argument when one splits the string by `#`. This diff fixes this problem.

Reviewed By: passy

Differential Revision: D13176776

fbshipit-source-id: cd5bdc33c61485e3cdc2f2dbcc615980c39c8b8c
2018-11-23 05:48:11 -08:00
Daniel Büchele
7747a0714d plugin redux
Summary:
Plugins were loaded in `/plugins/index.js` which was loaded once at launch of the app. This moves the list of available plugins to redux. This way, plugins can be dynamically added. The redux store keeps to Maps of plugins (devicePlugins and clientPlugins) with their ID as key:

```
  devicePlugins: Map<string, Class<FlipperDevicePlugin<>>>,
  clientPlugins: Map<string, Class<FlipperPlugin<>>>,
```

On launch of the app, all plugins bundled with the app and the one found in `pluginsPath` are dynamically added.

This changes now allows to add new plugins at any time. All components that need to know which plugins are available (e.g. the sidebar) are connected to the redux store. This way, they will automatically update, whenever a new plugin is added.

- add `plugins` to the redux store to keep the list of available plugins
- add a plugins dispatcher, responsible for loading the plugins on launch
- connecting all React components that imported `plugins/index.js` before to the redux store to get the plugins from there.
- moved the updating of the MenuBar to the plugins dispatcher as it needs to update whenever a new plugin is added.

Reviewed By: jknoxville, passy

Differential Revision: D12449236

fbshipit-source-id: 6ef3e243e2c80443614b901ccbfde485fcb4301c
2018-11-15 07:30:05 -08:00
Daniel Büchele
bd03f891d0 notification category filters
Summary:
Allows filtering notification by category. Category filters are also persisted in redux.

Adds a test suite for notification reducer

Reviewed By: passy

Differential Revision: D12999884

fbshipit-source-id: 5f8d2357e52f091c17b726e1f89ed68f3b7294fb
2018-11-12 01:49:48 -08:00
Daniel Büchele
8cb715bb3a adding actions to notifications
Summary: This diff adds action buttons to the notifications. Notifications with actions can only be sent from the main process. This is why we need to send a message to the main process which then shows the notification. The action callbacks are sent back to the renderer process to handle the action and log the event.

Reviewed By: passy

Differential Revision: D12999886

fbshipit-source-id: b415fded3172582fad11d88cabf0cfc5b3b8d4f9
2018-11-12 01:49:48 -08:00
Daniel Büchele
c8a7ce5cfb link to hub
Summary: Clicking on a notifications links to the Notification Hub highlighting the selected notification.

Reviewed By: jknoxville

Differential Revision: D10487822

fbshipit-source-id: ed907ec244bef970d1b30ddb719856949229d0c4
2018-10-22 06:59:52 -07:00
Daniel Büchele
f1c6ebfbd5 disable GK
Summary: Adding a GK to be able to disable notifications remotely.

Reviewed By: passy

Differential Revision: D10467036

fbshipit-source-id: ee555bd73cb5c58d1113e28fe88fe605480865cf
2018-10-19 10:53:13 -07:00
Daniel Büchele
51f70fd78c call notifications API
Summary:
Adding a static method plugins can implement to trigger notifications:

```
static getActiveNotifications: ?(persistedState: P) => Array<Notification>;
```

When the plugin's persisted state changes, this API is called from the `notification`-dispatcher which updates the notifications store.

Reviewed By: passy

Differential Revision: D10378434

fbshipit-source-id: 778fe3ad4229b03bd5ba14ebfdafa5020c25f34f
2018-10-18 02:47:52 -07:00
Daniel Büchele
069f2be335 notifications] adding native notifications
Summary: Adds a notification disapatcher to the redux store which triggers native notifications.

Reviewed By: jknoxville

Differential Revision: D10301490

fbshipit-source-id: d926d9a5378359ebb98a8b5816100f41db1e13e6
2018-10-10 10:41:09 -07:00