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

feat(paginator): Add functionality to jump to first and last page #9603

Merged
merged 1 commit into from
Jan 31, 2018

Conversation

lharries
Copy link
Contributor

@lharries lharries commented Jan 25, 2018

Add two buttons which allow you to jump to the first and last page.
Hidden by default and can be toggled with showHideFirstButtons

Fixes #9278, contains the following fixes and is therefore blocked by: #9597 and #9604 (and therefore also #9584)

@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Jan 25, 2018
Copy link
Member

@jelbourn jelbourn left a comment

Choose a reason for hiding this comment

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

LGTM, great PR.

Will leave final review to @andrewseguin

[disabled]="!hasPreviousPage()"
*ngIf="showFirstLastButtons">
<div class="mat-paginator-first"></div>
<div class="mat-paginator-decrement"></div>
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: indentation with these 2 divs is inconsistent with the rest

Copy link
Contributor

@andrewseguin andrewseguin left a comment

Choose a reason for hiding this comment

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

Great job, thanks for adding this feature and following the right styles/structure! We would definitely welcome any more quality contributions with any other bugs and features in the library :)

Just one nit about the demo app, and Will's indent comment.

After responding to those two comments, just add a comment and we can add the merge: ready label

@princemaple
Copy link
Contributor

princemaple commented Jan 25, 2018

@andrewseguin did you forget to leave your nit comment? I only see one comment above (you mentioned "two") and no rebases have been performed.

(random guy reading through PRs everyday)

@lharries
Copy link
Contributor Author

lharries commented Jan 26, 2018

Thanks very much @andrewseguin!

Good spot @willshowell I'll have fixed that now.

@andrewseguin what is the nit for the demo app and how should I fix it?

I have brought the branch up to speed, however, I believe it is still blocked by #9597?

PS Thanks very much @andrewseguin for guiding me, you've made it really easy to submit the PR

@lharries lharries force-pushed the paginator-first-last-buttons branch from e3b27dc to c6fdd9e Compare January 26, 2018 10:58
Copy link
Contributor

@andrewseguin andrewseguin left a comment

Choose a reason for hiding this comment

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

Whoops, looks like my review didn't get sent out, just one small comment about the demo

(toggleColorColumn)="toggleColorColumn()">
</table-header-demo>

<mat-table [dataSource]="dataSource" [trackBy]="userTrackBy">
Copy link
Contributor

Choose a reason for hiding this comment

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

Since the data source for this table doesn't update with the paginator, we can go ahead and just remove it. Maybe replace it with a JSON text of the latest paginator output?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

image

How about this?

@andrewseguin
Copy link
Contributor

Also, if you can fit in a similar change as #9629, that'd be helpful. Right now the inputs require a boolean or "true" when they really should be set to true just by being present as attributes

@lharries
Copy link
Contributor Author

image

@lharries lharries force-pushed the paginator-first-last-buttons branch from 28fa11e to 25be196 Compare January 27, 2018 12:14
@lharries
Copy link
Contributor Author

Completed the nits, however I believe it's still blocked by #9597

Add two buttons which allow you to jump to the first and last page.
Hidden by default and can be toggled with showHideFirstButtons

Fixes angular#9278
@lharries lharries force-pushed the paginator-first-last-buttons branch from 25be196 to fa07f14 Compare January 27, 2018 14:23
@lharries
Copy link
Contributor Author

lharries commented Jan 27, 2018

Any thoughts on why the travis-ci failed?

@andrewseguin
Copy link
Contributor

No issues, just a flaky test. I re-ran and you're good to go.

Next steps will be running this against some internal tests at Google to make sure nothing breaks. I don't expect any issues. We'll do the same with #9597. Ideally we can get them in this week

@lharries
Copy link
Contributor Author

Awesome!

@andrewseguin andrewseguin added the action: merge The PR is ready for merge by the caretaker label Jan 29, 2018
@tinayuangao
Copy link
Contributor

@andrewseguin please add release label for this pr.

@bitbeter
Copy link

bitbeter commented Mar 3, 2018

There is a bug in rtl mode in this feature. Please fix it. Thank you 😘😅
screen shot 1396-12-12 at 15 28 17

@lharries
Copy link
Contributor Author

lharries commented Mar 3, 2018

@bitbeter @crisbeto has replaced the CCS icons with SVG elements in #9776 which should fix it for you!

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker cla: yes PR author has agreed to Google's Contributor License Agreement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Paginator] Add functionality to jump to first and last page
8 participants