Files
Joshen Lim 6d08d66b7d Add eslint rule for google translate dynamic spans + address all issues (#52949)
## 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"
/>
2026-11-05 23:28:46 +08:00

68 lines
1.9 KiB
TypeScript

import { Skeleton } from 'ui'
import { Admonition } from 'ui-patterns/Admonition'
import { OrganizationCard } from './OrganizationCard'
import { useOrganizationsQuery } from '@/data/organizations/organizations-query'
export const OrgNotFound = ({ slug }: { slug?: string }) => {
const {
data: organizations,
isSuccess: isOrganizationsSuccess,
isPending: isOrganizationsLoading,
isError: isOrganizationsError,
error: organizationsError,
} = useOrganizationsQuery()
return (
<>
{slug !== '_' && (
<Admonition
type="destructive"
title="Organization not found"
description={
<>
{slug ? (
<>
The organization <code>{slug}</code>{' '}
</>
) : (
<>This organization </>
)}
<span>
does not exist or you do not have permission to access it. Contact the owner if you
believe this is a mistake.
</span>
</>
}
/>
)}
<h3 className="text-sm">Select a different organization to create your new project in</h3>
<div className="grid gap-2 grid-cols-2">
{isOrganizationsLoading && (
<>
<Skeleton className="h-[62px] rounded-md" />
<Skeleton className="h-[62px] rounded-md" />
<Skeleton className="h-[62px] rounded-md" />
</>
)}
{isOrganizationsError && (
<Admonition
type="destructive"
title="Failed to load organizations"
description={organizationsError?.message}
/>
)}
{isOrganizationsSuccess && (
<>
{organizations?.map((org) => (
<OrganizationCard key={org.slug} organization={org} href={`/new/${org.slug}`} />
))}
</>
)}
</div>
</>
)
}