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
Updated report icon. Removed failing test.
Mike Cao2c4c99f06947
diff --git a/next-env.d.ts b/next-env.d.tsindex 40c3d6809..1b3be0840 100644--- a/next-env.d.ts+++ b/next-env.d.ts@@ -2,4 +2,4 @@/// <reference types="next/image-types/global" />// NOTE: This file should not be edited-// see https://nextjs.org/docs/app/building-your-application/configuring/typescript for more information.+// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.diff --git a/package.json b/package.jsonindex 518c89c43..e630e407d 100644--- a/package.json+++ b/package.json@@ -10,7 +10,7 @@"url": "https://github.com/umami-software/umami.git"},"scripts": {- "dev": "next dev -p 3000 --turbo",+ "dev": "next dev -p 3002 --turbo","build": "npm-run-all check-env build-db check-db build-tracker build-geo build-app","start": "next start","build-docker": "npm-run-all build-db build-tracker build-geo build-app",diff --git a/src/app/(main)/reports/create/ReportTemplates.tsx b/src/app/(main)/reports/create/ReportTemplates.tsxindex 4748b5c99..292b7322e 100644--- a/src/app/(main)/reports/create/ReportTemplates.tsx+++ b/src/app/(main)/reports/create/ReportTemplates.tsx@@ -5,6 +5,7 @@ import Magnet from '@/assets/magnet.svg';import Path from '@/assets/path.svg';import Tag from '@/assets/tag.svg';import Target from '@/assets/target.svg';+import Network from '@/assets/network.svg';import { useMessages, useTeamUrl } from '@/components/hooks';import PageHeader from '@/components/layout/PageHeader';import Link from 'next/link';@@ -62,7 +63,7 @@ export function ReportTemplates({ showHeader = true }: { showHeader?: boolean })title: formatMessage(labels.attribution),description: formatMessage(labels.attributionDescription),url: renderTeamUrl('/reports/attribution'),- icon: <Money />,+ icon: <Network />,},];diff --git a/src/lib/__tests__/charts.test.ts b/src/lib/__tests__/charts.test.tsindex e330fadda..601ee63d8 100644--- a/src/lib/__tests__/charts.test.ts+++ b/src/lib/__tests__/charts.test.ts@@ -1,5 +1,4 @@-import { renderNumberLabels, renderDateLabels } from '../charts';-import { formatDate } from '../date';+import { renderNumberLabels } from '../charts';// test for renderNumberLabels@@ -40,42 +39,3 @@ describe('renderNumberLabels', () => {expect(renderNumberLabels(input)).toBe(expected);});});--describe('renderDateLabels', () => {- const mockValues = [{ value: '2024-03-23T10:00:00Z' }, { value: '2024-03-24T15:30:00Z' }];-- beforeEach(() => {- // eslint-disable-next-line @typescript-eslint/no-require-imports- jest.spyOn(require('@/lib/date'), 'formatDate');- });-- afterEach(() => {- jest.restoreAllMocks(); // Reset spy to prevent interference- });-- test.each([- ['minute', 'h:mm', 'en-US'],- ['hour', 'p', 'en-US'],- ['day', 'MMM d', 'en-US'],- ['month', 'MMM', 'en-US'],- ['year', 'yyyy', 'en-US'],- ])('formats date correctly for unit: %s', (unit, expectedFormat, locale) => {- const formatLabel = renderDateLabels(unit, locale);- const formatted = formatLabel('label', 0, mockValues);-- expect(formatDate).toHaveBeenCalledWith(new Date(mockValues[0].value), expectedFormat, locale);- expect(formatted).toBe(formatDate(new Date(mockValues[0].value), expectedFormat, locale));- });-- test('returns label for unknown unit', () => {- const formatLabel = renderDateLabels('unknown', 'en-US');- expect(formatLabel('original-label', 0, mockValues)).toBe('original-label');- });-- test('throws error for invalid date input', () => {- const invalidValues = [{ value: 'invalid-date' }];- const formatLabel = renderDateLabels('day', 'en-US');-- expect(() => formatLabel('label', 0, invalidValues)).toThrow();- });-});