Add another Network to the new view/edit screen
[vid.git] / vid-webpack-master / src / app / drawingBoard / service-planning / drawing-board-tree / drawing-board-tree.component.ts
index a195cf0..18c3f72 100644 (file)
@@ -51,7 +51,6 @@ export class DrawingBoardTreeComponent implements OnInit, AfterViewInit {
   @Input() pageMode : DrawingBoardModes;
   static triggerDeleteActionService: Subject<string> = new Subject<string>();
   static triggerUndoDeleteActionService: Subject<string> = new Subject<string>();
-  static triggerreCalculateIsDirty: Subject<string> = new Subject<string>();
   @ViewChild(ContextMenuComponent, {static: false}) public contextMenu: ContextMenuComponent;
 
   constructor(private _contextMenuService: ContextMenuService,
@@ -87,12 +86,12 @@ export class DrawingBoardTreeComponent implements OnInit, AfterViewInit {
       });
     });
 
-    DrawingBoardTreeComponent.triggerUndoDeleteActionService.subscribe((serviceModelId) => {
-      this.drawingBoardTreeService.undoDeleteActionService(this.nodes, serviceModelId);
+    DrawingBoardTreeService.triggerCheckIsDirty.subscribe((serviceModelId)=>{
       this.store.dispatch(changeServiceIsDirty(this.nodes, serviceModelId));
-    });
+    })
 
-    DrawingBoardTreeComponent.triggerreCalculateIsDirty.subscribe((serviceModelId) => {
+    DrawingBoardTreeComponent.triggerUndoDeleteActionService.subscribe((serviceModelId) => {
+      this.drawingBoardTreeService.undoDeleteActionService(this.nodes, serviceModelId);
       this.store.dispatch(changeServiceIsDirty(this.nodes, serviceModelId));
     });
 
@@ -228,7 +227,13 @@ export class DrawingBoardTreeComponent implements OnInit, AfterViewInit {
     this.highlightNode.emit(node.data.modelUniqueId);
     if (FeatureFlagsService.getFlagState(Features.FLAG_1906_COMPONENT_INFO, this.store)) {
       const serviceHierarchy = this._store.getState().service.serviceHierarchy[this.serviceModelId];
-      const model = node.data.getModel(node.data.modelName, node.data, serviceHierarchy);
+
+      const instanceModel = this._sharedTreeService.modelByIdentifiers(
+        serviceHierarchy, node.data.modelTypeName,
+        this._sharedTreeService.modelUniqueNameOrId(node.data), node.data.modelName
+      );
+
+      const model = node.data.getModel(instanceModel);
       const modelInfoItems = node.data.getInfo(model, node.data);
       const componentInfoModel: ComponentInfoModel = this._sharedTreeService.addGeneralInfoItems(modelInfoItems, node.data.componentInfoType, model, node.data);
       ComponentInfoService.triggerComponentInfoChange.next(componentInfoModel);