diff --git a/src/Components/Patient/PatientRegister.tsx b/src/Components/Patient/PatientRegister.tsx
index 919a27ef2d6..da32db60872 100644
--- a/src/Components/Patient/PatientRegister.tsx
+++ b/src/Components/Patient/PatientRegister.tsx
@@ -105,8 +105,8 @@ const initForm: any = {
name: "",
age: "",
gender: "",
- phone_number: "",
- emergency_phone_number: "",
+ phone_number: "+91",
+ emergency_phone_number: null,
blood_group: "",
disease_status: diseaseStatus[2],
is_declared_positive: "false",
@@ -362,7 +362,7 @@ export const PatientRegister = (props: PatientRegisterProps) => {
fetchDistricts(res.data.district_object.state),
fetchLocalBody(res.data.district),
fetchWards(res.data.local_body),
- duplicateCheck("+91" + res.data.mobile_number),
+ duplicateCheck(res.data.mobile_number),
]);
setShowImport(false);
@@ -2120,6 +2120,7 @@ export const PatientRegister = (props: PatientRegisterProps) => {
},
])
}
+ data-testid="add-insurance-button"
>
Add Insurance Details
diff --git a/src/Components/Patient/SampleDetails.tsx b/src/Components/Patient/SampleDetails.tsx
index 9dcb7d0c50f..79a75141896 100644
--- a/src/Components/Patient/SampleDetails.tsx
+++ b/src/Components/Patient/SampleDetails.tsx
@@ -1,4 +1,3 @@
-import { Card, CardContent, Button } from "@material-ui/core";
import loadable from "@loadable/component";
import { useCallback, useState } from "react";
import { useDispatch } from "react-redux";
@@ -10,16 +9,17 @@ import { navigate } from "raviger";
import { GENDER_TYPES, TEST_TYPE_CHOICES } from "../../Common/constants";
import _ from "lodash";
import { formatDate } from "../../Utils/utils";
+import Card from "../../CAREUI/display/Card";
+import Page from "../Common/components/Page";
+import ButtonV2 from "../Common/components/ButtonV2";
const Loading = loadable(() => import("../Common/Loading"));
-const PageTitle = loadable(() => import("../Common/PageTitle"));
interface SampleDetailsProps {
id: number;
}
-export const SampleDetails = (props: SampleDetailsProps) => {
- const { id } = props;
+export const SampleDetails = ({ id }: SampleDetailsProps) => {
const dispatch: any = useDispatch();
const [isLoading, setIsLoading] = useState(false);
const [sampleDetails, setSampleDetails] = useState({});
@@ -46,7 +46,7 @@ export const SampleDetails = (props: SampleDetailsProps) => {
},
[dispatch, fetchData, id]
);
- const yesornoBadge = (param: any) =>
+ const yesOrNoBadge = (param: any) =>
param ? (
Yes
) : (
@@ -180,13 +180,13 @@ export const SampleDetails = (props: SampleDetailsProps) => {
Contact with confirmed carrier:{" "}
- {yesornoBadge(patientData?.contact_with_confirmed_carrier)}
+ {yesOrNoBadge(patientData?.contact_with_confirmed_carrier)}
Contact with suspected carrier:{" "}
- {yesornoBadge(patientData?.contact_with_suspected_carrier)}
+ {yesOrNoBadge(patientData?.contact_with_suspected_carrier)}
{patientData?.estimated_contact_date && (
@@ -200,13 +200,13 @@ export const SampleDetails = (props: SampleDetailsProps) => {
Has SARI (Severe Acute Respiratory illness)?:{" "}
- {yesornoBadge(patientData?.has_SARI)}
+ {yesOrNoBadge(patientData?.has_SARI)}
Domestic/international Travel (within last 28 days):{" "}
- {yesornoBadge(patientData?.past_travel)}
+ {yesOrNoBadge(patientData?.past_travel)}
{patientData?.countries_travelled &&
!!patientData?.countries_travelled.length && (
@@ -257,31 +257,25 @@ export const SampleDetails = (props: SampleDetailsProps) => {
const renderFlow = (flow: FlowModel) => {
return (
-
-
-
-
- Status: {" "}
- {_.startCase(_.camelCase(flow.status))}
-
-
- Label:{" "}
- {_.capitalize(flow.notes)}
-
-
-
- Created On :
- {" "}
- {flow.created_date ? formatDate(flow.created_date) : "-"}
-
-
-
- Modified on:
- {" "}
- {flow.modified_date ? formatDate(flow.modified_date) : "-"}
-
+
+
+
+ Status: {" "}
+ {_.startCase(_.camelCase(flow.status))}
+
+
+ Label:{" "}
+ {_.capitalize(flow.notes)}
+
+
+ Created On :{" "}
+ {flow.created_date ? formatDate(flow.created_date) : "-"}
+
+
+ Modified on:{" "}
+ {flow.modified_date ? formatDate(flow.modified_date) : "-"}
-
+
);
};
@@ -291,162 +285,153 @@ export const SampleDetails = (props: SampleDetailsProps) => {
}
return (
-
-
- {sampleDetails.patient && (
-
-
-
- )}
-
-
-
-
- Status:
- {_.startCase(_.camelCase(sampleDetails.status))}
-
-
- Result:
- {_.startCase(_.camelCase(sampleDetails.result))}
-
-
- Patient:
- {sampleDetails.patient_name}
-
- {sampleDetails.facility_object && (
-
-
- Facility:{" "}
-
- {sampleDetails.facility_object.name}
-
- )}
-
- Tested on:
- {sampleDetails.date_of_result
- ? formatDate(sampleDetails.date_of_result)
- : "-"}
-
+
+
+ ICMR Specimen Referral Form
+
+
+ )
+ }
+ >
+
+
+
+ Status:
+ {_.startCase(_.camelCase(sampleDetails.status))}
+
+
+ Result:
+ {_.startCase(_.camelCase(sampleDetails.result))}
+
+
+ Patient:
+ {sampleDetails.patient_name}
+
+ {sampleDetails.facility_object && (
- Result on:
- {sampleDetails.date_of_result
- ? formatDate(sampleDetails.date_of_result)
- : "-"}
+ Facility:
+ {sampleDetails.facility_object.name}
- {sampleDetails.fast_track && (
-
-
- Fast track testing reason:{" "}
-
- {sampleDetails.fast_track}
-
- )}
- {sampleDetails.doctor_name && (
-
-
- Doctor's Name:{" "}
-
- {_.startCase(_.camelCase(sampleDetails.doctor_name))}
-
- )}
- {sampleDetails.diagnosis && (
-
-
- Diagnosis:{" "}
-
- {sampleDetails.diagnosis}
-
- )}
- {sampleDetails.diff_diagnosis && (
-
-
- Differential diagnosis:{" "}
-
- {sampleDetails.diff_diagnosis}
-
- )}
- {sampleDetails.etiology_identified && (
-
-
- Etiology identified:{" "}
-
- {sampleDetails.etiology_identified}
-
- )}
-
+ )}
+
+ Tested on:
+ {sampleDetails.date_of_result
+ ? formatDate(sampleDetails.date_of_result)
+ : "-"}
+
+
+ Result on:
+ {sampleDetails.date_of_result
+ ? formatDate(sampleDetails.date_of_result)
+ : "-"}
+
+ {sampleDetails.fast_track && (
+
- Is Atypical presentation{" "}
+ Fast track testing reason:{" "}
- {yesornoBadge(sampleDetails.is_atypical_presentation)}
+ {sampleDetails.fast_track}
-
+ )}
+ {sampleDetails.doctor_name && (
+
- Is unusual course{" "}
+ Doctor's Name:{" "}
- {yesornoBadge(sampleDetails.is_unusual_course)}
+ {_.startCase(_.camelCase(sampleDetails.doctor_name))}
- {sampleDetails.atypical_presentation && (
-
-
- Atypical presentation details:{" "}
-
- {sampleDetails.atypical_presentation}
-
- )}
-
-
- SARI - Severe Acute Respiratory illness{" "}
-
- {yesornoBadge(sampleDetails.has_sari)}
+ )}
+ {sampleDetails.diagnosis && (
+
+ Diagnosis:
+ {sampleDetails.diagnosis}
-
+ )}
+ {sampleDetails.diff_diagnosis && (
+
- ARI - Acute Respiratory illness{" "}
+ Differential diagnosis:{" "}
- {yesornoBadge(sampleDetails.has_ari)}
+ {sampleDetails.diff_diagnosis}
-
+ )}
+ {sampleDetails.etiology_identified && (
+
- Contact with confirmed carrier{" "}
+ Etiology identified:{" "}
- {yesornoBadge(sampleDetails.patient_has_confirmed_contact)}
+ {sampleDetails.etiology_identified}
-
+ )}
+
+
+ Is Atypical presentation{" "}
+
+ {yesOrNoBadge(sampleDetails.is_atypical_presentation)}
+
+
+
+ Is unusual course{" "}
+
+ {yesOrNoBadge(sampleDetails.is_unusual_course)}
+
+ {sampleDetails.atypical_presentation && (
+
- Contact with suspected carrier{" "}
+ Atypical presentation details:{" "}
- {yesornoBadge(sampleDetails.patient_has_suspected_contact)}
+ {sampleDetails.atypical_presentation}
- {sampleDetails.patient_travel_history &&
- sampleDetails.patient_travel_history.length !== 0 && (
-
-
- Countries travelled:{" "}
-
- {JSON.parse(sampleDetails.patient_travel_history).join(", ")}
-
- )}
- {sampleDetails.sample_type && (
+ )}
+
+
+ SARI - Severe Acute Respiratory illness{" "}
+
+ {yesOrNoBadge(sampleDetails.has_sari)}
+
+
+
+ ARI - Acute Respiratory illness{" "}
+
+ {yesOrNoBadge(sampleDetails.has_ari)}
+
+
+
+ Contact with confirmed carrier{" "}
+
+ {yesOrNoBadge(sampleDetails.patient_has_confirmed_contact)}
+
+
+
+ Contact with suspected carrier{" "}
+
+ {yesOrNoBadge(sampleDetails.patient_has_suspected_contact)}
+
+ {sampleDetails.patient_travel_history &&
+ sampleDetails.patient_travel_history.length !== 0 && (
- Sample Type:{" "}
+ Countries travelled:{" "}
- {_.startCase(_.camelCase(sampleDetails.sample_type))}
+ {JSON.parse(sampleDetails.patient_travel_history).join(", ")}
)}
-
-
+ {sampleDetails.sample_type && (
+
+
+ Sample Type:{" "}
+
+ {_.startCase(_.camelCase(sampleDetails.sample_type))}
+
+ )}
+
@@ -454,13 +439,11 @@ export const SampleDetails = (props: SampleDetailsProps) => {
{showPatientCard(sampleDetails.patient_object)}
-
- {sampleDetails.flow &&
- sampleDetails.flow.map((flow: FlowModel) => renderFlow(flow))}
+
+
Sample Test History
+ {sampleDetails.flow &&
+ sampleDetails.flow.map((flow: FlowModel) => renderFlow(flow))}
+
{
unspecified={true}
audio={true}
/>
-
+
);
};
diff --git a/src/Components/Patient/SampleFilters.tsx b/src/Components/Patient/SampleFilters.tsx
index a7be9852642..db22e54ac80 100644
--- a/src/Components/Patient/SampleFilters.tsx
+++ b/src/Components/Patient/SampleFilters.tsx
@@ -1,5 +1,4 @@
import { useState, useEffect } from "react";
-import { LegacySelectField } from "../Common/HelperInputFields";
import {
SAMPLE_TEST_STATUS,
SAMPLE_TEST_RESULT,
@@ -10,9 +9,12 @@ import { FacilitySelect } from "../Common/FacilitySelect";
import { FacilityModel } from "../Facility/models";
import { getAnyFacility } from "../../Redux/actions";
import { useDispatch } from "react-redux";
-import { CircularProgress } from "@material-ui/core";
import useMergeState from "../../Common/hooks/useMergeState";
import FiltersSlideover from "../../CAREUI/interactive/FiltersSlideover";
+import CircularProgress from "../Common/components/CircularProgress";
+import { FieldLabel } from "../Form/FormFields/FormField";
+import { SelectFormField } from "../Form/FormFields/SelectFormField";
+import { FieldChangeEvent } from "../Form/FormFields/Utils";
const clearFilterState = {
status: "",
@@ -36,13 +38,8 @@ export default function UserFilter(props: any) {
const [isFacilityLoading, setFacilityLoading] = useState(false);
const dispatch: any = useDispatch();
- const handleChange = (event: any) => {
- const { name, value } = event.target;
-
- const filterData: any = { ...filterState };
- filterData[name] = value;
-
- setFilterState(filterData);
+ const handleChange = ({ name, value }: FieldChangeEvent
) => {
+ setFilterState({ ...filterState, [name]: value });
};
const applyFilter = () => {
@@ -70,6 +67,8 @@ export default function UserFilter(props: any) {
fetchData();
}, [dispatch]);
+ console.log(filterState.sample_type);
+
return (
-
-
Status
-
{
- return { id, text: text.replaceAll("_", " ") };
- }),
- ]}
- onChange={handleChange}
- errors=""
- />
-
+ {
+ return { id, text: text.replaceAll("_", " ") };
+ })}
+ optionValue={(option) => option.id}
+ optionLabel={(option) => option.text}
+ labelClassName="text-sm"
+ errorClassName="hidden"
+ />
-
+ option.id}
+ optionLabel={(option) => option.text}
+ labelClassName="text-sm"
+ errorClassName="hidden"
+ />
-
+ option.id}
+ optionLabel={(option) => option.text}
+ labelClassName="text-sm"
+ errorClassName="hidden"
+ />
-
Facility
-
+
Facility
+
{isFacilityLoading ? (
-
+
) : (
)}
diff --git a/src/Components/Patient/SampleViewAdmin.tsx b/src/Components/Patient/SampleViewAdmin.tsx
index b7105ef2fd5..2f1204a34c4 100644
--- a/src/Components/Patient/SampleViewAdmin.tsx
+++ b/src/Components/Patient/SampleViewAdmin.tsx
@@ -401,7 +401,7 @@ export default function SampleViewAdmin() {
"Sample Test Type",
"sample_type",
SAMPLE_TYPE_CHOICES.find(
- (type) => type.id.toString() === qParams.sample_type
+ (type) => type.id === qParams.sample_type
)?.text || ""
),
value("Facility", "facility", facilityName),
diff --git a/src/Components/Patient/ShiftCreate.tsx b/src/Components/Patient/ShiftCreate.tsx
index e863ae3fd84..c4bb347cfcb 100644
--- a/src/Components/Patient/ShiftCreate.tsx
+++ b/src/Components/Patient/ShiftCreate.tsx
@@ -314,7 +314,7 @@ export const ShiftCreate = (props: patientShiftProps) => {
label="Contact person phone"
name="refering_facility_contact_number"
required
- onlyIndia
+ disableCountry
value={state.form.refering_facility_contact_number}
onChange={handleFormFieldChange}
error={state.errors.refering_facility_contact_number}
diff --git a/src/Components/Patient/models.tsx b/src/Components/Patient/models.tsx
index 9ed633feed0..3da59b9ba4a 100644
--- a/src/Components/Patient/models.tsx
+++ b/src/Components/Patient/models.tsx
@@ -260,7 +260,6 @@ export interface DailyRoundsModel {
pulse?: number;
resp?: number;
temperature?: string;
- temperatureUnit?: "C" | "F";
temperature_measured_at?: string;
physical_examination_info?: string;
other_details?: string;
diff --git a/src/Components/Resource/ListView.tsx b/src/Components/Resource/ListView.tsx
index 222bce4f3a0..15c5bd4baba 100644
--- a/src/Components/Resource/ListView.tsx
+++ b/src/Components/Resource/ListView.tsx
@@ -13,6 +13,10 @@ import BadgesList from "./BadgesList";
import { formatDate } from "../../Utils/utils";
import useFilters from "../../Common/hooks/useFilters";
import { ExportButton } from "../Common/Export";
+import ButtonV2 from "../Common/components/ButtonV2";
+import { useTranslation } from "react-i18next";
+import { AdvancedFilterButton } from "../../CAREUI/interactive/FiltersSlideover";
+import CareIcon from "../../CAREUI/icons/CareIcon";
const Loading = loadable(() => import("../Common/Loading"));
const PageTitle = loadable(() => import("../Common/PageTitle"));
@@ -24,6 +28,7 @@ export default function ListView() {
const [data, setData] = useState
([]);
const [totalCount, setTotalCount] = useState(0);
const [isLoading, setIsLoading] = useState(false);
+ const { t } = useTranslation();
const onBoardViewBtnClick = () =>
navigate("/resource/board-view", { query: qParams });
@@ -199,28 +204,13 @@ export default function ListView() {
/>
-
-
-
-
-
-
-
+
+
+
+ {t("board_view")}
+
+
+
advancedFilter.setShow(true)} />
diff --git a/src/Components/Resource/ResourceBoard.tsx b/src/Components/Resource/ResourceBoard.tsx
index 9d9f53bd0eb..3f42e82e2e0 100644
--- a/src/Components/Resource/ResourceBoard.tsx
+++ b/src/Components/Resource/ResourceBoard.tsx
@@ -4,15 +4,12 @@ import {
listResourceRequests,
downloadResourceRequests,
} from "../../Redux/actions";
-import CircularProgress from "@material-ui/core/CircularProgress";
import { navigate } from "raviger";
import moment from "moment";
import { classNames } from "../../Utils/utils";
import { useDrag, useDrop } from "react-dnd";
import { formatDate } from "../../Utils/utils";
-import ButtonV2 from "../Common/components/ButtonV2";
-import CareIcon from "../../CAREUI/icons/CareIcon";
-import CSVLink from "../Common/CSVLink";
+import { ExportButton } from "../Common/Export";
const limit = 14;
@@ -22,8 +19,6 @@ interface boardProps {
formatFilter: any;
}
-const now = moment().format("DD-MM-YYYY:hh:mm:ss");
-
const renderBoardTitle = (board: string) => board;
const reduceLoading = (action: string, current: any) => {
@@ -163,10 +158,8 @@ export default function ResourceBoard({
}: boardProps) {
const dispatch: any = useDispatch();
const [data, setData] = useState([]);
- const [downloadFile, setDownloadFile] = useState("");
const [totalCount, setTotalCount] = useState();
const [currentPage, setCurrentPage] = useState(1);
- const [downloadLoading, setDownloadLoading] = useState(false);
const [isLoading, setIsLoading] = useState({ board: false, more: false });
const [{ isOver }, drop] = useDrop(() => ({
accept: "resource-card",
@@ -195,21 +188,6 @@ export default function ResourceBoard({
});
};
- const triggerDownload = async () => {
- // while is getting ready
- setDownloadLoading(true);
- const res = await dispatch(
- downloadResourceRequests({
- ...formatFilter({ ...filterProp, status: board }),
- csv: 1,
- })
- );
- // file ready to download
- setDownloadLoading(false);
- setDownloadFile(res.data);
- document.getElementById(`resourceRequests-${board}`)?.click();
- };
-
useEffect(() => {
fetchData();
}, [
@@ -264,22 +242,15 @@ export default function ResourceBoard({
{renderBoardTitle(board)}{" "}
- {downloadLoading ? (
-
- ) : (
-
-
-
- Download
-
-
- )}
+
+ downloadResourceRequests({
+ ...formatFilter({ ...filterProp, status: board }),
+ csv: 1,
+ })
+ }
+ filenamePrefix={`resource_requests_${board}`}
+ />
{totalCount || "0"}
@@ -321,11 +292,6 @@ export default function ResourceBoard({
))}
-
);
}
diff --git a/src/Components/Resource/ResourceBoardView.tsx b/src/Components/Resource/ResourceBoardView.tsx
index 616c23b38fb..e3f147f41b6 100644
--- a/src/Components/Resource/ResourceBoardView.tsx
+++ b/src/Components/Resource/ResourceBoardView.tsx
@@ -10,6 +10,11 @@ import BadgesList from "./BadgesList";
import { formatFilter } from "./Commons";
import useFilters from "../../Common/hooks/useFilters";
import { ExportButton } from "../Common/Export";
+import SwitchTabs from "../Common/components/SwitchTabs";
+import ButtonV2 from "../Common/components/ButtonV2";
+import { useTranslation } from "react-i18next";
+import { AdvancedFilterButton } from "../../CAREUI/interactive/FiltersSlideover";
+import CareIcon from "../../CAREUI/icons/CareIcon";
const Loading = loadable(() => import("../Common/Loading"));
const PageTitle = loadable(() => import("../Common/PageTitle"));
@@ -25,6 +30,7 @@ export default function BoardView() {
// eslint-disable-next-line
const [isLoading, setIsLoading] = useState(false);
const appliedFilters = formatFilter(qParams);
+ const { t } = useTranslation();
const onListViewBtnClick = () => {
navigate("/resource/list-view", { query: qParams });
@@ -33,7 +39,7 @@ export default function BoardView() {
return (
-
+
-
-
-
-
-
-
-
-
diff --git a/src/Components/Resource/ResourceCreate.tsx b/src/Components/Resource/ResourceCreate.tsx
index 14b0a593599..2f1203bdc91 100644
--- a/src/Components/Resource/ResourceCreate.tsx
+++ b/src/Components/Resource/ResourceCreate.tsx
@@ -244,7 +244,7 @@ export default function ResourceCreate(props: resourceProps) {
label={t("contact_phone")}
name="refering_facility_contact_number"
required
- onlyIndia
+ disableCountry
value={state.form.refering_facility_contact_number}
onChange={handleFormFieldChange}
error={state.errors.refering_facility_contact_number}
diff --git a/src/Components/Shifting/BoardView.tsx b/src/Components/Shifting/BoardView.tsx
index 79c85fb7572..d4d95d93e70 100644
--- a/src/Components/Shifting/BoardView.tsx
+++ b/src/Components/Shifting/BoardView.tsx
@@ -17,6 +17,10 @@ import useFilters from "../../Common/hooks/useFilters";
import { useState } from "react";
import { useTranslation } from "react-i18next";
import withScrolling from "react-dnd-scrolling";
+import ButtonV2 from "../Common/components/ButtonV2";
+import SwitchTabs from "../Common/components/SwitchTabs";
+import { AdvancedFilterButton } from "../../CAREUI/interactive/FiltersSlideover";
+import CareIcon from "../../CAREUI/icons/CareIcon";
const Loading = loadable(() => import("../Common/Loading"));
const PageTitle = loadable(() => import("../Common/PageTitle"));
@@ -55,7 +59,7 @@ export default function BoardView() {
return (
-
+
-
+
updateQuery({ [e.name]: e.value })}
placeholder={t("search_patient")}
/>
-
-
-
-
-
-
diff --git a/src/Components/Shifting/ListFilter.tsx b/src/Components/Shifting/ListFilter.tsx
index 099926f78e4..ed6baa7d32d 100644
--- a/src/Components/Shifting/ListFilter.tsx
+++ b/src/Components/Shifting/ListFilter.tsx
@@ -18,7 +18,6 @@ import { FieldLabel } from "../Form/FormFields/FormField";
import FiltersSlideover from "../../CAREUI/interactive/FiltersSlideover";
import { LegacySelectField } from "../Common/HelperInputFields";
import PhoneNumberFormField from "../Form/FormFields/PhoneNumberFormField";
-import { UserSelect } from "../Common/UserSelect2";
import moment from "moment";
import { navigate } from "raviger";
import parsePhoneNumberFromString from "libphonenumber-js";
@@ -26,6 +25,7 @@ import useConfig from "../../Common/hooks/useConfig";
import { useDispatch } from "react-redux";
import useMergeState from "../../Common/hooks/useMergeState";
import { useTranslation } from "react-i18next";
+import UserAutocompleteFormField from "../Common/UserAutocompleteFormField";
const clearFilterState = {
orgin_facility: "",
@@ -57,7 +57,6 @@ export default function ListFilter(props: any) {
const [isOriginLoading, setOriginLoading] = useState(false);
const [isShiftingLoading, setShiftingLoading] = useState(false);
const [isAssignedLoading, setAssignedLoading] = useState(false);
- const [isAssignedUserLoading, setAssignedUserLoading] = useState(false);
const { t } = useTranslation();
const shiftStatusOptions = (
@@ -143,16 +142,13 @@ export default function ListFilter(props: any) {
useEffect(() => {
async function fetchData() {
if (filter.assigned_to) {
- setAssignedUserLoading(true);
const res = await dispatch(getUserList({ id: filter.assigned_to }));
-
if (res && res.data && res.data.count) {
setFilterState({
...filterState,
assigned_user_ref: res.data.results[0],
});
}
- setAssignedUserLoading(false);
}
}
fetchData();
@@ -345,23 +341,16 @@ export default function ListFilter(props: any) {
-
- {t("assigned_to")}
- {isAssignedUserLoading ? (
-
- ) : (
- setAssignedUser(obj)}
- className="shifting-page-filter-dropdown"
- errors={""}
- />
- )}
-
+
setAssignedUser(value)}
+ errorClassName="hidden"
+ />
-
+
{t("ordering")}
import("../Common/Loading"));
@@ -302,30 +304,20 @@ export default function ListView() {
{/* dummy div to align space as per board view */}
-
-
-
- navigate("/shifting/board-view", { query: qParams })
- }
- >
-
- {t("board_view")}
-
-
-
- advancedFilter.setShow(true)}
- >
-
- {t("filters")}
-
-
+
+
+ navigate("/shifting/board-view", { query: qParams })
+ }
+ >
+
+ {t("board_view")}
+
+
+
advancedFilter.setShow(true)}
+ />
>
}
diff --git a/src/Components/Shifting/ShiftingBoard.tsx b/src/Components/Shifting/ShiftingBoard.tsx
index d0ad71beb48..cdd5b8dce65 100644
--- a/src/Components/Shifting/ShiftingBoard.tsx
+++ b/src/Components/Shifting/ShiftingBoard.tsx
@@ -8,15 +8,13 @@ import {
import { useDrag, useDrop } from "react-dnd";
import ButtonV2 from "../Common/components/ButtonV2";
-import CareIcon from "../../CAREUI/icons/CareIcon";
-import CircularProgress from "../Common/components/CircularProgress";
import ConfirmDialogV2 from "../Common/ConfirmDialogV2";
import moment from "moment";
import { navigate } from "raviger";
import useConfig from "../../Common/hooks/useConfig";
import { useDispatch, useSelector } from "react-redux";
import { useTranslation } from "react-i18next";
-import CSVLink from "../Common/CSVLink";
+import { ExportButton } from "../Common/Export";
const limit = 14;
@@ -27,8 +25,6 @@ interface boardProps {
formatFilter: any;
}
-const now = moment().format("DD-MM-YYYY:hh:mm:ss");
-
const reduceLoading = (action: string, current: any) => {
switch (action) {
case "MORE":
@@ -259,11 +255,9 @@ export default function ShiftingBoard({
}: boardProps) {
const dispatch: any = useDispatch();
const [data, setData] = useState
([]);
- const [downloadFile, setDownloadFile] = useState("");
const [totalCount, setTotalCount] = useState();
const [currentPage, setCurrentPage] = useState(1);
const [isLoading, setIsLoading] = useState({ board: false, more: false });
- const [downloadLoading, setDownloadLoading] = useState(false);
const [{ isOver }, drop] = useDrop(() => ({
accept: "shift-card",
drop: (item: any) => {
@@ -288,21 +282,6 @@ export default function ShiftingBoard({
});
};
- const triggerDownload = async () => {
- // while is getting ready
- setDownloadLoading(true);
- const res = await dispatch(
- downloadShiftRequests({
- ...formatFilter({ ...filterProp, status: board }),
- csv: 1,
- })
- );
- // file ready to download
- setDownloadLoading(false);
- setDownloadFile(res.data);
- document.getElementById(`shiftRequests-${board}`)?.click();
- };
-
useEffect(() => {
fetchData();
}, [
@@ -367,22 +346,15 @@ export default function ShiftingBoard({
{title || board}{" "}
- {downloadLoading ? (
-
- ) : (
-
-
-
- {t("download")}
-
-
- )}
+
+ downloadShiftRequests({
+ ...formatFilter({ ...filterProp, status: board }),
+ csv: 1,
+ })
+ }
+ filenamePrefix={`shift_requests_${board}`}
+ />
{totalCount || "0"}
@@ -424,11 +396,6 @@ export default function ShiftingBoard({
))}
-
);
}
diff --git a/src/Components/Users/SkillsSlideOver.tsx b/src/Components/Users/SkillsSlideOver.tsx
index 785a2513a18..2a1dfbcbfde 100644
--- a/src/Components/Users/SkillsSlideOver.tsx
+++ b/src/Components/Users/SkillsSlideOver.tsx
@@ -94,8 +94,8 @@ export default ({ show, setShow, username }: IProps) => {
setDeleteSkill(null)}
- handleOk={() => removeSkill(username, deleteSkill.id)}
+ onCancel={() => setDeleteSkill(null)}
+ onSubmit={() => removeSkill(username, deleteSkill.id)}
/>
)}
void;
- handleOk: () => void;
+ onCancel: () => void;
+ onSubmit: () => void;
}
-const UnlinkSkillDialog = (props: ConfirmDialogProps) => {
- const { skillName, userName, handleCancel, handleOk } = props;
-
- const [disable, setDisable] = useState(false);
+export default function UnlinkSkillDialog(props: Props) {
+ const [disabled, setDisabled] = useState(false);
const handleSubmit = () => {
- handleOk();
- setDisable(true);
+ props.onSubmit();
+ setDisabled(true);
};
+
return (
-
+
+ Are you sure you want to unlink the skill{" "}
+ {props.skillName} from user{" "}
+ {props.userName}? the user will not have the skill
+ associated anymore.
+
+ }
+ >
);
-};
-
-export default UnlinkSkillDialog;
+}
diff --git a/src/Components/Users/UserAdd.tsx b/src/Components/Users/UserAdd.tsx
index fd22eddf470..3bad31a865d 100644
--- a/src/Components/Users/UserAdd.tsx
+++ b/src/Components/Users/UserAdd.tsx
@@ -1,4 +1,3 @@
-import { Card, CardContent, CircularProgress } from "@material-ui/core";
import loadable from "@loadable/component";
import { Link, navigate } from "raviger";
import { parsePhoneNumberFromString } from "libphonenumber-js/max";
@@ -39,9 +38,11 @@ import Checkbox from "../Common/components/CheckBox";
import DateFormField from "../Form/FormFields/DateFormField";
import { FieldLabel } from "../Form/FormFields/FormField";
import useAppHistory from "../../Common/hooks/useAppHistory";
+import Page from "../Common/components/Page";
+import Card from "../../CAREUI/display/Card";
+import CircularProgress from "../Common/components/CircularProgress";
const Loading = loadable(() => import("../Common/Loading"));
-const PageTitle = loadable(() => import("../Common/PageTitle"));
interface UserProps {
userId?: number;
@@ -86,8 +87,8 @@ const initForm: UserForm = {
first_name: "",
last_name: "",
email: "",
- phone_number: "",
- alt_phone_number: "",
+ phone_number: "+91",
+ alt_phone_number: "+91",
age: 0,
date_of_birth: null,
state: 0,
@@ -632,322 +633,315 @@ export const UserAdd = (props: UserProps) => {
};
return (
-
-
- Need Help?
-
- }
- justifyContents="justify-between"
- backUrl="/users"
- />
-
-
-
-
-
-
-
-
- Temperature Unit
-
-
- Set your temperature unit preference
-
-
-
-
-
-
-
diff --git a/src/Components/Users/models.tsx b/src/Components/Users/models.tsx
index fd5f24c2736..6f26ec8cc93 100644
--- a/src/Components/Users/models.tsx
+++ b/src/Components/Users/models.tsx
@@ -2,7 +2,7 @@ interface HomeFacilityObjectModel {
id?: string;
name?: string;
}
-export interface UserModel {
+export type UserModel = {
id?: number;
username?: string;
first_name?: string;
@@ -23,7 +23,7 @@ export interface UserModel {
doctor_qualification?: string;
doctor_experience_commenced_on?: string;
doctor_medical_council_registration?: string;
-}
+};
export interface SkillObjectModel {
id: string;
diff --git a/src/Utils/VoiceRecorder.tsx b/src/Utils/VoiceRecorder.tsx
index fdf45e819d0..60f03dba5a2 100644
--- a/src/Utils/VoiceRecorder.tsx
+++ b/src/Utils/VoiceRecorder.tsx
@@ -67,6 +67,7 @@ export const VoiceRecorder = (props: any) => {
{t("record")}
diff --git a/src/Utils/utils.ts b/src/Utils/utils.ts
index f97837e2232..35ad46408b1 100644
--- a/src/Utils/utils.ts
+++ b/src/Utils/utils.ts
@@ -224,15 +224,3 @@ export const formatCurrency = (price: number) =>
style: "currency",
currency: "INR",
});
-
-export const fahrenheitToCelsius = (x: any) => {
- if (x === null || x === undefined) return x;
- const t = (Number(x) - 32.0) * (5.0 / 9.0);
- return String(t.toFixed(1));
-};
-
-export const celsiusToFahrenheit = (x: any) => {
- if (x === null || x === undefined) return x;
- const t = (Number(x) * 9.0) / 5.0 + 32.0;
- return String(t.toFixed(1));
-};
diff --git a/src/index.tsx b/src/index.tsx
index dfebfd4fdaf..4df33b7357d 100644
--- a/src/index.tsx
+++ b/src/index.tsx
@@ -1,4 +1,4 @@
-import ReactDOM from "react-dom";
+import { createRoot } from "react-dom/client";
import reducer from "../src/Redux/Reducer";
import { createTheme, ThemeProvider } from "@material-ui/core/styles";
import App from "./App";
@@ -30,11 +30,11 @@ const theme = createTheme({
},
});
-ReactDOM.render(
+const root = createRoot(document.getElementById("root") as HTMLElement);
+root.render(
- ,
- document.getElementById("root")
+
);
diff --git a/src/react-phone-input-2.d.ts b/src/react-phone-input-2.d.ts
deleted file mode 100644
index 0b2ad81da0f..00000000000
--- a/src/react-phone-input-2.d.ts
+++ /dev/null
@@ -1,70 +0,0 @@
-declare module "react-phone-input-2" {
- import React from "react";
-
- export interface ICountryData {
- name: string;
- dialCode: string;
- countryCode: string;
- format: string;
- }
-
- interface IStyle {
- containerClass?: string;
- inputClass?: string;
- buttonClass?: string;
- dropdownClass?: string;
- searchClass?: string;
-
- containerStyle?: React.CSSProperties;
- inputStyle?: React.CSSProperties;
- buttonStyle?: React.CSSProperties;
- dropdownStyle?: React.CSSProperties;
- searchStyle?: React.CSSProperties;
- }
-
- interface IPhoneInputEventsProps {
- onChange?(
- value: string,
- data: ICountryData | {},
- event: ChangeEvent,
- formattedValue: string
- ): void;
- onFocus?(
- event: React.FocusEvent,
- data: ICountryData | {}
- ): void;
- onBlur?(
- event: React.FocusEvent,
- data: ICountryData | {}
- ): void;
- onClick?(
- event: React.MouseEvent,
- data: ICountryData | {}
- ): void;
- onKeyDown?(event: React.KeyboardEvent): void;
- }
-
- export interface IPhoneInputProps extends IPhoneInputEventsProps, IStyle {
- country?: string;
- value?: string;
- onlyCountries?: string[];
- preferredCountries?: string[];
- excludeCountries?: string[];
- placeholder?: string;
- searchPlaceholder?: string;
- inputProps?: object;
-
- autoFormat?: boolean;
- disabled?: boolean;
- disableDropdown?: boolean;
- disableCountryCode?: boolean;
- enableAreaCodes?: boolean;
- enableTerritories?: boolean;
- enableLongNumbers?: boolean;
- countryCodeEditable?: boolean;
- enableSearch?: boolean;
- disableSearchIcon?: boolean;
- }
- const PhoneInput: React.FC;
- export default PhoneInput;
-}
diff --git a/vite.config.ts b/vite.config.ts
index 53f1491e7b4..0244935cee0 100644
--- a/vite.config.ts
+++ b/vite.config.ts
@@ -57,6 +57,7 @@ export default defineConfig({
// workaround for react-phone-input-2 https://github.com/vitejs/vite/issues/2139#issuecomment-1405624744
defaultIsModuleExports(id) {
try {
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
const module = require(id);
if (module?.default) {
return false;