Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(Feature) New pagination view #1928

Merged
merged 18 commits into from
May 14, 2019
Merged

Conversation

gabitoesmiapodo
Copy link
Contributor

Closes #1893

Motivation

Pagination styles need to be updated according to this design:

Screen Shot 2019-05-10 at 16 33 20

This is obviously missing some logic which the design shows but it's absent from the current implementation:

  • First and Last buttons.
  • Page 1 of X needs to calculate the value for X.
  • Show XXXX Records, amount of items to show should be implemented too (this can be hidden using a parameter).

Sections including the pagination component:

  • Blocks / Uncles / Forked.
  • Transactions Validated / Pending.
  • Accounts.

Screenshots

(Colors will obviously be different depending on your current theme)

Screen Shot 2019-05-10 at 16 30 21
Screen Shot 2019-05-10 at 16 30 30
Screen Shot 2019-05-10 at 16 30 53

Changelog

Enhancements

  • Pagination styles were updated.

Checklist for your PR

  • I added an entry to CHANGELOG.md with this PR
  • If I added new functionality, I added tests covering it.
  • If I fixed a bug, I added a regression test to prevent the bug from silently reappearing again.
  • I checked whether I should update the docs and did so if necessary

@gabitoesmiapodo gabitoesmiapodo self-assigned this May 10, 2019
@ghost ghost added the in progress label May 10, 2019
@coveralls
Copy link

coveralls commented May 10, 2019

Pull Request Test Coverage Report for Build d3280b17-3fe5-4fcf-b9d2-c87162fd1601

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 6 unchanged lines in 3 files lost coverage.
  • Overall coverage decreased (-0.07%) to 81.753%

Files with Coverage Reduction New Missed Lines %
apps/indexer/lib/indexer/fetcher/token.ex 1 78.57%
apps/indexer/lib/indexer/fetcher/token_balance.ex 2 87.1%
apps/indexer/lib/indexer/block/fetcher.ex 3 86.57%
Totals Coverage Status
Change from base Build f74b48aa-2a4d-4b9b-a26a-7397911f0ef5: -0.07%
Covered Lines: 4646
Relevant Lines: 5683

💛 - Coveralls

@ayrat555
Copy link
Contributor

Page 1 of undefined is it ok?

Also, if there are no blocks should we show navigation buttons?

</svg>
</a>
</li>
<li class="page-item"><a class="page-link no-hover" href><%= gettext "Page" %> <%= assigns[:cur_page_number] || "" %> <%= gettext "of" %> <%= assigns[:total_pages_number] || "undefined" %></a></li>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we should show only current page if there is no total_pages_number instead of of undefined

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

I think everything else will be addressed in #1930

Copy link
Member

@vbaranov vbaranov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gabitoesmiapodo

The pagination view looks good to me. Meanwhile, I guess, there are some changes should be done before merging this:

  1. The old pagination messages like this Showing 10 Validated Transactions or Showing 50 addresses of 0 total addresses with a balance (page 1) should be removed as it is implemented in the new pagination view.

  2. Could we display pagination buttons in the mobile view aligned to the center of the screen (see the screenshot below)?

  3. As you correctly mentioned there are some new buttons and missing logic for new pagination. And I created a separate issue to fill those missing parts of the logic Implement logic for new advanced pagination functionality #1930. In the meantime, the logic for left/right pagination buttons exists in the current pagination, but it wasn't ported to the new pagination buttons. Could you return it? Because for now, pagination is rather a mockup.

Screenshot 2019-05-13 at 11 37 59

@vbaranov
Copy link
Member

@gabitoesmiapodo

In addition, we have pagination buttons for transactions list on address details page like this: https://blockscout.com/poa/core/address/0xc76815f3815614f10b78dfe94185e86d9f5250c5/transactions. We should also use new pagination here.

@vbaranov
Copy link
Member

@gabitoesmiapodo

plus, we should have the same pagination for transactions in the block details page. For example, here https://blockscout.com/eth/mainnet/blocks/7751624/transactions

@gabitoesmiapodo
Copy link
Contributor Author

@vbaranov

As you correctly mentioned there are some new buttons and missing logic for new pagination. And I created a separate issue to fill those missing parts of the logic #1930. In the meantime, the logic for left/right pagination buttons exists in the current pagination, but it wasn't ported to the new pagination buttons. Could you return it? Because for now, pagination is rather a mockup.

I didn't get that part, could you please clarify?

Working on fixing everything else.

@vbaranov
Copy link
Member

@gabitoesmiapodo

As you correctly mentioned there are some new buttons and missing logic for new pagination. And I created a separate issue to fill those missing parts of the logic #1930. In the meantime, the logic for left/right pagination buttons exists in the current pagination, but it wasn't ported to the new pagination buttons. Could you return it? Because for now, pagination is rather a mockup.

