🐸 Rybbit - open-source and privacy-friendly alternative to Google Analytics that is 10x more intuitive.
Update EventList component to integrate event filtering functionality
Bill Yang781526c4a2f4
diff --git a/client/src/app/[site]/events/components/EventList.tsx b/client/src/app/[site]/events/components/EventList.tsxindex 0dc8c44ff..7396c0c6d 100644--- a/client/src/app/[site]/events/components/EventList.tsx+++ b/client/src/app/[site]/events/components/EventList.tsx@@ -8,6 +8,7 @@ import { useGetEventProperties } from "../../../../api/analytics/events/useGetEvimport { NothingFound } from "../../../../components/NothingFound";import { cn } from "../../../../lib/utils";import { EventProperties } from "./EventProperties";+import { addFilter } from "../../../../lib/store";// Skeleton component for EventListconst EventListSkeleton = memo(({ size = "small" }: { size?: "small" | "large" }) => {@@ -132,7 +133,13 @@ export function EventList({ events, isLoading, size = "small" }: EventListProps)"relative flex items-center cursor-pointer hover:bg-neutral-850 group px-2 rounded-md",size === "small" ? "h-6" : "h-9")}- onClick={() => handleEventClick(event.eventName)}+ onClick={() =>+ addFilter({+ parameter: "event_name",+ value: [event.eventName],+ type: "equals",+ })+ }><divclassName="absolute inset-0 bg-dataviz py-2 opacity-25 rounded-md"@@ -145,11 +152,18 @@ export function EventList({ events, isLoading, size = "small" }: EventListProps))}><div className="font-medium truncate max-w-[70%] flex items-center gap-1">- {isExpanded ? (- <ChevronDown className="h-4 w-4 text-neutral-400 hover:text-neutral-100" strokeWidth={3} />- ) : (- <ChevronRight className="h-4 w-4 text-neutral-400 hover:text-neutral-100" strokeWidth={3} />- )}+ <div+ onClick={e => {+ e.stopPropagation();+ handleEventClick(event.eventName);+ }}+ >+ {isExpanded ? (+ <ChevronDown className="h-4 w-4 text-neutral-400 hover:text-neutral-100" strokeWidth={3} />+ ) : (+ <ChevronRight className="h-4 w-4 text-neutral-400 hover:text-neutral-100" strokeWidth={3} />+ )}+ </div>{event.eventName}</div><div className={cn("text-sm flex gap-2", size === "small" ? "text-xs" : "text-sm")}>diff --git a/client/src/lib/filterGroups.ts b/client/src/lib/filterGroups.tsindex 3265ad664..e8144212a 100644--- a/client/src/lib/filterGroups.ts+++ b/client/src/lib/filterGroups.ts@@ -37,7 +37,7 @@ export const EVENT_FILTERS: FilterParameter[] = ["exit_page",];-export const GOALS_PAGE_FILTERS: FilterParameter[] = [...BASE_FILTERS, "event_name"];+export const GOALS_PAGE_FILTERS: FilterParameter[] = [...BASE_FILTERS];export const USER_PAGE_FILTERS: FilterParameter[] = ["hostname",@@ -57,6 +57,7 @@ export const USER_PAGE_FILTERS: FilterParameter[] = [];export const JOURNEY_PAGE_FILTERS: FilterParameter[] = [+ "hostname","browser","operating_system","language",@@ -65,7 +66,6 @@ export const JOURNEY_PAGE_FILTERS: FilterParameter[] = ["city","device_type","referrer",- "hostname",// "channel",// "utm_source",// "utm_medium",