mirror of
https://github.com/umami-software/umami.git
synced 2026-05-30 06:47:25 +00:00
Merge branch 'dev' of https://github.com/umami-software/umami into dev
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -17,7 +17,7 @@ import { X } from '@/components/icons';
|
||||
import { isSearchOperator } from '@/lib/params';
|
||||
|
||||
export interface FilterRecordProps {
|
||||
websiteId: string;
|
||||
websiteId?: string;
|
||||
type: string;
|
||||
startDate: Date;
|
||||
endDate: Date;
|
||||
|
||||
@@ -23,7 +23,7 @@ import { type FieldGroup, useFields, useMessages, useMobile } from '@/components
|
||||
import { Plus } from '@/components/icons';
|
||||
|
||||
export interface FieldFiltersProps {
|
||||
websiteId: string;
|
||||
websiteId?: string;
|
||||
value?: { name: string; operator: string; value: string }[];
|
||||
exclude?: string[];
|
||||
match?: string;
|
||||
|
||||
@@ -20,7 +20,7 @@ import {
|
||||
import { Bookmark, X } from '@/components/icons';
|
||||
import { isSearchOperator } from '@/lib/params';
|
||||
|
||||
export function FilterBar({ websiteId }: { websiteId: string }) {
|
||||
export function FilterBar({ websiteId }: { websiteId?: string }) {
|
||||
const { t, labels } = useMessages();
|
||||
const { formatValue } = useFormat();
|
||||
const {
|
||||
@@ -32,7 +32,8 @@ export function FilterBar({ websiteId }: { websiteId: string }) {
|
||||
} = useNavigation();
|
||||
const { filters, operatorLabels } = useFilters();
|
||||
const { data, isLoading } = useWebsiteSegmentQuery(websiteId, segment || cohort);
|
||||
const canSaveSegment = filters.length > 0 && !segment && !cohort && !pathname.includes('/share');
|
||||
const canSaveSegment =
|
||||
!!websiteId && filters.length > 0 && !segment && !cohort && !pathname.includes('/share');
|
||||
|
||||
const handleCloseFilter = (param: string) => {
|
||||
router.push(updateParams({ [param]: undefined }));
|
||||
|
||||
@@ -27,7 +27,7 @@ export function FilterEditForm({ websiteId, onChange, onClose }: FilterEditFormP
|
||||
const [currentCohort, setCurrentCohort] = useState(cohort);
|
||||
const [currentMatch, setCurrentMatch] = useState<string>(match || 'all');
|
||||
const { isMobile } = useMobile();
|
||||
const excludeFilters = pathname.includes('/pixels') || pathname.includes('/links');
|
||||
const excludeFilters = !websiteId || pathname.includes('/pixels') || pathname.includes('/links');
|
||||
const excludeEvent = !pathname.endsWith('/events') && !pathname.endsWith('/replays');
|
||||
|
||||
const handleReset = () => {
|
||||
|
||||
@@ -6,7 +6,7 @@ import { useWebsiteSegmentsQuery } from '@/components/hooks';
|
||||
import { ChartPie, UserPlus } from '@/components/icons';
|
||||
|
||||
export interface SegmentFiltersProps {
|
||||
websiteId: string;
|
||||
websiteId?: string;
|
||||
segmentId: string;
|
||||
type?: string;
|
||||
onChange?: (id: string, type: string) => void;
|
||||
|
||||
@@ -7,7 +7,7 @@ import { getDateRangeValue } from '@/lib/date';
|
||||
import { DateFilter } from './DateFilter';
|
||||
|
||||
export interface WebsiteDateFilterProps {
|
||||
websiteId: string;
|
||||
websiteId?: string;
|
||||
compare?: string;
|
||||
showAllTime?: boolean;
|
||||
showButtons?: boolean;
|
||||
|
||||
@@ -9,7 +9,7 @@ import { filtersArrayToObject } from '@/lib/params';
|
||||
export function WebsiteFilterButton({
|
||||
websiteId,
|
||||
}: {
|
||||
websiteId: string;
|
||||
websiteId?: string;
|
||||
position?: 'bottom' | 'top' | 'left' | 'right';
|
||||
alignment?: 'end' | 'center' | 'start';
|
||||
}) {
|
||||
|
||||
Reference in New Issue
Block a user