From f2ef7b0f07e842db87b7dfc1b45b5e103e8aace2 Mon Sep 17 00:00:00 2001 From: Boubaker Khanfir Date: Fri, 21 Jul 2023 15:33:49 +0100 Subject: [PATCH] fix: Fix Wallet Main Currency Name - MEED-2307 - Meeds-io/meeds#1010 (#392) Prior to this change, the display of Matic amounts was made in ehter instead of Matic. This change will fix it by introducing two labels, one for name and another for symbol. --- .../src/main/resources/locale/addon/Wallet_en.properties | 3 +++ .../components/admin/wallets/WalletAdminWalletsTab.vue | 8 ++++---- .../admin/wallets/modals/WalletAdminSendEtherModal.vue | 4 ++-- .../wallet-common/components/TransactionsList.vue | 9 ++++----- 4 files changed, 13 insertions(+), 11 deletions(-) diff --git a/wallet-services/src/main/resources/locale/addon/Wallet_en.properties b/wallet-services/src/main/resources/locale/addon/Wallet_en.properties index a62d45fc2..fbe58a463 100644 --- a/wallet-services/src/main/resources/locale/addon/Wallet_en.properties +++ b/wallet-services/src/main/resources/locale/addon/Wallet_en.properties @@ -474,3 +474,6 @@ exoplatform.wallet.label.metamask.buttonTitle=Connect with metamask Wallet exoplatform.wallet.metamask.error.transactionFailed=Transaction failed exoplatform.wallet.metamask.message.transactionSent=Transaction sent exoplatform.wallet.message.followTransaction={0} link to follow your transaction + +wallet.mainCurrency=Matic +wallet.mainCurrencySymbol=Matic diff --git a/wallet-webapps/src/main/webapp/vue-app/wallet-admin/components/admin/wallets/WalletAdminWalletsTab.vue b/wallet-webapps/src/main/webapp/vue-app/wallet-admin/components/admin/wallets/WalletAdminWalletsTab.vue index 85d201922..3ca142f52 100644 --- a/wallet-webapps/src/main/webapp/vue-app/wallet-admin/components/admin/wallets/WalletAdminWalletsTab.vue +++ b/wallet-webapps/src/main/webapp/vue-app/wallet-admin/components/admin/wallets/WalletAdminWalletsTab.vue @@ -377,9 +377,9 @@ export default { }, etherAccountDetails() { return { - title: 'ether', + title: this.$t('wallet.mainCurrency'), icon: 'ether', - symbol: 'ether', + symbol: this.$t('wallet.mainCurrencySymbol'), isContract: false, balance: 10, // Fake balance to not display unsufficient funds address: this.walletAddress, @@ -532,9 +532,9 @@ export default { this.selectedWalletAddress = wallet.address; this.selectedWallet = wallet; this.selectedWalletDetails = { - title: 'ether', + title: this.$t('wallet.mainCurrency'), icon: 'fab fa-ethereum', - symbol: 'ether', + symbol: this.$t('wallet.mainCurrencySymbol'), address: this.selectedWalletAddress, balance: wallet.etherBalance, balanceFiat: wallet.fiatBalance, diff --git a/wallet-webapps/src/main/webapp/vue-app/wallet-admin/components/admin/wallets/modals/WalletAdminSendEtherModal.vue b/wallet-webapps/src/main/webapp/vue-app/wallet-admin/components/admin/wallets/modals/WalletAdminSendEtherModal.vue index 7cd579e84..c71fbf7b7 100644 --- a/wallet-webapps/src/main/webapp/vue-app/wallet-admin/components/admin/wallets/modals/WalletAdminSendEtherModal.vue +++ b/wallet-webapps/src/main/webapp/vue-app/wallet-admin/components/admin/wallets/modals/WalletAdminSendEtherModal.vue @@ -130,7 +130,7 @@ export default { } this.wallet = wallet; this.etherAmount = etherAmount; - this.transactionLabel = `Send ether for wallet of ${this.wallet.type} ${this.wallet.name}`; + this.transactionLabel = `Send ${this.$t('wallet.mainCurrency')} for wallet of ${this.wallet.type} ${this.wallet.name}`; this.transactionMessage = initialFundsMessage; this.error = null; @@ -156,7 +156,7 @@ export default { if (resp && resp.ok) { return resp.text(); } else { - throw new Error(`Error sending ether to wallet ${this.wallet.address}`); + throw new Error(`Error sending ${this.$t('wallet.mainCurrency')} to wallet ${this.wallet.address}`); } }).then((hash) => { this.$emit('sent', hash); diff --git a/wallet-webapps/src/main/webapp/vue-app/wallet-common/components/TransactionsList.vue b/wallet-webapps/src/main/webapp/vue-app/wallet-common/components/TransactionsList.vue index 21f859572..9d64f9b25 100644 --- a/wallet-webapps/src/main/webapp/vue-app/wallet-common/components/TransactionsList.vue +++ b/wallet-webapps/src/main/webapp/vue-app/wallet-common/components/TransactionsList.vue @@ -247,7 +247,7 @@ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - {{ toFixed(item.value) }} ether + {{ toFixed(item.value) }} {{ $t('wallet.mainCurrency') }} @@ -269,7 +269,7 @@ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. v-else-if="item.value && Number(item.value)" :class="(item.pending || item.succeeded) ? 'primary--text' : 'red--text'"> - {{ toFixed(item.value) }} ether + {{ toFixed(item.value) }} {{ $t('wallet.mainCurrency') }}
- {{ toFixed(item.value) }} ether + {{ toFixed(item.value) }} {{ $t('wallet.mainCurrency') }}
@@ -469,8 +469,7 @@ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. {{ toFixed(item.feeFiat) }} {{ fiatSymbol }} + color="orange"> warning