From 0a1ac97c574d09e13f2c1f5e440a6ed8c9106988 Mon Sep 17 00:00:00 2001 From: Toba Ojo Date: Fri, 14 Nov 2025 11:55:01 +0000 Subject: [PATCH 1/2] - removed console.log --- src/hooks/useCameraZoom.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/hooks/useCameraZoom.ts b/src/hooks/useCameraZoom.ts index e7e174a..7862f1f 100644 --- a/src/hooks/useCameraZoom.ts +++ b/src/hooks/useCameraZoom.ts @@ -11,7 +11,6 @@ const getCameraMode = async (options: { camera: string }) => { }; const updateCameraMode = async (options: { camera: string; mode: string }) => { - console.log(options); const dayNightPayload = { id: options.camera, fields: [ From dd1cd342c13460eb5366d8ac60ce584cab7860b9 Mon Sep 17 00:00:00 2001 From: Toba Ojo Date: Fri, 14 Nov 2025 15:01:01 +0000 Subject: [PATCH 2/2] - added nped category options for alert popups - minor fix on modal for 'DISABLED' MCC --- .../PopupSettings/NPEDCategoryPopup.tsx | 65 +++++++++++++++++++ .../SettingForms/NPED/NPEDCatToggle.tsx | 22 +++++++ .../SettingForms/NPED/NPEDFields.tsx | 29 ++++----- .../SightingModal/SightingModal.tsx | 42 ++++++------ .../SightingsWidget/SightingWidget.tsx | 14 +++- .../providers/IntegrationsContextProvider.tsx | 36 ++++++++-- .../reducers/IntegrationsContextReducer.ts | 11 ++++ src/pages/SystemSettings.tsx | 2 + src/types/types.ts | 8 +++ 9 files changed, 184 insertions(+), 45 deletions(-) create mode 100644 src/components/PopupSettings/NPEDCategoryPopup.tsx create mode 100644 src/components/SettingForms/NPED/NPEDCatToggle.tsx diff --git a/src/components/PopupSettings/NPEDCategoryPopup.tsx b/src/components/PopupSettings/NPEDCategoryPopup.tsx new file mode 100644 index 0000000..b2c521b --- /dev/null +++ b/src/components/PopupSettings/NPEDCategoryPopup.tsx @@ -0,0 +1,65 @@ +import Card from "../UI/Card"; +import CardHeader from "../UI/CardHeader"; +import NPEDCatToggle from "../SettingForms/NPED/NPEDCatToggle"; +import FormGroup from "../SettingForms/components/FormGroup"; +import { Form, Formik } from "formik"; +import { useIntegrationsContext } from "../../context/IntegrationsContext"; +import { useCameraBlackboard } from "../../hooks/useCameraBlackboard"; +import type { CategoryPopups } from "../../types/types"; + +const NPEDCategoryPopup = () => { + const { state, dispatch } = useIntegrationsContext(); + const { mutation } = useCameraBlackboard(); + + const isCatAEnabled = state?.iscatEnabled?.catA; + const isCatBEnabled = state?.iscatEnabled?.catB; + const isCatCEnabled = state?.iscatEnabled?.catC; + const isCatDEnabled = state?.iscatEnabled?.catD; + + const initialValues = { + catA: isCatAEnabled ?? true, + catB: isCatBEnabled ?? true, + catC: isCatCEnabled ?? true, + catD: isCatDEnabled ?? false, + }; + + const handleSubmit = async (values: CategoryPopups) => { + await mutation.mutateAsync({ + operation: "INSERT", + value: values, + path: "CategoryPopup", + }); + dispatch({ type: "NPEDCATENABLED", payload: values }); + }; + + return ( + + +

Allows alerts to pop up to user.

+ +
+ + + + + + + + + + + + + +
+
+
+ ); +}; + +export default NPEDCategoryPopup; diff --git a/src/components/SettingForms/NPED/NPEDCatToggle.tsx b/src/components/SettingForms/NPED/NPEDCatToggle.tsx new file mode 100644 index 0000000..d8a627b --- /dev/null +++ b/src/components/SettingForms/NPED/NPEDCatToggle.tsx @@ -0,0 +1,22 @@ +import { Field } from "formik"; + +type NPEDToggleProps = { + name: string; + label: string; +}; + +const NPEDCatToggle = ({ name, label }: NPEDToggleProps) => { + return ( +