Make websiteId optional in filter controls to enable dashboard filtering

Allows BoardControls to render filter bar and date picker without
requiring a websiteId. Website-specific features (segments, cohorts,
filter value autocomplete, save segment) are gracefully hidden when
no websiteId is available.
This commit is contained in:
Mike Cao committed 2026-03-04 21:30:05 -08:00
1 parent d4a995d9cc
commit c921231bb9
9 files changed
+11 -17

No files matched your search

@@ -9,16 +9,9 @@ export function BoardControls() {
?.flatMap(row => row.columns)
.map(column => column.component?.websiteId)
.filter(Boolean);
const fallbackWebsiteId =
componentWebsiteIds && new Set(componentWebsiteIds).size === 1
? componentWebsiteIds[0]
: undefined;
const fallbackWebsiteId = componentWebsiteIds?.[0];
const websiteId = boardWebsiteId || fallbackWebsiteId;
if (!websiteId) {
return null;
}
return (
<Box marginBottom="4">
<WebsiteControls websiteId={websiteId} />
@@ -13,7 +13,7 @@ export function WebsiteControls({
allowDownload = false,
allowCompare = false,
}: {
websiteId: string;
websiteId?: string;
allowFilter?: boolean;
allowBounceFilter?: boolean;
allowDateFilter?: boolean;