summaryrefslogtreecommitdiffstats
path: root/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/shared.tree.service.ts
diff options
context:
space:
mode:
authorIttay Stern <ittay.stern@att.com>2020-02-02 18:09:40 +0200
committerIttay Stern <ittay.stern@att.com>2020-02-03 19:32:49 +0200
commit0814238f615f3e3b855a53add72730b957f6c790 (patch)
treea9170ece7827b039de56534459bcfa0c76ebb7e5 /vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/shared.tree.service.ts
parent52670a9e0b450074dfbe0d151925d0133bc8442a (diff)
NodeInfo::getModel expects the instance-model
Now callers (objectToInstanceTree, objectToModelTree, etc.) pass the hierarchy itself, instead of providing only the service hierarchy and keys. Issue-ID: VID-724 Change-Id: I80cde29887d86b2cc986d96b220ff769562f38b8 Signed-off-by: Ittay Stern <ittay.stern@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.ts17
1 files changed, 11 insertions, 6 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 83691cfa2..964e1202f 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
@@ -19,7 +19,6 @@ import {NodeInstance} from "../../../shared/models/nodeInstance";
@Injectable()
export class SharedTreeService {
- private _sharedTreeService: SharedTreeService;
constructor(private _store: NgRedux<AppState>) {
}
@@ -63,12 +62,12 @@ export class SharedTreeService {
* @param modelTypeName "vnfs" | "networks" | "vfModules" | "collectionResources" | ...
* @param modelUniqueNameOrId Either an entry name (i.e. "originalName"), modelCustomizationId or modelInvariantId.
* Note that modelInvariantId will work only where model lacks a modelCustomizationId.
- * @param modeName An optional entry name (i.e. "originalName"); will not try to use as id
+ * @param modelName An optional entry name (i.e. "originalName"); will not try to use as id
*/
- modelByIdentifiers = (serviceModelFromHierarchy, modelTypeName: string, modelUniqueNameOrId: string, modeName?: string): any => {
+ modelByIdentifiers = (serviceModelFromHierarchy, modelTypeName: string, modelUniqueNameOrId: string, modelName?: string): any => {
const logErrorAndReturnUndefined = () =>
console.info(`modelByIdentifiers: could not find a model matching query`, {
- modelTypeName, modelUniqueNameOrId, modeName, serviceModelFromHierarchy
+ modelTypeName, modelUniqueNameOrId, modelName, serviceModelFromHierarchy
});
if (_.isNil(serviceModelFromHierarchy)) return logErrorAndReturnUndefined();
@@ -77,7 +76,7 @@ export class SharedTreeService {
if (_.isNil(modelsOfType)) return logErrorAndReturnUndefined();
const modelIfModelIdentifierIsEntryName = modelsOfType[modelUniqueNameOrId];
- const modelIfModeNameExists = _.isNil(modeName) ? null : modelsOfType[modeName];
+ const modelIfModeNameExists = _.isNil(modelName) ? null : modelsOfType[modelName];
if (!_.isNil(modelIfModelIdentifierIsEntryName)) {
return modelIfModelIdentifierIsEntryName;
@@ -421,7 +420,13 @@ export class SharedTreeService {
AuditInfoModalComponent.openInstanceAuditInfoModal.next({
instanceId: serviceModelId,
type: instanceType,
- model: modelInfoService.getModel(node.data.modelName, instance, this._store.getState().service.serviceHierarchy[serviceModelId]),
+ model: modelInfoService.getModel(
+ this.modelByIdentifiers(
+ this._store.getState().service.serviceHierarchy[serviceModelId],
+ modelInfoService.name,
+ this.modelUniqueNameOrId(instance), node.data.modelName
+ )
+ ),
instance
});
}