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 nav menus.
Mike Caod7fd22645c33
diff --git a/pnpm-lock.yaml b/pnpm-lock.yamlindex 5db0535d2..baa6fa617 100644--- a/pnpm-lock.yaml+++ b/pnpm-lock.yaml@@ -328,7 +328,44 @@ importers:specifier: ^5.9.3version: 5.9.3- dist: {}+ dist:+ dependencies:+ chart.js:+ specifier: ^4.5.0+ version: 4.5.1+ chartjs-adapter-date-fns:+ specifier: ^3.0.0+ version: 3.0.0([email protected])([email protected])+ colord:+ specifier: ^2.9.2+ version: 2.9.3+ jsonwebtoken:+ specifier: ^9.0.2+ version: 9.0.2+ lucide-react:+ specifier: ^0.542.0+ version: 0.542.0([email protected])+ pure-rand:+ specifier: ^7.0.1+ version: 7.0.1+ react-simple-maps:+ specifier: ^2.3.0+ react-use-measure:+ specifier: ^2.0.4+ react-window:+ specifier: ^1.8.6+ serialize-error:+ specifier: ^12.0.0+ version: 12.0.0+ thenby:+ specifier: ^1.3.4+ version: 1.3.4+ uuid:+ specifier: ^11.1.0+ version: 11.1.0packages:@@ -5152,6 +5189,11 @@ packages:peerDependencies:react: ^16.5.1 || ^17.0.0 || ^18.0.0 || ^19.0.0+ resolution: {integrity: sha512-w3hD8/SQB7+lzU2r4VdFyzzOzKnUjTZIF/MQJGSSvni7Llewni4vuViRppfRAa2guOsY5k4jZyxw/i9DQHv+dw==}+ peerDependencies:+ react: ^16.5.1 || ^17.0.0 || ^18.0.0 || ^19.0.0+resolution: {integrity: sha512-fpVfuOQO0V3HBaOA1stIiP/A2fPCXHIleRZL16Mx3HmjTYwNSbimhnFBygs2CAfU1geexMX5ItUcWBGUaqw5CA==}peerDependencies:@@ -12921,6 +12963,10 @@ snapshots:dependencies:react: 19.2.0+ dependencies:+ react: 19.2.0+dependencies:react: 19.2.0diff --git a/src/app/(main)/admin/AdminLayout.tsx b/src/app/(main)/admin/AdminLayout.tsxindex 56561a8e1..3c8fa20a1 100644--- a/src/app/(main)/admin/AdminLayout.tsx+++ b/src/app/(main)/admin/AdminLayout.tsx@@ -21,6 +21,7 @@ export function AdminLayout({ children }: { children: ReactNode }) {border="right"backgroundColormarginRight="2"+ padding="3"><AdminNav /></Column>diff --git a/src/app/(main)/admin/users/[userId]/UserEditForm.tsx b/src/app/(main)/admin/users/[userId]/UserEditForm.tsxindex 30c86862a..28bf030f5 100644--- a/src/app/(main)/admin/users/[userId]/UserEditForm.tsx+++ b/src/app/(main)/admin/users/[userId]/UserEditForm.tsx@@ -50,7 +50,7 @@ export function UserEditForm({ userId, onSave }: { userId: string; onSave?: () =label={formatMessage(labels.role)}rules={{ required: formatMessage(labels.required) }}>- <Select defaultSelectedKey={user.role}>+ <Select defaultValue={user.role}><ListItem id={ROLES.viewOnly} data-test="dropdown-item-viewOnly">{formatMessage(labels.viewOnly)}</ListItem>diff --git a/src/app/(main)/settings/SettingsLayout.tsx b/src/app/(main)/settings/SettingsLayout.tsxindex adfaaa4f6..f6588721c 100644--- a/src/app/(main)/settings/SettingsLayout.tsx+++ b/src/app/(main)/settings/SettingsLayout.tsx@@ -14,6 +14,7 @@ export function SettingsLayout({ children }: { children: ReactNode }) {border="right"backgroundColormarginRight="2"+ padding="3"><SettingsNav /></Column>diff --git a/src/app/(main)/settings/layout.tsx b/src/app/(main)/settings/layout.tsxindex e8dfb30d7..4e773a37f 100644--- a/src/app/(main)/settings/layout.tsx+++ b/src/app/(main)/settings/layout.tsx@@ -3,7 +3,7 @@ import { SettingsLayout } from './SettingsLayout';export default function ({ children }) {if (process.env.cloudMode) {- //return null;+ return null;}return <SettingsLayout>{children}</SettingsLayout>;diff --git a/src/components/common/SideMenu.tsx b/src/components/common/SideMenu.tsxindex bdd249521..92ff798a0 100644--- a/src/components/common/SideMenu.tsx+++ b/src/components/common/SideMenu.tsx@@ -51,7 +51,7 @@ export function SideMenu({};return (- <Column gap overflowY="auto" justifyContent="space-between">+ <Column gap overflowY="auto" justifyContent="space-between" position="sticky" top="20px">{title && (<Row padding><Heading size="1">{title}</Heading>diff --git a/src/components/hooks/queries/useUpdateQuery.ts b/src/components/hooks/queries/useUpdateQuery.tsindex 9535c4363..85a94425f 100644--- a/src/components/hooks/queries/useUpdateQuery.ts+++ b/src/components/hooks/queries/useUpdateQuery.ts@@ -1,10 +1,11 @@import { useToast } from '@umami/react-zen';+import type { ApiError } from '@/lib/types';import { useApi } from '../useApi';import { useModified } from '../useModified';export function useUpdateQuery(path: string, params?: Record<string, any>) {const { post, useMutation } = useApi();- const query = useMutation({+ const query = useMutation<any, ApiError, Record<string, any>>({mutationFn: (data: Record<string, any>) => post(path, { ...data, ...params }),});const { touch } = useModified();diff --git a/src/components/hooks/useMessages.ts b/src/components/hooks/useMessages.tsindex 19f12d9a4..d5bc2423d 100644--- a/src/components/hooks/useMessages.ts+++ b/src/components/hooks/useMessages.ts@@ -1,5 +1,6 @@import { FormattedMessage, type MessageDescriptor, useIntl } from 'react-intl';import { labels, messages } from '@/components/messages';+import type { ApiError } from '@/lib/types';type FormatMessage = (descriptor: MessageDescriptor,@@ -12,7 +13,7 @@ interface UseMessages {messages: typeof messages;labels: typeof labels;getMessage: (id: string) => string;- getErrorMessage: (error: unknown) => string | undefined;+ getErrorMessage: (error: ApiError) => string | undefined;FormattedMessage: typeof FormattedMessage;}@@ -25,7 +26,7 @@ export function useMessages(): UseMessages {return message ? formatMessage(message) : id;};- const getErrorMessage = (error: unknown) => {+ const getErrorMessage = (error: ApiError) => {if (!error) {return undefined;}diff --git a/src/lib/types.ts b/src/lib/types.tsindex e727c87a3..9c0619794 100644--- a/src/lib/types.ts+++ b/src/lib/types.ts@@ -136,3 +136,8 @@ export interface RealtimeData {urls: Record<string, number>;visitors: any[];}++export interface ApiError extends Error {+ code?: string;+ message: string;+}