-
Notifications
You must be signed in to change notification settings - Fork 412
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
fix: Added Validation for Insurance input fields in patient registration issue (#8672) #8681
base: develop
Are you sure you want to change the base?
fix: Added Validation for Insurance input fields in patient registration issue (#8672) #8681
Conversation
❌ Deploy Preview for care-ohc failed.
|
@syedfardeenjeelani is this ready for review? |
we are getting the error from the validator.ts which is something like this so should i use field_required from the i18n locale here instead of "All fields are mandatory" |
yes |
Thanks I'll do the changes and push |
@rithviknishad if we do it like this then it will also show it right here or should we handle both cases seprately |
Let's keep the error texts same as before itself instead of showing the error on ALL fields, just that ensure ALL fields required validation happens as mentioned in the issue. |
@rithviknishad I've made some changes based on your feedback, but I'm not sure if I got it right. Could you take a look at my PR when you get a chance and let me know if i am headed in the right direction or not ? |
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.
Only validation logic in this file needs to be modified: https://github.com/ohcnetwork/care_fe/blob/develop/src/Components/HCX/validators.ts
label={t("policy__insurer_name")} | ||
error={error} |
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.
error={error} |
@@ -133,6 +138,7 @@ const InsuranceDetailEditCard = ({ | |||
<TextFormField | |||
required | |||
name="policy_id" | |||
error={error} |
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.
error={error} |
@@ -125,6 +129,7 @@ const InsuranceDetailEditCard = ({ | |||
<TextFormField | |||
required | |||
name="subscriber_id" | |||
error={error} |
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.
error={error} |
}: { | ||
policy: HCXPolicyModel; | ||
handleUpdate: (event: FieldChangeEvent<unknown>) => void; | ||
handleUpdates: (diffs: object) => void; | ||
handleRemove: () => void; | ||
gridView?: boolean; | ||
error: FieldError; |
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.
error: FieldError; |
@@ -91,12 +93,14 @@ const InsuranceDetailEditCard = ({ | |||
handleUpdates, | |||
handleRemove, | |||
gridView, | |||
error, |
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.
error, |
@@ -73,6 +74,7 @@ export default function InsuranceDetailsBuilder(props: Props) { | |||
> | |||
<InsuranceDetailEditCard | |||
policy={policy} | |||
error={props.error} |
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.
error={props.error} |
@@ -15,6 +15,7 @@ import request from "../../Utils/request/request"; | |||
import routes from "../../Redux/api"; | |||
import { useTranslation } from "react-i18next"; | |||
import careConfig from "@careConfig"; | |||
import { FieldError } from "../Form/FieldValidators"; |
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.
import { FieldError } from "../Form/FieldValidators"; |
src/Redux/fireRequest.tsx
Outdated
console.log(error.response.data.detaillocal_ip_address); | ||
// Notification.BadRequest({ | ||
// errs: error.response.data, | ||
// }); | ||
// return error.response; |
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.
Why was this changed?
hey @rithviknishad should it be something like this also do we only have to change this particular file and nothing else |
yes |
@rithviknishad can you verify is it ready for testing |
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.
texts to be in i18n locale files
@rithviknishad hello should i put them in common.json |
…njeelani/care_fe into issues/8672/fix-issue
👋 Hi, @syedfardeenjeelani, This message is automatically generated by prince-chrismc/label-merge-conflicts-action so don't hesitate to report issues/improvements there. |
Put in |
okay |
👋 Hi, @syedfardeenjeelani, This message is automatically generated by prince-chrismc/label-merge-conflicts-action so don't hesitate to report issues/improvements there. |
Hey @syedfardeenjeelani , Please check by adding this line |
👋 Hi, @syedfardeenjeelani, This message is automatically generated by prince-chrismc/label-merge-conflicts-action so don't hesitate to report issues/improvements there. |
@syedfardeenjeelani could you resolve the merge conflicts? |
ensure the en.json file has keys sorted. pre-commit should do it for you if setup properly. |
968340c
to
f5a2651
Compare
@nihal467 please test this |
src/Locale/en.json
Outdated
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.
why is the entire file having a change?
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.
pre-commit was not sorting keys for me so i used https://codeshack.io/json-sorter/
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 npm run sort-locales
instead; also why is pre-commit not sorting?
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.
i will look into it @rithviknishad also can you please tell me if i should hard reset to commit f5a265172e499e4f4016be1453751680b7eb416b (fixed validation)
Proposed Changes
All.fields.are.mandatory.1.mp4
@ohcnetwork/care-fe-code-reviewers
Merge Checklist