This repository was archived by the owner on Oct 21, 2025. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 ) => {
Original file line number Diff line number Diff 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
342348let initialPageTitle : string | undefined ;
You can’t perform that action at this time.
0 commit comments