diff options
author | Alexey Sandler <alexey.sandler@intl.att.com> | 2020-03-09 11:04:52 +0200 |
---|---|---|
committer | Alexey Sandler <alexey.sandler@intl.att.com> | 2020-03-09 13:05:24 +0200 |
commit | 5c249d4675c6f8f293d676c28de436cfe615e630 (patch) | |
tree | 2711232dc8cf41c64537604747d06cf4ceccdbce /vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/shared.tree.service.ts | |
parent | d46b13b53c422a4f3c01fb02012c3315aff6bde6 (diff) |
Upgrade vfModule popup: show modelVersionId and invariantiD from instance or model.
Issue-ID: Issue-ID: VID-771
Signed-off-by: Alexey Sandler <alexey.sandler@intl.att.com>
Change-Id: I2132df5557d346537a9283c5f7147f47f1da36af
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 | 30 |
1 files changed, 20 insertions, 10 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 d543991b5..1e8512784 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 @@ -478,19 +478,29 @@ 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; + return this.getNamedFieldFromInstanceOrFromHierarchy(selectedNodeData, "modelVersion", model, "version"); } 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 this.getNamedFieldFromInstanceOrFromHierarchy(selectedNodeData, "modelCustomizationId", model, "customizationUuid"); + } + + getModelInvariantIdEitherFromInstanceOrFromHierarchy(selectedNodeData, model): string | undefined { + return this.getNamedFieldFromInstanceOrFromHierarchy(selectedNodeData, "modelInvariantId", model, "invariantUuid"); + } + + getModelVersionIdEitherFromInstanceOrFromHierarchy(selectedNodeData, model): string | undefined { + return this.getNamedFieldFromInstanceOrFromHierarchy (selectedNodeData, "modelVersionId", model, "uuid"); + } + + + + getNamedFieldFromInstanceOrFromHierarchy(selectedNodeData, instanceModelInfoFieldName, model, modelFieldName): string | undefined { + if (instanceModelInfoFieldName && selectedNodeData && selectedNodeData.instanceModelInfo + && selectedNodeData.instanceModelInfo[instanceModelInfoFieldName]) { + return selectedNodeData.instanceModelInfo[instanceModelInfoFieldName]; + } else if (modelFieldName && model && model[modelFieldName]) { + return model[modelFieldName]; } return undefined; } |