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,10 +499,11 @@ 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">
{typeof schema.content === "object" ? (
<JsonViewer <JsonViewer
className="w-auto max-w-120 bg-background pr-3 text-sm" className="pr-3 text-sm"
json={schema.content} json={schema.content}
title={schema.name} title={schema.name}
expand={5} expand={5}
@@ -515,10 +512,11 @@ const CustomFieldWrapper = ({
<CodePreview <CodePreview
code={schema.content} code={schema.content}
lang="typescript" lang="typescript"
className="w-auto max-w-120 bg-background p-3 text-sm" 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)}