Umami is a privacy-first web and product analytics platform. Traffic, campaigns, behavior, conversions, and revenue in one place. No cookies, no surveillance, self-hosted or in the cloud.
TypeScript analyticsaudience-segmentationchartscohort-analysisgoogle-analyticsproduct-analyticsstatisticsuser-journeyweb-analytics
Fixed funnel report saving invalid data.
Mike Cao980e4e6b41a5
diff --git a/package.json b/package.jsonindex c229f45b8..455dff953 100644--- a/package.json+++ b/package.json@@ -82,7 +82,7 @@"@react-spring/web": "^10.0.1","@svgr/cli": "^8.1.0","@tanstack/react-query": "^5.85.5",- "@umami/react-zen": "^0.183.0",+ "@umami/react-zen": "^0.184.0","@umami/redis-client": "^0.29.0","bcryptjs": "^3.0.2","chalk": "^5.6.0",diff --git a/pnpm-lock.yaml b/pnpm-lock.yamlindex 19a08f61b..c71a6ef7d 100644--- a/pnpm-lock.yaml+++ b/pnpm-lock.yaml@@ -45,8 +45,8 @@ importers:specifier: ^5.85.5version: 5.85.5([email protected])'@umami/react-zen':- specifier: ^0.183.0- version: 0.183.0(@babel/[email protected])(@types/[email protected])([email protected])([email protected])([email protected]([email protected]))+ specifier: ^0.184.0+ version: 0.184.0(@babel/[email protected])(@types/[email protected])([email protected])([email protected])([email protected]([email protected]))'@umami/redis-client':specifier: ^0.29.0version: 0.29.0@@ -2735,8 +2735,8 @@ packages:'@prisma/client': ^6.1.0'@prisma/extension-read-replicas': ^0.4.1- '@umami/[email protected]':- resolution: {integrity: sha512-snzfp87NElKbQn5lHUs3jTdCkXww4FHNJAGzyXVUcTv/5Bqv9mAmW+6htELychvQnO259t8GL/qJrcC5V/e4cg==}+ '@umami/[email protected]':+ resolution: {integrity: sha512-XfxTiP4ljumflx02ymDMXLnhcJW+mOxxKCPEVEjuDrQfR6VUlbHg0EdH04S4gvCJZJC/WnP6guyO2eabhJL88Q==}'@umami/[email protected]':resolution: {integrity: sha512-Jaqh++jskqDB7ny75pfC02OvKp1JTS4asGDsFrRL3qy8sxL3PAl9+/mybCJe4/6vWrXDJKqpgkSfUDJq2bFjyw==}@@ -10323,7 +10323,7 @@ snapshots:transitivePeerDependencies:- supports-color- '@umami/[email protected](@babel/[email protected])(@types/[email protected])([email protected])([email protected])([email protected]([email protected]))':+ '@umami/[email protected](@babel/[email protected])(@types/[email protected])([email protected])([email protected])([email protected]([email protected]))':dependencies:'@fontsource/jetbrains-mono': 5.2.8'@internationalized/date': 3.9.0diff --git a/src/app/(main)/websites/[websiteId]/(reports)/funnels/Funnel.tsx b/src/app/(main)/websites/[websiteId]/(reports)/funnels/Funnel.tsxindex a91b41e9b..7237dc9c7 100644--- a/src/app/(main)/websites/[websiteId]/(reports)/funnels/Funnel.tsx+++ b/src/app/(main)/websites/[websiteId]/(reports)/funnels/Funnel.tsx@@ -1,7 +1,7 @@import { Grid, Column, Row, Text, Icon, ProgressBar, Dialog, Box } from '@umami/react-zen';import { useMessages, useResultQuery } from '@/components/hooks';import { LoadingPanel } from '@/components/common/LoadingPanel';-import { File, Lightning, User } from '@/components/icons';+import { File, LightningSvg, User } from '@/components/icons';import { formatLongNumber } from '@/lib/format';import { ReportEditButton } from '@/components/input/ReportEditButton';import { FunnelEditForm } from './FunnelEditForm';@@ -92,7 +92,7 @@ export function Funnel({ id, name, type, parameters, websiteId }) {</Row><Row alignItems="center" justifyContent="space-between" gap><Row alignItems="center" gap>- <Icon>{type === 'path' ? <File /> : <Lightning />}</Icon>+ <Icon>{type === 'path' ? <File /> : <LightningSvg />}</Icon><Text>{value}</Text></Row><Row alignItems="center" gap>diff --git a/src/app/(main)/websites/[websiteId]/(reports)/funnels/FunnelEditForm.tsx b/src/app/(main)/websites/[websiteId]/(reports)/funnels/FunnelEditForm.tsxindex 57675bdf7..01940beb0 100644--- a/src/app/(main)/websites/[websiteId]/(reports)/funnels/FunnelEditForm.tsx+++ b/src/app/(main)/websites/[websiteId]/(reports)/funnels/FunnelEditForm.tsx@@ -14,7 +14,7 @@ import {Column,} from '@umami/react-zen';import { useMessages, useReportQuery, useUpdateQuery } from '@/components/hooks';-import { Close, Plus } from '@/components/icons';+import { X, Plus } from '@/components/icons';import { ActionSelect } from '@/components/input/ActionSelect';import { LookupField } from '@/components/input/LookupField';@@ -36,6 +36,8 @@ export function FunnelEditForm({const { mutate, error, isPending, touch } = useUpdateQuery(`/reports${id ? `/${id}` : ''}`);const handleSubmit = async ({ name, ...parameters }) => {+ //+mutate({ ...data, id, name, type: 'funnel', websiteId, parameters },{@@ -75,7 +77,13 @@ export function FunnelEditForm({><TextField /></FormField>- <FormFieldArray name="steps" label={formatMessage(labels.steps)}>+ <FormFieldArray+ name="steps"+ label={formatMessage(labels.steps)}+ rules={{+ validate: value => value.length > 1 || 'At least two steps are required',+ }}+ >{({ fields, append, remove, getValues }) => {return (<Grid gap>@@ -104,7 +112,7 @@ export function FunnelEditForm({</Column><Button onPress={() => remove(index)}><Icon size="sm">- <Close />+ <X /></Icon></Button></Grid>diff --git a/src/app/(main)/websites/[websiteId]/(reports)/journeys/Journey.tsx b/src/app/(main)/websites/[websiteId]/(reports)/journeys/Journey.tsxindex 965e7a31f..581d69abe 100644--- a/src/app/(main)/websites/[websiteId]/(reports)/journeys/Journey.tsx+++ b/src/app/(main)/websites/[websiteId]/(reports)/journeys/Journey.tsx@@ -3,7 +3,7 @@ import { TooltipTrigger, Tooltip, Focusable, Icon, Text, Row, Column } from '@umimport { firstBy } from 'thenby';import classNames from 'classnames';import { useEscapeKey, useMessages, useResultQuery } from '@/components/hooks';-import { File, Lightning } from '@/components/icons';+import { File, LightningSvg } from '@/components/icons';import { objectToArray } from '@/lib/data';import { formatLongNumber } from '@/lib/format';import { LoadingPanel } from '@/components/common/LoadingPanel';@@ -215,7 +215,7 @@ export function Journey({ websiteId, steps, startStep, endStep }: JourneyProps)onClick={() => handleClick(name, columnIndex, paths)}><Row alignItems="center" className={styles.name} title={name} gap>- <Icon>{name.startsWith('/') ? <File /> : <Lightning />}</Icon>+ <Icon>{name.startsWith('/') ? <File /> : <LightningSvg />}</Icon><Text truncate>{name}</Text></Row><div className={styles.count} title={nodeCount}>diff --git a/src/app/(main)/websites/[websiteId]/WebsiteExpandedView.tsx b/src/app/(main)/websites/[websiteId]/WebsiteExpandedView.tsxindex 3da5bc191..239d51332 100644--- a/src/app/(main)/websites/[websiteId]/WebsiteExpandedView.tsx+++ b/src/app/(main)/websites/[websiteId]/WebsiteExpandedView.tsx@@ -3,12 +3,12 @@ import { useMessages, useNavigation } from '@/components/hooks';import { MetricsExpandedTable } from '@/components/metrics/MetricsExpandedTable';import { SideMenu } from '@/components/common/SideMenu';import {- Link,LogOut,LogIn,Search,Type,- ArrowRight,+ SquareSlash,+ SquareArrowRight,Megaphone,Earth,Globe,@@ -45,7 +45,7 @@ export function WebsiteExpandedView({id: 'path',label: formatMessage(labels.path),path: updateParams({ view: 'path' }),- icon: <Link />,+ icon: <SquareSlash />,},{id: 'entry',@@ -80,7 +80,7 @@ export function WebsiteExpandedView({id: 'referrer',label: formatMessage(labels.referrer),path: updateParams({ view: 'referrer' }),- icon: <ArrowRight />,+ icon: <SquareArrowRight />,},{id: 'channel',diff --git a/src/app/api/batch/route.ts b/src/app/api/batch/route.tsindex 87e04110d..6feab06b6 100644--- a/src/app/api/batch/route.ts+++ b/src/app/api/batch/route.ts@@ -2,8 +2,9 @@ import { z } from 'zod';import * as send from '@/app/api/send/route';import { parseRequest } from '@/lib/request';import { json, serverError } from '@/lib/response';+import { anyObjectParam } from '@/lib/schema';-const schema = z.array(z.object({}).passthrough());+const schema = z.array(anyObjectParam);export async function POST(request: Request) {try {diff --git a/src/app/api/websites/[websiteId]/segments/[segmentId]/route.ts b/src/app/api/websites/[websiteId]/segments/[segmentId]/route.tsindex 4418cfe57..b784fa5ae 100644--- a/src/app/api/websites/[websiteId]/segments/[segmentId]/route.ts+++ b/src/app/api/websites/[websiteId]/segments/[segmentId]/route.ts@@ -1,7 +1,7 @@import { canDeleteWebsite, canUpdateWebsite, canViewWebsite } from '@/permissions';import { parseRequest } from '@/lib/request';import { json, notFound, ok, unauthorized } from '@/lib/response';-import { segmentTypeParam } from '@/lib/schema';+import { anyObjectParam, segmentTypeParam } from '@/lib/schema';import { deleteSegment, getSegment, updateSegment } from '@/queries';import { z } from 'zod';@@ -33,7 +33,7 @@ export async function POST(const schema = z.object({type: segmentTypeParam,name: z.string().max(200),- parameters: z.object({}).passthrough(),+ parameters: anyObjectParam,});const { auth, body, error } = await parseRequest(request, schema);diff --git a/src/app/api/websites/[websiteId]/segments/route.ts b/src/app/api/websites/[websiteId]/segments/route.tsindex fcc2e0a3c..e842dcc79 100644--- a/src/app/api/websites/[websiteId]/segments/route.ts+++ b/src/app/api/websites/[websiteId]/segments/route.ts@@ -2,7 +2,7 @@ import { canUpdateWebsite, canViewWebsite } from '@/permissions';import { uuid } from '@/lib/crypto';import { getQueryFilters, parseRequest } from '@/lib/request';import { json, unauthorized } from '@/lib/response';-import { segmentTypeParam, searchParams } from '@/lib/schema';+import { segmentTypeParam, searchParams, anyObjectParam } from '@/lib/schema';import { createSegment, getWebsiteSegments } from '@/queries';import { z } from 'zod';@@ -42,7 +42,7 @@ export async function POST(const schema = z.object({type: segmentTypeParam,name: z.string().max(200),- parameters: z.object({}).passthrough(),+ parameters: anyObjectParam,});const { auth, body, error } = await parseRequest(request, schema);diff --git a/src/components/input/WebsiteDateFilter.tsx b/src/components/input/WebsiteDateFilter.tsxindex 58c23d241..475fce44a 100644--- a/src/components/input/WebsiteDateFilter.tsx+++ b/src/components/input/WebsiteDateFilter.tsx@@ -59,7 +59,7 @@ export function WebsiteDateFilter({</Button></Row>)}- <Row width="200px">+ <Row minWidth="200px"><DateFiltervalue={value}onChange={handleChange}diff --git a/src/lib/schema.ts b/src/lib/schema.tsindex 36bf50daa..965eae079 100644--- a/src/lib/schema.ts+++ b/src/lib/schema.ts@@ -57,7 +57,7 @@ export const userRoleParam = z.enum(['admin', 'user', 'view-only']);export const teamRoleParam = z.enum(['team-member', 'team-view-only', 'team-manager']);-export const anyObjectParam = z.object({}).passthrough();+export const anyObjectParam = z.record(z.string(), z.any());export const urlOrPathParam = z.string().refine(value => {@@ -202,7 +202,7 @@ export const reportBaseSchema = z.object({type: reportTypeParam,name: z.string().max(200),description: z.string().max(500).optional(),- parameters: z.object({}).passthrough(),+ parameters: anyObjectParam,});export const reportTypeSchema = z.discriminatedUnion('type', [