mirror of
https://github.com/supabase/supabase.git
synced 2026-12-04 07:29:16 +00:00
## Context We've been seeing many `NotFoundError: Failed to execute 'removeChild' on 'Node'` and `NotFoundError: Failed to execute 'insertBefore' on 'Node'` events on Sentry which are historically known to be caused by Google Translate in the browser. There's technically no _right way_ to address this unfortunately, but one of the solutions which should address most of these issues is to wrap any dynamic text within a span - we've considered that quite a while back tbh but never took the time to do this until today with the help of Claude. Although just a heads up that it might not necessarily completely eradicate those issues. Also added an eslint rule which should prevent future occurences of this <img width="1264" height="192" alt="image" src="https://github.com/user-attachments/assets/b2c32ea0-45a2-4ccd-82fe-1a859905fc29" />
44 lines
1.5 KiB
TypeScript
44 lines
1.5 KiB
TypeScript
import { useQuery } from '@tanstack/react-query'
|
|
import { Admonition } from 'ui-patterns/Admonition'
|
|
import { FormItemLayout } from 'ui-patterns/form/FormItemLayout/FormItemLayout'
|
|
|
|
import { getItemsAffectingProjectCreation } from './RegionSelector.utils'
|
|
import { InlineLink } from '@/components/ui/InlineLink'
|
|
import { statusPageQueryOptions } from '@/data/platform/status-page-query'
|
|
import { normalizeStatusPage } from '@/lib/status-page/status-page.utils'
|
|
|
|
export const ProjectCreationStatusAdmonition = ({
|
|
selectedRegionCode,
|
|
}: {
|
|
selectedRegionCode?: string
|
|
}) => {
|
|
const { data } = useQuery({ ...statusPageQueryOptions(), select: normalizeStatusPage })
|
|
if (!data) return null
|
|
|
|
const items = getItemsAffectingProjectCreation(data.items, selectedRegionCode)
|
|
const item = items[0]
|
|
if (!item) return null
|
|
|
|
const isMaintenance = item.kind === 'maintenance'
|
|
const isRegionSpecific = item.projectCreationScope?.type === 'regions'
|
|
|
|
return (
|
|
<FormItemLayout layout="horizontal">
|
|
<Admonition
|
|
type="warning"
|
|
title={isMaintenance ? 'Maintenance in progress' : 'Incident in progress'}
|
|
description={
|
|
<>
|
|
{isMaintenance ? 'Maintenance' : 'An incident'} <span>may affect project creation</span>
|
|
{isRegionSpecific ? ' in this region' : ''}
|
|
<span>. Follow updates on</span>{' '}
|
|
<InlineLink href={data.pageUrl}>status page</InlineLink>
|
|
<span>.</span>
|
|
</>
|
|
}
|
|
className="mt-3"
|
|
/>
|
|
</FormItemLayout>
|
|
)
|
|
}
|