summaryrefslogtreecommitdiffstats
path: root/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/objectToInstanceTree/objectToInstanceTree.service.ts
diff options
context:
space:
mode:
authorEylon Malin <eylon.malin@intl.att.com>2020-01-29 15:11:47 +0200
committerEylon Malin <eylon.malin@intl.att.com>2020-01-30 23:23:36 +0200
commitaefc6a0e43b8ce36134dbbed71cf2b4cb9745a9f (patch)
tree82e6a44cdb477657796d3280aa0a9ef91aea1fe3 /vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/objectToInstanceTree/objectToInstanceTree.service.ts
parent714c28d14b53b91eac1a5ffa3ebdf63650028918 (diff)
don't show delete in menu action while edit a macro service
Issue-ID: VID-760 Change-Id: Ieed2b7430cc1584681b1143d8b7244801dd8a1c4 Signed-off-by: Eylon Malin <eylon.malin@intl.att.com>
Diffstat (limited to 'vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/objectToInstanceTree/objectToInstanceTree.service.ts')
-rw-r--r--vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/objectToInstanceTree/objectToInstanceTree.service.ts15
1 files changed, 9 insertions, 6 deletions
diff --git a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/objectToInstanceTree/objectToInstanceTree.service.ts b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/objectToInstanceTree/objectToInstanceTree.service.ts
index 8ddb4ba2d..89d901f55 100644
--- a/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/objectToInstanceTree/objectToInstanceTree.service.ts
+++ b/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/objectToInstanceTree/objectToInstanceTree.service.ts
@@ -34,10 +34,11 @@ export class ObjectToInstanceTreeService {
this.numberOfFailed = 0;
this.numberOfElements = 0;
let _this = this;
+ const serviceModelId:string = serviceInstance.modelInfo.modelVersionId;
const firstLevelOptions: ILevelNodeInfo[] = _this._objectToTreeService.getFirstLevelOptions();
for (let option of firstLevelOptions) {
_.forOwn(serviceInstance[option.name], function (instance, modelName) {
- nodes.push(_this.getNodeInstance(modelName, null, instance, serviceHierarchy, option));
+ nodes.push(_this.getNodeInstance(modelName, null, instance, serviceHierarchy, option, serviceModelId));
});
}
return this.sortElementsByPosition(nodes);
@@ -71,18 +72,19 @@ export class ObjectToInstanceTreeService {
* @param instance
* @param serviceHierarchy - The service Hierarchy store
* @param option
+ * @param serviceModelId
* @param parentType
****************************************************************/
- getNodeInstance(modelName: string, parentModel: any, instance: any, serviceHierarchy, option: ILevelNodeInfo, parentType ?: string) {
+ getNodeInstance(modelName: string, parentModel: any, instance: any, serviceHierarchy, option: ILevelNodeInfo, serviceModelId: string, parentType ?: string) {
const model = option.getModel(modelName, instance, serviceHierarchy);
- let optionalNodes = option.createInstanceTreeNode(instance, model, parentModel, modelName);
+ let optionalNodes = option.createInstanceTreeNode(instance, model, parentModel, modelName, serviceModelId);
this.increaseNumberOfFailed(optionalNodes);
this.increaseNumberOfExcitingElements();
let nodes: any[] = _.isArray(optionalNodes) ? optionalNodes : [optionalNodes];
for (let node of nodes) {
node = this.addingExtraDataToNode(node, modelName, parentModel, instance, serviceHierarchy, option, parentType);
- let children = this.addNextInstanceTreeNode(instance, model, option, node, serviceHierarchy);
+ let children = this.addNextInstanceTreeNode(instance, model, option, node, serviceHierarchy, serviceModelId);
if (!_.isNil(children) && children.length > 0) {
node.children = this.sortElementsByPosition(children);
}
@@ -119,8 +121,9 @@ export class ObjectToInstanceTreeService {
* @param levelNodeInfo
* @param parentNode
* @param serviceHierarchy - The service Hierarchy store
+ * @param serviceModelId
****************************************************************/
- addNextInstanceTreeNode(parentInstance, parentModel, levelNodeInfo: ILevelNodeInfo, parentNode, serviceHierarchy): any[] {
+ addNextInstanceTreeNode(parentInstance, parentModel, levelNodeInfo: ILevelNodeInfo, parentNode, serviceHierarchy, serviceModelId: string): any[] {
if (!_.isNil(levelNodeInfo.childNames)&& levelNodeInfo.childNames.length > 0) {
const that = this;
parentNode.children = [];
@@ -130,7 +133,7 @@ export class ObjectToInstanceTreeService {
let nextLevelNodeInfo = levelNodeInfo.getNextLevelObject.apply(that, [childName]);
Object.keys(parentInstance[childName]).map((modelName) => {
let nextLevelInstance = parentInstance[childName][modelName];
- let nodes: any[] | any = that.getNodeInstance(modelName, parentModel, nextLevelInstance, serviceHierarchy, nextLevelNodeInfo, parentType);
+ let nodes: any[] | any = that.getNodeInstance(modelName, parentModel, nextLevelInstance, serviceHierarchy, nextLevelNodeInfo, serviceModelId, parentType);
if (_.isArray(nodes)) {
parentNode.children = parentNode.children.concat(nodes);
} else {