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

[Frontend]: Implement pagination to the App #2

Closed
Mayank0255 opened this issue Jul 1, 2020 · 40 comments · Fixed by #57
Closed

[Frontend]: Implement pagination to the App #2

Mayank0255 opened this issue Jul 1, 2020 · 40 comments · Fixed by #57
Assignees
Labels
enhancement Improvement in an existing feature or expanding a feature feature New feature good first issue hacktoberfest up-for-grabs

Comments

@Mayank0255
Copy link
Owner

Mayank0255 commented Jul 1, 2020

Add pagination in the front-end on pages:

  • HomePage
  • QuestionsPage
  • TagsPage
  • UsersPage

The pagination for the HomePage and QuestionsPage should look similar to this:

image

Don't add the counts per page thing, if possible you can go ahead or else the pagination will begin after 10 PostItem Components

And for TagsPage and UsersPage, it should look like this:

image

The pagination should begin after 12 TagPanel Components

Kindly check for all the cases file paginating like on going forward how the paginate component should look like and all.

Feel free to tag me if there's any issue 😄

@Mayank0255 Mayank0255 added the feature New feature label Jul 1, 2020
@Mayank0255 Mayank0255 self-assigned this Jul 1, 2020
@Mayank0255 Mayank0255 changed the title Apply pagination wherever required Implement pagination to the App Sep 3, 2020
@Mayank0255 Mayank0255 added the enhancement Improvement in an existing feature or expanding a feature label Nov 18, 2020
@Mayank0255 Mayank0255 changed the title Implement pagination to the App [ENHANCEMENT]: Implement pagination to the App Jan 25, 2021
@Mayank0255 Mayank0255 changed the title [ENHANCEMENT]: Implement pagination to the App [Frontend]: Implement pagination to the App Mar 17, 2021
@Mayank0255 Mayank0255 removed their assignment Mar 19, 2021
@devanshiv123
Copy link

@Mayank0255 Can you assign this issue to me?

@Mayank0255
Copy link
Owner Author

@devanshiv123 sure, go ahead

@devanshiv123
Copy link

@Mayank0255 I am getting the the following error while setting up project(after npm run dev)
image

@Mayank0255
Copy link
Owner Author

@devanshiv123
Try removing all the question marks from the shown areas and then try again and let me know

@devanshiv123
Copy link

I have removed the question marks and now I am getting another error:
image

@Mayank0255
Copy link
Owner Author

@devanshiv123
Can you go to the sidebar file in whoch it is exported and check whether it's exported correctly or not?

@devanshiv123
Copy link

@Mayank0255 Yes I think its exported correctly

@Mayank0255
Copy link
Owner Author

@devanshiv123
It's a new error actually, I haven't gotten this ever.

Can you look into it if possible? I will also try to figure it out.

Btw I am assuming that you haven't changed anything in the code right now?

@devanshiv123
Copy link

@Mayank0255 No I havn't made any changes I have just made the setup till now. I will try to figure out, maybe an issue with dependency.

@Mayank0255
Copy link
Owner Author

@devanshiv123 yes, correct, it's been sometime time there had been any changes so might be some functions or methods may have depreciated with the new versions

@Mayank0255
Copy link
Owner Author

@devanshiv123 any updates?

@devanshiv123
Copy link

@Mayank0255 I am still getting those errors. I have tried for a day but maybe something is wrong. For now you can unassign me from the issue, I will first try to setup correctly and then take up any other issue.

@Mayank0255
Copy link
Owner Author

@devanshiv123 Oh, ok

Any other reason that you wanna work on some other issue?

@devanshiv123
Copy link

@devanshiv123 Oh, ok

Any other reason that you wanna work on some other issue?

@Mayank0255 No nothing as such, I will surely try to contribute if I get the setup properly after resolving errors.

@Mayank0255
Copy link
Owner Author

@devanshiv123 Cool

@Mayank0255
Copy link
Owner Author

@alceil can you please clarify that from which issue are you willing to begin?

@kunalkumar007 kindly give the person 1 day to get back to us, if he decides to take up this issue then I can recommend you to take up #31 this issue, which might be something new and for which a guide has also been referred. If he decides to take up anyother issue then I would love you to be part of this issue.

If @alceil doesn't gives us an update by the EOD then I can happily assign this to @kunalkumar007 as I am looking for some active participants as well :-)

@jigmetnamgyal
Copy link

Is this still active ? Can I work on it

@Mayank0255
Copy link
Owner Author

Is this still active ? Can I work on it

Yes it is active, @kunalkumar007 is also willing to work on this, so @kunalkumar007 would you like to work with @jigmet123 on this or do you want to work on this separately?

@kunalkumar007
Copy link

As more developers are interested to work on this issue, I would try another issue.

@Mayank0255
Copy link
Owner Author

@kunalkumar007 sure, kindly comment on that particular issue so that I can assign you that.

@Mayank0255
Copy link
Owner Author

@jigmet123 I am then assigning this issue to you, is that ok?

@jigmetnamgyal
Copy link

@Mayank0255 sure I will take this

@Mayank0255
Copy link
Owner Author

@jigmet123 Cool. Looking forward to a PR soon!!

@Mayank0255
Copy link
Owner Author

