diff options
author | Alexey Sandler <alexey.sandler@intl.att.com> | 2020-02-13 17:31:00 +0200 |
---|---|---|
committer | Alexey Sandler <alexey.sandler@intl.att.com> | 2020-02-13 18:45:36 +0200 |
commit | 32d65b8087406fccc5db734a6843d8942727bd78 (patch) | |
tree | f34f775abcbd5b3208ea7d5f1db613aaf99ee5b4 /vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/shared.tree.service.ts | |
parent | 6bb3fad98f9ea0ccb3c5e4ad5621f3f66271ed3a (diff) |
the upgrade button is allowed when VFM in instance not exists in model.
Issue-ID: VID-758
Signed-off-by: Alexey Sandler <alexey.sandler@intl.att.com>
Change-Id: I8f5aceaf27480d6cc3ab6ec630bcaf285b683303
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 | 13 |
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); } |