diff options
author | Alexander Tseung <alextsg@gmail.com> | 2018-08-07 13:39:54 +0800 |
---|---|---|
committer | Alexander Tseung <alextsg@gmail.com> | 2018-08-24 07:45:27 +0800 |
commit | 9adf0c4b60c863a820af7b20ff66a8b29f7bdbe7 (patch) | |
tree | 37166e258a95f82f8ff592c30cd9cc07ca5b44a7 /ui | |
parent | c9ec5ed38d0e2475778ca6eb18d29b3389f67190 (diff) | |
download | tangerine-wallet-browser-9adf0c4b60c863a820af7b20ff66a8b29f7bdbe7.tar tangerine-wallet-browser-9adf0c4b60c863a820af7b20ff66a8b29f7bdbe7.tar.gz tangerine-wallet-browser-9adf0c4b60c863a820af7b20ff66a8b29f7bdbe7.tar.bz2 tangerine-wallet-browser-9adf0c4b60c863a820af7b20ff66a8b29f7bdbe7.tar.lz tangerine-wallet-browser-9adf0c4b60c863a820af7b20ff66a8b29f7bdbe7.tar.xz tangerine-wallet-browser-9adf0c4b60c863a820af7b20ff66a8b29f7bdbe7.tar.zst tangerine-wallet-browser-9adf0c4b60c863a820af7b20ff66a8b29f7bdbe7.zip |
Fix integration tests
Diffstat (limited to 'ui')
-rw-r--r-- | ui/app/components/shift-list-item.js | 3 | ||||
-rw-r--r-- | ui/app/components/transaction-list-item/transaction-list-item.component.js | 5 | ||||
-rw-r--r-- | ui/app/components/transaction-list/transaction-list.container.js | 4 | ||||
-rw-r--r-- | ui/app/components/transaction-status/index.scss | 2 | ||||
-rw-r--r-- | ui/app/constants/transactions.js | 1 | ||||
-rw-r--r-- | ui/app/helpers/transactions.util.js | 7 | ||||
-rw-r--r-- | ui/app/selectors/transactions.js | 7 |
7 files changed, 24 insertions, 5 deletions
diff --git a/ui/app/components/shift-list-item.js b/ui/app/components/shift-list-item.js index 4334aacba..b87bf959e 100644 --- a/ui/app/components/shift-list-item.js +++ b/ui/app/components/shift-list-item.js @@ -35,12 +35,13 @@ function ShiftListItem () { } ShiftListItem.prototype.render = function () { - return h('div.tx-list-item.tx-list-clickable', { + return h('div.transaction-list-item.tx-list-clickable', { style: { paddingTop: '20px', paddingBottom: '20px', justifyContent: 'space-around', alignItems: 'center', + flexDirection: 'row', }, }, [ h('div', { diff --git a/ui/app/components/transaction-list-item/transaction-list-item.component.js b/ui/app/components/transaction-list-item/transaction-list-item.component.js index d4b1bec94..6e1abd0e4 100644 --- a/ui/app/components/transaction-list-item/transaction-list-item.component.js +++ b/ui/app/components/transaction-list-item/transaction-list-item.component.js @@ -67,7 +67,10 @@ export default class TransactionListItem extends PureComponent { const { txParams = {} } = transaction const nonce = hexToDecimal(txParams.nonce) - const nonceAndDateText = `#${nonce} - ${formatDate(transaction.time)}` + const nonceAndDateText = nonce + ? `#${nonce} - ${formatDate(transaction.time)}` + : formatDate(transaction.time) + const fiatDisplayText = `-${fiatDisplayValue}` const ethDisplayText = ethTransactionAmount && `-${ethTransactionAmount} ETH` diff --git a/ui/app/components/transaction-list/transaction-list.container.js b/ui/app/components/transaction-list/transaction-list.container.js index 5a63d916d..e1d19e787 100644 --- a/ui/app/components/transaction-list/transaction-list.container.js +++ b/ui/app/components/transaction-list/transaction-list.container.js @@ -4,6 +4,7 @@ import { compose } from 'recompose' import TransactionList from './transaction-list.component' import { pendingTransactionsSelector, + submittedPendingTransactionsSelector, completedTransactionsSelector, } from '../../selectors/transactions' import { selectedTokenSelector } from '../../selectors/tokens' @@ -11,11 +12,12 @@ import { getLatestSubmittedTxWithEarliestNonce } from '../../helpers/transaction const mapStateToProps = state => { const pendingTransactions = pendingTransactionsSelector(state) + const submittedPendingTransactions = submittedPendingTransactionsSelector(state) return { completedTransactions: completedTransactionsSelector(state), pendingTransactions, - transactionToRetry: getLatestSubmittedTxWithEarliestNonce(pendingTransactions), + transactionToRetry: getLatestSubmittedTxWithEarliestNonce(submittedPendingTransactions), selectedToken: selectedTokenSelector(state), } } diff --git a/ui/app/components/transaction-status/index.scss b/ui/app/components/transaction-status/index.scss index 95d29f6d3..35be550f7 100644 --- a/ui/app/components/transaction-status/index.scss +++ b/ui/app/components/transaction-status/index.scss @@ -21,7 +21,7 @@ color: #609a1c; } - &--approved { + &--approved, &--submitted { background-color: #FFF2DB; color: #CA810A; } diff --git a/ui/app/constants/transactions.js b/ui/app/constants/transactions.js index 5f8935a64..1dc8944d3 100644 --- a/ui/app/constants/transactions.js +++ b/ui/app/constants/transactions.js @@ -16,5 +16,6 @@ export const DEPLOY_CONTRACT_ACTION_KEY = 'contractDeployment' export const APPROVE_ACTION_KEY = 'approve' export const SEND_TOKEN_ACTION_KEY = 'outgoing' export const TRANSFER_FROM_ACTION_KEY = 'transferFrom' +export const SIGNATURE_REQUEST_KEY = 'signatureRequest' export const TRANSACTION_TYPE_SHAPESHIFT = 'shapeshift' diff --git a/ui/app/helpers/transactions.util.js b/ui/app/helpers/transactions.util.js index 89d2649c9..8ded31bca 100644 --- a/ui/app/helpers/transactions.util.js +++ b/ui/app/helpers/transactions.util.js @@ -13,6 +13,7 @@ import { APPROVE_ACTION_KEY, SEND_TOKEN_ACTION_KEY, TRANSFER_FROM_ACTION_KEY, + SIGNATURE_REQUEST_KEY, } from '../constants/transactions' abiDecoder.addABI(abi) @@ -41,7 +42,11 @@ export function isConfirmDeployContract (txData = {}) { } export function getTransactionActionKey (transaction, methodData) { - const { txParams: { data } = {} } = transaction + const { txParams: { data } = {}, msgParams } = transaction + + if (msgParams) { + return SIGNATURE_REQUEST_KEY + } if (isConfirmDeployContract(transaction)) { return DEPLOY_CONTRACT_ACTION_KEY diff --git a/ui/app/selectors/transactions.js b/ui/app/selectors/transactions.js index 6fedf36be..3e9843722 100644 --- a/ui/app/selectors/transactions.js +++ b/ui/app/selectors/transactions.js @@ -43,6 +43,13 @@ export const pendingTransactionsSelector = createSelector( ) ) +export const submittedPendingTransactionsSelector = createSelector( + transactionsSelector, + (transactions = []) => ( + transactions.filter(transaction => transaction.status === SUBMITTED_STATUS) + ) +) + export const completedTransactionsSelector = createSelector( transactionsSelector, (transactions = []) => ( |