feat(base): enforce unique property names per base

This commit is contained in:
Philipinho
2026-04-24 02:34:38 +01:00
parent 8c0071ee23
commit 464bd701ba
4 changed files with 65 additions and 4 deletions
@@ -25,6 +25,7 @@ type Props = {
editingPropertyId: string | null;
initialSource?: string;
name?: string;
disabled?: boolean;
onSave: (
source: string,
ast: unknown,
@@ -39,6 +40,7 @@ export function FormulaEditor({
editingPropertyId,
initialSource = "",
name,
disabled = false,
onSave,
onCancel,
}: Props) {
@@ -49,7 +51,7 @@ export function FormulaEditor({
editingPropertyId,
registry,
);
const canSave = parseState.state === "ok";
const canSave = parseState.state === "ok" && !disabled;
const insertAtEnd = (snippet: string) =>
setSource((s) => `${s}${s ? " " : ""}${snippet}`);