Skip to content

Commit

Permalink
Merge pull request #1855 from dusk-network/feature-1797
Browse files Browse the repository at this point in the history
explorer: fix inconsistent data presentation
  • Loading branch information
deuch13 authored Jun 18, 2024
2 parents 71104a3 + 4ce2fae commit da11457
Show file tree
Hide file tree
Showing 16 changed files with 131 additions and 134 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,32 +20,6 @@ exports[`Block Details > renders the Block Details component 1`] = `
<dl
class="block-details__list"
>
<dt
class="details-list__term"
>
<svg
class="dusk-icon dusk-icon--size--normal detail-list__help"
data-tooltip-id="main-tooltip"
data-tooltip-place="top"
data-tooltip-text="The hash for the header of the block"
data-tooltip-type="info"
role="graphics-symbol"
viewBox="0 0 24 24"
>
<path
d="M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M11,17H13V11H11V17Z"
/>
</svg>
block hash
</dt>
<dd
class="details-list__definition"
>
bd5c99bb720b03500e89f103fe66113ba62f2e124ed9651563f38fd15977719f
</dd>
<dt
class="details-list__term"
>
Expand Down Expand Up @@ -113,6 +87,32 @@ exports[`Block Details > renders the Block Details component 1`] = `
</a>
</dd>
<dt
class="details-list__term"
>
<svg
class="dusk-icon dusk-icon--size--normal detail-list__help"
data-tooltip-id="main-tooltip"
data-tooltip-place="top"
data-tooltip-text="The hash for the header of the block"
data-tooltip-type="info"
role="graphics-symbol"
viewBox="0 0 24 24"
>
<path
d="M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M11,17H13V11H11V17Z"
/>
</svg>
hash
</dt>
<dd
class="details-list__definition"
>
bd5c99bb720b03500e89f103fe66113ba62f2e124ed9651563f38fd15977719f
</dd>
<dt
class="details-list__term"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ exports[`Blocks Card > should disable the \`Show More\` button if there is no mo
<th
class="table__header-cell"
>
# Block
Block
</th>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ exports[`Blocks List > renders the Blocks List component 1`] = `
</svg>
# block
block
</dt>
<dd
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ exports[`Blocks Table > should render the \`BlocksTable\` component 1`] = `
<th
class="table__header-cell"
>
# Block
Block
</th>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ exports[`Transactions Card > should disable the \`Show More\` button if there is
<th
class="table__header-cell"
>
Hash
ID
</th>
Expand Down Expand Up @@ -127,7 +127,7 @@ exports[`Transactions Card > should disable the \`Show More\` button if there is
class="dusk-anchor dusk-anchor--on-surface transaction__link"
href="/some-base-path/transactions/transaction?id=070280c69500df7d1b40942981a3b599ccf9f71ba62f96d63e322994efca2a0e"
>
904ad41723...1b50b2dc54
070280c695...94efca2a0e
</a>
<small
Expand Down Expand Up @@ -205,7 +205,7 @@ exports[`Transactions Card > should disable the \`Show More\` button if there is
class="dusk-anchor dusk-anchor--on-surface transaction__link"
href="/some-base-path/transactions/transaction?id=534f753d5a420fddc21c84d76ff26b87cc48ea75b450c082759d155153259c00"
>
6971e17e16...d38530d800
534f753d5a...5153259c00
</a>
<small
Expand Down Expand Up @@ -283,7 +283,7 @@ exports[`Transactions Card > should disable the \`Show More\` button if there is
class="dusk-anchor dusk-anchor--on-surface transaction__link"
href="/some-base-path/transactions/transaction?id=c6f13af20c23b8bc55d22a416a191e3a6ba47128b4d7dc3ac6fce5fc68ebb102"
>
c28cfe813e...bbca988fed
c6f13af20c...fc68ebb102
</a>
<small
Expand Down Expand Up @@ -361,7 +361,7 @@ exports[`Transactions Card > should disable the \`Show More\` button if there is
class="dusk-anchor dusk-anchor--on-surface transaction__link"
href="/some-base-path/transactions/transaction?id=31c7dce26a5a6ef1392f53630b8e2714981f10eaeea2685c5a37dbbf7bcb4c04"
>
e4a232262c...4db4b3cdec
31c7dce26a...bf7bcb4c04
</a>
<small
Expand Down Expand Up @@ -439,7 +439,7 @@ exports[`Transactions Card > should disable the \`Show More\` button if there is
class="dusk-anchor dusk-anchor--on-surface transaction__link"
href="/some-base-path/transactions/transaction?id=4fa6e913c083aa595530b1f6c010c7e5a58121307c991ea6782f9e9e4dd5510d"
>
ea1cfc01b6...ce792d0e8a
4fa6e913c0...9e4dd5510d
</a>
<small
Expand Down Expand Up @@ -517,7 +517,7 @@ exports[`Transactions Card > should disable the \`Show More\` button if there is
class="dusk-anchor dusk-anchor--on-surface transaction__link"
href="/some-base-path/transactions/transaction?id=d1a7928a435021d87ea3649bff57c8154fc7b5c6c68081a61fea5779ccdb2e04"
>
e4c3e5f688...50ebdcbff4
d1a7928a43...79ccdb2e04
</a>
<small
Expand Down Expand Up @@ -595,7 +595,7 @@ exports[`Transactions Card > should disable the \`Show More\` button if there is
class="dusk-anchor dusk-anchor--on-surface transaction__link"
href="/some-base-path/transactions/transaction?id=004ca8683c315b9270e04d3768dfb58fb0f65d92a9469ca31a5d97cff9718b06"
>
10cd59c725...eed7adc1f8
004ca8683c...cff9718b06
</a>
<small
Expand Down Expand Up @@ -673,7 +673,7 @@ exports[`Transactions Card > should disable the \`Show More\` button if there is
class="dusk-anchor dusk-anchor--on-surface transaction__link"
href="/some-base-path/transactions/transaction?id=b5a77063e45dd90b97b2c30b4cd670fbf04ae60c4b8e3ea9fd0d0b4496253a05"
>
31bcdcbf06...347aac19f3
b5a77063e4...4496253a05
</a>
<small
Expand Down Expand Up @@ -751,7 +751,7 @@ exports[`Transactions Card > should disable the \`Show More\` button if there is
class="dusk-anchor dusk-anchor--on-surface transaction__link"
href="/some-base-path/transactions/transaction?id=b263d9d594439be92bb9349bd97f55a05060956419f2f4a32925639d80b06e0b"
>
deb6807ba2...ecf6f1b837
b263d9d594...9d80b06e0b
</a>
<small
Expand Down Expand Up @@ -829,7 +829,7 @@ exports[`Transactions Card > should disable the \`Show More\` button if there is
class="dusk-anchor dusk-anchor--on-surface transaction__link"
href="/some-base-path/transactions/transaction?id=b4525cb82f5cd56fcf8ceb2eb30f647d2c3567e82abb8265dd12daf5275d7709"
>
62fbd83edb...1b54a5ad89
b4525cb82f...f5275d7709
</a>
<small
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ exports[`Transactions List > renders the Transactions List component 1`] = `
</svg>
Hash
ID
</dt>
<dd
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ exports[`Transactions Table > should render the \`TransactionsTable\` component
<th
class="table__header-cell"
>
Hash
ID
</th>
Expand Down Expand Up @@ -64,7 +64,7 @@ exports[`Transactions Table > should render the \`TransactionsTable\` component
class="dusk-anchor dusk-anchor--on-surface transaction__link"
href="/some-base-path/transactions/transaction?id=070280c69500df7d1b40942981a3b599ccf9f71ba62f96d63e322994efca2a0e"
>
904ad41723...1b50b2dc54
070280c695...94efca2a0e
</a>
<small
Expand Down Expand Up @@ -142,7 +142,7 @@ exports[`Transactions Table > should render the \`TransactionsTable\` component
class="dusk-anchor dusk-anchor--on-surface transaction__link"
href="/some-base-path/transactions/transaction?id=534f753d5a420fddc21c84d76ff26b87cc48ea75b450c082759d155153259c00"
>
6971e17e16...d38530d800
534f753d5a...5153259c00
</a>
<small
Expand Down Expand Up @@ -220,7 +220,7 @@ exports[`Transactions Table > should render the \`TransactionsTable\` component
class="dusk-anchor dusk-anchor--on-surface transaction__link"
href="/some-base-path/transactions/transaction?id=c6f13af20c23b8bc55d22a416a191e3a6ba47128b4d7dc3ac6fce5fc68ebb102"
>
c28cfe813e...bbca988fed
c6f13af20c...fc68ebb102
</a>
<small
Expand Down Expand Up @@ -298,7 +298,7 @@ exports[`Transactions Table > should render the \`TransactionsTable\` component
class="dusk-anchor dusk-anchor--on-surface transaction__link"
href="/some-base-path/transactions/transaction?id=31c7dce26a5a6ef1392f53630b8e2714981f10eaeea2685c5a37dbbf7bcb4c04"
>
e4a232262c...4db4b3cdec
31c7dce26a...bf7bcb4c04
</a>
<small
Expand Down Expand Up @@ -376,7 +376,7 @@ exports[`Transactions Table > should render the \`TransactionsTable\` component
class="dusk-anchor dusk-anchor--on-surface transaction__link"
href="/some-base-path/transactions/transaction?id=4fa6e913c083aa595530b1f6c010c7e5a58121307c991ea6782f9e9e4dd5510d"
>
ea1cfc01b6...ce792d0e8a
4fa6e913c0...9e4dd5510d
</a>
<small
Expand Down Expand Up @@ -454,7 +454,7 @@ exports[`Transactions Table > should render the \`TransactionsTable\` component
class="dusk-anchor dusk-anchor--on-surface transaction__link"
href="/some-base-path/transactions/transaction?id=d1a7928a435021d87ea3649bff57c8154fc7b5c6c68081a61fea5779ccdb2e04"
>
e4c3e5f688...50ebdcbff4
d1a7928a43...79ccdb2e04
</a>
<small
Expand Down Expand Up @@ -532,7 +532,7 @@ exports[`Transactions Table > should render the \`TransactionsTable\` component
class="dusk-anchor dusk-anchor--on-surface transaction__link"
href="/some-base-path/transactions/transaction?id=004ca8683c315b9270e04d3768dfb58fb0f65d92a9469ca31a5d97cff9718b06"
>
10cd59c725...eed7adc1f8
004ca8683c...cff9718b06
</a>
<small
Expand Down Expand Up @@ -610,7 +610,7 @@ exports[`Transactions Table > should render the \`TransactionsTable\` component
class="dusk-anchor dusk-anchor--on-surface transaction__link"
href="/some-base-path/transactions/transaction?id=b5a77063e45dd90b97b2c30b4cd670fbf04ae60c4b8e3ea9fd0d0b4496253a05"
>
31bcdcbf06...347aac19f3
b5a77063e4...4496253a05
</a>
<small
Expand Down Expand Up @@ -688,7 +688,7 @@ exports[`Transactions Table > should render the \`TransactionsTable\` component
class="dusk-anchor dusk-anchor--on-surface transaction__link"
href="/some-base-path/transactions/transaction?id=b263d9d594439be92bb9349bd97f55a05060956419f2f4a32925639d80b06e0b"
>
deb6807ba2...ecf6f1b837
b263d9d594...9d80b06e0b
</a>
<small
Expand Down Expand Up @@ -766,7 +766,7 @@ exports[`Transactions Table > should render the \`TransactionsTable\` component
class="dusk-anchor dusk-anchor--on-surface transaction__link"
href="/some-base-path/transactions/transaction?id=b4525cb82f5cd56fcf8ceb2eb30f647d2c3567e82abb8265dd12daf5275d7709"
>
62fbd83edb...1b54a5ad89
b4525cb82f...f5275d7709
</a>
<small
Expand Down
22 changes: 11 additions & 11 deletions explorer/src/lib/components/block-details/BlockDetails.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -61,17 +61,6 @@
title="Block Details"
>
<dl class="block-details__list">
<!-- BLOCK HASH -->
<ListItem tooltipText="The hash for the header of the block">
<svelte:fragment slot="term">block hash</svelte:fragment>
<svelte:fragment slot="definition"
>{middleEllipsis(
data.header.hash,
calculateAdaptiveCharCount(screenWidth, 320, 1920, 14, 66)
)}</svelte:fragment
>
</ListItem>

<!-- HEIGHT -->
<ListItem
tooltipText="The height of the block indicates the length of the block chain and is increased with each additional block"
Expand All @@ -94,6 +83,17 @@
</svelte:fragment>
</ListItem>

<!-- BLOCK HASH -->
<ListItem tooltipText="The hash for the header of the block">
<svelte:fragment slot="term">hash</svelte:fragment>
<svelte:fragment slot="definition"
>{middleEllipsis(
data.header.hash,
calculateAdaptiveCharCount(screenWidth, 320, 1920, 14, 66)
)}</svelte:fragment
>
</ListItem>

<!-- TIMESTAMP -->
<ListItem tooltipText="The date and time the block was created">
<svelte:fragment slot="term">timestamp</svelte:fragment>
Expand Down
2 changes: 1 addition & 1 deletion explorer/src/lib/components/blocks-list/BlocksList.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<ListItem
tooltipText="The height of the block indicates the length of the block chain and is increased with each additional block"
>
<svelte:fragment slot="term"># block</svelte:fragment>
<svelte:fragment slot="term">block</svelte:fragment>
<svelte:fragment slot="definition"
><AppAnchor
className="block-details__list-link"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<Table className={classes}>
<TableHead>
<TableRow>
<TableCell type="th"># Block</TableCell>
<TableCell type="th">Block</TableCell>
<TableCell type="th">Fee</TableCell>
<TableCell type="th">Txn(s)</TableCell>
<TableCell type="th">Rewards</TableCell>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<DetailList>
<!-- TRANSACTION ID -->
<ListItem tooltipText="The ID of the transaction">
<svelte:fragment slot="term">Hash</svelte:fragment>
<svelte:fragment slot="term">ID</svelte:fragment>
<svelte:fragment slot="definition">
<AppAnchor
className="transaction-details__list-link"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<Table className={classes}>
<TableHead>
<TableRow>
<TableCell type="th">Hash</TableCell>
<TableCell type="th">ID</TableCell>
<TableCell type="th">Gas</TableCell>
<TableCell type="th">Fee</TableCell>
<TableCell type="th">Status</TableCell>
Expand All @@ -49,10 +49,7 @@
<AppAnchor
className="transaction__link"
href={`/transactions/transaction?id=${transaction.txid}`}
>{middleEllipsis(
transaction.blockhash,
HASH_CHARS_LENGTH
)}</AppAnchor
>{middleEllipsis(transaction.txid, HASH_CHARS_LENGTH)}</AppAnchor
>
<small class="transaction__time"
>{getRelativeTimeString(transaction.date, "long")}</small
Expand Down
Loading

0 comments on commit da11457

Please sign in to comment.