From d87ae84a2946a721d395ab609676037f81cd2143 Mon Sep 17 00:00:00 2001 From: Francis Cao Date: Wed, 22 Oct 2025 16:09:31 -0700 Subject: [PATCH 1/2] fix reports permissions, long team overflow, language settings --- src/app/(main)/settings/SettingsLayout.tsx | 19 +++++++++++++------ src/app/api/reports/[reportId]/route.ts | 10 +++++----- src/components/hooks/useLocale.ts | 2 +- src/components/input/NavButton.tsx | 2 +- 4 files changed, 20 insertions(+), 13 deletions(-) diff --git a/src/app/(main)/settings/SettingsLayout.tsx b/src/app/(main)/settings/SettingsLayout.tsx index 5af26fa5a..787d6c64c 100644 --- a/src/app/(main)/settings/SettingsLayout.tsx +++ b/src/app/(main)/settings/SettingsLayout.tsx @@ -1,10 +1,10 @@ 'use client'; -import { ReactNode } from 'react'; -import { Grid, Column } from '@umami/react-zen'; -import { useMessages, useNavigation } from '@/components/hooks'; import { PageBody } from '@/components/common/PageBody'; import { SideMenu } from '@/components/common/SideMenu'; -import { UserCircle, Users, Settings2 } from '@/components/icons'; +import { useMessages, useNavigation } from '@/components/hooks'; +import { Settings2, UserCircle, Users } from '@/components/icons'; +import { Column, Grid } from '@umami/react-zen'; +import { ReactNode } from 'react'; export function SettingsLayout({ children }: { children: ReactNode }) { const { formatMessage, labels } = useMessages(); @@ -46,8 +46,15 @@ export function SettingsLayout({ children }: { children: ReactNode }) { .find(({ path }) => path && pathname.includes(path.split('?')[0]))?.id; return ( - - + + }) { const { auth, error } = await parseRequest(request); @@ -41,7 +41,7 @@ export async function POST( return notFound(); } - if (!(await canUpdateReport(auth, report))) { + if (!(await canUpdateWebsite(auth, websiteId))) { return unauthorized(); } @@ -70,7 +70,7 @@ export async function DELETE( const { reportId } = await params; const report = await getReport(reportId); - if (!(await canDeleteReport(auth, report))) { + if (!(await canDeleteWebsite(auth, report.websiteId))) { return unauthorized(); } diff --git a/src/components/hooks/useLocale.ts b/src/components/hooks/useLocale.ts index 8d96fdde9..9dd164e59 100644 --- a/src/components/hooks/useLocale.ts +++ b/src/components/hooks/useLocale.ts @@ -26,7 +26,7 @@ export function useLocale() { } async function saveLocale(value: string) { - if (!messages[value]) { + if (!messages[value] && !process.env.cloudMode) { await loadMessages(value); } diff --git a/src/components/input/NavButton.tsx b/src/components/input/NavButton.tsx index e1f7129d7..b57c2ecdc 100644 --- a/src/components/input/NavButton.tsx +++ b/src/components/input/NavButton.tsx @@ -69,7 +69,7 @@ export function NavButton({ showText = true }: TeamsButtonProps) { shadow="1" maxHeight="40px" role="button" - style={{ cursor: 'pointer', textWrap: 'nowrap', outline: 'none' }} + style={{ cursor: 'pointer', textWrap: 'nowrap', overflow: 'hidden', outline: 'none' }} > {teamId ? : } From 1d3e980eedd6908a269fc4be12ae90efce0506d8 Mon Sep 17 00:00:00 2001 From: Francis Cao Date: Wed, 22 Oct 2025 16:40:14 -0700 Subject: [PATCH 2/2] revert saveLocale change --- src/components/hooks/useLocale.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/hooks/useLocale.ts b/src/components/hooks/useLocale.ts index 9dd164e59..8d96fdde9 100644 --- a/src/components/hooks/useLocale.ts +++ b/src/components/hooks/useLocale.ts @@ -26,7 +26,7 @@ export function useLocale() { } async function saveLocale(value: string) { - if (!messages[value] && !process.env.cloudMode) { + if (!messages[value]) { await loadMessages(value); }