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

nsc-events-nextjs-6-288-home-page-events-pagination #302

Merged
merged 14 commits into from
May 10, 2024

Conversation

cshimm
Copy link
Contributor

@cshimm cshimm commented Apr 30, 2024

Note: This branch depends on SeattleColleges/nsc-events-nestjs#110. Until it is merged to main, please make sure to checkout branch bug-110-remove-duplicate-get-handler in the nsc-events-nestjs repo before testing this feature.

Resolves #288

A "Load more events" button has been added and on click, 5 new events will be loaded until the end of the events list has been reached. When all of the events have been rendered, the Load More Events button will not be rendered anymore.
image

Video demonstrating pagination both logged in and logged out:

2024-04-29.23-10-19.mp4

@taylorpapke taylorpapke self-requested a review April 30, 2024 09:12
taylorpapke
taylorpapke previously approved these changes Apr 30, 2024
Copy link
Contributor

@taylorpapke taylorpapke left a comment

Choose a reason for hiding this comment

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

Works for me while logged in and out. It loads up to 5 more events every time I click the button:
Screenshot 2024-04-30 at 2 11 43 AM

@cshimm cshimm marked this pull request as ready for review April 30, 2024 17:19
@cshimm cshimm requested a review from a team as a code owner April 30, 2024 17:19
@cshimm cshimm requested review from bcko, Exochos, Seiyaroo, tinpham5614, heosman, brinkbrink and Robel-003 and removed request for a team April 30, 2024 17:19
IsaacJrTypes
IsaacJrTypes previously approved these changes Apr 30, 2024
Copy link
Contributor

@IsaacJrTypes IsaacJrTypes left a comment

Choose a reason for hiding this comment

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

Looks good. Making a note that we are using the api directly over the use effect library. Great negation technique lol
CleanShot 2024-04-30 at 11 49 53

tinpham5614
tinpham5614 previously approved these changes Apr 30, 2024
Copy link
Contributor

@tinpham5614 tinpham5614 left a comment

Choose a reason for hiding this comment

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

Looks good to me.
It would be great if you could provide some comments for ease of reading and understanding of the logic. For example in line 34.

@cshimm
Copy link
Contributor Author

cshimm commented Apr 30, 2024

Thanks @tinpham5614. I changed the variable name to activeEvents and added a comment above the filter line for clarity. I could also change it to !event.isArchived && !event.isHidden if that is even clearer.

@cshimm cshimm marked this pull request as draft May 1, 2024 01:31
@Ali-7s
Copy link
Contributor

Ali-7s commented May 3, 2024

Not sure why but I'm met with this error:
image

@cshimm
Copy link
Contributor Author

cshimm commented May 3, 2024

@Ali-7s Yea I had to re-address this issue so I'm still working on it. Once it's ready I'll take it out of draft mode and open it to review.

@cshimm cshimm marked this pull request as ready for review May 8, 2024 17:15
@cshimm
Copy link
Contributor Author

cshimm commented May 8, 2024

Re-opened. Please checkout branch bug-110-remove-duplicate-get-handler in the nsc-events-nestjs repository to test.

Copy link

@nickolasram nickolasram left a comment

Choose a reason for hiding this comment

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

I’ll “request changes” just so this doesn’t get prematurely merged while we check out the updates

@nickolasram nickolasram dismissed stale reviews from tinpham5614, IsaacJrTypes, and taylorpapke May 9, 2024 16:28

Branch has been updated since review

Copy link
Contributor

@taylorpapke taylorpapke left a comment

Choose a reason for hiding this comment

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

Still works:
Screenshot 2024-05-09 at 12 53 45 PM

@tinpham5614
Copy link
Contributor

It works as expected.

@taylorpapke taylorpapke merged commit e0ee970 into main May 10, 2024
3 checks passed
@taylorpapke taylorpapke deleted the feature-288-home-page-event-pagination branch May 10, 2024 02:03
@cshimm
Copy link
Contributor Author

cshimm commented May 10, 2024

@tinpham5614 @nickolasram @heosman Can you guys review this PR in the nestjs repo @SeattleColleges/nsc-events-nestjs/#111 ? Since the pagination depends on it, it won't appear to work currently if you're on the main branch in the nestjs repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Home Page: Implement pagination and display 5 additional events on "Load more events" button clicked
7 participants