@@ -86,8 +85,8 @@ export default function ABDMFacilityRecords({ facilityId }: IProps) {
consent.expiry,
) < new Date()
? "EXPIRED"
- : consent.consent_artefacts?.[0]?.status ??
- consent.status}
+ : (consent.consent_artefacts?.[0]?.status ??
+ consent.status)}
@@ -102,13 +101,6 @@ export default function ABDMFacilityRecords({ facilityId }: IProps) {
: "-"}
|
- {/*
- {`${consent.requester?.first_name} ${consent.requester?.last_name}`.trim()}
-
- ({consent.requester.username})
-
- | */}
-
{formatDateTime(
consent.consent_artefacts?.[0]?.from_time ??
@@ -159,7 +151,7 @@ export default function ABDMFacilityRecords({ facilityId }: IProps) {
View
) : (
-
+
View
)}
diff --git a/src/Components/ABDM/ABDMRecordsTab.tsx b/src/Components/ABDM/ABDMRecordsTab.tsx
index d828335cd0d..37ae1a629db 100644
--- a/src/Components/ABDM/ABDMRecordsTab.tsx
+++ b/src/Components/ABDM/ABDMRecordsTab.tsx
@@ -5,7 +5,7 @@ import CareIcon from "../../CAREUI/icons/CareIcon";
import ButtonV2 from "../Common/components/ButtonV2";
import * as Notification from "../../Utils/Notifications.js";
import Loading from "../Common/Loading";
-import { classNames } from "../../Utils/utils";
+import { classNames, formatName } from "../../Utils/utils";
import { Link } from "raviger";
import routes from "../../Redux/api";
import request from "../../Utils/request/request";
@@ -75,7 +75,7 @@ function ConsentRequestCard({ consent }: IConsentRequestCardProps) {
}
- {consent.requester.first_name} {consent.requester.last_name}
+ {formatName(consent.requester)}
diff --git a/src/Components/Assets/AssetFilter.tsx b/src/Components/Assets/AssetFilter.tsx
index 0470ea7f701..bf07bad4b09 100644
--- a/src/Components/Assets/AssetFilter.tsx
+++ b/src/Components/Assets/AssetFilter.tsx
@@ -46,7 +46,7 @@ function AssetFilter(props: any) {
useEffect(() => {
setFacilityId(facility?.id ? `${facility?.id}` : "");
setLocationId(
- facility?.id === qParams.facility ? qParams.location ?? "" : "",
+ facility?.id === qParams.facility ? (qParams.location ?? "") : "",
);
}, [facility?.id, qParams.facility, qParams.location]);
diff --git a/src/Components/Assets/AssetManage.tsx b/src/Components/Assets/AssetManage.tsx
index a9bb6eb78ea..4c17721e1f9 100644
--- a/src/Components/Assets/AssetManage.tsx
+++ b/src/Components/Assets/AssetManage.tsx
@@ -10,7 +10,7 @@ import Pagination from "../Common/Pagination";
import { navigate } from "raviger";
import QRCode from "qrcode.react";
import AssetWarrantyCard from "./AssetWarrantyCard";
-import { formatDate, formatDateTime } from "../../Utils/utils";
+import { formatDate, formatDateTime, formatName } from "../../Utils/utils";
import Chip from "../../CAREUI/display/Chip";
import CareIcon from "../../CAREUI/icons/CareIcon";
import ButtonV2 from "../Common/components/ButtonV2";
@@ -110,7 +110,7 @@ const AssetManage = (props: AssetManageProps) => {
const PrintPreview = () => (
-
+
|
- {transaction.performed_by.first_name}{" "}
- {transaction.performed_by.last_name}
+ {formatName(transaction.performed_by)}
|
diff --git a/src/Components/Assets/AssetWarrantyCard.tsx b/src/Components/Assets/AssetWarrantyCard.tsx
index cde8dfc256d..e26575f712b 100644
--- a/src/Components/Assets/AssetWarrantyCard.tsx
+++ b/src/Components/Assets/AssetWarrantyCard.tsx
@@ -33,7 +33,7 @@ export default function AssetWarrantyCard(props: { asset: AssetData }) {
{asset.manufacturer}
-
+
{Object.keys(details).map((key) => (
diff --git a/src/Components/CameraFeed/AssetBedSelect.tsx b/src/Components/CameraFeed/AssetBedSelect.tsx
index dafb28d133f..d9f37d5ed2a 100644
--- a/src/Components/CameraFeed/AssetBedSelect.tsx
+++ b/src/Components/CameraFeed/AssetBedSelect.tsx
@@ -109,7 +109,7 @@ export const CameraPresetDropdown = (
leaveFrom="opacity-100"
leaveTo="opacity-0"
>
-
+
{options?.map((obj) => (
) => void) {
const { res, data } = await props.operate({ type: "get_presets" });
if (res?.ok && data) {
- cb((data as { result: Record }).result);
+ cb((data as GetPresetsResponse).result);
}
}
getPresets(props.onCameraPresetsObtained);
@@ -125,9 +126,9 @@ export default function CameraFeed(props: Props) {
}}
onReset={resetStream}
onMove={async (data) => {
- props.onMove?.();
setState("moving");
const { res } = await props.operate({ type: "relative_move", data });
+ props.onMove?.();
setTimeout(() => {
setState((state) => (state === "moving" ? undefined : state));
}, 4000);
diff --git a/src/Components/CameraFeed/CentralLiveMonitoring/LiveMonitoringFilters.tsx b/src/Components/CameraFeed/CentralLiveMonitoring/LiveMonitoringFilters.tsx
index 80032fc9abc..83b3052ddd7 100644
--- a/src/Components/CameraFeed/CentralLiveMonitoring/LiveMonitoringFilters.tsx
+++ b/src/Components/CameraFeed/CentralLiveMonitoring/LiveMonitoringFilters.tsx
@@ -46,7 +46,7 @@ const LiveMonitoringFilters = (props: Props) => {
- {props.totalCount}{" "}
+ {props.totalCount}{" "}
Camera(s) present
diff --git a/src/Components/CameraFeed/FeedControls.tsx b/src/Components/CameraFeed/FeedControls.tsx
index 8cff960505a..1bacd6c1cfc 100644
--- a/src/Components/CameraFeed/FeedControls.tsx
+++ b/src/Components/CameraFeed/FeedControls.tsx
@@ -224,7 +224,7 @@ export default function FeedControls({ shortcutsDisabled, ...props }: Props) {
-
+
{controls.zoom}
{controls.reset}
diff --git a/src/Components/CameraFeed/routes.ts b/src/Components/CameraFeed/routes.ts
index f3374a1776d..482dc515eb3 100644
--- a/src/Components/CameraFeed/routes.ts
+++ b/src/Components/CameraFeed/routes.ts
@@ -1,11 +1,27 @@
import { Type } from "../../Redux/api";
-import { OperationAction } from "./useOperateCamera";
+import { OperationAction, PTZPayload } from "./useOperateCamera";
+
+export type GetStatusResponse = {
+ result: {
+ position: PTZPayload;
+ moveStatus: {
+ panTilt: "IDLE" | "MOVING";
+ zoom: "IDLE" | "MOVING";
+ };
+ error: string;
+ utcTime: string;
+ };
+};
+
+export type GetPresetsResponse = {
+ result: Record ;
+};
export const FeedRoutes = {
operateAsset: {
path: "/api/v1/asset/{id}/operate_assets/",
method: "POST",
- TRes: Type |