From a1fd29b34b2588fd13e34adcdbcc2b15f94731ff Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Fri, 13 Sep 2024 07:25:29 -0600 Subject: [PATCH] Fix filter args (#13718) * Fix filter args in events * Fix export arg * Don' t fail * Fix filter buttons * Fix right click * Formatting --- web/src/components/card/AnimatedEventCard.tsx | 12 ++++---- web/src/components/card/ExportCard.tsx | 2 +- .../components/filter/CamerasFilterButton.tsx | 13 ++++++++- .../components/filter/ReviewFilterGroup.tsx | 11 +++++++- .../components/filter/SearchFilterGroup.tsx | 18 +++++++++++- web/src/components/player/LivePlayer.tsx | 8 ++++-- .../player/PreviewThumbnailPlayer.tsx | 8 ++++-- web/src/hooks/use-api-filter.ts | 6 +++- web/src/pages/Events.tsx | 28 +++++++++++++++++-- 9 files changed, 88 insertions(+), 18 deletions(-) diff --git a/web/src/components/card/AnimatedEventCard.tsx b/web/src/components/card/AnimatedEventCard.tsx index 8ee4acdcf..fd8096ebc 100644 --- a/web/src/components/card/AnimatedEventCard.tsx +++ b/web/src/components/card/AnimatedEventCard.tsx @@ -135,11 +135,13 @@ export function AnimatedEventCard({
- window - .open(`${baseUrl}review?id=${event.id}`, "_blank") - ?.focus() - } + onAuxClick={(e) => { + if (e.button === 1) { + window + .open(`${baseUrl}review?id=${event.id}`, "_blank") + ?.focus(); + } + }} > {!alertVideos ? ( shareOrCopy( - `${baseUrl}exports?id=${exportedRecording.id}`, + `${baseUrl}export?id=${exportedRecording.id}`, exportedRecording.name.replaceAll("_", " "), ) } diff --git a/web/src/components/filter/CamerasFilterButton.tsx b/web/src/components/filter/CamerasFilterButton.tsx index 1b36102b8..da188b5d7 100644 --- a/web/src/components/filter/CamerasFilterButton.tsx +++ b/web/src/components/filter/CamerasFilterButton.tsx @@ -1,6 +1,6 @@ import { Button } from "../ui/button"; import { CameraGroupConfig } from "@/types/frigateConfig"; -import { useMemo, useState } from "react"; +import { useEffect, useMemo, useState } from "react"; import { DropdownMenu, DropdownMenuContent, @@ -53,6 +53,17 @@ export function CamerasFilterButton({ }`; }, [allCamerasSelected, currentCameras]); + // ui + + useEffect(() => { + setCurrentCameras( + selectedCameras === undefined ? [...allCameras] : selectedCameras, + ); + setAllCamerasSelected(selectedCameras === undefined); + // only refresh when state changes + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [selectedCameras]); + const trigger = (