-
Notifications
You must be signed in to change notification settings - Fork 547
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
Vaccination Details frontend #8035
Conversation
@hrit2773 is attempting to deploy a commit to the Open Healthcare Network Team on Vercel. A member of the Team first needs to authorize it. |
✅ Deploy Preview for care-egov-staging ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hrit2773 nicely done, but few changes are needed, here are the gist of changes needed:
- remove unnecessary console logs
- avoid using any or unknown
- use useQuery to fetch data
- use translation whereever possible
- follow the existing conversion used in care while creating new forms
const fetchAllVaccines = useCallback(async () => { | ||
setIsVaccineLoading(true); | ||
const { res, data } = await request(routes.getVaccines); | ||
if (res?.ok && data?.results) { | ||
setVaccinesList(data.results); | ||
} | ||
setIsVaccineLoading(false); | ||
console.log(data?.results); | ||
return data?.results || []; | ||
}, []); | ||
useEffect(() => { | ||
fetchAllVaccines(); | ||
}, []); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use useQuery which keeps the code clean and no need of extra states like vaccinesList and isVaccineLoading
@@ -756,6 +777,7 @@ export const PatientRegister = (props: PatientRegisterProps) => { | |||
is_active: true, | |||
ration_card_category: formData.ration_card_category, | |||
}; | |||
console.log(data); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
console.log(data); |
@@ -1738,15 +1760,15 @@ export const PatientRegister = (props: PatientRegisterProps) => { | |||
} | |||
title={ | |||
<h1 className="text-left text-xl font-bold text-purple-500"> | |||
COVID Details | |||
Complete Vaccination Details |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use internationalization, we are working on adding it through out the application, so when you come across an instance where it is not used while making changes, please feel free to add
</tr> | ||
</thead> | ||
<tbody> | ||
{props.vaccineData?.map((detail: any) => ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
avoid using any
}; | ||
const hasError = props.disallowed.includes(state.vaccine_name); | ||
return ( | ||
<div className=" flex flex-col gap-2"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use form component and structure it similar to the existing forms, checkout patient register form for reference.
@khavinshankar thanks for pointing them will make these changes and update it soon. |
@khavinshankar the add vaccination details form is similar to that of consultation diagnosis. The only difference being that it has multiple form fields. we dont need the restore button offered by the form component. And when we press add vaccination details it should just display the details and not submit it by whole. Submitting will be handled by patient register. So should i still use the form component? because pressing the submit button is reloading the page. Moreover, its not a seperate form, the vaccination details are entered in the patient register form itself. Multiple vaccines can be added. So i think form component is not needed. That may make it look like a completely independent form layout |
Hi, This pr has been automatically marked as stale because it has not had any recent activity. It will be automatically closed if no further activity occurs for 7 more days. Thank you for your contributions. |
Hi, This pr has been automatically marked as stale because it has not had any recent activity. It will be automatically closed if no further activity occurs for 7 more days. Thank you for your contributions. |
👋 Hi, @hrit2773, This message is automatically generated by prince-chrismc/label-merge-conflicts-action so don't hesitate to report issues/improvements there. |
Hi, This pr has been automatically marked as stale because it has not had any recent activity. It will be automatically closed if no further activity occurs for 7 more days. Thank you for your contributions. |
Hi, @coronasafe/care-frontend-maintainers, This PR has been automatically closed due to inactivity. Thank you for your contributions. Feel free to re-open the PR. |
Proposed Changes