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

Adds pagination to repositories index #375

Closed

Conversation

marcosddourado
Copy link
Contributor

Adds will_paginate gem
Adds functional tests of pagination
Adds step definition to click on link based on its text
Adds will_paginate initializer to workaround repositories not being child of activerecord::base

- 'will_paginate' gem installation
- new feature to test pagination

Signed-off-by: DylanGuedes <[email protected]>
Signed-off-by: MarcosDDourado <[email protected]>
@marcosddourado marcosddourado force-pushed the pagination_repositories branch from ec9098b to f8749d4 Compare September 6, 2016 20:17
@DylanGuedes
Copy link
Contributor

This merge closes the issue #361

@marcosddourado marcosddourado force-pushed the pagination_repositories branch from f8749d4 to 1d3e320 Compare September 6, 2016 20:58
Pagination repositories finished

Signed-off-by: Marcos Dourado <[email protected]>
Signed-off-by: DylanGuedes <[email protected]>
@rafamanzo
Copy link
Member

Nicely done. Please rebase from master. This will require further improvement once the necessary API gets added into KalbroProcessor and KalibroClient (so the requests also can get paginated) as I've tlaked to @DylanGuedes last week on IRC.

And I have a public repository named "reposittory 10"
And I own that repository
And I am at the All Repositories page
Then I should see a div with class "pagination"
Copy link
Member

Choose a reason for hiding this comment

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

What do you think about expanding this in order to check if the correct repositories are at the correct pages? This implies in testing a second page as well.

@diegoamc
Copy link
Contributor

diegoamc commented Nov 5, 2016

ping @marcosddourado, @DylanGuedes

@@ -15,6 +15,8 @@ class RepositoriesController < ApplicationController

def index
@repositories = Repository.public_or_owned_by_user(current_user)

@repositories = @repositories.paginate(:page => params[:page], :per_page => 10)
Copy link
Contributor

Choose a reason for hiding this comment

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

Where does the :page param come from?

Copy link
Contributor

Choose a reason for hiding this comment

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

from the submit triggered when you click in the "will_paginate" button.

@vitorbaraujo
Copy link
Contributor

What is the current status of this PR?

@DylanGuedes
Copy link
Contributor

@vitorbaraujo here. We solved it in the naive way, so you can check how we did it for educational purposes, but the correct solution shouldn't use our solution.

@rafamanzo
Copy link
Member

This PR does not reduce the size of the data downloaded in a single request. If you want to keep working on this issue, please submit another PR.

@paulormm
Copy link

@vitorbaraujo , would you talk to @DylanGuedes to the MES'2017 team proceed a new PR based on this PR?

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.

6 participants