Skip to content

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

Front end - thoth-tech/doubtfire-web#270

macite and others added 30 commits June 14, 2024 12:11
first commit containing endpoints and DB changes

new faeture
first commit containing endpoints and DB changes

new faeture
- Implement methods in task_definition model for numbas data management
- Implement routes in task_definition_api for numbas data managemnt
- Remove unused upload API in numbas_api
@anmol-sainii
Copy link

Code looks good, i tested it on my browsers, it works as its supposed to!

@nodogx
Copy link
Author

nodogx commented Jan 11, 2025

Code looks good, i tested it on my browsers, it works as its supposed to!

Thank you for the review, are you able to approve the changes done at this current state if you are happy with this review? @anmol-sainii

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 I tested on my local machine. This really help 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 backend functionality and observed that it handles key parameters such as page number, records per page, project ID, and limit efficiently. The offset is calculated as page - 1, which is appropriate for pagination. Overall, the backend functionality works well.
The target grade history is designed to return a maximum of 10 records per page, which helps in pagination. The backend sends correct data to the frontend. I did not find any errors in the code. I do approve this

@anmol-sainii
Copy link

Im not sure why my approval hadnt gone through earlier, just approved it again

@aNebula
Copy link

aNebula commented Jan 25, 2025

LGTM.
@nodogx Please open an upstream PR against https://github.com/doubtfire-lms/doubtfire-api/tree/8.0.x

@nodogx
Copy link
Author

nodogx commented Jan 26, 2025

LGTM. @nodogx Please open an upstream PR against https://github.com/doubtfire-lms/doubtfire-api/tree/8.0.x

@aNebula This has been done: doubtfire-lms#455 :)

Thank you!

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.

9 participants