From 7931a9659083dad456e1a1493f005ca8ec94840c Mon Sep 17 00:00:00 2001 From: Keith Date: Sun, 10 Nov 2019 23:48:35 +0800 Subject: [PATCH 1/2] feat(neuron-ui): remove input truncation on importing keystore. --- .../neuron-ui/src/components/ImportKeystore/index.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/neuron-ui/src/components/ImportKeystore/index.tsx b/packages/neuron-ui/src/components/ImportKeystore/index.tsx index 3217bb9a17..fd2b34d045 100644 --- a/packages/neuron-ui/src/components/ImportKeystore/index.tsx +++ b/packages/neuron-ui/src/components/ImportKeystore/index.tsx @@ -98,7 +98,6 @@ const ImportKeystore = (props: React.PropsWithoutRef { @@ -108,6 +107,13 @@ const ImportKeystore = (props: React.PropsWithoutRef maxLength) { + return t(`messages.codes.${ErrorCode.FieldTooLong}`, { + fieldName: key, + fieldValue: text, + length: maxLength, + }) + } return '' }} onChange={(_e: React.FormEvent, newValue?: string) => { From d180d4a35ac8f6deba88d5a51f94ddf2e2d7fdda Mon Sep 17 00:00:00 2001 From: Keith Date: Mon, 11 Nov 2019 10:38:11 +0800 Subject: [PATCH 2/2] refactor(neuron-ui): hide the password in error message --- packages/neuron-ui/src/components/ImportKeystore/index.tsx | 2 +- packages/neuron-ui/src/locales/en.json | 1 + packages/neuron-ui/src/locales/zh.json | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/neuron-ui/src/components/ImportKeystore/index.tsx b/packages/neuron-ui/src/components/ImportKeystore/index.tsx index fd2b34d045..e1c908c4a0 100644 --- a/packages/neuron-ui/src/components/ImportKeystore/index.tsx +++ b/packages/neuron-ui/src/components/ImportKeystore/index.tsx @@ -110,7 +110,7 @@ const ImportKeystore = (props: React.PropsWithoutRef maxLength) { return t(`messages.codes.${ErrorCode.FieldTooLong}`, { fieldName: key, - fieldValue: text, + fieldValue: key === 'password' ? '' : text, length: maxLength, }) } diff --git a/packages/neuron-ui/src/locales/en.json b/packages/neuron-ui/src/locales/en.json index 679aaad4de..ca5d51d297 100644 --- a/packages/neuron-ui/src/locales/en.json +++ b/packages/neuron-ui/src/locales/en.json @@ -259,6 +259,7 @@ "fields": { "wallet": "Wallet", "name": "Name", + "password": "Password", "remote": "RPC URL", "network": "Network", "address": "Address", diff --git a/packages/neuron-ui/src/locales/zh.json b/packages/neuron-ui/src/locales/zh.json index 2046f8c097..fd69af80e9 100644 --- a/packages/neuron-ui/src/locales/zh.json +++ b/packages/neuron-ui/src/locales/zh.json @@ -259,6 +259,7 @@ "fields": { "wallet": "钱包", "name": "名称", + "password": "密码", "remote": "RPC URL", "network": "网络", "address": "地址",