From 1ca6fff31719c4ff8d155dc9f7c88663a6719046 Mon Sep 17 00:00:00 2001 From: Kevin Serrano Date: Thu, 9 Mar 2017 11:31:00 -0800 Subject: Display owned addresses in datalist. --- ui/app/components/ens-input.js | 10 ++++++++++ ui/app/send.js | 2 ++ 2 files changed, 12 insertions(+) (limited to 'ui') diff --git a/ui/app/components/ens-input.js b/ui/app/components/ens-input.js index ffc4eab4a..80c8deb22 100644 --- a/ui/app/components/ens-input.js +++ b/ui/app/components/ens-input.js @@ -21,6 +21,7 @@ function EnsInput () { EnsInput.prototype.render = function () { const props = this.props const opts = extend(props, { + list: 'addresses', onChange: () => { const network = this.props.network let resolverAddress = networkResolvers[network] @@ -46,6 +47,15 @@ EnsInput.prototype.render = function () { style: { width: '100%' }, }, [ h('input.large-input', opts), + h('datalist', + { + id: 'addresses', + }, + [ + Object.keys(props.identities).map((key) => { + return h('option', props.identities[key].address) + }), + ]), this.ensIcon(), ]) } diff --git a/ui/app/send.js b/ui/app/send.js index a281a5fcf..a2ce696cf 100644 --- a/ui/app/send.js +++ b/ui/app/send.js @@ -44,6 +44,7 @@ SendTransactionScreen.prototype.render = function () { var account = state.account var identity = state.identity var network = state.network + var identities = state.identities return ( @@ -153,6 +154,7 @@ SendTransactionScreen.prototype.render = function () { placeholder: 'Recipient Address', onChange: this.recipientDidChange.bind(this), network, + identities, }), ]), -- cgit v1.2.3 From d270cbc9d2f45b6dae184efbe6c405889ee8cba5 Mon Sep 17 00:00:00 2001 From: Kevin Serrano Date: Thu, 9 Mar 2017 13:07:38 -0800 Subject: Create distinct labels and names for addresses. --- ui/app/components/ens-input.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'ui') diff --git a/ui/app/components/ens-input.js b/ui/app/components/ens-input.js index 80c8deb22..2b224fa3e 100644 --- a/ui/app/components/ens-input.js +++ b/ui/app/components/ens-input.js @@ -53,7 +53,11 @@ EnsInput.prototype.render = function () { }, [ Object.keys(props.identities).map((key) => { - return h('option', props.identities[key].address) + let identity = props.identities[key] + return h('option', { + value: identity.address, + label: identity.name, + }) }), ]), this.ensIcon(), -- cgit v1.2.3 From 9f6c04055419f54a730bcbd3f1da4c5f992db94d Mon Sep 17 00:00:00 2001 From: Kevin Serrano Date: Thu, 9 Mar 2017 13:58:42 -0800 Subject: Create persistence address book. --- ui/app/reducers/metamask.js | 1 + 1 file changed, 1 insertion(+) (limited to 'ui') diff --git a/ui/app/reducers/metamask.js b/ui/app/reducers/metamask.js index a3c07d977..10d3b0461 100644 --- a/ui/app/reducers/metamask.js +++ b/ui/app/reducers/metamask.js @@ -19,6 +19,7 @@ function reduceMetamask (state, action) { noActiveNotices: true, lastUnreadNotice: undefined, frequentRpcList: [], + addressBook: [], }, state.metamask) switch (action.type) { -- cgit v1.2.3 From b34ee4daa145c1d4eea2da6fd0cba0763e5c6483 Mon Sep 17 00:00:00 2001 From: Kevin Serrano Date: Thu, 9 Mar 2017 15:10:27 -0800 Subject: Allow for adding recently used addresses to address book. --- ui/app/actions.js | 14 ++++++++++++++ ui/app/components/ens-input.js | 13 +++++++++++-- ui/app/send.js | 13 +++++++++++-- 3 files changed, 36 insertions(+), 4 deletions(-) (limited to 'ui') diff --git a/ui/app/actions.js b/ui/app/actions.js index d4fd7553b..e21b6257d 100644 --- a/ui/app/actions.js +++ b/ui/app/actions.js @@ -75,6 +75,8 @@ var actions = { // account detail screen SHOW_SEND_PAGE: 'SHOW_SEND_PAGE', showSendPage: showSendPage, + ADD_TO_ADDRESS_BOOK: 'ADD_TO_ADDRESS_BOOK', + addToAddressBook: addToAddressBook, REQUEST_ACCOUNT_EXPORT: 'REQUEST_ACCOUNT_EXPORT', requestExportAccount: requestExportAccount, EXPORT_ACCOUNT: 'EXPORT_ACCOUNT', @@ -696,6 +698,18 @@ function setRpcTarget (newRpc) { } } +function addToAddressBook (recipient, nickname) { + log.debug(`background.addToAddressBook`) + return (dispatch) => { + background.setAddressBook(recipient, nickname, (err, result) => { + if (err) { + log.error(err) + return dispatch(self.displayWarning('Address book failed to update')) + } + }) + } +} + function setProviderType (type) { log.debug(`background.setProviderType`) background.setProviderType(type) diff --git a/ui/app/components/ens-input.js b/ui/app/components/ens-input.js index 2b224fa3e..06efe6652 100644 --- a/ui/app/components/ens-input.js +++ b/ui/app/components/ens-input.js @@ -59,6 +59,12 @@ EnsInput.prototype.render = function () { label: identity.name, }) }), + props.addressBook.map((identity) => { + return h('option', { + value: identity.address, + label: identity.name, + }) + }), ]), this.ensIcon(), ]) @@ -94,11 +100,13 @@ EnsInput.prototype.lookupEnsName = function () { this.setState({ loadingEns: false, ensResolution: address, + nickname: recipient.trim(), hoverText: address + '\nClick to Copy', }) } }) .catch((reason) => { + log.error(reason) return this.setState({ loadingEns: false, ensFailure: true, @@ -109,10 +117,11 @@ EnsInput.prototype.lookupEnsName = function () { EnsInput.prototype.componentDidUpdate = function (prevProps, prevState) { const state = this.state || {} - const { ensResolution } = state + const ensResolution = state.ensResolution + const nickname = state.nickname || ' ' if (ensResolution && this.props.onChange && ensResolution !== prevState.ensResolution) { - this.props.onChange(ensResolution) + this.props.onChange(ensResolution, nickname) } } diff --git a/ui/app/send.js b/ui/app/send.js index a2ce696cf..eb32d5e06 100644 --- a/ui/app/send.js +++ b/ui/app/send.js @@ -20,6 +20,7 @@ function mapStateToProps (state) { identities: state.metamask.identities, warning: state.appState.warning, network: state.metamask.network, + addressBook: state.metamask.addressBook, } result.error = result.warning && result.warning.split('.')[0] @@ -45,6 +46,7 @@ SendTransactionScreen.prototype.render = function () { var identity = state.identity var network = state.network var identities = state.identities + var addressBook = state.addressBook return ( @@ -155,6 +157,7 @@ SendTransactionScreen.prototype.render = function () { onChange: this.recipientDidChange.bind(this), network, identities, + addressBook, }), ]), @@ -224,13 +227,17 @@ SendTransactionScreen.prototype.back = function () { this.props.dispatch(actions.backToAccountDetail(address)) } -SendTransactionScreen.prototype.recipientDidChange = function (recipient) { - this.setState({ recipient }) +SendTransactionScreen.prototype.recipientDidChange = function (recipient, nickname) { + this.setState({ + recipient: recipient, + nickname: nickname, + }) } SendTransactionScreen.prototype.onSubmit = function () { const state = this.state || {} const recipient = state.recipient || document.querySelector('input[name="address"]').value + const nickname = state.nickname || ' ' const input = document.querySelector('input[name="amount"]').value const value = util.normalizeEthStringToWei(input) const txData = document.querySelector('input[name="txData"]').value @@ -259,6 +266,8 @@ SendTransactionScreen.prototype.onSubmit = function () { this.props.dispatch(actions.hideWarning()) + this.props.dispatch(actions.addToAddressBook(recipient, nickname)) + var txParams = { from: this.props.address, value: '0x' + value.toString(16), -- cgit v1.2.3 From 2ab86b001dfc4ade4fc6df030175e64359b757e6 Mon Sep 17 00:00:00 2001 From: Kevin Serrano Date: Fri, 10 Mar 2017 09:34:13 -0800 Subject: Add comments. --- ui/app/actions.js | 1 + ui/app/components/ens-input.js | 5 +++++ 2 files changed, 6 insertions(+) (limited to 'ui') diff --git a/ui/app/actions.js b/ui/app/actions.js index e21b6257d..4e0435ade 100644 --- a/ui/app/actions.js +++ b/ui/app/actions.js @@ -698,6 +698,7 @@ function setRpcTarget (newRpc) { } } +// Calls the addressBookController to add a new address. function addToAddressBook (recipient, nickname) { log.debug(`background.addToAddressBook`) return (dispatch) => { diff --git a/ui/app/components/ens-input.js b/ui/app/components/ens-input.js index 06efe6652..d5348ea62 100644 --- a/ui/app/components/ens-input.js +++ b/ui/app/components/ens-input.js @@ -47,11 +47,13 @@ EnsInput.prototype.render = function () { style: { width: '100%' }, }, [ h('input.large-input', opts), + // The address book functionality. h('datalist', { id: 'addresses', }, [ + // Corresponds to the addresses owned. Object.keys(props.identities).map((key) => { let identity = props.identities[key] return h('option', { @@ -59,6 +61,7 @@ EnsInput.prototype.render = function () { label: identity.name, }) }), + // Corresponds to previously sent-to addresses. props.addressBook.map((identity) => { return h('option', { value: identity.address, @@ -118,6 +121,8 @@ EnsInput.prototype.lookupEnsName = function () { EnsInput.prototype.componentDidUpdate = function (prevProps, prevState) { const state = this.state || {} const ensResolution = state.ensResolution + // If an address is sent without a nickname, meaning not from ENS or from + // the user's own accounts, a default of a one-space string is used. const nickname = state.nickname || ' ' if (ensResolution && this.props.onChange && ensResolution !== prevState.ensResolution) { -- cgit v1.2.3 From e4feb50f6f909082b6a65351bbb9bfaeebaf9028 Mon Sep 17 00:00:00 2001 From: Kevin Serrano Date: Mon, 13 Mar 2017 16:41:25 -0700 Subject: Display Custom RPC on lock screen. --- ui/app/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ui') diff --git a/ui/app/app.js b/ui/app/app.js index 2bc92b54c..b3e86220a 100644 --- a/ui/app/app.js +++ b/ui/app/app.js @@ -266,7 +266,7 @@ App.prototype.renderNetworkDropdown = function () { this.renderCustomOption(props.provider), this.renderCommonRpc(rpcList, props.provider), - props.isUnlocked && h(DropMenuItem, { + h(DropMenuItem, { label: 'Custom RPC', closeMenu: () => this.setState({ isNetworkMenuOpen: false }), action: () => this.props.dispatch(actions.showConfigPage()), -- cgit v1.2.3 From b10f370c7463c177df16650a80a57f9875db7685 Mon Sep 17 00:00:00 2001 From: Kevin Serrano Date: Mon, 13 Mar 2017 16:43:34 -0700 Subject: Render config screen from unlock. --- ui/app/app.js | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'ui') diff --git a/ui/app/app.js b/ui/app/app.js index b3e86220a..9c1ba8a3a 100644 --- a/ui/app/app.js +++ b/ui/app/app.js @@ -400,6 +400,10 @@ App.prototype.renderPrimary = function () { log.debug('rendering restore vault screen') return h(HDRestoreVaultScreen, {key: 'HDRestoreVaultScreen'}) + case 'config': + log.debug('rendering config screen from unlock screen.') + return h(ConfigScreen, {key: 'config'}) + default: log.debug('rendering locked screen') return h(UnlockScreen, {key: 'locked'}) -- cgit v1.2.3 From 1ec7930c75f10390e3e4ab553e1032056d1d2c2f Mon Sep 17 00:00:00 2001 From: Kevin Serrano Date: Tue, 14 Mar 2017 14:04:52 -0700 Subject: Minor change in removing opts object. --- ui/app/components/ens-input.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'ui') diff --git a/ui/app/components/ens-input.js b/ui/app/components/ens-input.js index d5348ea62..facf29d97 100644 --- a/ui/app/components/ens-input.js +++ b/ui/app/components/ens-input.js @@ -48,10 +48,7 @@ EnsInput.prototype.render = function () { }, [ h('input.large-input', opts), // The address book functionality. - h('datalist', - { - id: 'addresses', - }, + h('datalist#addresses', [ // Corresponds to the addresses owned. Object.keys(props.identities).map((key) => { -- cgit v1.2.3 From 37ffcfcf0e518ed8843022cd079ce09d0b2239ff Mon Sep 17 00:00:00 2001 From: Kevin Serrano Date: Tue, 14 Mar 2017 17:06:16 -0700 Subject: Rename variables to proper currency state variables. --- ui/app/actions.js | 8 ++++---- ui/app/components/fiat-value.js | 4 ++-- ui/app/config.js | 12 ++++++------ ui/app/reducers/metamask.js | 5 +---- 4 files changed, 13 insertions(+), 16 deletions(-) (limited to 'ui') diff --git a/ui/app/actions.js b/ui/app/actions.js index d4fd7553b..0027a5f67 100644 --- a/ui/app/actions.js +++ b/ui/app/actions.js @@ -71,7 +71,7 @@ var actions = { SHOW_CONF_TX_PAGE: 'SHOW_CONF_TX_PAGE', SHOW_CONF_MSG_PAGE: 'SHOW_CONF_MSG_PAGE', SET_CURRENT_FIAT: 'SET_CURRENT_FIAT', - setCurrentFiat: setCurrentFiat, + setCurrentCurrency: setCurrentCurrency, // account detail screen SHOW_SEND_PAGE: 'SHOW_SEND_PAGE', showSendPage: showSendPage, @@ -328,10 +328,10 @@ function showInfoPage () { } } -function setCurrentFiat (currencyCode) { +function setCurrentCurrency (currencyCode) { return (dispatch) => { dispatch(this.showLoadingIndication()) - log.debug(`background.setCurrentFiat`) + log.debug(`background.setCurrentCurrency`) background.setCurrentCurrency(currencyCode, (err, data) => { dispatch(this.hideLoadingIndication()) if (err) { @@ -341,7 +341,7 @@ function setCurrentFiat (currencyCode) { dispatch({ type: this.SET_CURRENT_FIAT, value: { - currentFiat: data.currentFiat, + currentCurrency: data.currentCurrency, conversionRate: data.conversionRate, conversionDate: data.conversionDate, }, diff --git a/ui/app/components/fiat-value.js b/ui/app/components/fiat-value.js index 13ee48245..298809b30 100644 --- a/ui/app/components/fiat-value.js +++ b/ui/app/components/fiat-value.js @@ -9,7 +9,7 @@ module.exports = connect(mapStateToProps)(FiatValue) function mapStateToProps (state) { return { conversionRate: state.metamask.conversionRate, - currentFiat: state.metamask.currentFiat, + currentCurrency: state.metamask.currentCurrency, } } @@ -34,7 +34,7 @@ FiatValue.prototype.render = function () { fiatTooltipNumber = 'Unknown' } - var fiatSuffix = props.currentFiat + var fiatSuffix = props.currentCurrency return fiatDisplay(fiatDisplayNumber, fiatSuffix) } diff --git a/ui/app/config.js b/ui/app/config.js index 00a4cba88..3f0507f48 100644 --- a/ui/app/config.js +++ b/ui/app/config.js @@ -125,19 +125,19 @@ function rpcValidation (newRpc, state) { } function currentConversionInformation (metamaskState, state) { - var currentFiat = metamaskState.currentFiat + var currentCurrency = metamaskState.currentCurrency var conversionDate = metamaskState.conversionDate return h('div', [ h('span', {style: { fontWeight: 'bold', paddingRight: '10px'}}, 'Current Conversion'), h('span', {style: { fontWeight: 'bold', paddingRight: '10px', fontSize: '13px'}}, `Updated ${Date(conversionDate)}`), - h('select#currentFiat', { + h('select#currentCurrency', { onChange (event) { event.preventDefault() - var element = document.getElementById('currentFiat') - var newFiat = element.value - state.dispatch(actions.setCurrentFiat(newFiat)) + var element = document.getElementById('currentCurrency') + var newCurrency = element.value + state.dispatch(actions.setCurrentCurrency(newCurrency)) }, - defaultValue: currentFiat, + defaultValue: currentCurrency, }, currencies.map((currency) => { return h('option', {key: currency.code, value: currency.code}, `${currency.code} - ${currency.name}`) }) diff --git a/ui/app/reducers/metamask.js b/ui/app/reducers/metamask.js index a3c07d977..269f8d272 100644 --- a/ui/app/reducers/metamask.js +++ b/ui/app/reducers/metamask.js @@ -13,9 +13,6 @@ function reduceMetamask (state, action) { rpcTarget: 'https://rawtestrpc.metamask.io/', identities: {}, unapprovedTxs: {}, - currentFiat: 'USD', - conversionRate: 0, - conversionDate: 'N/A', noActiveNotices: true, lastUnreadNotice: undefined, frequentRpcList: [], @@ -126,7 +123,7 @@ function reduceMetamask (state, action) { case actions.SET_CURRENT_FIAT: return extend(metamaskState, { - currentFiat: action.value.currentFiat, + currentCurrency: action.value.currentCurrency, conversionRate: action.value.conversionRate, conversionDate: action.value.conversionDate, }) -- cgit v1.2.3 From 35c05607b091f6064be6802a2eb1023d837c9c85 Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Thu, 16 Mar 2017 12:22:09 -0700 Subject: Improve personal_sign style textarea was not resizing the way I'd expected, so made it permanently larger, to accomodate larger messages. --- ui/app/components/binary-renderer.js | 21 ++++++++++++--------- ui/app/components/pending-personal-msg-details.js | 13 +++++++++++-- 2 files changed, 23 insertions(+), 11 deletions(-) (limited to 'ui') diff --git a/ui/app/components/binary-renderer.js b/ui/app/components/binary-renderer.js index a9d49b128..0b6a1f5c2 100644 --- a/ui/app/components/binary-renderer.js +++ b/ui/app/components/binary-renderer.js @@ -2,6 +2,7 @@ const Component = require('react').Component const h = require('react-hyperscript') const inherits = require('util').inherits const ethUtil = require('ethereumjs-util') +const extend = require('xtend') module.exports = BinaryRenderer @@ -12,20 +13,22 @@ function BinaryRenderer () { BinaryRenderer.prototype.render = function () { const props = this.props - const { value } = props + const { value, style } = props const text = this.hexToText(value) + const defaultStyle = extend({ + width: '315px', + maxHeight: '210px', + resize: 'none', + border: 'none', + background: 'white', + padding: '3px', + }, style) + return ( h('textarea.font-small', { readOnly: true, - style: { - width: '315px', - maxHeight: '210px', - resize: 'none', - border: 'none', - background: 'white', - padding: '3px', - }, + style: defaultStyle, defaultValue: text, }) ) diff --git a/ui/app/components/pending-personal-msg-details.js b/ui/app/components/pending-personal-msg-details.js index fa2c6416c..1050513f2 100644 --- a/ui/app/components/pending-personal-msg-details.js +++ b/ui/app/components/pending-personal-msg-details.js @@ -40,9 +40,18 @@ PendingMsgDetails.prototype.render = function () { }), // message data - h('div', [ + h('div', { + style: { + height: '260px', + }, + }, [ h('label.font-small', { style: { display: 'block' } }, 'MESSAGE'), - h(BinaryRenderer, { value: data }), + h(BinaryRenderer, { + value: data, + style: { + height: '215px', + }, + }), ]), ]) -- cgit v1.2.3 From 889132b16cbafbb5a8e35dd2cf6acc9a7fe3d5fa Mon Sep 17 00:00:00 2001 From: Kevin Serrano Date: Tue, 21 Mar 2017 06:57:49 -0700 Subject: Add action to hide loading indication on an incorrect pw. --- ui/app/actions.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'ui') diff --git a/ui/app/actions.js b/ui/app/actions.js index b09021577..13a9cf547 100644 --- a/ui/app/actions.js +++ b/ui/app/actions.js @@ -269,7 +269,10 @@ function requestRevealSeed (password) { dispatch(actions.showLoadingIndication()) log.debug(`background.submitPassword`) background.submitPassword(password, (err) => { - if (err) return dispatch(actions.displayWarning(err.message)) + if (err) { + dispatch(actions.hideLoadingIndication()) + return dispatch(actions.displayWarning(err.message)) + } log.debug(`background.placeSeedWords`) background.placeSeedWords((err) => { if (err) return dispatch(actions.displayWarning(err.message)) @@ -698,7 +701,7 @@ function setRpcTarget (newRpc) { } } -// Calls the addressBookController to add a new address. +// Calls the addressBookController to add a new address. function addToAddressBook (recipient, nickname) { log.debug(`background.addToAddressBook`) return (dispatch) => { -- cgit v1.2.3 From 0e43606b162db28c72ea0b76a14a92f88c8f2109 Mon Sep 17 00:00:00 2001 From: Kevin Serrano Date: Tue, 21 Mar 2017 08:53:34 -0700 Subject: Adjust private key confirmation style and logic. --- ui/app/actions.js | 26 +++++++---- ui/app/components/account-export.js | 92 ++++++++++++++++++++++--------------- ui/app/css/index.css | 3 +- 3 files changed, 75 insertions(+), 46 deletions(-) (limited to 'ui') diff --git a/ui/app/actions.js b/ui/app/actions.js index b09021577..9d6676d01 100644 --- a/ui/app/actions.js +++ b/ui/app/actions.js @@ -698,7 +698,7 @@ function setRpcTarget (newRpc) { } } -// Calls the addressBookController to add a new address. +// Calls the addressBookController to add a new address. function addToAddressBook (recipient, nickname) { log.debug(`background.addToAddressBook`) return (dispatch) => { @@ -772,22 +772,30 @@ function requestExportAccount () { } } -function exportAccount (address) { +function exportAccount (password, address) { var self = this return function (dispatch) { dispatch(self.showLoadingIndication()) - log.debug(`background.exportAccount`) - background.exportAccount(address, function (err, result) { - dispatch(self.hideLoadingIndication()) - + log.debug(`background.submitPassword`) + background.submitPassword(password, function (err) { if (err) { - log.error(err) - return dispatch(self.displayWarning('Had a problem exporting the account.')) + log.error('Error in submiting password.') + dispatch(self.hideLoadingIndication()) + return dispatch(self.displayWarning('Incorrect Password.')) } + log.debug(`background.exportAccount`) + background.exportAccount(address, function (err, result) { + dispatch(self.hideLoadingIndication()) - dispatch(self.showPrivateKey(result)) + if (err) { + log.error(err) + return dispatch(self.displayWarning('Had a problem exporting the account.')) + } + + dispatch(self.showPrivateKey(result)) + }) }) } } diff --git a/ui/app/components/account-export.js b/ui/app/components/account-export.js index 6d8b099a5..38a1d28ef 100644 --- a/ui/app/components/account-export.js +++ b/ui/app/components/account-export.js @@ -4,14 +4,21 @@ const inherits = require('util').inherits const copyToClipboard = require('copy-to-clipboard') const actions = require('../actions') const ethUtil = require('ethereumjs-util') +const connect = require('react-redux').connect -module.exports = ExportAccountView +module.exports = connect(mapStateToProps)(ExportAccountView) inherits(ExportAccountView, Component) function ExportAccountView () { Component.call(this) } +function mapStateToProps (state) { + return { + warning: state.appState.warning, + } +} + ExportAccountView.prototype.render = function () { console.log('EXPORT VIEW') console.dir(this.props) @@ -28,35 +35,57 @@ ExportAccountView.prototype.render = function () { if (notExporting) return h('div') if (exportRequested) { - var warning = `Exporting your private key is very dangerous, - and you should only do it if you know what you're doing.` - var confirmation = `If you're absolutely sure, type "I understand" below and - submit.` + var warning = `Export private keys at your own risk.` return ( - h('div', { - key: 'exporting', style: { - margin: '0 20px', + display: 'inline-block', + textAlign: 'center', }, - }, [ - h('p.error', warning), - h('p', confirmation), - h('input#exportAccount.sizing-input', { - onKeyPress: this.onExportKeyPress.bind(this), - style: { - position: 'relative', - top: '1.5px', + }, + [ + h('div', { + key: 'exporting', + style: { + margin: '0 20px', + }, + }, [ + h('p.error', warning), + h('input#exportAccount.sizing-input', { + placeholder: 'confirm password', + onKeyPress: this.onExportKeyPress.bind(this), + style: { + position: 'relative', + top: '1.5px', + marginBottom: '7px', + }, + }), + ]), + h('div', { + key: 'buttons', + style: { + margin: '0 20px', + }, }, - }), - h('button', { - onClick: () => this.onExportKeyPress({ key: 'Enter', preventDefault: () => {} }), - }, 'Submit'), - h('button', { - onClick: () => this.props.dispatch(actions.backToAccountDetail(this.props.address)), - }, 'Cancel'), - ]) - + [ + h('button', { + onClick: () => this.onExportKeyPress({ key: 'Enter', preventDefault: () => {} }), + style: { + marginRight: '10px', + }, + }, 'Submit'), + h('button', { + onClick: () => this.props.dispatch(actions.backToAccountDetail(this.props.address)), + }, 'Cancel'), + ]), + (this.props.warning) && ( + h('span.error', { + style: { + margin: '20px', + }, + }, this.props.warning.split('-')) + ), + ]) ) } @@ -89,15 +118,6 @@ ExportAccountView.prototype.onExportKeyPress = function (event) { if (event.key !== 'Enter') return event.preventDefault() - var input = document.getElementById('exportAccount') - if (input.value === 'I understand') { - this.props.dispatch(actions.exportAccount(this.props.address)) - } else { - input.value = '' - input.placeholder = 'Please retype "I understand" exactly.' - } -} - -ExportAccountView.prototype.exportAccount = function (address) { - this.props.dispatch(actions.exportAccount(address)) + var input = document.getElementById('exportAccount').value + this.props.dispatch(actions.exportAccount(input, this.props.address)) } diff --git a/ui/app/css/index.css b/ui/app/css/index.css index 8c6ff29d3..3ec0ac5c5 100644 --- a/ui/app/css/index.css +++ b/ui/app/css/index.css @@ -266,8 +266,9 @@ app sections } .sizing-input{ - font-size: 1em; + font-size: 14px; height: 30px; + padding-left: 5px; } .editable-label{ display: flex; -- cgit v1.2.3 From 605c2a7404ba235aa4894a5b6f4b6afa6b41004f Mon Sep 17 00:00:00 2001 From: Kevin Serrano Date: Tue, 21 Mar 2017 09:15:12 -0700 Subject: Remove redundant removal of loading indicator. Integrate loading indicator disappear with display warning. --- ui/app/actions.js | 7 ++----- ui/app/reducers/app.js | 1 + 2 files changed, 3 insertions(+), 5 deletions(-) (limited to 'ui') diff --git a/ui/app/actions.js b/ui/app/actions.js index 13a9cf547..ac54158d0 100644 --- a/ui/app/actions.js +++ b/ui/app/actions.js @@ -215,7 +215,7 @@ function confirmSeedWords () { dispatch(actions.showLoadingIndication()) log.debug(`background.clearSeedWordCache`) background.clearSeedWordCache((err, account) => { - dispatch(actions.hideLoadingIndication()) + // dispatch(actions.hideLoadingIndication()) if (err) { return dispatch(actions.displayWarning(err.message)) } @@ -231,7 +231,7 @@ function createNewVaultAndRestore (password, seed) { dispatch(actions.showLoadingIndication()) log.debug(`background.createNewVaultAndRestore`) background.createNewVaultAndRestore(password, seed, (err) => { - dispatch(actions.hideLoadingIndication()) + // dispatch(actions.hideLoadingIndication()) if (err) return dispatch(actions.displayWarning(err.message)) dispatch(actions.showAccountsPage()) }) @@ -270,13 +270,11 @@ function requestRevealSeed (password) { log.debug(`background.submitPassword`) background.submitPassword(password, (err) => { if (err) { - dispatch(actions.hideLoadingIndication()) return dispatch(actions.displayWarning(err.message)) } log.debug(`background.placeSeedWords`) background.placeSeedWords((err) => { if (err) return dispatch(actions.displayWarning(err.message)) - dispatch(actions.hideLoadingIndication()) }) }) } @@ -299,7 +297,6 @@ function importNewAccount (strategy, args) { dispatch(actions.showLoadingIndication('This may take a while, be patient.')) log.debug(`background.importAccountWithStrategy`) background.importAccountWithStrategy(strategy, args, (err) => { - dispatch(actions.hideLoadingIndication()) if (err) return dispatch(actions.displayWarning(err.message)) log.debug(`background.getState`) background.getState((err, newState) => { diff --git a/ui/app/reducers/app.js b/ui/app/reducers/app.js index 7ea1e1d7c..b9e3f7b16 100644 --- a/ui/app/reducers/app.js +++ b/ui/app/reducers/app.js @@ -426,6 +426,7 @@ function reduceApp (state, action) { case actions.DISPLAY_WARNING: return extend(appState, { warning: action.value, + isLoading: false, }) case actions.HIDE_WARNING: -- cgit v1.2.3 From b0c0c30689773113ce592b0540de10696e54d372 Mon Sep 17 00:00:00 2001 From: Kevin Serrano Date: Tue, 21 Mar 2017 13:38:27 -0700 Subject: Uncomment lines relating to showing indicator. --- ui/app/actions.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ui') diff --git a/ui/app/actions.js b/ui/app/actions.js index ac54158d0..2fefccf9f 100644 --- a/ui/app/actions.js +++ b/ui/app/actions.js @@ -215,7 +215,7 @@ function confirmSeedWords () { dispatch(actions.showLoadingIndication()) log.debug(`background.clearSeedWordCache`) background.clearSeedWordCache((err, account) => { - // dispatch(actions.hideLoadingIndication()) + dispatch(actions.hideLoadingIndication()) if (err) { return dispatch(actions.displayWarning(err.message)) } @@ -231,7 +231,7 @@ function createNewVaultAndRestore (password, seed) { dispatch(actions.showLoadingIndication()) log.debug(`background.createNewVaultAndRestore`) background.createNewVaultAndRestore(password, seed, (err) => { - // dispatch(actions.hideLoadingIndication()) + dispatch(actions.hideLoadingIndication()) if (err) return dispatch(actions.displayWarning(err.message)) dispatch(actions.showAccountsPage()) }) -- cgit v1.2.3 From f2e40e85b7751e891ce04935ad85a984076495fd Mon Sep 17 00:00:00 2001 From: Kevin Serrano Date: Wed, 22 Mar 2017 12:18:13 -0400 Subject: Add one more loading indication. --- ui/app/actions.js | 1 + 1 file changed, 1 insertion(+) (limited to 'ui') diff --git a/ui/app/actions.js b/ui/app/actions.js index 2fefccf9f..3b1fc0435 100644 --- a/ui/app/actions.js +++ b/ui/app/actions.js @@ -300,6 +300,7 @@ function importNewAccount (strategy, args) { if (err) return dispatch(actions.displayWarning(err.message)) log.debug(`background.getState`) background.getState((err, newState) => { + dispatch(actions.hideLoadingIndication()) if (err) { return dispatch(actions.displayWarning(err.message)) } -- cgit v1.2.3 From 4116b37d32e467bbd4cbb113851667115d28cf64 Mon Sep 17 00:00:00 2001 From: Kevin Serrano Date: Wed, 22 Mar 2017 16:01:38 -0400 Subject: Modify css rule for unused hollow diamond. --- ui/app/css/lib.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ui') diff --git a/ui/app/css/lib.css b/ui/app/css/lib.css index 99c6f1b9d..670dc9fd0 100644 --- a/ui/app/css/lib.css +++ b/ui/app/css/lib.css @@ -188,7 +188,7 @@ hr.horizontal-line { .hollow-diamond { transform: rotate(45deg); - border: 1px solid #038789; + border: 3px solid #690496; } .pending-dot { -- cgit v1.2.3 From c00544de91caec4d76f34aeaf91f025292ae0384 Mon Sep 17 00:00:00 2001 From: Kevin Serrano Date: Wed, 22 Mar 2017 16:02:17 -0400 Subject: Add conditional kovan logic to etherscan link generators. --- ui/lib/account-link.js | 4 +++- ui/lib/explorer-link.js | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'ui') diff --git a/ui/lib/account-link.js b/ui/lib/account-link.js index 77db0851d..948f32da1 100644 --- a/ui/lib/account-link.js +++ b/ui/lib/account-link.js @@ -1,7 +1,6 @@ module.exports = function (address, network) { const net = parseInt(network) let link - switch (net) { case 1: // main net link = `http://etherscan.io/address/${address}` @@ -12,6 +11,9 @@ module.exports = function (address, network) { case 3: // ropsten test net link = `http://testnet.etherscan.io/address/${address}` break + case 42: // kovan test net + link = `http://kovan.etherscan.io/address/${address}` + break default: link = '' break diff --git a/ui/lib/explorer-link.js b/ui/lib/explorer-link.js index dc6be2984..7ae19cca0 100644 --- a/ui/lib/explorer-link.js +++ b/ui/lib/explorer-link.js @@ -5,9 +5,12 @@ module.exports = function (hash, network) { case 1: // main net prefix = '' break - case 3: // morden test net + case 3: // ropsten test net prefix = 'testnet.' break + case 42: // kovan test net + prefix = 'kovan.' + break default: prefix = '' } -- cgit v1.2.3 From b3dfc4e639bf4e73784d8a53227cfc0bc0a650fd Mon Sep 17 00:00:00 2001 From: Kevin Serrano Date: Wed, 22 Mar 2017 16:03:02 -0400 Subject: Add kovan conditional to config screen. --- ui/app/config.js | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'ui') diff --git a/ui/app/config.js b/ui/app/config.js index 3f0507f48..444365de2 100644 --- a/ui/app/config.js +++ b/ui/app/config.js @@ -161,6 +161,11 @@ function currentProviderDisplay (metamaskState) { value = 'Ropsten Test Network' break + case 'kovan': + title = 'Current Network' + value = 'Kovan Test Network' + break + default: title = 'Current RPC' value = metamaskState.provider.rpcTarget -- cgit v1.2.3 From 4757858df0ea63952ec8e435749a0f2df0782612 Mon Sep 17 00:00:00 2001 From: Kevin Serrano Date: Wed, 22 Mar 2017 16:03:51 -0400 Subject: Add conditional kovan to current network component. --- ui/app/components/network.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'ui') diff --git a/ui/app/components/network.js b/ui/app/components/network.js index 77805fd57..d9045167f 100644 --- a/ui/app/components/network.js +++ b/ui/app/components/network.js @@ -40,6 +40,9 @@ Network.prototype.render = function () { } else if (parseInt(networkNumber) === 3) { hoverText = 'Ropsten Test Network' iconName = 'ropsten-test-network' + } else if (providerName === 'kovan') { + hoverText = 'Kovan Test Network' + iconName = 'kovan-test-network' } else { hoverText = 'Unknown Private Network' iconName = 'unknown-private-network' @@ -70,6 +73,15 @@ Network.prototype.render = function () { }}, 'Ropsten Test Net'), ]) + case 'kovan-test-network': + return h('.network-indicator', [ + h('.menu-icon.hollow-diamond'), + h('.network-name', { + style: { + color: '#690496', + }}, + 'Kovan Test Net'), + ]) default: return h('.network-indicator', [ h('i.fa.fa-question-circle.fa-lg', { -- cgit v1.2.3 From 34f3889eb00d41920c67ec2d4845626b5b480eb5 Mon Sep 17 00:00:00 2001 From: Kevin Serrano Date: Wed, 22 Mar 2017 16:04:28 -0400 Subject: Add kovan to drop-menu-item --- ui/app/components/drop-menu-item.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'ui') diff --git a/ui/app/components/drop-menu-item.js b/ui/app/components/drop-menu-item.js index 9f002234e..3eb6ec876 100644 --- a/ui/app/components/drop-menu-item.js +++ b/ui/app/components/drop-menu-item.js @@ -42,7 +42,10 @@ DropMenuItem.prototype.activeNetworkRender = function () { if (providerType === 'mainnet') return h('.check', '✓') break case 'Ropsten Test Network': - if (provider.type === 'testnet') return h('.check', '✓') + if (providerType === 'testnet') return h('.check', '✓') + break + case 'Kovan Test Network': + if (providerType === 'kovan') return h('.check', '✓') break case 'Localhost 8545': if (activeNetwork === 'http://localhost:8545') return h('.check', '✓') -- cgit v1.2.3 From b26c53452e2817f4f00a4770eae8828731e97808 Mon Sep 17 00:00:00 2001 From: Kevin Serrano Date: Wed, 22 Mar 2017 16:05:04 -0400 Subject: Add Kovan test network to our application. --- ui/app/app.js | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'ui') diff --git a/ui/app/app.js b/ui/app/app.js index 9c1ba8a3a..5a7596aca 100644 --- a/ui/app/app.js +++ b/ui/app/app.js @@ -255,6 +255,15 @@ App.prototype.renderNetworkDropdown = function () { provider: props.provider, }), + h(DropMenuItem, { + label: 'Kovan Test Network', + closeMenu: () => this.setState({ isNetworkMenuOpen: false}), + action: () => props.dispatch(actions.setProviderType('kovan')), + icon: h('.menu-icon.hollow-diamond'), + activeNetworkRender: props.network, + provider: props.provider, + }), + h(DropMenuItem, { label: 'Localhost 8545', closeMenu: () => this.setState({ isNetworkMenuOpen: false }), -- cgit v1.2.3 From 5d149258427b25f34dca89e5dfaba57a4f1cb95b Mon Sep 17 00:00:00 2001 From: Kevin Serrano Date: Wed, 22 Mar 2017 16:54:10 -0400 Subject: Fix styling of error message. --- ui/app/accounts/import/json.js | 3 +-- ui/app/accounts/import/private-key.js | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) (limited to 'ui') diff --git a/ui/app/accounts/import/json.js b/ui/app/accounts/import/json.js index 1c2b331d4..5ed31ab0a 100644 --- a/ui/app/accounts/import/json.js +++ b/ui/app/accounts/import/json.js @@ -60,7 +60,7 @@ JsonImportSubview.prototype.render = function () { }, }, 'Import'), - error ? h('span.warning', error) : null, + error ? h('span.error', error) : null, ]) ) } @@ -95,4 +95,3 @@ JsonImportSubview.prototype.createNewKeychain = function () { this.props.dispatch(actions.importNewAccount('JSON File', [ fileContents, password ])) } - diff --git a/ui/app/accounts/import/private-key.js b/ui/app/accounts/import/private-key.js index b139a0374..68ccee58e 100644 --- a/ui/app/accounts/import/private-key.js +++ b/ui/app/accounts/import/private-key.js @@ -48,7 +48,7 @@ PrivateKeyImportView.prototype.render = function () { }, }, 'Import'), - error ? h('span.warning', error) : null, + error ? h('span.error', error) : null, ]) ) } @@ -65,4 +65,3 @@ PrivateKeyImportView.prototype.createNewKeychain = function () { const privateKey = input.value this.props.dispatch(actions.importNewAccount('Private Key', [ privateKey ])) } - -- cgit v1.2.3 From 41e276b0367281bb3e6481d0e7c6af89b7319f90 Mon Sep 17 00:00:00 2001 From: Kevin Serrano Date: Wed, 22 Mar 2017 17:46:51 -0400 Subject: Hide the password in the private key retrieval screen. --- ui/app/components/account-export.js | 1 + 1 file changed, 1 insertion(+) (limited to 'ui') diff --git a/ui/app/components/account-export.js b/ui/app/components/account-export.js index 38a1d28ef..888196c5d 100644 --- a/ui/app/components/account-export.js +++ b/ui/app/components/account-export.js @@ -52,6 +52,7 @@ ExportAccountView.prototype.render = function () { }, [ h('p.error', warning), h('input#exportAccount.sizing-input', { + type: 'password', placeholder: 'confirm password', onKeyPress: this.onExportKeyPress.bind(this), style: { -- cgit v1.2.3 From 525c32ae604a148b803be307b6ac3cb7f9b8617a Mon Sep 17 00:00:00 2001 From: Kevin Serrano Date: Thu, 23 Mar 2017 11:26:39 -0400 Subject: Enable etherscan linking on Kovan transaction list items. --- ui/app/components/transaction-list-item.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ui') diff --git a/ui/app/components/transaction-list-item.js b/ui/app/components/transaction-list-item.js index 44d2dc587..ee32be7d3 100644 --- a/ui/app/components/transaction-list-item.js +++ b/ui/app/components/transaction-list-item.js @@ -28,7 +28,7 @@ TransactionListItem.prototype.render = function () { let isLinkable = false const numericNet = parseInt(network) - isLinkable = numericNet === 1 || numericNet === 3 + isLinkable = numericNet === 1 || numericNet === 3 || numericNet === 42 var isMsg = ('msgParams' in transaction) var isTx = ('txParams' in transaction) -- cgit v1.2.3