Merge pull request #4820 from blockscout/vb-fixate-address-fields

Pin address page's overview block rows
pull/4823/head
Victor Baranov 3 years ago committed by GitHub
commit 1d400cfe97
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      CHANGELOG.md
  2. 15
      apps/block_scout_web/assets/js/pages/address.js
  3. 5
      apps/block_scout_web/lib/block_scout_web/templates/address/overview.html.eex
  4. 20
      apps/block_scout_web/priv/gettext/default.pot
  5. 20
      apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po
  6. 2
      apps/block_scout_web/test/block_scout_web/controllers/address_controller_test.exs
  7. 4
      apps/explorer/lib/explorer/counters/address_gas_usage_counter.ex
  8. 4
      apps/explorer/lib/explorer/counters/address_token_transfers_counter.ex
  9. 4
      apps/explorer/lib/explorer/counters/address_transactions_counter.ex

@ -7,7 +7,7 @@
- [#4739](https://github.com/blockscout/blockscout/pull/4739) - Improve logs and inputs decoding - [#4739](https://github.com/blockscout/blockscout/pull/4739) - Improve logs and inputs decoding
- [#4747](https://github.com/blockscout/blockscout/pull/4747) - Advanced CSV export - [#4747](https://github.com/blockscout/blockscout/pull/4747) - Advanced CSV export
- [#4745](https://github.com/blockscout/blockscout/pull/4745) - Vyper contracts verification - [#4745](https://github.com/blockscout/blockscout/pull/4745) - Vyper contracts verification
- [#4699](https://github.com/blockscout/blockscout/pull/4699), [#4793](https://github.com/blockscout/blockscout/pull/4793) - Address page facelifting - [#4699](https://github.com/blockscout/blockscout/pull/4699), [#4793](https://github.com/blockscout/blockscout/pull/4793), [#4820](https://github.com/blockscout/blockscout/pull/4820) - Address page facelifting
- [#4667](https://github.com/blockscout/blockscout/pull/4667) - Transaction Page: Add expand/collapse button for long contract method data - [#4667](https://github.com/blockscout/blockscout/pull/4667) - Transaction Page: Add expand/collapse button for long contract method data
- [#4641](https://github.com/blockscout/blockscout/pull/4641), [#4733](https://github.com/blockscout/blockscout/pull/4733) - Improve Read Contract page logic - [#4641](https://github.com/blockscout/blockscout/pull/4641), [#4733](https://github.com/blockscout/blockscout/pull/4733) - Improve Read Contract page logic
- [#4660](https://github.com/blockscout/blockscout/pull/4660) - Save Sourcify path instead of filename - [#4660](https://github.com/blockscout/blockscout/pull/4660) - Save Sourcify path instead of filename

@ -121,11 +121,6 @@ const elements = {
if (oldState.transactionCount === state.transactionCount) return if (oldState.transactionCount === state.transactionCount) return
const transactionsDSName = (state.transactionCount > 1) ? ' Transactions' : ' Transaction' const transactionsDSName = (state.transactionCount > 1) ? ' Transactions' : ' Transaction'
$el.empty().append(numeral(state.transactionCount).format() + transactionsDSName) $el.empty().append(numeral(state.transactionCount).format() + transactionsDSName)
$el.show()
$('.address-transactions-count-item').removeAttr('style')
} else {
$el.hide()
$('.address-transactions-count-item').css('display', 'none')
} }
} }
}, },
@ -138,11 +133,6 @@ const elements = {
if (oldState.tokenTransferCount === state.tokenTransferCount) return if (oldState.tokenTransferCount === state.tokenTransferCount) return
const transfersDSName = (state.tokenTransferCount > 1) ? ' Transfers' : ' Transfer' const transfersDSName = (state.tokenTransferCount > 1) ? ' Transfers' : ' Transfer'
$el.empty().append(numeral(state.tokenTransferCount).format() + transfersDSName) $el.empty().append(numeral(state.tokenTransferCount).format() + transfersDSName)
$el.show()
$('.address-transfers-count-item').removeAttr('style')
} else {
$el.hide()
$('.address-transfers-count-item').css('display', 'none')
} }
} }
}, },
@ -154,11 +144,6 @@ const elements = {
if (state.countersFetched && state.gasUsageCount) { if (state.countersFetched && state.gasUsageCount) {
if (oldState.gasUsageCount === state.gasUsageCount) return if (oldState.gasUsageCount === state.gasUsageCount) return
$el.empty().append(numeral(state.gasUsageCount).format()) $el.empty().append(numeral(state.gasUsageCount).format())
$el.show()
$('.address-gas-used-item').removeAttr('style')
} else {
$el.hide()
$('.address-gas-used-item').css('display', 'none')
} }
} }
}, },

