From f792671ae247a931f34d902e9276202b5016ef9a Mon Sep 17 00:00:00 2001 From: Ittay Stern Date: Sun, 7 Jul 2019 19:23:03 +0300 Subject: Merge from ecomp 718fd196 - Modern UI Issue-ID: VID-378 Change-Id: I2736b98426e324ec3aa233b034229ba84d99839f Signed-off-by: Ittay Stern --- .../drawing-board-tree.component.ts | 30 +++++++++++++++++----- 1 file changed, 24 insertions(+), 6 deletions(-) (limited to 'vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board-tree/drawing-board-tree.component.ts') diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board-tree/drawing-board-tree.component.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board-tree/drawing-board-tree.component.ts index d0715982c..6be5036b2 100644 --- a/vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board-tree/drawing-board-tree.component.ts +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/drawing-board-tree/drawing-board-tree.component.ts @@ -1,4 +1,4 @@ -import {AfterViewInit, Component, EventEmitter, OnInit, Output, ViewChild,} from '@angular/core'; +import {AfterViewInit, Component, EventEmitter, Input, OnInit, Output, ViewChild,} from '@angular/core'; import {ContextMenuComponent, ContextMenuService} from 'ngx-contextmenu'; import {Constants} from '../../../shared/utils/constants'; import {IDType, ITreeNode} from "angular-tree-component/dist/defs/api"; @@ -24,7 +24,10 @@ import * as _ from 'lodash'; import {ErrorMsgService} from "../../../shared/components/error-msg/error-msg.service"; import {DragAndDropService} from "./dragAndDrop/dragAndDrop.service"; import {FeatureFlagsService, Features} from "../../../shared/services/featureFlag/feature-flags.service"; -import {PopoverPlacement} from "../../../shared/components/popover/popover.component"; +import {ComponentInfoService} from "../component-info/component-info.service"; +import {ComponentInfoModel} from "../component-info/component-info-model"; +import {ObjectToModelTreeService} from "../objectsToTree/objectToModelTree/objectToModelTree.service"; +import {DrawingBoardModes} from "../drawing-board.modes"; @Component({ selector: 'drawing-board-tree', @@ -37,10 +40,14 @@ export class DrawingBoardTreeComponent implements OnInit, AfterViewInit { _store: NgRedux; duplicateService: DuplicateService; drawingBoardTreeService: DrawingBoardTreeService; + objectToModelTreeService : ObjectToModelTreeService; + objectToInstanceTreeService : ObjectToInstanceTreeService; errorMsgService: ErrorMsgService; isFilterEnabled: boolean = false; filterValue: string = ''; contextMenuOptions: TreeNodeContextMenuModel[]; + + @Input() pageMode : DrawingBoardModes; static triggerDeleteActionService: Subject = new Subject(); static triggerUndoDeleteActionService: Subject = new Subject(); static triggerreCalculateIsDirty: Subject = new Subject(); @@ -62,13 +69,16 @@ export class DrawingBoardTreeComponent implements OnInit, AfterViewInit { private _highlightPipe: HighlightPipe, private _objectToInstanceTreeService: ObjectToInstanceTreeService, private _sharedTreeService: SharedTreeService, - private _dragAndDropService : DragAndDropService) { + private _dragAndDropService : DragAndDropService, + private _objectToModelTreeService : ObjectToModelTreeService, + private _componentInfoService: ComponentInfoService) { this.errorMsgService = _errorMsgService; this.duplicateService = _duplicateService; this.drawingBoardTreeService = _drawingBoardTreeService; this.contextMenuOptions = _drawingBoardTreeService.generateContextMenuOptions(); - + this.objectToModelTreeService = _objectToModelTreeService; + this.objectToInstanceTreeService = _objectToInstanceTreeService; DrawingBoardTreeComponent.triggerDeleteActionService.subscribe((serviceModelId) => { this._sharedTreeService.shouldShowDeleteInstanceWithChildrenModal(this.nodes, serviceModelId, (node, serviceModelId)=>{ this.drawingBoardTreeService.deleteActionService(this.nodes, serviceModelId); @@ -102,6 +112,10 @@ export class DrawingBoardTreeComponent implements OnInit, AfterViewInit { this.filterValue = updateData.filterValue; } + isLinkedInstance = (node) : boolean => { + return !_.isNil(node) && node.parentType === "VRF" || node.parentType === "VnfGroup"; + }; + @Output() highlightNode: EventEmitter = new EventEmitter(); @@ -138,7 +152,7 @@ export class DrawingBoardTreeComponent implements OnInit, AfterViewInit { updateTree() { const serviceInstance = this.store.getState().service.serviceInstance[this.serviceModelId]; - this.nodes = this._objectToInstanceTreeService.convertServiceInstanceToTreeData(serviceInstance, this.store.getState().service.serviceHierarchy[this.serviceModelId]); + this.nodes = this._objectToInstanceTreeService.convertServiceInstanceToTreeData(serviceInstance, this.store.getState().service.serviceHierarchy[this.serviceModelId]).filter((item) => item !== null); console.log('right nodes', this.nodes); } @@ -194,7 +208,11 @@ export class DrawingBoardTreeComponent implements OnInit, AfterViewInit { this._sharedTreeService.setSelectedVNF(node); this.highlightNode.emit(node.data.modelUniqueId); if (FeatureFlagsService.getFlagState(Features.FLAG_1906_COMPONENT_INFO, this.store)) { - node.data.onSelectedNode(node); + const serviceHierarchy = this._store.getState().service.serviceHierarchy[this.serviceModelId]; + const model = node.data.getModel(node.data.modelName, node.data, serviceHierarchy); + 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); } } -- cgit 1.2.3-korg