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

added PatientDetailsTabDemographyGeneralInfo plaggable #10418

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
6 changes: 6 additions & 0 deletions src/components/Patient/PatientDetailsTab/Demography.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

import { GENDER_TYPES } from "@/common/constants";

import { PLUGIN_Component } from "@/PluginEngine";
import { formatPatientAge } from "@/Utils/utils";
import {
Organization,
Expand Down Expand Up @@ -135,6 +136,11 @@
id: "general-info",
allowEdit: true,
details: [
<PLUGIN_Component
key="patient_details_tab__demography__general_info"
__name="PatientDetailsTabDemographyGeneralInfo"
{...props}
/>,

Check failure on line 143 in src/components/Patient/PatientDetailsTab/Demography.tsx

View workflow job for this annotation

GitHub Actions / cypress-run (1)

Property 'id' is missing in type '{ facilityId: string; patientId: string; patientData: Patient; key: string; __name: "PatientDetailsTabDemographyGeneralInfo"; }' but required in type '{ facilityId: string; id: string; patientData: Patient; }'.
Comment on lines +143 to +147
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

Fix prop type mismatch causing build failure.

The component requires an id prop, but receives patientId from the spread props. This type mismatch is causing the build to fail.

Apply this fix to resolve the type error:

 <PLUGIN_Component
   key="patient_details_tab__demography__general_info"
   __name="PatientDetailsTabDemographyGeneralInfo"
-  {...props}
+  facilityId={facilityId}
+  id={id}
+  patientData={patientData}
 />
📝 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
<PLUGIN_Component
key="patient_details_tab__demography__general_info"
__name="PatientDetailsTabDemographyGeneralInfo"
{...props}
/>,
<PLUGIN_Component
key="patient_details_tab__demography__general_info"
__name="PatientDetailsTabDemographyGeneralInfo"
facilityId={facilityId}
id={id}
patientData={patientData}
/>,
🧰 Tools
🪛 GitHub Check: cypress-run (1)

[failure] 143-143:
Property 'id' is missing in type '{ facilityId: string; patientId: string; patientData: Patient; key: string; __name: "PatientDetailsTabDemographyGeneralInfo"; }' but required in type '{ facilityId: string; id: string; patientData: Patient; }'.

🪛 GitHub Actions: Cypress Tests

[error] 143-143: Property 'id' is missing in type '{ facilityId: string; patientId: string; patientData: Patient; key: string; __name: "PatientDetailsTabDemographyGeneralInfo"; }' but required in type '{ facilityId: string; id: string; patientData: Patient; }'.


[warning] ExperimentalWarning: Importing JSON modules is an experimental feature and might change at any time.

{ label: t("full_name"), value: patientData.name },
{
label: t("phone_number"),
Expand Down
7 changes: 7 additions & 0 deletions src/pluginTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ export type PatientRegistrationFormComponentType = React.FC<{
patientId?: string;
}>;

export type PatientDetailsTabDemographyGeneralInfoComponentType = React.FC<{
facilityId: string;
id: string;
patientData: Patient;
}>;

// Define supported plugin components
export type SupportedPluginComponents = {
DoctorConnectButtons: DoctorConnectButtonComponentType;
Expand All @@ -49,6 +55,7 @@ export type SupportedPluginComponents = {
PatientInfoCardActions: PatientInfoCardActionsComponentType;
FacilityHomeActions: FacilityHomeActionsComponentType;
PatientRegistrationForm: PatientRegistrationFormComponentType;
PatientDetailsTabDemographyGeneralInfo: PatientDetailsTabDemographyGeneralInfoComponentType;
};

// Create a type for lazy-loaded components
Expand Down
Loading