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

Commit 3eae274

Browse files
committed
Fix: Completly get rid of constraint keywords
1 parent 3e76258 commit 3eae274

2 files changed

Lines changed: 8 additions & 7 deletions

File tree

src/features/constraintMenu/commands.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,9 @@ export class ChooseConstraintCommand extends Command {
2020

2121
execute(context: CommandExecutionContext): CommandReturn {
2222
this.annnotationsManager.clearTfgs();
23-
let names = this.action.names;
23+
const names = this.action.names;
2424
this.constraintRegistry.setSelectedConstraints(names);
2525

26-
if (names.includes("INITIAL_CONSTRAINT_STATE")) {
27-
this.constraintRegistry.setAllConstraintsAsSelected();
28-
names = this.constraintRegistry.getSelectedConstraints();
29-
}
30-
3126
const nodes = context.root.children.filter((node) => getBasicType(node) === "node") as DfdNodeImpl[];
3227
if (names.length === 0) {
3328
nodes.forEach((node) => {

src/features/serialize/load.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,13 @@ export class LoadDiagramCommand extends Command {
226226

227227
postLoadActions(this.newRoot, this.actionDispatcher);
228228

229+
if (this.constraintRegistry) {
230+
this.constraintRegistry.setAllConstraintsAsSelected();
231+
this.actionDispatcher.dispatch(
232+
ChooseConstraintAction.create(this.constraintRegistry!.getConstraintList().map((c) => c.name)),
233+
);
234+
}
235+
229236
this.oldFileName = currentFileName;
230237
this.newFileName = file.name;
231238
setFileNameInPageTitle(file.name);
@@ -336,7 +343,6 @@ export async function postLoadActions(
336343
// fit to screen is done after auto layouting because that may change the bounds of the diagram
337344
// requiring another fit to screen.
338345
await actionDispatcher.dispatch(createDefaultFitToScreenAction(newRoot, false));
339-
actionDispatcher.dispatch(ChooseConstraintAction.create(["INITIAL_CONSTRAINT_STATE"]));
340346
}
341347

342348
let initialPageTitle: string | undefined;

0 commit comments

Comments
 (0)