diff --git a/next.config.ts b/next.config.ts index 40c94fa2b..e229cb44a 100644 --- a/next.config.ts +++ b/next.config.ts @@ -117,22 +117,22 @@ const redirects = [ { source: '/settings', destination: '/settings/preferences', - permanent: false, + permanent: true, }, { source: '/teams/:id', destination: '/teams/:id/websites', - permanent: false, + permanent: true, }, { source: '/teams/:id/settings', destination: '/teams/:id/settings/preferences', - permanent: false, + permanent: true, }, { source: '/admin', destination: '/admin/users', - permanent: false, + permanent: true, }, ]; diff --git a/package.components.json b/package.components.json index ba951df99..8dda25887 100644 --- a/package.components.json +++ b/package.components.json @@ -1,6 +1,6 @@ { "name": "@umami/components", - "version": "0.125.0", + "version": "0.123.0", "description": "Umami React components.", "author": "Mike Cao ", "license": "MIT", diff --git a/src/app/(main)/websites/[websiteId]/WebsiteMenu.tsx b/src/app/(main)/websites/[websiteId]/WebsiteMenu.tsx index 03c72008b..6aa67df1b 100644 --- a/src/app/(main)/websites/[websiteId]/WebsiteMenu.tsx +++ b/src/app/(main)/websites/[websiteId]/WebsiteMenu.tsx @@ -25,7 +25,7 @@ export function WebsiteMenu({ websiteId }: { websiteId: string }) { if (id === 'compare') { router.push(updateParams({ compare: 'prev' })); } else if (id === 'edit') { - router.push(renderUrl(`/websites/${websiteId}`)); + router.push(renderUrl(`/settings/websites/${websiteId}`)); } }; diff --git a/src/app/(main)/websites/[websiteId]/settings/WebsiteData.tsx b/src/app/(main)/websites/[websiteId]/settings/WebsiteData.tsx index 1c1863859..c9c42558b 100644 --- a/src/app/(main)/websites/[websiteId]/settings/WebsiteData.tsx +++ b/src/app/(main)/websites/[websiteId]/settings/WebsiteData.tsx @@ -39,7 +39,7 @@ export function WebsiteData({ websiteId, onSave }: { websiteId: string; onSave?: const handleSave = () => { touch('websites'); onSave?.(); - router.push(renderUrl(`/websites`)); + router.push(renderUrl(`/settings/websites`)); }; const handleReset = async () => { diff --git a/src/components/common/ActionForm.tsx b/src/components/common/ActionForm.tsx index d97064757..3d3d8dc6f 100644 --- a/src/components/common/ActionForm.tsx +++ b/src/components/common/ActionForm.tsx @@ -2,12 +2,12 @@ import { Row, Column, Text } from '@umami/react-zen'; export function ActionForm({ label, description, children }) { return ( - - + + {label} - {description} + {description} - + {children} diff --git a/src/components/hooks/queries/useUserTeamsQuery.ts b/src/components/hooks/queries/useUserTeamsQuery.ts index 82f65496b..6e9971e40 100644 --- a/src/components/hooks/queries/useUserTeamsQuery.ts +++ b/src/components/hooks/queries/useUserTeamsQuery.ts @@ -8,7 +8,7 @@ export function useUserTeamsQuery(userId: string) { return useQuery({ queryKey: ['teams', { userId, modified }], queryFn: () => { - return get(`/users/${userId}/teams`); + return get(`/users/${userId}/teams`, { userId }); }, enabled: !!userId, }); diff --git a/src/components/input/SettingsButton.tsx b/src/components/input/SettingsButton.tsx index 3536d1d54..e717e1357 100644 --- a/src/components/input/SettingsButton.tsx +++ b/src/components/input/SettingsButton.tsx @@ -24,7 +24,7 @@ export function SettingsButton() { const handleAction = (id: Key) => { if (id === 'settings') { if (cloudMode) { - window.location.href = `${cloudUrl}/settings`; + window.location.href = `${cloudUrl}/dashboard`; return; } } diff --git a/src/index.ts b/src/index.ts index 5dd342a68..ab6f0946c 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,8 +1,3 @@ -export * from '@/app/(main)/settings/preferences/LanguageSetting'; -export * from '@/app/(main)/settings/preferences/PreferenceSettings'; -export * from '@/app/(main)/settings/preferences/PreferencesPage'; -export * from '@/app/(main)/settings/preferences/ThemeSetting'; - export * from '@/app/(main)/teams/[teamId]/TeamMemberEditButton'; export * from '@/app/(main)/teams/[teamId]/TeamMemberEditForm'; export * from '@/app/(main)/teams/[teamId]/TeamMemberRemoveButton'; diff --git a/src/tracker/index.js b/src/tracker/index.js index c4c420b6c..b2899e8be 100644 --- a/src/tracker/index.js +++ b/src/tracker/index.js @@ -38,18 +38,6 @@ /* Helper functions */ - const normalize = raw => { - if (!raw) return raw; - try { - const u = new URL(raw, location.href); - if (excludeSearch) u.search = ''; - if (excludeHash) u.hash = ''; - return u.toString(); - } catch (e) { - return raw; - } - }; - const getPayload = () => ({ website, screen, @@ -73,7 +61,11 @@ if (!url) return; currentRef = currentUrl; - currentUrl = normalize(new URL(url, location.href).toString()); + currentUrl = new URL(url, location.href); + + if (excludeSearch) currentUrl.search = ''; + if (excludeHash) currentUrl.hash = ''; + currentUrl = currentUrl.toString(); if (currentUrl !== currentRef) { setTimeout(track, delayDuration); @@ -219,9 +211,8 @@ }; } - let currentUrl = normalize(href); - let currentRef = normalize(referrer.startsWith(origin) ? '' : referrer); - + let currentUrl = href; + let currentRef = referrer.startsWith(origin) ? '' : referrer; let initialized = false; let disabled = false; let cache;