Export dialog improvements (#24787)

* show validation errors in multi-camera export

Clearing part of a time field in the export time picker set the range to NaN, while the picker kept showing a valid fallback time. The multi-camera Export button then stayed disabled with no explanation, and non-admins could never start an export because a case name was required even though they can't see the case field. The picker now ignores incomplete time values. The multi-camera tab shows inline errors for an invalid range, no selected cameras, and a blank case name, only requires a case name from admins, and prefills a default case name.

* add viewer export test and remove stale non-admin case text

* fix test
This commit is contained in:
Josh Hawkins
2026-10-26 06:24:34 -06:00
committed by GitHub
parent 9fec1c76b5
commit 975f346618
5 changed files with 153 additions and 12 deletions
@@ -68,9 +68,7 @@ export default function MultiExportDialog({
const isAdmin = useIsAdmin();
const { data: config } = useSWR<FrigateConfig>("config");
// Only admins can attach exports to an existing case (enforced server-side
// by POST /exports/batch). Skip fetching the case list entirely for
// non-admins — they can only ever use the "Create new case" branch.
// Only admins can assign exports to a case, so non-admins skip the case list
const { data: cases } = useSWR<ExportCase[]>(isAdmin ? "cases" : null);
const [open, setOpen] = useState(false);
@@ -284,9 +282,6 @@ export default function MultiExportDialog({
t,
]);
// New-case inputs: rendered below the Select when caseSelection === "new",
// or rendered standalone for non-admins (who never see the Select since
// they cannot attach to an existing case).
const newCaseInputs = (
<div className="space-y-2 pt-1">
<Input