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

[RFR] Refactor datagrid pagination #298

Merged
merged 8 commits into from
Mar 2, 2015
Merged

[RFR] Refactor datagrid pagination #298

merged 8 commits into from
Mar 2, 2015

Conversation

jpetitcolas
Copy link
Contributor

  • Make pagination directive isolated from $location
  • Add link to first and last page
  • Use default Bootstrap markup for pagination
  • Add some tests on datagrid pagination directive
  • Fix pagination issue when too many pages (see the style of pagination controls #296)
  • Separate infinite pagination and normal pagination into 2 directives
  • Move click on page link action to the caller (listController) and pass it as a parameter

Here is how the pagination nav looks for a 9 page list:

at page 1:   1 2 … 9 Next »
at page 2:   « Prev 1 2 3 … 9 Next »
at page 3:   « Prev 1 2 3 4 … 9 Next »
at page 4:   « Prev 1 2 3 4 5 … 9 Next »
at page 5:   « Prev 1 … 4 5 6 … 9 Next »
at page 6:   « Prev 1 … 5 6 7 8 9 Next »
at page 7:   « Prev 1 … 6 7 8 9 Next »
at page 8:   « Prev 1 … 7 8 9 Next »
at page 9:   « Prev 1 … 8 9

expect(totalElement.innerText.trim()).toBe('No record found.');
});

it('should display item range displayed', function() {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Review description label

Copy link
Member

Choose a reason for hiding this comment

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

"it should display the content range currently displayed"

@fzaninotto
Copy link
Member

Missing:

  • it should display prev page except on the first one
  • it should display next page except on the last one

scope.infinite = true;
});

it('should not be displayed if pagination is infinite', function() {
Copy link
Member

Choose a reason for hiding this comment

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

Well, that's a problem in fact. It's not related with this PR, but infinite pagination hides the total number of results. We need to solve this in the UI.

@fzaninotto
Copy link
Member

Any progress?

@fzaninotto fzaninotto changed the title [WIP] Bootstrap tests on datagrid pagination [RFR] Refactor datagrid pagination Mar 1, 2015
@fzaninotto
Copy link
Member

Switching to RFR

@@ -1,12 +0,0 @@
<div ng-if="!paginationCtrl.infinite">
Copy link
Member

Choose a reason for hiding this comment

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

renamed to maDatagridPagination

jpetitcolas added a commit that referenced this pull request Mar 2, 2015
[RFR] Refactor datagrid pagination
@jpetitcolas jpetitcolas merged commit 4962426 into master Mar 2, 2015
@jpetitcolas jpetitcolas deleted the pagination_test branch March 2, 2015 13:41
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.

2 participants