@ -205,9 +205,11 @@
<dd class="col-sm-8 col-md-8 col-lg-9" data-test="address_transaction_count"> <dd class="col-sm-8 col-md-8 col-lg-9" data-test="address_transaction_count">
<%= if @conn.request_path |> String.contains?("/transactions") do %> <%= if @conn.request_path |> String.contains?("/transactions") do %>
<a href="#txs" class="page-link bs-label large btn-no-border-link-to-tems" data-selector="transaction-count"> <a href="#txs" class="page-link bs-label large btn-no-border-link-to-tems" data-selector="transaction-count">
0 <%= gettext("Transactions") %>
</a> </a>
<% else %> <% else %>
<a href="<%= AccessHelpers.get_path(@conn, :address_transaction_path, :index, @address.hash)%>#txs" class="page-link bs-label large btn-no-border-link-to-tems" data-selector="transaction-count"> <a href="<%= AccessHelpers.get_path(@conn, :address_transaction_path, :index, @address.hash)%>#txs" class="page-link bs-label large btn-no-border-link-to-tems" data-selector="transaction-count">
0 <%= gettext("Transactions") %>
</a> </a>
<% end %> <% end %>
</dd> </dd>
@ -222,9 +224,11 @@
<dd class="col-sm-8 col-md-8 col-lg-9" data-test="address_transfer_count"> <dd class="col-sm-8 col-md-8 col-lg-9" data-test="address_transfer_count">
<%= if @conn.request_path |> String.contains?("/token-transfers") do %> <%= if @conn.request_path |> String.contains?("/token-transfers") do %>
<a href="#transfers" class="page-link bs-label large btn-no-border-link-to-tems" data-selector="transfer-count"> <a href="#transfers" class="page-link bs-label large btn-no-border-link-to-tems" data-selector="transfer-count">
0 <%= gettext("Transfers") %>
</a> </a>
<% else %> <% else %>
<a href="<%= AccessHelpers.get_path(@conn, :address_token_transfers_path, :index, @address.hash)%>#transfers" class="page-link bs-label large btn-no-border-link-to-tems" data-selector="transfer-count"> <a href="<%= AccessHelpers.get_path(@conn, :address_token_transfers_path, :index, @address.hash)%>#transfers" class="page-link bs-label large btn-no-border-link-to-tems" data-selector="transfer-count">
0 <%= gettext("Transfers") %>
</a> </a>
<% end %> <% end %>
</dd> </dd>
@ -238,6 +242,7 @@
</dt> </dt>
<dd class="col-sm-8 col-md-8 col-lg-9" data-test="address_gas_used"> <dd class="col-sm-8 col-md-8 col-lg-9" data-test="address_gas_used">
<span data-selector="gas-usage-count"> <span data-selector="gas-usage-count">
0
</span> </span>
</dd> </dd>
</dl> </dl>

