admin ui: made context overlays scrollable

This commit is contained in:
dswbx
2025-12-22 15:10:36 +01:00
parent 4f7925dfd8
commit 81f3914e7f

View File

@@ -378,11 +378,7 @@ function replaceEntitiesEnum(schema: Record<string, any>, entities: string[]) {
}); });
} }
const Policy = ({ const Policy = ({ permission }: { permission: TPermission }) => {
permission,
}: {
permission: TPermission;
}) => {
const { value } = useDerivedFieldContext("", ({ value }) => ({ const { value } = useDerivedFieldContext("", ({ value }) => ({
effect: (value?.effect ?? "allow") as "allow" | "deny" | "filter", effect: (value?.effect ?? "allow") as "allow" | "deny" | "filter",
})); }));
@@ -503,22 +499,24 @@ const CustomFieldWrapper = ({
className: "max-w-none", className: "max-w-none",
}} }}
position="bottom-end" position="bottom-end"
target={() => target={() => (
typeof schema.content === "object" ? ( <div className="w-auto max-w-[80vw] md:max-w-120 bg-background overflow-scroll">
<JsonViewer {typeof schema.content === "object" ? (
className="w-auto max-w-120 bg-background pr-3 text-sm" <JsonViewer
json={schema.content} className="pr-3 text-sm"
title={schema.name} json={schema.content}
expand={5} title={schema.name}
/> expand={5}
) : ( />
<CodePreview ) : (
code={schema.content} <CodePreview
lang="typescript" code={schema.content}
className="w-auto max-w-120 bg-background p-3 text-sm" lang="typescript"
/> className="p-3 text-sm"
) />
} )}
</div>
)}
> >
<Button variant="ghost" size="smaller" IconLeft={TbCodeDots}> <Button variant="ghost" size="smaller" IconLeft={TbCodeDots}>
{autoFormatString(schema.name)} {autoFormatString(schema.name)}