diff options
author | Yoav Schneiderman <yoav.schneiderman@intl.att.com> | 2020-02-02 20:00:00 +0200 |
---|---|---|
committer | Yoav Schneiderman <yoav.schneiderman@intl.att.com> | 2020-02-03 14:38:14 +0200 |
commit | a3e54c3e36156bccea5293f87b3e2d9caad2e025 (patch) | |
tree | 79fa6e3fe5a8146046cc8dc4b15b14091af2850b /vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/shared.tree.service.ts | |
parent | 74e6271d3c9a5f0f2f471c607ca7bc9b8f3d5fc0 (diff) |
upgrade VFM is not enable when other VFM in the same VNF is already upgraded.
Issue-ID: VID-771
Signed-off-by: Yoav Schneiderman <yoav.schneiderman@intl.att.com>
Change-Id: Ia5eca719c50d47c77919a82c2306605da4d2a1c0
Signed-off-by: Yoav Schneiderman <yoav.schneiderman@intl.att.com>
Diffstat (limited to 'vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/shared.tree.service.ts')
-rw-r--r-- | vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/shared.tree.service.ts | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/shared.tree.service.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/shared.tree.service.ts index d60bbd3c9..83691cfa2 100644 --- a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/shared.tree.service.ts +++ b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/shared.tree.service.ts @@ -208,7 +208,7 @@ export class SharedTreeService { ****************************************************/ shouldShowUpgrade(node, serviceModelId): boolean { if (FeatureFlagsService.getFlagState(Features.FLAG_FLASH_REPLACE_VF_MODULE, this._store) && - this.isThereAnUpdatedLatestVersion(serviceModelId)) { + (this.isThereAnUpdatedLatestVersion(serviceModelId)) || this.isDiffCustomizationUuid(node, serviceModelId)) { return this.shouldShowButtonGeneric(node, VNFMethods.UPGRADE, serviceModelId); } else { @@ -216,7 +216,25 @@ export class SharedTreeService { } } - private isThereAnUpdatedLatestVersion(serviceModelId) : boolean{ + + isDiffCustomizationUuid(node, serviceModelId) : boolean { + const vfModuleServiceHierarchy = this.getVfModuleHierarchyThroughParentModelName(node, serviceModelId); + if(_.isNil(vfModuleServiceHierarchy)){ + return true; + } + return node.data && !_.isNil(vfModuleServiceHierarchy) && vfModuleServiceHierarchy.customizationUuid && (vfModuleServiceHierarchy.customizationUuid !== node.data.modelCustomizationId); + } + + getVfModuleHierarchyThroughParentModelName(node, serviceModelId) { + if(node.parent && node.parent.data && node.data){ + const vnfHierarchy = this._store.getState().service.serviceHierarchy[serviceModelId].vnfs[node.parent.data.modelName]; + return vnfHierarchy ? vnfHierarchy.vfModules[node.data.modelName] : null; + } + return null; + } + + + isThereAnUpdatedLatestVersion(serviceModelId) : boolean{ let serviceInstance = this.getServiceInstance(serviceModelId); return !_.isNil(serviceInstance.latestAvailableVersion) && (Number(serviceInstance.modelInfo.modelVersion) < serviceInstance.latestAvailableVersion); } |