From 4b67d10f045337bebb0c9569c8f101de38e86220 Mon Sep 17 00:00:00 2001 From: Mike Cao Date: Sat, 1 Jun 2024 14:06:17 -0700 Subject: [PATCH] Fixed teams urls. --- .../(main)/reports/[reportId]/ReportHeader.tsx | 2 +- .../teams/[teamId]/reports/goals/page.tsx | 3 --- src/app/(main)/websites/WebsitesPage.tsx | 5 ++++- src/app/(main)/websites/page.tsx | 4 ++-- src/components/common/Favicon.module.css | 3 --- src/components/common/Favicon.tsx | 3 --- src/components/metrics/ReferrersTable.tsx | 18 ++++++++---------- .../analytics/sessions/getSessionStats.ts | 4 ++-- 8 files changed, 17 insertions(+), 25 deletions(-) delete mode 100644 src/app/(main)/teams/[teamId]/reports/goals/page.tsx delete mode 100644 src/components/common/Favicon.module.css diff --git a/src/app/(main)/reports/[reportId]/ReportHeader.tsx b/src/app/(main)/reports/[reportId]/ReportHeader.tsx index 2936d806..7ab80fcd 100644 --- a/src/app/(main)/reports/[reportId]/ReportHeader.tsx +++ b/src/app/(main)/reports/[reportId]/ReportHeader.tsx @@ -60,7 +60,7 @@ export function ReportHeader({ icon }) {
REPORT_TYPES[key] === report?.type)], diff --git a/src/app/(main)/teams/[teamId]/reports/goals/page.tsx b/src/app/(main)/teams/[teamId]/reports/goals/page.tsx deleted file mode 100644 index 34aab933..00000000 --- a/src/app/(main)/teams/[teamId]/reports/goals/page.tsx +++ /dev/null @@ -1,3 +0,0 @@ -import Page from 'app/(main)/reports/goals/page'; - -export default Page; diff --git a/src/app/(main)/websites/WebsitesPage.tsx b/src/app/(main)/websites/WebsitesPage.tsx index 8d8ee2e2..d6f8524b 100644 --- a/src/app/(main)/websites/WebsitesPage.tsx +++ b/src/app/(main)/websites/WebsitesPage.tsx @@ -1,8 +1,11 @@ 'use client'; import WebsitesHeader from 'app/(main)/settings/websites/WebsitesHeader'; import WebsitesDataTable from 'app/(main)/settings/websites/WebsitesDataTable'; +import { useTeamUrl } from 'components/hooks'; + +export default function WebsitesPage() { + const { teamId } = useTeamUrl(); -export default function WebsitesPage({ teamId }: { teamId: string }) { return ( <> diff --git a/src/app/(main)/websites/page.tsx b/src/app/(main)/websites/page.tsx index ee49cb8a..859516c9 100644 --- a/src/app/(main)/websites/page.tsx +++ b/src/app/(main)/websites/page.tsx @@ -1,8 +1,8 @@ import WebsitesPage from './WebsitesPage'; import { Metadata } from 'next'; -export default function ({ params: { teamId, userId } }) { - return ; +export default function () { + return ; } export const metadata: Metadata = { diff --git a/src/components/common/Favicon.module.css b/src/components/common/Favicon.module.css deleted file mode 100644 index f8972ad1..00000000 --- a/src/components/common/Favicon.module.css +++ /dev/null @@ -1,3 +0,0 @@ -.favicon { - margin-inline-end: 8px; -} diff --git a/src/components/common/Favicon.tsx b/src/components/common/Favicon.tsx index cdaeaf4b..e78bdbc7 100644 --- a/src/components/common/Favicon.tsx +++ b/src/components/common/Favicon.tsx @@ -1,5 +1,3 @@ -import styles from './Favicon.module.css'; - function getHostName(url: string) { const match = url.match(/^(?:https?:\/\/)?(?:[^@\n]+@)?(?:www\.)?([^:/\n?=]+)/im); return match && match.length > 1 ? match[1] : null; @@ -14,7 +12,6 @@ export function Favicon({ domain, ...props }) { return hostName ? ( { return ( - + - - + ); }; diff --git a/src/queries/analytics/sessions/getSessionStats.ts b/src/queries/analytics/sessions/getSessionStats.ts index c977187d..e3af7ba6 100644 --- a/src/queries/analytics/sessions/getSessionStats.ts +++ b/src/queries/analytics/sessions/getSessionStats.ts @@ -66,8 +66,8 @@ async function clickhouseQuery( order by t `, params, - ).then(a => { - return Object.values(a).map(a => { + ).then(result => { + return Object.values(result).map((a: any) => { return { x: a.x, y: Number(a.y) }; }); });