I didn't get that part, could you please clarify?

Sure, I mean, in the current pagination (that we would like to update) we already have implemented left|right buttons and logic for them:

Screenshot 2019-05-13 at 14 08 46

And that logic has been removed from the new left|right buttons (that are from this PR). Could we return that logic to those buttons before merging?

@gabitoesmiapodo
Copy link
Contributor Author

@vbaranov

Oh, sure.

I thought that I've left that working, but it seems it's not.

* master:
  Update CHANGELOG.md
  Update sokol_logo.svg
  Update kovan_logo.svg
  Update _sokol_variables.scss
  Update _kovan_variables.scss

# Conflicts:
#	CHANGELOG.md
@vbaranov
Copy link
Member

@gabitoesmiapodo

in addition, the same pagination should be on the address details page for

@gabitoesmiapodo
Copy link
Contributor Author

gabitoesmiapodo commented May 13, 2019

@vbaranov

The old pagination messages like this Showing 10 Validated Transactions or Showing 50 addresses of 0 total addresses with a balance (page 1) should be removed as it is implemented in the new pagination view.

Removed all text.

Could we display pagination buttons in the mobile view aligned to the center of the screen (see the screenshot below)?

Done.

As you correctly mentioned there are some new buttons and missing logic for new pagination. And I created a separate issue to fill those missing parts of the logic #1930. In the meantime, the logic for left/right pagination buttons exists in the current pagination, but it wasn't ported to the new pagination buttons. Could you return it? Because for now, pagination is rather a mockup.

in addition, the same pagination should be on the address details page for

I've only found the combination Back / Next on the Accounts section. Seems to be working now, but it is disabled if there's no back or next page.

I've replaced the pagination in every other section too, but in those cases there was only an Older or Next button. In that case, it's going to be replaced by the > button until its implementation is updated.

@gabitoesmiapodo gabitoesmiapodo requested review from vbaranov and ayrat555 and removed request for ayrat555 May 13, 2019 21:58
Copy link
Member

@vbaranov vbaranov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gabitoesmiapodo

Could we display pagination buttons in the mobile view aligned to the center of the screen (see the screenshot below)?

Done.

Could we change the paddings for <> buttons to nail them to the left and right sides as shown on the screenshot from my previous review? This request is only for the mobile view.

I've replaced the pagination in every other section too, but in those cases there was only an Older or Next button. In that case, it's going to be replaced by the > button until its implementation is updated.

I see now that the pagination buttons work for Accounts page, but could we also return the logic to the > button, which is instead of Older or Next button?

* master:
  feat: add on demand fetching and stale attr to rpc
  Add CHANGELOG entry
  check presence of overlap[i]
@gabitoesmiapodo
Copy link
Contributor Author

@vbaranov

Could we change the paddings for...

Sure, done. It should look like this:

Screen Shot 2019-05-14 at 08 50 23

I see now that the pagination buttons work for Accounts page, but could we also return the logic to the > button, which is instead of Older or Next button?

Not sure if I follow.

For the "Accounts" section there were only Back and Next buttons. Those were converted to < and > now.

For the rest of the pages I only found one Older (or Next) isolated button, which is now the > button.

These buttons are disabled when there's nothing to paginate (@prev_page_path / @next_page_path are null, etc.), but they could be hidden instead.

So, the functionality should be there (unless I screwed something up, which could be the case).

Maybe I inadvertently removed some other functionality?

@vbaranov
Copy link
Member

@gabitoesmiapodo

I am trying to open blocks page, transactions page or other pages with pagination from your PR. On those pages, we have currently in the prod Older or Next buttons, and they work fine in the prod. When I open those pages from this PR, > button is always disabled. Please, try it locally.

@gabitoesmiapodo
Copy link
Contributor Author

@vbaranov

Got it now, thank you.

It should work as before now, warts and all. Notice that the button will be disabled once there are no more pages, and there's no current way to go back.

next

@vbaranov
Copy link
Member

@gabitoesmiapodo yes, seems, pagination buttons work now. The last thing I forgot to mention in the previous review is:

Screenshot 2019-05-14 at 12 43 05

we should move the top pagination below the chart because the cart is not responsive on changing pages. It shows the whole data.

@gabitoesmiapodo
Copy link
Contributor Author

@vbaranov

Done.

@vbaranov vbaranov self-requested a review May 14, 2019 15:40
@vbaranov vbaranov merged commit 93c67bf into master May 14, 2019
@vbaranov vbaranov deleted the feature/#1893-new-pagination-view branch May 14, 2019 15:51
@ghost ghost removed the in progress label May 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

New pagination view
4 participants