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

Fix: showing "-" in the emergency contact person field to represent the field is null #10323

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/components/Patient/PatientDetailsTab/Demography.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export const Demography = (props: PatientProps) => {
{t("emergency_contact_person_name")}
</div>
<div className="mt-1 text-sm font-semibold leading-5 text-gray-900">
{props.name || "-"}
-
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

The change contradicts the PR objective.

The PR objective is to show "-" when the emergency contact person field is null. However, the current change always shows "-" even when a valid name is provided through props.name.

Apply this diff to fix the logic:

-            -
+            {props.name || "-"}

This will:

  • Show the name when it's provided
  • Show "-" only when the name is null/undefined
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
-
{props.name || "-"}

</div>
</div>
</div>
Expand Down