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

style(frontend): activity incomplete transaction list #3700

Open
wants to merge 19 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
117b60b
adds message box of type warning
BonomoAlessandro Nov 19, 2024
62af14f
displays warning to display which tokens do not have an index canister
BonomoAlessandro Nov 20, 2024
8224145
reformat code
BonomoAlessandro Nov 20, 2024
5e4fda0
moves token load logic into network-tokens.derived.ts
BonomoAlessandro Nov 20, 2024
242a80e
reformat code
BonomoAlessandro Nov 20, 2024
c0d0449
Merge remote-tracking branch 'origin/main' into style(frontend)/activ…
BonomoAlessandro Nov 20, 2024
b6abe61
provides closableKey to warning message box
BonomoAlessandro Nov 20, 2024
547d988
renames variable
BonomoAlessandro Nov 20, 2024
b66bec1
Merge remote-tracking branch 'origin/main' into style(frontend)/activ…
BonomoAlessandro Nov 20, 2024
9166dcf
adds new hide info key
BonomoAlessandro Nov 20, 2024
e305432
implements review feedback
BonomoAlessandro Nov 22, 2024
56c1d01
reformat code
BonomoAlessandro Nov 22, 2024
569c607
Merge remote-tracking branch 'origin/main' into style(frontend)/activ…
BonomoAlessandro Nov 22, 2024
c29f50c
reformat code
BonomoAlessandro Nov 22, 2024
b6086b3
removes unused ethTransactionStore and btcTransactionStore check
BonomoAlessandro Nov 22, 2024
2b5fbfc
fixes frontend checks
BonomoAlessandro Nov 22, 2024
f1d64b9
uses notEmptyString to check if string is empty
BonomoAlessandro Nov 22, 2024
a9c131b
Merge branch 'main' into style(frontend)/activity-incomplete-transact…
BonomoAlessandro Nov 26, 2024
3565495
Merge branch 'main' into style(frontend)/activity-incomplete-transact…
BonomoAlessandro Dec 2, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,10 +1,23 @@
<script lang="ts">
import { notEmptyString, type Token } from '@dfinity/utils';
import { icTransactionsStore } from '$icp/stores/ic-transactions.store';
import NetworksSwitcher from '$lib/components/networks/NetworksSwitcher.svelte';
import AllTransactionsList from '$lib/components/transactions/AllTransactionsList.svelte';
import MessageBox from '$lib/components/ui/MessageBox.svelte';
import PageTitle from '$lib/components/ui/PageTitle.svelte';
import { enabledNetworkTokens } from '$lib/derived/network-tokens.derived';
import { testnetsEnabled } from '$lib/derived/settings.derived';
import { i18n } from '$lib/stores/i18n.store';
import type { TokenUi } from '$lib/types/token';
import { replacePlaceholders } from '$lib/utils/i18n.utils.js';

let enabledTokensWithoutCanister: Token[];
$: enabledTokensWithoutCanister = $enabledNetworkTokens.filter(
Copy link
Member

Choose a reason for hiding this comment

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

@AntonioVentilii implemented a workaround last week that causes tokens with an index canister in error to fall back to using the ledger only. As a result, transactions === null can now have two different root causes, which are displayed differently in the UI. Can you both discuss how you'd like to handle this?

(token: TokenUi) => $icTransactionsStore?.[token.id] === null
);

let tokenList: string;
$: tokenList = enabledTokensWithoutCanister.map((token) => `$${token.symbol}`).join(', ');
peterpeterparker marked this conversation as resolved.
Show resolved Hide resolved
</script>

<div class="flex flex-col gap-5">
Expand All @@ -16,6 +29,14 @@
</div>
{/if}

{#if notEmptyString(tokenList)}
<MessageBox level="light-warning" closableKey="oisy_ic_hide_incomplete_transaction_list">
{replacePlaceholders($i18n.activity.warning.incomplete_transaction_list, {
$token_list: tokenList
})}
</MessageBox>
{/if}

<MessageBox level="plain" closableKey="oisy_ic_hide_bitcoin_activity">
{$i18n.activity.info.btc_transactions}
</MessageBox>
Expand Down
3 changes: 3 additions & 0 deletions src/frontend/src/lib/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -810,6 +810,9 @@
},
"info": {
"btc_transactions": "BTC transaction information is obtained from central third parties and should be independently verified."
},
"warning": {
"incomplete_transaction_list": "Transaction list is incomplete because $token_list don't have an Index canister to provide transaction information."
}
}
}
1 change: 1 addition & 0 deletions src/frontend/src/lib/types/i18n.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -702,6 +702,7 @@ interface I18nLicense_agreement {
interface I18nActivity {
text: { title: string };
info: { btc_transactions: string };
warning: { incomplete_transaction_list: string };
}

interface I18n {
Expand Down
3 changes: 2 additions & 1 deletion src/frontend/src/lib/utils/info.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ export type HideInfoKey =
| 'oisy_ic_hide_bitcoin_info'
| 'oisy_ic_hide_ethereum_info'
| 'oisy_ic_hide_erc20_info'
| 'oisy_ic_hide_bitcoin_activity';
| 'oisy_ic_hide_bitcoin_activity'
| 'oisy_ic_hide_incomplete_transaction_list';

export const saveHideInfo = (key: HideInfoKey) => {
try {
Expand Down