@ -398,7 +398,7 @@ msgid "Block number containing the transaction."
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/address/overview.html.eex:249 #: lib/block_scout_web/templates/address/overview.html.eex:254
msgid "Block number in which the address was updated." msgid "Block number in which the address was updated."
msgstr "" msgstr ""
@ -420,7 +420,7 @@ msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/address/_tabs.html.eex:48 #: lib/block_scout_web/templates/address/_tabs.html.eex:48
#: lib/block_scout_web/templates/address/overview.html.eex:266 lib/block_scout_web/templates/address_validation/index.html.eex:15 #: lib/block_scout_web/templates/address/overview.html.eex:271 lib/block_scout_web/templates/address_validation/index.html.eex:15
#: lib/block_scout_web/views/address_view.ex:356 #: lib/block_scout_web/views/address_view.ex:356
msgid "Blocks Validated" msgid "Blocks Validated"
msgstr "" msgstr ""
@ -1176,7 +1176,7 @@ msgid "Gas Price"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/address/overview.html.eex:237 #: lib/block_scout_web/templates/address/overview.html.eex:241
#: lib/block_scout_web/templates/block/_tile.html.eex:73 lib/block_scout_web/templates/block/overview.html.eex:172 #: lib/block_scout_web/templates/block/_tile.html.eex:73 lib/block_scout_web/templates/block/overview.html.eex:172
msgid "Gas Used" msgid "Gas Used"
msgstr "" msgstr ""
@ -1187,8 +1187,8 @@ msgid "Gas Used by Transaction"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/address/overview.html.eex:236 #: lib/block_scout_web/templates/address/overview.html.eex:240
#: lib/block_scout_web/templates/address/overview.html.eex:265 #: lib/block_scout_web/templates/address/overview.html.eex:270
msgid "Gas used by the address." msgid "Gas used by the address."
msgstr "" msgstr ""
@ -1345,7 +1345,7 @@ msgid "JSON RPC error"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/address/overview.html.eex:250 #: lib/block_scout_web/templates/address/overview.html.eex:255
msgid "Last Balance Update" msgid "Last Balance Update"
msgstr "" msgstr ""
@ -1647,7 +1647,7 @@ msgid "Number of transactions related to this address."
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/address/overview.html.eex:219 #: lib/block_scout_web/templates/address/overview.html.eex:221
msgid "Number of transfers to/from this address." msgid "Number of transfers to/from this address."
msgstr "" msgstr ""
@ -2677,7 +2677,8 @@ msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/address/_tabs.html.eex:7 #: lib/block_scout_web/templates/address/_tabs.html.eex:7
#: lib/block_scout_web/templates/address/overview.html.eex:203 lib/block_scout_web/templates/address_transaction/index.html.eex:17 #: lib/block_scout_web/templates/address/overview.html.eex:203 lib/block_scout_web/templates/address/overview.html.eex:208
#: lib/block_scout_web/templates/address/overview.html.eex:212 lib/block_scout_web/templates/address_transaction/index.html.eex:17
#: lib/block_scout_web/templates/block/overview.html.eex:74 lib/block_scout_web/templates/block_transaction/index.html.eex:10 #: lib/block_scout_web/templates/block/overview.html.eex:74 lib/block_scout_web/templates/block_transaction/index.html.eex:10
#: lib/block_scout_web/templates/chain/show.html.eex:236 lib/block_scout_web/templates/layout/_topnav.html.eex:41 #: lib/block_scout_web/templates/chain/show.html.eex:236 lib/block_scout_web/templates/layout/_topnav.html.eex:41
#: lib/block_scout_web/views/address_view.ex:347 #: lib/block_scout_web/views/address_view.ex:347
@ -2695,7 +2696,8 @@ msgid "Transactions sent"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/address/overview.html.eex:220 #: lib/block_scout_web/templates/address/overview.html.eex:222
#: lib/block_scout_web/templates/address/overview.html.eex:227 lib/block_scout_web/templates/address/overview.html.eex:231
#: lib/block_scout_web/templates/tokens/instance/overview/_details.html.eex:50 #: lib/block_scout_web/templates/tokens/instance/overview/_details.html.eex:50
msgid "Transfers" msgid "Transfers"
msgstr "" msgstr ""

