From ca5cf06ae9e3e417dd3488bb0d94cdeec74ca18c Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Mon, 27 Feb 2017 10:25:10 -0800 Subject: [PATCH 1/3] Concatenate custom RPC labels that are too long --- ui/app/app.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/ui/app/app.js b/ui/app/app.js index cf865f23f..a05a42516 100644 --- a/ui/app/app.js +++ b/ui/app/app.js @@ -499,6 +499,12 @@ App.prototype.renderCustomOption = function (provider) { const { rpcTarget, type } = provider if (type !== 'rpc') return null + // Concatenate long URLs + let label = rpcTarget + if (rpcTarget.length > 31) { + label = label.substr(0, 34) + '...' + } + switch (rpcTarget) { case 'http://localhost:8545': @@ -506,7 +512,8 @@ App.prototype.renderCustomOption = function (provider) { default: return h(DropMenuItem, { - label: `${rpcTarget}`, + label, + key: rpcTarget, closeMenu: () => this.setState({ isNetworkMenuOpen: false }), icon: h('i.fa.fa-question-circle.fa-lg'), activeNetworkRender: 'custom', @@ -524,6 +531,7 @@ App.prototype.renderCommonRpc = function (rpcList, provider) { } else { return h(DropMenuItem, { label: rpc, + key: rpc, closeMenu: () => this.setState({ isNetworkMenuOpen: false }), action: () => props.dispatch(actions.setRpcTarget(rpc)), icon: h('i.fa.fa-question-circle.fa-lg'), From b5d03cd52418cfd09ce51a23c01e78262d3ffc9b Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Mon, 27 Feb 2017 10:39:48 -0800 Subject: [PATCH 2/3] add controllers to root scripts folder --- app/scripts/{lib => }/controllers/currency.js | 0 app/scripts/{lib => }/controllers/preferences.js | 0 app/scripts/{lib => }/controllers/shapeshift.js | 0 app/scripts/metamask-controller.js | 6 +++--- 4 files changed, 3 insertions(+), 3 deletions(-) rename app/scripts/{lib => }/controllers/currency.js (100%) rename app/scripts/{lib => }/controllers/preferences.js (100%) rename app/scripts/{lib => }/controllers/shapeshift.js (100%) diff --git a/app/scripts/lib/controllers/currency.js b/app/scripts/controllers/currency.js similarity index 100% rename from app/scripts/lib/controllers/currency.js rename to app/scripts/controllers/currency.js diff --git a/app/scripts/lib/controllers/preferences.js b/app/scripts/controllers/preferences.js similarity index 100% rename from app/scripts/lib/controllers/preferences.js rename to app/scripts/controllers/preferences.js diff --git a/app/scripts/lib/controllers/shapeshift.js b/app/scripts/controllers/shapeshift.js similarity index 100% rename from app/scripts/lib/controllers/shapeshift.js rename to app/scripts/controllers/shapeshift.js diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index d8136667f..bdffc87ac 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.js @@ -11,10 +11,10 @@ const streamIntoProvider = require('web3-stream-provider/handler') const MetaMaskProvider = require('web3-provider-engine/zero.js') const setupMultiplex = require('./lib/stream-utils.js').setupMultiplex const KeyringController = require('./keyring-controller') -const PreferencesController = require('./lib/controllers/preferences') -const CurrencyController = require('./lib/controllers/currency') +const PreferencesController = require('./controllers/preferences') +const CurrencyController = require('./controllers/currency') const NoticeController = require('./notice-controller') -const ShapeShiftController = require('./lib/controllers/shapeshift') +const ShapeShiftController = require('./controllers/shapeshift') const MessageManager = require('./lib/message-manager') const PersonalMessageManager = require('./lib/personal-message-manager') const TxManager = require('./transaction-manager') From 6fb33853f2ceeb6ef48988a7ee9334dfc87a8223 Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Mon, 27 Feb 2017 10:53:36 -0800 Subject: [PATCH 3/3] Fix test reference --- test/unit/currency-controller-test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/unit/currency-controller-test.js b/test/unit/currency-controller-test.js index c57b522c7..dd7fa91e0 100644 --- a/test/unit/currency-controller-test.js +++ b/test/unit/currency-controller-test.js @@ -5,7 +5,7 @@ const assert = require('assert') const extend = require('xtend') const rp = require('request-promise') const nock = require('nock') -const CurrencyController = require('../../app/scripts/lib/controllers/currency') +const CurrencyController = require('../../app/scripts/controllers/currency') describe('config-manager', function() { var currencyController