diff --git a/src/app/core/component/create-pattern-relation/create-pattern-relation.component.ts b/src/app/core/component/create-pattern-relation/create-pattern-relation.component.ts index 026b7035..e7829bd6 100644 --- a/src/app/core/component/create-pattern-relation/create-pattern-relation.component.ts +++ b/src/app/core/component/create-pattern-relation/create-pattern-relation.component.ts @@ -88,6 +88,7 @@ export class CreatePatternRelationComponent implements OnInit { } const type = dialogResult.relationType ? dialogResult.relationType : null; const description = dialogResult.description ? dialogResult.description : null; + dialogResult.firstPattern.id = this.data.callerPatternId; switch (dialogResult.direction.name) { case PatternRelationDescriptorDirection.DirectedRight: return new DirectedEdgeModel(dialogResult.firstPattern, dialogResult.secondPattern, this.data.patternLanguage, description, type, @@ -114,6 +115,7 @@ export class CreatePatternRelationComponent implements OnInit { export interface DialogData { relationType: string; description: string; + callerPatternId: string; firstPattern?: Pattern; secondPattern?: Pattern; preselectedEdgeDirection?: PatternRelationDescriptorDirection; diff --git a/src/app/core/default-pattern-renderer/default-pattern-renderer.component.ts b/src/app/core/default-pattern-renderer/default-pattern-renderer.component.ts index c1f7b441..e0986f1d 100644 --- a/src/app/core/default-pattern-renderer/default-pattern-renderer.component.ts +++ b/src/app/core/default-pattern-renderer/default-pattern-renderer.component.ts @@ -233,7 +233,7 @@ export class DefaultPatternRendererComponent implements AfterViewInit, OnDestroy private showAndHandleLinkDialog() { const dialogRef = this.dialog.open(CreatePatternRelationComponent, - { data: { firstPattern: this.pattern, patterns: this.patterns } } + { data: { firstPattern: this.pattern, patterns: this.patterns, callerPatternId: this.patternId } } ); const dialogSubscription = dialogRef.afterClosed().pipe( switchMap((edge) => {