Skip to content

Commit

Permalink
Remove invalid diagram element instead of replacing it by backup
Browse files Browse the repository at this point in the history
  • Loading branch information
JanBliznicenko committed Nov 23, 2024
1 parent 684a12d commit 0cc62c7
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
21 changes: 9 additions & 12 deletions repository/OpenPonk-Core/OPDiagramElement.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -182,12 +182,6 @@ OPDiagramElement >> attachedShapesDo: aBlock [
thenDo: aBlock
]

{ #category : 'serialization' }
OPDiagramElement >> backupModelElementFor: aModelReference [

^ nil
]

{ #category : 'accessing' }
OPDiagramElement >> canvas [

Expand Down Expand Up @@ -529,9 +523,11 @@ OPDiagramElement >> resizableInteractionTarget [
{ #category : 'serialization' }
OPDiagramElement >> resolveAllModelElements: aCollection [

self resolveModelElements: aCollection.
self ownedElements do: [ :each |
each resolveAllModelElements: aCollection ]
| success |
success := self resolveModelElements: aCollection.
self ownedElements: (self ownedElements select: [ :each |
each resolveAllModelElements: aCollection ]).
^ success
]

{ #category : 'serialization' }
Expand All @@ -541,9 +537,10 @@ OPDiagramElement >> resolveModelElements: aCollection [
[ each modelObjectFrom: aCollection ]
on: NotFound
do: [ :e |
OPModelInvalid signal:
'Diagram references non-existent model element. Try using Proceed to use placeholder model object'.
self backupModelElementFor: each ] ])
OPDiagramInvalid signal:
'Diagram references non-existent model element. Try using Proceed to remove it'.
^ false ] ]).
^ true
]

{ #category : 'rendering' }
Expand Down
7 changes: 7 additions & 0 deletions repository/OpenPonk-Core/OPDiagramInvalid.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Class {
#name : 'OPDiagramInvalid',
#superclass : 'Warning',
#category : 'OpenPonk-Core-Controllers',
#package : 'OpenPonk-Core',
#tag : 'Controllers'
}

0 comments on commit 0cc62c7

Please sign in to comment.