merge from ecomp a88f0072 - Modern UI
[vid.git] / vid-webpack-master / src / app / drawingBoard / service-planning / objectsToTree / models / configuration / configuration.model.info.ts
1 import {ILevelNodeInfo} from "../basic.model.info";
2 import {DynamicInputsService} from "../../dynamicInputs.service";
3 import * as _ from 'lodash';
4 import {SharedTreeService} from "../../shared.tree.service";
5 import {ITreeNode} from "angular-tree-component/dist/defs/api";
6 import {AvailableNodeIcons} from "../../../available-models-tree/available-models-tree.service";
7
8 export class ConfigurationModelInfo implements ILevelNodeInfo{
9   constructor(private _dynamicInputsService : DynamicInputsService,
10               private _sharedTreeService : SharedTreeService){}
11   name: string = 'configurations';
12   type : string = 'Configuration';
13   typeName : string = 'C';
14
15   isEcompGeneratedNaming = () : boolean => true;
16
17   updateDynamicInputsDataFromModel = () : any => [];
18
19   getNextLevelObject = (): any => null;
20
21   getTooltip = () : string => 'Configuration';
22
23   getType = () : string => "Configuration";
24
25   /***********************************************************
26    * return configuration model
27    * @param configurationModelId - current Model id
28    * @param serviceHierarchy - serviceHierarchy
29    ************************************************************/
30   getModel = (configurationModelId : string, serviceHierarchy) : any =>{
31     if(!_.isNil(serviceHierarchy)){
32       if(!_.isNil(serviceHierarchy[this.name]) && !_.isNil(serviceHierarchy[this.name][configurationModelId])){
33         return serviceHierarchy[this.name][configurationModelId];
34       }
35     }
36     return {};
37   };
38
39   createInstanceTreeNode(instance: any, model: any, storeKey: string): any {return null;}
40
41   childName: string;
42   childType: string;
43
44   /***********************************************************
45    * return if instance has missing data
46    * @param instance - vnf instance
47    * @param dynamicInputs
48    * @param isEcompGeneratedNaming
49    ************************************************************/
50   hasMissingData(instance, dynamicInputs: any, isEcompGeneratedNaming: boolean): boolean {
51     return this._sharedTreeService.hasMissingData(instance, dynamicInputs, isEcompGeneratedNaming, []);
52   }
53
54   onClickAdd(node: ITreeNode, serviceModelId: string): void {
55   }
56
57   getNodeCount(node: ITreeNode, serviceModelId: string): number {
58     return 0;
59   }
60
61   /***********************************************************
62    * should show node icon
63    * @param node - current ITrees node
64    * @param serviceModelId - service id
65    ************************************************************/
66   showNodeIcons(node: ITreeNode, serviceModelId: string): AvailableNodeIcons {
67     return null;
68   }
69
70   getMenuAction(node: ITreeNode, serviceModelId : string){
71     return {
72
73     }
74   }
75
76   updatePosition(that , node, instanceId): void {
77     // TODO
78   }
79
80   getNodePosition(instance): number {
81     return null;
82   }
83
84   onSelectedNode(node: ITreeNode): void {
85   }
86
87 }