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
Settings refactor.
Mike Caoc98f324c2285
diff --git a/db/postgresql/schema.prisma b/db/postgresql/schema.prismaindex 39dac240e..cfcbf0efe 100644--- a/db/postgresql/schema.prisma+++ b/db/postgresql/schema.prisma@@ -1,5 +1,5 @@generator client {- provider = "prisma-client"+ provider = "prisma-client-js"previewFeatures = ["queryCompiler", "driverAdapters"]output = "../src/generated/prisma"moduleFormat = "esm"@@ -46,7 +46,7 @@ model Session {websiteEvent WebsiteEvent[]sessionData SessionData[]- revenue Revenue[]+ revenue Revenue[]@@index([createdAt])@@index([websiteId])@@ -224,7 +224,7 @@ model Report {type String @db.VarChar(200)name String @db.VarChar(200)description String @db.VarChar(500)- parameters Json+ parameters JsoncreatedAt DateTime? @default(now()) @map("created_at") @db.Timestamptz(6)updatedAt DateTime? @updatedAt @map("updated_at") @db.Timestamptz(6)@@ -239,13 +239,13 @@ model Report {}model Segment {- id String @id() @unique() @map("segment_id") @db.Uuid- websiteId String @map("website_id") @db.Uuid- type String @db.VarChar(200)- name String @db.VarChar(200)- parameters Json- createdAt DateTime? @default(now()) @map("created_at") @db.Timestamptz(6)- updatedAt DateTime? @updatedAt @map("updated_at") @db.Timestamptz(6)+ id String @id() @unique() @map("segment_id") @db.Uuid+ websiteId String @map("website_id") @db.Uuid+ type String @db.VarChar(200)+ name String @db.VarChar(200)+ parameters Json+ createdAt DateTime? @default(now()) @map("created_at") @db.Timestamptz(6)+ updatedAt DateTime? @updatedAt @map("updated_at") @db.Timestamptz(6)website Website @relation(fields: [websiteId], references: [id])@@ -254,14 +254,14 @@ model Segment {}model Revenue {- id String @id() @unique() @map("revenue_id") @db.Uuid- websiteId String @map("website_id") @db.Uuid- sessionId String @map("session_id") @db.Uuid- eventId String @map("event_id") @db.Uuid- eventName String @map("event_name") @db.VarChar(50)- currency String @db.VarChar(100)- revenue Decimal? @db.Decimal(19, 4)- createdAt DateTime? @default(now()) @map("created_at") @db.Timestamptz(6)+ id String @id() @unique() @map("revenue_id") @db.Uuid+ websiteId String @map("website_id") @db.Uuid+ sessionId String @map("session_id") @db.Uuid+ eventId String @map("event_id") @db.Uuid+ eventName String @map("event_name") @db.VarChar(50)+ currency String @db.VarChar(100)+ revenue Decimal? @db.Decimal(19, 4)+ createdAt DateTime? @default(now()) @map("created_at") @db.Timestamptz(6)website Website @relation(fields: [websiteId], references: [id])session Session @relation(fields: [sessionId], references: [id])diff --git a/next.config.ts b/next.config.tsindex 4e0561b71..f2c07aff9 100644--- a/next.config.ts+++ b/next.config.ts@@ -125,7 +125,7 @@ if (collectApiEndpoint) {const redirects = [{source: '/settings',- destination: '/settings/profile',+ destination: '/settings/preferences',permanent: true,},{@@ -133,11 +133,6 @@ const redirects = [destination: '/teams/:id/websites',permanent: true,},- {- source: '/teams/:id/settings',- destination: '/teams/:id/settings/team',- permanent: true,- },{source: '/admin',destination: '/admin/users',@@ -173,12 +168,6 @@ if (cloudMode && cloudUrl) {permanent: false,});- redirects.push({- source: '/teams/:id/settings/:path*',- destination: `${cloudUrl}/teams/:id/settings/:path*`,- permanent: false,- });-if (disableLogin) {redirects.push({source: '/login',diff --git a/package.json b/package.jsonindex 02d0d23fd..878176db9 100644--- a/package.json+++ b/package.json@@ -82,7 +82,7 @@"@react-spring/web": "^9.7.3","@svgr/cli": "^8.1.0","@tanstack/react-query": "^5.80.10",- "@umami/react-zen": "^0.144.0",+ "@umami/react-zen": "^0.145.0","@umami/redis-client": "^0.27.0","bcryptjs": "^2.4.3","chalk": "^4.1.1",diff --git a/pnpm-lock.yaml b/pnpm-lock.yamlindex 6929ce717..9443ea0c4 100644--- a/pnpm-lock.yaml+++ b/pnpm-lock.yaml@@ -45,8 +45,8 @@ importers:specifier: ^5.80.10version: 5.80.10([email protected])'@umami/react-zen':- specifier: ^0.144.0- version: 0.144.0(@babel/[email protected])(@types/[email protected])([email protected])([email protected])([email protected]([email protected]))+ specifier: ^0.145.0+ version: 0.145.0(@babel/[email protected])(@types/[email protected])([email protected])([email protected])([email protected]([email protected]))'@umami/redis-client':specifier: ^0.27.0version: 0.27.0@@ -355,6 +355,45 @@ importers:specifier: ^5.5.3version: 5.8.3+ dist:+ dependencies:+ '@tanstack/react-query':+ specifier: ^4.33.0+ classnames:+ specifier: ^2.3.1+ version: 2.5.1+ colord:+ specifier: ^2.9.2+ version: 2.9.3+ date-fns-tz:+ specifier: ^1.1.4+ version: 1.3.8([email protected])+ immer:+ specifier: ^9.0.12+ version: 9.0.21+ moment-timezone:+ specifier: ^0.5.35+ version: 0.5.48+ next:+ specifier: ^13.4.0+ version: 13.5.11(@babel/[email protected])([email protected]([email protected]))([email protected])+ next-basics:+ specifier: ^0.36.0+ version: 0.36.0([email protected](@babel/[email protected])([email protected]([email protected]))([email protected]))([email protected]([email protected]))([email protected])+ react:+ specifier: ^18.2.0+ version: 18.3.1+ react-dom:+ specifier: ^18.2.0+ version: 18.3.1([email protected])+ react-intl:+ specifier: ^5.24.7+ version: 5.25.1([email protected])([email protected])+ zustand:+ specifier: ^4.3.8+packages:'@ampproject/[email protected]':@@ -1056,6 +1095,9 @@ packages:'@formatjs/[email protected]':resolution: {integrity: sha512-qrycXDeaORzIqNhBOx0btnhpD1c+/qFIHAN9znofuMJX6QBwtbrmlpWfD4oiUUD2vJUOIYFA/gYtg2KAMGG7sA==}+ '@formatjs/[email protected]':+ resolution: {integrity: sha512-Rg0e76nomkz3vF9IPlKeV+Qynok0r7YZjL6syLz4/urSg0IbjPZCB/iYUMNsYA643gh4mgrX3T7KEIFIxJBQeg==}+'@formatjs/[email protected]':resolution: {integrity: sha512-3jeJ+HyOfu8osl3GNSL4vVHUuWFXR03Iz9jjgI7RwjG6ysu/Ymdr0JRCPHfF5yGbTE6JCrd63EpvX1/WybYRbA==}@@ -1080,9 +1122,15 @@ packages:'@formatjs/[email protected]':resolution: {integrity: sha512-vHwK3piXwamFcx5YQdCdJxUQ1WdTl6ANclt5xba5zLGDv5Bsur7qz8AD7BevaKxITwpgDeU0u8My3AIibW9ywA==}+ '@formatjs/[email protected]':+ resolution: {integrity: sha512-4r12A3mS5dp5hnSaQCWBuBNfi9Amgx2dzhU4lTFfhSxgb5DOAiAbMpg6+7gpWZgl4ahsj3l2r/iHIjdmdXOE2Q==}+'@formatjs/[email protected]':resolution: {integrity: sha512-85b+GdAKCsleS6cqVxf/Aw/uBd+20EM0wDpgaxzHo3RIR3bxF4xCJqH/Grbzx8CXurTgDDZHPdPdwJC+May41w==}+ '@formatjs/[email protected]':+ resolution: {integrity: sha512-ozpz515F/+3CU+HnLi5DYPsLa6JoCfBggBSSg/8nOB5LYSFW9+ZgNQJxJ8tdhKYeODT+4qVHX27EeJLoxLGLNg==}+'@formatjs/[email protected]':resolution: {integrity: sha512-Wzes10SMNeYgnxYiKsda4rnHP3Q3II4XT2tZyOgnH5fWuHDtIkceuWlRQNsvrI3uiwP4hLqp2XdQTCsfkhXulg==}@@ -1106,6 +1154,14 @@ packages:typescript:optional: true+ '@formatjs/[email protected]':+ resolution: {integrity: sha512-vgvyUOOrzqVaOFYzTf2d3+ToSkH2JpR7x/4U1RyoHQLmvEaTQvXJ7A2qm1Iy3brGNXC/+/7bUlc3lpH+h/LOJA==}+ peerDependencies:+ typescript: ^4.5+ peerDependenciesMeta:+ typescript:+ optional: true+'@formatjs/[email protected]':resolution: {integrity: sha512-mu7sHXZk1NWZrQ3eUqugpSYo8x5/tXkrI4uIbFqCEC0eNgQaIcoKgVeDFgDAcgG+cEme2atAUYSFF+DFWC4org==}peerDependencies:@@ -1381,54 +1437,111 @@ packages:resolution: {integrity: sha512-SCF2UPT+mDrfO3DDeUb7eTRqHycBEx4aJ8vACm17Nyn2b2ueaLlS5u/2V42SSZF/F6LydI7R78fv3xPW7HHdWw==}engines: {node: '>=18.0.0'}+ '@next/[email protected]':+ resolution: {integrity: sha512-fbb2C7HChgM7CemdCY+y3N1n8pcTKdqtQLbC7/EQtPdLvlMUT9JX/dBYl8MMZAtYG4uVMyPFHXckb68q/NRwqg==}+'@next/[email protected]':resolution: {integrity: sha512-ZkdYzBseS6UjYzz6ylVKPOK+//zLWvD6Ta+vpoye8cW11AjiQjGYVibF0xuvT4L0iJfAPfZLFidaEzAOywyOAQ==}'@next/[email protected]':resolution: {integrity: sha512-mvVsMIutMxQ4NGZEMZ1kiBNc+la8Xmlk30bKUmCPQz2eFkmsLv54Mha8QZarMaCtSPkkFA1TMD+FIZk0l/PpzA==}+ '@next/[email protected]':+ resolution: {integrity: sha512-pVyd8/1y1l5atQRvOaLOvfbmRwefxLhqQOzYo/M7FQ5eaRwA1+wuCn7t39VwEgDd7Aw1+AIWwd+MURXUeXhwDw==}+ engines: {node: '>= 10'}+ cpu: [arm64]+ os: [darwin]+'@next/[email protected]':resolution: {integrity: sha512-z0qIYTONmPRbwHWvpyrFXJd5F9YWLCsw3Sjrzj2ZvMYy9NPQMPZ1NjOJh4ojr4oQzcGYwgJKfidzehaNa1BpEg==}engines: {node: '>= 10'}cpu: [arm64]os: [darwin]+ '@next/[email protected]':+ resolution: {integrity: sha512-DwdeJqP7v8wmoyTWPbPVodTwCybBZa02xjSJ6YQFIFZFZ7dFgrieKW4Eo0GoIcOJq5+JxkQyejmI+8zwDp3pwA==}+ engines: {node: '>= 10'}+ cpu: [x64]+ os: [darwin]+'@next/[email protected]':resolution: {integrity: sha512-Z0FYJM8lritw5Wq+vpHYuCIzIlEMjewG2aRkc3Hi2rcbULknYL/xqfpBL23jQnCSrDUGAo/AEv0Z+s2bff9Zkw==}engines: {node: '>= 10'}cpu: [x64]os: [darwin]+ '@next/[email protected]':+ resolution: {integrity: sha512-wdQsKsIsGSNdFojvjW3Ozrh8Q00+GqL3wTaMjDkQxVtRbAqfFBtrLPO0IuWChVUP2UeuQcHpVeUvu0YgOP00+g==}+ engines: {node: '>= 10'}+ cpu: [arm64]+ os: [linux]+'@next/[email protected]':resolution: {integrity: sha512-l8ZQOCCg7adwmsnFm8m5q9eIPAHdaB2F3cxhufYtVo84pymwKuWfpYTKcUiFcutJdp9xGHC+F1Uq3xnFU1B/7g==}engines: {node: '>= 10'}cpu: [arm64]os: [linux]+ '@next/[email protected]':+ resolution: {integrity: sha512-6VpS+bodQqzOeCwGxoimlRoosiWlSc0C224I7SQWJZoyJuT1ChNCo+45QQH+/GtbR/s7nhaUqmiHdzZC9TXnXA==}+ engines: {node: '>= 10'}+ cpu: [arm64]+ os: [linux]+'@next/[email protected]':resolution: {integrity: sha512-wFyZ7X470YJQtpKot4xCY3gpdn8lE9nTlldG07/kJYexCUpX1piX+MBfZdvulo+t1yADFVEuzFfVHfklfEx8kw==}engines: {node: '>= 10'}cpu: [arm64]os: [linux]+ '@next/[email protected]':+ resolution: {integrity: sha512-XxG3yj61WDd28NA8gFASIR+2viQaYZEFQagEodhI/R49gXWnYhiflTeeEmCn7Vgnxa/OfK81h1gvhUZ66lozpw==}+ engines: {node: '>= 10'}+ cpu: [x64]+ os: [linux]+'@next/[email protected]':resolution: {integrity: sha512-gEbH9rv9o7I12qPyvZNVTyP/PWKqOp8clvnoYZQiX800KkqsaJZuOXkWgMa7ANCCh/oEN2ZQheh3yH8/kWPSEg==}engines: {node: '>= 10'}cpu: [x64]os: [linux]+ '@next/[email protected]':+ resolution: {integrity: sha512-/dnscWqfO3+U8asd+Fc6dwL2l9AZDl7eKtPNKW8mKLh4Y4wOpjJiamhe8Dx+D+Oq0GYVjuW0WwjIxYWVozt2bA==}+ engines: {node: '>= 10'}+ cpu: [x64]+ os: [linux]+'@next/[email protected]':resolution: {integrity: sha512-Cf8sr0ufuC/nu/yQ76AnarbSAXcwG/wj+1xFPNbyNo8ltA6kw5d5YqO8kQuwVIxk13SBdtgXrNyom3ZosHAy4A==}engines: {node: '>= 10'}cpu: [x64]os: [linux]+ '@next/[email protected]':+ resolution: {integrity: sha512-T/iPnyurOK5a4HRUcxAlss8uzoEf5h9tkd+W2dSWAfzxv8WLKlUgbfk+DH43JY3Gc2xK5URLuXrxDZ2mGfk/jw==}+ engines: {node: '>= 10'}+ cpu: [arm64]+ os: [win32]+'@next/[email protected]':resolution: {integrity: sha512-ay5+qADDN3rwRbRpEhTOreOn1OyJIXS60tg9WMYTWCy3fB6rGoyjLVxc4dR9PYjEdR2iDYsaF5h03NA+XuYPQQ==}engines: {node: '>= 10'}cpu: [arm64]os: [win32]+ '@next/[email protected]':+ resolution: {integrity: sha512-BLiPKJomaPrTAb7ykjA0LPcuuNMLDVK177Z1xe0nAem33+9FIayU4k/OWrtSn9SAJW/U60+1hoey5z+KCHdRLQ==}+ engines: {node: '>= 10'}+ cpu: [ia32]+ os: [win32]++ '@next/[email protected]':+ resolution: {integrity: sha512-/72/dZfjXXNY/u+n8gqZDjI6rxKMpYsgBBYNZKWOQw0BpBF7WCnPflRy3ZtvQ2+IYI3ZH2bPyj7K+6a6wNk90Q==}+ engines: {node: '>= 10'}+ cpu: [x64]+ os: [win32]+'@next/[email protected]':resolution: {integrity: sha512-4kDt31Bc9DGyYs41FTL1/kNpDeHyha2TC0j5sRRoKCyrhNcfZ/nRQkAUlF27mETwm8QyHqIjHJitfcza2Iykfg==}engines: {node: '>= 10'}@@ -2316,9 +2429,27 @@ packages:'@swc/[email protected]':resolution: {integrity: sha512-5IKx/Y13RsYd+sauPb2x+U/xZikHjolzfuDgTAl/Tdf3Q8rslRvC19NKDLgAJQ6wsqADk10ntlv08nPFw/gO/A==}+ '@swc/[email protected]':+ resolution: {integrity: sha512-E4KcWTpoLHqwPHLxidpOqQbcrZVgi0rsmmZXUle1jXmJfuIf/UWpczUJ7MZZ5tlxytgJXyp0w4PGkkeLiuIdZw==}++ '@tanstack/[email protected]':+ resolution: {integrity: sha512-7MJTtZkCSuehMC7IxMOCGsLvHS3jHx4WjveSrGsG1Nc1UQLjaFwwkpLA2LmPfvOAxnH4mszMOBFD6LlZE+aB+Q==}+'@tanstack/[email protected]':resolution: {integrity: sha512-mUNQOtzxkjL6jLbyChZoSBP6A5gQDVRUiPvW+/zw/9ftOAz+H754zCj3D8PwnzPKyHzGkQ9JbH48ukhym9LK1Q==}+ '@tanstack/[email protected]':+ resolution: {integrity: sha512-mgD07S5N8e5v81CArKDWrHE4LM7HxZ9k/KLeD3+NUD9WimGZgKIqojUZf/rXkfAMYZU9p0Chzj2jOXm7xpgHHQ==}+ peerDependencies:+ react: ^16.8.0 || ^17.0.0 || ^18.0.0+ react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0+ react-native: '*'+ peerDependenciesMeta:+ react-dom:+ optional: true+ react-native:+ optional: true+'@tanstack/[email protected]':resolution: {integrity: sha512-6zM098J8sLy9oU60XAdzUlAH4wVzoMVsWUWiiE/Iz4fd67PplxeyL4sw/MPcVJJVhbwGGXCsHn9GrQt2mlAzig==}peerDependencies:@@ -2547,8 +2678,8 @@ packages:resolution: {integrity: sha512-xoh5rJ+tgsRKoXnkBPFRLZ7rjKM0AfVbC68UZ/ECXoDbfggb9RbEySN359acY1vS3qZ0jVTVWzbtfapwm5ztxw==}engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}- '@umami/[email protected]':- resolution: {integrity: sha512-RpPid2hdXAzbWKlbQWdSCwm6GZMHVs1f6VsVumq7Who/B8wxX0RVBwehHn3/ERwDw+c6ThRzlAZvOO6QLv+tQw==}+ '@umami/[email protected]':+ resolution: {integrity: sha512-bbbdgWDwW0MIXfSc3JJPDOcmATZpwDsbrDdj37LEvP6rdtUgwAarnATjJa9l3133LGhhEAdYitZqwrDfHHPI5g==}'@umami/[email protected]':resolution: {integrity: sha512-SbHTpxhgeZyTBUSp2zdZM+XUtpsaSL4Tad8QXIEhEtjWhvvfoornyT5kLuyYCVtzSAT4daALeGmOO1z6EE1KcA==}@@ -2988,12 +3119,12 @@ packages:resolution: {integrity: sha512-AflseV1ahcSunK53NfEs9gFWgOEmzr0f+kaMFA4xiLZlr9Hzt7HxcSpIFcnNCUkz6R6dWKa54rUz3HUmI3nVcw==}- resolution: {integrity: sha512-DCQHBBZtiK6JVkAGw7drvAMK0Q0POD/xZvEmDp6baiMMP6QXXk9HpD6mNYBZWhOPG6LvIDb82ITqtWjhDckHCA==}-resolution: {integrity: sha512-VQAUIUzBiZ/UnlM28fSp2CRF3ivUn1BWEvxMcVTNwpw91Py1pGbPIyIKtd+tzct9C3ouceCVdGAXxZOpZAsgdw==}+ resolution: {integrity: sha512-pB68nIHmbN6L/4C6MH1DokyR3bYqFwjaSs/sWDHGj4CTcFtQUQMuJftVwWkXq7mNWOybD3KhUv3oWHoGxgP14Q==}+resolution: {integrity: sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==}@@ -3424,8 +3555,8 @@ packages:resolution: {integrity: sha512-VfxadyCECXgQlkoEAjeghAr5gY3Hf+IKjKb+X8tGVDtveCjN+USwprd2q3QXBR9T1+x2DG0XZF5/w+7HAtSaXA==}engines: {node: '>=10'}- resolution: {integrity: sha512-8vDa8Qxvr/+d94hSh5P3IJwI5t8/c0KsMp+g8bNw9cY2icONa5aPfvKeieW1WlG0WQYwwhJ7mjui2xtiePQSXw==}+ resolution: {integrity: sha512-YpgQiITW3JXGntzdUmyUR1V812Hn8T1YVXhCu+wO3OpS4eU9l4YdD3qjyiKdV6mvV29zapkMeD390UVEf2lkUg==}resolution: {integrity: sha512-F1Z+5UCFpmQUzJa11agbyPVMbpgT/qA3/SKyJ1jyBgm7dUcUEa8v9JwDkerSQXfakBwFljIxhOJqGkjUwZ9FSA==}@@ -4055,6 +4186,9 @@ packages:resolution: {integrity: sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==}engines: {node: '>=10.13.0'}+ resolution: {integrity: sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==}+resolution: {integrity: sha512-fa46+tv1Ak0UPK1TOy/pZrIybNNt4HCv7SDzwyfiOZkvZLEbjsZkJBPtDHVshZjbecAoAGSC20MjLDG/qr679g==}engines: {node: '>=16 || 14 >=14.17'}@@ -4291,6 +4425,9 @@ packages:resolution: {integrity: sha512-F134jIoeYMro/3I0h08D0Yt4N9o9pjddU/4IIxMMURqbAtI2wu70X8hvG1V48W49zXHXv3RKSF/po+0fDfsGjA==}+ resolution: {integrity: sha512-7sGC7QnSQGa5LZP7bXLDhVDtQOeKGeBFGHF2Y8LVBwYZoQZCgWeKoPGTa5GMG8g/TzDgeXuYJQis7Ggiw2xTOw==}+resolution: {integrity: sha512-Ag3wB2o37wslZS19hZqorUnrnzSkpOVy+IiiDEiTqNubEYpYuHWIf6K4psgN2ZWKExS4xhVCrRVfb/wfW8fWJA==}engines: {node: '>= 10'}@@ -5082,6 +5219,12 @@ packages:resolution: {integrity: sha512-DXO4L9W+08T+A7h5+xdT32l7IMot8z7WOH+7C1Maol571PnktQ8un7Ni4CyPFp4H+vht/FDA5/tpjRvWMFQDMw==}engines: {node: '>=10', npm: '>=6'}+ resolution: {integrity: sha512-f22b8LV1gbTO2ms2j2z13MuPogNoh5UzxL3nzNAYKGraILnbGc9NEE6dyiiiLv46DGRb8A4kg8UKWLjPthxBHw==}++ resolution: {integrity: sha512-uEmtNhbDOrWPFS+hdjFCBfy9f2YoyzRpwcl+DqpC6taX21FzsTLQVbMV/W7PzNSX6x/bhC1zA3c2UQ5NzH6how==}+resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==}@@ -5101,6 +5244,28 @@ packages:resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==}+ resolution: {integrity: sha512-Nwou8pCjFuoD/ZxUw9iKC7hhZeWbo/ng0ze74yck3W89MNc/CepwCDziflAHY5XcmIVNmpXOCu9OfmzTdVRPWQ==}+ peerDependencies:+ next: ^13.4.0+ react: ^18.2.0+ react-dom: ^18.2.0++ resolution: {integrity: sha512-WUPJ6WbAX9tdC86kGTu92qkrRdgRqVrY++nwM+shmWQwmyxt4zhZfR59moXSI4N8GDYCBY3lIAqhzjDd4rTC8Q==}+ engines: {node: '>=16.14.0'}+ hasBin: true+ peerDependencies:+ '@opentelemetry/api': ^1.1.0+ react: ^18.2.0+ react-dom: ^18.2.0+ sass: ^1.3.0+ peerDependenciesMeta:+ '@opentelemetry/api':+ optional: true+ sass:+ optional: true+resolution: {integrity: sha512-mHKd50C+mCjam/gcnwqL1T1vPx/XQNFlXqFIVdgQdVAFY9iIQtY0IfaVflEYzKiqjeA7B0cYYMaCrmAYFjs4rA==}engines: {node: ^18.18.0 || ^19.8.0 || >= 20.0.0}@@ -5936,6 +6101,11 @@ packages:react: ^18.2.0react-dom: ^18.2.0+ resolution: {integrity: sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==}+ peerDependencies:+ react: ^18.3.1+resolution: {integrity: sha512-Xs1hdnE+DyKgeHJeJznQmYMIBG3TKIHJJT95Q58nHLSrElKlGQqDTR2HQ9fx5CN/Gk6Vh/kupBTDLU11/nDk/g==}peerDependencies:@@ -5952,8 +6122,8 @@ packages:peerDependencies:react: ^16.8.0 || ^17 || ^18 || ^19- resolution: {integrity: sha512-Lml/KZYEEFfPhUVgE0RdCVpnC4yhW+PndRhbiTtdvSlQTL8IfVR+iQkBjLIvmmc6+GGoVeM11z37ktKFPAb0FA==}+ resolution: {integrity: sha512-SBrYOvMbDB7cV8ZfNpaiLcgjH/a1c7aK0lK+aNigpf4xWLO8q+o4tcvVurv3c4EOyzn/3dCsYt4GKD42VvJ/+A==}engines: {node: '>=18.0.0'}peerDependencies:react: ^16.8.0 || ^17 || ^18 || ^19@@ -5963,6 +6133,15 @@ packages:peerDependencies:react: '*'+ resolution: {integrity: sha512-pkjdQDvpJROoXLMltkP/5mZb0/XqrqLoPGKUCfbdkP8m6U9xbK40K51Wu+a4aQqTEvEK5lHBk0fWzUV72SJ3Hg==}+ peerDependencies:+ react: ^16.3.0 || 17 || 18+ typescript: ^4.5+ peerDependenciesMeta:+ typescript:+ optional: true+resolution: {integrity: sha512-TUfj5E7lyUDvz/GtovC9OMh441kBr08rtIbgh3p0R8iF3hVY+V2W9Am7rb8BpJ/29BH1utJOqOOhmvEVh3GfZg==}peerDependencies:@@ -6018,6 +6197,10 @@ packages:react: ^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0react-dom: ^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0+ resolution: {integrity: sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==}+ engines: {node: '>=0.10.0'}+resolution: {integrity: sha512-FS+XFBNvn3GTAWq26joslQgWNoFu08F4kl0J4CgdNKADkdSGXQyTCnKteIAJy96Br6YbpEU1LSzV5dYtjMkMDg==}engines: {node: '>=0.10.0'}@@ -6204,6 +6387,9 @@ packages:resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==}+ resolution: {integrity: sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==}+resolution: {integrity: sha512-NlHwttCI/l5gCPR3D1nNXtWABUmBwvZpEQiD4IXSbIDq8BzLIK/7Ir5gTFSGZDUu37K5cMNp0hFtzO38sC7gWA==}@@ -6463,6 +6649,19 @@ packages:resolution: {integrity: sha512-Dj1Okke1C3uKKwQcetra4jSuk0DqbzbYtXipzFlFMZtowbF1x7BKJwB9AayVMyFARvU8EDrZdcax4At/452cAg==}+ resolution: {integrity: sha512-pW7uC1l4mBZ8ugbiZrcIsiIvVx1UmTfw7UkC3Um2tmfUq9Bhk8IiyEIPl6F8agHgjzku6j0xQEZbfA5uSgSaCw==}+ engines: {node: '>= 12.0.0'}+ peerDependencies:+ '@babel/core': '*'+ babel-plugin-macros: '*'+ react: '>= 16.8.0 || 17.x.x || ^18.0.0-0'+ peerDependenciesMeta:+ '@babel/core':+ optional: true+ babel-plugin-macros:+ optional: true+resolution: {integrity: sha512-qSVyDTeMotdvQYoHWLNGwRFJHC+i+ZvdBRYosOFgC+Wg1vx4frN2/RG/NA7SYqqvKNLf39P2LSRA2pu6n0XYZA==}engines: {node: '>= 12.0.0'}@@ -6839,6 +7038,10 @@ packages:resolution: {integrity: sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ==}+ resolution: {integrity: sha512-Lcvm7MGST/4fup+ifyKi2hjyIAwcdI4HRgtvTpIUxBRhB+RFtUh8XtDOxUfctVCnhVi+QQj49i91OyvzkJl6cg==}+ engines: {node: '>=10.13.0'}+resolution: {integrity: sha512-d2JWLCivmZYTSIoge9MsgFCZrt571BikcWGYkjC1khllbTeDlGqZ2D8vD8E/lJa8WGWbb7Plm8/XJYV7IJHZZw==}engines: {node: '>= 8'}@@ -6954,6 +7157,21 @@ packages:resolution: {integrity: sha512-idA2YXwpCdqUSKRCACDE6ItZD9TZzy3OZMtpfLoh6oPR47lipysRrJfjzMqFxQ3uJuUPyUeWe1r9vLH33xO/Qw==}+ resolution: {integrity: sha512-CHOUy7mu3lbD6o6LJLfllpjkzhHXSBlX8B9+qPddUsIfeF5S/UZ5q0kmCsnRqT1UHFQZchNFDDzMbQsuesHWlw==}+ engines: {node: '>=12.7.0'}+ peerDependencies:+ '@types/react': '>=16.8'+ immer: '>=9.0.6'+ react: '>=16.8'+ peerDependenciesMeta:+ '@types/react':+ optional: true+ immer:+ optional: true+ react:+ optional: true+resolution: {integrity: sha512-mILtRfKW9xM47hqxGIxCv12gXusoY/xTSHBYApXozR0HmQv299whhBeeAcRy+KrPPybzosvJBCOmVjq6x12fCg==}engines: {node: '>=12.20.0'}@@ -7624,7 +7842,11 @@ snapshots:dependencies:'@formatjs/fast-memoize': 2.2.7'@formatjs/intl-localematcher': 0.6.1- decimal.js: 10.5.0+ decimal.js: 10.6.0+ tslib: 2.8.1++ '@formatjs/[email protected]':+ dependencies:tslib: 2.8.1'@formatjs/[email protected]':@@ -7668,12 +7890,24 @@ snapshots:'@formatjs/ecma402-abstract': 2.2.4tslib: 2.8.1+ '@formatjs/[email protected]':+ dependencies:+ '@formatjs/ecma402-abstract': 1.11.4+ '@formatjs/intl-localematcher': 0.2.25+ tslib: 2.8.1+'@formatjs/[email protected]':dependencies:'@formatjs/ecma402-abstract': 2.2.4'@formatjs/intl-localematcher': 0.5.8tslib: 2.8.1+ '@formatjs/[email protected]':+ dependencies:+ '@formatjs/ecma402-abstract': 1.11.4+ '@formatjs/intl-localematcher': 0.2.25+ tslib: 2.8.1+'@formatjs/[email protected]':dependencies:'@formatjs/ecma402-abstract': 2.2.4@@ -7709,6 +7943,18 @@ snapshots:optionalDependencies:typescript: 5.8.3+ '@formatjs/[email protected]([email protected])':+ dependencies:+ '@formatjs/ecma402-abstract': 1.11.4+ '@formatjs/fast-memoize': 1.2.1+ '@formatjs/icu-messageformat-parser': 2.1.0+ '@formatjs/intl-displaynames': 5.4.3+ '@formatjs/intl-listformat': 6.5.3+ intl-messageformat: 9.13.0+ tslib: 2.8.1+ optionalDependencies:+ typescript: 4.9.5+'@formatjs/[email protected]([email protected](@babel/[email protected])(@jest/[email protected])(@jest/[email protected])([email protected](@babel/[email protected]))([email protected])([email protected])([email protected](@types/[email protected])([email protected](@types/[email protected])([email protected])))([email protected]))':dependencies:intl-messageformat-parser: 6.1.2@@ -8070,33 +8316,62 @@ snapshots:'@netlify/[email protected]': {}+ '@next/[email protected]': {}+'@next/[email protected]': {}'@next/[email protected]':dependencies:glob: 10.3.10+ '@next/[email protected]':+ optional: true+'@next/[email protected]':optional: true+ '@next/[email protected]':+ optional: true+'@next/[email protected]':optional: true+ '@next/[email protected]':+ optional: true+'@next/[email protected]':optional: true+ '@next/[email protected]':+ optional: true+'@next/[email protected]':optional: true+ '@next/[email protected]':+ optional: true+'@next/[email protected]':optional: true+ '@next/[email protected]':+ optional: true+'@next/[email protected]':optional: true+ '@next/[email protected]':+ optional: true+'@next/[email protected]':optional: true+ '@next/[email protected]':+ optional: true++ '@next/[email protected]':+ optional: true+'@next/[email protected]':optional: true@@ -9453,8 +9728,22 @@ snapshots:dependencies:tslib: 2.8.1+ '@swc/[email protected]':+ dependencies:+ tslib: 2.8.1++ '@tanstack/[email protected]': {}+'@tanstack/[email protected]': {}+ dependencies:+ '@tanstack/query-core': 4.40.0+ react: 18.3.1+ use-sync-external-store: 1.5.0([email protected])+ optionalDependencies:+ react-dom: 18.3.1([email protected])+'@tanstack/[email protected]([email protected])':dependencies:'@tanstack/query-core': 5.80.10@@ -9736,7 +10025,7 @@ snapshots:'@typescript-eslint/types': 8.34.1eslint-visitor-keys: 4.2.1- '@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.6'@internationalized/date': 3.8.2@@ -9750,7 +10039,7 @@ snapshots:react: 19.1.0react-dom: 19.1.0([email protected])- react-hook-form: 7.58.1([email protected])+ react-hook-form: 7.60.0([email protected])react-icons: 5.5.0([email protected])thenby: 1.3.4zustand: 5.0.5(@types/[email protected])([email protected])([email protected])([email protected]([email protected]))@@ -10245,16 +10534,16 @@ snapshots:dependencies:browserslist: 4.24.5- caniuse-lite: 1.0.30001722+ caniuse-lite: 1.0.30001727lodash.memoize: 4.1.2lodash.uniq: 4.5.0- [email protected]: {}-+ [email protected]: {}+@@ -10726,7 +11015,7 @@ snapshots:- [email protected]: {}+ [email protected]: {}@@ -11559,6 +11848,8 @@ snapshots:dependencies:is-glob: 4.0.3+ [email protected]: {}+dependencies:foreground-child: 3.3.1@@ -11788,6 +12079,13 @@ snapshots:'@formatjs/icu-messageformat-parser': 2.9.4tslib: 2.8.1+ dependencies:+ '@formatjs/ecma402-abstract': 1.11.4+ '@formatjs/fast-memoize': 1.2.1+ '@formatjs/icu-messageformat-parser': 2.1.0+ tslib: 2.8.1+@@ -12764,6 +13062,12 @@ snapshots:+ dependencies:+ moment: 2.30.1++ [email protected]: {}+@@ -12774,6 +13078,40 @@ snapshots:+ [email protected]([email protected](@babel/[email protected])([email protected]([email protected]))([email protected]))([email protected]([email protected]))([email protected]):+ dependencies:+ bcryptjs: 2.4.3+ jsonwebtoken: 9.0.2+ pure-rand: 6.1.0+ react: 18.3.1+ react-dom: 18.3.1([email protected])++ [email protected](@babel/[email protected])([email protected]([email protected]))([email protected]):+ dependencies:+ '@next/env': 13.5.11+ '@swc/helpers': 0.5.2+ busboy: 1.6.0+ caniuse-lite: 1.0.30001727+ postcss: 8.4.31+ react: 18.3.1+ react-dom: 18.3.1([email protected])+ styled-jsx: 5.1.1(@babel/[email protected])([email protected])+ watchpack: 2.4.0+ optionalDependencies:+ '@next/swc-darwin-arm64': 13.5.9+ '@next/swc-darwin-x64': 13.5.9+ '@next/swc-linux-arm64-gnu': 13.5.9+ '@next/swc-linux-arm64-musl': 13.5.9+ '@next/swc-linux-x64-gnu': 13.5.9+ '@next/swc-linux-x64-musl': 13.5.9+ '@next/swc-win32-arm64-msvc': 13.5.9+ '@next/swc-win32-ia32-msvc': 13.5.9+ '@next/swc-win32-x64-msvc': 13.5.9+ transitivePeerDependencies:+ - '@babel/core'+ - babel-plugin-macros+[email protected](@babel/[email protected])([email protected])([email protected]([email protected]))([email protected]):dependencies:'@next/env': 15.3.4@@ -13659,6 +13997,12 @@ snapshots:react-hook-form: 7.56.4([email protected])+ dependencies:+ loose-envify: 1.4.0+ react: 18.3.1+ scheduler: 0.23.2+dependencies:react: 19.1.0@@ -13673,7 +14017,7 @@ snapshots:dependencies:react: 19.1.0dependencies:react: 19.1.0@@ -13681,6 +14025,22 @@ snapshots:dependencies:react: 19.1.0+ dependencies:+ '@formatjs/ecma402-abstract': 1.11.4+ '@formatjs/icu-messageformat-parser': 2.1.0+ '@formatjs/intl': 2.2.1([email protected])+ '@formatjs/intl-displaynames': 5.4.3+ '@formatjs/intl-listformat': 6.5.3+ '@types/hoist-non-react-statics': 3.3.6+ '@types/react': 18.3.23+ hoist-non-react-statics: 3.3.2+ intl-messageformat: 9.13.0+ react: 18.3.1+ tslib: 2.8.1+ optionalDependencies:+ typescript: 4.9.5+dependencies:'@formatjs/ecma402-abstract': 2.2.4@@ -13763,6 +14123,10 @@ snapshots:react: 19.1.0react-dom: 19.1.0([email protected])+ dependencies:+ loose-envify: 1.4.0+@@ -13996,6 +14360,10 @@ snapshots:+ dependencies:+ loose-envify: 1.4.0+@@ -14314,6 +14682,13 @@ snapshots:+ dependencies:+ client-only: 0.0.1+ react: 18.3.1+ optionalDependencies:+ '@babel/core': 7.27.1+dependencies:client-only: 0.0.1@@ -14695,6 +15070,10 @@ snapshots:dependencies:react: 19.1.0+ dependencies:+ react: 18.3.1+dependencies:react: 19.1.0@@ -14740,6 +15119,11 @@ snapshots:dependencies:makeerror: 1.0.12+ dependencies:+ glob-to-regexp: 0.4.1+ graceful-fs: 4.2.11+@@ -14881,6 +15265,14 @@ snapshots:+ dependencies:+ use-sync-external-store: 1.5.0([email protected])+ optionalDependencies:+ '@types/react': 19.1.8+ immer: 9.0.21+ react: 18.3.1+[email protected](@types/[email protected])([email protected])([email protected])([email protected]([email protected])):optionalDependencies:'@types/react': 19.1.8diff --git a/src/app/(main)/admin/teams/[teamId]/AdminTeamPage.tsx b/src/app/(main)/admin/teams/[teamId]/AdminTeamPage.tsxindex 311343888..7f680a91b 100644--- a/src/app/(main)/admin/teams/[teamId]/AdminTeamPage.tsx+++ b/src/app/(main)/admin/teams/[teamId]/AdminTeamPage.tsx@@ -1,5 +1,5 @@'use client';-import { TeamDetails } from '@/app/(main)/teams/[teamId]/settings/team/TeamDetails';+import { TeamDetails } from '@/app/(main)/settings/teams/[teamId]/TeamDetails';import { TeamProvider } from '@/app/(main)/teams/[teamId]/TeamProvider';export function AdminTeamPage({ teamId }: { teamId: string }) {diff --git a/src/app/(main)/admin/users/[userId]/UserProvider.tsx b/src/app/(main)/admin/users/[userId]/UserProvider.tsxindex 22b1b955f..39df7cfce 100644--- a/src/app/(main)/admin/users/[userId]/UserProvider.tsx+++ b/src/app/(main)/admin/users/[userId]/UserProvider.tsx@@ -1,22 +1,19 @@-import { createContext, ReactNode, useEffect } from 'react';+import { createContext, ReactNode } from 'react';import { Loading } from '@umami/react-zen';-import { useModified, useUserQuery } from '@/components/hooks';+import { useUserQuery } from '@/components/hooks';export const UserContext = createContext(null);export function UserProvider({ userId, children }: { userId: string; children: ReactNode }) {- const { modified } = useModified(`user:${userId}`);- const { data: user, isFetching, isLoading, refetch } = useUserQuery(userId);-- useEffect(() => {- if (modified) {- refetch();- }- }, [modified]);+ const { data: user, isFetching, isLoading } = useUserQuery(userId);if (isFetching && isLoading) {return <Loading position="page" />;}- return <UserContext.Provider value={{ ...user, modified }}>{children}</UserContext.Provider>;+ if (!user) {+ return null;+ }++ return <UserContext.Provider value={user}>{children}</UserContext.Provider>;}diff --git a/src/app/(main)/settings/SettingsLayout.tsx b/src/app/(main)/settings/SettingsLayout.tsxindex 4110820e8..cfc901d4e 100644--- a/src/app/(main)/settings/SettingsLayout.tsx+++ b/src/app/(main)/settings/SettingsLayout.tsx@@ -13,6 +13,11 @@ export function SettingsLayout({ children }: { children: ReactNode }) {const { pathname } = useNavigation();const items = [+ {+ id: 'preferences',+ label: formatMessage(labels.preferences),+ url: '/settings/preferences',+ },{id: 'profile',label: formatMessage(labels.profile),diff --git a/src/app/(main)/settings/profile/DateRangeSetting.tsx b/src/app/(main)/settings/preferences/DateRangeSetting.tsxsimilarity index 100%rename from src/app/(main)/settings/profile/DateRangeSetting.tsxrename to src/app/(main)/settings/preferences/DateRangeSetting.tsxdiff --git a/src/app/(main)/settings/profile/LanguageSetting.tsx b/src/app/(main)/settings/preferences/LanguageSetting.tsxsimilarity index 100%rename from src/app/(main)/settings/profile/LanguageSetting.tsxrename to src/app/(main)/settings/preferences/LanguageSetting.tsxdiff --git a/src/app/(main)/settings/preferences/PreferenceSettings.tsx b/src/app/(main)/settings/preferences/PreferenceSettings.tsxnew file mode 100644index 000000000..c956ebad9--- /dev/null+++ b/src/app/(main)/settings/preferences/PreferenceSettings.tsx@@ -0,0 +1,39 @@+import { Column, Label } from '@umami/react-zen';+import { useLoginQuery, useMessages } from '@/components/hooks';+import { TimezoneSetting } from './TimezoneSetting';+import { DateRangeSetting } from './DateRangeSetting';+import { LanguageSetting } from './LanguageSetting';+import { ThemeSetting } from './ThemeSetting';++export function PreferenceSettings() {+ const { user } = useLoginQuery();+ const { formatMessage, labels } = useMessages();++ if (!user) {+ return null;+ }++ return (+ <Column width="400px" gap="6">+ <Column>+ <Label>{formatMessage(labels.defaultDateRange)}</Label>+ <DateRangeSetting />+ </Column>++ <Column>+ <Label>{formatMessage(labels.language)}</Label>+ <LanguageSetting />+ </Column>++ <Column>+ <Label>{formatMessage(labels.timezone)}</Label>+ <TimezoneSetting />+ </Column>++ <Column>+ <Label>{formatMessage(labels.theme)}</Label>+ <ThemeSetting />+ </Column>+ </Column>+ );+}diff --git a/src/app/(main)/settings/preferences/PreferencesPage.tsx b/src/app/(main)/settings/preferences/PreferencesPage.tsxnew file mode 100644index 000000000..62d7f8821--- /dev/null+++ b/src/app/(main)/settings/preferences/PreferencesPage.tsx@@ -0,0 +1,16 @@+'use client';+import { Column } from '@umami/react-zen';+import { useMessages } from '@/components/hooks';+import { SectionHeader } from '@/components/common/SectionHeader';+import { PreferenceSettings } from './PreferenceSettings';++export function PreferencesPage() {+ const { formatMessage, labels } = useMessages();++ return (+ <Column gap>+ <SectionHeader title={formatMessage(labels.preferences)} />+ <PreferenceSettings />+ </Column>+ );+}diff --git a/src/app/(main)/settings/profile/ThemeSetting.tsx b/src/app/(main)/settings/preferences/ThemeSetting.tsxsimilarity index 61%rename from src/app/(main)/settings/profile/ThemeSetting.tsxrename to src/app/(main)/settings/preferences/ThemeSetting.tsxindex bc9b90b6c..d0c4fb288 100644--- a/src/app/(main)/settings/profile/ThemeSetting.tsx+++ b/src/app/(main)/settings/preferences/ThemeSetting.tsx@@ -6,15 +6,12 @@ export function ThemeSetting() {return (<Row gap>- <Button- variant={theme === 'light' ? 'primary' : 'secondary'}- onPress={() => setTheme('light')}- >+ <Button variant={theme === 'light' ? 'primary' : undefined} onPress={() => setTheme('light')}><Icon><Sun /></Icon></Button>- <Button variant={theme === 'dark' ? 'primary' : 'secondary'} onPress={() => setTheme('dark')}>+ <Button variant={theme === 'dark' ? 'primary' : undefined} onPress={() => setTheme('dark')}><Icon><Moon /></Icon>diff --git a/src/app/(main)/settings/profile/TimezoneSetting.tsx b/src/app/(main)/settings/preferences/TimezoneSetting.tsxsimilarity index 100%rename from src/app/(main)/settings/profile/TimezoneSetting.tsxrename to src/app/(main)/settings/preferences/TimezoneSetting.tsxdiff --git a/src/app/(main)/settings/preferences/page.tsx b/src/app/(main)/settings/preferences/page.tsxnew file mode 100644index 000000000..bc1398f38--- /dev/null+++ b/src/app/(main)/settings/preferences/page.tsx@@ -0,0 +1,10 @@+import { Metadata } from 'next';+import { PreferencesPage } from './PreferencesPage';++export default function () {+ return <PreferencesPage />;+}++export const metadata: Metadata = {+ title: 'Preferences',+};diff --git a/src/app/(main)/settings/profile/PasswordChangeButton.tsx b/src/app/(main)/settings/profile/PasswordChangeButton.tsxindex fb4c3f853..a4d65f93b 100644--- a/src/app/(main)/settings/profile/PasswordChangeButton.tsx+++ b/src/app/(main)/settings/profile/PasswordChangeButton.tsx@@ -1,4 +1,13 @@-import { Button, Icon, Text, useToast, DialogTrigger, Dialog, Modal } from '@umami/react-zen';+import {+ Button,+ Icon,+ Text,+ useToast,+ DialogTrigger,+ Dialog,+ Modal,+ Column,+} from '@umami/react-zen';import { PasswordEditForm } from './PasswordEditForm';import { LockKeyhole } from '@/components/icons';import { useMessages } from '@/components/hooks';@@ -21,7 +30,11 @@ export function PasswordChangeButton() {</Button><Modal><Dialog title={formatMessage(labels.changePassword)}>- {({ close }) => <PasswordEditForm onSave={handleSave} onClose={close} />}+ {({ close }) => (+ <Column width="300px">+ <PasswordEditForm onSave={handleSave} onClose={close} />+ </Column>+ )}</Dialog></Modal></DialogTrigger>diff --git a/src/app/(main)/settings/profile/ProfileSettings.tsx b/src/app/(main)/settings/profile/ProfileSettings.tsxindex 40471c75c..72ae7d91a 100644--- a/src/app/(main)/settings/profile/ProfileSettings.tsx+++ b/src/app/(main)/settings/profile/ProfileSettings.tsx@@ -1,10 +1,6 @@import { Row, Column, Label } from '@umami/react-zen';import { useLoginQuery, useMessages } from '@/components/hooks';import { ROLES } from '@/lib/constants';-import { TimezoneSetting } from './TimezoneSetting';-import { DateRangeSetting } from './DateRangeSetting';-import { LanguageSetting } from './LanguageSetting';-import { ThemeSetting } from './ThemeSetting';import { PasswordChangeButton } from './PasswordChangeButton';export function ProfileSettings() {@@ -52,26 +48,6 @@ export function ProfileSettings() {</Row></Column>)}-- <Column>- <Label>{formatMessage(labels.defaultDateRange)}</Label>- <DateRangeSetting />- </Column>-- <Column>- <Label>{formatMessage(labels.language)}</Label>- <LanguageSetting />- </Column>-- <Column>- <Label>{formatMessage(labels.timezone)}</Label>- <TimezoneSetting />- </Column>-- <Column>- <Label>{formatMessage(labels.theme)}</Label>- <ThemeSetting />- </Column></Column>);}diff --git a/src/app/(main)/settings/teams/TeamAddForm.tsx b/src/app/(main)/settings/teams/TeamAddForm.tsxindex 80fd0c622..2c1746f7e 100644--- a/src/app/(main)/settings/teams/TeamAddForm.tsx+++ b/src/app/(main)/settings/teams/TeamAddForm.tsx@@ -25,7 +25,7 @@ export function TeamAddForm({ onSave, onClose }: { onSave: () => void; onClose:};return (- <Form onSubmit={handleSubmit} error={error}>+ <Form onSubmit={handleSubmit} error={error} style={{ minWidth: 300 }}><FormField name="name" label={formatMessage(labels.name)}><TextField autoComplete="off" /></FormField>diff --git a/src/app/(main)/settings/teams/TeamJoinForm.tsx b/src/app/(main)/settings/teams/TeamJoinForm.tsxindex 91ec5aaf8..047b28ad9 100644--- a/src/app/(main)/settings/teams/TeamJoinForm.tsx+++ b/src/app/(main)/settings/teams/TeamJoinForm.tsx@@ -25,7 +25,7 @@ export function TeamJoinForm({ onSave, onClose }: { onSave: () => void; onClose:};return (- <Form onSubmit={handleSubmit} error={error}>+ <Form onSubmit={handleSubmit} error={error} style={{ minWidth: 300 }}><FormFieldlabel={formatMessage(labels.accessCode)}name="accessCode"diff --git a/src/app/(main)/settings/teams/TeamsDataTable.tsx b/src/app/(main)/settings/teams/TeamsDataTable.tsxindex 093917a0d..5c6aa8875 100644--- a/src/app/(main)/settings/teams/TeamsDataTable.tsx+++ b/src/app/(main)/settings/teams/TeamsDataTable.tsx@@ -6,17 +6,16 @@ import { ReactNode } from 'react';export function TeamsDataTable({allowEdit,showActions,- children,}: {allowEdit?: boolean;showActions?: boolean;children?: ReactNode;}) {const { user } = useLoginQuery();- const queryResult = useUserTeamsQuery(user.id);+ const query = useUserTeamsQuery(user.id);return (- <DataGrid query={queryResult} renderEmpty={() => children}>+ <DataGrid query={query}>{({ data }) => {return <TeamsTable data={data} allowEdit={allowEdit} showActions={showActions} />;}}diff --git a/src/app/(main)/settings/teams/TeamsTable.tsx b/src/app/(main)/settings/teams/TeamsTable.tsxindex 39870ec85..bfe6b3327 100644--- a/src/app/(main)/settings/teams/TeamsTable.tsx+++ b/src/app/(main)/settings/teams/TeamsTable.tsx@@ -1,8 +1,9 @@import { DataColumn, DataTable, Icon, MenuItem, Text, Row } from '@umami/react-zen';import { useMessages } from '@/components/hooks';-import { Arrow, Edit } from '@/components/icons';+import { Eye, Edit } from '@/components/icons';import { ROLES } from '@/lib/constants';import { MenuButton } from '@/components/input/MenuButton';+import Link from 'next/link';export function TeamsTable({data = [],@@ -16,7 +17,9 @@ export function TeamsTable({return (<DataTable data={data}>- <DataColumn id="name" label={formatMessage(labels.name)} />+ <DataColumn id="name" label={formatMessage(labels.name)}>+ {(row: any) => <Link href={`/settings/teams/${row.id}`}>{row.name}</Link>}+ </DataColumn><DataColumn id="owner" label={formatMessage(labels.owner)}>{(row: any) => row.teamUser.find(({ role }) => role === ROLES.teamOwner)?.user?.username}</DataColumn>@@ -36,12 +39,12 @@ export function TeamsTable({<MenuItem href={`/teams/${id}`}><Row alignItems="center" gap><Icon>- <Arrow />+ <Eye /></Icon><Text>{formatMessage(labels.view)}</Text></Row></MenuItem>- <MenuItem href={`/teams/${id}/settings`}>+ <MenuItem href={`/settings/teams/${id}`}><Row alignItems="center" gap><Icon><Edit />diff --git a/src/app/(main)/teams/[teamId]/settings/team/TeamDeleteForm.tsx b/src/app/(main)/settings/teams/[teamId]/TeamDeleteForm.tsxsimilarity index 100%rename from src/app/(main)/teams/[teamId]/settings/team/TeamDeleteForm.tsxrename to src/app/(main)/settings/teams/[teamId]/TeamDeleteForm.tsxdiff --git a/src/app/(main)/teams/[teamId]/settings/team/TeamDetails.tsx b/src/app/(main)/settings/teams/[teamId]/TeamDetails.tsxsimilarity index 88%rename from src/app/(main)/teams/[teamId]/settings/team/TeamDetails.tsxrename to src/app/(main)/settings/teams/[teamId]/TeamDetails.tsxindex d77829561..635aba551 100644--- a/src/app/(main)/teams/[teamId]/settings/team/TeamDetails.tsx+++ b/src/app/(main)/settings/teams/[teamId]/TeamDetails.tsx@@ -8,8 +8,8 @@ import { Users } from '@/components/icons';import { TeamLeaveButton } from '@/app/(main)/settings/teams/TeamLeaveButton';import { TeamManage } from './TeamManage';import { TeamEditForm } from './TeamEditForm';-import { TeamWebsitesDataTable } from '@/app/(main)/teams/[teamId]/settings/websites/TeamWebsitesDataTable';-import { TeamMembersDataTable } from '@/app/(main)/teams/[teamId]/settings/members/TeamMembersDataTable';+import { TeamWebsitesDataTable } from './TeamWebsitesDataTable';+import { TeamMembersDataTable } from './TeamMembersDataTable';export function TeamDetails({ teamId }: { teamId: string }) {const team = useContext(TeamContext);@@ -22,10 +22,12 @@ export function TeamDetails({ teamId }: { teamId: string }) {user.role !== ROLES.viewOnly;const canEdit =- !!team?.teamUser?.find(+ user.isAdmin ||+ (!!team?.teamUser?.find(({ userId, role }) =>(role === ROLES.teamOwner || role === ROLES.teamManager) && userId === user.id,- ) && user.role !== ROLES.viewOnly;+ ) &&+ user.role !== ROLES.viewOnly);return (<Column gap>diff --git a/src/app/(main)/teams/[teamId]/settings/team/TeamEditForm.tsx b/src/app/(main)/settings/teams/[teamId]/TeamEditForm.tsxsimilarity index 69%rename from src/app/(main)/teams/[teamId]/settings/team/TeamEditForm.tsxrename to src/app/(main)/settings/teams/[teamId]/TeamEditForm.tsxindex fad603bbc..4fde3fd32 100644--- a/src/app/(main)/teams/[teamId]/settings/team/TeamEditForm.tsx+++ b/src/app/(main)/settings/teams/[teamId]/TeamEditForm.tsx@@ -6,7 +6,6 @@ import {TextField,Button,useToast,- Text,} from '@umami/react-zen';import { getRandomChars } from '@/lib/crypto';import { useContext } from 'react';@@ -15,28 +14,38 @@ import { TeamContext } from '@/app/(main)/teams/[teamId]/TeamProvider';const generateId = () => `team_${getRandomChars(16)}`;-export function TeamEditForm({ teamId, allowEdit }: { teamId: string; allowEdit?: boolean }) {+export function TeamEditForm({+ teamId,+ allowEdit,+ onSave,+}: {+ teamId: string;+ allowEdit?: boolean;+ onSave?: () => void;+}) {const team = useContext(TeamContext);const { formatMessage, labels, messages } = useMessages();const { post, useMutation } = useApi();+ const { toast } = useToast();+ const { touch } = useModified();+const { mutate, error } = useMutation({mutationFn: (data: any) => post(`/teams/${teamId}`, data),});- const { toast } = useToast();- const { touch } = useModified();- const cloudMode = !!process.env.cloudMode;const handleSubmit = async (data: any) => {mutate(data, {onSuccess: async () => {touch('teams');+ touch(`teams:${teamId}`);toast(formatMessage(messages.saved));+ onSave?.();},});};return (- <Form onSubmit={handleSubmit} error={error} defaultValues={{ ...team }}>+ <Form onSubmit={handleSubmit} error={error} defaultValues={{ ...team }} style={{ width: 400 }}>{({ setValue }) => {return (<>@@ -48,22 +57,16 @@ export function TeamEditForm({ teamId, allowEdit }: { teamId: string; allowEdit?label={formatMessage(labels.name)}rules={{ required: formatMessage(labels.required) }}>- {allowEdit ? <TextField /> : <Text>{team?.name}</Text>}+ <TextField isReadOnly={!allowEdit} />+ </FormField>+ <FormField name="accessCode" label={formatMessage(labels.accessCode)}>+ <TextField isReadOnly allowCopy /></FormField>- {!cloudMode && allowEdit && (- <FormField name="accessCode" label={formatMessage(labels.accessCode)}>- <TextField isReadOnly allowCopy />- </FormField>- )}{allowEdit && (<FormButtons justifyContent="space-between">- {allowEdit && (- <Button- onPress={() => setValue('accessCode', generateId(), { shouldDirty: true })}- >- {formatMessage(labels.regenerate)}- </Button>- )}+ <Button onPress={() => setValue('accessCode', generateId(), { shouldDirty: true })}>+ {formatMessage(labels.regenerate)}+ </Button><FormSubmitButton variant="primary">{formatMessage(labels.save)}</FormSubmitButton></FormButtons>)}diff --git a/src/app/(main)/teams/[teamId]/settings/team/TeamManage.tsx b/src/app/(main)/settings/teams/[teamId]/TeamManage.tsxsimilarity index 100%rename from src/app/(main)/teams/[teamId]/settings/team/TeamManage.tsxrename to src/app/(main)/settings/teams/[teamId]/TeamManage.tsxdiff --git a/src/app/(main)/teams/[teamId]/settings/members/TeamMemberEditButton.tsx b/src/app/(main)/settings/teams/[teamId]/TeamMemberEditButton.tsxsimilarity index 83%rename from src/app/(main)/teams/[teamId]/settings/members/TeamMemberEditButton.tsxrename to src/app/(main)/settings/teams/[teamId]/TeamMemberEditButton.tsxindex 62279bdd3..308e34398 100644--- a/src/app/(main)/teams/[teamId]/settings/members/TeamMemberEditButton.tsx+++ b/src/app/(main)/settings/teams/[teamId]/TeamMemberEditButton.tsx@@ -1,14 +1,5 @@import { useMessages, useModified } from '@/components/hooks';-import {- Row,- Pressable,- Icon,- Modal,- DialogTrigger,- Dialog,- Text,- useToast,-} from '@umami/react-zen';+import { Row, Button, Icon, Modal, DialogTrigger, Dialog, useToast } from '@umami/react-zen';import { TeamMemberEditForm } from './TeamMemberEditForm';import { Edit } from '@/components/icons';@@ -28,21 +19,20 @@ export function TeamMemberEditButton({const { touch } = useModified();const handleSave = () => {- toast(formatMessage(messages.saved));touch('teams:members');+ toast(formatMessage(messages.saved));onSave?.();};return (<DialogTrigger>- <Pressable>+ <Button variant="quiet"><Row alignItems="center" gap><Icon><Edit /></Icon>- <Text>{formatMessage(labels.edit)}</Text></Row>- </Pressable>+ </Button><Modal><Dialog title={formatMessage(labels.editMember)}>{({ close }) => (diff --git a/src/app/(main)/teams/[teamId]/settings/members/TeamMemberEditForm.tsx b/src/app/(main)/settings/teams/[teamId]/TeamMemberEditForm.tsxsimilarity index 94%rename from src/app/(main)/teams/[teamId]/settings/members/TeamMemberEditForm.tsxrename to src/app/(main)/settings/teams/[teamId]/TeamMemberEditForm.tsxindex c55012214..72618f838 100644--- a/src/app/(main)/teams/[teamId]/settings/members/TeamMemberEditForm.tsx+++ b/src/app/(main)/settings/teams/[teamId]/TeamMemberEditForm.tsx@@ -39,7 +39,7 @@ export function TeamMemberEditForm({};return (- <Form onSubmit={handleSubmit} error={error} values={{ role }}>+ <Form onSubmit={handleSubmit} error={error} defaultValues={{ role }} style={{ minWidth: 400 }}><FormFieldname="role"rules={{ required: formatMessage(labels.required) }}@@ -53,12 +53,12 @@ export function TeamMemberEditForm({</FormField><FormButtons>- <FormSubmitButton variant="primary" isDisabled={false}>- {formatMessage(labels.save)}- </FormSubmitButton><Button isDisabled={isPending} onPress={onClose}>{formatMessage(labels.cancel)}</Button>+ <FormSubmitButton variant="primary" isDisabled={false}>+ {formatMessage(labels.save)}+ </FormSubmitButton></FormButtons></Form>);diff --git a/src/app/(main)/teams/[teamId]/settings/members/TeamMemberRemoveButton.tsx b/src/app/(main)/settings/teams/[teamId]/TeamMemberRemoveButton.tsxsimilarity index 87%rename from src/app/(main)/teams/[teamId]/settings/members/TeamMemberRemoveButton.tsxrename to src/app/(main)/settings/teams/[teamId]/TeamMemberRemoveButton.tsxindex 508ddc6e7..ae25c8be0 100644--- a/src/app/(main)/teams/[teamId]/settings/members/TeamMemberRemoveButton.tsx+++ b/src/app/(main)/settings/teams/[teamId]/TeamMemberRemoveButton.tsx@@ -1,8 +1,8 @@import { ConfirmationForm } from '@/components/common/ConfirmationForm';import { useApi, useMessages, useModified } from '@/components/hooks';import { messages } from '@/components/messages';-import { Close } from '@/components/icons';-import { Button, Icon, Modal, DialogTrigger, Dialog, Text } from '@umami/react-zen';+import { Trash } from '@/components/icons';+import { Button, Icon, Modal, DialogTrigger, Dialog } from '@umami/react-zen';export function TeamMemberRemoveButton({teamId,@@ -35,11 +35,10 @@ export function TeamMemberRemoveButton({return (<DialogTrigger>- <Button>+ <Button variant="quiet"><Icon>- <Close />+ <Trash /></Icon>- <Text>{formatMessage(labels.remove)}</Text></Button><Modal><Dialog title={formatMessage(labels.removeMember)}>@@ -53,6 +52,7 @@ export function TeamMemberRemoveButton({onConfirm={handleConfirm.bind(null, close)}onClose={close}buttonLabel={formatMessage(labels.remove)}+ buttonVariant="danger"/>)}</Dialog>diff --git a/src/app/(main)/teams/[teamId]/settings/members/TeamMembersDataTable.tsx b/src/app/(main)/settings/teams/[teamId]/TeamMembersDataTable.tsxsimilarity index 90%rename from src/app/(main)/teams/[teamId]/settings/members/TeamMembersDataTable.tsxrename to src/app/(main)/settings/teams/[teamId]/TeamMembersDataTable.tsxindex 25ccbab39..d5f993104 100644--- a/src/app/(main)/teams/[teamId]/settings/members/TeamMembersDataTable.tsx+++ b/src/app/(main)/settings/teams/[teamId]/TeamMembersDataTable.tsx@@ -12,7 +12,7 @@ export function TeamMembersDataTable({const queryResult = useTeamMembersQuery(teamId);return (- <DataGrid query={queryResult}>+ <DataGrid query={queryResult} allowSearch>{({ data }) => <TeamMembersTable data={data} teamId={teamId} allowEdit={allowEdit} />}</DataGrid>);diff --git a/src/app/(main)/teams/[teamId]/settings/members/TeamMembersPage.tsx b/src/app/(main)/settings/teams/[teamId]/TeamMembersPage.tsxsimilarity index 100%rename from src/app/(main)/teams/[teamId]/settings/members/TeamMembersPage.tsxrename to src/app/(main)/settings/teams/[teamId]/TeamMembersPage.tsxdiff --git a/src/app/(main)/teams/[teamId]/settings/members/TeamMembersTable.tsx b/src/app/(main)/settings/teams/[teamId]/TeamMembersTable.tsxsimilarity index 50%rename from src/app/(main)/teams/[teamId]/settings/members/TeamMembersTable.tsxrename to src/app/(main)/settings/teams/[teamId]/TeamMembersTable.tsxindex 34f3ac3b4..f84f58a9c 100644--- a/src/app/(main)/teams/[teamId]/settings/members/TeamMembersTable.tsx+++ b/src/app/(main)/settings/teams/[teamId]/TeamMembersTable.tsx@@ -1,9 +1,8 @@-import { DataColumn, DataTable, MenuItem } from '@umami/react-zen';-import { useMessages, useLoginQuery } from '@/components/hooks';+import { DataColumn, DataTable, Row } from '@umami/react-zen';+import { useMessages } from '@/components/hooks';import { ROLES } from '@/lib/constants';import { TeamMemberRemoveButton } from './TeamMemberRemoveButton';import { TeamMemberEditButton } from './TeamMemberEditButton';-import { MenuButton } from '@/components/input/MenuButton';export function TeamMembersTable({data = [],@@ -15,7 +14,6 @@ export function TeamMembersTable({allowEdit: boolean;}) {const { formatMessage, labels } = useMessages();- const { user } = useLoginQuery();const roles = {[ROLES.teamOwner]: formatMessage(labels.teamOwner),@@ -32,28 +30,22 @@ export function TeamMembersTable({<DataColumn id="role" label={formatMessage(labels.role)}>{(row: any) => roles[row?.role]}</DataColumn>- <DataColumn id="action" align="end">- {(row: any) => {- return (- allowEdit &&- row?.role !== ROLES.teamOwner &&- user?.id !== row?.user?.id && (- <MenuButton>- <MenuItem>- <TeamMemberEditButton teamId={teamId} userId={row?.user?.id} role={row?.role} />- </MenuItem>- <MenuItem>- <TeamMemberRemoveButton- teamId={teamId}- userId={row?.user?.id}- userName={row?.user?.username}- />- </MenuItem>- </MenuButton>- )- );- }}- </DataColumn>+ {allowEdit && (+ <DataColumn id="action" align="end">+ {(row: any) => {+ return (+ <Row alignItems="center">+ <TeamMemberEditButton teamId={teamId} userId={row?.user?.id} role={row?.role} />+ <TeamMemberRemoveButton+ teamId={teamId}+ userId={row?.user?.id}+ userName={row?.user?.username}+ />+ </Row>+ );+ }}+ </DataColumn>+ )}</DataTable>);}diff --git a/src/app/(main)/settings/teams/[teamId]/TeamSettingsPage.tsx b/src/app/(main)/settings/teams/[teamId]/TeamSettingsPage.tsxnew file mode 100644index 000000000..88ec9b404--- /dev/null+++ b/src/app/(main)/settings/teams/[teamId]/TeamSettingsPage.tsx@@ -0,0 +1,11 @@+'use client';+import { TeamProvider } from '@/app/(main)/teams/[teamId]/TeamProvider';+import { TeamDetails } from '@/app/(main)/settings/teams/[teamId]/TeamDetails';++export function TeamSettingsPage({ teamId }: { teamId: string }) {+ return (+ <TeamProvider teamId={teamId}>+ <TeamDetails teamId={teamId} />+ </TeamProvider>+ );+}diff --git a/src/app/(main)/teams/[teamId]/settings/websites/TeamWebsiteRemoveButton.tsx b/src/app/(main)/settings/teams/[teamId]/TeamWebsiteRemoveButton.tsxsimilarity index 100%rename from src/app/(main)/teams/[teamId]/settings/websites/TeamWebsiteRemoveButton.tsxrename to src/app/(main)/settings/teams/[teamId]/TeamWebsiteRemoveButton.tsxdiff --git a/src/app/(main)/teams/[teamId]/settings/websites/TeamWebsitesDataTable.tsx b/src/app/(main)/settings/teams/[teamId]/TeamWebsitesDataTable.tsxsimilarity index 91%rename from src/app/(main)/teams/[teamId]/settings/websites/TeamWebsitesDataTable.tsxrename to src/app/(main)/settings/teams/[teamId]/TeamWebsitesDataTable.tsxindex 1cb65eacd..6a2e4f45d 100644--- a/src/app/(main)/teams/[teamId]/settings/websites/TeamWebsitesDataTable.tsx+++ b/src/app/(main)/settings/teams/[teamId]/TeamWebsitesDataTable.tsx@@ -12,7 +12,7 @@ export function TeamWebsitesDataTable({const queryResult = useTeamWebsitesQuery(teamId);return (- <DataGrid query={queryResult}>+ <DataGrid query={queryResult} allowSearch>{({ data }) => <TeamWebsitesTable data={data} teamId={teamId} allowEdit={allowEdit} />}</DataGrid>);diff --git a/src/app/(main)/teams/[teamId]/settings/websites/TeamWebsitesTable.tsx b/src/app/(main)/settings/teams/[teamId]/TeamWebsitesTable.tsxsimilarity index 85%rename from src/app/(main)/teams/[teamId]/settings/websites/TeamWebsitesTable.tsxrename to src/app/(main)/settings/teams/[teamId]/TeamWebsitesTable.tsxindex 599263352..f04f1f85f 100644--- a/src/app/(main)/teams/[teamId]/settings/websites/TeamWebsitesTable.tsx+++ b/src/app/(main)/settings/teams/[teamId]/TeamWebsitesTable.tsx@@ -1,7 +1,8 @@import { DataColumn, DataTable, Icon, MenuItem, Text, Row } from '@umami/react-zen';import { useLoginQuery, useMessages } from '@/components/hooks';-import { Arrow, Edit } from '@/components/icons';+import { Eye, Edit } from '@/components/icons';import { MenuButton } from '@/components/input/MenuButton';+import Link from 'next/link';export function TeamWebsitesTable({teamId,@@ -17,7 +18,9 @@ export function TeamWebsitesTable({return (<DataTable data={data}>- <DataColumn id="name" label={formatMessage(labels.name)} />+ <DataColumn id="name" label={formatMessage(labels.name)}>+ {(row: any) => <Link href={`/settings/websites/${row.id}`}>{row.name}</Link>}+ </DataColumn><DataColumn id="domain" label={formatMessage(labels.domain)} /><DataColumn id="createdBy" label={formatMessage(labels.createdBy)}>{(row: any) => row?.createUser?.username}@@ -31,7 +34,7 @@ export function TeamWebsitesTable({<MenuItem href={`/teams/${teamId}/websites/${websiteId}`}><Row alignItems="center" gap><Icon>- <Arrow />+ <Eye /></Icon><Text>{formatMessage(labels.view)}</Text></Row>diff --git a/src/app/(main)/teams/[teamId]/settings/team/page.tsx b/src/app/(main)/settings/teams/[teamId]/page.tsxsimilarity index 62%rename from src/app/(main)/teams/[teamId]/settings/team/page.tsxrename to src/app/(main)/settings/teams/[teamId]/page.tsxindex 4767b1c40..5a9aaacb8 100644--- a/src/app/(main)/teams/[teamId]/settings/team/page.tsx+++ b/src/app/(main)/settings/teams/[teamId]/page.tsx@@ -1,12 +1,12 @@import { Metadata } from 'next';-import { TeamPage } from './TeamPage';+import { TeamSettingsPage } from './TeamSettingsPage';export default async function ({ params }: { params: Promise<{ teamId: string }> }) {const { teamId } = await params;- return <TeamPage teamId={teamId} />;+ return <TeamSettingsPage teamId={teamId} />;}export const metadata: Metadata = {- title: 'Teams Details',+ title: 'Teams',};diff --git a/src/app/(main)/settings/websites/WebsiteAddButton.tsx b/src/app/(main)/settings/websites/WebsiteAddButton.tsxindex 8996c5b96..74852a14e 100644--- a/src/app/(main)/settings/websites/WebsiteAddButton.tsx+++ b/src/app/(main)/settings/websites/WebsiteAddButton.tsx@@ -1,5 +1,14 @@import { useMessages, useModified } from '@/components/hooks';-import { Button, Icon, Modal, Dialog, DialogTrigger, Text, useToast } from '@umami/react-zen';+import {+ Button,+ Icon,+ Modal,+ Dialog,+ DialogTrigger,+ Text,+ Column,+ useToast,+} from '@umami/react-zen';import { Plus } from '@/components/icons';import { WebsiteAddForm } from './WebsiteAddForm';@@ -24,7 +33,11 @@ export function WebsiteAddButton({ teamId, onSave }: { teamId: string; onSave?:</Button><Modal><Dialog title={formatMessage(labels.addWebsite)}>- {({ close }) => <WebsiteAddForm teamId={teamId} onSave={handleSave} onClose={close} />}+ {({ close }) => (+ <Column width="300px">+ <WebsiteAddForm teamId={teamId} onSave={handleSave} onClose={close} />+ </Column>+ )}</Dialog></Modal></DialogTrigger>diff --git a/src/app/(main)/settings/websites/WebsitesTable.tsx b/src/app/(main)/settings/websites/WebsitesTable.tsxindex f4cc7ebf1..2d285c75e 100644--- a/src/app/(main)/settings/websites/WebsitesTable.tsx+++ b/src/app/(main)/settings/websites/WebsitesTable.tsx@@ -6,7 +6,7 @@ import { Eye, SquarePen } from '@/components/icons';import Link from 'next/link';export interface WebsitesTableProps {- data: any[];+ data: Record<string, any>[];showActions?: boolean;allowEdit?: boolean;allowView?: boolean;@@ -22,7 +22,8 @@ export function WebsitesTable({children,}: WebsitesTableProps) {const { formatMessage, labels } = useMessages();- const { renderUrl } = useNavigation();+ const { renderUrl, pathname } = useNavigation();+ const isSettings = pathname.includes('/settings');if (!data?.length) {return children;@@ -31,7 +32,11 @@ export function WebsitesTable({return (<DataTable data={data}><DataColumn id="name" label={formatMessage(labels.name)}>- {(row: any) => <Link href={renderUrl(`/websites/${row.id}`, false)}>{row.name}</Link>}+ {(row: any) => (+ <Link href={renderUrl(`${isSettings ? '/settings' : ''}/websites/${row.id}`, false)}>+ {row.name}+ </Link>+ )}</DataColumn><DataColumn id="domain" label={formatMessage(labels.domain)} />{showActions && (@@ -41,7 +46,7 @@ export function WebsitesTable({return (<MenuButton>- {allowEdit && (+ {allowView && (<MenuItem href={renderUrl(`/websites/${websiteId}`)}><Row alignItems="center" gap><Icon data-test="link-button-view">@@ -51,7 +56,7 @@ export function WebsitesTable({</Row></MenuItem>)}- {allowView && (+ {allowEdit && (<MenuItem href={renderUrl(`/settings/websites/${websiteId}`)}><Row alignItems="center" gap><Icon data-test="link-button-edit">diff --git a/src/app/(main)/settings/websites/[websiteId]/WebsiteEditForm.tsx b/src/app/(main)/settings/websites/[websiteId]/WebsiteEditForm.tsxindex 8e9c6d7c8..941977483 100644--- a/src/app/(main)/settings/websites/[websiteId]/WebsiteEditForm.tsx+++ b/src/app/(main)/settings/websites/[websiteId]/WebsiteEditForm.tsx@@ -33,7 +33,7 @@ export function WebsiteEditForm({ websiteId, onSave }: { websiteId: string; onSa};return (- <Form onSubmit={handleSubmit} error={error} values={website} style={{ width: 420 }}>+ <Form onSubmit={handleSubmit} error={error} values={website} style={{ width: 400 }}><FormField name="id" label={formatMessage(labels.websiteId)}><TextField data-test="text-field-websiteId" value={website?.id} isReadOnly allowCopy /></FormField>diff --git a/src/app/(main)/settings/websites/[websiteId]/WebsiteSettings.tsx b/src/app/(main)/settings/websites/[websiteId]/WebsiteSettings.tsxindex a7d19745f..e36cf0ae4 100644--- a/src/app/(main)/settings/websites/[websiteId]/WebsiteSettings.tsx+++ b/src/app/(main)/settings/websites/[websiteId]/WebsiteSettings.tsx@@ -2,7 +2,7 @@ import { useContext } from 'react';import { Icon, Tabs, TabList, Tab, TabPanel, Text } from '@umami/react-zen';import { WebsiteContext } from '@/app/(main)/websites/[websiteId]/WebsiteProvider';import { useMessages } from '@/components/hooks';-import { Globe, Arrow } from '@/components/icons';+import { Globe, Eye } from '@/components/icons';import { SectionHeader } from '@/components/common/SectionHeader';import { WebsiteShareForm } from './WebsiteShareForm';import { WebsiteTrackingCode } from './WebsiteTrackingCode';@@ -25,7 +25,7 @@ export function WebsiteSettings({<SectionHeader title={website?.name} icon={<Globe />}><LinkButton href={`/websites/${websiteId}`} target={openExternal ? '_blank' : null}><Icon>- <Arrow />+ <Eye /></Icon><Text>{formatMessage(labels.view)}</Text></LinkButton>@@ -35,7 +35,7 @@ export function WebsiteSettings({<Tab id="details">{formatMessage(labels.details)}</Tab><Tab id="tracking">{formatMessage(labels.trackingCode)}</Tab><Tab id="share"> {formatMessage(labels.shareUrl)}</Tab>- <Tab id="data">{formatMessage(labels.data)}</Tab>+ <Tab id="manage">{formatMessage(labels.manage)}</Tab></TabList><TabPanel id="details"><WebsiteEditForm websiteId={websiteId} />@@ -44,9 +44,9 @@ export function WebsiteSettings({<WebsiteTrackingCode websiteId={websiteId} /></TabPanel><TabPanel id="share">- <WebsiteShareForm websiteId={websiteId} />+ <WebsiteShareForm websiteId={websiteId} shareId={website.shareId} /></TabPanel>- <TabPanel id="data">+ <TabPanel id="manage"><WebsiteData websiteId={websiteId} /></TabPanel></Tabs>diff --git a/src/app/(main)/teams/[teamId]/TeamProvider.tsx b/src/app/(main)/teams/[teamId]/TeamProvider.tsxindex 178b73d61..a0161ff00 100644--- a/src/app/(main)/teams/[teamId]/TeamProvider.tsx+++ b/src/app/(main)/teams/[teamId]/TeamProvider.tsx@@ -1,25 +1,18 @@'use client';-import { createContext, ReactNode, useEffect } from 'react';-import { useTeamQuery, useModified } from '@/components/hooks';+import { createContext, ReactNode } from 'react';+import { useTeamQuery } from '@/components/hooks';import { Loading } from '@umami/react-zen';export const TeamContext = createContext(null);export function TeamProvider({ teamId, children }: { teamId?: string; children: ReactNode }) {- const { modified } = useModified(`teams`);- const { data: team, isLoading, isFetching, refetch } = useTeamQuery(teamId);-- useEffect(() => {- if (teamId && modified) {- refetch();- }- }, [teamId, modified]);+ const { data: team, isLoading, isFetching } = useTeamQuery(teamId);if (isFetching && isLoading) {return <Loading position="page" />;}- if (teamId && !team) {+ if (!team) {return null;}diff --git a/src/app/(main)/teams/[teamId]/layout.tsx b/src/app/(main)/teams/[teamId]/layout.tsxindex 11814eca1..1dfdd2437 100644--- a/src/app/(main)/teams/[teamId]/layout.tsx+++ b/src/app/(main)/teams/[teamId]/layout.tsx@@ -1,6 +1,5 @@import { TeamProvider } from './TeamProvider';import { Metadata } from 'next';-import { TeamSettingsLayout } from './settings/TeamSettingsLayout';export default async function ({children,@@ -11,11 +10,7 @@ export default async function ({}) {const { teamId } = await params;- return (- <TeamProvider teamId={teamId}>- <TeamSettingsLayout>{children}</TeamSettingsLayout>- </TeamProvider>- );+ return <TeamProvider teamId={teamId}>{children}</TeamProvider>;}export const metadata: Metadata = {diff --git a/src/app/(main)/teams/[teamId]/settings/TeamSettingsLayout.tsx b/src/app/(main)/teams/[teamId]/settings/TeamSettingsLayout.tsxdeleted file mode 100644index 6e4c33ccd..000000000--- a/src/app/(main)/teams/[teamId]/settings/TeamSettingsLayout.tsx+++ /dev/null@@ -1,49 +0,0 @@-'use client';-import { ReactNode } from 'react';-import { useMessages, useNavigation } from '@/components/hooks';-import { Grid, Column } from '@umami/react-zen';-import { SideMenu } from '@/components/common/SideMenu';-import { Panel } from '@/components/common/Panel';-import { PageHeader } from '@/components/common/PageHeader';-import { PageBody } from '@/components/common/PageBody';--export function TeamSettingsLayout({ children }: { children: ReactNode }) {- const { formatMessage, labels } = useMessages();- const { pathname, teamId } = useNavigation();-- const items = [- {- id: 'team',- label: formatMessage(labels.team),- url: `/teams/${teamId}/settings/team`,- },- {- id: 'websites',- label: formatMessage(labels.websites),- url: `/teams/${teamId}/settings/websites`,- },- {- id: 'members',- label: formatMessage(labels.members),- url: `/teams/${teamId}/settings/members`,- },- ].filter(n => n);-- const value = items.find(({ url }) => pathname.includes(url))?.id;-- return (- <PageBody>- <Column gap="6">- <PageHeader title={formatMessage(labels.teamSettings)} />- <Grid columns="200px 1fr" gap>- <Column>- <SideMenu items={items} selectedKey={value} />- </Column>- <Column>- <Panel>{children}</Panel>- </Column>- </Grid>- </Column>- </PageBody>- );-}diff --git a/src/app/(main)/teams/[teamId]/settings/members/page.tsx b/src/app/(main)/teams/[teamId]/settings/members/page.tsxdeleted file mode 100644index f6957843a..000000000--- a/src/app/(main)/teams/[teamId]/settings/members/page.tsx+++ /dev/null@@ -1,12 +0,0 @@-import { Metadata } from 'next';-import { TeamMembersPage } from './TeamMembersPage';--export default async function ({ params }: { params: Promise<{ teamId: string }> }) {- const { teamId } = await params;-- return <TeamMembersPage teamId={teamId} />;-}--export const metadata: Metadata = {- title: 'Team Members',-};diff --git a/src/app/(main)/teams/[teamId]/settings/team/TeamPage.tsx b/src/app/(main)/teams/[teamId]/settings/team/TeamPage.tsxdeleted file mode 100644index a35e6d72b..000000000--- a/src/app/(main)/teams/[teamId]/settings/team/TeamPage.tsx+++ /dev/null@@ -1,6 +0,0 @@-'use client';-import { TeamDetails } from './TeamDetails';--export function TeamPage({ teamId }: { teamId: string }) {- return <TeamDetails teamId={teamId} />;-}diff --git a/src/app/(main)/teams/[teamId]/settings/websites/TeamWebsitesPage.tsx b/src/app/(main)/teams/[teamId]/settings/websites/TeamWebsitesPage.tsxdeleted file mode 100644index d878b9415..000000000--- a/src/app/(main)/teams/[teamId]/settings/websites/TeamWebsitesPage.tsx+++ /dev/null@@ -1,29 +0,0 @@-'use client';-import { TeamContext } from '@/app/(main)/teams/[teamId]/TeamProvider';-import { WebsiteAddButton } from '@/app/(main)/settings/websites/WebsiteAddButton';-import { useLoginQuery, useMessages } from '@/components/hooks';-import { SectionHeader } from '@/components/common/SectionHeader';-import { TeamWebsitesDataTable } from './TeamWebsitesDataTable';-import { ROLES } from '@/lib/constants';-import { useContext } from 'react';-import { Column } from '@umami/react-zen';--export function TeamWebsitesPage({ teamId }: { teamId: string }) {- const team = useContext(TeamContext);- const { formatMessage, labels } = useMessages();- const { user } = useLoginQuery();-- const canEdit =- !!team?.teamUser?.find(- ({ userId, role }) => userId === user.id && role !== ROLES.teamViewOnly,- ) && user.role !== ROLES.viewOnly;-- return (- <Column gap>- <SectionHeader title={formatMessage(labels.websites)}>- {canEdit && <WebsiteAddButton teamId={teamId} />}- </SectionHeader>- <TeamWebsitesDataTable teamId={teamId} allowEdit={canEdit} />- </Column>- );-}diff --git a/src/app/(main)/teams/[teamId]/settings/websites/[websiteId]/page.tsx b/src/app/(main)/teams/[teamId]/settings/websites/[websiteId]/page.tsxdeleted file mode 100644index a18f8a2eb..000000000--- a/src/app/(main)/teams/[teamId]/settings/websites/[websiteId]/page.tsx+++ /dev/null@@ -1,5 +0,0 @@-import Page from '@/app/(main)/settings/websites/[websiteId]/page';--export default function ({ params }) {- return <Page params={params} />;-}diff --git a/src/app/(main)/teams/[teamId]/settings/websites/page.tsx b/src/app/(main)/teams/[teamId]/settings/websites/page.tsxdeleted file mode 100644index e34c35d59..000000000--- a/src/app/(main)/teams/[teamId]/settings/websites/page.tsx+++ /dev/null@@ -1,12 +0,0 @@-import { TeamWebsitesPage } from './TeamWebsitesPage';-import { Metadata } from 'next';--export default async function ({ params }: { params: Promise<{ teamId: string }> }) {- const { teamId } = await params;-- return <TeamWebsitesPage teamId={teamId} />;-}--export const metadata: Metadata = {- title: 'Teams Websites',-};diff --git a/src/app/(main)/websites/[websiteId]/WebsiteProvider.tsx b/src/app/(main)/websites/[websiteId]/WebsiteProvider.tsxindex ea0a8bbe5..16aa55fb8 100644--- a/src/app/(main)/websites/[websiteId]/WebsiteProvider.tsx+++ b/src/app/(main)/websites/[websiteId]/WebsiteProvider.tsx@@ -1,6 +1,6 @@'use client';-import { createContext, ReactNode, useEffect } from 'react';-import { useModified, useWebsiteQuery } from '@/components/hooks';+import { createContext, ReactNode } from 'react';+import { useWebsiteQuery } from '@/components/hooks';import { Loading } from '@umami/react-zen';import { Website } from '@/generated/prisma/client';@@ -13,18 +13,15 @@ export function WebsiteProvider({websiteId: string;children: ReactNode;}) {- const { modified } = useModified(`website:${websiteId}`);- const { data: website, isFetching, isLoading, refetch } = useWebsiteQuery(websiteId);-- useEffect(() => {- if (modified) {- refetch();- }- }, [modified]);+ const { data: website, isFetching, isLoading } = useWebsiteQuery(websiteId);if (isFetching && isLoading) {return <Loading position="page" />;}+ if (!website) {+ return null;+ }+return <WebsiteContext.Provider value={website}>{children}</WebsiteContext.Provider>;}diff --git a/src/app/api/teams/[teamId]/users/route.ts b/src/app/api/teams/[teamId]/users/route.tsindex 376351ea4..cf1b4b9b5 100644--- a/src/app/api/teams/[teamId]/users/route.ts+++ b/src/app/api/teams/[teamId]/users/route.ts@@ -1,13 +1,14 @@import { z } from 'zod';import { unauthorized, json, badRequest } from '@/lib/response';import { canAddUserToTeam, canViewTeam } from '@/lib/auth';-import { parseRequest } from '@/lib/request';-import { pagingParams, teamRoleParam } from '@/lib/schema';+import { getQueryFilters, parseRequest } from '@/lib/request';+import { pagingParams, teamRoleParam, searchParams } from '@/lib/schema';import { createTeamUser, getTeamUser, getTeamUsers } from '@/queries';export async function GET(request: Request, { params }: { params: Promise<{ teamId: string }> }) {const schema = z.object({...pagingParams,+ ...searchParams,});const { auth, query, error } = await parseRequest(request, schema);@@ -22,6 +23,8 @@ export async function GET(request: Request, { params }: { params: Promise<{ teamreturn unauthorized('You must be the owner of this team.');}+ const filters = getQueryFilters(query);+const users = await getTeamUsers({where: {@@ -39,7 +42,7 @@ export async function GET(request: Request, { params }: { params: Promise<{ team},},},- query,+ filters,);return json(users);diff --git a/src/components/common/ConfirmationForm.tsx b/src/components/common/ConfirmationForm.tsxindex 39861f618..38c8634d0 100644--- a/src/components/common/ConfirmationForm.tsx+++ b/src/components/common/ConfirmationForm.tsx@@ -25,10 +25,17 @@ export function ConfirmationForm({return (<Form onSubmit={onConfirm} error={error}>- <Row marginY="4">{message}</Row>+ <Row marginY="4" gap="2">+ {message}+ </Row><FormButtons><Button onPress={onClose}>{formatMessage(labels.cancel)}</Button>- <FormSubmitButton data-test="button-confirm" isLoading={isLoading} variant={buttonVariant}>+ <FormSubmitButton+ data-test="button-confirm"+ isLoading={isLoading}+ variant={buttonVariant}+ isDisabled={false}+ >{buttonLabel || formatMessage(labels.ok)}</FormSubmitButton></FormButtons>diff --git a/src/components/hooks/queries/useTeamQuery.ts b/src/components/hooks/queries/useTeamQuery.tsindex 563e16d54..f471172b6 100644--- a/src/components/hooks/queries/useTeamQuery.ts+++ b/src/components/hooks/queries/useTeamQuery.ts@@ -1,10 +1,17 @@import { useApi } from '../useApi';+import { useModified } from '@/components/hooks';+import { keepPreviousData } from '@tanstack/react-query';+import { ReactQueryOptions } from '@/lib/types';-export function useTeamQuery(teamId: string) {+export function useTeamQuery(teamId: string, options?: ReactQueryOptions<any>) {const { get, useQuery } = useApi();+ const { modified } = useModified(`teams:${teamId}`);+return useQuery({- queryKey: ['teams', teamId],+ queryKey: ['teams', { teamId, modified }],queryFn: () => get(`/teams/${teamId}`),enabled: !!teamId,+ placeholderData: keepPreviousData,+ ...options,});}diff --git a/src/components/hooks/queries/useUserQuery.ts b/src/components/hooks/queries/useUserQuery.tsindex baaa084b0..6fb476d54 100644--- a/src/components/hooks/queries/useUserQuery.ts+++ b/src/components/hooks/queries/useUserQuery.ts@@ -1,11 +1,17 @@import { useApi } from '../useApi';+import { useModified } from '@/components/hooks';+import { keepPreviousData } from '@tanstack/react-query';+import { ReactQueryOptions } from '@/lib/types';-export function useUserQuery(userId: string, options?: Record<string, any>) {+export function useUserQuery(userId: string, options?: ReactQueryOptions<any>) {const { get, useQuery } = useApi();+ const { modified } = useModified(`user:${userId}`);+return useQuery({- queryKey: ['users', userId],+ queryKey: ['users', { userId, modified }],queryFn: () => get(`/users/${userId}`),enabled: !!userId,+ placeholderData: keepPreviousData,...options,});}diff --git a/src/components/hooks/queries/useWebsiteQuery.ts b/src/components/hooks/queries/useWebsiteQuery.tsindex 55fe4eba1..8faaaa262 100644--- a/src/components/hooks/queries/useWebsiteQuery.ts+++ b/src/components/hooks/queries/useWebsiteQuery.ts@@ -1,12 +1,17 @@import { useApi } from '../useApi';+import { useModified } from '@/components/hooks';+import { keepPreviousData } from '@tanstack/react-query';+import { ReactQueryOptions } from '@/lib/types';-export function useWebsiteQuery(websiteId: string, options?: Record<string, any>) {+export function useWebsiteQuery(websiteId: string, options?: ReactQueryOptions<any>) {const { get, useQuery } = useApi();+ const { modified } = useModified(`website:${websiteId}`);return useQuery({- queryKey: ['website', { websiteId }],+ queryKey: ['website', { websiteId, modified }],queryFn: () => get(`/websites/${websiteId}`),enabled: !!websiteId,+ placeholderData: keepPreviousData,...options,});}diff --git a/src/components/input/FilterBar.tsx b/src/components/input/FilterBar.tsxindex f4f86b65f..224b4c774 100644--- a/src/components/input/FilterBar.tsx+++ b/src/components/input/FilterBar.tsx@@ -62,7 +62,7 @@ export function FilterBar() {})}</Row><TooltipTrigger delay={0}>- <Button variant="wrapper" onPress={handleResetFilter} style={{ alignSelf: 'flex-start' }}>+ <Button variant="zero" onPress={handleResetFilter} style={{ alignSelf: 'flex-start' }}><Icon><Close /></Icon>diff --git a/src/components/input/MenuButton.tsx b/src/components/input/MenuButton.tsxindex e3e3a3b53..b861577c7 100644--- a/src/components/input/MenuButton.tsx+++ b/src/components/input/MenuButton.tsx@@ -5,9 +5,11 @@ import { Ellipsis } from '@/components/icons';export function MenuButton({children,onAction,+ isDisabled,}: {children: ReactNode;onAction?: (action: string) => void;+ isDisabled?: boolean;}) {const handleAction = (key: Key) => {onAction?.(key.toString());@@ -15,7 +17,7 @@ export function MenuButton({return (<DialogTrigger>- <Button variant="quiet">+ <Button variant="quiet" isDisabled={isDisabled}><Icon><Ellipsis /></Icon>diff --git a/src/components/messages.ts b/src/components/messages.tsindex 6eaf743a6..c29820c19 100644--- a/src/components/messages.ts+++ b/src/components/messages.ts@@ -334,6 +334,7 @@ export const labels = defineMessages({firstClick: { id: 'label.first-click', defaultMessage: 'First click' },lastClick: { id: 'label.last-click', defaultMessage: 'Last click' },online: { id: 'label.online', defaultMessage: 'Online' },+ preferences: { id: 'label.preferences', defaultMessage: 'Preferences' },});export const messages = defineMessages({