diff --git a/app/_locales/de/messages.json b/app/_locales/de/messages.json index f5e257ef6..3923e2b5e 100644 --- a/app/_locales/de/messages.json +++ b/app/_locales/de/messages.json @@ -2191,9 +2191,6 @@ "message": "Nonce ist höher als vorgeschlagen nonce von $1", "description": "The next nonce according to MetaMask's internal logic" }, - "nft": { - "message": "NFT" - }, "nftAddFailedMessage": { "message": "NFT kann nicht hinzugefügt werden, da die Eigentumsangaben nicht übereinstimmen. Stellen Sie sicher, dass Sie die richtigen Informationen eingegeben haben." }, diff --git a/app/_locales/el/messages.json b/app/_locales/el/messages.json index f2ab8a5e0..19f736c5f 100644 --- a/app/_locales/el/messages.json +++ b/app/_locales/el/messages.json @@ -2191,9 +2191,6 @@ "message": "Το Nonce είναι υψηλότερο από το προτεινόμενο nonce του $1", "description": "The next nonce according to MetaMask's internal logic" }, - "nft": { - "message": "NFT" - }, "nftAddFailedMessage": { "message": "Τα NFT δεν μπορούν να προστεθούν, διότι τα στοιχεία της κυριότητας δεν ταυτίζονται. Σιγουρευτείτε ότι έχετε εισαγάγει τα σωστά στοιχεία." }, diff --git a/app/_locales/en/messages.json b/app/_locales/en/messages.json index eefe50cb5..7b45679ff 100644 --- a/app/_locales/en/messages.json +++ b/app/_locales/en/messages.json @@ -321,6 +321,10 @@ "message": "All of your $1", "description": "$1 is the symbol or name of the token that the user is approving spending" }, + "allYourNFTsOf": { + "message": "All of your NFTs from $1", + "description": "$1 is a link to contract on the block explorer when we're not able to retrieve a erc721 or erc1155 name" + }, "allowExternalExtensionTo": { "message": "Allow this external extension to:" }, @@ -368,6 +372,10 @@ "message": "Allow access to and transfer of all your $1?", "description": "$1 is the symbol of the token for which the user is granting approval" }, + "approveAllTokensTitleWithoutSymbol": { + "message": "Allow access to and transfer all of your NFTs from $1?", + "description": "$1 a link to contract on the block explorer when we're not able to retrieve a erc721 or erc1155 name" + }, "approveAndInstall": { "message": "Approve & install" }, @@ -384,6 +392,10 @@ "approveTokenDescription": { "message": "This allows a third party to access and transfer the following NFTs without further notice until you revoke its access." }, + "approveTokenDescriptionWithoutSymbol": { + "message": "This allows a third party to access and transfer all of your NFTs from $1 without further notice until you revoke its access.", + "description": "$1 is a link to contract on the block explorer when we're not able to retrieve a erc721 or erc1155 name" + }, "approveTokenTitle": { "message": "Allow access to and transfer of your $1?", "description": "$1 is the symbol of the token for which the user is granting approval" @@ -2224,9 +2236,6 @@ "message": "Nonce is higher than suggested nonce of $1", "description": "The next nonce according to MetaMask's internal logic" }, - "nft": { - "message": "NFT" - }, "nftAddFailedMessage": { "message": "NFT can’t be added as the ownership details do not match. Make sure you have entered correct information." }, @@ -3212,10 +3221,18 @@ "message": "Revoke permission to access and transfer all of your $1?", "description": "$1 is the symbol of the token for which the user is revoking approval" }, + "revokeAllTokensTitleWithoutSymbol": { + "message": "Revoke permission to access and transfer all of your NFTs from $1?", + "description": "$1 is a link to contract on the block explorer when we're not able to retrieve a erc721 or erc1155 name" + }, "revokeApproveForAllDescription": { "message": "This revokes the permission for a third party to access and transfer all of your $1 without further notice.", "description": "$1 is either a string or link of a given token symbol or name" }, + "revokeApproveForAllDescriptionWithoutSymbol": { + "message": "This revokes the permission for a third party to access and transfer all of your NFTs from $1 without further notice.", + "description": "$1 is a link to contract on the block explorer when we're not able to retrieve a erc721 or erc1155 name" + }, "revokeSpendingCap": { "message": "Revoke spending cap for your $1", "description": "$1 is a token symbol" @@ -4196,6 +4213,9 @@ "thingsToKeep": { "message": "Things to keep in mind:" }, + "thisCollection": { + "message": "this collection" + }, "thisIsBasedOn": { "message": "This is based on information from " }, diff --git a/app/_locales/es/messages.json b/app/_locales/es/messages.json index ad1319017..94b2d78da 100644 --- a/app/_locales/es/messages.json +++ b/app/_locales/es/messages.json @@ -2191,9 +2191,6 @@ "message": "El nonce es superior al nonce sugerido de $1", "description": "The next nonce according to MetaMask's internal logic" }, - "nft": { - "message": "NFT" - }, "nftAddFailedMessage": { "message": "No se puede agregar el NFT porque los detalles de propiedad no coinciden. Asegúrese de haber ingresado la información correcta." }, diff --git a/app/_locales/fr/messages.json b/app/_locales/fr/messages.json index 78408e2db..34849859e 100644 --- a/app/_locales/fr/messages.json +++ b/app/_locales/fr/messages.json @@ -2191,9 +2191,6 @@ "message": "Le nonce est supérieur au nonce suggéré de $1", "description": "The next nonce according to MetaMask's internal logic" }, - "nft": { - "message": "NFT" - }, "nftAddFailedMessage": { "message": "Ce NFT ne peut pas être ajouté, car les informations de propriété ne correspondent pas. Vérifiez que votre saisie est correcte." }, diff --git a/app/_locales/hi/messages.json b/app/_locales/hi/messages.json index 61eafe59d..b57d88ae8 100644 --- a/app/_locales/hi/messages.json +++ b/app/_locales/hi/messages.json @@ -2191,9 +2191,6 @@ "message": "नॉन्स $1 के सुझाए गए नॉन्स से अधिक है", "description": "The next nonce according to MetaMask's internal logic" }, - "nft": { - "message": "एनएफटी" - }, "nftAddFailedMessage": { "message": "एनएफटी जोड़ा नहीं जा सकता क्योंकि स्वामित्व विवरण मेल नहीं खा रहे हैं। सुनिश्चित करें कि आपने सही जानकारी दर्ज की है।" }, diff --git a/app/_locales/id/messages.json b/app/_locales/id/messages.json index 76dd89d9b..a5c4bd5e2 100644 --- a/app/_locales/id/messages.json +++ b/app/_locales/id/messages.json @@ -2191,9 +2191,6 @@ "message": "Nonce lebih tinggi dari nonce $1 yang disarankan", "description": "The next nonce according to MetaMask's internal logic" }, - "nft": { - "message": "NFT" - }, "nftAddFailedMessage": { "message": "NFT tidak dapat ditambahkan karena detail kepemilikan tidak cocok. Pastikan Anda telah memasukkan informasi yang benar." }, diff --git a/app/_locales/ja/messages.json b/app/_locales/ja/messages.json index eb13dbc01..04461f0f6 100644 --- a/app/_locales/ja/messages.json +++ b/app/_locales/ja/messages.json @@ -2191,9 +2191,6 @@ "message": "ナンスが提案され$1よりも大きいです", "description": "The next nonce according to MetaMask's internal logic" }, - "nft": { - "message": "NFT" - }, "nftAddFailedMessage": { "message": "所有者情報が一致していないため、NFT を追加できません。入力された情報が正しいことを確認してください。" }, diff --git a/app/_locales/ko/messages.json b/app/_locales/ko/messages.json index 7b24d0458..b321862ab 100644 --- a/app/_locales/ko/messages.json +++ b/app/_locales/ko/messages.json @@ -2191,9 +2191,6 @@ "message": "임시값이 권장 임시값인 $1보다 큽니다.", "description": "The next nonce according to MetaMask's internal logic" }, - "nft": { - "message": "NFT\n" - }, "nftAddFailedMessage": { "message": "소유권 정보가 일치하지 않아 NFT를 추가할 수 없습니다. 올바른 정보를 입력했는지 확인하세요." }, diff --git a/app/_locales/pt/messages.json b/app/_locales/pt/messages.json index ae39ab7d9..86f69b1c0 100644 --- a/app/_locales/pt/messages.json +++ b/app/_locales/pt/messages.json @@ -2191,9 +2191,6 @@ "message": "Nonce é maior que o nonce sugerido de $1", "description": "The next nonce according to MetaMask's internal logic" }, - "nft": { - "message": "NFT" - }, "nftAddFailedMessage": { "message": "O NFT não pôde ser adicionado, pois os dados de propriedade não coincidem. Certifique-se de ter inserido as informações corretas." }, diff --git a/app/_locales/ru/messages.json b/app/_locales/ru/messages.json index f4edcbfc1..dd8db16a5 100644 --- a/app/_locales/ru/messages.json +++ b/app/_locales/ru/messages.json @@ -2191,9 +2191,6 @@ "message": "Одноразовый номер больше, чем предложенный одноразовый номер $1", "description": "The next nonce according to MetaMask's internal logic" }, - "nft": { - "message": "NFT" - }, "nftAddFailedMessage": { "message": "Невозможно добавить NFT, так как сведения о владельце не совпадают. Убедитесь, что вы ввели правильную информацию." }, diff --git a/app/_locales/tl/messages.json b/app/_locales/tl/messages.json index 461e9f291..d7e0c937d 100644 --- a/app/_locales/tl/messages.json +++ b/app/_locales/tl/messages.json @@ -2191,9 +2191,6 @@ "message": "Mas mataas ang noncesa iminumungkahing nonce na $1", "description": "The next nonce according to MetaMask's internal logic" }, - "nft": { - "message": "NFT" - }, "nftAddFailedMessage": { "message": "Hindi maidaragdag ang NFT dahil hindi tumutugma ang mga detalye ng pagmamay-ari. Siguraduhing tamang impormasyon ang iyong nailagay." }, diff --git a/app/_locales/tr/messages.json b/app/_locales/tr/messages.json index 8472fce54..5887a63d5 100644 --- a/app/_locales/tr/messages.json +++ b/app/_locales/tr/messages.json @@ -2191,9 +2191,6 @@ "message": "Geçici anahtar, önerilen $1 geçici anahtarından daha büyük", "description": "The next nonce according to MetaMask's internal logic" }, - "nft": { - "message": "NFT" - }, "nftAddFailedMessage": { "message": "Sahiplik bilgileri eşleşmediği için NFT eklenemiyor. Doğru bilgileri girdiğinizden emin olun." }, diff --git a/app/_locales/vi/messages.json b/app/_locales/vi/messages.json index 892ad6942..9a19d71b3 100644 --- a/app/_locales/vi/messages.json +++ b/app/_locales/vi/messages.json @@ -2191,9 +2191,6 @@ "message": "Số chỉ dùng một lần lớn hơn số chỉ dùng một lần gợi ý là $1", "description": "The next nonce according to MetaMask's internal logic" }, - "nft": { - "message": "NFT" - }, "nftAddFailedMessage": { "message": "Không thể thêm NFT vì thông tin quyền sở hữu không trùng khớp. Đảm bảo bạn đã nhập đúng thông tin." }, diff --git a/app/_locales/zh_CN/messages.json b/app/_locales/zh_CN/messages.json index 9fec36276..49b04ecd2 100644 --- a/app/_locales/zh_CN/messages.json +++ b/app/_locales/zh_CN/messages.json @@ -2191,9 +2191,6 @@ "message": "Nonce 高于建议的 nouce 值 $1", "description": "The next nonce according to MetaMask's internal logic" }, - "nft": { - "message": "非同质化代币(NFT)" - }, "nftAddFailedMessage": { "message": "由于所有权信息不匹配,无法添加NFT。请确保所输入的信息正确无误。" }, diff --git a/test/e2e/nft/erc1155-interaction.spec.js b/test/e2e/nft/erc1155-interaction.spec.js index 5dcc75203..7a5b95961 100644 --- a/test/e2e/nft/erc1155-interaction.spec.js +++ b/test/e2e/nft/erc1155-interaction.spec.js @@ -129,9 +129,9 @@ describe('ERC1155 NFTs testdapp interaction', function () { it('should enable approval for a third party address to manage all ERC1155 token', async function () { const expectedMessageTitle = - 'Allow access to and transfer of all your NFT?'; + 'Allow access to and transfer all of your NFTs from this collection?'; const expectedDescription = - 'This allows a third party to access and transfer the following NFTs without further notice until you revoke its access.'; + 'This allows a third party to access and transfer all of your NFTs from this collection without further notice until you revoke its access.'; const expectedWarningMessage = 'Your NFT may be at risk'; await withFixtures( { @@ -219,9 +219,9 @@ describe('ERC1155 NFTs testdapp interaction', function () { it('should revoke approval for a third party address to manage all ERC1155 token', async function () { const expectedMessageTitle = - 'Revoke permission to access and transfer all of your NFT?'; + 'Revoke permission to access and transfer all of your NFTs from this collection?'; const expectedDescription = - 'This revokes the permission for a third party to access and transfer all of your NFT without further notice.'; + 'This revokes the permission for a third party to access and transfer all of your NFTs from this collection without further notice.'; await withFixtures( { dapp: true, diff --git a/ui/pages/confirm-approve/confirm-approve-content/__snapshots__/confirm-approve-content.component.test.js.snap b/ui/pages/confirm-approve/confirm-approve-content/__snapshots__/confirm-approve-content.component.test.js.snap new file mode 100644 index 000000000..a2c7be080 --- /dev/null +++ b/ui/pages/confirm-approve/confirm-approve-content/__snapshots__/confirm-approve-content.component.test.js.snap @@ -0,0 +1,738 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`ConfirmApproveContent Component should render Confirm approve page correctly and display fallback copy for when we are able to retrieve a erc721 or erc1155 name in the setApprovalForAll screen and when giving a setApprovalForAll allowance 1`] = ` +
+
+
+
+
+ https://metamask.github.io/test-dapp/ +
+
+ https://metamask.github.io/test-dapp/ +
+
+
+
+ + + Allow access to and transfer of all your + + ZenAcademy + + + ? + + +
+
+ This allows a third party to access and transfer the following NFTs without further notice until you revoke its access. +
+ +
+
+
+
+ +
+
+ Transaction fee +
+ +
+
+
+
+ A fee is associated with this request. +
+
+
+ $10.00 +
+
+ 20 ETH +
+
+
+
+
+
+
+
+
+
+ Nonce +
+ + Edit + +
+
+ 2 +
+
+
+
+
+
+ View full transaction details +
+ +
+
+
+
+
+
+`; + +exports[`ConfirmApproveContent Component should render Confirm approve page correctly and display fallback copy for when we are able to retrieve a erc721 or erc1155 name in the setApprovalForAll screen and when revoking a setApprovalForAll allowance 1`] = ` +
+
+
+
+
+ https://metamask.github.io/test-dapp/ +
+
+ https://metamask.github.io/test-dapp/ +
+
+
+
+ + + Revoke permission to access and transfer all of your + + ZenAcademy + + + ? + + +
+
+ + + This revokes the permission for a third party to access and transfer all of your + + ZenAcademy + + + without further notice. + + +
+ +
+
+
+
+ +
+
+ Transaction fee +
+ +
+
+
+
+ A fee is associated with this request. +
+
+
+ $10.00 +
+
+ 20 ETH +
+
+
+
+
+
+
+
+
+
+ Nonce +
+ + Edit + +
+
+ 2 +
+
+
+
+
+
+ View full transaction details +
+ +
+
+
+
+
+
+`; + +exports[`ConfirmApproveContent Component should render Confirm approve page correctly and display fallback copy for when we are not able to retrieve a erc721 or erc1155 name in the setApprovalForAll screen and when giving a setApprovalForAll allowance 1`] = ` +
+
+
+
+
+ https://metamask.github.io/test-dapp/ +
+
+ https://metamask.github.io/test-dapp/ +
+
+
+
+ + + Allow access to and transfer all of your NFTs from + + this collection + + + ? + + +
+
+ + + This allows a third party to access and transfer all of your NFTs from + + this collection + + + without further notice until you revoke its access. + + +
+ +
+
+
+
+ +
+
+ Transaction fee +
+ +
+
+
+
+ A fee is associated with this request. +
+
+
+ $10.00 +
+
+ 20 ETH +
+
+
+
+
+
+
+
+
+
+ Nonce +
+ + Edit + +
+
+ 2 +
+
+
+
+
+
+ View full transaction details +
+ +
+
+
+
+
+
+`; + +exports[`ConfirmApproveContent Component should render Confirm approve page correctly and display fallback copy for when we are not able to retrieve a erc721 or erc1155 name in the setApprovalForAll screen and when revoking a setApprovalForAll allowance 1`] = ` +
+
+
+
+
+ https://metamask.github.io/test-dapp/ +
+
+ https://metamask.github.io/test-dapp/ +
+
+
+
+ + + Revoke permission to access and transfer all of your NFTs from + + this collection + + + ? + + +
+
+ + + This revokes the permission for a third party to access and transfer all of your NFTs from + + this collection + + + without further notice. + + +
+ +
+
+
+
+ +
+
+ Transaction fee +
+ +
+
+
+
+ A fee is associated with this request. +
+
+
+ $10.00 +
+
+ 20 ETH +
+
+
+
+
+
+
+
+
+
+ Nonce +
+ + Edit + +
+
+ 2 +
+
+
+
+
+
+ View full transaction details +
+ +
+
+
+
+
+
+`; diff --git a/ui/pages/confirm-approve/confirm-approve-content/confirm-approve-content.component.js b/ui/pages/confirm-approve/confirm-approve-content/confirm-approve-content.component.js index c6cd73087..3ec03a1c9 100644 --- a/ui/pages/confirm-approve/confirm-approve-content/confirm-approve-content.component.js +++ b/ui/pages/confirm-approve/confirm-approve-content/confirm-approve-content.component.js @@ -210,9 +210,13 @@ export default class ConfirmApproveContent extends Component { renderERC721OrERC1155PermissionContent() { const { t } = this.context; - const { origin, toAddress, isContract, isSetApproveForAll } = this.props; + const { origin, toAddress, isContract, isSetApproveForAll, tokenSymbol } = + this.props; const titleTokenDescription = this.getTitleTokenDescription(); + const approvedAssetText = tokenSymbol + ? t('allOfYour', [titleTokenDescription]) + : t('allYourNFTsOf', [titleTokenDescription]); const displayedAddress = isContract ? `${t('contract')} (${addressSummary(toAddress)})` @@ -227,9 +231,7 @@ export default class ConfirmApproveContent extends Component { {t('approvedAsset')}:
- {isSetApproveForAll - ? t('allOfYour', [titleTokenDescription]) - : titleTokenDescription} + {isSetApproveForAll ? approvedAssetText : titleTokenDescription}
@@ -376,7 +378,7 @@ export default class ConfirmApproveContent extends Component { if (assetName || tokenSymbol) { titleTokenDescription = `${assetName ?? tokenSymbol}`; } else { - titleTokenDescription = t('nft'); + titleTokenDescription = t('thisCollection'); } } @@ -451,9 +453,20 @@ export default class ConfirmApproveContent extends Component { let title; if (isSetApproveForAll) { - title = t('approveAllTokensTitle', [titleTokenDescription]); - if (isApprovalOrRejection === false) { - title = t('revokeAllTokensTitle', [titleTokenDescription]); + if (tokenSymbol) { + title = t('approveAllTokensTitle', [titleTokenDescription]); + if (isApprovalOrRejection === false) { + title = t('revokeAllTokensTitle', [titleTokenDescription]); + } + } else { + title = t('approveAllTokensTitleWithoutSymbol', [ + titleTokenDescription, + ]); + if (isApprovalOrRejection === false) { + title = t('revokeAllTokensTitleWithoutSymbol', [ + titleTokenDescription, + ]); + } } } else if ( assetStandard === TokenStandard.ERC721 || @@ -485,9 +498,15 @@ export default class ConfirmApproveContent extends Component { let description = t('trustSiteApprovePermission', [grantee]); if (isSetApproveForAll && isApprovalOrRejection === false) { - description = t('revokeApproveForAllDescription', [ - this.getTitleTokenDescription(), - ]); + if (tokenSymbol) { + description = t('revokeApproveForAllDescription', [ + this.getTitleTokenDescription(), + ]); + } else { + description = t('revokeApproveForAllDescriptionWithoutSymbol', [ + this.getTitleTokenDescription(), + ]); + } } else if ( isSetApproveForAll || assetStandard === TokenStandard.ERC721 || @@ -496,7 +515,13 @@ export default class ConfirmApproveContent extends Component { (assetName && tokenId) || (tokenSymbol && tokenId) ) { - description = t('approveTokenDescription'); + if (tokenSymbol) { + description = t('approveTokenDescription'); + } else { + description = t('approveTokenDescriptionWithoutSymbol', [ + this.getTitleTokenDescription(), + ]); + } } return description; } diff --git a/ui/pages/confirm-approve/confirm-approve-content/confirm-approve-content.component.test.js b/ui/pages/confirm-approve/confirm-approve-content/confirm-approve-content.component.test.js index 952a38af6..87f3a13f2 100644 --- a/ui/pages/confirm-approve/confirm-approve-content/confirm-approve-content.component.test.js +++ b/ui/pages/confirm-approve/confirm-approve-content/confirm-approve-content.component.test.js @@ -37,6 +37,8 @@ const props = { rpcPrefs: {}, isContract: true, useCurrencyRateCheck: true, + isSetApproveForAll: false, + isApprovalOrRejection: true, }; describe('ConfirmApproveContent Component', () => { @@ -281,4 +283,46 @@ describe('ConfirmApproveContent Component', () => { ), ).toBeInTheDocument(); }); + + it('should render Confirm approve page correctly and display fallback copy for when we are able to retrieve a erc721 or erc1155 name in the setApprovalForAll screen and when giving a setApprovalForAll allowance', () => { + const { container } = renderComponent({ + ...props, + tokenSymbol: 'ZenAcademy', + isSetApproveForAll: true, + }); + + expect(container).toMatchSnapshot(); + }); + + it('should render Confirm approve page correctly and display fallback copy for when we are not able to retrieve a erc721 or erc1155 name in the setApprovalForAll screen and when giving a setApprovalForAll allowance', () => { + const { container } = renderComponent({ + ...props, + tokenSymbol: '', + isSetApproveForAll: true, + }); + + expect(container).toMatchSnapshot(); + }); + + it('should render Confirm approve page correctly and display fallback copy for when we are able to retrieve a erc721 or erc1155 name in the setApprovalForAll screen and when revoking a setApprovalForAll allowance', () => { + const { container } = renderComponent({ + ...props, + tokenSymbol: 'ZenAcademy', + isSetApproveForAll: true, + isApprovalOrRejection: false, + }); + + expect(container).toMatchSnapshot(); + }); + + it('should render Confirm approve page correctly and display fallback copy for when we are not able to retrieve a erc721 or erc1155 name in the setApprovalForAll screen and when revoking a setApprovalForAll allowance', () => { + const { container } = renderComponent({ + ...props, + tokenSymbol: '', + isSetApproveForAll: true, + isApprovalOrRejection: false, + }); + + expect(container).toMatchSnapshot(); + }); });