Skip to content
Open
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
504 changes: 504 additions & 0 deletions plugins/autoRegisterComponents.ts

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/Routers/PatientRouter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import useSidebarState from "@/hooks/useSidebarState";
import PatientUserProvider from "@/Providers/PatientUserProvider";
import { FacilitiesPage } from "@/pages/Facility/FacilitiesPage";
import PatientIndex from "@/pages/Patient/index";
import { PatientRegistration } from "@/pages/PublicAppointments/PatientRegistration";
import { PublicPatientRegistration } from "@/pages/PublicAppointments/PatientRegistration";
import PatientSelect from "@/pages/PublicAppointments/PatientSelect";
import { ScheduleAppointment } from "@/pages/PublicAppointments/Schedule";
import { AppointmentSuccess } from "@/pages/PublicAppointments/Success";
Expand Down Expand Up @@ -78,7 +78,7 @@ const AppointmentRoutes = {
}: {
facilityId: string;
staffId: string;
}) => <PatientRegistration facilityId={facilityId} staffId={staffId} />,
}) => <PublicPatientRegistration facilityId={facilityId} staffId={staffId} />,
};

export default function PatientRouter() {
Expand Down
6 changes: 1 addition & 5 deletions src/components/Auth/AuthHero.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ import careConfig from "@careConfig";
import { Link } from "raviger";
import { useTranslation } from "react-i18next";

import { register } from "@/lib/override";

const AuthHeroBase = () => {
export const AuthHero = () => {
const { urls, stateLogo, customLogo, customLogoAlt } = careConfig;
const customDescriptionHtml = __CUSTOM_DESCRIPTION_HTML__;
const { t } = useTranslation();
Expand Down Expand Up @@ -119,5 +117,3 @@ const AuthHeroBase = () => {
</div>
);
};

export const AuthHero = register("AuthHero", AuthHeroBase);
3 changes: 1 addition & 2 deletions src/components/Auth/Login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ import otpApi from "@/types/otp/otpApi";
import { clearQueryPersistenceCache } from "@/Utils/request/queryClient";
import { invalidateAllPaymentReconcilationLocationCaches } from "@/atoms/paymentReconcilationLocationAtom";
import { clearQueuePractitionerCache } from "@/atoms/queuePractitionerAtom";
import { register } from "@/lib/override";
import { AuthHero } from "./AuthHero";

interface OtpLoginData {
Expand Down Expand Up @@ -807,4 +806,4 @@ const Login = (props: LoginProps) => {
);
};

export default register("Login", Login);
export default Login;
4 changes: 2 additions & 2 deletions src/components/CareTeam/CareTeamSheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ type CareTeamSheetProps = {
setOpen?: (open: boolean) => void;
};

export function EmptyState() {
export function CareTeamEmptyState() {
const { t } = useTranslation();
return (
<div className="flex min-h-[200px] flex-col items-center justify-center gap-1 p-8 text-center">
Expand Down Expand Up @@ -252,7 +252,7 @@ export function CareTeamSheet({

<div className="space-y-2">
{encounter.care_team.length === 0 ? (
<EmptyState />
<CareTeamEmptyState />
) : (
encounter.care_team.map((member, index) => (
<div
Expand Down
2 changes: 1 addition & 1 deletion src/components/Common/PageHeadTitle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export interface IPageTitleProps {
title: string;
}

export default function PageTitle({ title }: IPageTitleProps) {
export default function PageHeadTitle({ title }: IPageTitleProps) {
useEffect(() => {
const prevTitle = document.title;
if (title) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export function PrintAllQuestionnaireResponses({
</h2>
</div>

<EncounterDetails
<PrintableEncounterDetails
encounter={encounter}
patient={encounter?.patient ?? patient}
/>
Expand All @@ -113,7 +113,7 @@ export function PrintAllQuestionnaireResponses({
{questionnaireResponses?.results?.map(
(item: QuestionnaireResponse) => (
<div key={item.id} className="w-full">
<ResponseCard key={item.id} item={item} />
<PrintableResponseCard key={item.id} item={item} />
</div>
),
)}
Expand Down Expand Up @@ -150,7 +150,7 @@ interface EncounterDetailsProps {
patient?: PatientRead;
}

export function EncounterDetails({
export function PrintableEncounterDetails({
encounter,
patient,
}: EncounterDetailsProps) {
Expand Down Expand Up @@ -331,7 +331,7 @@ interface ResponseCardProps {
item?: QuestionnaireResponse;
}

export function ResponseCard({ item }: ResponseCardProps) {
export function PrintableResponseCard({ item }: ResponseCardProps) {
const { t } = useTranslation();

if (!item) return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import { useTranslation } from "react-i18next";
import PrintPreview from "@/CAREUI/misc/PrintPreview";

import {
EncounterDetails,
ResponseCard,
PrintableEncounterDetails as EncounterDetails,
PrintableResponseCard as ResponseCard,
} from "@/components/Facility/ConsultationDetails/PrintAllQuestionnaireResponses";

import query from "@/Utils/request/query";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { Label } from "@/components/ui/label";
import { ScrollArea, ScrollBar } from "@/components/ui/scroll-area";

import { TableSkeleton } from "@/components/Common/SkeletonLoading";
import { EmptyState } from "@/components/Medicine/MedicationRequestTable";
import { MedicationRequestEmptyState as EmptyState } from "@/components/Medicine/MedicationRequestTable";

import mutate from "@/Utils/request/mutate";
import query from "@/Utils/request/query";
Expand Down
6 changes: 3 additions & 3 deletions src/components/Medicine/MedicationRequestTable/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@ import { MedicationStatementList } from "@/components/Patient/MedicationStatemen

import { useEncounter } from "@/pages/Encounters/utils/EncounterProvider";

interface EmptyStateProps {
interface MedicationRequestEmptyStateProps {
searching?: boolean;
searchQuery?: string;
message?: string;
description?: string;
}

export const EmptyState = ({
export const MedicationRequestEmptyState = ({
searching,
searchQuery,
message,
description,
}: EmptyStateProps) => {
}: MedicationRequestEmptyStateProps) => {
const { t } = useTranslation();

return (
Expand Down
2 changes: 1 addition & 1 deletion src/components/Patient/Common/EmptyState.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useTranslation } from "react-i18next";

import { Skeleton } from "@/components/ui/skeleton";

export default function EmptyState({
export default function PatientClinicalEmptyState({
title,
description,
}: {
Expand Down
2 changes: 1 addition & 1 deletion src/components/Patient/MedicationStatementList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { Button } from "@/components/ui/button";
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";

import { TableSkeleton } from "@/components/Common/SkeletonLoading";
import { EmptyState } from "@/components/Medicine/MedicationRequestTable";
import { MedicationRequestEmptyState as EmptyState } from "@/components/Medicine/MedicationRequestTable";

import query from "@/Utils/request/query";
import { PaginatedResponse } from "@/Utils/request/types";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ interface FacilityOrganizationSelectorProps {
singleSelection?: boolean;
}

export default function FacilityOrganizationSelector(
export default function AdminFacilityOrganizationSelector(
props: FacilityOrganizationSelectorProps,
) {
const { t } = useTranslation();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import { scheduleServiceTypeAtom } from "@/atoms/scheduleServiceTypeAtom";
import { Button } from "@/components/ui/button";
import { Drawer, DrawerContent, DrawerTrigger } from "@/components/ui/drawer";

import { register } from "@/lib/override";
import { AppointmentSlotPicker } from "@/pages/Appointments/BookAppointment/AppointmentSlotPicker";
import useCurrentFacility from "@/pages/Facility/utils/useCurrentFacility";
import { TagConfig } from "@/types/emr/tagConfig/tagConfig";
Expand All @@ -27,7 +26,7 @@ export interface BookAppointmentDetailsProps {
onSuccess?: () => void;
}

const BookAppointmentDetailsBase = ({
export const BookAppointmentDetails = ({
patientId,
onSuccess,
}: BookAppointmentDetailsProps) => {
Expand Down Expand Up @@ -242,8 +241,3 @@ const BookAppointmentDetailsBase = ({
</div>
);
};

export const BookAppointmentDetails = register(
"BookAppointmentDetails",
BookAppointmentDetailsBase,
);
5 changes: 1 addition & 4 deletions src/pages/Encounters/tabs/overview/quick-actions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import {

import { ShortcutBadge } from "@/Utils/keyboardShortcutComponents";

import { register } from "@/lib/override";
import { FormDialog } from "./FormsDialog";

export const QuickActions = (props: React.ComponentProps<"div">) => {
Expand Down Expand Up @@ -72,9 +71,7 @@ export const QuickActions = (props: React.ComponentProps<"div">) => {
);
};

export const QuickAction = register("QuickAction", QuickActionBase);

function QuickActionBase({
export function QuickAction({
icon,
title,
actionId,
Comment on lines +74 to 77
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import accountApi from "@/types/billing/account/accountApi";

import { cn } from "@/lib/utils";
import { toast } from "sonner";
import { EmptyState } from "./empty-state";
import { SummaryPanelEmptyState as EmptyState } from "./empty-state";

export const Account = () => {
const { t } = useTranslation();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { CardListSkeleton } from "@/components/Common/SkeletonLoading";

import { useEncounter } from "@/pages/Encounters/utils/EncounterProvider";

import { EmptyState } from "./empty-state";
import { SummaryPanelEmptyState as EmptyState } from "./empty-state";

export const DepartmentsAndTeams = () => {
const { t } = useTranslation();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { CardListSkeleton } from "@/components/Common/SkeletonLoading";

import { useEncounter } from "@/pages/Encounters/utils/EncounterProvider";

import { EmptyState } from "./empty-state";
import { SummaryPanelEmptyState as EmptyState } from "./empty-state";

export const DischargeDetails = () => {
const { t } = useTranslation();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import CareIcon from "@/CAREUI/icons/CareIcon";

export const EmptyState = ({ message }: { message: string }) => (
export const SummaryPanelEmptyState = ({ message }: { message: string }) => (
<div className={"flex flex-row items-center justify-start"}>
<CareIcon icon="l-info-circle" className="size-8 text-gray-400" />
<span className="text-sm text-gray-500 font-medium">{message}</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { useEncounter } from "@/pages/Encounters/utils/EncounterProvider";
import { useQueryClient } from "@tanstack/react-query";
import { SquarePen } from "lucide-react";
import { useTranslation } from "react-i18next";
import { EmptyState } from "./empty-state";
import { SummaryPanelEmptyState as EmptyState } from "./empty-state";

export const EncounterTags = () => {
const { canWriteSelectedEncounter: canEdit, selectedEncounter: encounter } =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { LocationTree } from "@/components/Location/LocationTree";

import { useEncounter } from "@/pages/Encounters/utils/EncounterProvider";

import { EmptyState } from "./empty-state";
import { SummaryPanelEmptyState as EmptyState } from "./empty-state";

export const Locations = () => {
const { t } = useTranslation();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { useEncounter } from "@/pages/Encounters/utils/EncounterProvider";

import { formatName } from "@/Utils/utils";

import { EmptyState } from "./empty-state";
import { SummaryPanelEmptyState as EmptyState } from "./empty-state";

export const ManageCareTeam = () => {
const { t } = useTranslation();
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Facility/FacilityDetailsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import publicFacilityApi from "@/types/facility/publicFacilityApi";
import { goBack } from "@/Utils/utils";
import { Button } from "@/components/ui/button";
import { FeatureBadge } from "./Utils";
import { UserCard } from "./components/UserCard";
import { FacilityUserCard as UserCard } from "./components/UserCard";

interface Props {
id: string;
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Facility/components/UserCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ interface Props {
facilityId: string;
}

export function UserCard({ user, className, facilityId }: Props) {
export function FacilityUserCard({ user, className, facilityId }: Props) {
const { t } = useTranslation();
const { patientToken: tokenData } = useAuthContext();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { useTranslation } from "react-i18next";

import Page from "@/components/Common/Page";
import { ResourceCategoryList } from "@/components/Common/ResourceCategoryList";
import { ActivityDefinitionList as ActivityDefinitionListComponent } from "@/pages/Facility/settings/activityDefinition/ActivityDefinitionListComponent";
import { ActivityDefinitionListContent } from "@/pages/Facility/settings/activityDefinition/ActivityDefinitionListComponent";
import { ResourceCategoryResourceType } from "@/types/base/resourceCategory/resourceCategory";
import { Status } from "@/types/emr/activityDefinition/activityDefinition";
import activityDefinitionApi from "@/types/emr/activityDefinition/activityDefinitionApi";
Expand Down Expand Up @@ -58,7 +58,7 @@ export default function ActivityDefinitionList({
}}
>
{categorySlug && (
<ActivityDefinitionListComponent
<ActivityDefinitionListContent
facilityId={facilityId}
categorySlug={categorySlug}
setAllowCategoryCreate={setAllowCategoryCreate}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ interface ActivityDefinitionListProps {
setAllowCategoryCreate: (allow: boolean) => void;
}

export function ActivityDefinitionList({
export function ActivityDefinitionListContent({
facilityId,
categorySlug,
setAllowCategoryCreate,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import queryClient from "@/Utils/request/queryClient";

type DuoToneIconName = keyof typeof duoToneIcons;

export default function HealthcareServiceShow({
export default function SettingsHealthcareServiceShow({
facilityId,
healthcareServiceId,
}: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import locationApi from "@/types/location/locationApi";
import LocationMap from "./LocationMap";
import LocationSheet from "./LocationSheet";
import LocationView from "./LocationView";
import { LocationCard } from "./components/LocationCard";
import { SettingsLocationCard as LocationCard } from "./components/LocationCard";
import { LocationTable } from "./components/LocationTable";

interface LocationSettingsProps {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Facility/settings/locations/LocationSheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ interface Props {
parentId?: string;
}

export default function LocationSheet({
export default function SettingsLocationSheet({
open,
onOpenChange,
facilityId,
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Facility/settings/locations/LocationView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import { LocationRead } from "@/types/location/location";
import locationApi from "@/types/location/locationApi";

import LocationSheet from "./LocationSheet";
import { LocationCard } from "./components/LocationCard";
import { SettingsLocationCard as LocationCard } from "./components/LocationCard";
import { LocationTable } from "./components/LocationTable";

interface Props {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ interface Props {
setPage?: (page: number) => void;
}

export function LocationCard({
export function SettingsLocationCard({
location,
onEdit,
onView,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ interface Props {
trigger?: React.ReactNode;
}

export default function EditUserRoleSheet({
export default function EditFacilityUserRoleSheet({
facilityId,
organizationId,
userRole,
Expand Down
Loading
Loading