The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
fix
Steven Teyc7e2c6dbad2f
diff --git a/apps/web/lib/analytics/get-events.ts b/apps/web/lib/analytics/get-events.tsindex ba041d650c..276f7bc2dc 100644--- a/apps/web/lib/analytics/get-events.ts+++ b/apps/web/lib/analytics/get-events.ts@@ -1,7 +1,7 @@import { tb } from "@/lib/tinybird";import { tbDemo } from "../tinybird/demo-client";import { analyticsFilterTB } from "../zod/schemas/analytics";-import { clickEventSchemaTB } from "../zod/schemas/clicks";+import { clickEventMVSchemaTB } from "../zod/schemas/clicks";import { INTERVAL_DATA } from "./constants";import { EventsFilters } from "./types";@@ -27,15 +27,7 @@ export const getEvents = async (params: EventsFilters) => {const pipe = (isDemo ? tbDemo : tb).buildPipe({pipe: `v1_events`,parameters: analyticsFilterTB,- data: clickEventSchemaTB,- });-- console.log({- ...params,- eventType: event,- workspaceId,- start: start.toISOString().replace("T", " ").replace("Z", ""),- end: end.toISOString().replace("T", " ").replace("Z", ""),+ data: clickEventMVSchemaTB,});const response = await pipe({diff --git a/apps/web/ui/analytics/events/events-table.tsx b/apps/web/ui/analytics/events/events-table.tsxindex ade886c3db..da3f6fa3ad 100644--- a/apps/web/ui/analytics/events/events-table.tsx+++ b/apps/web/ui/analytics/events/events-table.tsx@@ -3,7 +3,7 @@import { editQueryString } from "@/lib/analytics/utils";import useWorkspace from "@/lib/swr/use-workspace";import { Button, LinkLogo, LoadingSpinner } from "@dub/ui";-import { COUNTRIES, capitalize, cn, fetcher, getApexDomain } from "@dub/utils";+import { COUNTRIES, capitalize, cn, fetcher } from "@dub/utils";import {ColumnDef,PaginationState,@@ -24,10 +24,11 @@ const tableCellClassName ="border-r border-b border-gray-200 px-4 py-2.5 text-left text-sm leading-6";type FakeDatum = {- link: { domain: string; key: string; url: string };+ // link: { domain: string; key: string; url: string };+ link_id: string;country: string;device: string;- date: string;+ timestamp: string;};export default function EventsTable() {@@ -51,14 +52,14 @@ export default function EventsTable() {cell: ({ getValue }) => (<div className="flex items-center gap-3"><LinkLogo- apexDomain={getApexDomain(getValue().url)}+ // apexDomain={getApexDomain(getValue().url)}className="h-4 w-4 sm:h-4 sm:w-4"/><span><span className="font-medium text-gray-950">- {getValue().domain}+ {/* {getValue().domain} */}dub.sh</span>- /{getValue().key}+ /{getValue()}</span></div>),@@ -98,11 +99,12 @@ export default function EventsTable() {header: "Date",enableSorting: true,accessorFn: (d) =>- new Date(d.date).toLocaleTimeString("en-US", {+ new Date(d.timestamp).toLocaleTimeString("en-US", {month: "short",day: "numeric",hour: "numeric",minute: "numeric",+ second: "numeric",hour12: true,}),},diff --git a/apps/web/ui/analytics/share-analytics.tsx b/apps/web/ui/analytics/share-analytics.tsxindex 4c82464727..9602719501 100644--- a/apps/web/ui/analytics/share-analytics.tsx+++ b/apps/web/ui/analytics/share-analytics.tsx@@ -2,7 +2,7 @@ import { Copy, Switch, Tick, useOptimisticUpdate } from "@dub/ui";import { linkConstructor } from "@dub/utils";import { useContext, useState } from "react";import { toast } from "sonner";-import { AnalyticsContext } from ".";+import { AnalyticsContext } from "./analytics-provider";export default function ShareAnalytics() {const { queryString, domain, key } = useContext(AnalyticsContext) as {