diff options
Diffstat (limited to 'vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models')
13 files changed, 42 insertions, 39 deletions
diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/basic.model.info.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/basic.model.info.ts index 5ae64376a..9c102069b 100644 --- a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/basic.model.info.ts +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/basic.model.info.ts @@ -63,8 +63,9 @@ export interface ILevelNodeInfo { * @param model - The model of current object * @param parentModel * @param storeKey - instance storeKey if exist (for duplicate) + * @param serviceModelId ************************************************************/ - createInstanceTreeNode(instance: any, model: any, parentModel: any, storeKey: string): any + createInstanceTreeNode(instance: any, model: any, parentModel: any, storeKey: string, serviceModelId: string): any /*********************************************************** * return if instance has some missing data diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/collectionResource/collectionResource.model.info.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/collectionResource/collectionResource.model.info.ts index 339951de5..c469be501 100644 --- a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/collectionResource/collectionResource.model.info.ts +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/collectionResource/collectionResource.model.info.ts @@ -34,11 +34,11 @@ export class CollectionResourceModelInfo implements ILevelNodeInfo{ }; - createInstanceTreeNode = (instance: CollectionResourceInstance, model: CollectionResourceModel, parentModel, storeKey: string): CollectionResourceTreeNode => { + createInstanceTreeNode = (instance: any, model: any, parentModel: any, storeKey: string, serviceModelId: string): any => { let node = new CollectionResourceTreeNode(instance, model, storeKey); node.missingData = this.hasMissingData(instance, node, model.isEcompGeneratedNaming); node.typeName = this.typeName; - node.menuActions = this.getMenuAction(<any>node, model.uuid); + node.menuActions = this.getMenuAction(<any>node, serviceModelId); node.isFailed = _.isNil(instance.isFailed) ? false : instance.isFailed; node.statusMessage = !_.isNil(instance.statusMessage) ? instance.statusMessage : ""; return node; diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/configuration/configuration.model.info.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/configuration/configuration.model.info.ts index d9702b4c4..f7b7df75c 100644 --- a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/configuration/configuration.model.info.ts +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/configuration/configuration.model.info.ts @@ -38,7 +38,7 @@ export class ConfigurationModelInfo implements ILevelNodeInfo{ return {}; }; - createInstanceTreeNode(instance: any, model: any, storeKey: string): any {return null;} + createInstanceTreeNode(instance: any, model: any, storeKey: string, serviceModelId: string): any {return null;} childNames: string[]; diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/ncf/ncf.model.info.spec.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/ncf/ncf.model.info.spec.ts index 6c8382808..951145870 100644 --- a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/ncf/ncf.model.info.spec.ts +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/ncf/ncf.model.info.spec.ts @@ -69,7 +69,7 @@ describe('NCF Model Info', () => { typeName: "NCF" }; - const ncfTreeNode: NcfTreeNode = ncfModel.createInstanceTreeNode(instance, {}, parentModel, "6b3536cf-3a12-457f-abb5-fa2203e0d923"); + const ncfTreeNode: NcfTreeNode = ncfModel.createInstanceTreeNode(instance, {}, parentModel, "6b3536cf-3a12-457f-abb5-fa2203e0d923", "dd182d7d-6949-4b90-b3cc-5befe400742e"); expect(ncfTreeNode).toMatchObject(expected); }); diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/ncf/ncf.model.info.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/ncf/ncf.model.info.ts index 4db41c0d1..5c03b379b 100644 --- a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/ncf/ncf.model.info.ts +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/ncf/ncf.model.info.ts @@ -37,7 +37,7 @@ export class NcfModelInfo implements ILevelNodeInfo { }; - createInstanceTreeNode = (instance: Level1Instance, model: Level1Model, parentModel, storeKey: string): NcfTreeNode => { + createInstanceTreeNode = (instance: any, model: any, parentModel: any, storeKey: string, serviceModelId: string): any => { let modelVersion: string = null; if (parentModel.networksCollection && instance.originalName) { const ncfRealModel: NcfModelInterface = parentModel.networksCollection[instance.originalName]; @@ -47,7 +47,7 @@ export class NcfModelInfo implements ILevelNodeInfo { } let node = new NcfTreeNode(instance, model, storeKey, modelVersion); - node.menuActions = this.getMenuAction(<any>node, model.uuid); + node.menuActions = this.getMenuAction(<any>node, serviceModelId); node.typeName = this.typeName; return node; }; diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/network/network.model.info.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/network/network.model.info.ts index 7c240a9b9..7979b5af4 100644 --- a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/network/network.model.info.ts +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/network/network.model.info.ts @@ -85,11 +85,11 @@ export class NetworkModelInfo implements ILevelNodeInfo { * @param parentModel * @param storeKey - store key if exist ************************************************************/ - createInstanceTreeNode = (instance: NetworkInstance, model: NetworkModel, parentModel, storeKey: string): NetworkTreeNode => { + createInstanceTreeNode = (instance: any, model: any, parentModel: any, storeKey: string, serviceModelId: string): any => { let node = new NetworkTreeNode(instance, model, storeKey); node.missingData = this.hasMissingData(instance, node, model.isEcompGeneratedNaming); node.typeName = this.typeName; - node.menuActions = this.getMenuAction(<any>node, model.uuid); + node.menuActions = this.getMenuAction(<any>node, serviceModelId); node.isFailed = _.isNil(instance.isFailed) ? false : instance.isFailed; node.statusMessage = !_.isNil(instance.statusMessage) ? instance.statusMessage : ""; node = this._sharedTreeService.addingStatusProperty(node); @@ -234,8 +234,8 @@ export class NetworkModelInfo implements ILevelNodeInfo { }); } }, - visible: (node) => node.data.parentType !== 'VRF' && this._sharedTreeService.shouldShowDelete(node), - enable: (node) => node.data.parentType !== 'VRF' && this._sharedTreeService.shouldShowDelete(node) + visible: (node) => node.data.parentType !== 'VRF' && this._sharedTreeService.shouldShowDelete(node, serviceModelId), + enable: (node) => node.data.parentType !== 'VRF' && this._sharedTreeService.shouldShowDelete(node, serviceModelId) }, undoDelete: { method: (node, serviceModelId) => { diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/pnf/pnf.model.info.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/pnf/pnf.model.info.ts index 05e05a744..6debcd6a5 100644 --- a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/pnf/pnf.model.info.ts +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/pnf/pnf.model.info.ts @@ -21,7 +21,7 @@ export class PnfModelInfo implements ILevelNodeInfo{ childNames: string[]; componentInfoType = ComponentInfoType.PNF; - createInstanceTreeNode = (instance: PnfInstance, model: PNFModel, parentModel: any, storeKey: string): PnfTreeNode => null; + createInstanceTreeNode = (instance: any, model: any, parentModel: any, storeKey: string, serviceModelId: string): any => null; getInfo(model, instance): ModelInformationItem[] { return []; diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/relatedVnfMember/relatedVnfMember.info.model.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/relatedVnfMember/relatedVnfMember.info.model.ts index 86455ce60..20d1f5949 100644 --- a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/relatedVnfMember/relatedVnfMember.info.model.ts +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/relatedVnfMember/relatedVnfMember.info.model.ts @@ -65,12 +65,13 @@ export class RelatedVnfMemberInfoModel implements ILevelNodeInfo { * @param model - vnf model * @param parentModel * @param storeKey - store key if exist + * @param serviceModelId ************************************************************/ - createInstanceTreeNode = (instance: VnfInstance, model: VNFModel, parentModel, storeKey: string): VnfTreeNode => { + createInstanceTreeNode = (instance: any, model: any, parentModel: any, storeKey: string, serviceModelId: string): any => { let node = new VnfTreeNode(instance, model, storeKey); node.missingData = this.hasMissingData(instance, node, model.isEcompGeneratedNaming); node.typeName = this.typeName; - node.menuActions = this.getMenuAction(<any>node, model.uuid); + node.menuActions = this.getMenuAction(<any>node, serviceModelId); node.isFailed = _.isNil(instance.isFailed) ? false : instance.isFailed; node.statusMessage = !_.isNil(instance.statusMessage) ? instance.statusMessage: ""; node = this._sharedTreeService.addingStatusProperty(node); @@ -128,8 +129,8 @@ export class RelatedVnfMemberInfoModel implements ILevelNodeInfo { method : (node, serviceModelId) => { this._store.dispatch(deleteActionRelatedVnfMemberInstance(node.parent.data.vnfGroupStoreKey, node.data.vnfStoreKey, serviceModelId)); }, - visible: (node) => this._sharedTreeService.shouldShowDelete(node), - enable: (node) => this._sharedTreeService.shouldShowDelete(node) + visible: (node) => this._sharedTreeService.shouldShowDelete(node, serviceModelId), + enable: (node) => this._sharedTreeService.shouldShowDelete(node, serviceModelId) }, undoDelete : { method : (node, serviceModelId) => { @@ -137,7 +138,7 @@ export class RelatedVnfMemberInfoModel implements ILevelNodeInfo { }, visible: (node) => this._sharedTreeService.shouldShowUndoDelete(node), - enable: (node, serviceModelId) => this._sharedTreeService.shouldShowUndoDelete(node) && this._sharedTreeService.shouldShowDelete(node.parent) && !this._sharedTreeService.isServiceOnDeleteMode(serviceModelId) + enable: (node, serviceModelId) => this._sharedTreeService.shouldShowUndoDelete(node) && this._sharedTreeService.shouldShowDelete(node.parent, serviceModelId) && !this._sharedTreeService.isServiceOnDeleteMode(serviceModelId) } } } diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/vfModule/vfModule.model.info.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/vfModule/vfModule.model.info.ts index 1b92eb81b..9886176be 100644 --- a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/vfModule/vfModule.model.info.ts +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/vfModule/vfModule.model.info.ts @@ -86,7 +86,7 @@ export class VFModuleModelInfo implements ILevelNodeInfo { return {}; }; - createNode(instance: VfModuleInstance, currentModel: VfModule, parentModel: VNFModel, modelName: string, index: number): VfModuleTreeNode { + createNode(instance: VfModuleInstance, currentModel: VfModule, parentModel: VNFModel, modelName: string, index: number, serviceModelId: string): VfModuleTreeNode { let dynamicModelName = Object.keys(instance)[index]; instance = instance[Object.keys(instance)[index]]; const isEcompGeneratedNaming: boolean = this.isEcompGeneratedNaming(currentModel, parentModel); @@ -96,7 +96,7 @@ export class VFModuleModelInfo implements ILevelNodeInfo { newVfModule.missingData = this._sharedTreeService.hasMissingData(instance, newVfModule.dynamicInputs, isEcompGeneratedNaming, []); newVfModule.typeName = this.typeName; - newVfModule.menuActions = this.getMenuAction(<any>newVfModule, currentModel.uuid); + newVfModule.menuActions = this.getMenuAction(<any>newVfModule, serviceModelId); newVfModule.isFailed = _.isNil(instance.isFailed) ? false : instance.isFailed; newVfModule.statusMessage = !_.isNil(instance.statusMessage) ? instance.statusMessage : ""; @@ -104,16 +104,16 @@ export class VFModuleModelInfo implements ILevelNodeInfo { return newVfModule; } - createInstanceTreeNode(instance: VfModuleInstance, currentModel: VfModule, parentModel: VNFModel, modelName: string): VfModuleTreeNode | VfModuleTreeNode[] { + createInstanceTreeNode(instance: any, model: any, parentModel: any, storeKey: string, serviceModelId: string): any { let numberOfChilds = Object.keys(instance).length; if (numberOfChilds > 1) { let result: VfModuleTreeNode[] = []; for (let i = 0; i < numberOfChilds; i++) { - result.push(this.createNode(instance, currentModel, parentModel, modelName, i)); + result.push(this.createNode(instance, model, parentModel, storeKey, i, serviceModelId)); } return result; } else { - return this.createNode(instance, currentModel, parentModel, modelName, 0); + return this.createNode(instance, model, parentModel, storeKey, 0, serviceModelId); } } @@ -355,8 +355,8 @@ export class VFModuleModelInfo implements ILevelNodeInfo { method: (node, serviceModelId) => { this._store.dispatch(deleteActionVfModuleInstance(node.data.dynamicModelName, node.parent.data.vnfStoreKey, serviceModelId)) }, - visible: (node) => this._sharedTreeService.shouldShowDelete(node), - enable: (node) => this._sharedTreeService.shouldShowDelete(node) + visible: (node) => this._sharedTreeService.shouldShowDelete(node, serviceModelId), + enable: (node) => this._sharedTreeService.shouldShowDelete(node, serviceModelId) }, undoDelete: { method: (node, serviceModelId) => { @@ -364,7 +364,7 @@ export class VFModuleModelInfo implements ILevelNodeInfo { this._store.dispatch(deleteVFModuleField(node.data.modelName, node.parent.data.vnfStoreKey, node.data.servicedId ,node.data.dynamicModelName, 'retainAssignments')); }, visible: (node) => this._sharedTreeService.shouldShowUndoDelete(node), - enable: (node, serviceModelId) => this._sharedTreeService.shouldShowUndoDelete(node) && this._sharedTreeService.shouldShowDelete(node.parent) && !this._sharedTreeService.isServiceOnDeleteMode(serviceModelId) + enable: (node, serviceModelId) => this._sharedTreeService.shouldShowUndoDelete(node) && this._sharedTreeService.shouldShowDelete(node.parent, serviceModelId) && !this._sharedTreeService.isServiceOnDeleteMode(serviceModelId) }, upgrade: { method: (node, serviceModelId) => { diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/vnf/vnf.model.info.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/vnf/vnf.model.info.ts index 1215bb80e..950e3628c 100644 --- a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/vnf/vnf.model.info.ts +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/vnf/vnf.model.info.ts @@ -101,12 +101,13 @@ export class VnfModelInfo implements ILevelNodeInfo { * @param model - vnf model * @param parentModel * @param storeKey - store key if exist + * @param serviceModelId ************************************************************/ - createInstanceTreeNode = (instance: VnfInstance, model: VNFModel, parentModel, storeKey: string): VnfTreeNode => { + createInstanceTreeNode = (instance: any, model: any, parentModel: any, storeKey: string, serviceModelId: string): any => { let node = new VnfTreeNode(instance, model, storeKey); node.missingData = this.hasMissingData(instance, node, model.isEcompGeneratedNaming); node.typeName = this.typeName; - node.menuActions = this.getMenuAction(<any>node, model.uuid); + node.menuActions = this.getMenuAction(<any>node, serviceModelId); node.isFailed = _.isNil(instance.isFailed) ? false : instance.isFailed; node.statusMessage = !_.isNil(instance.statusMessage) ? instance.statusMessage : ""; node = this._sharedTreeService.addingStatusProperty(node); @@ -271,8 +272,8 @@ export class VnfModelInfo implements ILevelNodeInfo { }); } }, - visible: (node) => this._sharedTreeService.shouldShowDelete(node), - enable: (node) => this._sharedTreeService.shouldShowDelete(node) + visible: (node) => this._sharedTreeService.shouldShowDelete(node, serviceModelId), + enable: (node) => this._sharedTreeService.shouldShowDelete(node, serviceModelId) }, undoDelete: { method: (node, serviceModelId) => { diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/vnfGrouping/vnfGrouping.model.info.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/vnfGrouping/vnfGrouping.model.info.ts index fa785bc73..2447a063c 100644 --- a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/vnfGrouping/vnfGrouping.model.info.ts +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/vnfGrouping/vnfGrouping.model.info.ts @@ -83,12 +83,12 @@ export class VnfGroupingModelInfo implements ILevelNodeInfo { getType = (): string => 'VnfGroup'; - createInstanceTreeNode(instance: any, model: any, parentModel: any, storeKey: string): any { + createInstanceTreeNode(instance: any, model: any, parentModel: any, storeKey: string, serviceModelId: string): any { let node = new VnfGroupTreeNode(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.menuActions = this.getMenuAction(<any>node, serviceModelId); node.isFailed = _.isNil(instance.isFailed) ? false : instance.isFailed; node.statusMessage = !_.isNil(instance.statusMessage) ? instance.statusMessage : ""; node.limitMembers = (!_.isNil(model.properties.quantity)) ? model.properties.quantity : null; @@ -275,8 +275,8 @@ export class VnfGroupingModelInfo implements ILevelNodeInfo { }); } }, - visible: (node) => this._sharedTreeService.shouldShowDelete(node), - enable: (node) => this._sharedTreeService.shouldShowDelete(node) + visible: (node) => this._sharedTreeService.shouldShowDelete(node, serviceModelId), + enable: (node) => this._sharedTreeService.shouldShowDelete(node, serviceModelId) }, undoDelete: { method: (node, serviceModelId) => { 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 index b951162f8..0fbbc4a2d 100644 --- 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 @@ -34,12 +34,12 @@ export class VpnModelInfo implements ILevelNodeInfo { }; - createInstanceTreeNode = (instance: NetworkInstance, model: any, parentModel, storeKey: string): VpnTreeNode => { + createInstanceTreeNode = (instance: any, model: any, parentModel: any, storeKey: string, serviceModelId: string): any => { 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.menuActions = this.getMenuAction(<any>node, serviceModelId); node.isFailed = _.isNil(instance.isFailed) ? false : instance.isFailed; node.statusMessage = !_.isNil(instance.statusMessage) ? instance.statusMessage : ""; node = this._sharedTreeService.addingStatusProperty(node); diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/vrf/vrf.model.info.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/vrf/vrf.model.info.ts index 03f60211c..dacde73f8 100644 --- a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/vrf/vrf.model.info.ts +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/vrf/vrf.model.info.ts @@ -56,11 +56,11 @@ export class VrfModelInfo implements ILevelNodeInfo { }; - createInstanceTreeNode = (instance: VrfInstance, model: VrfModel, parentModel, storeKey: string): VrfTreeNode => { + createInstanceTreeNode = (instance: any, model: any, parentModel: any, storeKey: string, serviceModelId: string): any => { let node = new VrfTreeNode(instance, model, storeKey); node.missingData = this.hasMissingData(instance, node, model.isEcompGeneratedNaming); node.typeName = this.typeName; - node.menuActions = this.getMenuAction(<any>node, model.uuid); + node.menuActions = this.getMenuAction(<any>node, serviceModelId); node.isFailed = _.isNil(instance.isFailed) ? false : instance.isFailed; node.statusMessage = !_.isNil(instance.statusMessage) ? instance.statusMessage : ""; return node; @@ -157,8 +157,8 @@ export class VrfModelInfo implements ILevelNodeInfo { method: (node, serviceModelId) => { this._store.dispatch(deleteActionVrfInstance(node.data.vrfStoreKey, serviceModelId)); }, - visible: (node) => this._sharedTreeService.shouldShowDelete(node), - enable: (node) => this._sharedTreeService.shouldShowDelete(node) + visible: (node) => this._sharedTreeService.shouldShowDelete(node, serviceModelId), + enable: (node) => this._sharedTreeService.shouldShowDelete(node, serviceModelId) }, undoDelete: { method: (node, serviceModelId) => { |