From 3182ebac65b0ff2e38cd474d74c8b532898df041 Mon Sep 17 00:00:00 2001
From: tequ <69445828+develoQ@users.noreply.github.com>
Date: Sun, 25 Jun 2023 01:57:53 +0900
Subject: [PATCH 1/2] [JA] Add hooks-testnet name (#758)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
"Unknown Network" was displayed when no translation information was
provided for the network name.
---
public/locales/ja-JP/translations.json | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/public/locales/ja-JP/translations.json b/public/locales/ja-JP/translations.json
index fc37fa4b3..f5cf2a30b 100644
--- a/public/locales/ja-JP/translations.json
+++ b/public/locales/ja-JP/translations.json
@@ -11,6 +11,7 @@
"network_name_mainnet": "Mainnet",
"network_name_devnet": "Devnet",
"network_name_amm": "AMM-Devnet",
+ "network_name_hooks_testnet": "Hooks-Testnet",
"network_name_custom": "Custom",
"app.meta.description": "XRPLネットワークエクスプローラ",
"app.meta.author": "Ripple",
@@ -448,5 +449,8 @@
"peer_crawled_context": null,
"xchainbridge": null,
"language_en-US": null,
- "language_ja-JP": null
+ "language_ja-JP": null,
+ "xchain_account_claim_count": null,
+ "xchain_account_create_count": null,
+ "min_signer_quorum": null
}
From 99f00d13beee1400862af7dc4e081fe1564ee51c Mon Sep 17 00:00:00 2001
From: jonathanlei
Date: Mon, 26 Jun 2023 16:07:40 -0700
Subject: [PATCH 2/2] strip leading and trailing quotes from search (#759)
---
src/containers/Header/Search.tsx | 10 ++++++----
src/containers/Header/test/Search.test.js | 18 ++++++++++++++++++
2 files changed, 24 insertions(+), 4 deletions(-)
diff --git a/src/containers/Header/Search.tsx b/src/containers/Header/Search.tsx
index 3a77957ad..424c53604 100644
--- a/src/containers/Header/Search.tsx
+++ b/src/containers/Header/Search.tsx
@@ -104,15 +104,17 @@ export const Search = ({ callback = () => {} }: SearchProps) => {
const history = useHistory()
const handleSearch = async (id: string) => {
- const type = await getIdType(id, socket)
-
+ const strippedId = id.replace(/^["']|["']$/g, '')
+ const type = await getIdType(strippedId, socket)
track('search', {
- search_term: id,
+ search_term: strippedId,
search_category: type,
})
history.push(
- type === 'invalid' ? `/search/${id}` : `/${type}/${normalize(id, type)}`,
+ type === 'invalid'
+ ? `/search/${strippedId}`
+ : `/${type}/${normalize(strippedId, type)}`,
)
callback()
}
diff --git a/src/containers/Header/test/Search.test.js b/src/containers/Header/test/Search.test.js
index 7dd607187..d458373c7 100644
--- a/src/containers/Header/test/Search.test.js
+++ b/src/containers/Header/test/Search.test.js
@@ -47,6 +47,9 @@ describe('Search component', () => {
const paystring = 'blunden$paystring.crypto.com'
const paystringWithAt = 'blunden@paystring.crypto.com'
const validator = 'nHUFE9prPXPrHcG3SkwP1UzAQbSphqyQkQK9ATXLZsfkezhhda3p'
+ const addressWithQuotes = '"rGFuMiw48HdbnrUbkRYuitXTmfrDBNTCnX"'
+ const addressWithSpace = ' rGFuMiw48HdbnrUbkRYuitXTmfrDBNTCnX '
+ const addressWithSingleQuote = '"rGFuMiw48HdbnrUbkRYuitXTmfrDBNTCnX'
const hash =
'59239EA78084F6E2F288473F8AE02F3E6FC92F44BDE59668B5CAE361D3D32838'
@@ -73,6 +76,21 @@ describe('Search component', () => {
await flushPromises()
expect(window.location.pathname).toEqual(`/accounts/${rippleAddress}`)
+ input.instance().value = addressWithQuotes
+ input.simulate('keyDown', { key: 'Enter' })
+ await flushPromises()
+ expect(window.location.pathname).toEqual(`/accounts/${rippleAddress}`)
+
+ input.instance().value = addressWithSingleQuote
+ input.simulate('keyDown', { key: 'Enter' })
+ await flushPromises()
+ expect(window.location.pathname).toEqual(`/accounts/${rippleAddress}`)
+
+ input.instance().value = addressWithSpace
+ input.simulate('keyDown', { key: 'Enter' })
+ await flushPromises()
+ expect(window.location.pathname).toEqual(`/accounts/${rippleAddress}`)
+
input.instance().value = rippleXAddress
input.simulate('keyDown', { key: 'Enter' })
await flushPromises()