diff options
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; } |