Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Render error tx844 #898

Open
wants to merge 12 commits into
base: staging
Choose a base branch
from
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@
],
"prettier": "@xrplf/prettier-config",
"engines": {
"node": ">=18.0.0 <19",
"node": ">=20.x",
"npm": ">=7.14.0 <10.0.0"
}
}
3 changes: 2 additions & 1 deletion public/locales/en-US/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -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}}",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we still want the pubkey to be printed if it's available, with some sort of "This Clio node only..." alternate message

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, you're saying that the clio-node-part still needs to be present in the code. What if I change the code such that whenever the pubKey is not empty, it gets displayed. But when it is empty, print it as "This clio node only..."

Would that be viable?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, something like that sounds good.

"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",
Expand Down
3 changes: 2 additions & 1 deletion public/locales/es-ES/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,8 @@
"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}}",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, just a note, if you are unsure about the translations in other languages, you can set them to null and others can fill in later. It would use the default en-US if set to null

"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",
Expand Down
3 changes: 2 additions & 1 deletion public/locales/fr-FR/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,8 @@
"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}}.",
"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",
Expand Down
1 change: 1 addition & 0 deletions public/locales/ja-JP/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": "未満",
Expand Down
3 changes: 2 additions & 1 deletion public/locales/ko-KR/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,8 @@
"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}} 원장만 포함하고 있습니다",
"server_ledgers_hint_with_key": null,
"use_search": "검색을 이용해 주세요",
"ledger_has_no_trans": "이 원장에는 어떠한 트랜잭션도 없습니다",
"less_than": "미만",
Expand Down
13 changes: 7 additions & 6 deletions src/containers/NoMatch/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,20 @@ const NoMatch = ({
}, [...hints, title, track])

const notFound = title.includes('not_found')
const hintMsg = hints.map((hint) => (
<div className="hint" key={hint}>
{t(hint as any, values)}
</div>
))

// 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 (
<div className="no-match">
<Helmet title={t(title as any)} />
{isError && <div className="uh-oh">{t('uh_oh')}</div>}
<div className="title">{t(title as any, values)}</div>
{hintMsg}
{hintMsg && <div className="hint">{hintMsg}</div>}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure why we need to change here. Would hintMsg ever be null? Also, are we not using hints array here at all?

Copy link
Contributor Author

@sohammk08 sohammk08 Apr 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will implement the suggested change in the next commit

{(derivedWarning || isError) && (
<div className="warning">
<InfoIcon title={derivedWarning} />
Expand Down