Updated prisma.

This commit is contained in:
Mike Cao 2025-11-21 21:35:11 -08:00
parent b45971da33
commit b9d52af215
13 changed files with 493 additions and 167 deletions

View file

@ -1,13 +1,13 @@
'use client';
import { Grid, Loading, Column, Row } from '@umami/react-zen';
import { Column, Grid, Loading, Row } from '@umami/react-zen';
import Script from 'next/script';
import { UpdateNotice } from './UpdateNotice';
import { SideNav } from '@/app/(main)/SideNav';
import { useLoginQuery, useConfig, useNavigation } from '@/components/hooks';
import { MobileNav } from '@/app/(main)/MobileNav';
import { useEffect } from 'react';
import { removeItem, setItem } from '@/lib/storage';
import { MobileNav } from '@/app/(main)/MobileNav';
import { SideNav } from '@/app/(main)/SideNav';
import { useConfig, useLoginQuery, useNavigation } from '@/components/hooks';
import { LAST_TEAM_CONFIG } from '@/lib/constants';
import { removeItem, setItem } from '@/lib/storage';
import { UpdateNotice } from './UpdateNotice';
export function App({ children }) {
const { user, isLoading, error } = useLoginQuery();
@ -27,7 +27,9 @@ export function App({ children }) {
}
if (error) {
window.location.href = `${process.env.basePath || ''}/login`;
window.location.href = config.cloudMode
? `${process.env.cloudUrl}/login`
: `${process.env.basePath || ''}/login`;
return null;
}

View file

@ -208,7 +208,7 @@
.start:before,
.end:before {
content: '';
content: "";
position: absolute;
border-radius: 100%;
border: 3px solid var(--journey-line-color);

View file

@ -137,11 +137,6 @@ export function MetricLabel({ type, data }: MetricLabelProps) {
return formatValue(label, 'language');
default:
return (
<FilterLink
type={type}
value={label}
/>
);
return <FilterLink type={type} value={label} />;
}
}

View file

@ -14,23 +14,21 @@ describe('renderNumberLabels', () => {
expect(renderNumberLabels(input)).toBe(expected);
});
test.each([['12500', '12.5k']])(
"formats numbers ≥ 10K as 'X.Xk' (%s → %s)",
(input, expected) => {
expect(renderNumberLabels(input)).toBe(expected);
},
);
test.each([
['12500', '12.5k'],
])("formats numbers ≥ 10K as 'X.Xk' (%s → %s)", (input, expected) => {
expect(renderNumberLabels(input)).toBe(expected);
});
test.each([['1500', '1.50k']])("formats numbers ≥ 1K as 'X.XXk' (%s → %s)", (input, expected) => {
expect(renderNumberLabels(input)).toBe(expected);
});
test.each([['999', '999']])(
'calls formatNumber for values < 1000 (%s → %s)',
(input, expected) => {
expect(renderNumberLabels(input)).toBe(expected);
},
);
test.each([
['999', '999'],
])('calls formatNumber for values < 1000 (%s → %s)', (input, expected) => {
expect(renderNumberLabels(input)).toBe(expected);
});
test.each([
['0', '0'],

View file

@ -1,10 +1,10 @@
import debug from 'debug';
import { PrismaPg } from '@prisma/adapter-pg';
import { readReplicas } from '@prisma/extension-read-replicas';
import debug from 'debug';
import { PrismaClient } from '@/generated/prisma/client';
import { SESSION_COLUMNS, OPERATORS, DEFAULT_PAGE_SIZE, FILTER_COLUMNS } from './constants';
import { QueryOptions, QueryFilters, Operator } from './types';
import { DEFAULT_PAGE_SIZE, FILTER_COLUMNS, OPERATORS, SESSION_COLUMNS } from './constants';
import { filtersObjectToArray } from './params';
import type { Operator, QueryFilters, QueryOptions } from './types';
const log = debug('umami:prisma');

View file

@ -1,6 +1,6 @@
import { Prisma } from '@/generated/prisma/client';
import type { Prisma } from '@/generated/prisma/client';
import prisma from '@/lib/prisma';
import { QueryFilters } from '@/lib/types';
import type { QueryFilters } from '@/lib/types';
export async function findPixel(criteria: Prisma.PixelFindUniqueArgs) {
return prisma.client.pixel.findUnique(criteria);

View file

@ -8,7 +8,7 @@ body {
min-height: 100vh;
}
html[style*='padding-right'] {
html[style*="padding-right"] {
padding-right: 0 !important;
}