Support handling deeplinks in plugins

Summary:
This adds support for handling incoming deeplinks in a Sandy plugin, which can be done by using a `client.onDeepLink(deepLink => { } )` listener

Also generalized deeplinks to not just support strings, but also richer objects, which is beneficial to plugin to plugin linking.

Reviewed By: jknoxville

Differential Revision: D22524749

fbshipit-source-id: 2cbe8d52f6eac91a1c1c8c8494706952920b9181
This commit is contained in:
Michel Weststrate
2020-07-22 04:11:32 -07:00
committed by Facebook GitHub Bot
parent 485b4c9827
commit f0c54667e0
13 changed files with 225 additions and 31 deletions

View File

@@ -18,7 +18,7 @@ import {selectPlugin} from '../reducers/connections';
import React from 'react';
type StateFromProps = {
deepLinkPayload: string | null;
deepLinkPayload: unknown;
blacklistedPlugins: Array<string>;
blacklistedCategories: Array<string>;
};
@@ -28,7 +28,7 @@ type DispatchFromProps = {
selectPlugin: (payload: {
selectedPlugin: string | null;
selectedApp: string | null | undefined;
deepLinkPayload: string | null;
deepLinkPayload: unknown;
}) => any;
};
@@ -62,7 +62,9 @@ class Notifications extends PureComponent<Props, State> {
<Container>
<ConnectedNotificationsTable
onClear={clearAllNotifications}
selectedID={deepLinkPayload}
selectedID={
typeof deepLinkPayload === 'string' ? deepLinkPayload : null
}
onSelectPlugin={selectPlugin}
logger={logger}
defaultFilters={[