@jigmet123 Any updates on the progress?

Let me know if you get stuck anywhere

@luko0610
Copy link
Contributor

luko0610 commented Oct 7, 2021

@Mayank0255 In case this doesn't make any progress I'd be happy to take over.

@Mayank0255
Copy link
Owner Author

@luko0610 Cool, let's wait for sometime if the person replies, I will assign it to you if the person doesn't replies.

@luko0610
Copy link
Contributor

luko0610 commented Oct 7, 2021

@luko0610 Cool, let's wait for sometime if the person replies, I will assign it to you if the person doesn't replies.

Sounds good. Thanks.

@Mayank0255
Copy link
Owner Author

@luko0610 Okay so @jigmet123 two days has completed since I asked him about the updates.

Should I assign it to you then? And may I ask that approximately after how much time can I expect a PR?

@luko0610
Copy link
Contributor

luko0610 commented Oct 8, 2021

@luko0610 Okay so @jigmet123 two days has completed since I asked him about the updates.

Should I assign it to you then? And may I ask that approximately after how much time can I expect a PR?

Yes, please. Should be done in about two days.

@Mayank0255
Copy link
Owner Author

@luko0610 Great, looking forward to it 🎉

@luko0610
Copy link
Contributor

luko0610 commented Oct 9, 2021

@Mayank0255 I'm currently at it. Frontend pagination component is nearly done (still needs some style improvements).
For now pagination is client side. If you want I can also make a PR for the backend to add server side pagination.

@Mayank0255
Copy link
Owner Author

@Mayank0255 I'm currently at it. Frontend pagination component is nearly done (still needs some style improvements). For now pagination is client side. If you want I can also make a PR for the backend to add server side pagination.

Great progress @luko0610 ,

Can you elaborate on the part of server side pagination? If pagination has been setup on the frontend then what will you be doing in the backend?

@luko0610
Copy link
Contributor

luko0610 commented Oct 9, 2021

@Mayank0255
Of course. Basically if we only set it up on the frontend, the application would always receive all entries from the backend and then handle pagination on the client side. That's okay for a small number of entries, but can become an issue, when having thousands of entries.

A solution for this issue would be to do the pagination server side. That means when fetching the entries from the backend we always send the currentPage and pageSize we want returned, and then only get sent back entries we want to currently show in the frontend.

I would for now implement it client side, but I could of course make another PR to add server side pagination later on.

@luko0610
Copy link
Contributor

luko0610 commented Oct 9, 2021

@Mayank0255 I have created a PR (#57) . I created the pagination component and added it to the pages as described.
Let me know if any changes are needed.

Thank you.

@Mayank0255
Copy link
Owner Author

@Mayank0255 Of course. Basically if we only set it up on the frontend, the application would always receive all entries from the backend and then handle pagination on the client side. That's okay for a small number of entries, but can become an issue, when having thousands of entries.

A solution for this issue would be to do the pagination server side. That means when fetching the entries from the backend we always send the currentPage and pageSize we want returned, and then only get sent back entries we want to currently show in the frontend.

I would for now implement it client side, but I could of course make another PR to add server side pagination later on.

@luko0610 I think it's a good idea, I have two things to ask about it,

  1. After implementing that in the API, will you be calling the endpoint with updated page whenever next page or a specific page button is pressed?

  2. There's one important thing to keep in mind while adding pagination, which is get access to last page number (can be names as lastPageNumber) at all the time as in the client side it is necessary to show the page numbers from the first to the last page.

I would request you to make a an issue related to this on the backend repo, and then add a brief description related to it so that I can assign you that and the project management runs smoothly.

@luko0610
Copy link
Contributor

@Mayank0255 Of course. Basically if we only set it up on the frontend, the application would always receive all entries from the backend and then handle pagination on the client side. That's okay for a small number of entries, but can become an issue, when having thousands of entries.
A solution for this issue would be to do the pagination server side. That means when fetching the entries from the backend we always send the currentPage and pageSize we want returned, and then only get sent back entries we want to currently show in the frontend.
I would for now implement it client side, but I could of course make another PR to add server side pagination later on.

@luko0610 I think it's a good idea, I have two things to ask about it,

  1. After implementing that in the API, will you be calling the endpoint with updated page whenever next page or a specific page button is pressed?
  2. There's one important thing to keep in mind while adding pagination, which is get access to last page number (can be names as lastPageNumber) at all the time as in the client side it is necessary to show the page numbers from the first to the last page.

I would request you to make a an issue related to this on the backend repo, and then add a brief description related to it so that I can assign you that and the project management runs smoothly.

  1. Exactly, whenever the pagination changes a new api call is done, to load the items for the selected page. (The parameters pageNumber, pageSize need to be supplied in the request).
  2. Yes, the number of total items needs to be known for the pagination. Would return the data from the backend using the following structure:
    { total: {total}, pageNumber: {pageNumber}, pageSize: {pageSize} data: [] }

@Mayank0255
Copy link
Owner Author

@luko0610 cool, make an issue there then, will assign it to you

Mayank0255 added a commit that referenced this issue Oct 12, 2021
feat(#2): implement pagination component and add it to pages
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improvement in an existing feature or expanding a feature feature New feature good first issue hacktoberfest up-for-grabs
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants