diff options
author | 2019-07-07 19:23:03 +0300 | |
---|---|---|
committer | 2019-07-08 16:13:43 +0300 | |
commit | f792671ae247a931f34d902e9276202b5016ef9a (patch) | |
tree | 6104971e8074c9a3d720836276ff18619719ec02 /vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/vpn/vpn.model.info.ts | |
parent | fc62274e8d15964d63c62bf0e2f4abc040252ee9 (diff) |
Merge from ecomp 718fd196 - Modern UI
Issue-ID: VID-378
Change-Id: I2736b98426e324ec3aa233b034229ba84d99839f
Signed-off-by: Ittay Stern <ittay.stern@att.com>
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)); + } +} + |