summaryrefslogtreecommitdiffstats
path: root/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/shared.tree.service.ts
diff options
context:
space:
mode:
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.ts13
1 files changed, 12 insertions, 1 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 de859e4ea..864472505 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
@@ -222,7 +222,18 @@ export class SharedTreeService {
isVfMoudleCouldBeUpgraded(node, serviceModelId): boolean{
return (FeatureFlagsService.getFlagState(Features.FLAG_FLASH_REPLACE_VF_MODULE, this._store) &&
- ((this.isThereAnUpdatedLatestVersion(serviceModelId)) || this.isVfmoduleAlmostPartOfModelOnlyCustomizationUuidDiffer(node, serviceModelId)))
+ (this.isThereAnUpdatedLatestVersion(serviceModelId) || this.isVfModuleCustomizationIdNotExistsOnModel(node, serviceModelId)))
+ }
+
+ isVfModuleCustomizationIdNotExistsOnModel(vfModuleNode, serviceModelId) {
+
+ // prevent undefined
+ if (_.isNil(vfModuleNode.data) || _.isNil(vfModuleNode.data.modelCustomizationId)) {
+ return false;
+ }
+
+ let vfModulesHierarchyByGivenModelId = this._store.getState().service.serviceHierarchy[serviceModelId].vfModules;
+ return !_.some(vfModulesHierarchyByGivenModelId, vfmodel => vfmodel.customizationUuid === vfModuleNode.data.modelCustomizationId);
}