-
Notifications
You must be signed in to change notification settings - Fork 437
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
Add autosave to forms #5731
Add autosave to forms #5731
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 settings. |
👋 Hi, @Ashesh3, This message is automatically generated by prince-chrismc/label-merge-conflicts-action so don't hesitate to report issues/improvements there. |
@nihal467 Made the fixes |
LGTM |
@Ashesh3 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 🙌. |
WHAT
🤖 Generated by Copilot at 1690c7a
The pull request adds auto-save and draft functionality to various forms in the application, such as consultation, facility, daily rounds, patient register, and user add forms. It uses a custom hook
useAutoSaveReducer
and a componentDraftSection
to handle the logic and UI for saving and restoring form state. It also refactors some form components and types to support the new features and fixes some minor bugs.Proposed Changes
@coronasafe/care-fe-code-reviewers @coronasafe/code-reviewers
HOW
🤖 Generated by Copilot at 1690c7a
permanent_address
field toPatientModel
interface and patient register form (link, link, link)sameAddress
field toUserForm
type and state to store whether current address and permanent address are the same (link, link)sameAddress
field and conditionally renderpermanent_address
field (link, link)fetchData
,validateForm
, andhandleSubmit
functions to usestate.form.sameAddress
andstate.form.permanent_address
fields (link, link, link)phone_number_is_whatsapp
field toUserForm
type and user add form (link, link, link)phone_number_is_whatsapp
field and conditionally renderalt_phone_number
field (link, link)useAbortableEffect
andhandleSubmit
functions to usestate.form.phone_number_is_whatsapp
andstate.form.alt_phone_number
fields (link, link)InvestigationAdvice
andprocedures
fields toFormDetails
type and consultation form (link, link, link, link)fetchData
,validateForm
, andhandleSubmit
functions to usestate.form.InvestigationAdvice
andstate.form.procedures
fields (link, link, link, link)InvestigationBuilder
andProcedureBuilder
components to usehandleFormFieldChange
function to update the fields (link, link)CollapseV2
component by removingoverflow-hidden
class (link)DateFormField
component expected aDate
object as thevalue
prop by handling the case where thefield.value
was a string (link)useReducer
imports from various files (link, link, link, link, link, link)excludeFromDraft
parameter toFormContextValue
type to allow form fields to opt out of the draft functionality (link)