Skip to content

enhance: data pagination#270

Open
nodogx wants to merge 4 commits intothoth-tech:developmentfrom
nodogx:data-pagination
Open

enhance: data pagination#270
nodogx wants to merge 4 commits intothoth-tech:developmentfrom
nodogx:data-pagination

Conversation

@nodogx
Copy link

@nodogx nodogx commented Dec 22, 2024

Description

Added Data Pagination

Now, instead of loading all the data histories at once, the backend just gives the data based on the webpage and a limited number or data. For example, If there are 30 records, and if the page 1 has 10 records, this will only give the 10 records in the backend with the total number of records (needed for page count).

When the user goes to page 2 for example, the next set of data will be loaded. This way, if there are 500 histories for example, everything will not be loaded at once.

This will help boost webpage load times

Screenshot 2024-12-23 at 2 29 02 am
  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Login as any user
Go to the dashboard (where all the target history is been shown)
Go to the inspect page in the browser.
Go to the Network tab, and see how the data is loaded every time when the user is navigated to a new page

Testing Checklist:

  • Tested in latest Chrome
  • Tested in latest Safari
  • Tested in latest Firefox

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have requested a review from @macite and @jakerenzella on the Pull Request

Back end pull: thoth-tech/doubtfire-api#50

@nodogx nodogx changed the title Data pagination enhance: data pagination Dec 22, 2024
Copy link

@CheeYuKoh CheeYuKoh left a comment

Choose a reason for hiding this comment

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

just reviewed and tried the code, seems ok and is working

Copy link

@XinHuang1112 XinHuang1112 left a comment

Choose a reason for hiding this comment

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

Codes are very clear and detailed. I have tested it on my local machine. It really helps boost webpage load times effectively.

Copy link

@aditya993388 aditya993388 left a comment

Choose a reason for hiding this comment

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

I reviewed the code and tested the frontend, and everything works as expected. The backend data is populated correctly in the frontend. For example, the target grade history is displayed accurately in a table. I can confirm that the frontend divides the total records (e.g 37) by the maximum number of records per page (10) to calculate and display the correct number of pages. It fetches and displays the data correctly on the website. I did not find any error in the code. I do approve this.

@aNebula
Copy link

aNebula commented Jan 25, 2025

@nodogx Please open a pull request against the upstream repo doubtfire-lms/doubtfire-web, branch 8.0.x.

@nodogx
Copy link
Author

nodogx commented Jan 26, 2025

@nodogx Please open a pull request against the upstream repo doubtfire-lms/doubtfire-web, branch 8.0.x.

This has been done @aNebula : doubtfire-lms#913

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.

5 participants