@Injectable()
export class SharedTreeService {
- private _sharedTreeService: SharedTreeService;
constructor(private _store: NgRedux<AppState>) {
}
* @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();
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;
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
});
}