Skip to content
This repository was archived by the owner on Oct 21, 2025. It is now read-only.

Commit 340924d

Browse files
committed
fix default diagramm constraint
1 parent dac22d0 commit 340924d

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

src/features/constraintMenu/ConstraintMenu.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,15 @@ export class ConstraintMenu extends AbstractUIExtension implements Switchable {
4545
editorModeController?.onModeChange(() => {
4646
this.forceReadOnly = editorModeController!.isReadOnly();
4747
});
48+
constraintRegistry.onUpdate(() => {
49+
if (this.editor) {
50+
const editorText = this.editor.getValue();
51+
// Only update the editor if the constraints have changed
52+
if (editorText !== this.constraintRegistry.getConstraints()) {
53+
this.editor.setValue(this.constraintRegistry.getConstraints() || "");
54+
}
55+
}
56+
});
4857
}
4958

5059
id(): string {

src/features/serialize/defaultDiagram.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -612,6 +612,6 @@
612612
]
613613
}
614614
],
615-
"constraints": "data Sensitivity.Personal neverFlows vertex Location.nonEU",
615+
"constraints": "- default: data Sensitivity.Personal neverFlows vertex Location.nonEU",
616616
"mode": "edit"
617617
}

0 commit comments

Comments
 (0)