Merge pull request #3360 from poanetwork/vb-fix-tokens-dropdown-appearance

Fix tokens dropdown appearance
pull/3365/head
Victor Baranov 4 years ago committed by GitHub
commit dcf55533ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      CHANGELOG.md
  2. 2
      apps/block_scout_web/assets/js/pages/address.js
  3. 2
      apps/block_scout_web/assets/js/pages/admin/tasks.js
  4. 33
      apps/block_scout_web/test/block_scout_web/features/viewing_addresses_test.exs

@ -1,7 +1,7 @@
## Current ## Current
### Features ### Features
- [#2292](https://github.com/poanetwork/blockscout/pull/2292), [#3356](https://github.com/poanetwork/blockscout/pull/3356) - Add Web UI for POSDAO Staking DApp - [#2292](https://github.com/poanetwork/blockscout/pull/2292), [#3356](https://github.com/poanetwork/blockscout/pull/3356), [#3360](https://github.com/poanetwork/blockscout/pull/3360) - Add Web UI for POSDAO Staking DApp
- [#3354](https://github.com/poanetwork/blockscout/pull/3354) - Tx hash in EOA coin balance history - [#3354](https://github.com/poanetwork/blockscout/pull/3354) - Tx hash in EOA coin balance history
- [#3333](https://github.com/poanetwork/blockscout/pull/3333), [#3337](https://github.com/poanetwork/blockscout/pull/3337) - Dark forest contract custom theme - [#3333](https://github.com/poanetwork/blockscout/pull/3333), [#3337](https://github.com/poanetwork/blockscout/pull/3337) - Dark forest contract custom theme
- [#3330](https://github.com/poanetwork/blockscout/pull/3330) - Caching of address transactions counter, remove query 10_000 rows limit - [#3330](https://github.com/poanetwork/blockscout/pull/3330) - Caching of address transactions counter, remove query 10_000 rows limit

@ -72,7 +72,7 @@ export function reducer (state = initialState, action) {
let fetchedTokenBalanceBlockNumber = 0 let fetchedTokenBalanceBlockNumber = 0
function loadTokenBalance (blockNumber) { function loadTokenBalance (blockNumber) {
if (blockNumber > fetchedTokenBalanceBlockNumber) { if (blockNumber >= fetchedTokenBalanceBlockNumber) {
fetchedTokenBalanceBlockNumber = blockNumber fetchedTokenBalanceBlockNumber = blockNumber
setTimeout(loadTokenBalanceDropdown, 1000) setTimeout(loadTokenBalanceDropdown, 1000)
} }

@ -14,7 +14,7 @@ const runTask = (event) => {
$loading.show() $loading.show()
$.get(apiPath) $.get(apiPath)
.done(response => { .done(_response => {
$successMessage.show() $successMessage.show()
$loading.hide() $loading.hide()
}) })

@ -364,8 +364,13 @@ defmodule BlockScoutWeb.ViewingAddressesTest do
end end
test "filter tokens balances by token name", %{session: session, lincoln: lincoln} do test "filter tokens balances by token name", %{session: session, lincoln: lincoln} do
next =
session session
|> AddressPage.visit_page(lincoln) |> AddressPage.visit_page(lincoln)
Process.sleep(2_000)
next
|> AddressPage.click_balance_dropdown_toggle() |> AddressPage.click_balance_dropdown_toggle()
|> AddressPage.fill_balance_dropdown_search("ato") |> AddressPage.fill_balance_dropdown_search("ato")
|> assert_has(AddressPage.token_balance(count: 2)) |> assert_has(AddressPage.token_balance(count: 2))
@ -374,19 +379,29 @@ defmodule BlockScoutWeb.ViewingAddressesTest do
end end
# flaky test # flaky test
# test "filter token balances by token symbol", %{session: session, lincoln: lincoln} do test "filter token balances by token symbol", %{session: session, lincoln: lincoln} do
# session next =
# |> AddressPage.visit_page(lincoln) session
# |> AddressPage.click_balance_dropdown_toggle() |> AddressPage.visit_page(lincoln)
# |> AddressPage.fill_balance_dropdown_search("T2")
# |> assert_has(AddressPage.token_balance(count: 2)) Process.sleep(2_000)
# |> assert_has(AddressPage.token_type(count: 2))
# |> assert_has(AddressPage.token_type_count(type: "ERC-20", text: "1")) next
# end |> AddressPage.click_balance_dropdown_toggle()
|> AddressPage.fill_balance_dropdown_search("T2")
|> assert_has(AddressPage.token_balance(count: 2))
|> assert_has(AddressPage.token_type(count: 2))
|> assert_has(AddressPage.token_type_count(type: "ERC-20", text: "1"))
end
test "reset token balances filter when dropdown closes", %{session: session, lincoln: lincoln} do test "reset token balances filter when dropdown closes", %{session: session, lincoln: lincoln} do
next =
session session
|> AddressPage.visit_page(lincoln) |> AddressPage.visit_page(lincoln)
Process.sleep(2_000)
next
|> AddressPage.click_balance_dropdown_toggle() |> AddressPage.click_balance_dropdown_toggle()
|> AddressPage.fill_balance_dropdown_search("ato") |> AddressPage.fill_balance_dropdown_search("ato")
|> AddressPage.click_outside_of_the_dropdown() |> AddressPage.click_outside_of_the_dropdown()

Loading…
Cancel
Save