import {DynamicInputsService} from "../../dynamicInputs.service";
import {ILevelNodeInfo} from "../basic.model.info";
-import {NetworkInstance} from "../../../../../shared/models/networkInstance";
import {NetworkModel} from "../../../../../shared/models/networkModel";
import {NetworkTreeNode} from "../../../../../shared/models/networkTreeNode";
import {SharedTreeService} from "../../shared.tree.service";
};
/***********************************************************
- * return network model
- * @param networkModelId - current Model id
- * @param instance
- * @param serviceHierarchy - serviceHierarchy
+ * return a NodeModel object instance
+ * @param instanceModel - The model of the instance (usually extracted from serviceHierarchy store)
************************************************************/
- getModel = (networkModelId: string, instance: NetworkInstance, serviceHierarchy): NetworkModel => {
- const originalModelName = instance.originalName ? instance.originalName : networkModelId;
+ getModel = (instanceModel: any): NetworkModel => {
return new NetworkModel(
- this._sharedTreeService.modelByIdentifier(serviceHierarchy, this.name, originalModelName),
+ instanceModel,
this._featureFlagsService.getAllFlags());
};
* @param parentModel
* @param storeKey - store key if exist
************************************************************/
- createInstanceTreeNode = (instance: NetworkInstance, model: NetworkModel, parentModel, storeKey: string): NetworkTreeNode => {
+ createInstanceTreeNode = (instance: any, model: any, parentModel: any, storeKey: string, serviceModelId: string): any => {
let node = new NetworkTreeNode(instance, model, storeKey);
node.missingData = this.hasMissingData(instance, node, model.isEcompGeneratedNaming);
node.typeName = this.typeName;
- node.menuActions = this.getMenuAction(<any>node, model.uuid);
+ node.menuActions = this.getMenuAction(<any>node, serviceModelId);
node.isFailed = _.isNil(instance.isFailed) ? false : instance.isFailed;
node.statusMessage = !_.isNil(instance.statusMessage) ? instance.statusMessage : "";
node = this._sharedTreeService.addingStatusProperty(node);
let storeKey: string = node.data.networkStoreKey;
this._store.dispatch(removeInstance(node.data.networkStoreKey, serviceModelId, storeKey, node));
this._store.dispatch(changeInstanceCounter(node.data.modelUniqueId, serviceModelId, -1, node));
- this._sharedTreeService.selectedVNF = null;
+ this._sharedTreeService.selectedNF = null;
},
visible: (node) => node.data.parentType !== 'VRF' && this._sharedTreeService.shouldShowRemoveAndEdit(node),
enable: (node) => node.data.parentType !== 'VRF' && this._sharedTreeService.shouldShowRemoveAndEdit(node),
});
}
},
- visible: (node) => node.data.parentType !== 'VRF' && this._sharedTreeService.shouldShowDelete(node),
- enable: (node) => node.data.parentType !== 'VRF' && this._sharedTreeService.shouldShowDelete(node)
+ visible: (node) => node.data.parentType !== 'VRF' && this._sharedTreeService.shouldShowDelete(node, serviceModelId),
+ enable: (node) => node.data.parentType !== 'VRF' && this._sharedTreeService.shouldShowDelete(node, serviceModelId)
},
undoDelete: {
method: (node, serviceModelId) => {