Unlimited number of tokens in search results

pull/3231/head
Victor Baranov 4 years ago
parent 9e75193257
commit 17f71985ea
  1. 1
      CHANGELOG.md
  2. 8
      apps/block_scout_web/assets/css/components/_navbar.scss
  3. 1
      apps/block_scout_web/lib/block_scout_web/templates/layout/_topnav.html.eex
  4. 2
      apps/block_scout_web/priv/gettext/default.pot
  5. 4
      apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po
  6. 2
      apps/explorer/lib/explorer/chain.ex

@ -5,6 +5,7 @@
- [#3224](https://github.com/poanetwork/blockscout/pull/3224) - Top tokens page - [#3224](https://github.com/poanetwork/blockscout/pull/3224) - Top tokens page
### Fixes ### Fixes
- [#3231](https://github.com/poanetwork/blockscout/pull/3231) - Improve search: unlimited number of searching results
- [#3231](https://github.com/poanetwork/blockscout/pull/3231) - Improve search: allow search with space - [#3231](https://github.com/poanetwork/blockscout/pull/3231) - Improve search: allow search with space
- [#3231](https://github.com/poanetwork/blockscout/pull/3231) - Improve search: order by token holders in descendant order - [#3231](https://github.com/poanetwork/blockscout/pull/3231) - Improve search: order by token holders in descendant order
- [#3226](https://github.com/poanetwork/blockscout/pull/3226) - Fix notifier query for live update of token transfers - [#3226](https://github.com/poanetwork/blockscout/pull/3226) - Fix notifier query for live update of token transfers

@ -186,6 +186,14 @@ $navbar-logo-width: auto !default;
} }
} }
.input-group {
.awesomplete > ul {
overflow-y: auto !important;
max-height: 300px !important;
}
}
.navbar-collapse.collapsing, .navbar-collapse.collapsing,
.navbar-collapse.collapse.show { .navbar-collapse.collapse.show {
display: flex; display: flex;

@ -174,6 +174,7 @@
], ],
[ url: "#{chain_path(@conn, :token_autocomplete)}?q=", [ url: "#{chain_path(@conn, :token_autocomplete)}?q=",
limit: 0, limit: 0,
maxItems: 1000,
minChars: 2, minChars: 2,
value: "contract_address_hash", value: "contract_address_hash",
label: "contract_address_hash", label: "contract_address_hash",

@ -1244,7 +1244,7 @@ msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/address_logs/index.html.eex:14 #: lib/block_scout_web/templates/address_logs/index.html.eex:14
#: lib/block_scout_web/templates/layout/_topnav.html.eex:172 #: lib/block_scout_web/templates/layout/_topnav.html.eex:172
#: lib/block_scout_web/templates/layout/_topnav.html.eex:189 #: lib/block_scout_web/templates/layout/_topnav.html.eex:190
msgid "Search" msgid "Search"
msgstr "" msgstr ""

@ -1244,7 +1244,7 @@ msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/address_logs/index.html.eex:14 #: lib/block_scout_web/templates/address_logs/index.html.eex:14
#: lib/block_scout_web/templates/layout/_topnav.html.eex:172 #: lib/block_scout_web/templates/layout/_topnav.html.eex:172
#: lib/block_scout_web/templates/layout/_topnav.html.eex:189 #: lib/block_scout_web/templates/layout/_topnav.html.eex:190
msgid "Search" msgid "Search"
msgstr "" msgstr ""
@ -1940,7 +1940,7 @@ msgstr ""
msgid "Copy Raw Trace" msgid "Copy Raw Trace"
msgstr "" msgstr ""
#, elixir-format, fuzzy #, elixir-format
#: lib/block_scout_web/templates/layout/_topnav.html.eex:170 #: lib/block_scout_web/templates/layout/_topnav.html.eex:170
msgid "Search by address, token symbol, name, transaction hash, or block number" msgid "Search by address, token symbol, name, transaction hash, or block number"
msgstr "" msgstr ""

@ -1043,7 +1043,6 @@ defmodule Explorer.Chain do
query = query =
from(token in Token, from(token in Token,
where: fragment("to_tsvector('english', symbol || ' ' || name ) @@ to_tsquery(?)", ^term_final), where: fragment("to_tsvector('english', symbol || ' ' || name ) @@ to_tsquery(?)", ^term_final),
limit: 5,
select: %{ select: %{
contract_address_hash: token.contract_address_hash, contract_address_hash: token.contract_address_hash,
symbol: token.symbol, symbol: token.symbol,
@ -1066,7 +1065,6 @@ defmodule Explorer.Chain do
query = query =
from(smart_contract in SmartContract, from(smart_contract in SmartContract,
where: fragment("to_tsvector('english', name ) @@ to_tsquery(?)", ^term_final), where: fragment("to_tsvector('english', name ) @@ to_tsquery(?)", ^term_final),
limit: 5,
select: %{contract_address_hash: smart_contract.address_hash, name: smart_contract.name} select: %{contract_address_hash: smart_contract.address_hash, name: smart_contract.name}
) )

Loading…
Cancel
Save