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

Replace useDispatch w. useQuery/request: Consultations #6372 #6484

Merged
merged 22 commits into from
Nov 22, 2023

Conversation

AshrafMd-1
Copy link
Contributor

@AshrafMd-1 AshrafMd-1 commented Oct 24, 2023

WHAT

🤖 Generated by Copilot at 48aff69

Refactored several components related to consultations and daily rounds to use a common PaginatedList component and a request helper function, which simplify the code and improve the pagination functionality and error handling. Added types to some API routes and data models to enhance type safety and readability. Moved some files to different folders to reflect their new roles.

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 48aff69

  • Refactored the code to use the PaginatedList component for various tables and plots in the consultations module (link, link, link, link, link, link, link, link, link, link, link, link, link)
  • Replaced the Redux actions for API calls with the request helper function and the useQuery hook, which handle errors and authentication (link, link, link, link, link, link, link, link, link, link, link, link, link)
  • Changed the error message in the useContextualized hook to be more generic and accurate (link)
  • Added the offset parameter to the query hook for pagination support (link)
  • Removed the useDispatch hook and the dispatch variable from the files that no longer use Redux actions (link, link, link, link, link, link)
  • Added the style attribute to the div elements that contain the tables, to set the direction to rtl and reverse the order of the columns (link, link, link)
  • Modified the values of the VERBAL_RESPONSE_SCALE constant as per the feedback from the doctors (link)
  • Added the types for the daily rounds fields and responses to the models.tsx and api.tsx files (link, link, link, link, link)
  • Changed the import order to follow the alphabetical order of the file names (link)
  • Added the missing dependencies to the useEffect hooks (link, link, link)
  • Moved the constants and functions that do not depend on state or props outside the useEffect hooks (link, link, link, link)
  • Renamed the response variable to avoid confusion with the res variable (link, link)
  • Replaced the isLoading condition with the loading state from the useQuery hook (link)
  • Removed the empty line to reduce the file size (link)

@AshrafMd-1 AshrafMd-1 requested a review from a team October 24, 2023 10:13
@AshrafMd-1 AshrafMd-1 requested a review from a team as a code owner October 24, 2023 10:13
@netlify
Copy link

netlify bot commented Oct 24, 2023

Deploy Preview for care-egov-staging ready!

Name Link
🔨 Latest commit 32b8660
🔍 Latest deploy log https://app.netlify.com/sites/care-egov-staging/deploys/655625b12d3d040007531b2b
😎 Deploy Preview https://deploy-preview-6484--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 configuration.

@AshrafMd-1
Copy link
Contributor Author

@rithviknishad can you review this PR?

@vercel
Copy link

vercel bot commented Oct 24, 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 Nov 16, 2023 2:23pm

src/Redux/api.tsx Outdated Show resolved Hide resolved
src/Redux/api.tsx Outdated Show resolved Hide resolved
src/Redux/api.tsx Outdated Show resolved Hide resolved
src/Components/Facility/models.tsx Outdated Show resolved Hide resolved
src/Components/Facility/models.tsx Outdated Show resolved Hide resolved
src/Components/Facility/Consultations/LiveFeed.tsx Outdated Show resolved Hide resolved
src/Components/Facility/Consultations/Feed.tsx Outdated Show resolved Hide resolved
src/Components/Facility/Consultations/Feed.tsx Outdated Show resolved Hide resolved
src/Components/Facility/Consultations/Feed.tsx Outdated Show resolved Hide resolved
src/Components/Facility/Consultations/Beds.tsx Outdated Show resolved Hide resolved
Copy link
Member

@rithviknishad rithviknishad left a comment

Choose a reason for hiding this comment

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

Also, do remove no longer used actions from actions.tsx

@rithviknishad
Copy link
Member

@AshrafMd-1 any updates on this?

@AshrafMd-1
Copy link
Contributor Author

AshrafMd-1 commented Oct 30, 2023

@AshrafMd-1 any updates on this?

Some small issues related to pagination and request. So I will push a PR with all issues resolved in 2-3 days.

@github-actions github-actions bot added the merge conflict pull requests with merge conflict label Oct 31, 2023
@github-actions
Copy link

👋 Hi, @AshrafMd-1,
Conflicts have been detected against the base branch. Please rebase your branch against the base branch.


This message is automatically generated by prince-chrismc/label-merge-conflicts-action so don't hesitate to report issues/improvements there.

@rithviknishad
Copy link
Member

Hey @AshrafMd-1 any updates on this?

@github-actions github-actions bot removed the merge conflict pull requests with merge conflict label Nov 10, 2023
@AshrafMd-1
Copy link
Contributor Author

@AshrafMd-1 could you also clear the merge conflicts?

yup done

@nihal467
Copy link
Member

LGTM

@khavinshankar khavinshankar merged commit 91af0d6 into ohcnetwork:develop Nov 22, 2023
34 of 36 checks passed
@AshrafMd-1 AshrafMd-1 deleted the Fix#6372-new branch November 26, 2023 11:00
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.

🛠️ Replace useDispatch w. useQuery/request: Consultations (src/Components/Facility/Consultations/**)
4 participants