1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

do not show amounts for approvals (#9032)

This commit is contained in:
Brad Decker 2020-07-21 10:45:14 -05:00 committed by GitHub
parent 2389777244
commit e463a47588
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 19 additions and 17 deletions

View File

@ -187,11 +187,11 @@
"alertsSettingsDescription": {
"message": "Enable or disable each alert"
},
"alertSettingsUnconnectedAccount": {
"message": "Browsing a website with an unconnected account selected"
},
"alertSettingsUnconnectedAccountDescription": {
"message": "This alert is shown in the popup when you are browsing a connected Web3 site, but the currently selected account is not connected."
"alertSettingsUnconnectedAccount": {
"message": "Browsing a website with an unconnected account selected"
},
"alertSettingsUnconnectedAccountDescription": {
"message": "This alert is shown in the popup when you are browsing a connected Web3 site, but the currently selected account is not connected."
},
"allowOriginSpendToken": {
"message": "Allow $1 to spend your $2?",
@ -224,6 +224,10 @@
"approve": {
"message": "Approve spend limit"
},
"approveSpendLimit": {
"message": "Approve $1 spend limit",
"description": "The token symbol that is being approved"
},
"approved": {
"message": "Approved"
},

View File

@ -1018,8 +1018,8 @@ describe('MetaMask', function () {
return pendingTxes.length === 1
}, 10000)
const [txListValue] = await driver.findElements(By.css('.transaction-list-item__primary-currency'))
await driver.wait(until.elementTextMatches(txListValue, /-7\s*TST/))
const [txtListHeading] = await driver.findElements(By.css('.transaction-list-item .list-item__heading'))
await driver.wait(until.elementTextMatches(txtListHeading, /Approve TST spend limit/))
await driver.clickElement(By.css('.transaction-list-item'))
await driver.delay(regularDelayMs)
})
@ -1104,10 +1104,8 @@ describe('MetaMask', function () {
return confirmedTxes.length === 3
}, 10000)
const txValues = await driver.findElements(By.css('.transaction-list-item__primary-currency'))
await driver.wait(until.elementTextMatches(txValues[0], /-5\s*TST/))
const txStatuses = await driver.findElements(By.css('.list-item__heading'))
await driver.wait(until.elementTextMatches(txStatuses[0], /Approve/))
await driver.wait(until.elementTextMatches(txStatuses[0], /Approve TST spend limit/))
})
})
@ -1177,8 +1175,8 @@ describe('MetaMask', function () {
return pendingTxes.length === 1
}, 10000)
const [txListValue] = await driver.findElements(By.css('.transaction-list-item__primary-currency'))
await driver.wait(until.elementTextMatches(txListValue, /-7\s*TST/))
const [txtListHeading] = await driver.findElements(By.css('.transaction-list-item .list-item__heading'))
await driver.wait(until.elementTextMatches(txtListHeading, /Approve TST spend limit/))
await driver.clickElement(By.css('.transaction-list-item'))
await driver.delay(regularDelayMs)
})
@ -1204,10 +1202,8 @@ describe('MetaMask', function () {
return confirmedTxes.length === 5
}, 10000)
const txValues = await driver.findElements(By.css('.transaction-list-item__primary-currency'))
await driver.wait(until.elementTextMatches(txValues[0], /-7\s*TST/))
const txStatuses = await driver.findElements(By.css('.list-item__heading'))
await driver.wait(until.elementTextMatches(txStatuses[0], /Approve/))
await driver.wait(until.elementTextMatches(txStatuses[0], /Approve TST spend limit/))
})
})

View File

@ -15,6 +15,7 @@ import { CONFIRM_TRANSACTION_ROUTE } from '../../../helpers/constants/routes'
import {
TRANSACTION_CATEGORY_SIGNATURE_REQUEST,
UNAPPROVED_STATUS,
TRANSACTION_CATEGORY_APPROVAL,
FAILED_STATUS,
DROPPED_STATUS,
REJECTED_STATUS,
@ -55,6 +56,7 @@ export default function TransactionListItem ({ transactionGroup, isEarliestNonce
const isSignatureReq = category === TRANSACTION_CATEGORY_SIGNATURE_REQUEST
const isApproval = category === TRANSACTION_CATEGORY_APPROVAL
const isUnapproved = status === UNAPPROVED_STATUS
const className = classnames('transaction-list-item', {
@ -137,7 +139,7 @@ export default function TransactionListItem ({ transactionGroup, isEarliestNonce
</span>
</h3>
)}
rightContent={!isSignatureReq && (
rightContent={!isSignatureReq && !isApproval && (
<>
<h2 className="transaction-list-item__primary-currency">{primaryCurrency}</h2>
<h3 className="transaction-list-item__secondary-currency">{secondaryCurrency}</h3>

View File

@ -106,7 +106,7 @@ export function useTransactionDisplayData (transactionGroup) {
subtitleContainsOrigin = true
} else if (transactionCategory === TOKEN_METHOD_APPROVE) {
category = TRANSACTION_CATEGORY_APPROVAL
title = t('approve')
title = t('approveSpendLimit', [token?.symbol || t('token')])
subtitle = origin
subtitleContainsOrigin = true
} else if (transactionCategory === DEPLOY_CONTRACT_ACTION_KEY || transactionCategory === CONTRACT_INTERACTION_KEY) {