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

Fix Auto-Scroll Issue and Total Count Card for Staff Capacity Pagination in facility details page #9122

Open
4 tasks
nihal467 opened this issue Nov 14, 2024 · 8 comments
Assignees

Comments

@nihal467
Copy link
Member

nihal467 commented Nov 14, 2024

Describe the bug

Originally report: #9004 (comment)

  • When navigating from page 1 to page 2 in the staff capacity section on the facility details page, the page automatically scrolls to the top.
  • When moving from page 1 to page 2, the total capacity card displays the staff capacity for the current page only, not the entire section.

To Reproduce
Steps to reproduce the behavior:

  1. Go to facility details page
  2. Add 15+ staff capacity
  3. try to move to page no 2
  4. See error

Expected behavior

  • Auto-scrolling should stop at the beginning of the staff capacity section, rather than scrolling to the top of the facility details page.
  • The total capacity card should display the total staff capacity for the entire section, not just the current page.

Screenshots

Image

@nihal467 nihal467 added the P1 breaking issue or vital feature label Nov 14, 2024
Copy link

⚠️ Refrain from assigning this issue to yourself if you have another P1 issue assigned that is not yet closed.

@nihal467 nihal467 removed the P1 breaking issue or vital feature label Nov 14, 2024
@PAVAN507-STAR
Copy link

@nihal467 can i work on this issue?

@github-actions github-actions bot added needs-triage question Further information is requested labels Nov 15, 2024
@Jacobjeevan Jacobjeevan removed question Further information is requested needs-triage labels Nov 15, 2024
@Jacobjeevan Jacobjeevan added this to Care Nov 15, 2024
@github-project-automation github-project-automation bot moved this to Triage in Care Nov 15, 2024
@Jacobjeevan Jacobjeevan moved this from Triage to Up Next in Care Nov 15, 2024
@github-actions github-actions bot added needs-triage question Further information is requested labels Nov 20, 2024
@PAVAN507-STAR
Copy link

PAVAN507-STAR commented Nov 20, 2024

@Jacobjeevan @nihal467 I found the issue of total count on card ,the problem is the logic only counts from data fetched from current page .Need a bit of help ,I have a doubt/confusion on how to approach ,so should i fetch the entire data of all pages at once i.e change limit and offset?Or do i have to write an api for that or is there any other way ?

Image

Image

@Jacobjeevan
Copy link
Contributor

@Jacobjeevan @nihal467 I found the issue of total count on card ,the problem is the logic only counts from data fetched from current page .Need a bit of help ,I have a doubt/confusion on how to approach ,so should i fetch the entire data of all pages at once i.e change limit and offset?Or do i have to write an api for that or is there any other way ?

Image

Image

Hmm 🤔 Easiest way would probably be to tweak the api rather than fetching all the results; that would affect pagination unless you want to call the api twice.

In this case, modifying HospitalDoctorViewSet to return the total along with the results should work.

@Jacobjeevan Jacobjeevan added Backend Frontend and removed question Further information is requested needs-triage labels Nov 20, 2024
@PAVAN507-STAR
Copy link

@Jacobjeevan @nihal467 I found the issue of total count on card ,the problem is the logic only counts from data fetched from current page .Need a bit of help ,I have a doubt/confusion on how to approach ,so should i fetch the entire data of all pages at once i.e change limit and offset?Or do i have to write an api for that or is there any other way ?
Image
Image

Hmm 🤔 Easiest way would probably be to tweak the api rather than fetching all the results; that would affect pagination unless you want to call the api twice.

In this case, modifying HospitalDoctorViewSet to return the total along with the results should work.

Will give it a try and let u know if it works.Thanks for the help sir.

@github-actions github-actions bot added needs-triage question Further information is requested labels Nov 21, 2024
@PAVAN507-STAR
Copy link

@Jacobjeevan Hii sir.I'm learning django rn so it make take 2-4 days for me to fix this issue.Hope it's fine.

@nihal467 nihal467 removed question Further information is requested needs-triage labels Nov 25, 2024
@shauryag2002
Copy link
Contributor

Hi @nihal467, @Jacobjeevan,

This issue has been stagnant for 2 weeks. Can I take over?

My approach:

  • Stop auto-scrolling at the staff capacity section instead of the page top.
  • Display total staff capacity for the entire section using the total_doctor value in the API response to avoid extra API calls.
total_staff_scroll.mp4

@github-actions github-actions bot added needs-triage question Further information is requested labels Nov 30, 2024
@Jacobjeevan
Copy link
Contributor

@Jacobjeevan Hii sir.I'm learning django rn so it make take 2-4 days for me to fix this issue.Hope it's fine.

@PAVAN507-STAR any updates here?

@Jacobjeevan Jacobjeevan removed question Further information is requested needs-triage labels Dec 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Up Next
Development

No branches or pull requests

4 participants