mirror of
https://github.com/supabase/supabase.git
synced 2026-10-09 11:25:06 +03:00
Stacked PR 3/5 for page title improvements. Includes Logs and Observability layout title adoption, unified logs title cleanup, and small route title fixes. _Base: [dnywh/feat/page-titles](https://github.com/supabase/supabase/pull/43538)_ --- ## What kind of change does this PR introduce? - Resolves FE-1960 - Resolves FE-1983 - Resolves DEPR-207 ## What is the current behavior? Page titles between surfaces are inconsistent and vague. Sometimes they say the product name: ``` My Project | My Org | Supabase ``` ...even when on a specific surface like Database > Tables. Other times they show the entity name but skip over the project or org name : ``` Edge Functions | Supabase ``` ## What is the new behavior? Logs and Observability adopts the layout title format introduced in https://github.com/supabase/supabase/pull/43538: ``` users | Table Editor | My Project | My Org | Supabase hello-world | Logs | Edge Functions | My Project | My Org | Supabase Backups | Database | My Project | My Org | Supabase Authentication | My Project | My Org | Supabase ``` That format is: entity, section, surface, project, org, brand. Also includes unified logs title cleanup, and small route title fixes. ## Additional context Related stacked PRs also based on the the original [dnywh/feat/page-titles](https://github.com/supabase/supabase/pull/43538) branch: - https://github.com/supabase/supabase/pull/43534 - https://github.com/supabase/supabase/pull/43536 - https://github.com/supabase/supabase/pull/43537 --------- Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
48 lines
1.3 KiB
TypeScript
48 lines
1.3 KiB
TypeScript
import { PermissionAction } from '@supabase/shared-types/out/constants'
|
|
import NoPermission from 'components/ui/NoPermission'
|
|
import { useAsyncCheckPermissions } from 'hooks/misc/useCheckPermissions'
|
|
import { withAuth } from 'hooks/misc/withAuth'
|
|
import { PropsWithChildren } from 'react'
|
|
|
|
import { ProjectLayout } from '../ProjectLayout'
|
|
import { LogsSidebarMenuV2 } from './LogsSidebarMenuV2'
|
|
|
|
interface LogsLayoutProps {
|
|
title: string
|
|
}
|
|
|
|
const LogsLayout = ({ title, children }: PropsWithChildren<LogsLayoutProps>) => {
|
|
const { isLoading, can: canUseLogsExplorer } = useAsyncCheckPermissions(
|
|
PermissionAction.ANALYTICS_READ,
|
|
'logflare'
|
|
)
|
|
|
|
if (!canUseLogsExplorer) {
|
|
if (isLoading) {
|
|
return (
|
|
<ProjectLayout isLoading product="Logs & Analytics" browserTitle={{ section: title }} />
|
|
)
|
|
}
|
|
|
|
if (!isLoading && !canUseLogsExplorer) {
|
|
return (
|
|
<ProjectLayout product="Logs & Analytics" browserTitle={{ section: title }}>
|
|
<NoPermission isFullPage resourceText="access your project's logs" />
|
|
</ProjectLayout>
|
|
)
|
|
}
|
|
}
|
|
|
|
return (
|
|
<ProjectLayout
|
|
product="Logs & Analytics"
|
|
browserTitle={{ section: title }}
|
|
productMenu={<LogsSidebarMenuV2 />}
|
|
>
|
|
{children}
|
|
</ProjectLayout>
|
|
)
|
|
}
|
|
|
|
export default withAuth(LogsLayout)
|