From dc4db837a785c90be94983d7b66961346fa3ef6d Mon Sep 17 00:00:00 2001 From: Jaco Greeff Date: Mon, 19 Oct 2020 12:02:31 +0200 Subject: [PATCH] Don't display unbonding blocks in Aura (#3896) --- .../apps/public/locales/ar/translation.json | 4 ++-- .../public/locales/en/react-components.json | 4 ++-- .../apps/public/locales/es/translation.json | 4 ++-- .../apps/public/locales/fr/translation.json | 4 ++-- .../apps/public/locales/id/translation.json | 4 ++-- .../apps/public/locales/it/translation.json | 4 ++-- .../apps/public/locales/ko/translation.json | 4 ++-- .../apps/public/locales/pt/translation.json | 4 ++-- .../apps/public/locales/ru/translation.json | 4 ++-- .../apps/public/locales/zh/translation.json | 4 ++-- .../page-accounts/src/Accounts/Account.tsx | 2 +- .../react-components/src/StakingUnbonding.tsx | 22 ++++++++++++------- 12 files changed, 35 insertions(+), 29 deletions(-) diff --git a/packages/apps/public/locales/ar/translation.json b/packages/apps/public/locales/ar/translation.json index fb8835ea08..3070f49983 100644 --- a/packages/apps/public/locales/ar/translation.json +++ b/packages/apps/public/locales/ar/translation.json @@ -763,7 +763,7 @@ "Unbid": "إلغاء العرض", "Unbond": "إلغاء الربط", "Unbond funds": "إلغاء الربط الأموال", - "Unbonding {{value}}, ": "،{{إلغاء الربط {{قيمة", + "Unbonding {{value}}": "،{{إلغاء الربط {{قيمة", "Uncaught error. Something went wrong with the query and rendering of this component. {{message}}": "{{خطأ غير مسلط. حدث خطأ ما في الاستعلام عن هذا المكون وتصويله. {{رسالة", "Undelegate": "إلغاء التفويض", "Unit": "وحدة", @@ -1300,4 +1300,4 @@ "{{threshold}}, not passing": "سقف}}، لا يتم تمريره}}", "{{threshold}}, passing": "سقف}}، يتم تمريره}}", "{{value}}x voting balance, locked for {{lock}}x enactment ({{period}} days)": "({{قفل}} (تاريخ إصدار {{أيام}}x رصيد التصويت، مقفل لـ x {{قيمة }}" -} \ No newline at end of file +} diff --git a/packages/apps/public/locales/en/react-components.json b/packages/apps/public/locales/en/react-components.json index 36c9b34d7d..5bfa810df8 100644 --- a/packages/apps/public/locales/en/react-components.json +++ b/packages/apps/public/locales/en/react-components.json @@ -19,7 +19,7 @@ "This operation does not remove the history of the account from the chain, nor any associated funds from the account. The forget operation only limits your access to the account on this browser.": "This operation does not remove the history of the account from the chain, nor any associated funds from the account. The forget operation only limits your access to the account on this browser.", "This operation does not remove the history of the account from the chain, nor any associated funds from the account. The forget operation only limits your access to the address on this browser.": "This operation does not remove the history of the account from the chain, nor any associated funds from the account. The forget operation only limits your access to the address on this browser.", "This operation does not remove the history of the contract from the chain, nor any associated funds from its account. The forget operation only limits your access to the contract on this browser.": "This operation does not remove the history of the contract from the chain, nor any associated funds from its account. The forget operation only limits your access to the contract on this browser.", - "Unbonding {{value}}, ": "Unbonding {{value}}, ", + "Unbonding {{value}}": "Unbonding {{value}}", "Uncaught error. Something went wrong with the query and rendering of this component. {{message}}": "Uncaught error. Something went wrong with the query and rendering of this component. {{message}}", "View this externally": "View this externally", "Withdraw these unbonded funds": "Withdraw these unbonded funds", @@ -71,4 +71,4 @@ "{{blocks}} blocks": "{{blocks}} blocks", "{{name}} ({{size}} bytes)": "{{name}} ({{size}} bytes)", "{{value}}x voting balance, locked for {{lock}}x enactment ({{period}} days)": "{{value}}x voting balance, locked for {{lock}}x enactment ({{period}} days)" -} \ No newline at end of file +} diff --git a/packages/apps/public/locales/es/translation.json b/packages/apps/public/locales/es/translation.json index 5c6424e635..46dc3cbfa0 100644 --- a/packages/apps/public/locales/es/translation.json +++ b/packages/apps/public/locales/es/translation.json @@ -630,7 +630,7 @@ "Unable to find on-chain WASM code for the supplied codeHash": "No se ha podido encontrar el código WASM de la cadena para el hash del código suministrado.", "Unbond": "Desvincular", "Unbond funds": "Desvincular fondos", - "Unbonding {{value}}, ": "Desvinculando {{value}},", + "Unbonding {{value}}": "Desvinculando {{value}}", "Uncaught error. Something went wrong with the query and rendering of this component. {{message}}": "{{message}} Un error no descubierto. Algo salió mal con la consulta y la representación de este componente.", "Unit": "Unidad", "Unit decides the name of 1 unit token, e.g. \"DOT\" for Polkadot": "La unidad decide el nombre de un token de unidad, por ejemplo \"DOT\" para Polkadot", @@ -1115,4 +1115,4 @@ "{{threshold}}, not passing": "{{threshold}}, no pasará", "{{threshold}}, passing": "{{threshold}}, de aprobación", "{{value}}x voting balance, locked for {{lock}}x enactment ({{period}} days)": "{{value}}x saldo de votos, bloqueado por {{lock}}x sentencia ({{period}} días." -} \ No newline at end of file +} diff --git a/packages/apps/public/locales/fr/translation.json b/packages/apps/public/locales/fr/translation.json index 5edce57baf..a5f801345d 100644 --- a/packages/apps/public/locales/fr/translation.json +++ b/packages/apps/public/locales/fr/translation.json @@ -866,7 +866,7 @@ "Unbid": "Retierer l'enchère", "Unbond": "Délier", "Unbond funds": "Fonds déliés", - "Unbonding {{value}}, ": "Déliaison {{value}},", + "Unbonding {{value}}": "Déliaison {{value}}", "Uncaught error. Something went wrong with the query and rendering of this component. {{message}}": "Une erreur non interceptée. Une erreur s'est produite avec la requête et le rendu de ce composant. {{message}}", "Undelegate": "Supprimer la déléguation", "Understood, close this": "J'ai compris, fermer", @@ -1519,4 +1519,4 @@ "{{threshold}}, not passing": "{{seuil} }, ne dépassant pas", "{{threshold}}, passing": "{{seuil}}, passant", "{{value}}x voting balance, locked for {{lock}}x enactment ({{period}} days)": "{{value}} x solde de vote, verrouillé pendant {{lock}} x décret ({{period}} jours)" -} \ No newline at end of file +} diff --git a/packages/apps/public/locales/id/translation.json b/packages/apps/public/locales/id/translation.json index 61c3cba314..7ecc3a909a 100644 --- a/packages/apps/public/locales/id/translation.json +++ b/packages/apps/public/locales/id/translation.json @@ -849,7 +849,7 @@ "Unbid": "Batalkan penawaran", "Unbond": "Unbond", "Unbond funds": "Unbond dana", - "Unbonding {{value}}, ": "Tidak terikat {{value}},", + "Unbonding {{value}}": "Tidak terikat {{value}}", "Uncaught error. Something went wrong with the query and rendering of this component. {{message}}": "Kesalahan tidak tertangkap. Ada yang tidak beres dengan kueri dan rendering komponen ini. {{message}}", "Undelegate": "Undelegasi", "Unit": "Unit", @@ -1452,4 +1452,4 @@ "{{threshold}}, not passing": "{{threshold}}, tidak melewati", "{{threshold}}, passing": "{{threshold}}, melewati", "{{value}}x voting balance, locked for {{lock}}x enactment ({{period}} days)": "{{value}}x memilih saldo, terkunci untuk {{lock}}x berlaku ({{period}} hari)" -} \ No newline at end of file +} diff --git a/packages/apps/public/locales/it/translation.json b/packages/apps/public/locales/it/translation.json index d2ec8167d6..84b43662bc 100644 --- a/packages/apps/public/locales/it/translation.json +++ b/packages/apps/public/locales/it/translation.json @@ -837,7 +837,7 @@ "Unbid": "Cancella l'offerta", "Unbond": "Svincola", "Unbond funds": "Svincola fondi", - "Unbonding {{value}}, ": "Svincolo {{value}},", + "Unbonding {{value}}": "Svincolo {{value}}", "Uncaught error. Something went wrong with the query and rendering of this component. {{message}}": "Errore inatteso. Qualcosa è andato storto con l'interrogazione o con la lettura di qualche sua componente {{message}}", "Undelegate": "Togli la delega", "Unit": "Unità", @@ -1431,4 +1431,4 @@ "{{threshold}}, not passing": "{{threshold}}, respinta", "{{threshold}}, passing": "{{threshold}}, approvato", "{{value}}x voting balance, locked for {{lock}}x enactment ({{period}} days)": "{{value}} x moltiplicatore di voto, fondi bloccati per {{lock}}x = {{period}} giorni" -} \ No newline at end of file +} diff --git a/packages/apps/public/locales/ko/translation.json b/packages/apps/public/locales/ko/translation.json index 7963bb3a78..8519f6cc44 100644 --- a/packages/apps/public/locales/ko/translation.json +++ b/packages/apps/public/locales/ko/translation.json @@ -716,7 +716,7 @@ "Type the password chosen at the account creation. It was used to encrypt your account's private key in the backup file.": "계정 생성시 선택한 비밀번호를 입력하세요. 비밀번호는 백업파일에서 사용자 계정의 개인키를 암호화하는데 사용됩니다.", "Unable to retrieve the specified block details. {{error}}": "지정된 블록 디테일을 찾을 수 없습니다 {{error}}", "Unbid": "언비드", - "Unbonding {{value}}, ": "언본딩 {{value}},", + "Unbonding {{value}}": "언본딩 {{value}}", "Uncaught error. Something went wrong with the query and rendering of this component. {{message}}": "발견하지 않은 오류. 퀴리 및 요소의 연주 시 이상이 있었습니다", "Undelegate": "위임취소", "Unit": "단위", @@ -1160,4 +1160,4 @@ "{{threshold}}, not passing": "{{threshold}}, 통과되지 않았습니다", "{{threshold}}, passing": "{{threshold}}, 통과되었습니다", "{{value}}x voting balance, locked for {{lock}}x enactment ({{period}} days)": "{{value}}x 투표 발란스, 잠금 {{lock}}x제정 ({{period}} days)" -} \ No newline at end of file +} diff --git a/packages/apps/public/locales/pt/translation.json b/packages/apps/public/locales/pt/translation.json index 05c9f9c90d..5aa95affa0 100644 --- a/packages/apps/public/locales/pt/translation.json +++ b/packages/apps/public/locales/pt/translation.json @@ -634,7 +634,7 @@ "Unable to find on-chain WASM code for the supplied codeHash": "Não foi possível encontrar o código WASM na cadeia para o codeHash fornecido", "Unbond": "Desvincular", "Unbond funds": "Desvincular fundos", - "Unbonding {{value}}, ": "Desvinculando {{value}},", + "Unbonding {{value}}": "Desvinculando {{value}}", "Uncaught error. Something went wrong with the query and rendering of this component. {{message}}": "Erro não capturado. Ocorreu um problema com a consulta e a renderização deste componente. {{mensagem}}", "Unit": "Unidade", "Unit decides the name of 1 unit token, e.g. \"DOT\" for Polkadot": "A unidade decide o nome de 1 token de unidade, por exemplo \"DOT\" para Polkadot", @@ -1122,4 +1122,4 @@ "{{threshold}}, not passing": "{{threshold}}, não passando", "{{threshold}}, passing": "{{threshold}}, passando", "{{value}}x voting balance, locked for {{lock}}x enactment ({{period}} days)": "{{value}} x saldo de votos, bloqueado por {{lock}} x promulgação ({{period}} dias)" -} \ No newline at end of file +} diff --git a/packages/apps/public/locales/ru/translation.json b/packages/apps/public/locales/ru/translation.json index 08f255109f..48848f2270 100644 --- a/packages/apps/public/locales/ru/translation.json +++ b/packages/apps/public/locales/ru/translation.json @@ -641,7 +641,7 @@ "Unable to find on-chain WASM code for the supplied codeHash": "Не найден WASM код для этого codeHash", "Unbond": "Освободить", "Unbond funds": "Освободить средства", - "Unbonding {{value}}, ": "Разблокирование {{value}}", + "Unbonding {{value}}": "Разблокирование {{value}}", "Uncaught error. Something went wrong with the query and rendering of this component. {{message}}": "Неизвестная ошибка. Что-то пошло не так с запросом и показом этого компонента {{message}}", "Unit": "Единица", "Unit decides the name of 1 unit token, e.g. \"DOT\" for Polkadot": "Единица измерения определяет имя 1 единицы токена, например, \"DOT\" для Polkadot", @@ -1133,4 +1133,4 @@ "{{threshold}}, not passing": "{{threshold}}, не проходит", "{{threshold}}, passing": "{{threshold}}, проходит", "{{value}}x voting balance, locked for {{lock}}x enactment ({{period}} days)": "{{value}}x баланс голосования, заблокировано на {{lock}}x ({{period}} дней)" -} \ No newline at end of file +} diff --git a/packages/apps/public/locales/zh/translation.json b/packages/apps/public/locales/zh/translation.json index 8ed520ff3b..61952498d0 100644 --- a/packages/apps/public/locales/zh/translation.json +++ b/packages/apps/public/locales/zh/translation.json @@ -821,7 +821,7 @@ "Unbid": "没有竞标", "Unbond": "解除绑定", "Unbond funds": "解除绑定资金", - "Unbonding {{value}}, ": "解除绑定{{value}}", + "Unbonding {{value}}": "解除绑定{{value}}", "Uncaught error. Something went wrong with the query and rendering of this component. {{message}}": "未捕获的错误。此组件的查询和呈现出现问题。{{message}}", "Undelegate": "不受委托的", "Unit": "单位", @@ -1380,4 +1380,4 @@ "{{threshold}}, not passing": "{{threshold}},没有通过", "{{threshold}}, passing": "{{threshold}}, 通过", "{{value}}x voting balance, locked for {{lock}}x enactment ({{period}} days)": "{{value}}x投票余额,锁定 {{lock}}x 执行 ({{period}} days)" -} \ No newline at end of file +} diff --git a/packages/page-accounts/src/Accounts/Account.tsx b/packages/page-accounts/src/Accounts/Account.tsx index 52cd7eac2e..d9d8a06682 100644 --- a/packages/page-accounts/src/Accounts/Account.tsx +++ b/packages/page-accounts/src/Accounts/Account.tsx @@ -270,7 +270,7 @@ function Account ({ account: { address, meta }, className = '', delegation, filt onClick={toggleDelegate} /> )} - { !!proxy?.[0].length && ( + {!!proxy?.[0].length && ( ('This account has {{proxyNumber}} proxy set.', { diff --git a/packages/react-components/src/StakingUnbonding.tsx b/packages/react-components/src/StakingUnbonding.tsx index 60fa86fecf..43bbb400d9 100644 --- a/packages/react-components/src/StakingUnbonding.tsx +++ b/packages/react-components/src/StakingUnbonding.tsx @@ -19,15 +19,16 @@ interface Props { stakingInfo?: DeriveStakingAccount; } -function extractTotals (stakingInfo?: DeriveStakingAccount, progress?: DeriveSessionProgress): [[DeriveUnlocking, BN][], BN] { +function extractTotals (stakingInfo?: DeriveStakingAccount, progress?: DeriveSessionProgress): [[DeriveUnlocking, BN, BN][], BN] { if (!stakingInfo?.unlocking || !progress) { return [[], BN_ZERO]; } const mapped = stakingInfo.unlocking .filter(({ remainingEras, value }) => value.gt(BN_ZERO) && remainingEras.gt(BN_ZERO)) - .map((unlock): [DeriveUnlocking, BN] => [ + .map((unlock): [DeriveUnlocking, BN, BN] => [ unlock, + unlock.remainingEras, unlock.remainingEras .sub(BN_ONE) .imul(progress.eraLength) @@ -63,17 +64,22 @@ function StakingUnbonding ({ className = '', stakingInfo }: Props): React.ReactE /> ( + text={mapped.map(([{ value }, eras, blocks], index): React.ReactNode => (
-
{t('Unbonding {{value}}, ', { replace: { value: formatBalance(value, { forceUnit: '-' }) } })}
+
{t('Unbonding {{value}}', { replace: { value: formatBalance(value, { forceUnit: '-' }) } })}
- ('{{blocks}} blocks', { replace: { blocks: formatNumber(blocks) } })}, `} - /> + {api.consts.babe.epochDuration + ? ( + ('{{blocks}} blocks', { replace: { blocks: formatNumber(blocks) } })}, `} + /> + ) + : t('{{eras}} eras remaining', { replace: { eras: formatNumber(eras) } }) + }
))}