@ -398,7 +398,7 @@ msgid "Block number containing the transaction."
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/address/overview.html.eex:249 #: lib/block_scout_web/templates/address/overview.html.eex:254
msgid "Block number in which the address was updated." msgid "Block number in which the address was updated."
msgstr "" msgstr ""
@ -420,7 +420,7 @@ msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/address/_tabs.html.eex:48 #: lib/block_scout_web/templates/address/_tabs.html.eex:48
#: lib/block_scout_web/templates/address/overview.html.eex:266 lib/block_scout_web/templates/address_validation/index.html.eex:15 #: lib/block_scout_web/templates/address/overview.html.eex:271 lib/block_scout_web/templates/address_validation/index.html.eex:15
#: lib/block_scout_web/views/address_view.ex:356 #: lib/block_scout_web/views/address_view.ex:356
msgid "Blocks Validated" msgid "Blocks Validated"
msgstr "" msgstr ""
@ -1176,7 +1176,7 @@ msgid "Gas Price"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/address/overview.html.eex:237 #: lib/block_scout_web/templates/address/overview.html.eex:241
#: lib/block_scout_web/templates/block/_tile.html.eex:73 lib/block_scout_web/templates/block/overview.html.eex:172 #: lib/block_scout_web/templates/block/_tile.html.eex:73 lib/block_scout_web/templates/block/overview.html.eex:172
msgid "Gas Used" msgid "Gas Used"
msgstr "" msgstr ""
@ -1187,8 +1187,8 @@ msgid "Gas Used by Transaction"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/address/overview.html.eex:236 #: lib/block_scout_web/templates/address/overview.html.eex:240
#: lib/block_scout_web/templates/address/overview.html.eex:265 #: lib/block_scout_web/templates/address/overview.html.eex:270
msgid "Gas used by the address." msgid "Gas used by the address."
msgstr "" msgstr ""
@ -1345,7 +1345,7 @@ msgid "JSON RPC error"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/address/overview.html.eex:250 #: lib/block_scout_web/templates/address/overview.html.eex:255
msgid "Last Balance Update" msgid "Last Balance Update"
msgstr "" msgstr ""
@ -1647,7 +1647,7 @@ msgid "Number of transactions related to this address."
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/address/overview.html.eex:219 #: lib/block_scout_web/templates/address/overview.html.eex:221
msgid "Number of transfers to/from this address." msgid "Number of transfers to/from this address."
msgstr "" msgstr ""
@ -2677,7 +2677,8 @@ msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/address/_tabs.html.eex:7 #: lib/block_scout_web/templates/address/_tabs.html.eex:7
#: lib/block_scout_web/templates/address/overview.html.eex:203 lib/block_scout_web/templates/address_transaction/index.html.eex:17 #: lib/block_scout_web/templates/address/overview.html.eex:203 lib/block_scout_web/templates/address/overview.html.eex:208
#: lib/block_scout_web/templates/address/overview.html.eex:212 lib/block_scout_web/templates/address_transaction/index.html.eex:17
#: lib/block_scout_web/templates/block/overview.html.eex:74 lib/block_scout_web/templates/block_transaction/index.html.eex:10 #: lib/block_scout_web/templates/block/overview.html.eex:74 lib/block_scout_web/templates/block_transaction/index.html.eex:10
#: lib/block_scout_web/templates/chain/show.html.eex:236 lib/block_scout_web/templates/layout/_topnav.html.eex:41 #: lib/block_scout_web/templates/chain/show.html.eex:236 lib/block_scout_web/templates/layout/_topnav.html.eex:41
#: lib/block_scout_web/views/address_view.ex:347 #: lib/block_scout_web/views/address_view.ex:347
@ -2695,7 +2696,8 @@ msgid "Transactions sent"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/address/overview.html.eex:220 #: lib/block_scout_web/templates/address/overview.html.eex:222
#: lib/block_scout_web/templates/address/overview.html.eex:227 lib/block_scout_web/templates/address/overview.html.eex:231
#: lib/block_scout_web/templates/tokens/instance/overview/_details.html.eex:50 #: lib/block_scout_web/templates/tokens/instance/overview/_details.html.eex:50
msgid "Transfers" msgid "Transfers"
msgstr "" msgstr ""

@ -89,7 +89,7 @@ defmodule BlockScoutWeb.AddressControllerTest do
"transaction_count" => 0, "transaction_count" => 0,
"token_transfer_count" => 0, "token_transfer_count" => 0,
"validation_count" => 0, "validation_count" => 0,
"gas_usage_count" => 0, "gas_usage_count" => nil,
"crc_total_worth" => "0" "crc_total_worth" => "0"
} == } ==
response response

@ -48,9 +48,7 @@ defmodule Explorer.Counters.AddressTransactionsGasUsageCounter do
def fetch(address) do def fetch(address) do
if cache_expired?(address) do if cache_expired?(address) do
Task.start_link(fn -> update_cache(address)
update_cache(address)
end)
end end
address_hash_string = get_address_hash_string(address) address_hash_string = get_address_hash_string(address)

@ -48,9 +48,7 @@ defmodule Explorer.Counters.AddressTokenTransfersCounter do
def fetch(address) do def fetch(address) do
if cache_expired?(address) do if cache_expired?(address) do
Task.start_link(fn -> update_cache(address)
update_cache(address)
end)
end end
address_hash_string = get_address_hash_string(address) address_hash_string = get_address_hash_string(address)

@ -48,9 +48,7 @@ defmodule Explorer.Counters.AddressTransactionsCounter do
def fetch(address) do def fetch(address) do
if cache_expired?(address) do if cache_expired?(address) do
Task.start_link(fn -> update_cache(address)
update_cache(address)
end)
end end
address_hash_string = get_address_hash_string(address) address_hash_string = get_address_hash_string(address)

Loading…
Cancel
Save