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

Replaced useDispatch w. useQuery/request: Shifting (src/Components/Shifting/**) #6533

Merged
merged 7 commits into from
Nov 7, 2023

Conversation

konavivekramakrishna
Copy link
Contributor

@konavivekramakrishna konavivekramakrishna commented Nov 1, 2023

WHAT

🤖 Generated by Copilot at a3582c4

The pull request refactors the shifting features of the frontend application to use the useQuery hook and the request function from the Utils folder, which simplify and improve the API requests and responses logic. The pull request also defines new interfaces for the shift and shift details data, and updates the existing interfaces and routes for the shifting features. The pull request also removes some unused and redundant code, and adds some user interface enhancements.

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 a3582c4

  • Make the state property optional in the FacilityModel interface and the exclude_user prop optional in the FacilitySelectProps interface (link, link)
  • Replace the Redux actions and hooks for shifting features with the useQuery and request functions from the Utils folder, which use the routes object and the axios library to make and handle API requests (link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link)
  • Add the types of the request and response data for the shifting routes in the routes object, using the IShift and IShiftDetails interfaces from the models file and the Type function from the runtypes library (link, link, link)
  • Add a new route for getting a specific user by id in the routes object, using the UserModel interface and the PaginatedResponse type (link)
  • Add a new component Comment in src/Components/Resource/CommentSection.tsx, which takes an IComment object as a prop and renders the comment details (link)
  • Replace the CommentSection component in src/Components/Shifting/CommentsSection.tsx with the PaginatedList component from the CAREUI folder, which handles the loading and pagination logic internally (link)
  • Add a tooltip to the update and delete buttons in src/Components/Shifting/ShiftDetails.tsx and src/Components/Shifting/ListView.tsx, which show messages based on the shift status or confirmation (link, link)
  • Add a link to the phone number and the patient id in src/Components/Shifting/ShiftDetails.tsx, which allow the user to make a call or navigate to the patient details page by clicking on them (link, link)
  • Add the offset state variable in src/Components/Shifting/ShiftingBoard.tsx, which is used to keep track of the pagination offset for the API request (link)

Copy link

vercel bot commented Nov 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 Nov 7, 2023 11:12am

Copy link

netlify bot commented Nov 1, 2023

Deploy Preview for care-egov-staging ready!

Name Link
🔨 Latest commit dd3cc78
🔍 Latest deploy log https://app.netlify.com/sites/care-egov-staging/deploys/654a1b5836dcc300080421f4
😎 Deploy Preview https://deploy-preview-6533--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.

src/Components/Shifting/BadgesList.tsx Outdated Show resolved Hide resolved
src/Components/Shifting/BadgesList.tsx Outdated Show resolved Hide resolved
src/Components/Shifting/BadgesList.tsx Outdated Show resolved Hide resolved
src/Components/Shifting/CommentsSection.tsx Outdated Show resolved Hide resolved
src/Components/Shifting/ShiftingBoard.tsx Outdated Show resolved Hide resolved
src/Components/Shifting/models.ts Outdated Show resolved Hide resolved
src/CAREUI/misc/PaginatedList.tsx Outdated Show resolved Hide resolved
src/CAREUI/misc/PaginatedList.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.

Nice work @konavivekramakrishna LGTM

@konavivekramakrishna konavivekramakrishna changed the title replaced useDispatch in Shifting Replaced useDispatch w. useQuery/request: Shifting (src/Components/Shifting/**) Nov 6, 2023
@konavivekramakrishna
Copy link
Contributor Author

konavivekramakrishna commented Nov 6, 2023

@rithviknishad,
I don't know why loading dummy data into the Care backend Cypress test failed. Is this something I need to work on?

@rithviknishad
Copy link
Member

No @konavivekramakrishna
It'll fixed seperatley

@rithviknishad
Copy link
Member

It's not your PR's fault

@konavivekramakrishna
Copy link
Contributor Author

konavivekramakrishna commented Nov 6, 2023

Got it👍

@nihal467
Copy link
Member

nihal467 commented Nov 6, 2023

@konavivekramakrishna
image

https://deploy-preview-6533--care-net.netlify.app/shifting/c8bcd2a4-ed41-4b64-ba27-96cd62a978dc

this no comment is not in staging, so just remove it

image

pagination for the comments is breaking

@nihal467
Copy link
Member

nihal467 commented Nov 7, 2023

LGTM

@nihal467 nihal467 added tested cypress failed pull request with cypress test failure and removed needs testing cypress failed pull request with cypress test failure labels Nov 7, 2023
@khavinshankar khavinshankar merged commit 01d5b16 into coronasafe:develop Nov 7, 2023
28 of 31 checks passed
Copy link

netlify bot commented Nov 7, 2023

Deploy Preview for care-net failed.

Name Link
🔨 Latest commit dd3cc78
🔍 Latest deploy log https://app.netlify.com/sites/care-net/deploys/654a1b586a44320008dc7fd3

@github-actions github-actions bot added the Deploy-Failed Deplyment is not showing preview label Nov 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Deploy-Failed Deplyment is not showing preview tested
Projects
None yet
Development

Successfully merging this pull request may close these issues.

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