diff options
author | 2020-02-29 22:11:26 +0200 | |
---|---|---|
committer | 2020-03-01 20:11:47 +0200 | |
commit | 4e32415b9d34fcd8b18cf278b92c441e5044feab (patch) | |
tree | 8873834358afc4814df85fc90c82f342dcba4525 /vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/shared.tree.service.ts | |
parent | decd21f501cbd5df2ec7436cce98b0a75f61ee29 (diff) |
Component-info: show version and customization id from instance
Issue-ID: Issue-ID: VID-771
Change-Id: If172a0aa6555087edabff3c112c565a768169b5c
Signed-off-by: Alexey Sandler <alexey.sandler@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 | 31 |
1 files changed, 24 insertions, 7 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 864472505..d543991b5 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 @@ -477,17 +477,34 @@ export class SharedTreeService { }); } + getModelVersionEitherFromInstanceOrFromHierarchy(selectedNodeData, model): string | undefined { + if (selectedNodeData && selectedNodeData.instanceModelInfo && selectedNodeData.instanceModelInfo.modelVersion) { + return selectedNodeData.instanceModelInfo.modelVersion; + } else if (model && model.version) { + return model.version; + } + return undefined; + } + + getModelCustomizationIdEitherFromInstanceOrFromHierarchy(selectedNodeData, model): string | undefined { + if (selectedNodeData && selectedNodeData.instanceModelInfo && selectedNodeData.instanceModelInfo.modelCustomizationId) { + return selectedNodeData.instanceModelInfo.modelCustomizationId; + } else if (model && model.customizationUuid) { + return model.customizationUuid; + } + return undefined; + } - addGeneralInfoItems(modelInfoSpecificItems: ModelInformationItem[], type: ComponentInfoType, model, instance):ComponentInfoModel { + addGeneralInfoItems(modelInfoSpecificItems: ModelInformationItem[], type: ComponentInfoType, model, selectedNodeData):ComponentInfoModel { let modelInfoItems: ModelInformationItem[] = [ - ModelInformationItem.createInstance("Model version", model ? model.version : null), - ModelInformationItem.createInstance("Model customization ID", model ? model.customizationUuid : null), - ModelInformationItem.createInstance("Instance ID", instance ? instance.instanceId : null), - ModelInformationItem.createInstance("Instance type", instance ? instance.instanceType : null), - ModelInformationItem.createInstance("In maintenance", instance? instance.inMaint : null), + ModelInformationItem.createInstance("Model version", this.getModelVersionEitherFromInstanceOrFromHierarchy(selectedNodeData, model)), + ModelInformationItem.createInstance("Model customization ID", this.getModelCustomizationIdEitherFromInstanceOrFromHierarchy(selectedNodeData, model)), + ModelInformationItem.createInstance("Instance ID", selectedNodeData ? selectedNodeData.instanceId : null), + ModelInformationItem.createInstance("Instance type", selectedNodeData ? selectedNodeData.instanceType : null), + ModelInformationItem.createInstance("In maintenance", selectedNodeData? selectedNodeData.inMaint : null), ]; modelInfoItems = modelInfoItems.concat(modelInfoSpecificItems); - return this.getComponentInfoModelByModelInformationItems(modelInfoItems, type, instance); + return this.getComponentInfoModelByModelInformationItems(modelInfoItems, type, selectedNodeData); } getComponentInfoModelByModelInformationItems(modelInfoItems: ModelInformationItem[], type: ComponentInfoType, instance){ |