From 728a3cdf3753b7719c2f11b124497dcbe44d5372 Mon Sep 17 00:00:00 2001 From: William Chargin Date: Fri, 29 Jun 2018 19:37:00 -0700 Subject: [PATCH] Add `name` function to plugin adapter (#463) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Summary: This presents a human-readable name for a plugin. It’s not yet used anywhere. Paired with @decentralion. Test Plan: Flow passes. wchargin-branch: plugin-name --- src/v3/app/pluginAdapter.js | 1 + src/v3/plugins/git/pluginAdapter.js | 3 +++ src/v3/plugins/github/pluginAdapter.js | 3 +++ 3 files changed, 7 insertions(+) diff --git a/src/v3/app/pluginAdapter.js b/src/v3/app/pluginAdapter.js index 26805d5..94f76d9 100644 --- a/src/v3/app/pluginAdapter.js +++ b/src/v3/app/pluginAdapter.js @@ -7,6 +7,7 @@ export interface Renderer { } export interface PluginAdapter { + name(): string; graph(): Graph; renderer(): Renderer; nodePrefix(): NodeAddressT; diff --git a/src/v3/plugins/git/pluginAdapter.js b/src/v3/plugins/git/pluginAdapter.js index 6d4d252..d0edfe5 100644 --- a/src/v3/plugins/git/pluginAdapter.js +++ b/src/v3/plugins/git/pluginAdapter.js @@ -26,6 +26,9 @@ class PluginAdapter implements IPluginAdapter { constructor(graph: Graph) { this._graph = graph; } + name() { + return "Git"; + } graph() { return this._graph; } diff --git a/src/v3/plugins/github/pluginAdapter.js b/src/v3/plugins/github/pluginAdapter.js index be22c4d..bc902a6 100644 --- a/src/v3/plugins/github/pluginAdapter.js +++ b/src/v3/plugins/github/pluginAdapter.js @@ -31,6 +31,9 @@ class PluginAdapter implements IPluginAdapter { this._view = view; this._graph = graph; } + name() { + return "GitHub"; + } graph() { return this._graph; }