diff --git a/src/Components/Assets/AssetConfigure.tsx b/src/Components/Assets/AssetConfigure.tsx index 4e5866c1af5..1d71770d3cc 100644 --- a/src/Components/Assets/AssetConfigure.tsx +++ b/src/Components/Assets/AssetConfigure.tsx @@ -1,6 +1,5 @@ import React, { useCallback } from "react"; import Loading from "../Common/Loading"; -import PageTitle from "../Common/PageTitle"; import { AssetData } from "./AssetTypes"; import { statusType, useAbortableEffect } from "../../Common/utils"; import { useDispatch } from "react-redux"; @@ -8,6 +7,7 @@ import { getAsset } from "../../Redux/actions"; import * as Notification from "../../Utils/Notifications.js"; import HL7Monitor from "./AssetType/HL7Monitor"; import ONVIFCamera from "./AssetType/ONVIFCamera"; +import Page from "../Common/components/Page"; interface AssetConfigureProps { assetId: string; @@ -49,37 +49,35 @@ const AssetConfigure = (props: AssetConfigureProps) => { if (isLoading) return ; return ( -
+ <> {assetType === "HL7MONITOR" ? ( - <> - + - + ) : ( - <> - + - + )} -
+ ); }; diff --git a/src/Components/Assets/AssetManage.tsx b/src/Components/Assets/AssetManage.tsx index 775f014f74f..d2f528ff5f5 100644 --- a/src/Components/Assets/AssetManage.tsx +++ b/src/Components/Assets/AssetManage.tsx @@ -20,7 +20,7 @@ import ButtonV2 from "../Common/components/ButtonV2"; import { UserRole, USER_TYPES } from "../../Common/constants"; import moment from "moment"; import ConfirmDialogV2 from "../Common/ConfirmDialogV2"; -const PageTitle = loadable(() => import("../Common/PageTitle")); +import Page from "../Common/components/Page"; const Loading = loadable(() => import("../Common/Loading")); interface AssetManageProps { @@ -201,17 +201,16 @@ const AssetManage = (props: AssetManageProps) => { }; return ( -
- + { />
)} - + ); }; diff --git a/src/Components/Assets/AssetsList.tsx b/src/Components/Assets/AssetsList.tsx index eda93c2dea0..1c9c7405df2 100644 --- a/src/Components/Assets/AssetsList.tsx +++ b/src/Components/Assets/AssetsList.tsx @@ -2,7 +2,6 @@ import { useDispatch } from "react-redux"; import QrReader from "react-qr-reader"; import { statusType, useAbortableEffect } from "../../Common/utils"; import * as Notification from "../../Utils/Notifications.js"; -import PageTitle from "../Common/PageTitle"; import { getAnyFacility, listAssets, @@ -29,6 +28,7 @@ import AuthorizeFor from "../../Utils/AuthorizeFor"; import ButtonV2 from "../Common/components/ButtonV2"; import FacilitiesSelectDialogue from "../ExternalResult/FacilitiesSelectDialogue"; import ExportMenu from "../Common/Export"; +import Page from "../Common/components/Page"; const Loading = loadable(() => import("../Common/Loading")); @@ -265,52 +265,57 @@ const AssetsList = () => { } return ( -
-
- - {authorizedForImportExport && ( -
- {!facility && ( - -

Select a facility from the Facilities

-

page and click 'View Assets' from the

-

Manage Facility dropdown

-
- )} - {/* TODO: ask for facility select dialog instead of disabling */} - setImportAssetModalOpen(true), - options: { - icon: , - onClick: () => setImportAssetModalOpen(true), + + {authorizedForImportExport && ( +
+ {!facility && ( + +

Select a facility from the Facilities

+

page and click 'View Assets' from the

+

Manage Facility dropdown

+
+ )} + {/* TODO: ask for facility select dialog instead of disabling */} + setImportAssetModalOpen(true), + options: { + icon: , + onClick: () => setImportAssetModalOpen(true), + }, }, - }, - { - label: "Export Assets", - action: () => - authorizedForImportExport && - listAssets({ - ...qParams, - json: true, - limit: totalCount, - }), - type: "json", - filePrefix: `assets_${facility?.name}`, - options: { - icon: , - disabled: totalCount === 0 || !authorizedForImportExport, + { + label: "Export Assets", + action: () => + authorizedForImportExport && + listAssets({ + ...qParams, + json: true, + limit: totalCount, + }), + type: "json", + filePrefix: `assets_${facility?.name}`, + options: { + icon: , + disabled: totalCount === 0 || !authorizedForImportExport, + }, }, - }, - ]} - /> -
- )} -
+ ]} + /> +
+ )} + + } + >
@@ -385,7 +390,7 @@ const AssetsList = () => { ]} />
-
+
{manageAssets}
@@ -409,7 +414,7 @@ const AssetsList = () => { setSelectedFacility({ name: "" }); }} /> -
+ ); }; diff --git a/src/Components/Common/Export.tsx b/src/Components/Common/Export.tsx index 58e56a03ee1..68e27cb381e 100644 --- a/src/Components/Common/Export.tsx +++ b/src/Components/Common/Export.tsx @@ -71,7 +71,7 @@ export const ExportButton = ({ exportFile(props.action, props.filenamePrefix, type)} - className="mx-2 tooltip p-4 text-lg text-secondary-800 disabled:text-secondary-500 disabled:bg-transparent" + className="mx-2 tooltip px-4 text-lg text-secondary-800 disabled:text-secondary-500 disabled:bg-transparent" variant="secondary" ghost circle diff --git a/src/Components/Common/PageTitle.tsx b/src/Components/Common/PageTitle.tsx index 6ed7c442344..006258d83cb 100644 --- a/src/Components/Common/PageTitle.tsx +++ b/src/Components/Common/PageTitle.tsx @@ -3,12 +3,12 @@ import Breadcrumbs from "./Breadcrumbs"; import PageHeadTitle from "./PageHeadTitle"; import { classNames, goBack } from "../../Utils/utils"; -interface PageTitleProps { +export interface PageTitleProps { title: string; hideBack?: boolean; backUrl?: string; backButtonCB?: () => number | void; - className?: string; + // className?: string; componentRight?: React.ReactNode; justifyContents?: | "justify-center" @@ -27,7 +27,7 @@ export default function PageTitle({ hideBack = false, backUrl, backButtonCB, - className = "", + // className = "", componentRight = <>, breadcrumbs = true, crumbsReplacements = {}, @@ -46,13 +46,13 @@ export default function PageTitle({ backButtonCB ? goBack(backButtonCB()) : goBack(backUrl); return ( -
+
{!hideBack && ( diff --git a/src/Components/Common/components/Page.tsx b/src/Components/Common/components/Page.tsx new file mode 100644 index 00000000000..0ae9741c08a --- /dev/null +++ b/src/Components/Common/components/Page.tsx @@ -0,0 +1,38 @@ +import { RefObject } from "react"; +import PageTitle, { PageTitleProps } from "../PageTitle"; + +interface PageProps extends PageTitleProps { + children: any; + options?: any; + className?: string; + noImplicitPadding?: boolean; + ref?: RefObject; +} + +export default function Page(props: PageProps) { + let padding = ""; + if (!props.noImplicitPadding) { + if (!props.hideBack || props.componentRight) padding = "px-6 py-3.5"; + else padding = "px-6 py-5"; + } + + return ( +
+
+ + {props.options} +
+ {props.children} +
+ ); +} diff --git a/src/Components/Dashboard/HubDashboard.tsx b/src/Components/Dashboard/HubDashboard.tsx index 34a099ff9ca..e15dd6da41f 100644 --- a/src/Components/Dashboard/HubDashboard.tsx +++ b/src/Components/Dashboard/HubDashboard.tsx @@ -1,5 +1,4 @@ import React from "react"; -import PageTitle from "../Common/PageTitle"; import LiveFeedTile from "../Hub/LiveFeedTile"; export default function HubDashboard() { diff --git a/src/Components/ExternalResult/ExternalResultUpload.tsx b/src/Components/ExternalResult/ExternalResultUpload.tsx index 040fe25b39f..06f8beab215 100644 --- a/src/Components/ExternalResult/ExternalResultUpload.tsx +++ b/src/Components/ExternalResult/ExternalResultUpload.tsx @@ -1,4 +1,3 @@ -import loadable from "@loadable/component"; import _ from "lodash"; import { navigate } from "raviger"; import { useState } from "react"; @@ -6,7 +5,7 @@ import CSVReader from "react-csv-reader"; import { useDispatch } from "react-redux"; import { externalResultUploadCsv } from "../../Redux/actions"; import * as Notification from "../../Utils/Notifications.js"; -const PageTitle = loadable(() => import("../Common/PageTitle")); +import Page from "../Common/components/Page"; export default function ExternalResultUpload() { const dispatch: any = useDispatch(); @@ -58,12 +57,7 @@ export default function ExternalResultUpload() { }; return ( -
- +
@@ -139,6 +133,6 @@ export default function ExternalResultUpload() {
-
+ ); } diff --git a/src/Components/ExternalResult/ResultItem.tsx b/src/Components/ExternalResult/ResultItem.tsx index e04d2f83de8..7218fe7eba5 100644 --- a/src/Components/ExternalResult/ResultItem.tsx +++ b/src/Components/ExternalResult/ResultItem.tsx @@ -6,13 +6,13 @@ import { externalResult, deleteExternalResult } from "../../Redux/actions"; import * as Notification from "../../Utils/Notifications.js"; import { navigate } from "raviger"; import AlertDialog from "../Common/AlertDialog"; +import Page from "../Common/components/Page"; const Loading = loadable(() => import("../Common/Loading")); -const PageTitle = loadable(() => import("../Common/PageTitle")); export default function ResultItem(props: any) { const dispatch: any = useDispatch(); - let initialData: any = {}; + const initialData: any = {}; const [data, setData] = useState(initialData); const [isLoading, setIsLoading] = useState(true); const [showDeleteAlert, setShowDeleteAlert] = useState(false); @@ -59,9 +59,7 @@ export default function ResultItem(props: any) { } return ( -
- - + {showDeleteAlert && ( )} -
+
-
+
); } diff --git a/src/Components/ExternalResult/ResultList.tsx b/src/Components/ExternalResult/ResultList.tsx index 93a4a77e836..d74a5ca3da8 100644 --- a/src/Components/ExternalResult/ResultList.tsx +++ b/src/Components/ExternalResult/ResultList.tsx @@ -15,9 +15,9 @@ import useFilters from "../../Common/hooks/useFilters"; import CareIcon from "../../CAREUI/icons/CareIcon"; import ExportMenu from "../Common/Export"; import PhoneNumberFormField from "../Form/FormFields/PhoneNumberFormField"; +import Page from "../Common/components/Page"; const Loading = loadable(() => import("../Common/Loading")); -const PageTitle = loadable(() => import("../Common/PageTitle")); export default function ResultList() { const dispatch: any = useDispatch(); @@ -215,20 +215,11 @@ export default function ResultList() { } return ( -
- setSelectedFacility(e)} - selectedFacility={selectedFacility} - handleOk={() => - navigate(`facility/${selectedFacility.id}/patient`, { - query: { extId: resultId }, - }) - } - handleCancel={() => setShowDialog(false)} - /> -
- + -
+ } + > + setSelectedFacility(e)} + selectedFacility={selectedFacility} + handleOk={() => + navigate(`facility/${selectedFacility.id}/patient`, { + query: { extId: resultId }, + }) + } + handleCancel={() => setShowDialog(false)} + />
@@ -351,6 +354,6 @@ export default function ResultList() {
-
+ ); } diff --git a/src/Components/ExternalResult/ResultUpdate.tsx b/src/Components/ExternalResult/ResultUpdate.tsx index 1190a039513..54c91d8c7aa 100644 --- a/src/Components/ExternalResult/ResultUpdate.tsx +++ b/src/Components/ExternalResult/ResultUpdate.tsx @@ -22,9 +22,9 @@ import { MultilineInputField, SelectField } from "../Common/HelperInputFields"; import { navigate } from "raviger"; import { goBack } from "../../Utils/utils"; import { Cancel, Submit } from "../Common/components/ButtonV2"; +import Page from "../Common/components/Page"; const Loading = loadable(() => import("../Common/Loading")); -const PageTitle = loadable(() => import("../Common/PageTitle")); const initForm = { address: "", @@ -223,8 +223,7 @@ export default function UpdateResult(props: any) { } return ( -
- +

@@ -329,6 +328,6 @@ export default function UpdateResult(props: any) {

-
+ ); } diff --git a/src/Components/Facility/AddBedForm.tsx b/src/Components/Facility/AddBedForm.tsx index 1e3009bb7b6..3ca20d8b73b 100644 --- a/src/Components/Facility/AddBedForm.tsx +++ b/src/Components/Facility/AddBedForm.tsx @@ -18,8 +18,8 @@ import { import { LOCATION_BED_TYPES } from "../../Common/constants"; import { navigate } from "raviger"; import { Cancel, Submit } from "../Common/components/ButtonV2"; +import Page from "../Common/components/Page"; const Loading = loadable(() => import("../Common/Loading")); -const PageTitle = loadable(() => import("../Common/PageTitle")); interface BedFormProps { facilityId: string; @@ -134,30 +134,30 @@ export const AddBedForm = (props: BedFormProps) => { } return ( -
- { - navigate(`/facility/${facilityId}/location/${locationId}/beds`, { - replace: true, - }); - - return 0; - }} - crumbsReplacements={{ - [facilityId]: { name: facilityName }, - [locationId]: { - name: locationName, - uri: `/facility/${facilityId}/location`, + { + navigate(`/facility/${facilityId}/location/${locationId}/beds`, { + replace: true, + }); + + return 0; + }} + crumbsReplacements={{ + [facilityId]: { name: facilityName }, + [locationId]: { + name: locationName, + uri: `/facility/${facilityId}/location`, + }, + ...(bedId && { + [bedId]: { + name: bedName, + uri: `/facility/${facilityId}/location/${locationId}/beds`, }, - ...(bedId && { - [bedId]: { - name: bedName, - uri: `/facility/${facilityId}/location/${locationId}/beds`, - }, - }), - }} - /> + }), + }} + >
handleSubmit(e)}> @@ -223,6 +223,6 @@ export const AddBedForm = (props: BedFormProps) => {
-
+ ); }; diff --git a/src/Components/Facility/AddInventoryForm.tsx b/src/Components/Facility/AddInventoryForm.tsx index 09ef39105f6..f48884ddc8b 100644 --- a/src/Components/Facility/AddInventoryForm.tsx +++ b/src/Components/Facility/AddInventoryForm.tsx @@ -14,8 +14,8 @@ import { SelectField, TextInputField } from "../Common/HelperInputFields"; import { InventoryItemsModel } from "./models"; import { goBack } from "../../Utils/utils"; import { Cancel, Submit } from "../Common/components/ButtonV2"; +import Page from "../Common/components/Page"; const Loading = loadable(() => import("../Common/Loading")); -const PageTitle = loadable(() => import("../Common/PageTitle")); const initForm = { id: "", @@ -214,11 +214,10 @@ export const AddInventoryForm = (props: any) => { } return ( -
- +
@@ -294,6 +293,6 @@ export const AddInventoryForm = (props: any) => {
-
+ ); }; diff --git a/src/Components/Facility/AddLocationForm.tsx b/src/Components/Facility/AddLocationForm.tsx index 084830c2784..1a298f52e1f 100644 --- a/src/Components/Facility/AddLocationForm.tsx +++ b/src/Components/Facility/AddLocationForm.tsx @@ -15,8 +15,8 @@ import { } from "../Common/HelperInputFields"; import { navigate } from "raviger"; import { Submit, Cancel } from "../Common/components/ButtonV2"; +import Page from "../Common/components/Page"; const Loading = loadable(() => import("../Common/Loading")); -const PageTitle = loadable(() => import("../Common/PageTitle")); interface LocationFormProps { facilityId: string; @@ -90,19 +90,19 @@ export const AddLocationForm = (props: LocationFormProps) => { } return ( -
- +
@@ -149,6 +149,6 @@ export const AddLocationForm = (props: LocationFormProps) => {
-
+ ); }; diff --git a/src/Components/Facility/AssetCreate.tsx b/src/Components/Facility/AssetCreate.tsx index ea1f3e676b8..d881a26b83f 100644 --- a/src/Components/Facility/AssetCreate.tsx +++ b/src/Components/Facility/AssetCreate.tsx @@ -8,7 +8,6 @@ import { import { useDispatch } from "react-redux"; import * as Notification from "../../Utils/Notifications.js"; import CropFreeIcon from "@material-ui/icons/CropFree"; -import PageTitle from "../Common/PageTitle"; import { parsePhoneNumberFromString } from "libphonenumber-js"; import { validateEmailAddress } from "../../Common/validation"; import { @@ -31,7 +30,7 @@ import { SelectFormField } from "../Form/FormFields/SelectFormField"; import TextFormField from "../Form/FormFields/TextFormField"; import TextAreaFormField from "../Form/FormFields/TextAreaFormField"; import PhoneNumberFormField from "../Form/FormFields/PhoneNumberFormField"; - +import Page from "../Common/components/Page"; const Loading = loadable(() => import("../Common/Loading")); const formErrorKeys = [ @@ -385,15 +384,15 @@ const AssetCreate = (props: AssetProps) => { if (locations.length === 0) { return ( -
- +

@@ -411,7 +410,7 @@ const AssetCreate = (props: AssetProps) => { Add Location

-
+ ); } @@ -459,16 +458,15 @@ const AssetCreate = (props: AssetProps) => { }; return ( -
- +
{Object.keys(sections).map((sectionTitle) => { @@ -500,10 +498,9 @@ const AssetCreate = (props: AssetProps) => { className="rounded sm:rounded-xl bg-white p-6 sm:p-12 transition-all" >
-
+
{/* General Details Section */} {sectionTitle("General Details")} - {/* Asset Name */}
{
{/* Divider */} -
+ {/*

{ : "opacity-100 my-4") } /> -
+
*/} {/* Working Status */}
@@ -662,7 +659,7 @@ const AssetCreate = (props: AssetProps) => {
{/* Divider */} -
+ {/*

{ : "opacity-100 mb-7") } /> -
+
*/} {/* Asset QR ID */}
@@ -904,7 +901,7 @@ const AssetCreate = (props: AssetProps) => {
-
+ ); }; diff --git a/src/Components/Facility/BedManagement.tsx b/src/Components/Facility/BedManagement.tsx index 78385e30486..b0811489294 100644 --- a/src/Components/Facility/BedManagement.tsx +++ b/src/Components/Facility/BedManagement.tsx @@ -15,8 +15,8 @@ import { ReactElement } from "react"; import * as Notification from "../../Utils/Notifications.js"; import { LOCATION_BED_TYPES } from "../../Common/constants"; import BedDeleteDialog from "./BedDeleteDialog"; +import Page from "../Common/components/Page"; -const PageTitle = loadable(() => import("../Common/PageTitle")); const Loading = loadable(() => import("../Common/Loading")); interface BedManagementProps { @@ -237,18 +237,16 @@ export const BedManagement = (props: BedManagementProps) => { } return ( -
- +
{bed}
-
+ ); }; diff --git a/src/Components/Facility/ConsultationDetails.tsx b/src/Components/Facility/ConsultationDetails.tsx index 9bf7beaae6a..050a4a381c5 100644 --- a/src/Components/Facility/ConsultationDetails.tsx +++ b/src/Components/Facility/ConsultationDetails.tsx @@ -49,6 +49,7 @@ import CareIcon from "../../CAREUI/icons/CareIcon"; import DialogModal from "../Common/Dialog"; import ButtonV2, { Cancel, Submit } from "../Common/components/ButtonV2"; import { SelectFormField } from "../Form/FormFields/SelectFormField"; +import Page from "../Common/components/Page"; import DateFormField from "../Form/FormFields/DateFormField"; import { FieldChangeEvent } from "../Form/FormFields/Utils"; import TextFormField from "../Form/FormFields/TextFormField"; @@ -60,6 +61,7 @@ import PRNPrescriptionBuilder, { PRNPrescriptionType, } from "../Common/prescription-builder/PRNPrescriptionBuilder"; import { formatDate } from "../../Utils/utils"; + interface PreDischargeFormInterface { discharge_reason: string; discharge_notes: string; @@ -380,7 +382,60 @@ export const ConsultationDetails = (props: any) => { }; return ( -
+ +
+ {patientData.is_active && ( +
+ + {patientData.last_consultation?.id && ( + + Camera Feed + + )} +
+ )} +
+ + Patient Details + + + Doctor's Notes + +
+
+ + } + > Download Discharge Summary @@ -565,58 +620,6 @@ export const ConsultationDetails = (props: any) => {
-
{ {tab === "UPDATES" && (
- +
+ +
{!consultationData.discharge_date && (
{
- +
+ +
{ )} {tab === "FEED" && (
- +
+ +
{ )} {tab === "SUMMARY" && (
- +
+ +
{ {tab === "ABG" && (
- +
+ +
{ )} {tab === "NURSING" && (
- +
+ +
{ )} {tab === "NEUROLOGICAL_MONITORING" && (
- +
+ +
{ )} {tab === "VENTILATOR" && (
- +
+ +
{ )} {tab === "NUTRITION" && (
- +
+ +
{ )} {tab === "PRESSURE_SORE" && (
- +
+ +
)} {tab === "DIALYSIS" && (
- +
+ +
)} {tab === "INVESTIGATIONS" && (
- +
+ +
{ show={showDoctors} setShow={setShowDoctors} /> -
+ ); }; diff --git a/src/Components/Facility/ConsultationForm.tsx b/src/Components/Facility/ConsultationForm.tsx index 7a5e8c74b30..8b3ee454b40 100644 --- a/src/Components/Facility/ConsultationForm.tsx +++ b/src/Components/Facility/ConsultationForm.tsx @@ -60,9 +60,9 @@ import TextFormField from "../Form/FormFields/TextFormField"; import { DiagnosisSelectFormField } from "../Common/DiagnosisSelectFormField"; import { SymptomsSelect } from "../Common/SymptomsSelect"; import DateFormField from "../Form/FormFields/DateFormField"; +import Page from "../Common/components/Page"; const Loading = loadable(() => import("../Common/Loading")); -const PageTitle = loadable(() => import("../Common/PageTitle")); type BooleanStrings = "true" | "false"; @@ -692,16 +692,14 @@ export const ConsultationForm = (props: any) => { }; return ( -
- - +
{
)} -
+ ); }; diff --git a/src/Components/Facility/Consultations/DailyRoundsList.tsx b/src/Components/Facility/Consultations/DailyRoundsList.tsx index 219eeb0aa9b..75282b8cdbb 100644 --- a/src/Components/Facility/Consultations/DailyRoundsList.tsx +++ b/src/Components/Facility/Consultations/DailyRoundsList.tsx @@ -246,11 +246,13 @@ export const DailyRoundsList = (props: any) => {
- +
+ +
{roundsList}
diff --git a/src/Components/Facility/Consultations/LiveFeed.tsx b/src/Components/Facility/Consultations/LiveFeed.tsx index 5b82165b81b..90d1f96e395 100644 --- a/src/Components/Facility/Consultations/LiveFeed.tsx +++ b/src/Components/Facility/Consultations/LiveFeed.tsx @@ -3,7 +3,6 @@ import { useEffect, useState, useRef } from "react"; import { useDispatch } from "react-redux"; import screenfull from "screenfull"; import useKeyboardShortcut from "use-keyboard-shortcut"; -import loadable from "@loadable/component"; import { listAssetBeds, partialUpdateAssetBed, @@ -16,7 +15,6 @@ import { useMSEMediaPlayer, } from "../../../Common/hooks/useMSEplayer"; import { useFeedPTZ } from "../../../Common/hooks/useFeedPTZ"; -const PageTitle = loadable(() => import("../../Common/PageTitle")); import * as Notification from "../../../Utils/Notifications.js"; import { Card, @@ -32,6 +30,7 @@ import { BedSelect } from "../../Common/BedSelect"; import { BedModel } from "../models"; import { TextInputField } from "../../Common/HelperInputFields"; import useWindowDimensions from "../../../Common/hooks/useWindowDimensions"; +import Page from "../../Common/components/Page"; const LiveFeed = (props: any) => { const middlewareHostname = @@ -294,9 +293,7 @@ const LiveFeed = (props: any) => { } return ( -
- - + {toDelete && ( {
-
+ ); }; diff --git a/src/Components/Facility/FacilityCreate.tsx b/src/Components/Facility/FacilityCreate.tsx index bce0acf06ac..2d8bebd7c21 100644 --- a/src/Components/Facility/FacilityCreate.tsx +++ b/src/Components/Facility/FacilityCreate.tsx @@ -54,8 +54,8 @@ import Steps, { Step } from "../Common/Steps"; import { BedCapacity } from "./BedCapacity"; import { DoctorCapacity } from "./DoctorCapacity"; import PhoneNumberFormField from "../Form/FormFields/PhoneNumberFormField"; +import Page from "../Common/components/Page"; const Loading = loadable(() => import("../Common/Loading")); -const PageTitle = loadable(() => import("../Common/PageTitle")); interface FacilityProps { facilityId?: string; @@ -572,13 +572,12 @@ export const FacilityCreate = (props: FacilityProps) => { switch (currentStep) { case 3: return ( -
- +
{ }} />
-
+ ); case 2: return ( -
- +
{ }} />
-
+ ); case 1: default: return ( -
- + {!facilityId && } @@ -1128,7 +1125,7 @@ export const FacilityCreate = (props: FacilityProps) => { -
+ ); } }; diff --git a/src/Components/Facility/FacilityHome.tsx b/src/Components/Facility/FacilityHome.tsx index 3a3eaa2fa60..0a07baaf042 100644 --- a/src/Components/Facility/FacilityHome.tsx +++ b/src/Components/Facility/FacilityHome.tsx @@ -42,8 +42,8 @@ import CareIcon from "../../CAREUI/icons/CareIcon"; import { BedCapacity } from "./BedCapacity"; import { DoctorCapacity } from "./DoctorCapacity"; import DialogModal from "../Common/Dialog"; +import Page from "../Common/components/Page"; const Loading = loadable(() => import("../Common/Loading")); -const PageTitle = loadable(() => import("../Common/PageTitle")); export const getFacilityFeatureIcon = (featureId: number) => { const feature = FACILITY_FEATURE_TYPES.find((f) => f.id === featureId); @@ -296,12 +296,11 @@ export const FacilityHome = (props: any) => { ); return ( -
- + { /> )} -
+ ); }; diff --git a/src/Components/Facility/FacilityUsers.tsx b/src/Components/Facility/FacilityUsers.tsx index 54962e24a1f..f6505fc6065 100644 --- a/src/Components/Facility/FacilityUsers.tsx +++ b/src/Components/Facility/FacilityUsers.tsx @@ -23,9 +23,9 @@ import * as Notification from "../../Utils/Notifications.js"; import UserDetails from "../Common/UserDetails"; import UnlinkFacilityDialog from "../Users/UnlinkFacilityDialog"; import { classNames } from "../../Utils/utils"; +import Page from "../Common/components/Page"; const Loading = loadable(() => import("../Common/Loading")); -const PageTitle = loadable(() => import("../Common/PageTitle")); export default function FacilityUsers(props: any) { const { facilityId } = props; @@ -450,7 +450,7 @@ export default function FacilityUsers(props: any) { } return ( -
+ {linkFacility.show && ( )} - - -
+
-
+
Total Users @@ -486,10 +479,7 @@ export default function FacilityUsers(props: any) {
- -
-
{manageUsers}
-
+
{manageUsers}
{userData.show && ( )} -
+ ); } diff --git a/src/Components/Facility/HospitalList.tsx b/src/Components/Facility/HospitalList.tsx index d0a335a5dbe..747fdbed63e 100644 --- a/src/Components/Facility/HospitalList.tsx +++ b/src/Components/Facility/HospitalList.tsx @@ -23,9 +23,9 @@ import SearchInput from "../Form/SearchInput"; import useFilters from "../../Common/hooks/useFilters"; import { FacilityCard } from "./FacilityCard"; import ExportMenu from "../Common/Export"; +import Page from "../Common/components/Page"; const Loading = loadable(() => import("../Common/Loading")); -const PageTitle = loadable(() => import("../Common/PageTitle")); export const HospitalList = () => { const { @@ -209,34 +209,39 @@ export const HospitalList = () => { } return ( -
-
- - -
+ + + + } + >
@@ -329,6 +334,6 @@ export const HospitalList = () => {
{manageFacilities}
-
+ ); }; diff --git a/src/Components/Facility/InventoryList.tsx b/src/Components/Facility/InventoryList.tsx index 395f4eb69a8..15a0b36689b 100644 --- a/src/Components/Facility/InventoryList.tsx +++ b/src/Components/Facility/InventoryList.tsx @@ -8,7 +8,7 @@ import { getInventorySummary, getAnyFacility } from "../../Redux/actions"; import Pagination from "../Common/Pagination"; import { RoleButton } from "../Common/RoleButton"; import { classNames } from "../../Utils/utils"; -const PageTitle = loadable(() => import("../Common/PageTitle")); +import Page from "../Common/components/Page"; const Loading = loadable(() => import("../Common/Loading")); export default function InventoryList(props: any) { @@ -152,13 +152,11 @@ export default function InventoryList(props: any) { } return ( -
- -
+ +
@@ -197,6 +195,6 @@ export default function InventoryList(props: any) { {inventoryItem}
-
+ ); } diff --git a/src/Components/Facility/InventoryLog.tsx b/src/Components/Facility/InventoryLog.tsx index faf285d9d15..86a11a2a923 100644 --- a/src/Components/Facility/InventoryLog.tsx +++ b/src/Components/Facility/InventoryLog.tsx @@ -12,7 +12,7 @@ import { statusType, useAbortableEffect } from "../../Common/utils"; import Pagination from "../Common/Pagination"; import { Tooltip } from "@material-ui/core"; import { formatDate } from "../../Utils/utils"; -const PageTitle = loadable(() => import("../Common/PageTitle")); +import Page from "../Common/components/Page"; const Loading = loadable(() => import("../Common/Loading")); export default function InventoryLog(props: any) { @@ -244,16 +244,14 @@ export default function InventoryLog(props: any) { } return ( -
- -
+ +

Item: {itemName}

@@ -286,6 +284,6 @@ export default function InventoryLog(props: any) { {inventoryItem}
-
+
); } diff --git a/src/Components/Facility/Investigations/Reports/index.tsx b/src/Components/Facility/Investigations/Reports/index.tsx index 71f84b7c425..6ec9221421c 100644 --- a/src/Components/Facility/Investigations/Reports/index.tsx +++ b/src/Components/Facility/Investigations/Reports/index.tsx @@ -9,7 +9,6 @@ import { getPatient, } from "../../../../Redux/actions"; import { MultiSelectField } from "../../../Common/HelperInputFields"; -import PageTitle from "../../../Common/PageTitle"; import { Button, ButtonGroup, Checkbox, TextField } from "@material-ui/core"; import Loading from "../../../Common/Loading"; import _ from "lodash"; @@ -18,6 +17,7 @@ import { InputLabel, makeStyles, CircularProgress } from "@material-ui/core"; import { InvestigationResponse } from "./types"; import ReportTable from "./ReportTable"; import * as Notification from "../../../../Utils/Notifications"; +import Page from "../../../Common/components/Page"; const RESULT_PER_PAGE = 14; @@ -331,14 +331,14 @@ const InvestigationReports = ({ id }: any) => { const nextSessionDisabled = isNextSessionDisabled || isLoading.tableData; return ( -
- + {!isLoading.investigationGroupLoading ? ( <>
@@ -485,7 +485,7 @@ const InvestigationReports = ({ id }: any) => { ) : ( )} -
+
); }; diff --git a/src/Components/Facility/Investigations/ShowInvestigation.tsx b/src/Components/Facility/Investigations/ShowInvestigation.tsx index b10fdf5a401..905c48e56b9 100644 --- a/src/Components/Facility/Investigations/ShowInvestigation.tsx +++ b/src/Components/Facility/Investigations/ShowInvestigation.tsx @@ -6,12 +6,12 @@ import { getInvestigation, getPatient, } from "../../../Redux/actions"; -import PageTitle from "../../Common/PageTitle"; import InvestigationTable from "./InvestigationTable"; import loadable from "@loadable/component"; import _ from "lodash"; import { navigate } from "raviger"; import * as Notification from "../../../Utils/Notifications.js"; +import Page from "../../Common/components/Page"; const Loading = loadable(() => import("../../Common/Loading")); @@ -160,15 +160,14 @@ export default function ShowInvestigation(props: any) { }, [state.initialValues]); return ( -
- + {isLoading ? ( ) : ( @@ -181,6 +180,6 @@ export default function ShowInvestigation(props: any) { handleSave={handleSubmit} /> )} -
+ ); } diff --git a/src/Components/Facility/Investigations/index.tsx b/src/Components/Facility/Investigations/index.tsx index d3afa63dafa..3379ca1b64a 100644 --- a/src/Components/Facility/Investigations/index.tsx +++ b/src/Components/Facility/Investigations/index.tsx @@ -1,9 +1,8 @@ import React, { useEffect, useReducer, useState } from "react"; -import { MultiSelectField } from "../../Common/HelperInputFields"; import { TestTable } from "./Table"; import { useDispatch } from "react-redux"; import Autocomplete from "@material-ui/lab/Autocomplete"; -import { Checkbox, TextField, InputLabel } from "@material-ui/core"; +import { Checkbox, TextField } from "@material-ui/core"; import { createInvestigation, listInvestigationGroups, @@ -13,9 +12,9 @@ import { import * as Notification from "../../../Utils/Notifications.js"; import { navigate } from "raviger"; import loadable from "@loadable/component"; +import Page from "../../Common/components/Page"; const Loading = loadable(() => import("../../Common/Loading")); -const PageTitle = loadable(() => import("../../Common/PageTitle")); const initialState = { form: {}, @@ -57,7 +56,7 @@ const testFormReducer = (state = initialState, action: any) => { } }; -let listOfInvestigations = ( +const listOfInvestigations = ( group_id: string, investigations: InvestigationType[] ) => { @@ -66,7 +65,7 @@ let listOfInvestigations = ( ); }; -let findGroup = (group_id: string, groups: Group[]) => { +const findGroup = (group_id: string, groups: Group[]) => { return groups.find((g) => g.external_id === group_id); }; @@ -75,6 +74,7 @@ const Investigation = (props: { patientId: string; facilityId: string; }) => { + // eslint-disable-next-line const { consultationId, patientId, facilityId } = props; const dispatch: any = useDispatch(); @@ -140,12 +140,12 @@ const Investigation = (props: { }, [props.consultationId]); const initialiseForm = () => { - let investigationsArray = selectedGroup.map((group_id: string) => { + const investigationsArray = selectedGroup.map((group_id: string) => { return listOfInvestigations(group_id, investigations); }); - let flatInvestigations = investigationsArray.flat(); - let form: any = {}; + const flatInvestigations = investigationsArray.flat(); + const form: any = {}; flatInvestigations.forEach( (i: InvestigationType) => @@ -162,7 +162,7 @@ const Investigation = (props: { ); setState({ type: "set_form", form }); }; - + // eslint-disable-next-line const handleSubmit = async (e: any) => { initialiseForm(); if (!saving) { @@ -211,14 +211,14 @@ const Investigation = (props: { } return ( -
- +
+
); }; diff --git a/src/Components/Facility/LocationManagement.tsx b/src/Components/Facility/LocationManagement.tsx index b5e1922748d..04dea64fdb5 100644 --- a/src/Components/Facility/LocationManagement.tsx +++ b/src/Components/Facility/LocationManagement.tsx @@ -8,7 +8,7 @@ import Pagination from "../Common/Pagination"; import { RoleButton } from "../Common/RoleButton"; import { LocationModel } from "./models"; import { ReactElement } from "react"; -const PageTitle = loadable(() => import("../Common/PageTitle")); +import Page from "../Common/components/Page"; const Loading = loadable(() => import("../Common/Loading")); interface LocationManagementProps { @@ -162,13 +162,11 @@ export const LocationManagement = (props: LocationManagementProps) => { } return ( -
- -
+ +
{
{location}
-
+ ); }; diff --git a/src/Components/Facility/MinQuantityList.tsx b/src/Components/Facility/MinQuantityList.tsx index 1168a85b8f2..053660d7b08 100644 --- a/src/Components/Facility/MinQuantityList.tsx +++ b/src/Components/Facility/MinQuantityList.tsx @@ -8,8 +8,8 @@ import { navigate } from "raviger"; import { RoleButton } from "../Common/RoleButton"; import { MinQuantityRequiredModal } from "./MinQuantityRequiredModal"; import ButtonV2 from "../Common/components/ButtonV2"; +import Page from "../Common/components/Page"; const Loading = loadable(() => import("../Common/Loading")); -const PageTitle = loadable(() => import("../Common/PageTitle")); export default function MinQuantityList(props: any) { const { facilityId }: any = props; @@ -207,25 +207,22 @@ export default function MinQuantityList(props: any) { } return ( -
- -
+ +
)} -
+ ); } diff --git a/src/Components/Facility/SetInventoryForm.tsx b/src/Components/Facility/SetInventoryForm.tsx index e3c1ecb2afd..c815ace7ba3 100644 --- a/src/Components/Facility/SetInventoryForm.tsx +++ b/src/Components/Facility/SetInventoryForm.tsx @@ -9,8 +9,8 @@ import { SelectField, TextInputField } from "../Common/HelperInputFields"; import { InventoryItemsModel } from "./models"; import { goBack } from "../../Utils/utils"; import { Cancel, Submit } from "../Common/components/ButtonV2"; +import Page from "../Common/components/Page"; const Loading = loadable(() => import("../Common/Loading")); -const PageTitle = loadable(() => import("../Common/PageTitle")); const initForm = { id: "", @@ -130,20 +130,19 @@ export const SetInventoryForm = (props: any) => { } return ( -
- +
handleSubmit(e)}> @@ -201,6 +200,6 @@ export const SetInventoryForm = (props: any) => {
-
+ ); }; diff --git a/src/Components/Facility/TriageForm.tsx b/src/Components/Facility/TriageForm.tsx index 191ea64b7ef..9134538cf01 100644 --- a/src/Components/Facility/TriageForm.tsx +++ b/src/Components/Facility/TriageForm.tsx @@ -18,8 +18,8 @@ import { goBack } from "../../Utils/utils"; import ButtonV2 from "../Common/components/ButtonV2"; import DateInputV2 from "../Common/DateInputV2"; import { Cancel, Submit } from "../Common/components/ButtonV2"; +import Page from "../Common/components/Page"; const Loading = loadable(() => import("../Common/Loading")); -const PageTitle = loadable(() => import("../Common/PageTitle")); interface triageFormProps extends PatientStatsModel { facilityId: number; @@ -270,17 +270,15 @@ export const TriageForm = (props: triageFormProps) => { : "border-gray-200"; return ( -
- - + {
Entry Date -
+
{
-
+ ); }; diff --git a/src/Components/Facility/UpdateFacilityMiddleware.tsx b/src/Components/Facility/UpdateFacilityMiddleware.tsx index 520934fb0ed..edae8db7f8a 100644 --- a/src/Components/Facility/UpdateFacilityMiddleware.tsx +++ b/src/Components/Facility/UpdateFacilityMiddleware.tsx @@ -11,8 +11,8 @@ import * as Notification from "../../Utils/Notifications.js"; import { navigate } from "raviger"; import { Cancel, Submit } from "../Common/components/ButtonV2"; import TextFormField from "../Form/FormFields/TextFormField"; +import Page from "../Common/components/Page"; const Loading = loadable(() => import("../Common/Loading")); -const PageTitle = loadable(() => import("../Common/PageTitle")); const initForm = { name: "", @@ -118,13 +118,13 @@ export const UpdateFacilityMiddleware = (props: any) => { } return ( -
- +
handleSubmit(e)}> @@ -147,6 +147,6 @@ export const UpdateFacilityMiddleware = (props: any) => {
-
+ ); }; diff --git a/src/Components/Notifications/NoticeBoard.tsx b/src/Components/Notifications/NoticeBoard.tsx index 05e0728c6ad..b322289116e 100644 --- a/src/Components/Notifications/NoticeBoard.tsx +++ b/src/Components/Notifications/NoticeBoard.tsx @@ -1,10 +1,10 @@ import React, { useEffect, useState } from "react"; import { useDispatch } from "react-redux"; import { getNotifications } from "../../Redux/actions"; -import PageTitle from "../Common/PageTitle"; import { Card, CardContent } from "@material-ui/core"; import Loading from "../Common/Loading"; import { formatDate } from "../../Utils/utils"; +import Page from "../Common/components/Page"; export const NoticeBoard: any = () => { const dispatch: any = useDispatch(); @@ -65,9 +65,13 @@ export const NoticeBoard: any = () => { if (isLoading) return ; return ( -
- +
{notices}
-
+ ); }; diff --git a/src/Components/Patient/DailyRoundListDetails.tsx b/src/Components/Patient/DailyRoundListDetails.tsx index 6ece13da5f4..13636c8b3ee 100644 --- a/src/Components/Patient/DailyRoundListDetails.tsx +++ b/src/Components/Patient/DailyRoundListDetails.tsx @@ -8,8 +8,8 @@ import { CURRENT_HEALTH_CHANGE, SYMPTOM_CHOICES } from "../../Common/constants"; import { statusType, useAbortableEffect } from "../../Common/utils"; import { getConsultationDailyRoundsDetails } from "../../Redux/actions"; import { DailyRoundsModel } from "./models"; +import Page from "../Common/components/Page"; const Loading = loadable(() => import("../Common/Loading")); -const PageTitle = loadable(() => import("../Common/PageTitle")); const symptomChoices = [...SYMPTOM_CHOICES]; const currentHealthChoices = [...CURRENT_HEALTH_CHANGE]; @@ -77,8 +77,7 @@ export const DailyRoundListDetails = (props: any) => { } return ( -
- +
@@ -219,6 +218,6 @@ export const DailyRoundListDetails = (props: any) => {
-
+ ); }; diff --git a/src/Components/Patient/DailyRounds.tsx b/src/Components/Patient/DailyRounds.tsx index 2b680181181..8044da20d2f 100644 --- a/src/Components/Patient/DailyRounds.tsx +++ b/src/Components/Patient/DailyRounds.tsx @@ -39,8 +39,8 @@ import { import * as Notification from "../../Utils/Notifications"; import { make as Link } from "../Common/components/Link.gen"; import { formatDate } from "../../Utils/utils"; +import Page from "../Common/components/Page"; const Loading = loadable(() => import("../Common/Loading")); -const PageTitle = loadable(() => import("../Common/PageTitle")); const initForm: any = { otherSymptom: false, @@ -489,14 +489,14 @@ export const DailyRounds = (props: any) => { } return ( -
- +
handleSubmit(e)}> @@ -977,6 +977,6 @@ export const DailyRounds = (props: any) => {
-
+ ); }; diff --git a/src/Components/Patient/FileUpload.tsx b/src/Components/Patient/FileUpload.tsx index 864cea51a1a..62dfa164af8 100644 --- a/src/Components/Patient/FileUpload.tsx +++ b/src/Components/Patient/FileUpload.tsx @@ -1246,15 +1246,17 @@ export const FileUpload = (props: FileUploadProps) => {
- +
+ +
{audio ? ( @@ -1367,12 +1369,15 @@ export const FileUpload = (props: FileUploadProps) => { ) : null}
+
+ {" "} + +
- import("../Common/Loading")); -const PageTitle = loadable(() => import("../Common/PageTitle")); interface TabPanelProps { children?: React.ReactNode; @@ -633,19 +633,11 @@ export const PatientManager = () => { }; return ( -
- setSelectedFacility(e)} - selectedFacility={selectedFacility} - handleOk={() => navigate(`facility/${selectedFacility.id}/patient`)} - handleCancel={() => { - setShowDialog(false); - setSelectedFacility({ name: "" }); - }} - /> -
- + { )}
-
+ } + > + setSelectedFacility(e)} + selectedFacility={selectedFacility} + handleOk={() => navigate(`facility/${selectedFacility.id}/patient`)} + handleCancel={() => { + setShowDialog(false); + setSelectedFacility({ name: "" }); + }} + />
@@ -853,6 +856,6 @@ export const PatientManager = () => {
-
+ ); }; diff --git a/src/Components/Patient/PatientHome.tsx b/src/Components/Patient/PatientHome.tsx index 67d555c5818..5d18bf41d16 100644 --- a/src/Components/Patient/PatientHome.tsx +++ b/src/Components/Patient/PatientHome.tsx @@ -34,9 +34,9 @@ import ButtonV2 from "../Common/components/ButtonV2"; import { NonReadOnlyUsers } from "../../Utils/AuthorizeFor"; import RelativeDateUserMention from "../Common/RelativeDateUserMention"; import CareIcon from "../../CAREUI/icons/CareIcon"; +import Page from "../Common/components/Page"; const Loading = loadable(() => import("../Common/Loading")); -const PageTitle = loadable(() => import("../Common/PageTitle")); export const PatientHome = (props: any) => { const { facilityId, id } = props; @@ -388,7 +388,15 @@ export const PatientHome = (props: any) => { }; return ( -
+ {showAlertMessage.show && ( { )}
- -
@@ -1534,6 +1533,6 @@ export const PatientHome = (props: any) => {
)}
-
+ ); }; diff --git a/src/Components/Patient/PatientNotes.tsx b/src/Components/Patient/PatientNotes.tsx index 2ef4e1f15b1..7ea574a274d 100644 --- a/src/Components/Patient/PatientNotes.tsx +++ b/src/Components/Patient/PatientNotes.tsx @@ -7,13 +7,13 @@ import { getPatient, } from "../../Redux/actions"; import * as Notification from "../../Utils/Notifications.js"; -import PageTitle from "../Common/PageTitle"; import Pagination from "../Common/Pagination"; import { navigate } from "raviger"; import { RESULTS_PER_PAGE_LIMIT } from "../../Common/constants"; import Loading from "../Common/Loading"; import { RoleButton } from "../Common/RoleButton"; import { formatDate } from "../../Utils/utils"; +import Page from "../Common/components/Page"; interface PatientNotesProps { patientId: any; @@ -105,16 +105,15 @@ const PatientNotes = (props: PatientNotesProps) => { } return ( -
- -

Add new notes

+ +

Add new notes