From 9db41c9ed5eabf4a6375a449c17dbdefa4a56f45 Mon Sep 17 00:00:00 2001 From: Sohamm Kulkarni Date: Tue, 19 Dec 2023 05:40:50 +0000 Subject: [PATCH 1/5] refactor: translations.json Changed server_ledgers_hint in translations.json in a manner such that only the 'connection.ledger.validated' is used as there was some error with displaying 'connection.server.publicKey' --- public/locales/en-US/translations.json | 2 +- public/locales/es-ES/translations.json | 2 +- public/locales/fr-FR/translations.json | 2 +- public/locales/ko-KR/translations.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/public/locales/en-US/translations.json b/public/locales/en-US/translations.json index 5e49b7317..39aa22863 100644 --- a/public/locales/en-US/translations.json +++ b/public/locales/en-US/translations.json @@ -200,7 +200,7 @@ "invalid_transaction_hash": "The transaction hash is invalid", "ledger_not_found": "Ledger not Found", "check_ledger_id": "Please check your ledger id", - "server_ledgers_hint": "This node ({{connection.server.publicKey, truncate(length: 10)}}) only contains ledgers {{connection.ledger.validated}}", + "server_ledgers_hint": "This node only contains ledgers {{connection.ledger.validated}}", "use_search": "Please use our search", "ledger_has_no_trans": "This ledger does not have any transactions", "less_than": "Less than", diff --git a/public/locales/es-ES/translations.json b/public/locales/es-ES/translations.json index 42066221e..159589330 100644 --- a/public/locales/es-ES/translations.json +++ b/public/locales/es-ES/translations.json @@ -196,7 +196,7 @@ "invalid_transaction_hash": "El hash de la transacción es inválido", "ledger_not_found": "Libro Contable no Encontrado", "check_ledger_id": "Por favor, comprueba el id de tu libro contable", - "server_ledgers_hint": "Este nodo ({{connection.server.publicKey, truncate(length: 10)}}) solo contiene libros contables {{connection.ledger.validated}}", + "server_ledgers_hint": "Este nodo solo contiene libros contables {{connection.ledger.validated}}", "use_search": "Por favor, utiliza nuestra búsqueda", "ledger_has_no_trans": "Este libro contable no tiene ninguna transacción", "less_than": "Menos que", diff --git a/public/locales/fr-FR/translations.json b/public/locales/fr-FR/translations.json index 2659107a2..6893500ee 100644 --- a/public/locales/fr-FR/translations.json +++ b/public/locales/fr-FR/translations.json @@ -198,7 +198,7 @@ "invalid_transaction_hash": "Le hash de la transaction est invalide", "ledger_not_found": "Registre introuvable", "check_ledger_id": "Veuillez vérifier votre id de registre", - "server_ledgers_hint": "Ce nœud ({{connection.server.publicKey, truncate(length: 10)}}) ne contient que les registres {{connection.ledger.validated}}.", + "server_ledgers_hint": "Ce nœud ne contient que les registres {{connection.ledger.validated}}.", "use_search": "Merci d'utiliser notre outil de recherche", "ledger_has_no_trans": "Ce registre n'a aucune transaction.", "less_than": "Moins de", diff --git a/public/locales/ko-KR/translations.json b/public/locales/ko-KR/translations.json index d60c7326c..1e7a89e3e 100644 --- a/public/locales/ko-KR/translations.json +++ b/public/locales/ko-KR/translations.json @@ -199,7 +199,7 @@ "invalid_transaction_hash": "트랜잭션 해시가 유효하지 않습니다", "ledger_not_found": "원장을 찾을 수 없습니다", "check_ledger_id": "원장 ID를 확인해주세요", - "server_ledgers_hint": "이 노드 ({{connection.server.publicKey, truncate(length: 10)}})는 {{connection.ledger.validated}} 원장만 포함하고 있습니다", + "server_ledgers_hint": "이 노드 는 {{connection.ledger.validated}} 원장만 포함하고 있습니다", "use_search": "검색을 이용해 주세요", "ledger_has_no_trans": "이 원장에는 어떠한 트랜잭션도 없습니다", "less_than": "미만", From e619909a41059796f656d89334c12556d894ad87 Mon Sep 17 00:00:00 2001 From: Sohamm Kulkarni Date: Wed, 3 Apr 2024 09:14:50 +0000 Subject: [PATCH 2/5] This commit is made to try and solve a issue in vercel deployment --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index eb76ce89b..b8d5c62f0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -114,7 +114,7 @@ "xrpl": "^3.0.0-beta.1" }, "engines": { - "node": ">=18.0.0 <19", + "node": ">=20.x", "npm": ">=7.14.0 <10.0.0" } }, diff --git a/package.json b/package.json index 699b8e13e..a86a9dc77 100644 --- a/package.json +++ b/package.json @@ -146,7 +146,7 @@ ], "prettier": "@xrplf/prettier-config", "engines": { - "node": ">=18.0.0 <19", + "node": ">=20.x", "npm": ">=7.14.0 <10.0.0" } } From 7839eb0f1859391ffe598a9a2b9e51efbec5d932 Mon Sep 17 00:00:00 2001 From: Sohamm Kulkarni Date: Wed, 3 Apr 2024 09:54:52 +0000 Subject: [PATCH 3/5] pubKey displays properly --- public/locales/en-US/translations.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/locales/en-US/translations.json b/public/locales/en-US/translations.json index 57d6735d1..9d7630114 100644 --- a/public/locales/en-US/translations.json +++ b/public/locales/en-US/translations.json @@ -201,7 +201,7 @@ "invalid_transaction_hash": "The transaction hash is invalid", "ledger_not_found": "Ledger not Found", "check_ledger_id": "Please check your ledger id", - "server_ledgers_hint": "This node only contains ledgers {{connection.ledger.validated}}", + "server_ledgers_hint": "This node ({{connection.server.publicKey, truncate(length: 10)}}) only contains ledgers {{connection.ledger.validated}}", "use_search": "Please use our search", "ledger_has_no_trans": "This ledger does not have any transactions", "less_than": "Less than", From 5470806be6b71094ab875a194e6153ef19317604 Mon Sep 17 00:00:00 2001 From: Sohamm Kulkarni Date: Sat, 6 Apr 2024 18:16:16 +0000 Subject: [PATCH 4/5] Resolved Issue #844 --- public/locales/en-US/translations.json | 3 ++- public/locales/es-ES/translations.json | 1 + public/locales/fr-FR/translations.json | 1 + public/locales/ja-JP/translations.json | 1 + public/locales/ko-KR/translations.json | 1 + src/containers/NoMatch/index.tsx | 13 +++++++------ 6 files changed, 13 insertions(+), 7 deletions(-) diff --git a/public/locales/en-US/translations.json b/public/locales/en-US/translations.json index 9d7630114..a62af3f2b 100644 --- a/public/locales/en-US/translations.json +++ b/public/locales/en-US/translations.json @@ -201,7 +201,8 @@ "invalid_transaction_hash": "The transaction hash is invalid", "ledger_not_found": "Ledger not Found", "check_ledger_id": "Please check your ledger id", - "server_ledgers_hint": "This node ({{connection.server.publicKey, truncate(length: 10)}}) only contains ledgers {{connection.ledger.validated}}", + "server_ledgers_hint": "This node only contains ledgers {{connection.ledger.validated}}", + "server_ledgers_hint_with_key": "This node ({{connection.server.publicKey, truncate(length: 10)}}) only contains ledgers {{connection.ledger.validated}}", "use_search": "Please use our search", "ledger_has_no_trans": "This ledger does not have any transactions", "less_than": "Less than", diff --git a/public/locales/es-ES/translations.json b/public/locales/es-ES/translations.json index 3cfe21e58..45dd3b154 100644 --- a/public/locales/es-ES/translations.json +++ b/public/locales/es-ES/translations.json @@ -198,6 +198,7 @@ "ledger_not_found": "Libro Contable no Encontrado", "check_ledger_id": "Por favor, comprueba el id de tu libro contable", "server_ledgers_hint": "Este nodo solo contiene libros contables {{connection.ledger.validated}}", + "server_ledgers_hint_with_key": null, "use_search": "Por favor, utiliza nuestra búsqueda", "ledger_has_no_trans": "Este libro contable no tiene ninguna transacción", "less_than": "Menos que", diff --git a/public/locales/fr-FR/translations.json b/public/locales/fr-FR/translations.json index 94ef9e4ad..9fd807c18 100644 --- a/public/locales/fr-FR/translations.json +++ b/public/locales/fr-FR/translations.json @@ -200,6 +200,7 @@ "ledger_not_found": "Registre introuvable", "check_ledger_id": "Veuillez vérifier votre id de registre", "server_ledgers_hint": "Ce nœud ne contient que les registres {{connection.ledger.validated}}.", + "server_ledgers_hint_with_key": null, "use_search": "Merci d'utiliser notre outil de recherche", "ledger_has_no_trans": "Ce registre n'a aucune transaction.", "less_than": "Moins de", diff --git a/public/locales/ja-JP/translations.json b/public/locales/ja-JP/translations.json index 7d036a6ca..88a469e36 100644 --- a/public/locales/ja-JP/translations.json +++ b/public/locales/ja-JP/translations.json @@ -200,6 +200,7 @@ "ledger_not_found": "Ledgerが見つかりません", "check_ledger_id": "Ledger IDを確認してください", "server_ledgers_hint": null, + "server_ledgers_hint_with_key": null, "use_search": "検索機能をご利用ください", "ledger_has_no_trans": "Ledgerにはトランザクションがありません", "less_than": "未満", diff --git a/public/locales/ko-KR/translations.json b/public/locales/ko-KR/translations.json index 9199e4cc6..08597d9bf 100644 --- a/public/locales/ko-KR/translations.json +++ b/public/locales/ko-KR/translations.json @@ -201,6 +201,7 @@ "ledger_not_found": "원장을 찾을 수 없습니다", "check_ledger_id": "원장 ID를 확인해주세요", "server_ledgers_hint": "이 노드 는 {{connection.ledger.validated}} 원장만 포함하고 있습니다", + "server_ledgers_hint_with_key": null, "use_search": "검색을 이용해 주세요", "ledger_has_no_trans": "이 원장에는 어떠한 트랜잭션도 없습니다", "less_than": "미만", diff --git a/src/containers/NoMatch/index.tsx b/src/containers/NoMatch/index.tsx index 5d1e7ad0a..eca98ef7e 100644 --- a/src/containers/NoMatch/index.tsx +++ b/src/containers/NoMatch/index.tsx @@ -40,11 +40,12 @@ const NoMatch = ({ }, [...hints, title, track]) const notFound = title.includes('not_found') - const hintMsg = hints.map((hint) => ( -
- {t(hint as any, values)} -
- )) + + // Determine which hint message to display based on the presence of publicKey + const hintMsg = values.connection?.server?.publicKey + ? t('server_ledgers_hint_with_key', values) + : t('server_ledgers_hint', values) + const derivedWarning = warning ?? (notFound && t('not_found')) return ( @@ -52,7 +53,7 @@ const NoMatch = ({ {isError &&
{t('uh_oh')}
}
{t(title as any, values)}
- {hintMsg} + {hintMsg &&
{hintMsg}
} {(derivedWarning || isError) && (
From d05d2e1fd2e68ba9737b1d56292fe59e68a6cece Mon Sep 17 00:00:00 2001 From: Sohamm Kulkarni Date: Tue, 23 Apr 2024 12:09:08 +0000 Subject: [PATCH 5/5] refactor NoMatch index.tsx --- src/containers/NoMatch/index.tsx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/containers/NoMatch/index.tsx b/src/containers/NoMatch/index.tsx index eca98ef7e..c18b78c79 100644 --- a/src/containers/NoMatch/index.tsx +++ b/src/containers/NoMatch/index.tsx @@ -25,7 +25,7 @@ const NoMatch = ({ title = 'not_found_default_title', hints = ['not_found_check_url'], isError = true, - warning = undefined, + warning, }: NoMatchProps) => { const { track } = useAnalytics() const { t } = useTranslation() @@ -41,20 +41,21 @@ const NoMatch = ({ const notFound = title.includes('not_found') - // Determine which hint message to display based on the presence of publicKey const hintMsg = values.connection?.server?.publicKey ? t('server_ledgers_hint_with_key', values) : t('server_ledgers_hint', values) - const derivedWarning = warning ?? (notFound && t('not_found')) + const derivedWarning = warning ?? (notFound ? t('not_found') : undefined) return (
{isError &&
{t('uh_oh')}
}
{t(title as any, values)}
+ {/* Render hintMsg only if it exists */} {hintMsg &&
{hintMsg}
} - {(derivedWarning || isError) && ( + {/* Render derivedWarning only if it exists */} + {derivedWarning && (