diff --git a/CHANGELOG.md b/CHANGELOG.md index 400a1754ef..289f674be3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,10 @@ - [#2266](https://github.com/poanetwork/blockscout/pull/2266) - allow excluding uncles from average block time calculation ### Fixes +- [#2284](https://github.com/poanetwork/blockscout/pull/2284) - add 404 status for not existing pages +- [#2244](https://github.com/poanetwork/blockscout/pull/2244) - fix internal transactions failing to be indexed because of constraint +- [#2281](https://github.com/poanetwork/blockscout/pull/2281) - typo issues, dropdown issues +- [#2278](https://github.com/poanetwork/blockscout/pull/2278) - increase threshold for scientific notation - [#2275](https://github.com/poanetwork/blockscout/pull/2275) - Description for networks selector - [#2263](https://github.com/poanetwork/blockscout/pull/2263) - added an ability to close network selector on outside click - [#2257](https://github.com/poanetwork/blockscout/pull/2257) - 'download csv' button added to different tabs @@ -60,8 +64,11 @@ - [#2167](https://github.com/poanetwork/blockscout/pull/2167) - feat: document eth rpc api mimicking endpoints - [#2225](https://github.com/poanetwork/blockscout/pull/2225) - fix metadata decoding in Solidity 0.5.9 smart contract verification - [#2204](https://github.com/poanetwork/blockscout/pull/2204) - fix large contract verification +- [#2258](https://github.com/poanetwork/blockscout/pull/2258) - reduce BlocksTransactionsMismatch memory footprint - [#2247](https://github.com/poanetwork/blockscout/pull/2247) - hide logs search if there are no logs - [#2248](https://github.com/poanetwork/blockscout/pull/2248) - sort block after query execution for average block time +- [#2249](https://github.com/poanetwork/blockscout/pull/2249) - More transaction controllers improvements +- [#2267](https://github.com/poanetwork/blockscout/pull/2267) - Modify implementation of `where_transaction_has_multiple_internal_transactions` - [#2270](https://github.com/poanetwork/blockscout/pull/2270) - Remove duplicate params in `Indexer.Fetcher.TokenBalance` - [#2268](https://github.com/poanetwork/blockscout/pull/2268) - remove not existing assigns in html code - [#2276](https://github.com/poanetwork/blockscout/pull/2276) - remove port in docs diff --git a/apps/block_scout_web/assets/css/_typography.scss b/apps/block_scout_web/assets/css/_typography.scss index 963b02e978..1d0a9403c0 100644 --- a/apps/block_scout_web/assets/css/_typography.scss +++ b/apps/block_scout_web/assets/css/_typography.scss @@ -73,8 +73,12 @@ textarea.form-control { } .contract-address { - border-bottom: 1px dashed currentColor; display: inline-block; + text-decoration: underline; + text-decoration-style: dashed; + &:hover { + text-decoration-style: none; + } } .text { diff --git a/apps/block_scout_web/assets/css/components/_network-selector.scss b/apps/block_scout_web/assets/css/components/_network-selector.scss index ad0864bf61..8c433f28c3 100644 --- a/apps/block_scout_web/assets/css/components/_network-selector.scss +++ b/apps/block_scout_web/assets/css/components/_network-selector.scss @@ -1,6 +1,7 @@ $network-selector-overlay-background: $modal-overlay-color !default; $network-selector-close-color: $primary !default; $network-selector-horizontal-padding: 28px; +$network-selector-horizontal-mobile-padding: 14px; $btn-network-selector-load-more-background: #fff !default; $btn-network-selector-load-more-color: $primary !default; $network-selector-search-input-color: #a3a9b5 !default; @@ -143,7 +144,10 @@ $network-selector-item-icon-dimensions: 30px !default; border-bottom: 1px solid $base-border-color; display: flex; flex-shrink: 0; - margin: 0 $network-selector-horizontal-padding; + margin: 0 $network-selector-horizontal-mobile-padding; + @media (min-width: 375px) { + margin: 0 $network-selector-horizontal-padding; + } } .network-selector-tab { @@ -277,7 +281,10 @@ $network-selector-item-icon-dimensions: 30px !default; flex-shrink: 1; min-height: 100px; overflow: auto; - padding: 0 $network-selector-horizontal-padding; + padding: 0 $network-selector-horizontal-mobile-padding; + @media (min-width: 375px) { + padding: 0 $network-selector-horizontal-padding; + } } .network-selector-load-more-container { diff --git a/apps/block_scout_web/assets/css/components/_tile.scss b/apps/block_scout_web/assets/css/components/_tile.scss index c10fa2f9b6..68b873334c 100644 --- a/apps/block_scout_web/assets/css/components/_tile.scss +++ b/apps/block_scout_web/assets/css/components/_tile.scss @@ -174,6 +174,11 @@ $tile-body-a-color: #5959d8 !default; .tile-body { a { color: $tile-body-a-color; + &:hover { + span { + text-decoration: underline; + } + } } } diff --git a/apps/block_scout_web/assets/css/components/_token-balance-dropdown.scss b/apps/block_scout_web/assets/css/components/_token-balance-dropdown.scss index 14c42a5ebb..0a458a7ba4 100644 --- a/apps/block_scout_web/assets/css/components/_token-balance-dropdown.scss +++ b/apps/block_scout_web/assets/css/components/_token-balance-dropdown.scss @@ -1,21 +1,61 @@ .token-balance-dropdown { - min-width: 14.375rem; + min-width: 10rem; margin-top: 1rem; - background-color: $gray-100; - box-shadow: 0 2px 3px 2px $gray-200; - border: none; + background-color: #fff; + + &.dropdown-menu { + border-radius: 4px !important; + box-shadow: 0 0.5rem 1rem rgba(202, 199, 226, .3) !important; + border: 1px solid #e2e5ec !important; + } .dropdown-items { overflow-y: auto; max-height: 18.5rem; - .dropdown-item:hover { - color: $white; + .dropdown-item { + &:hover { + color: $secondary; + } + .row:nth-child(2) { + p { + font-size: 12px; + opacity: .65; + } + } } } - &:after, - &:before { + .dropdown-header { + padding: 1.1rem 20px .9rem 20px; + font-size: 14px; + font-weight: 400; + } + + .dropdown-search-field { + height: 50px; + border: 1px solid #f5f6fa; + background-color: #f5f6fa; + outline: none !important; + font-size: 14px; + color: #828ba0; + font-weight: 300; + padding-left: 52px; + &::placeholder { + color: rgba(#828ba0, .5); + } + } + + .dropdown-search-icon { + left: 20px; + top: 50%; + margin-top: -8.5px; + path { + fill: #828ba0; + } + } + + &:after { bottom: 100%; right: 14%; border: solid transparent; @@ -26,8 +66,6 @@ } &:before { - border-bottom-color: $gray-100; - border-width: 0.5rem; - margin-left: -0.5rem; + display: none; } } diff --git a/apps/block_scout_web/assets/css/components/_transaction.scss b/apps/block_scout_web/assets/css/components/_transaction.scss index ae0fbf5c17..b8d7b82e39 100644 --- a/apps/block_scout_web/assets/css/components/_transaction.scss +++ b/apps/block_scout_web/assets/css/components/_transaction.scss @@ -27,19 +27,20 @@ margin-top: 30px; } .download-all-transactions-link { + display: inline-flex; + align-items: center; text-decoration: none; svg { position: relative; margin-left: 2px; top: -3px; + left: 3px; path { fill: $primary; } } &:hover { - span { - text-decoration: underline; - } + text-decoration: underline; } } } \ No newline at end of file diff --git a/apps/block_scout_web/assets/css/theme/_neutral_variables.scss b/apps/block_scout_web/assets/css/theme/_neutral_variables.scss index 8a0a62d26e..4033934dd6 100644 --- a/apps/block_scout_web/assets/css/theme/_neutral_variables.scss +++ b/apps/block_scout_web/assets/css/theme/_neutral_variables.scss @@ -64,4 +64,11 @@ $card-tab-active: $primary; // Badges $badge-neutral-color: $primary; $badge-neutral-background-color: rgba($primary, .1); -$api-text-monospace-color: $primary; \ No newline at end of file +$api-text-monospace-color: $primary; + +// Tokens dropdown +.token-balance-dropdown[aria-labelledby="dropdown-tokens"] { + .dropdown-items .dropdown-item:hover { + color: $primary !important; + } +} \ No newline at end of file diff --git a/apps/block_scout_web/assets/css/theme/_poa_variables.scss b/apps/block_scout_web/assets/css/theme/_poa_variables.scss index 8a0a62d26e..4033934dd6 100644 --- a/apps/block_scout_web/assets/css/theme/_poa_variables.scss +++ b/apps/block_scout_web/assets/css/theme/_poa_variables.scss @@ -64,4 +64,11 @@ $card-tab-active: $primary; // Badges $badge-neutral-color: $primary; $badge-neutral-background-color: rgba($primary, .1); -$api-text-monospace-color: $primary; \ No newline at end of file +$api-text-monospace-color: $primary; + +// Tokens dropdown +.token-balance-dropdown[aria-labelledby="dropdown-tokens"] { + .dropdown-items .dropdown-item:hover { + color: $primary !important; + } +} \ No newline at end of file diff --git a/apps/block_scout_web/assets/js/lib/currency.js b/apps/block_scout_web/assets/js/lib/currency.js index 9b7493f1ad..f0491661c2 100644 --- a/apps/block_scout_web/assets/js/lib/currency.js +++ b/apps/block_scout_web/assets/js/lib/currency.js @@ -18,7 +18,7 @@ function formatCurrencyValue (value, symbol) { if (value < 0.000001) return `${window.localized['Less than']} ${symbol}0.000001` if (value < 1) return `${symbol}${numeral(value).format('0.000000')}` if (value < 100000) return `${symbol}${numeral(value).format('0,0.00')}` - if (value > 1000000000) return `${symbol}${numeral(value).format('0.000e+0')}` + if (value > 1000000000000) return `${symbol}${numeral(value).format('0.000e+0')}` return `${symbol}${numeral(value).format('0,0')}` } diff --git a/apps/block_scout_web/lib/block_scout_web/controllers/block_transaction_controller.ex b/apps/block_scout_web/lib/block_scout_web/controllers/block_transaction_controller.ex index f54671e795..15b06f1edd 100644 --- a/apps/block_scout_web/lib/block_scout_web/controllers/block_transaction_controller.ex +++ b/apps/block_scout_web/lib/block_scout_web/controllers/block_transaction_controller.ex @@ -17,7 +17,7 @@ defmodule BlockScoutWeb.BlockTransactionController do Keyword.merge( [ necessity_by_association: %{ - :block => :required, + :block => :optional, [created_contract_address: :names] => :optional, [from_address: :names] => :required, [to_address: :names] => :optional diff --git a/apps/block_scout_web/lib/block_scout_web/controllers/page_not_found_controller.ex b/apps/block_scout_web/lib/block_scout_web/controllers/page_not_found_controller.ex index e453e5463b..7ea8fab254 100644 --- a/apps/block_scout_web/lib/block_scout_web/controllers/page_not_found_controller.ex +++ b/apps/block_scout_web/lib/block_scout_web/controllers/page_not_found_controller.ex @@ -3,6 +3,7 @@ defmodule BlockScoutWeb.PageNotFoundController do def index(conn, _params) do conn + |> put_status(:not_found) |> render("index.html") end end diff --git a/apps/block_scout_web/lib/block_scout_web/controllers/transaction_controller.ex b/apps/block_scout_web/lib/block_scout_web/controllers/transaction_controller.ex index b40e6988e0..1bedf97c1d 100644 --- a/apps/block_scout_web/lib/block_scout_web/controllers/transaction_controller.ex +++ b/apps/block_scout_web/lib/block_scout_web/controllers/transaction_controller.ex @@ -61,21 +61,16 @@ defmodule BlockScoutWeb.TransactionController do end def show(conn, %{"id" => id}) do - case Chain.string_to_transaction_hash(id) do - {:ok, transaction_hash} -> show_transaction(conn, id, Chain.hash_to_transaction(transaction_hash)) - :error -> conn |> put_status(422) |> render("invalid.html", transaction_hash: id) - end - end - - defp show_transaction(conn, id, {:error, :not_found}) do - conn |> put_status(404) |> render("not_found.html", transaction_hash: id) - end - - defp show_transaction(conn, id, {:ok, %Chain.Transaction{} = transaction}) do - if Chain.transaction_has_token_transfers?(transaction.hash) do - redirect(conn, to: transaction_token_transfer_path(conn, :index, id)) + with {:ok, transaction_hash} <- Chain.string_to_transaction_hash(id), + {:ok, %Chain.Transaction{} = transaction} <- Chain.hash_to_transaction(transaction_hash) do + if Chain.transaction_has_token_transfers?(transaction.hash) do + redirect(conn, to: transaction_token_transfer_path(conn, :index, id)) + else + redirect(conn, to: transaction_internal_transaction_path(conn, :index, id)) + end else - redirect(conn, to: transaction_internal_transaction_path(conn, :index, id)) + :error -> conn |> put_status(422) |> render("invalid.html", transaction_hash: id) + {:error, :not_found} -> conn |> put_status(404) |> render("not_found.html", transaction_hash: id) end end end diff --git a/apps/block_scout_web/lib/block_scout_web/controllers/transaction_internal_transaction_controller.ex b/apps/block_scout_web/lib/block_scout_web/controllers/transaction_internal_transaction_controller.ex index 7c24b8d3b9..159d144cdd 100644 --- a/apps/block_scout_web/lib/block_scout_web/controllers/transaction_internal_transaction_controller.ex +++ b/apps/block_scout_web/lib/block_scout_web/controllers/transaction_internal_transaction_controller.ex @@ -17,7 +17,8 @@ defmodule BlockScoutWeb.TransactionInternalTransactionController do necessity_by_association: %{ [created_contract_address: :names] => :optional, [from_address: :names] => :optional, - [to_address: :names] => :optional + [to_address: :names] => :optional, + [transaction: :block] => :optional } ], paging_options(params) diff --git a/apps/block_scout_web/lib/block_scout_web/controllers/transaction_raw_trace_controller.ex b/apps/block_scout_web/lib/block_scout_web/controllers/transaction_raw_trace_controller.ex index a73290faab..3d090e8a9b 100644 --- a/apps/block_scout_web/lib/block_scout_web/controllers/transaction_raw_trace_controller.ex +++ b/apps/block_scout_web/lib/block_scout_web/controllers/transaction_raw_trace_controller.ex @@ -19,15 +19,7 @@ defmodule BlockScoutWeb.TransactionRawTraceController do :token_transfers => :optional } ) do - options = [ - necessity_by_association: %{ - [created_contract_address: :names] => :optional, - [from_address: :names] => :optional, - [to_address: :names] => :optional - } - ] - - internal_transactions = Chain.transaction_to_internal_transactions(transaction, options) + internal_transactions = Chain.transaction_to_internal_transactions(transaction) render( conn, diff --git a/apps/block_scout_web/lib/block_scout_web/templates/address_token_balance/_token_balances.html.eex b/apps/block_scout_web/lib/block_scout_web/templates/address_token_balance/_token_balances.html.eex index de0215727c..100d4f0262 100644 --- a/apps/block_scout_web/lib/block_scout_web/templates/address_token_balance/_token_balances.html.eex +++ b/apps/block_scout_web/lib/block_scout_web/templates/address_token_balance/_token_balances.html.eex @@ -18,8 +18,10 @@