diff --git a/apps/studio/components/interfaces/UnifiedLogs/UnifiedLogs.tsx b/apps/studio/components/interfaces/UnifiedLogs/UnifiedLogs.tsx index 2e24a741618..c927d36fe83 100644 --- a/apps/studio/components/interfaces/UnifiedLogs/UnifiedLogs.tsx +++ b/apps/studio/components/interfaces/UnifiedLogs/UnifiedLogs.tsx @@ -33,7 +33,6 @@ import { DownloadLogsButton } from './components/DownloadLogsButton' import { LogsFilterBar } from './components/LogsFilterBar' import { LogsListPanel } from './components/LogsListPanel' import { TooltipLabel } from './components/TooltipLabel' -import { UserLogFilterNotice } from './components/UserLogFilterNotice' import { RowSelectionHeader } from './RowSelectionHeader' import { ServiceFlowPanel } from './ServiceFlowPanel' import { SEARCH_PARAMS_PARSER } from './UnifiedLogs.constants' @@ -441,15 +440,6 @@ export const UnifiedLogs = () => { )} - {search.user ? ( - setSearch({ user: null })} - /> - ) : null} - void - className?: string -} - -/** - * Persistent notice shown while the user filter is active. Honesty requirement: it - * always states that coverage is partial (some sources can't be attributed and are - * hidden), and on an empty result it surfaces the likely cause — auth event logs not - * being enabled — as a system condition rather than reading as "no such user". - */ -export const UserLogFilterNotice = ({ - identifier, - isEmpty, - onClear, - className, -}: UserLogFilterNoticeProps) => { - const { data: resolved } = useResolvedLogUser(identifier) - const label = resolved?.email ?? identifier - - const clearAction = ( - - ) - - if (isEmpty) { - return ( - - ) - } - - return ( - - ) -} diff --git a/apps/studio/components/interfaces/UnifiedLogs/hooks/useResolvedLogUser.ts b/apps/studio/components/interfaces/UnifiedLogs/hooks/useResolvedLogUser.ts deleted file mode 100644 index 669230cca61..00000000000 --- a/apps/studio/components/interfaces/UnifiedLogs/hooks/useResolvedLogUser.ts +++ /dev/null @@ -1,49 +0,0 @@ -import { useQuery } from '@tanstack/react-query' -import { useParams } from 'common' - -import { - searchAuthUserByEmail, - searchAuthUserById, -} from '@/components/interfaces/UserJourneys/UserJourneys.queries' -import { useSelectedProjectQuery } from '@/hooks/misc/useSelectedProject' -import { UUID_REGEX } from '@/lib/constants' - -export interface ResolvedLogUser { - /** The raw identifier from the URL (id or email). */ - identifier: string - /** Resolved email, if an auth.users row was found (or the identifier itself when it's an email). */ - email: string | null - /** Resolved auth.users id, if one exists. Null for e.g. a failed signup with no row. */ - userId: string | null - /** Whether an auth.users row matched. False is normal for failed signups. */ - exists: boolean -} - -/** - * Resolves a Unified Logs `?user=` identifier (email or id) into display info for the - * active-filter notice. Reuses the same identity-resolution queries the parked user-journey - * timeline depends on. Display-only — the log SQL matches the raw `?user=` value directly. - */ -export function useResolvedLogUser(identifier: string | null | undefined) { - const { ref: projectRef } = useParams() - const { data: project } = useSelectedProjectQuery() - const connectionString = project?.connectionString ?? null - const id = identifier?.trim() ?? '' - - return useQuery({ - queryKey: ['unified-logs-resolve-user', projectRef, connectionString, id], - enabled: Boolean(projectRef) && id.length > 0, - staleTime: 5 * 60 * 1000, - queryFn: async () => { - const isId = UUID_REGEX.test(id) - const user = isId - ? await searchAuthUserById(projectRef!, connectionString, id) - : await searchAuthUserByEmail(projectRef!, connectionString, id) - - if (!user) { - return { identifier: id, email: isId ? null : id, userId: isId ? id : null, exists: false } - } - return { identifier: id, email: user.email, userId: user.id, exists: true } - }, - }) -}