From f3125c2add28ab04e460d835e64e3c52c78d2ced Mon Sep 17 00:00:00 2001 From: Francis Cao Date: Wed, 10 Sep 2025 16:38:51 -0700 Subject: [PATCH 1/2] clean up funnel migration and report errors --- .../14_add_link_and_pixel/migration.sql | 31 ++++++++++++++++--- src/queries/sql/reports/getFunnel.ts | 3 +- src/queries/sql/reports/getGoal.ts | 6 ++-- src/queries/sql/reports/getRevenue.ts | 2 +- 4 files changed, 31 insertions(+), 11 deletions(-) diff --git a/prisma/migrations/14_add_link_and_pixel/migration.sql b/prisma/migrations/14_add_link_and_pixel/migration.sql index 14feaa66a..29d9e300a 100644 --- a/prisma/migrations/14_add_link_and_pixel/migration.sql +++ b/prisma/migrations/14_add_link_and_pixel/migration.sql @@ -72,8 +72,29 @@ CREATE INDEX "pixel_team_id_idx" ON "pixel"("team_id"); -- CreateIndex CREATE INDEX "pixel_created_at_idx" ON "pixel"("created_at"); --- DataMigration -UPDATE "report" SET parameters = parameters - 'websiteId' - 'dateRange' WHERE type = 'funnel'; +-- DataMigration Funnel +DELETE FROM "report" WHERE type = 'funnel' and jsonb_array_length(parameters->'steps') = 1; +UPDATE "report" SET parameters = parameters - 'websiteId' - 'dateRange' - 'urls' WHERE type = 'funnel'; + +UPDATE "report" +SET parameters = jsonb_set( + parameters, + '{steps}', + ( + SELECT jsonb_agg( + CASE + WHEN step->>'type' = 'url' + THEN jsonb_set(step, '{type}', '"path"') + ELSE step + END + ) + FROM jsonb_array_elements(parameters->'steps') step + ) +) +WHERE type = 'funnel' + and parameters @> '{"steps":[{"type":"url"}]}'; + +-- DataMigration Goals UPDATE "report" SET type = 'goal' WHERE type = 'goals'; INSERT INTO "report" (report_id, user_id, website_id, type, name, description, parameters, created_at, updated_at) @@ -92,7 +113,7 @@ SELECT gen_random_uuid(), updated_at FROM "report" CROSS JOIN LATERAL jsonb_array_elements(parameters -> 'goals') elem -WHERE elem ->> 'type' IN ('event', 'url') - and type = 'goal'; +WHERE type = 'goal' + and elem ->> 'type' IN ('event', 'url'); -DELETE FROM "report" WHERE parameters ? 'goals' and type = 'goal'; \ No newline at end of file +DELETE FROM "report" WHERE type = 'goal' and parameters ? 'goals'; \ No newline at end of file diff --git a/src/queries/sql/reports/getFunnel.ts b/src/queries/sql/reports/getFunnel.ts index abc0dab31..a56439dbc 100644 --- a/src/queries/sql/reports/getFunnel.ts +++ b/src/queries/sql/reports/getFunnel.ts @@ -32,14 +32,13 @@ async function relationalQuery( ): Promise { const { startDate, endDate, window, steps } = parameters; const { rawQuery, getAddIntervalQuery, parseFilters } = prisma; - const { levelOneQuery, levelQuery, sumQuery, params } = getFunnelQuery(steps, window); - const { filterQuery, joinSessionQuery, cohortQuery, queryParams } = parseFilters({ ...filters, websiteId, startDate, endDate, }); + const { levelOneQuery, levelQuery, sumQuery, params } = getFunnelQuery(steps, window); function getFunnelQuery( steps: { type: string; value: string }[], diff --git a/src/queries/sql/reports/getGoal.ts b/src/queries/sql/reports/getGoal.ts index b00e362ec..81ec80abe 100644 --- a/src/queries/sql/reports/getGoal.ts +++ b/src/queries/sql/reports/getGoal.ts @@ -48,15 +48,15 @@ async function relationalQuery( from website_event ${cohortQuery} ${joinSessionQuery} - where website_id = {websiteId:UUID} + where website_id = {{websiteId::uuid}} ${dateQuery} ${filterQuery} ) as total from website_event ${cohortQuery} ${joinSessionQuery} - where website_id = {websiteId:UUID} - and ${column} = {value:String} + where website_id = {{websiteId::uuid}} + and ${column} = {{value}} ${dateQuery} ${filterQuery} `, diff --git a/src/queries/sql/reports/getRevenue.ts b/src/queries/sql/reports/getRevenue.ts index f5c652aa8..d73d90c23 100644 --- a/src/queries/sql/reports/getRevenue.ts +++ b/src/queries/sql/reports/getRevenue.ts @@ -75,7 +75,7 @@ async function relationalQuery( ` select session.country as name, - sum(r.revenue) value + sum(revenue) value from revenue join website_event on website_event.website_id = revenue.website_id From 67105f2cff299520daf44389be3d2d8709e94c51 Mon Sep 17 00:00:00 2001 From: Mike Cao Date: Wed, 10 Sep 2025 17:16:04 -0700 Subject: [PATCH 2/2] Updated packages. --- package.json | 12 +- pnpm-lock.yaml | 245 ++++++++++++++------------- prisma/schema.prisma | 6 +- src/app/(main)/teams/TeamsHeader.tsx | 13 +- 4 files changed, 143 insertions(+), 133 deletions(-) diff --git a/package.json b/package.json index d03a305a6..9112b3348 100644 --- a/package.json +++ b/package.json @@ -76,13 +76,13 @@ "@dicebear/core": "^9.2.3", "@fontsource/inter": "^5.2.6", "@hello-pangea/dnd": "^17.0.0", - "@prisma/adapter-pg": "^6.15.0", - "@prisma/client": "^6.15.0", + "@prisma/adapter-pg": "^6.16.0", + "@prisma/client": "^6.16.0", "@prisma/extension-read-replicas": "^0.4.1", "@react-spring/web": "^10.0.1", "@svgr/cli": "^8.1.0", "@tanstack/react-query": "^5.85.5", - "@umami/react-zen": "^0.180.0", + "@umami/react-zen": "^0.181.0", "@umami/redis-client": "^0.29.0", "bcryptjs": "^3.0.2", "chalk": "^5.6.0", @@ -110,14 +110,14 @@ "jsonwebtoken": "^9.0.2", "jszip": "^3.10.1", "kafkajs": "^2.1.0", - "lucide-react": "^0.542.0", + "lucide-react": "^0.543.0", "maxmind": "^5.0.0", - "next": "15.5.2", + "next": "15.5.3", "node-fetch": "^3.2.8", "npm-run-all": "^4.1.5", "papaparse": "^5.5.3", "pg": "^8.16.3", - "prisma": "6.15.0", + "prisma": "6.16.0", "pure-rand": "^7.0.1", "react": "^19.1.1", "react-dom": "^19.1.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6ff9ee7b8..f5176e1ca 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -27,14 +27,14 @@ importers: specifier: ^17.0.0 version: 17.0.0(@types/react@19.1.12)(react-dom@19.1.1(react@19.1.1))(react@19.1.1) '@prisma/adapter-pg': - specifier: ^6.15.0 - version: 6.15.0 + specifier: ^6.16.0 + version: 6.16.0 '@prisma/client': - specifier: ^6.15.0 - version: 6.15.0(prisma@6.15.0(typescript@5.9.2))(typescript@5.9.2) + specifier: ^6.16.0 + version: 6.16.0(prisma@6.16.0(typescript@5.9.2))(typescript@5.9.2) '@prisma/extension-read-replicas': specifier: ^0.4.1 - version: 0.4.1(@prisma/client@6.15.0(prisma@6.15.0(typescript@5.9.2))(typescript@5.9.2)) + version: 0.4.1(@prisma/client@6.16.0(prisma@6.16.0(typescript@5.9.2))(typescript@5.9.2)) '@react-spring/web': specifier: ^10.0.1 version: 10.0.1(react-dom@19.1.1(react@19.1.1))(react@19.1.1) @@ -45,8 +45,8 @@ importers: specifier: ^5.85.5 version: 5.85.5(react@19.1.1) '@umami/react-zen': - specifier: ^0.180.0 - version: 0.180.0(@babel/core@7.28.3)(@types/react@19.1.12)(babel-plugin-react-compiler@19.1.0-rc.2)(immer@10.1.1)(use-sync-external-store@1.5.0(react@19.1.1)) + specifier: ^0.181.0 + version: 0.181.0(@babel/core@7.28.3)(@types/react@19.1.12)(babel-plugin-react-compiler@19.1.0-rc.2)(immer@10.1.1)(use-sync-external-store@1.5.0(react@19.1.1)) '@umami/redis-client': specifier: ^0.29.0 version: 0.29.0 @@ -129,14 +129,14 @@ importers: specifier: ^2.1.0 version: 2.2.4 lucide-react: - specifier: ^0.542.0 - version: 0.542.0(react@19.1.1) + specifier: ^0.543.0 + version: 0.543.0(react@19.1.1) maxmind: specifier: ^5.0.0 version: 5.0.0 next: - specifier: 15.5.2 - version: 15.5.2(@babel/core@7.28.3)(babel-plugin-react-compiler@19.1.0-rc.2)(react-dom@19.1.1(react@19.1.1))(react@19.1.1) + specifier: 15.5.3 + version: 15.5.3(@babel/core@7.28.3)(babel-plugin-react-compiler@19.1.0-rc.2)(react-dom@19.1.1(react@19.1.1))(react@19.1.1) node-fetch: specifier: ^3.2.8 version: 3.3.2 @@ -150,8 +150,8 @@ importers: specifier: ^8.16.3 version: 8.16.3 prisma: - specifier: 6.15.0 - version: 6.15.0(typescript@5.9.2) + specifier: 6.16.0 + version: 6.16.0(typescript@5.9.2) pure-rand: specifier: ^7.0.1 version: 7.0.1 @@ -248,7 +248,7 @@ importers: version: 8.41.0(eslint@8.57.1)(typescript@5.9.2) '@umami/prisma-client': specifier: ^0.19.0 - version: 0.19.0(@prisma/adapter-pg@6.15.0)(@prisma/client@6.15.0(prisma@6.15.0(typescript@5.9.2))(typescript@5.9.2))(@prisma/extension-read-replicas@0.4.1(@prisma/client@6.15.0(prisma@6.15.0(typescript@5.9.2))(typescript@5.9.2))) + version: 0.19.0(@prisma/adapter-pg@6.16.0)(@prisma/client@6.16.0(prisma@6.16.0(typescript@5.9.2))(typescript@5.9.2))(@prisma/extension-read-replicas@0.4.1(@prisma/client@6.16.0(prisma@6.16.0(typescript@5.9.2))(typescript@5.9.2))) babel-plugin-react-compiler: specifier: 19.1.0-rc.2 version: 19.1.0-rc.2 @@ -364,6 +364,8 @@ importers: specifier: ^5.9.2 version: 5.9.2 + dist: {} + packages: '@ampproject/remapping@2.3.0': @@ -873,6 +875,9 @@ packages: '@emnapi/runtime@1.4.5': resolution: {integrity: sha512-++LApOtY0pEEz1zrd9vy1/zXVaVJJ/EbAF3u0fXIzPJEDtnITsBGbbK0EkM72amhl/R5b+5xx0Y/QhcVOpuulg==} + '@emnapi/runtime@1.5.0': + resolution: {integrity: sha512-97/BJ3iXHww3djw6hYIfErCZFee7qCtrneuLa20UXFCOTCfBM2cvQHjWJ2EG0s0MtdNwInarqCTz35i4wWXHsQ==} + '@emnapi/wasi-threads@1.0.4': resolution: {integrity: sha512-PJR+bOmMOPH8AtcTGAyYNiuJ3/Fcoj2XN/gBEWzDIKh254XO+mM9XoXHk5GNEhodxeMznbg7BlRojVbKN+gC6g==} @@ -1415,56 +1420,56 @@ packages: resolution: {integrity: sha512-b2Ic9NkNnnh0lKC/YWDZ2+HdLd/uYdBzLvLKYOkPyFt8KEszoC+Je3GRcwBeOLxaNtK8lji7YPIjtGz8K2sLVQ==} engines: {node: '>=18.0.0'} - '@next/env@15.5.2': - resolution: {integrity: sha512-Qe06ew4zt12LeO6N7j8/nULSOe3fMXE4dM6xgpBQNvdzyK1sv5y4oAP3bq4LamrvGCZtmRYnW8URFCeX5nFgGg==} + '@next/env@15.5.3': + resolution: {integrity: sha512-RSEDTRqyihYXygx/OJXwvVupfr9m04+0vH8vyy0HfZ7keRto6VX9BbEk0J2PUk0VGy6YhklJUSrgForov5F9pw==} '@next/eslint-plugin-next@14.2.32': resolution: {integrity: sha512-tyZMX8g4cWg/uPW4NxiJK13t62Pab47SKGJGVZJa6YtFwtfrXovH4j1n9tdpRdXW03PGQBugYEVGM7OhWfytdA==} - '@next/swc-darwin-arm64@15.5.2': - resolution: {integrity: sha512-8bGt577BXGSd4iqFygmzIfTYizHb0LGWqH+qgIF/2EDxS5JsSdERJKA8WgwDyNBZgTIIA4D8qUtoQHmxIIquoQ==} + '@next/swc-darwin-arm64@15.5.3': + resolution: {integrity: sha512-nzbHQo69+au9wJkGKTU9lP7PXv0d1J5ljFpvb+LnEomLtSbJkbZyEs6sbF3plQmiOB2l9OBtN2tNSvCH1nQ9Jg==} engines: {node: '>= 10'} cpu: [arm64] os: [darwin] - '@next/swc-darwin-x64@15.5.2': - resolution: {integrity: sha512-2DjnmR6JHK4X+dgTXt5/sOCu/7yPtqpYt8s8hLkHFK3MGkka2snTv3yRMdHvuRtJVkPwCGsvBSwmoQCHatauFQ==} + '@next/swc-darwin-x64@15.5.3': + resolution: {integrity: sha512-w83w4SkOOhekJOcA5HBvHyGzgV1W/XvOfpkrxIse4uPWhYTTRwtGEM4v/jiXwNSJvfRvah0H8/uTLBKRXlef8g==} engines: {node: '>= 10'} cpu: [x64] os: [darwin] - '@next/swc-linux-arm64-gnu@15.5.2': - resolution: {integrity: sha512-3j7SWDBS2Wov/L9q0mFJtEvQ5miIqfO4l7d2m9Mo06ddsgUK8gWfHGgbjdFlCp2Ek7MmMQZSxpGFqcC8zGh2AA==} + '@next/swc-linux-arm64-gnu@15.5.3': + resolution: {integrity: sha512-+m7pfIs0/yvgVu26ieaKrifV8C8yiLe7jVp9SpcIzg7XmyyNE7toC1fy5IOQozmr6kWl/JONC51osih2RyoXRw==} engines: {node: '>= 10'} cpu: [arm64] os: [linux] - '@next/swc-linux-arm64-musl@15.5.2': - resolution: {integrity: sha512-s6N8k8dF9YGc5T01UPQ08yxsK6fUow5gG1/axWc1HVVBYQBgOjca4oUZF7s4p+kwhkB1bDSGR8QznWrFZ/Rt5g==} + '@next/swc-linux-arm64-musl@15.5.3': + resolution: {integrity: sha512-u3PEIzuguSenoZviZJahNLgCexGFhso5mxWCrrIMdvpZn6lkME5vc/ADZG8UUk5K1uWRy4hqSFECrON6UKQBbQ==} engines: {node: '>= 10'} cpu: [arm64] os: [linux] - '@next/swc-linux-x64-gnu@15.5.2': - resolution: {integrity: sha512-o1RV/KOODQh6dM6ZRJGZbc+MOAHww33Vbs5JC9Mp1gDk8cpEO+cYC/l7rweiEalkSm5/1WGa4zY7xrNwObN4+Q==} + '@next/swc-linux-x64-gnu@15.5.3': + resolution: {integrity: sha512-lDtOOScYDZxI2BENN9m0pfVPJDSuUkAD1YXSvlJF0DKwZt0WlA7T7o3wrcEr4Q+iHYGzEaVuZcsIbCps4K27sA==} engines: {node: '>= 10'} cpu: [x64] os: [linux] - '@next/swc-linux-x64-musl@15.5.2': - resolution: {integrity: sha512-/VUnh7w8RElYZ0IV83nUcP/J4KJ6LLYliiBIri3p3aW2giF+PAVgZb6mk8jbQSB3WlTai8gEmCAr7kptFa1H6g==} + '@next/swc-linux-x64-musl@15.5.3': + resolution: {integrity: sha512-9vWVUnsx9PrY2NwdVRJ4dUURAQ8Su0sLRPqcCCxtX5zIQUBES12eRVHq6b70bbfaVaxIDGJN2afHui0eDm+cLg==} engines: {node: '>= 10'} cpu: [x64] os: [linux] - '@next/swc-win32-arm64-msvc@15.5.2': - resolution: {integrity: sha512-sMPyTvRcNKXseNQ/7qRfVRLa0VhR0esmQ29DD6pqvG71+JdVnESJaHPA8t7bc67KD5spP3+DOCNLhqlEI2ZgQg==} + '@next/swc-win32-arm64-msvc@15.5.3': + resolution: {integrity: sha512-1CU20FZzY9LFQigRi6jM45oJMU3KziA5/sSG+dXeVaTm661snQP6xu3ykGxxwU5sLG3sh14teO/IOEPVsQMRfA==} engines: {node: '>= 10'} cpu: [arm64] os: [win32] - '@next/swc-win32-x64-msvc@15.5.2': - resolution: {integrity: sha512-W5VvyZHnxG/2ukhZF/9Ikdra5fdNftxI6ybeVKYvBPDtyx7x4jPPSNduUkfH5fo3zG0JQ0bPxgy41af2JX5D4Q==} + '@next/swc-win32-x64-msvc@15.5.3': + resolution: {integrity: sha512-JMoLAq3n3y5tKXPQwCK5c+6tmwkuFDa2XAxz8Wm4+IVthdBZdZGh+lmiLUHg9f9IDwIQpUjp+ysd6OkYTyZRZw==} engines: {node: '>= 10'} cpu: [x64] os: [win32] @@ -1493,11 +1498,11 @@ packages: resolution: {integrity: sha512-QNqXyfVS2wm9hweSYD2O7F0G06uurj9kZ96TRQE5Y9hU7+tgdZwIkbAKc5Ocy1HxEY2kuDQa6cQ1WRs/O5LFKA==} engines: {node: ^12.20.0 || ^14.18.0 || >=16.0.0} - '@prisma/adapter-pg@6.15.0': - resolution: {integrity: sha512-UDqysvOwrSLUDgSnLOKPmTvIrXhod5bMOBwb4GzSR/b6qqSO/SEb3Fq2ddGi1hZt6fAOSp+sXmdaQBy5Sakvkw==} + '@prisma/adapter-pg@6.16.0': + resolution: {integrity: sha512-zNMQyIrkcVFMYFuVeO9GhK9dc5kMSvqwqL+pNMM9oK4+mj7HcKws780ZXhAgV149kcg2kDisHPHO5nE4gkG+oA==} - '@prisma/client@6.15.0': - resolution: {integrity: sha512-wR2LXUbOH4cL/WToatI/Y2c7uzni76oNFND7+23ypLllBmIS8e3ZHhO+nud9iXSXKFt1SoM3fTZvHawg63emZw==} + '@prisma/client@6.16.0': + resolution: {integrity: sha512-FYkFJtgwpwJRMxtmrB26y7gtpR372kyChw6lWng5TMmvn5V+uisy0OyllO5EJD1s8lX78V8X3XjhiXOoMLnu3w==} engines: {node: '>=18.18'} peerDependencies: prisma: '*' @@ -1508,31 +1513,31 @@ packages: typescript: optional: true - '@prisma/config@6.15.0': - resolution: {integrity: sha512-KMEoec9b2u6zX0EbSEx/dRpx1oNLjqJEBZYyK0S3TTIbZ7GEGoVyGyFRk4C72+A38cuPLbfQGQvgOD+gBErKlA==} + '@prisma/config@6.16.0': + resolution: {integrity: sha512-Q9TgfnllVehvQziY9lJwRJLGmziX0OimZUEQ/MhCUBoJMSScj2VivCjw/Of2vlO1FfyaHXxrvjZAr7ASl7DVcw==} - '@prisma/debug@6.15.0': - resolution: {integrity: sha512-y7cSeLuQmyt+A3hstAs6tsuAiVXSnw9T55ra77z0nbNkA8Lcq9rNcQg6PI00by/+WnE/aMRJ/W7sZWn2cgIy1g==} + '@prisma/debug@6.16.0': + resolution: {integrity: sha512-bxzro5vbVqAPkWyDs2A6GpQtRZunD8tyrLmSAchx9u0b+gWCDY6eV+oh5A0YtYT9245dIxQBswckayHuJG4u3w==} - '@prisma/driver-adapter-utils@6.15.0': - resolution: {integrity: sha512-tzcMG1eEBM3IJ8TBHo4jGeoUaalctqGXbrvxIoZb8jSEtgR82IUhdVyHHLVTlT8MdrHovcQJJ3jfcQfJARRnaQ==} + '@prisma/driver-adapter-utils@6.16.0': + resolution: {integrity: sha512-dsRHvEnifJ3xqpMKGBy1jRwR8yc+7Ko4TcHrdTQJIfq6NYN2gNoOf0k91hcbzs5AH19wDxjuHXCveklWq5AJdA==} - '@prisma/engines-version@6.15.0-5.85179d7826409ee107a6ba334b5e305ae3fba9fb': - resolution: {integrity: sha512-a/46aK5j6L3ePwilZYEgYDPrhBQ/n4gYjLxT5YncUTJJNRnTCVjPF86QdzUOLRdYjCLfhtZp9aum90W0J+trrg==} + '@prisma/engines-version@6.16.0-7.1c57fdcd7e44b29b9313256c76699e91c3ac3c43': + resolution: {integrity: sha512-ThvlDaKIVrnrv97ujNFDYiQbeMQpLa0O86HFA2mNoip4mtFqM7U5GSz2ie1i2xByZtvPztJlNRgPsXGeM/kqAA==} - '@prisma/engines@6.15.0': - resolution: {integrity: sha512-opITiR5ddFJ1N2iqa7mkRlohCZqVSsHhRcc29QXeldMljOf4FSellLT0J5goVb64EzRTKcIDeIsJBgmilNcKxA==} + '@prisma/engines@6.16.0': + resolution: {integrity: sha512-RHJGCH/zi017W4CWYWqg0Sv1pquGGFVo8T3auJ9sodDNaiRzbeNldydjaQzszVS8nscdtcvLuJzy7e65C3puqQ==} '@prisma/extension-read-replicas@0.4.1': resolution: {integrity: sha512-mCMDloqUKUwx2o5uedTs1FHX3Nxdt1GdRMoeyp1JggjiwOALmIYWhxfIN08M2BZ0w8SKwvJqicJZMjkQYkkijw==} peerDependencies: '@prisma/client': ^6.5.0 - '@prisma/fetch-engine@6.15.0': - resolution: {integrity: sha512-xcT5f6b+OWBq6vTUnRCc7qL+Im570CtwvgSj+0MTSGA1o9UDSKZ/WANvwtiRXdbYWECpyC3CukoG3A04VTAPHw==} + '@prisma/fetch-engine@6.16.0': + resolution: {integrity: sha512-Mx5rml0XRIDizhB9eZxSP8c0nMoXYVITTiJJwxlWn9rNCel8mG8NAqIw+vJlN3gPR+kt3IBkP1SQVsplPPpYrA==} - '@prisma/get-platform@6.15.0': - resolution: {integrity: sha512-Jbb+Xbxyp05NSR1x2epabetHiXvpO8tdN2YNoWoA/ZsbYyxxu/CO/ROBauIFuMXs3Ti+W7N7SJtWsHGaWte9Rg==} + '@prisma/get-platform@6.16.0': + resolution: {integrity: sha512-eaJOOvAoGslSUTjiQrtE9E0hoBdfL43j8SymOGD6LbdrKRNtIoiy6qiBaEr2fNYD+R/Qns7QOwPhl7SVHJayKA==} '@react-aria/autocomplete@3.0.0-rc.1': resolution: {integrity: sha512-4/+XHkCq9nkC0TNfgPsbuMTu3iwM6Gz4j67rTQRMXrWwCTAqAHJJEmDz/YDt/04Rg+dkGPsauHHMqDxwxZV24Q==} @@ -2730,8 +2735,8 @@ packages: '@prisma/client': ^6.1.0 '@prisma/extension-read-replicas': ^0.4.1 - '@umami/react-zen@0.180.0': - resolution: {integrity: sha512-/kkSeJ/D3WeW577Jb4W0/P6eBjWfGn6E4GHYS0W3K1RgNScz46bEcZe2HJc/l/ssiNoQcSE0vt63t0dUzUaqMQ==} + '@umami/react-zen@0.181.0': + resolution: {integrity: sha512-Hs5dXPWVOtgHwAksolVTZw8n8EucHq+Xj+++a6RpfzHix3m2sWQXo1qNwd11GasxytqDf6JSxETj109LCUJiSA==} '@umami/redis-client@0.29.0': resolution: {integrity: sha512-Jaqh++jskqDB7ny75pfC02OvKp1JTS4asGDsFrRL3qy8sxL3PAl9+/mybCJe4/6vWrXDJKqpgkSfUDJq2bFjyw==} @@ -3199,11 +3204,8 @@ packages: caniuse-lite@1.0.30001735: resolution: {integrity: sha512-EV/laoX7Wq2J9TQlyIXRxTJqIw4sxfXS4OYgudGxBYRuTv0q7AM6yMEpU/Vo1I94thg9U6EZ2NfZx9GJq83u7w==} - caniuse-lite@1.0.30001737: - resolution: {integrity: sha512-BiloLiXtQNrY5UyF0+1nSJLXUENuhka2pzy2Fx5pGxqavdrxSCW4U6Pn/PoG3Efspi2frRbHpBV2XsrPE6EDlw==} - - caniuse-lite@1.0.30001739: - resolution: {integrity: sha512-y+j60d6ulelrNSwpPyrHdl+9mJnQzHBr08xm48Qno0nSk4h3Qojh+ziv2qE6rXf4k3tadF4o1J/1tAbVm1NtnA==} + caniuse-lite@1.0.30001741: + resolution: {integrity: sha512-QGUGitqsc8ARjLdgAfxETDhRbJ0REsP6O3I96TAth/mVjh2cYzN2u+3AzPP3aVSm2FehEItaJw1xd+IGBXWeSw==} caseless@0.12.0: resolution: {integrity: sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==} @@ -5235,8 +5237,8 @@ packages: peerDependencies: react: ^16.5.1 || ^17.0.0 || ^18.0.0 || ^19.0.0 - lucide-react@0.542.0: - resolution: {integrity: sha512-w3hD8/SQB7+lzU2r4VdFyzzOzKnUjTZIF/MQJGSSvni7Llewni4vuViRppfRAa2guOsY5k4jZyxw/i9DQHv+dw==} + lucide-react@0.543.0: + resolution: {integrity: sha512-fpVfuOQO0V3HBaOA1stIiP/A2fPCXHIleRZL16Mx3HmjTYwNSbimhnFBygs2CAfU1geexMX5ItUcWBGUaqw5CA==} peerDependencies: react: ^16.5.1 || ^17.0.0 || ^18.0.0 || ^19.0.0 @@ -5419,8 +5421,8 @@ packages: neo-async@2.6.2: resolution: {integrity: sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==} - next@15.5.2: - resolution: {integrity: sha512-H8Otr7abj1glFhbGnvUt3gz++0AF1+QoCXEBmd/6aKbfdFwrn0LpA836Ed5+00va/7HQSDD+mOoVhn3tNy3e/Q==} + next@15.5.3: + resolution: {integrity: sha512-r/liNAx16SQj4D+XH/oI1dlpv9tdKJ6cONYPwwcCC46f2NjpaRWY+EKCzULfgQYV6YKXjHBchff2IZBSlZmJNw==} engines: {node: ^18.18.0 || ^19.8.0 || >= 20.0.0} hasBin: true peerDependencies: @@ -6232,8 +6234,8 @@ packages: resolution: {integrity: sha512-D1tKtYvByrBkFLe2wHJl2bwMJIiT8rW+XA+TiataH79/FszLQMrpGEvzUVkzPau7OCO0Qnrhpe87PqtOAIB8Yw==} engines: {node: ^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0} - prisma@6.15.0: - resolution: {integrity: sha512-E6RCgOt+kUVtjtZgLQDBJ6md2tDItLJNExwI0XJeBc1FKL+Vwb+ovxXxuok9r8oBgsOXBA33fGDuE/0qDdCWqQ==} + prisma@6.16.0: + resolution: {integrity: sha512-TTh+H1Kw8N68KN9cDzdAyMroqMOvdCO/Z+kS2wKEVYR1nuR21qH5Q/Db/bZHsAgw7l/TPHtM/veG5VABcdwPDw==} engines: {node: '>=18.18'} hasBin: true peerDependencies: @@ -7945,6 +7947,11 @@ snapshots: tslib: 2.8.1 optional: true + '@emnapi/runtime@1.5.0': + dependencies: + tslib: 2.8.1 + optional: true + '@emnapi/wasi-threads@1.0.4': dependencies: tslib: 2.8.1 @@ -8265,7 +8272,7 @@ snapshots: '@img/sharp-wasm32@0.34.3': dependencies: - '@emnapi/runtime': 1.4.5 + '@emnapi/runtime': 1.5.0 optional: true '@img/sharp-win32-arm64@0.34.3': @@ -8543,34 +8550,34 @@ snapshots: '@netlify/plugin-nextjs@5.12.1': {} - '@next/env@15.5.2': {} + '@next/env@15.5.3': {} '@next/eslint-plugin-next@14.2.32': dependencies: glob: 10.3.10 - '@next/swc-darwin-arm64@15.5.2': + '@next/swc-darwin-arm64@15.5.3': optional: true - '@next/swc-darwin-x64@15.5.2': + '@next/swc-darwin-x64@15.5.3': optional: true - '@next/swc-linux-arm64-gnu@15.5.2': + '@next/swc-linux-arm64-gnu@15.5.3': optional: true - '@next/swc-linux-arm64-musl@15.5.2': + '@next/swc-linux-arm64-musl@15.5.3': optional: true - '@next/swc-linux-x64-gnu@15.5.2': + '@next/swc-linux-x64-gnu@15.5.3': optional: true - '@next/swc-linux-x64-musl@15.5.2': + '@next/swc-linux-x64-musl@15.5.3': optional: true - '@next/swc-win32-arm64-msvc@15.5.2': + '@next/swc-win32-arm64-msvc@15.5.3': optional: true - '@next/swc-win32-x64-msvc@15.5.2': + '@next/swc-win32-x64-msvc@15.5.3': optional: true '@nodelib/fs.scandir@2.1.5': @@ -8592,20 +8599,20 @@ snapshots: '@pkgr/core@0.2.9': {} - '@prisma/adapter-pg@6.15.0': + '@prisma/adapter-pg@6.16.0': dependencies: - '@prisma/driver-adapter-utils': 6.15.0 + '@prisma/driver-adapter-utils': 6.16.0 pg: 8.16.3 postgres-array: 3.0.4 transitivePeerDependencies: - pg-native - '@prisma/client@6.15.0(prisma@6.15.0(typescript@5.9.2))(typescript@5.9.2)': + '@prisma/client@6.16.0(prisma@6.16.0(typescript@5.9.2))(typescript@5.9.2)': optionalDependencies: - prisma: 6.15.0(typescript@5.9.2) + prisma: 6.16.0(typescript@5.9.2) typescript: 5.9.2 - '@prisma/config@6.15.0': + '@prisma/config@6.16.0': dependencies: c12: 3.1.0 deepmerge-ts: 7.1.5 @@ -8614,34 +8621,34 @@ snapshots: transitivePeerDependencies: - magicast - '@prisma/debug@6.15.0': {} + '@prisma/debug@6.16.0': {} - '@prisma/driver-adapter-utils@6.15.0': + '@prisma/driver-adapter-utils@6.16.0': dependencies: - '@prisma/debug': 6.15.0 + '@prisma/debug': 6.16.0 - '@prisma/engines-version@6.15.0-5.85179d7826409ee107a6ba334b5e305ae3fba9fb': {} + '@prisma/engines-version@6.16.0-7.1c57fdcd7e44b29b9313256c76699e91c3ac3c43': {} - '@prisma/engines@6.15.0': + '@prisma/engines@6.16.0': dependencies: - '@prisma/debug': 6.15.0 - '@prisma/engines-version': 6.15.0-5.85179d7826409ee107a6ba334b5e305ae3fba9fb - '@prisma/fetch-engine': 6.15.0 - '@prisma/get-platform': 6.15.0 + '@prisma/debug': 6.16.0 + '@prisma/engines-version': 6.16.0-7.1c57fdcd7e44b29b9313256c76699e91c3ac3c43 + '@prisma/fetch-engine': 6.16.0 + '@prisma/get-platform': 6.16.0 - '@prisma/extension-read-replicas@0.4.1(@prisma/client@6.15.0(prisma@6.15.0(typescript@5.9.2))(typescript@5.9.2))': + '@prisma/extension-read-replicas@0.4.1(@prisma/client@6.16.0(prisma@6.16.0(typescript@5.9.2))(typescript@5.9.2))': dependencies: - '@prisma/client': 6.15.0(prisma@6.15.0(typescript@5.9.2))(typescript@5.9.2) + '@prisma/client': 6.16.0(prisma@6.16.0(typescript@5.9.2))(typescript@5.9.2) - '@prisma/fetch-engine@6.15.0': + '@prisma/fetch-engine@6.16.0': dependencies: - '@prisma/debug': 6.15.0 - '@prisma/engines-version': 6.15.0-5.85179d7826409ee107a6ba334b5e305ae3fba9fb - '@prisma/get-platform': 6.15.0 + '@prisma/debug': 6.16.0 + '@prisma/engines-version': 6.16.0-7.1c57fdcd7e44b29b9313256c76699e91c3ac3c43 + '@prisma/get-platform': 6.16.0 - '@prisma/get-platform@6.15.0': + '@prisma/get-platform@6.16.0': dependencies: - '@prisma/debug': 6.15.0 + '@prisma/debug': 6.16.0 '@react-aria/autocomplete@3.0.0-rc.1(react-dom@19.1.1(react@19.1.1))(react@19.1.1)': dependencies: @@ -10306,17 +10313,17 @@ snapshots: '@typescript-eslint/types': 8.41.0 eslint-visitor-keys: 4.2.1 - '@umami/prisma-client@0.19.0(@prisma/adapter-pg@6.15.0)(@prisma/client@6.15.0(prisma@6.15.0(typescript@5.9.2))(typescript@5.9.2))(@prisma/extension-read-replicas@0.4.1(@prisma/client@6.15.0(prisma@6.15.0(typescript@5.9.2))(typescript@5.9.2)))': + '@umami/prisma-client@0.19.0(@prisma/adapter-pg@6.16.0)(@prisma/client@6.16.0(prisma@6.16.0(typescript@5.9.2))(typescript@5.9.2))(@prisma/extension-read-replicas@0.4.1(@prisma/client@6.16.0(prisma@6.16.0(typescript@5.9.2))(typescript@5.9.2)))': dependencies: - '@prisma/adapter-pg': 6.15.0 - '@prisma/client': 6.15.0(prisma@6.15.0(typescript@5.9.2))(typescript@5.9.2) - '@prisma/extension-read-replicas': 0.4.1(@prisma/client@6.15.0(prisma@6.15.0(typescript@5.9.2))(typescript@5.9.2)) + '@prisma/adapter-pg': 6.16.0 + '@prisma/client': 6.16.0(prisma@6.16.0(typescript@5.9.2))(typescript@5.9.2) + '@prisma/extension-read-replicas': 0.4.1(@prisma/client@6.16.0(prisma@6.16.0(typescript@5.9.2))(typescript@5.9.2)) chalk: 4.1.2 debug: 4.4.1(supports-color@8.1.1) transitivePeerDependencies: - supports-color - '@umami/react-zen@0.180.0(@babel/core@7.28.3)(@types/react@19.1.12)(babel-plugin-react-compiler@19.1.0-rc.2)(immer@10.1.1)(use-sync-external-store@1.5.0(react@19.1.1))': + '@umami/react-zen@0.181.0(@babel/core@7.28.3)(@types/react@19.1.12)(babel-plugin-react-compiler@19.1.0-rc.2)(immer@10.1.1)(use-sync-external-store@1.5.0(react@19.1.1))': dependencies: '@fontsource/jetbrains-mono': 5.2.6 '@internationalized/date': 3.9.0 @@ -10326,7 +10333,7 @@ snapshots: glob: 10.4.5 highlight.js: 11.11.1 lucide-react: 0.511.0(react@19.1.1) - next: 15.5.2(@babel/core@7.28.3)(babel-plugin-react-compiler@19.1.0-rc.2)(react-dom@19.1.1(react@19.1.1))(react@19.1.1) + next: 15.5.3(@babel/core@7.28.3)(babel-plugin-react-compiler@19.1.0-rc.2)(react-dom@19.1.1(react@19.1.1))(react@19.1.1) react: 19.1.1 react-aria-components: 1.12.1(react-dom@19.1.1(react@19.1.1))(react@19.1.1) react-dom: 19.1.1(react@19.1.1) @@ -10853,15 +10860,13 @@ snapshots: caniuse-api@3.0.0: dependencies: browserslist: 4.25.2 - caniuse-lite: 1.0.30001739 + caniuse-lite: 1.0.30001741 lodash.memoize: 4.1.2 lodash.uniq: 4.5.0 caniuse-lite@1.0.30001735: {} - caniuse-lite@1.0.30001737: {} - - caniuse-lite@1.0.30001739: {} + caniuse-lite@1.0.30001741: {} caseless@0.12.0: {} @@ -13347,7 +13352,7 @@ snapshots: dependencies: react: 19.1.1 - lucide-react@0.542.0(react@19.1.1): + lucide-react@0.543.0(react@19.1.1): dependencies: react: 19.1.1 @@ -13520,24 +13525,24 @@ snapshots: neo-async@2.6.2: {} - next@15.5.2(@babel/core@7.28.3)(babel-plugin-react-compiler@19.1.0-rc.2)(react-dom@19.1.1(react@19.1.1))(react@19.1.1): + next@15.5.3(@babel/core@7.28.3)(babel-plugin-react-compiler@19.1.0-rc.2)(react-dom@19.1.1(react@19.1.1))(react@19.1.1): dependencies: - '@next/env': 15.5.2 + '@next/env': 15.5.3 '@swc/helpers': 0.5.15 - caniuse-lite: 1.0.30001737 + caniuse-lite: 1.0.30001741 postcss: 8.4.31 react: 19.1.1 react-dom: 19.1.1(react@19.1.1) styled-jsx: 5.1.6(@babel/core@7.28.3)(react@19.1.1) optionalDependencies: - '@next/swc-darwin-arm64': 15.5.2 - '@next/swc-darwin-x64': 15.5.2 - '@next/swc-linux-arm64-gnu': 15.5.2 - '@next/swc-linux-arm64-musl': 15.5.2 - '@next/swc-linux-x64-gnu': 15.5.2 - '@next/swc-linux-x64-musl': 15.5.2 - '@next/swc-win32-arm64-msvc': 15.5.2 - '@next/swc-win32-x64-msvc': 15.5.2 + '@next/swc-darwin-arm64': 15.5.3 + '@next/swc-darwin-x64': 15.5.3 + '@next/swc-linux-arm64-gnu': 15.5.3 + '@next/swc-linux-arm64-musl': 15.5.3 + '@next/swc-linux-x64-gnu': 15.5.3 + '@next/swc-linux-x64-musl': 15.5.3 + '@next/swc-win32-arm64-msvc': 15.5.3 + '@next/swc-win32-x64-msvc': 15.5.3 babel-plugin-react-compiler: 19.1.0-rc.2 sharp: 0.34.3 transitivePeerDependencies: @@ -14310,10 +14315,10 @@ snapshots: ansi-styles: 5.2.0 react-is: 18.3.1 - prisma@6.15.0(typescript@5.9.2): + prisma@6.16.0(typescript@5.9.2): dependencies: - '@prisma/config': 6.15.0 - '@prisma/engines': 6.15.0 + '@prisma/config': 6.16.0 + '@prisma/engines': 6.16.0 optionalDependencies: typescript: 5.9.2 transitivePeerDependencies: diff --git a/prisma/schema.prisma b/prisma/schema.prisma index 7c45d5ffa..aeb11648d 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -1,7 +1,7 @@ generator client { - provider = "prisma-client" - previewFeatures = ["driverAdapters", "queryCompiler"] - output = "../src/generated/prisma" + provider = "prisma-client" + output = "../src/generated/prisma" + engineType = "client" } datasource db { diff --git a/src/app/(main)/teams/TeamsHeader.tsx b/src/app/(main)/teams/TeamsHeader.tsx index f7d7e5203..47de97a1d 100644 --- a/src/app/(main)/teams/TeamsHeader.tsx +++ b/src/app/(main)/teams/TeamsHeader.tsx @@ -1,19 +1,24 @@ import { Row } from '@umami/react-zen'; import { PageHeader } from '@/components/common/PageHeader'; import { ROLES } from '@/lib/constants'; -import { useConfig, useLoginQuery, useMessages } from '@/components/hooks'; +import { useLoginQuery, useMessages } from '@/components/hooks'; import { TeamsJoinButton } from './TeamsJoinButton'; import { TeamsAddButton } from './TeamsAddButton'; -export function TeamsHeader({ allowCreate = true }: { allowCreate?: boolean }) { +export function TeamsHeader({ + allowCreate = true, + allowJoin = true, +}: { + allowCreate?: boolean; + allowJoin: boolean; +}) { const { formatMessage, labels } = useMessages(); const { user } = useLoginQuery(); - const { cloudMode } = useConfig(); return ( - {!cloudMode && } + {allowJoin && user.role !== ROLES.viewOnly && } {allowCreate && user.role !== ROLES.viewOnly && }