aboutsummaryrefslogtreecommitdiffstats
path: root/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/shared.tree.service.ts
diff options
context:
space:
mode:
authorIttay Stern <ittay.stern@att.com>2020-02-03 13:07:26 +0000
committerGerrit Code Review <gerrit@onap.org>2020-02-03 13:07:26 +0000
commit39d4ca5b77a2b70e37c5995fe4e5d945d327f062 (patch)
tree91e410fb0f982acfc652fac17bbe452858706965 /vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/shared.tree.service.ts
parente0071f0d81a88a417eacd47ef1f0c9451227e9ad (diff)
parenta3e54c3e36156bccea5293f87b3e2d9caad2e025 (diff)
Merge "upgrade VFM is not enable when other VFM in the same VNF is already upgraded. Issue-ID: VID-771"
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.ts22
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);
}