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

Vaccination Details frontend #8035

Closed
wants to merge 7 commits into from
Closed

Conversation

hrit2773
Copy link
Contributor

Copy link

vercel bot commented Jun 18, 2024

@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.

Copy link

netlify bot commented Jun 18, 2024

Deploy Preview for care-egov-staging ready!

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

Copy link
Member

@khavinshankar khavinshankar left a 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:

  1. remove unnecessary console logs
  2. avoid using any or unknown
  3. use useQuery to fetch data
  4. use translation whereever possible
  5. follow the existing conversion used in care while creating new forms

Comment on lines 232 to 244
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();
}, []);
Copy link
Member

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);
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
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
Copy link
Member

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) => (
Copy link
Member

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">
Copy link
Member

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.

@hrit2773
Copy link
Contributor Author

@khavinshankar thanks for pointing them will make these changes and update it soon.

@hrit2773
Copy link
Contributor Author

hrit2773 commented Jun 19, 2024

@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

Copy link

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.

@github-actions github-actions bot added the stale label Jun 27, 2024
@github-actions github-actions bot removed the stale label Jun 28, 2024
Copy link

github-actions bot commented Jul 5, 2024

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.

@github-actions github-actions bot added the stale label Jul 5, 2024
Copy link

👋 Hi, @hrit2773,
Conflicts have been detected against the base branch. Please rebase your branch against the base branch.


This message is automatically generated by prince-chrismc/label-merge-conflicts-action so don't hesitate to report issues/improvements there.

@github-actions github-actions bot added merge conflict pull requests with merge conflict and removed stale labels Jul 11, 2024
@hrit2773 hrit2773 closed this Jul 13, 2024
@hrit2773 hrit2773 reopened this Jul 13, 2024
Copy link

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.

@github-actions github-actions bot added the stale label Jul 21, 2024
Copy link

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.

@github-actions github-actions bot closed this Jul 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changes required merge conflict pull requests with merge conflict stale
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Migrate to a New Model for Storing Vaccination Details of a Patient
2 participants