-
Notifications
You must be signed in to change notification settings - Fork 15
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
Adds pagination to repositories index #375
Conversation
- 'will_paginate' gem installation - new feature to test pagination Signed-off-by: DylanGuedes <[email protected]> Signed-off-by: MarcosDDourado <[email protected]>
ec9098b
to
f8749d4
Compare
This merge closes the issue #361 |
f8749d4
to
1d3e320
Compare
Pagination repositories finished Signed-off-by: Marcos Dourado <[email protected]> Signed-off-by: DylanGuedes <[email protected]>
1d3e320
to
39839eb
Compare
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" |
There was a problem hiding this comment.
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.
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) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
What is the current status of this PR? |
@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. |
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. |
@vitorbaraujo , would you talk to @DylanGuedes to the MES'2017 team proceed a new PR based on this PR? |
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