-
Notifications
You must be signed in to change notification settings - Fork 90
pfTableView with pfPagination #527
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
Conversation
The pagination bar doesn't seem to right align correctly. Though, neither does the toolbar. |
expect(angular.element(element.find('.pagination-pf-items-total')).text().trim()).toBe('7'); | ||
expect(angular.element(element.find('.pagination-pf-page')).val().trim()).toBe('2'); | ||
expect(angular.element(element.find('.pagination-pf-pages')).text().trim()).toBe('4'); | ||
}); |
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.
Please add tests to make sure updatePageSize and updatePageNumber functions are called correctly when appropriate.
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.
Hi, do you mean with spy functions, or test changing the pageSize and pageNumber controls and getting the expected HTML?
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.
Spy functions work, or just by saving the parameters and checking the values after. Similar to
and
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.
Did both, fixed
src/table/table.less
Outdated
@@ -27,6 +27,11 @@ table.dataTable { | |||
} | |||
} | |||
tbody { | |||
tr.selected { | |||
span a { | |||
color: white; |
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.
use @color-pf-white
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.
Fixed
@@ -131,11 +146,22 @@ angular.module('patternfly.pagination').component('pfPagination', { | |||
|
|||
ctrl.getEndIndex = function () { | |||
var numFullPages = Math.floor(ctrl.numTotalItems / ctrl.pageSize); | |||
var numItemsOnLastPage = ctrl.numTotalItems - (numFullPages * ctrl.pageSize); | |||
var numItemsOnLastPage = ctrl.numTotalItems - (numFullPages * ctrl.pageSize) || ctrl.pageSize; | |||
var numItemsOnPage = isLastPage() ? numItemsOnLastPage : ctrl.pageSize; | |||
return ctrl.getStartIndex() + numItemsOnPage - 1; |
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.
If there are no items, this value would incorrectly be pageSize - 1.
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.
Fixed, although when I put items = [], I didn't get -1, I got '1-10' for an empty first page. Now it reads "0-0".
bb888e5
to
4433340
Compare
Hi @jeff-phillips-18, @cdcabrera, Does this PR warrant a Major version change since it has breaking changes? pfTableView won't work after this PR until end-users update their |
@dtaylor113 I would concur, breaking change equals major increment Edit: @dtaylor113 are we going to need to release package this change immediately, or is it something we can package with bug fixes? |
@cdcabrera This is an enhancement which OpenShift will "eventually" need, but it is not immediate. @serenamarie125 do you know when OpenShift will want pfTableView w/ pagination? |
I’d say keep it to a minor release. It won’t be worse than now if the application doesn't update the dependency, it will just use the old dependency and still have the bug. If the application is using wiredep, then all should be good. |
So, v4.3.0 ? (current is v4.2.0) |
Hi, so can this be merged? |
lgtm |
Integration of pfPagination controls into pfTableView
Updated ngDocs:

@akieling