Skip to content

armgit / umami

Public Imported from GitHub
0

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.

Updated settings components.

Mike Cao3004c37ccf88
diff --git a/package.json b/package.json
index dc4cbbb7c..6da9c735a 100644
--- a/package.json
+++ b/package.json
@@ -79,7 +79,7 @@
"@prisma/extension-read-replicas": "^0.4.1",
"@react-spring/web": "^9.7.3",
"@tanstack/react-query": "^5.74.11",
- "@umami/react-zen": "^0.96.0",
+ "@umami/react-zen": "^0.97.0",
"@umami/redis-client": "^0.27.0",
"bcryptjs": "^2.4.3",
"chalk": "^4.1.1",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 003ac2a99..44853a3fa 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -39,8 +39,8 @@ importers:
specifier: ^5.74.11
version: 5.74.11([email protected])
'@umami/react-zen':
- specifier: ^0.96.0
+ specifier: ^0.97.0
'@umami/redis-client':
specifier: ^0.27.0
version: 0.27.0
@@ -2992,8 +2992,8 @@ packages:
resolution: {integrity: sha512-JJtkDduxLi9bivAB+cYOVMtbkqdPOhZ+ZI5LC47MIRrDV4Yn2o+ZnW10Nkmr28xRpSpdJ6Sm42Hjf2+REYXm0A==}
engines: {node: ^16.0.0 || >=18.0.0}
- '@umami/[email protected]':
- resolution: {integrity: sha512-ojY3sOehvGbYN29fHrPHyBlsrrjOFJdlftlYTsPQSbX/25SiD1Sk6/WqcY/YEJZS71gZyklc4yjd/EKSZgxJqw==}
+ '@umami/[email protected]':
+ resolution: {integrity: sha512-+oGk/yKbeluWEfyUCLSffjoLGHx8JlgN5pbFdVKCSgXjKoPWpgiD7xqQHOIgw1KHrtdHEhbJkuoZ5frj3/0ZoQ==}
resolution: {integrity: sha512-SbHTpxhgeZyTBUSp2zdZM+XUtpsaSL4Tad8QXIEhEtjWhvvfoornyT5kLuyYCVtzSAT4daALeGmOO1z6EE1KcA==}
@@ -10784,7 +10784,7 @@ snapshots:
'@typescript-eslint/types': 6.21.0
eslint-visitor-keys: 3.4.3
dependencies:
'@fontsource/jetbrains-mono': 5.2.5
'@internationalized/date': 3.8.0
diff --git a/src/app/(main)/settings/profile/LanguageSetting.tsx b/src/app/(main)/settings/profile/LanguageSetting.tsx
index 19c5d74e9..4ec70d223 100644
--- a/src/app/(main)/settings/profile/LanguageSetting.tsx
+++ b/src/app/(main)/settings/profile/LanguageSetting.tsx
@@ -28,7 +28,7 @@ export function LanguageSetting() {
return (
<Row gap="3">
<Select
- selectedKey={locale}
+ value={locale}
onChange={val => saveLocale(val as string)}
allowSearch
onSearch={setSearch}
diff --git a/src/app/(main)/settings/profile/TimezoneSetting.tsx b/src/app/(main)/settings/profile/TimezoneSetting.tsx
index 3a40f3047..08ffad710 100644
--- a/src/app/(main)/settings/profile/TimezoneSetting.tsx
+++ b/src/app/(main)/settings/profile/TimezoneSetting.tsx
@@ -24,7 +24,7 @@ export function TimezoneSetting() {
return (
<Row gap="3">
<Select
- selectedKey={timezone}
+ value={timezone}
onChange={(value: any) => saveTimezone(value)}
allowSearch={true}
onSearch={setSearch}
diff --git a/src/app/(main)/settings/users/UsersTable.tsx b/src/app/(main)/settings/users/UsersTable.tsx
index 6b9b6a974..a4aeac6e3 100644
--- a/src/app/(main)/settings/users/UsersTable.tsx
+++ b/src/app/(main)/settings/users/UsersTable.tsx
@@ -70,7 +70,11 @@ export function UsersTable({
</Row>
</MenuItem>
<MenuSeparator />
- <MenuItem id="delete" onAction={() => setDeleteUser(row)}>
+ <MenuItem
+ id="delete"
+ onAction={() => setDeleteUser(row)}
+ data-test="link-button-delete"
+ >
<Row alignItems="center" gap>
<Icon>
<Icons.Trash />
diff --git a/src/app/(main)/settings/websites/WebsitesTable.tsx b/src/app/(main)/settings/websites/WebsitesTable.tsx
index 9328d0c56..9f18ec14e 100644
--- a/src/app/(main)/settings/websites/WebsitesTable.tsx
+++ b/src/app/(main)/settings/websites/WebsitesTable.tsx
@@ -3,6 +3,7 @@ import { Row, Text, Icon, DataTable, DataColumn, MenuItem } from '@umami/react-z
import { useMessages, useNavigation } from '@/components/hooks';
import { MenuButton } from '@/components/input/MenuButton';
import { Lucide } from '@/components/icons';
+import Link from 'next/link';
export interface WebsitesTableProps {
data: any[];
@@ -29,7 +30,9 @@ export function WebsitesTable({
return (
<DataTable data={data}>
- <DataColumn id="name" label={formatMessage(labels.name)} />
+ <DataColumn id="name" label={formatMessage(labels.name)}>
+ {(row: any) => <Link href={`/websites/${row.id}`}>{row.name}</Link>}
+ </DataColumn>
<DataColumn id="domain" label={formatMessage(labels.domain)} />
{showActions && (
<DataColumn id="action" label=" " align="end">
diff --git a/src/components/input/DateFilter.tsx b/src/components/input/DateFilter.tsx
index a4ed510ba..69f462d83 100644
--- a/src/components/input/DateFilter.tsx
+++ b/src/components/input/DateFilter.tsx
@@ -102,7 +102,7 @@ export function DateFilter({
return (
<>
<Select
- selectedKey={value}
+ value={value}
placeholder={formatMessage(labels.selectDate)}
onChange={handleChange}
renderValue={renderValue}
diff --git a/src/components/input/MenuButton.tsx b/src/components/input/MenuButton.tsx
index 37377c03e..4b99c9796 100644
--- a/src/components/input/MenuButton.tsx
+++ b/src/components/input/MenuButton.tsx
@@ -20,8 +20,8 @@ export function MenuButton({
<Lucide.Ellipsis />
</Icon>
</Button>
- <Popover>
- <Menu onAction={handleAction} style={{ minWidth: '140px' }}>
+ <Popover placement="bottom start">
+ <Menu aria-label="menu" onAction={handleAction} style={{ minWidth: '140px' }}>
{children}
</Menu>
</Popover>