-
Notifications
You must be signed in to change notification settings - Fork 490
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
💊 Adds support for editing prescriptions + Adds useSlug
hook
#6369
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
✅ Deploy Preview for care-egov-staging ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Passing run #1347 ↗︎
Details:
Review all test suite changes for PR #6369 ↗︎ |
LGTM |
👋 Hi, @rithviknishad, This message is automatically generated by prince-chrismc/label-merge-conflicts-action so don't hesitate to report issues/improvements there. |
@rithviknishad We truly appreciate your efforts. Thank you for taking the time to contribute; this is a very valuable contribution to us 🥇. We always welcome your contribution 🙂, so feel free to contribute to anything anytime, and never lose that spirit of innovation 🙌. |
* Middleware override feature in asset location * Fix tooltip clipping * Fix Flaky Cypress test in Facility Module (#6384) * fix random facility page failure * fix random facility page failure * Revert "Prescriptions: Shrink discontinued prescriptions + Flip MAR timeline + Freeze primary columns in horizontal scroll (#6282)" (#6386) This reverts commit 5009a86. * Refactor Asset Model Import Formatting (#6388) * Refactor Asset Model Import Formatting * fixes to warranty_amc_end_of_validity * Fix asset import file for cypress * Refactor: replaced Dispatch to useQuery/Request of src/Components/Auth/log… (#6333) * Refactor: replaced useDispatch to useQuery of src/Components/Auth/login.tsx * fix:useQuery changed to Request * feat: replaced dispatch with request * fix: types and added pathparams * fix: request body error * Update Login.tsx * change:Tres to Tbody * fixes: response type change * Update package-lock.json * fix hover height (#6352) * Split routes of App Router (#6363) * Prescription: show prescribed on & by and discontinued date in detail card (#6365) * Fixed bug in location picker in update facility page (#6377) * add all cases for map rendering * implement location pointer on searched location * Added cam auto reset in asset config page (#6375) * 💊 Adds support for editing prescriptions + Adds `useSlug` hook (#6369) * Adds hook: `useSlug` * bug fix: NumericWithUnits field not showing intial value * Form: support for showing global errors * Adds support for editing prescriptions (fixes #6340) * Fix cypress * fix cypress * Improve design --------- Co-authored-by: Mohammed Nihal <[email protected]> Co-authored-by: Rithvik Nishad <[email protected]> Co-authored-by: Aaron Jevil Nazareth <[email protected]> Co-authored-by: Pranshu Aggarwal <[email protected]> Co-authored-by: Gampa Sri Harsh <[email protected]> Co-authored-by: Tasnimul H. Tauhid <[email protected]>
* Middleware override feature in asset location * Fix tooltip clipping * Fix Flaky Cypress test in Facility Module (#6384) * fix random facility page failure * fix random facility page failure * Revert "Prescriptions: Shrink discontinued prescriptions + Flip MAR timeline + Freeze primary columns in horizontal scroll (#6282)" (#6386) This reverts commit 5009a86. * Refactor Asset Model Import Formatting (#6388) * Refactor Asset Model Import Formatting * fixes to warranty_amc_end_of_validity * Fix asset import file for cypress * Refactor: replaced Dispatch to useQuery/Request of src/Components/Auth/log… (#6333) * Refactor: replaced useDispatch to useQuery of src/Components/Auth/login.tsx * fix:useQuery changed to Request * feat: replaced dispatch with request * fix: types and added pathparams * fix: request body error * Update Login.tsx * change:Tres to Tbody * fixes: response type change * Update package-lock.json * fix hover height (#6352) * Split routes of App Router (#6363) * Prescription: show prescribed on & by and discontinued date in detail card (#6365) * Fixed bug in location picker in update facility page (#6377) * add all cases for map rendering * implement location pointer on searched location * Added cam auto reset in asset config page (#6375) * 💊 Adds support for editing prescriptions + Adds `useSlug` hook (#6369) * Adds hook: `useSlug` * bug fix: NumericWithUnits field not showing intial value * Form: support for showing global errors * Adds support for editing prescriptions (fixes #6340) * Fix cypress * fix cypress * Improve design --------- Co-authored-by: Mohammed Nihal <[email protected]> Co-authored-by: Rithvik Nishad <[email protected]> Co-authored-by: Aaron Jevil Nazareth <[email protected]> Co-authored-by: Pranshu Aggarwal <[email protected]> Co-authored-by: Gampa Sri Harsh <[email protected]> Co-authored-by: Tasnimul H. Tauhid <[email protected]>
* Middleware override feature in asset location * Fix tooltip clipping * Fix Flaky Cypress test in Facility Module (#6384) * fix random facility page failure * fix random facility page failure * Revert "Prescriptions: Shrink discontinued prescriptions + Flip MAR timeline + Freeze primary columns in horizontal scroll (#6282)" (#6386) This reverts commit 5009a86. * Refactor Asset Model Import Formatting (#6388) * Refactor Asset Model Import Formatting * fixes to warranty_amc_end_of_validity * Fix asset import file for cypress * Refactor: replaced Dispatch to useQuery/Request of src/Components/Auth/log… (#6333) * Refactor: replaced useDispatch to useQuery of src/Components/Auth/login.tsx * fix:useQuery changed to Request * feat: replaced dispatch with request * fix: types and added pathparams * fix: request body error * Update Login.tsx * change:Tres to Tbody * fixes: response type change * Update package-lock.json * fix hover height (#6352) * Split routes of App Router (#6363) * Prescription: show prescribed on & by and discontinued date in detail card (#6365) * Fixed bug in location picker in update facility page (#6377) * add all cases for map rendering * implement location pointer on searched location * Added cam auto reset in asset config page (#6375) * 💊 Adds support for editing prescriptions + Adds `useSlug` hook (#6369) * Adds hook: `useSlug` * bug fix: NumericWithUnits field not showing intial value * Form: support for showing global errors * Adds support for editing prescriptions (fixes #6340) * Fix cypress * fix cypress * Improve design --------- Co-authored-by: Mohammed Nihal <[email protected]> Co-authored-by: Rithvik Nishad <[email protected]> Co-authored-by: Aaron Jevil Nazareth <[email protected]> Co-authored-by: Pranshu Aggarwal <[email protected]> Co-authored-by: Gampa Sri Harsh <[email protected]> Co-authored-by: Tasnimul H. Tauhid <[email protected]>
* Middleware override feature in asset location * Fix tooltip clipping * Fix Flaky Cypress test in Facility Module (#6384) * fix random facility page failure * fix random facility page failure * Revert "Prescriptions: Shrink discontinued prescriptions + Flip MAR timeline + Freeze primary columns in horizontal scroll (#6282)" (#6386) This reverts commit 5009a86. * Refactor Asset Model Import Formatting (#6388) * Refactor Asset Model Import Formatting * fixes to warranty_amc_end_of_validity * Fix asset import file for cypress * Refactor: replaced Dispatch to useQuery/Request of src/Components/Auth/log… (#6333) * Refactor: replaced useDispatch to useQuery of src/Components/Auth/login.tsx * fix:useQuery changed to Request * feat: replaced dispatch with request * fix: types and added pathparams * fix: request body error * Update Login.tsx * change:Tres to Tbody * fixes: response type change * Update package-lock.json * fix hover height (#6352) * Split routes of App Router (#6363) * Prescription: show prescribed on & by and discontinued date in detail card (#6365) * Fixed bug in location picker in update facility page (#6377) * add all cases for map rendering * implement location pointer on searched location * Added cam auto reset in asset config page (#6375) * 💊 Adds support for editing prescriptions + Adds `useSlug` hook (#6369) * Adds hook: `useSlug` * bug fix: NumericWithUnits field not showing intial value * Form: support for showing global errors * Adds support for editing prescriptions (fixes #6340) * Fix cypress * fix cypress * Improve design --------- Co-authored-by: Mohammed Nihal <[email protected]> Co-authored-by: Rithvik Nishad <[email protected]> Co-authored-by: Aaron Jevil Nazareth <[email protected]> Co-authored-by: Pranshu Aggarwal <[email protected]> Co-authored-by: Gampa Sri Harsh <[email protected]> Co-authored-by: Tasnimul H. Tauhid <[email protected]>
WHAT
🤖 Generated by Copilot at 3208fac
This pull request adds and modifies several files to implement the feature of editing prescriptions from the
PrescriptionAdministrationsTable
component. It adds toast notifications for global form errors, refactors the validation logic for the prescription form, adds type definitions for the prescription API routes, and adds custom hooks for extracting slugs from the URL. It also fixes a formatting issue in the localization file and adds avalue
prop to theNumericWithUnitsFormField
component.Proposed Changes
useSlug
to retrieve path params from the route to remove the pain of passing it to deeply nested components.NumericWithUnitsFormField
not showing initial value@coronasafe/care-fe-code-reviewers @coronasafe/code-reviewers
Merge Checklist
HOW
🤖 Generated by Copilot at 3208fac
useSlug
anduseSlugs
to extract slugs from the current path based on prefixes (link)$all
to theFormErrors
type and display it using toast notifications in theForm
component (link, link, link)value
prop to theNumericWithUnitsFormField
component to pass the numeric value of the field (link)PrescriptionFormValidator
and import it in theCreatePrescriptionForm
component (link, link, link)EditPrescriptionForm
for editing an existing prescription, which takes an initial prescription object and a callback function as props, and renders a form with the same fields as theCreatePrescriptionForm
component, but with the initial values populated (link)EditPrescriptionFormValidator
for editing a prescription, which takes an old and a new prescription object as arguments, and calls thePrescriptionFormValidator
function on the new object, and also checks if the objects are the same, and if so, adds a global error message (link)Edit
button to thePrescriptionRow
component in thePrescriptionAdministrationsTable
component, which shows a modal dialog with theEditPrescriptionForm
component when clicked (link, link, link, link)id
property as required to theBasePrescription
type (link)TBody
andTRes
properties to thecreatePrescription
anddiscontinuePrescription
routes in theapi.tsx
file, which specify the types of the request and response bodies for the API routes (link, link, link)Medicine.json
file for the caution note and the reason for edit field in theEditPrescriptionForm
component (link)FieldError
type in theCreatePrescriptionForm.tsx
file (link)Medicine.json
file (link)