diff options
author | 2019-07-09 14:23:37 +0000 | |
---|---|---|
committer | 2019-07-09 14:23:37 +0000 | |
commit | 58d22b526418ffeb89337fed9e20406da420bc6f (patch) | |
tree | 4357c9cfe1c92d57ac0a3f90167cade7af505b95 /vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/vpn/vpn.model.info.ts | |
parent | 302b02a847e7aa8ccf3ff4bc14ff8a9cf67511b0 (diff) | |
parent | 97d9f66df456ef4573047a90baa3cc3ee4bfb0b7 (diff) |
Merge changes Ib4430bf2,Icc0bdb9e,I2736b984
* changes:
Merge from ecomp 718fd196 - Ext. Services Simulator
Merge from ecomp 718fd196 - Integration Tests
Merge from ecomp 718fd196 - Modern UI
Diffstat (limited to 'vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/vpn/vpn.model.info.ts')
-rw-r--r-- | vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/vpn/vpn.model.info.ts | 96 |
1 files changed, 96 insertions, 0 deletions
diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/vpn/vpn.model.info.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/vpn/vpn.model.info.ts new file mode 100644 index 000000000..b951162f8 --- /dev/null +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/vpn/vpn.model.info.ts @@ -0,0 +1,96 @@ +import {ILevelNodeInfo} from "../basic.model.info"; +import {ComponentInfoType} from "../../../component-info/component-info-model"; +import {ITreeNode} from "angular-tree-component/dist/defs/api"; +import {AvailableNodeIcons} from "../../../available-models-tree/available-models-tree.service"; +import {ModelInformationItem} from "../../../../../shared/components/model-information/model-information.component"; +import * as _ from "lodash"; +import {NgRedux} from "@angular-redux/store"; +import {AppState} from "../../../../../shared/store/reducers"; +import {SharedTreeService} from "../../shared.tree.service"; +import {NetworkInstance} from "../../../../../shared/models/networkInstance"; +import {Level1Model} from "../../../../../shared/models/nodeModel"; +import {VpnTreeNode} from "../../../../../shared/models/vpnTreeNode"; + +export class VpnModelInfo implements ILevelNodeInfo { + constructor(private _store: NgRedux<AppState>, + private _sharedTreeService: SharedTreeService) { + } + + name: string = 'vpns'; + type: string = 'VPN'; + typeName: string = 'VPN'; + + childNames: string[] = []; + componentInfoType = ComponentInfoType.VPN; + + isEcompGeneratedNaming(currentModel): boolean { + return false; + } + + updateDynamicInputsDataFromModel = (currentModel): any => []; + + getModel = (modelId: string, instance: any, serviceHierarchy): any => { + return new Level1Model(); + }; + + + createInstanceTreeNode = (instance: NetworkInstance, model: any, parentModel, storeKey: string): VpnTreeNode => { + let node = new VpnTreeNode(instance, model, storeKey); + node.missingData = this.hasMissingData(instance, node, model.isEcompGeneratedNaming); + node = this._sharedTreeService.addingStatusProperty(node); + node.typeName = this.typeName; + node.menuActions = this.getMenuAction(<any>node, model.uuid); + node.isFailed = _.isNil(instance.isFailed) ? false : instance.isFailed; + node.statusMessage = !_.isNil(instance.statusMessage) ? instance.statusMessage : ""; + node = this._sharedTreeService.addingStatusProperty(node); + return node; + }; + + + getNextLevelObject = (): any => { + return null; + }; + + getTooltip = (): string => 'VPN'; + + getType = (): string => 'VPN'; + + hasMissingData(instance, dynamicInputs: any, isEcompGeneratedNaming: boolean): boolean { + return false; + } + + onClickAdd(node, serviceModelId: string): void { + + } + + getNodeCount(node: ITreeNode, serviceModelId: string): number { + return 0; + } + + showNodeIcons(node: ITreeNode, serviceModelId: string): AvailableNodeIcons { + return null; + } + + getMenuAction(node: ITreeNode, serviceModelId: string): { [methodName: string]: { method: Function, visible: Function, enable: Function } } { + return {}; + } + + updatePosition(that, node, instanceId): void { + } + + getNodePosition(instance): number { + return 0; + } + + getInfo(model, instance): ModelInformationItem[] { + const modelInformation = []; + const instanceInfo = !_.isEmpty(instance) ? [ + ModelInformationItem.createInstance("Region", instance.region), + ModelInformationItem.createInstance("Route target id", !_.isNull(instance.routeTargetId) ? instance.routeTargetId : null), + ModelInformationItem.createInstance("Route target role", !_.isNull(instance.routeTargetRole) ? instance.routeTargetRole : null), + ModelInformationItem.createInstance("Customet VPN ID", !_.isNull(instance.customerVPNId) ? instance.customerVPNId : null)] : []; + const result = [modelInformation, instanceInfo]; + return _.uniq(_.flatten(result)); + } +} + |