From 88f4931c6f875be5186a0071e2cec5b78fb34b57 Mon Sep 17 00:00:00 2001 From: sdtsui Date: Thu, 10 Aug 2017 17:37:36 -0700 Subject: Fix text overflow for dropdown components flagged by @frankiebee --- ui/app/components/account-dropdowns.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'ui/app') diff --git a/ui/app/components/account-dropdowns.js b/ui/app/components/account-dropdowns.js index b23600e9b..bd60db51e 100644 --- a/ui/app/components/account-dropdowns.js +++ b/ui/app/components/account-dropdowns.js @@ -27,6 +27,10 @@ class AccountDropdowns extends Component { return Object.keys(identities).map((key, index) => { const identity = identities[key] const isSelected = identity.address === selected + console.log("address", identity.address) + console.log("selected:", selected) + console.log("isSelected:", isSelected) + // debugger; return h( DropdownMenuItem, @@ -51,7 +55,16 @@ class AccountDropdowns extends Component { }, }, ), - h('span', { style: { marginLeft: '20px', fontSize: '24px' } }, identity.name || ''), + h('span', { + style: { + marginLeft: '20px', + fontSize: '24px', + maxWidth: '145px', + whiteSpace: 'nowrap', + overflow: 'hidden', + textOverflow: 'ellipsis', + } + }, identity.name || ''), h('span', { style: { marginLeft: '20px', fontSize: '24px' } }, isSelected ? h('.check', '✓') : null), ] ) -- cgit v1.2.3 From 771f9ec124c758556ebba11067e66c9d4843455d Mon Sep 17 00:00:00 2001 From: sdtsui Date: Thu, 10 Aug 2017 17:37:55 -0700 Subject: Fix logic for dropdown components attaching checkmark to correct account --- ui/app/app.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'ui/app') diff --git a/ui/app/app.js b/ui/app/app.js index 4565bdd37..60d36772a 100644 --- a/ui/app/app.js +++ b/ui/app/app.js @@ -43,6 +43,7 @@ function mapStateToProps (state) { accounts, address, } = state.metamask + console.log("ADDRESS:", address) const selected = address || Object.keys(accounts)[0] return { @@ -185,7 +186,7 @@ App.prototype.renderAppBar = function () { style: {}, enableAccountsSelector: true, identities: this.props.identities, - selected: this.props.selected, + selected: this.props.currentView.context, network: this.props.network, }, []), -- cgit v1.2.3 From 2346c9b6b9322458b350d5afd19501372272f0ec Mon Sep 17 00:00:00 2001 From: sdtsui Date: Thu, 10 Aug 2017 17:49:12 -0700 Subject: Add overflow support for all account names in account details --- ui/app/account-detail.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'ui/app') diff --git a/ui/app/account-detail.js b/ui/app/account-detail.js index 22a883096..f6041e856 100644 --- a/ui/app/account-detail.js +++ b/ui/app/account-detail.js @@ -107,14 +107,23 @@ AccountDetailScreen.prototype.render = function () { }, [ h( - 'h2.font-medium.color-forest', + 'div.font-medium.color-forest', { name: 'edit', style: { }, }, [ - identity && identity.name, + h('h2', { + style: { + maxWidth: '180px', + overflowX: 'hidden', + textOverflow: 'ellipsis', + padding: '5px 0px', + }, + }, [ + identity && identity.name, + ]), ] ), h( -- cgit v1.2.3 From 9ec86636050c6d642ff5fa9bf3413d17ccba1a24 Mon Sep 17 00:00:00 2001 From: sdtsui Date: Thu, 10 Aug 2017 17:49:59 -0700 Subject: Cleanup stray logs and lint --- ui/app/app.js | 1 - ui/app/components/account-dropdowns.js | 6 +----- 2 files changed, 1 insertion(+), 6 deletions(-) (limited to 'ui/app') diff --git a/ui/app/app.js b/ui/app/app.js index 60d36772a..1f3d5b0f8 100644 --- a/ui/app/app.js +++ b/ui/app/app.js @@ -43,7 +43,6 @@ function mapStateToProps (state) { accounts, address, } = state.metamask - console.log("ADDRESS:", address) const selected = address || Object.keys(accounts)[0] return { diff --git a/ui/app/components/account-dropdowns.js b/ui/app/components/account-dropdowns.js index bd60db51e..7c24e70bd 100644 --- a/ui/app/components/account-dropdowns.js +++ b/ui/app/components/account-dropdowns.js @@ -27,10 +27,6 @@ class AccountDropdowns extends Component { return Object.keys(identities).map((key, index) => { const identity = identities[key] const isSelected = identity.address === selected - console.log("address", identity.address) - console.log("selected:", selected) - console.log("isSelected:", isSelected) - // debugger; return h( DropdownMenuItem, @@ -63,7 +59,7 @@ class AccountDropdowns extends Component { whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis', - } + }, }, identity.name || ''), h('span', { style: { marginLeft: '20px', fontSize: '24px' } }, isSelected ? h('.check', '✓') : null), ] -- cgit v1.2.3 From 6168efc9cc16d6dc623cb981a6d7f28fedf54477 Mon Sep 17 00:00:00 2001 From: sdtsui Date: Tue, 15 Aug 2017 17:13:11 +0200 Subject: Fix overflow issue on QubesOS, flagged by @kumavis --- ui/app/account-detail.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ui/app') diff --git a/ui/app/account-detail.js b/ui/app/account-detail.js index f6041e856..02089ecd0 100644 --- a/ui/app/account-detail.js +++ b/ui/app/account-detail.js @@ -117,7 +117,7 @@ AccountDetailScreen.prototype.render = function () { h('h2', { style: { maxWidth: '180px', - overflowX: 'hidden', + overflow: 'hidden', textOverflow: 'ellipsis', padding: '5px 0px', }, -- cgit v1.2.3 From 176dd6d214489e447460d20b4223596d84048f8d Mon Sep 17 00:00:00 2001 From: frankiebee Date: Tue, 15 Aug 2017 12:12:57 -0700 Subject: Disable token list --- ui/app/account-detail.js | 35 ++++++++++++++++++++++++++--------- 1 file changed, 26 insertions(+), 9 deletions(-) (limited to 'ui/app') diff --git a/ui/app/account-detail.js b/ui/app/account-detail.js index f6041e856..9921d3067 100644 --- a/ui/app/account-detail.js +++ b/ui/app/account-detail.js @@ -12,7 +12,7 @@ const ExportAccountView = require('./components/account-export') const ethUtil = require('ethereumjs-util') const EditableLabel = require('./components/editable-label') const TabBar = require('./components/tab-bar') -const TokenList = require('./components/token-list') +// const TokenList = require('./components/token-list') const AccountDropdowns = require('./components/account-dropdowns').AccountDropdowns module.exports = connect(mapStateToProps)(AccountDetailScreen) @@ -255,17 +255,34 @@ AccountDetailScreen.prototype.tabSections = function () { AccountDetailScreen.prototype.tabSwitchView = function () { const props = this.props - const { address, network } = props - const { currentAccountTab, tokens } = this.props + const { address/*, network */} = props + const { currentAccountTab/*, tokens*/ } = this.props switch (currentAccountTab) { case 'tokens': - return h(TokenList, { - userAddress: address, - network, - tokens, - addToken: () => this.props.dispatch(actions.showAddTokenPage()), - }) + // return h(TokenList, { + // userAddress: address, + // network, + // tokens, + // addToken: () => this.props.dispatch(actions.showAddTokenPage()), + // }) + return h('.hotFix', { + style: { + padding: '80px', + }, + }, [` + Token List is temporally + you can check your token balnce + `, h('span.hotFix', { + style: { + color: 'rgba(247, 134, 28, 1)', + }, + onClick: () => { + global.platform.openWindow({ + url: `https://ethplorer.io/address/${address}`, + }) + }, + }, 'here')]) default: return this.transactionList() } -- cgit v1.2.3 From a8d6e1fe98416db4d7c9e8615f79a8c77dbb62fc Mon Sep 17 00:00:00 2001 From: frankiebee Date: Tue, 15 Aug 2017 12:16:41 -0700 Subject: fix spelling --- ui/app/account-detail.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'ui/app') diff --git a/ui/app/account-detail.js b/ui/app/account-detail.js index 9921d3067..95e2c1cf9 100644 --- a/ui/app/account-detail.js +++ b/ui/app/account-detail.js @@ -270,10 +270,9 @@ AccountDetailScreen.prototype.tabSwitchView = function () { style: { padding: '80px', }, - }, [` - Token List is temporally - you can check your token balnce - `, h('span.hotFix', { + }, [ + 'Token lists are temporarily down. You can check you your token balances ', + h('span.hotFix', { style: { color: 'rgba(247, 134, 28, 1)', }, -- cgit v1.2.3 From 9c7abacf64c3c83790330c04baf456a1f642ed36 Mon Sep 17 00:00:00 2001 From: Kevin Serrano Date: Tue, 15 Aug 2017 12:26:11 -0700 Subject: Change cursor type to indicate link. --- ui/app/account-detail.js | 1 + 1 file changed, 1 insertion(+) (limited to 'ui/app') diff --git a/ui/app/account-detail.js b/ui/app/account-detail.js index 95e2c1cf9..4046b5875 100644 --- a/ui/app/account-detail.js +++ b/ui/app/account-detail.js @@ -275,6 +275,7 @@ AccountDetailScreen.prototype.tabSwitchView = function () { h('span.hotFix', { style: { color: 'rgba(247, 134, 28, 1)', + cursor: 'pointer', }, onClick: () => { global.platform.openWindow({ -- cgit v1.2.3 From b69f5533d902a1aba121b7d3752475c11084885b Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Wed, 16 Aug 2017 09:49:18 -0700 Subject: ReEnable Token List --- ui/app/account-detail.js | 35 +++++++++-------------------------- 1 file changed, 9 insertions(+), 26 deletions(-) (limited to 'ui/app') diff --git a/ui/app/account-detail.js b/ui/app/account-detail.js index 7af53a694..02089ecd0 100644 --- a/ui/app/account-detail.js +++ b/ui/app/account-detail.js @@ -12,7 +12,7 @@ const ExportAccountView = require('./components/account-export') const ethUtil = require('ethereumjs-util') const EditableLabel = require('./components/editable-label') const TabBar = require('./components/tab-bar') -// const TokenList = require('./components/token-list') +const TokenList = require('./components/token-list') const AccountDropdowns = require('./components/account-dropdowns').AccountDropdowns module.exports = connect(mapStateToProps)(AccountDetailScreen) @@ -255,34 +255,17 @@ AccountDetailScreen.prototype.tabSections = function () { AccountDetailScreen.prototype.tabSwitchView = function () { const props = this.props - const { address/*, network */} = props - const { currentAccountTab/*, tokens*/ } = this.props + const { address, network } = props + const { currentAccountTab, tokens } = this.props switch (currentAccountTab) { case 'tokens': - // return h(TokenList, { - // userAddress: address, - // network, - // tokens, - // addToken: () => this.props.dispatch(actions.showAddTokenPage()), - // }) - return h('.hotFix', { - style: { - padding: '80px', - }, - }, [ - 'Token lists are temporarily down. You can check you your token balances ', - h('span.hotFix', { - style: { - color: 'rgba(247, 134, 28, 1)', - cursor: 'pointer', - }, - onClick: () => { - global.platform.openWindow({ - url: `https://ethplorer.io/address/${address}`, - }) - }, - }, 'here')]) + return h(TokenList, { + userAddress: address, + network, + tokens, + addToken: () => this.props.dispatch(actions.showAddTokenPage()), + }) default: return this.transactionList() } -- cgit v1.2.3 From 722d91c8661a2c0912b7eaf9bcf20f220b76e384 Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Wed, 16 Aug 2017 09:49:23 -0700 Subject: Remove default tokens --- ui/app/components/token-list.js | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) (limited to 'ui/app') diff --git a/ui/app/components/token-list.js b/ui/app/components/token-list.js index 5ea31ae8d..1ea15521a 100644 --- a/ui/app/components/token-list.js +++ b/ui/app/components/token-list.js @@ -5,16 +5,6 @@ const TokenTracker = require('eth-token-tracker') const TokenCell = require('./token-cell.js') const normalizeAddress = require('eth-sig-util').normalize -const defaultTokens = [] -const contracts = require('eth-contract-metadata') -for (const address in contracts) { - const contract = contracts[address] - if (contract.erc20) { - contract.address = address - defaultTokens.push(contract) - } -} - module.exports = TokenList inherits(TokenList, Component) @@ -153,7 +143,7 @@ TokenList.prototype.createFreshTokenTracker = function () { this.tracker = new TokenTracker({ userAddress, provider: global.ethereumProvider, - tokens: uniqueMergeTokens(defaultTokens, this.props.tokens), + tokens: this.props.tokens, pollingInterval: 8000, }) -- cgit v1.2.3 From 3b6ee032f58de18c80f66833c54e4f9795ffbced Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Wed, 16 Aug 2017 09:50:16 -0700 Subject: Remove dead code --- ui/app/components/token-list.js | 14 -------------- 1 file changed, 14 deletions(-) (limited to 'ui/app') diff --git a/ui/app/components/token-list.js b/ui/app/components/token-list.js index 1ea15521a..4bcde7d1d 100644 --- a/ui/app/components/token-list.js +++ b/ui/app/components/token-list.js @@ -3,7 +3,6 @@ const h = require('react-hyperscript') const inherits = require('util').inherits const TokenTracker = require('eth-token-tracker') const TokenCell = require('./token-cell.js') -const normalizeAddress = require('eth-sig-util').normalize module.exports = TokenList @@ -189,16 +188,3 @@ TokenList.prototype.componentWillUnmount = function () { this.tracker.stop() } -function uniqueMergeTokens (tokensA, tokensB) { - const uniqueAddresses = [] - const result = [] - tokensA.concat(tokensB).forEach((token) => { - const normal = normalizeAddress(token.address) - if (!uniqueAddresses.includes(normal)) { - uniqueAddresses.push(normal) - result.push(token) - } - }) - return result -} - -- cgit v1.2.3 From 9fbdeab3deeb12999b14acfb9f8d6dd28b979c10 Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Wed, 16 Aug 2017 12:53:53 -0700 Subject: Fallback to ethplorer link --- ui/app/components/token-list.js | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'ui/app') diff --git a/ui/app/components/token-list.js b/ui/app/components/token-list.js index 4bcde7d1d..2346568bc 100644 --- a/ui/app/components/token-list.js +++ b/ui/app/components/token-list.js @@ -27,7 +27,24 @@ TokenList.prototype.render = function () { if (error) { log.error(error) - return this.message('There was a problem loading your token balances.') + return h('.hotFix', { + style: { + padding: '80px', + }, + }, [ + 'We had trouble loading your token balances. You can view them ', + h('span.hotFix', { + style: { + color: 'rgba(247, 134, 28, 1)', + cursor: 'pointer', + }, + onClick: () => { + global.platform.openWindow({ + url: `https://ethplorer.io/address/${userAddress}`, + }) + }, + }, 'here'), + ]) } const tokenViews = tokens.map((tokenData) => { -- cgit v1.2.3 From 343a7e9cce051d3045fe1a0c8a408c0d7402a1a1 Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Wed, 16 Aug 2017 17:06:21 -0700 Subject: Transition to home view after tx error --- ui/app/actions.js | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) (limited to 'ui/app') diff --git a/ui/app/actions.js b/ui/app/actions.js index eafd04b4c..eebe65ba2 100644 --- a/ui/app/actions.js +++ b/ui/app/actions.js @@ -97,7 +97,6 @@ var actions = { cancelMsg: cancelMsg, signPersonalMsg, cancelPersonalMsg, - sendTx: sendTx, signTx: signTx, updateAndApproveTx, cancelTx: cancelTx, @@ -397,26 +396,13 @@ function signPersonalMsg (msgData) { function signTx (txData) { return (dispatch) => { + dispatch(actions.showLoadingIndication()) global.ethQuery.sendTransaction(txData, (err, data) => { dispatch(actions.hideLoadingIndication()) - if (err) return dispatch(actions.displayWarning(err.message)) - dispatch(actions.hideWarning()) - }) - dispatch(this.showConfTxPage()) - } -} - -function sendTx (txData) { - log.info(`actions - sendTx: ${JSON.stringify(txData.txParams)}`) - return (dispatch) => { - log.debug(`actions calling background.approveTransaction`) - background.approveTransaction(txData.id, (err) => { - if (err) { - dispatch(actions.txError(err)) - return log.error(err.message) - } - dispatch(actions.completedTx(txData.id)) + if (err) dispatch(actions.displayWarning(err.message)) + dispatch(this.goHome()) }) + dispatch(actions.showConfTxPage()) } } @@ -428,6 +414,7 @@ function updateAndApproveTx (txData) { dispatch(actions.hideLoadingIndication()) if (err) { dispatch(actions.txError(err)) + dispatch(actions.goHome()) return log.error(err.message) } dispatch(actions.completedTx(txData.id)) -- cgit v1.2.3 From 98bedfabf932ff75445769898f8f97cf9f6e7f75 Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Thu, 17 Aug 2017 15:35:17 -0700 Subject: Fix eth sign formatting --- ui/app/components/pending-msg-details.js | 2 +- ui/app/components/pending-msg.js | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'ui/app') diff --git a/ui/app/components/pending-msg-details.js b/ui/app/components/pending-msg-details.js index 16308d121..718a22de0 100644 --- a/ui/app/components/pending-msg-details.js +++ b/ui/app/components/pending-msg-details.js @@ -38,7 +38,7 @@ PendingMsgDetails.prototype.render = function () { // message data h('.tx-data.flex-column.flex-justify-center.flex-grow.select-none', [ - h('.flex-row.flex-space-between', [ + h('.flex-column.flex-space-between', [ h('label.font-small', 'MESSAGE'), h('span.font-small', msgParams.data), ]), diff --git a/ui/app/components/pending-msg.js b/ui/app/components/pending-msg.js index b2cac164a..b7133cda8 100644 --- a/ui/app/components/pending-msg.js +++ b/ui/app/components/pending-msg.js @@ -18,6 +18,9 @@ PendingMsg.prototype.render = function () { h('div', { key: msgData.id, + style: { + maxWidth: '350px', + }, }, [ // header @@ -35,7 +38,7 @@ PendingMsg.prototype.render = function () { }, `Signing this message can have dangerous side effects. Only sign messages from sites you fully trust with your entire account. - This will be fixed in a future version.`), + This dangerous method will be removed in a future version.`), // message details h(PendingTxDetails, state), -- cgit v1.2.3 From e0ccdcd6fd4418e658d949247e2c258c5c8278a6 Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Wed, 23 Aug 2017 09:40:24 -0700 Subject: Remove eth-tx-viz link from tx history icons --- ui/app/components/transaction-list-item.js | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'ui/app') diff --git a/ui/app/components/transaction-list-item.js b/ui/app/components/transaction-list-item.js index 9018bab06..5d5d0bcc5 100644 --- a/ui/app/components/transaction-list-item.js +++ b/ui/app/components/transaction-list-item.js @@ -60,16 +60,7 @@ TransactionListItem.prototype.render = function () { }, [ h('.identicon-wrapper.flex-column.flex-center.select-none', [ - h('.pop-hover', { - onClick: (event) => { - event.stopPropagation() - if (!isTx || isPending) return - var url = `https://metamask.github.io/eth-tx-viz/?tx=${transaction.hash}` - global.platform.openWindow({ url }) - }, - }, [ - h(TransactionIcon, { txParams, transaction, isTx, isMsg }), - ]), + h(TransactionIcon, { txParams, transaction, isTx, isMsg }), ]), h(Tooltip, { -- cgit v1.2.3 From 54ce267a9f804b1733d2627ac7568d5eb6fe6518 Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Tue, 29 Aug 2017 11:42:44 -0700 Subject: Add version to state logs Fixes #1986 --- ui/app/reducers.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'ui/app') diff --git a/ui/app/reducers.js b/ui/app/reducers.js index 36045772f..6a2f44534 100644 --- a/ui/app/reducers.js +++ b/ui/app/reducers.js @@ -42,7 +42,10 @@ function rootReducer (state, action) { } window.logState = function () { - var stateString = JSON.stringify(window.METAMASK_CACHED_LOG_STATE, removeSeedWords, 2) + let state = window.METAMASK_CACHED_LOG_STATE + const version = global.platform.getVersion() + state.version = version + let stateString = JSON.stringify(state, removeSeedWords, 2) return stateString } -- cgit v1.2.3 From 04011f9ea764cf2458637e41012c131d8b7a9aca Mon Sep 17 00:00:00 2001 From: Thomas Huang Date: Tue, 29 Aug 2017 17:54:01 -0700 Subject: Multiple tokens shows the amount when greater than 1 --- ui/app/components/token-list.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ui/app') diff --git a/ui/app/components/token-list.js b/ui/app/components/token-list.js index 2346568bc..998ec901d 100644 --- a/ui/app/components/token-list.js +++ b/ui/app/components/token-list.js @@ -95,7 +95,7 @@ TokenList.prototype.renderTokenStatusBar = function () { let msg if (tokens.length === 1) { msg = `You own 1 token` - } else if (tokens.length === 1) { + } else if (tokens.length > 1) { msg = `You own ${tokens.length} tokens` } else { msg = `No tokens found` -- cgit v1.2.3 From ddd559718f5395190ad3903cdb9c42e2e6e50443 Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Fri, 1 Sep 2017 11:01:53 -0700 Subject: Update support link --- ui/app/info.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ui/app') diff --git a/ui/app/info.js b/ui/app/info.js index 899841c83..c69d83715 100644 --- a/ui/app/info.js +++ b/ui/app/info.js @@ -103,7 +103,7 @@ InfoScreen.prototype.render = function () { [ h('div.fa.fa-support', [ h('a.info', { - href: 'http://metamask.consensyssupport.happyfox.com', + href: 'https://support.metamask.com', target: '_blank', }, 'Visit our Support Center'), ]), -- cgit v1.2.3