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

Fixed pagination bug in FileUpload Component #5580

Merged
merged 7 commits into from
Jun 7, 2023

Conversation

patelaryan7751
Copy link
Contributor

@patelaryan7751 patelaryan7751 commented Jun 1, 2023

WHAT

🤖 Generated by Copilot at 42c0118

This change improves the file upload component for patient files by adding sorting and pagination features for both archived and unarchived files. It also simplifies the state management and rendering logic by using separate variables and functions for each file category in FileUpload.tsx.

Proposed Changes

@coronasafe/care-fe-code-reviewers @coronasafe/code-reviewers

Merge Checklist

  • Add specs that demonstrate bug / test a new feature.
  • Update product documentation.
  • Ensure that UI text is kept in I18n files.
  • Prep screenshot or demo video for changelog entry, and attach it to issue.
  • Request for Peer Reviews
  • Completion of QA

HOW

🤖 Generated by Copilot at 42c0118

  • Split the uploadedFiles and totalCount state variables into two separate variables each, based on the archival status of the files, to support the sorting and pagination features of the file upload component (link, link)
  • Modify the viewUpload action to accept an additional parameter, is_archived, and fetch both archived and unarchived files from the backend using the archivedFileData and unarchievedFileData objects, and update the state with the setuploadedArchievedFiles and setuploadedUnarchievedFiles functions (link, link)
  • Refactor the conditional rendering of the file upload component in src/Components/Patient/FileUpload.tsx to use the new state variables instead of filtering the uploadedFiles array based on the sortFileState variable, to improve the performance and readability of the component (link)

@patelaryan7751 patelaryan7751 requested a review from a team June 1, 2023 16:35
@patelaryan7751 patelaryan7751 requested a review from a team as a code owner June 1, 2023 16:35
@netlify
Copy link

netlify bot commented Jun 1, 2023

Deploy Preview for care-egov-staging ready!

Name Link
🔨 Latest commit ed7d5b9
🔍 Latest deploy log https://app.netlify.com/sites/care-egov-staging/deploys/648005bc94eae20008755371
😎 Deploy Preview https://deploy-preview-5580--care-egov-staging.netlify.app/
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@vercel
Copy link

vercel bot commented Jun 1, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
care-storybook ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 6, 2023 7:46am

@nihal467
Copy link
Member

nihal467 commented Jun 5, 2023

@patelaryan7751 check the cypress failing and fix it

@sonarcloud
Copy link

sonarcloud bot commented Jun 6, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

No Coverage information No Coverage information
0.0% 0.0% Duplication

@vercel
Copy link

vercel bot commented Jun 7, 2023

@patelaryan7751 is attempting to deploy a commit to the Coronasafe Team on Vercel.

A member of the Team first needs to authorize it.

@nihal467
Copy link
Member

nihal467 commented Jun 7, 2023

LGTM

@khavinshankar khavinshankar merged commit 2c1e296 into ohcnetwork:develop Jun 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Solve the pagination Bug for Archived and Unarchived Files in FileUpload Component
3 participants