mirror of
https://github.com/supabase/supabase.git
synced 2026-12-04 23:49:03 +00:00
## Problem There was no way to link straight to the Data privacy section (Supabase Assistant opt-in level) of an organization's general settings. The link could only point at the top of the page. The org picker behind `/org/_/<path>` also dropped any `#hash`, so a link that works without knowing the org slug couldn't reach a section. ## Solution The Data privacy section on organization general settings now has the `data-privacy` id, so Studio's hash scroll handling scrolls to it. The `/org/_` organization picker now keeps the URL hash when it sends the user to the chosen org, the same way it already keeps the path and query string. So `/org/_/general#data-privacy` lands on the opt-in setting for whichever org the user picks. ## How to verify 1. Open `/dashboard/org/<slug>/general#data-privacy` in the preview: the page scrolls to the Data privacy section with the Supabase Assistant Opt-in Level setting. 2. Open `/dashboard/org/_/general#data-privacy`, then pick an organization: the URL becomes `/dashboard/org/<slug>/general#data-privacy` and the page scrolls to Data privacy. 3. Open `/dashboard/org/_/general` with no hash, then pick an organization: the page opens at the top, as before. ## Checks Ran `tsc --noEmit` for apps/studio, eslint (both the standard and the type-checked config) on the changed files, `pnpm exec oxfmt --check` on the changed files, and `vitest run components/interfaces/Organization/Organization.utils.test.ts`, which has new cases for hash handling in `buildOrgUrl`. ## Checklist - [x] I have read the [Contributing Guidelines](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) - [ ] I have checked that the change works in the preview deployment Co-authored-by: supabase-vercel-tedd[bot] <336548405+supabase-vercel-tedd[bot]@users.noreply.github.com>
62 lines
1.9 KiB
TypeScript
62 lines
1.9 KiB
TypeScript
import {
|
|
PageSection,
|
|
PageSectionContent,
|
|
PageSectionDescription,
|
|
PageSectionMeta,
|
|
PageSectionSummary,
|
|
PageSectionTitle,
|
|
} from 'ui-patterns/PageSection'
|
|
|
|
import { DataPrivacyForm } from './DataPrivacyForm'
|
|
import { OrganizationDeletePanel } from './OrganizationDeletePanel'
|
|
import { OrganizationDetailsForm } from './OrganizationDetailsForm'
|
|
import { NoProjectsOnPaidOrgInfo } from '@/components/interfaces/Billing/NoProjectsOnPaidOrgInfo'
|
|
import { useIsFeatureEnabled } from '@/hooks/misc/useIsFeatureEnabled'
|
|
|
|
export const GeneralSettings = () => {
|
|
const organizationDeletionEnabled = useIsFeatureEnabled('organizations:delete')
|
|
|
|
return (
|
|
<>
|
|
<PageSection>
|
|
<PageSectionMeta>
|
|
<PageSectionSummary>
|
|
<PageSectionTitle>Organization details</PageSectionTitle>
|
|
</PageSectionSummary>
|
|
</PageSectionMeta>
|
|
<PageSectionContent className="flex flex-col gap-y-2">
|
|
<NoProjectsOnPaidOrgInfo />
|
|
<OrganizationDetailsForm />
|
|
</PageSectionContent>
|
|
</PageSection>
|
|
|
|
<PageSection id="data-privacy">
|
|
<PageSectionMeta>
|
|
<PageSectionSummary>
|
|
<PageSectionTitle>Data privacy</PageSectionTitle>
|
|
</PageSectionSummary>
|
|
</PageSectionMeta>
|
|
<PageSectionContent>
|
|
<DataPrivacyForm />
|
|
</PageSectionContent>
|
|
</PageSection>
|
|
|
|
{organizationDeletionEnabled && (
|
|
<PageSection>
|
|
<PageSectionMeta>
|
|
<PageSectionSummary>
|
|
<PageSectionTitle>Delete organization</PageSectionTitle>
|
|
<PageSectionDescription>
|
|
Permanently remove your organization and its projects.
|
|
</PageSectionDescription>
|
|
</PageSectionSummary>
|
|
</PageSectionMeta>
|
|
<PageSectionContent>
|
|
<OrganizationDeletePanel />
|
|
</PageSectionContent>
|
|
</PageSection>
|
|
)}
|
|
</>
|
|
)
|
|
}
|