From ac3681190dfc183e804f8aa8f8ca9ac4cc30deba Mon Sep 17 00:00:00 2001 From: Rishith25 Date: Mon, 21 Oct 2024 20:58:12 +0530 Subject: [PATCH 1/5] Removed the camera name and details pop-up in assest configuration page --- src/Components/Assets/AssetConfigure.tsx | 6 ++++- src/Components/CameraFeed/CameraFeed.tsx | 25 ++++++++++++------- src/Components/CameraFeed/ConfigureCamera.tsx | 11 +++++++- 3 files changed, 31 insertions(+), 11 deletions(-) diff --git a/src/Components/Assets/AssetConfigure.tsx b/src/Components/Assets/AssetConfigure.tsx index 9f5f73f296d..7c92430427b 100644 --- a/src/Components/Assets/AssetConfigure.tsx +++ b/src/Components/Assets/AssetConfigure.tsx @@ -61,7 +61,11 @@ const AssetConfigure = ({ assetId, facilityId }: AssetConfigureProps) => { }} backUrl={`/facility/${facilityId}/assets/${assetId}`} > - refetch()} /> + refetch()} + isAssetCongfigure={true} + /> ); }; diff --git a/src/Components/CameraFeed/CameraFeed.tsx b/src/Components/CameraFeed/CameraFeed.tsx index 3c9b25b6fc9..166282282b1 100644 --- a/src/Components/CameraFeed/CameraFeed.tsx +++ b/src/Components/CameraFeed/CameraFeed.tsx @@ -28,6 +28,8 @@ interface Props { shortcutsDisabled?: boolean; onMove?: () => void; operate: ReturnType["operate"]; + //Assest Configuration + isAssetConfigurationPage?: boolean; } export default function CameraFeed(props: Props) { @@ -145,6 +147,8 @@ export default function CameraFeed(props: Props) { /> ); + const isAssetConfigurationPage = props.isAssetConfigurationPage || false; + return (
-
- - {props.asset.name} - - -
+ {!isAssetConfigurationPage && ( +
+ + {props.asset.name} + + +
+ )} + {!isIOS && (
void; + isAssetCongfigure?: boolean; } type OnvifPreset = { name: string; value: number }; @@ -58,6 +59,7 @@ export default function ConfigureCamera(props: Props) { }>(); const [presetName, setPresetName] = useState(""); const [showUnlinkConfirmation, setShowUnlinkConfirmation] = useState(false); + const isAssetCongfigure = props.isAssetCongfigure || false; const assetBedsQuery = useQuery(routes.listAssetBeds, { query: { asset: props.asset.id, limit: 50 }, @@ -106,7 +108,12 @@ export default function ConfigureCamera(props: Props) { if (!["DistrictAdmin", "StateAdmin"].includes(authUser.user_type)) { return (
- +
); } @@ -246,6 +253,7 @@ export default function ConfigureCamera(props: Props) { ); } }} + isAssetConfigurationPage={isAssetCongfigure} >
{preset.name} + asudhbu Date: Mon, 21 Oct 2024 21:02:36 +0530 Subject: [PATCH 2/5] Removed the camera name and details pop-up in assest configuration page --- src/Components/CameraFeed/ConfigureCamera.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Components/CameraFeed/ConfigureCamera.tsx b/src/Components/CameraFeed/ConfigureCamera.tsx index 33f7b8d20d5..ee8aca7f2a9 100644 --- a/src/Components/CameraFeed/ConfigureCamera.tsx +++ b/src/Components/CameraFeed/ConfigureCamera.tsx @@ -560,7 +560,6 @@ export default function ConfigureCamera(props: Props) {
{preset.name} - asudhbu Date: Mon, 21 Oct 2024 21:06:14 +0530 Subject: [PATCH 3/5] Removed the camera name and details pop-up in assest configuration page --- src/Components/Assets/AssetConfigure.tsx | 2 +- src/Components/CameraFeed/ConfigureCamera.tsx | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Components/Assets/AssetConfigure.tsx b/src/Components/Assets/AssetConfigure.tsx index 7c92430427b..253806d4e18 100644 --- a/src/Components/Assets/AssetConfigure.tsx +++ b/src/Components/Assets/AssetConfigure.tsx @@ -64,7 +64,7 @@ const AssetConfigure = ({ assetId, facilityId }: AssetConfigureProps) => { refetch()} - isAssetCongfigure={true} + isAssetConfigure={true} /> ); diff --git a/src/Components/CameraFeed/ConfigureCamera.tsx b/src/Components/CameraFeed/ConfigureCamera.tsx index ee8aca7f2a9..4db788f2cdd 100644 --- a/src/Components/CameraFeed/ConfigureCamera.tsx +++ b/src/Components/CameraFeed/ConfigureCamera.tsx @@ -33,7 +33,7 @@ import CheckBoxFormField from "../Form/FormFields/CheckBoxFormField"; interface Props { asset: AssetData; onUpdated: () => void; - isAssetCongfigure?: boolean; + isAssetConfigure?: boolean; } type OnvifPreset = { name: string; value: number }; @@ -59,7 +59,7 @@ export default function ConfigureCamera(props: Props) { }>(); const [presetName, setPresetName] = useState(""); const [showUnlinkConfirmation, setShowUnlinkConfirmation] = useState(false); - const isAssetCongfigure = props.isAssetCongfigure || false; + const isAssetConfigure = props.isAssetConfigure || false; const assetBedsQuery = useQuery(routes.listAssetBeds, { query: { asset: props.asset.id, limit: 50 }, @@ -112,7 +112,7 @@ export default function ConfigureCamera(props: Props) { asset={props.asset} key={key} operate={operate} - isAssetConfigurationPage={isAssetCongfigure} + isAssetConfigurationPage={isAssetConfigure} />
); @@ -253,7 +253,7 @@ export default function ConfigureCamera(props: Props) { ); } }} - isAssetConfigurationPage={isAssetCongfigure} + isAssetConfigurationPage={isAssetConfigure} >
Date: Tue, 22 Oct 2024 07:02:40 +0530 Subject: [PATCH 4/5] Changed the isAssetConfigure to hideMonitorAsset in props --- src/Components/Assets/AssetConfigure.tsx | 2 +- src/Components/CameraFeed/CameraFeed.tsx | 8 ++++---- src/Components/CameraFeed/ConfigureCamera.tsx | 9 +++++---- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/Components/Assets/AssetConfigure.tsx b/src/Components/Assets/AssetConfigure.tsx index 253806d4e18..6175d73bf1d 100644 --- a/src/Components/Assets/AssetConfigure.tsx +++ b/src/Components/Assets/AssetConfigure.tsx @@ -64,7 +64,7 @@ const AssetConfigure = ({ assetId, facilityId }: AssetConfigureProps) => { refetch()} - isAssetConfigure={true} + hideMonitorAsset={true} /> ); diff --git a/src/Components/CameraFeed/CameraFeed.tsx b/src/Components/CameraFeed/CameraFeed.tsx index 166282282b1..bd2e21877bf 100644 --- a/src/Components/CameraFeed/CameraFeed.tsx +++ b/src/Components/CameraFeed/CameraFeed.tsx @@ -28,8 +28,8 @@ interface Props { shortcutsDisabled?: boolean; onMove?: () => void; operate: ReturnType["operate"]; - //Assest Configuration - isAssetConfigurationPage?: boolean; + //Monitor Hide or Show + hideMonitorAsset?: boolean; } export default function CameraFeed(props: Props) { @@ -147,7 +147,7 @@ export default function CameraFeed(props: Props) { /> ); - const isAssetConfigurationPage = props.isAssetConfigurationPage || false; + const hideMonitorAsset = props.hideMonitorAsset || false; return (
@@ -187,7 +187,7 @@ export default function CameraFeed(props: Props) { {props.children}
- {!isAssetConfigurationPage && ( + {!hideMonitorAsset && (
{props.asset.name} diff --git a/src/Components/CameraFeed/ConfigureCamera.tsx b/src/Components/CameraFeed/ConfigureCamera.tsx index 4db788f2cdd..bb83d010ab0 100644 --- a/src/Components/CameraFeed/ConfigureCamera.tsx +++ b/src/Components/CameraFeed/ConfigureCamera.tsx @@ -33,7 +33,8 @@ import CheckBoxFormField from "../Form/FormFields/CheckBoxFormField"; interface Props { asset: AssetData; onUpdated: () => void; - isAssetConfigure?: boolean; + //show or hide camera pop-up + hideMonitorAsset?: boolean; } type OnvifPreset = { name: string; value: number }; @@ -59,7 +60,7 @@ export default function ConfigureCamera(props: Props) { }>(); const [presetName, setPresetName] = useState(""); const [showUnlinkConfirmation, setShowUnlinkConfirmation] = useState(false); - const isAssetConfigure = props.isAssetConfigure || false; + const hideMonitorAsset = props.hideMonitorAsset || false; const assetBedsQuery = useQuery(routes.listAssetBeds, { query: { asset: props.asset.id, limit: 50 }, @@ -112,7 +113,7 @@ export default function ConfigureCamera(props: Props) { asset={props.asset} key={key} operate={operate} - isAssetConfigurationPage={isAssetConfigure} + hideMonitorAsset={hideMonitorAsset} />
); @@ -253,7 +254,7 @@ export default function ConfigureCamera(props: Props) { ); } }} - isAssetConfigurationPage={isAssetConfigure} + hideMonitorAsset={hideMonitorAsset} >
Date: Tue, 22 Oct 2024 10:46:56 +0530 Subject: [PATCH 5/5] Refactor props and component names --- src/Components/Assets/AssetConfigure.tsx | 6 +----- src/Components/CameraFeed/CameraFeed.tsx | 11 ++++------- src/Components/CameraFeed/ConfigureCamera.tsx | 7 ++----- .../{MonitorAssetPopover.tsx => AssetInfoPopover.tsx} | 11 ++++------- src/Components/VitalsMonitor/VitalsMonitorFooter.tsx | 4 ++-- 5 files changed, 13 insertions(+), 26 deletions(-) rename src/Components/Common/{MonitorAssetPopover.tsx => AssetInfoPopover.tsx} (92%) diff --git a/src/Components/Assets/AssetConfigure.tsx b/src/Components/Assets/AssetConfigure.tsx index 6175d73bf1d..9f5f73f296d 100644 --- a/src/Components/Assets/AssetConfigure.tsx +++ b/src/Components/Assets/AssetConfigure.tsx @@ -61,11 +61,7 @@ const AssetConfigure = ({ assetId, facilityId }: AssetConfigureProps) => { }} backUrl={`/facility/${facilityId}/assets/${assetId}`} > - refetch()} - hideMonitorAsset={true} - /> + refetch()} /> ); }; diff --git a/src/Components/CameraFeed/CameraFeed.tsx b/src/Components/CameraFeed/CameraFeed.tsx index bd2e21877bf..93f87ee20aa 100644 --- a/src/Components/CameraFeed/CameraFeed.tsx +++ b/src/Components/CameraFeed/CameraFeed.tsx @@ -12,7 +12,7 @@ import useFullscreen from "../../Common/hooks/useFullscreen"; import useBreakpoints from "../../Common/hooks/useBreakpoints"; import { GetPresetsResponse } from "./routes"; import VideoPlayer from "./videoPlayer"; -import MonitorAssetPopover from "../Common/MonitorAssetPopover"; +import AssetInfoPopover from "../Common/AssetInfoPopover"; interface Props { children?: React.ReactNode; @@ -28,8 +28,7 @@ interface Props { shortcutsDisabled?: boolean; onMove?: () => void; operate: ReturnType["operate"]; - //Monitor Hide or Show - hideMonitorAsset?: boolean; + hideAssetInfo?: boolean; } export default function CameraFeed(props: Props) { @@ -147,8 +146,6 @@ export default function CameraFeed(props: Props) { /> ); - const hideMonitorAsset = props.hideMonitorAsset || false; - return (
- {!hideMonitorAsset && ( + {!props.hideAssetInfo && (
{props.asset.name} - diff --git a/src/Components/CameraFeed/ConfigureCamera.tsx b/src/Components/CameraFeed/ConfigureCamera.tsx index bb83d010ab0..4882b21c655 100644 --- a/src/Components/CameraFeed/ConfigureCamera.tsx +++ b/src/Components/CameraFeed/ConfigureCamera.tsx @@ -33,8 +33,6 @@ import CheckBoxFormField from "../Form/FormFields/CheckBoxFormField"; interface Props { asset: AssetData; onUpdated: () => void; - //show or hide camera pop-up - hideMonitorAsset?: boolean; } type OnvifPreset = { name: string; value: number }; @@ -60,7 +58,6 @@ export default function ConfigureCamera(props: Props) { }>(); const [presetName, setPresetName] = useState(""); const [showUnlinkConfirmation, setShowUnlinkConfirmation] = useState(false); - const hideMonitorAsset = props.hideMonitorAsset || false; const assetBedsQuery = useQuery(routes.listAssetBeds, { query: { asset: props.asset.id, limit: 50 }, @@ -113,7 +110,7 @@ export default function ConfigureCamera(props: Props) { asset={props.asset} key={key} operate={operate} - hideMonitorAsset={hideMonitorAsset} + hideAssetInfo />
); @@ -254,7 +251,7 @@ export default function ConfigureCamera(props: Props) { ); } }} - hideMonitorAsset={hideMonitorAsset} + hideAssetInfo >
{ +const AssetInfoPopover = ({ asset, className }: AssetInfoPopoverProps) => { const { t } = useTranslation(); return ( @@ -87,4 +84,4 @@ const MonitorAssetPopover = ({ ); }; -export default MonitorAssetPopover; +export default AssetInfoPopover; diff --git a/src/Components/VitalsMonitor/VitalsMonitorFooter.tsx b/src/Components/VitalsMonitor/VitalsMonitorFooter.tsx index 1c669cd5bbf..1a45b2cd000 100644 --- a/src/Components/VitalsMonitor/VitalsMonitorFooter.tsx +++ b/src/Components/VitalsMonitor/VitalsMonitorFooter.tsx @@ -1,5 +1,5 @@ import { AssetData } from "../Assets/AssetTypes"; -import MonitorAssetPopover from "../Common/MonitorAssetPopover"; +import AssetInfoPopover from "../Common/AssetInfoPopover"; interface IVitalsMonitorFooterProps { asset?: AssetData; @@ -9,7 +9,7 @@ const VitalsMonitorFooter = ({ asset }: IVitalsMonitorFooterProps) => { return (

{asset?.name}

-