Skip to content

armgit / umami

Public Imported from GitHub
0

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.

Cleaned up pages. Fixed SSO page.

Mike Cao5e3c1353880b
diff --git a/src/app/(app)/console/[[...id]]/page.tsx b/src/app/(app)/console/[[...id]]/page.tsx
index 3eb96ee81..d020ddf9f 100644
--- a/src/app/(app)/console/[[...id]]/page.tsx
+++ b/src/app/(app)/console/[[...id]]/page.tsx
@@ -1,4 +1,5 @@
import TestConsole from '../TestConsole';
+import { Metadata } from 'next';
async function getEnabled() {
return !!process.env.ENABLE_TEST_CONSOLE;
@@ -13,3 +14,7 @@ export default async function ConsolePage() {
return <TestConsole />;
}
+
+export const metadata: Metadata = {
+ title: 'Test Console | umami',
+};
diff --git a/src/app/(app)/dashboard/page.tsx b/src/app/(app)/dashboard/page.tsx
index 17a1ed011..7e7c095c5 100644
--- a/src/app/(app)/dashboard/page.tsx
+++ b/src/app/(app)/dashboard/page.tsx
@@ -1,7 +1,7 @@
import Dashboard from 'app/(app)/dashboard/Dashboard';
import { Metadata } from 'next';
-export default function () {
+export default function DashboardPage() {
return <Dashboard />;
}
diff --git a/src/app/(app)/reports/insights/page.tsx b/src/app/(app)/reports/insights/page.tsx
index a535553c2..1f4db5c66 100644
--- a/src/app/(app)/reports/insights/page.tsx
+++ b/src/app/(app)/reports/insights/page.tsx
@@ -1,7 +1,7 @@
import InsightsReport from './InsightsReport';
import { Metadata } from 'next';
-export default function () {
+export default function InsightsReportPage() {
return <InsightsReport reportId={null} />;
}
diff --git a/src/app/(app)/reports/retention/page.js b/src/app/(app)/reports/retention/page.js
index 55b2de2ec..7c60cee8e 100644
--- a/src/app/(app)/reports/retention/page.js
+++ b/src/app/(app)/reports/retention/page.js
@@ -1,6 +1,6 @@
import RetentionReport from './RetentionReport';
-export default function () {
+export default function RetentionReportPage() {
return <RetentionReport reportId={null} />;
}
diff --git a/src/app/(app)/websites/WebsitesBrowse.js b/src/app/(app)/websites/WebsitesBrowse.js
new file mode 100644
index 000000000..006d0a40d
--- /dev/null
+++ b/src/app/(app)/websites/WebsitesBrowse.js
@@ -0,0 +1,30 @@
+'use client';
+import WebsiteList from 'app/(app)/settings/websites/WebsitesList';
+import { useMessages } from 'components/hooks';
+import { useState } from 'react';
+import { Item, Tabs } from 'react-basics';
+
+const TABS = {
+ myWebsites: 'my-websites',
+ teamWebsites: 'team-websites',
+};
+
+export function WebsitesBrowse() {
+ const { formatMessage, labels } = useMessages();
+ const [tab, setTab] = useState(TABS.myWebsites);
+
+ return (
+ <>
+ <Tabs selectedKey={tab} onSelect={setTab} style={{ marginBottom: 30 }}>
+ <Item key={TABS.myWebsites}>{formatMessage(labels.myWebsites)}</Item>
+ <Item key={TABS.teamWebsites}>{formatMessage(labels.teamWebsites)}</Item>
+ </Tabs>
+ {tab === TABS.myWebsites && <WebsiteList showHeader={false} />}
+ {tab === TABS.teamWebsites && (
+ <WebsiteList showHeader={false} showTeam={true} onlyTeams={true} />
+ )}
+ </>
+ );
+}
+
+export default WebsitesBrowse;
diff --git a/src/app/(app)/websites/[id]/event-data/page.js b/src/app/(app)/websites/[id]/event-data/page.js
index 66d1df66f..14e878c62 100644
--- a/src/app/(app)/websites/[id]/event-data/page.js
+++ b/src/app/(app)/websites/[id]/event-data/page.js
@@ -1,7 +1,7 @@
import WebsiteHeader from '../WebsiteHeader';
import WebsiteEventData from './WebsiteEventData';
-export default function ({ params: { id } }) {
+export default function WebsiteEventDataPage({ params: { id } }) {
if (!id) {
return null;
}
diff --git a/src/app/(app)/websites/[id]/page.tsx b/src/app/(app)/websites/[id]/page.tsx
index 2a0f37943..4b7d6ff35 100644
--- a/src/app/(app)/websites/[id]/page.tsx
+++ b/src/app/(app)/websites/[id]/page.tsx
@@ -1,9 +1,5 @@
import WebsiteDetails from './WebsiteDetails';
-export default function ({ params: { id } }) {
- if (!id) {
- return null;
- }
-
+export default function WebsiteReportsPage({ params: { id } }) {
return <WebsiteDetails websiteId={id} />;
}
diff --git a/src/app/(app)/websites/[id]/realtime/page.tsx b/src/app/(app)/websites/[id]/realtime/page.tsx
index 89e5ae540..b2957fa03 100644
--- a/src/app/(app)/websites/[id]/realtime/page.tsx
+++ b/src/app/(app)/websites/[id]/realtime/page.tsx
@@ -1,6 +1,6 @@
import Realtime from './Realtime';
-export default function ({ params: { id } }) {
+export default function WebsiteRealtimePage({ params: { id } }) {
if (!id) {
return null;
}
diff --git a/src/app/(app)/websites/page.js b/src/app/(app)/websites/page.js
index 7772c252f..a30bc5834 100644
--- a/src/app/(app)/websites/page.js
+++ b/src/app/(app)/websites/page.js
@@ -1,30 +1,12 @@
'use client';
-import WebsiteList from 'app/(app)/settings/websites/WebsitesList';
-import { useMessages } from 'components/hooks';
-import { useState } from 'react';
-import { Item, Tabs } from 'react-basics';
import WebsitesHeader from '../settings/websites/WebsitesHeader';
-
-const TABS = {
- myWebsites: 'my-websites',
- teamWebsites: 'team-websites',
-};
+import WebsitesBrowse from './WebsitesBrowse';
export default function WebsitesPage() {
- const { formatMessage, labels } = useMessages();
- const [tab, setTab] = useState(TABS.myWebsites);
-
return (
<>
<WebsitesHeader />
- <Tabs selectedKey={tab} onSelect={setTab} style={{ marginBottom: 30 }}>
- <Item key={TABS.myWebsites}>{formatMessage(labels.myWebsites)}</Item>
- <Item key={TABS.teamWebsites}>{formatMessage(labels.teamWebsites)}</Item>
- </Tabs>
- {tab === TABS.myWebsites && <WebsiteList showHeader={false} />}
- {tab === TABS.teamWebsites && (
- <WebsiteList showHeader={false} showTeam={true} onlyTeams={true} />
- )}
+ <WebsitesBrowse />
</>
);
}
diff --git a/src/app/share/[...id]/page.tsx b/src/app/share/[...id]/page.tsx
index 736abe7db..b674d56a4 100644
--- a/src/app/share/[...id]/page.tsx
+++ b/src/app/share/[...id]/page.tsx
@@ -1,9 +1,5 @@
import Share from './Share';
export default function ({ params: { id } }) {
- if (!id) {
- return null;
- }
-
return <Share shareId={id} />;
}
diff --git a/src/app/sso/page.tsx b/src/app/sso/page.tsx
index 914efdf18..75ea945d4 100644
--- a/src/app/sso/page.tsx
+++ b/src/app/sso/page.tsx
@@ -1,12 +1,14 @@
'use client';
import { useEffect } from 'react';
import { Loading } from 'react-basics';
-import { useRouter } from 'next/navigation';
+import { useRouter, useSearchParams } from 'next/navigation';
import { setClientAuthToken } from 'lib/client';
-export default function ({ params }) {
+export default function SSOPage() {
const router = useRouter();
- const { token, url } = params;
+ const search = useSearchParams();
+ const url = search.get('url');
+ const token = search.get('token');
useEffect(() => {
if (url && token) {