Skip to content
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.

refactor(labs): refactor labs module to use react query #2410

Merged

Conversation

rsousaj
Copy link
Contributor

@rsousaj rsousaj commented Sep 18, 2020

Fixes #2339 .

Changes proposed in this pull request:

  • Added those hooks and respective tests:
    -- useLab
    -- useLabsSearch
    -- useRequestLab
    -- useCancelLab
    -- useUpdateLab
    -- useCompleteLab

  • Remove lab-slice and labs-slice.

  • Updated ViewLab, ViewLabs and NewRequestLab tests

  • Refactor Labs.test

  • Refactor usePatient parameters to be optional and use useQuery config ({ enabled: id }) to only execute when id is available. This was due to ViewLab needs to execute both useLab and usePatient as dependency and because of that usePatient needs to wait for useLab to execute.

  • Refactor CareGoalTab.test and CarePlanTab.test to use Route as it's necessary for usePatient return data

  • Remove lab and labs reducers

@gitpod-io
Copy link

gitpod-io bot commented Sep 18, 2020

@vercel
Copy link

vercel bot commented Sep 19, 2020

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/hospitalrun/hospitalrun-frontend/jwbb1xlnz
✅ Preview: https://hospitalrun-fron-git-fork-rsousaj-issue2339labsmodulerea-4b6c0d.hospitalrun.vercel.app

@matteovivona matteovivona added the in progress indicates that issue/pull request is currently being worked on label Sep 19, 2020
@matteovivona matteovivona added this to the v2.0 milestone Sep 19, 2020
@jackcmeyer jackcmeyer changed the title Refactor labs module to use react query refactor(labs): refactor labs module to use react query Sep 19, 2020
src/labs/ViewLab.tsx Outdated Show resolved Hide resolved
src/labs/ViewLab.tsx Outdated Show resolved Hide resolved
src/labs/hooks/useCompleteLab.ts Outdated Show resolved Hide resolved
src/labs/hooks/useUpdateLab.ts Outdated Show resolved Hide resolved
src/labs/hooks/useLabsSearch.ts Outdated Show resolved Hide resolved
@matteovivona
Copy link
Contributor

@rsousaj there are conflicts to resolve

Copy link
Member

@jackcmeyer jackcmeyer left a comment

Choose a reason for hiding this comment

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

need to resolve conflicts

@rsousaj
Copy link
Contributor Author

rsousaj commented Sep 24, 2020

Working on this... Next few hours will be done

@blestab
Copy link
Contributor

blestab commented Sep 24, 2020

Hi @rsousaj looks like we have a failing test as well. May you take a look at that.

@blestab blestab added labs issue/pull request that interacts with labs module 🚀enhancement an issue/pull request that adds a feature to the application labels Sep 24, 2020
@blestab blestab added this to In progress in Version 2.0 via automation Sep 24, 2020
@rsousaj
Copy link
Contributor Author

rsousaj commented Sep 24, 2020

Hi @rsousaj looks like we have a failing test as well. May you take a look at that.

Sure I'll

@jackcmeyer jackcmeyer merged commit c1b850e into HospitalRun:master Sep 26, 2020
Version 2.0 automation moved this from In progress to Done Sep 26, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🚀enhancement an issue/pull request that adds a feature to the application in progress indicates that issue/pull request is currently being worked on labs issue/pull request that interacts with labs module
Projects
Version 2.0
  
Done
Development

Successfully merging this pull request may close these issues.

Refactor labs module to use react query instead of redux
4 participants