NodeInfo::getModel expects the instance-model
[vid.git] / vid-webpack-master / src / app / drawingBoard / service-planning / objectsToTree / models / basic.model.info.ts
1 import {ITreeNode} from "angular-tree-component/dist/defs/api";
2 import {AvailableNodeIcons} from "../../available-models-tree/available-models-tree.service";
3 import {ComponentInfoType} from "../../component-info/component-info-model";
4 import {ModelInformationItem} from "../../../../shared/components/model-information/model-information.component";
5
6 export interface ILevelNodeInfo {
7   /** Name of the key inside the serviceHierarchy object **/
8   name: string;
9
10   /** Type of the object**/
11   type: string;
12
13   /** Child name inside the of the serviceHierarchy object (if exist) **/
14   childNames?: string[];
15
16   /** model type name **/
17   typeName?: string;
18
19   componentInfoType? :ComponentInfoType;
20
21   /** is instance failed **/
22   isFailed?: boolean;
23
24   /** number of failed **/
25   numberOfFailed?: number;
26
27   /***********************************************************
28    * return node position
29    * @param instance - instance
30    ************************************************************/
31   getNodePosition(instance, deepNodeName? : string) : number;
32
33   /***********************************************************
34    * return if user should provide instance name or not
35    * @param currentModel - The model of current object
36    * @param parentModel - The parent model of current object.
37    ************************************************************/
38   isEcompGeneratedNaming(currentModel, parentModel?): boolean;
39
40
41   /***********************
42    * update node position
43    ***********************/
44   updatePosition(node, that, instanceId, parentStoreKey?) : void;
45
46   /***********************************************************
47    * return a NodeModel object instance
48    * @param instanceModel - The model of the instance (usually extracted from
49    *        serviceHierarchy store)
50    ************************************************************/
51   getModel(instanceModel: any): any;
52
53   /***********************************************************
54    * return dynamic inputs of current model
55    * @param currentModel - The model of current object
56    ************************************************************/
57   updateDynamicInputsDataFromModel(currentModel): any;
58
59   /***********************************************************
60    * return tree node instance
61    * @param instance - The model of current object
62    * @param model - The model of current object
63    * @param parentModel
64    * @param storeKey - instance storeKey if exist (for duplicate)
65    * @param serviceModelId
66    ************************************************************/
67   createInstanceTreeNode(instance: any, model: any, parentModel: any, storeKey: string, serviceModelId: string): any
68
69   /***********************************************************
70    * return if instance has some missing data
71    * @param instance - The instance of current object
72    * @param dynamicInputs
73    * @param isEcompGeneratedNaming - boolean
74    ************************************************************/
75   hasMissingData(instance, dynamicInputs: any, isEcompGeneratedNaming: boolean): boolean;
76
77   /************************
78    * return object tooltip
79    ************************/
80   getTooltip(): string;
81
82   /************************
83    * return object type
84    ************************/
85   getType(): string;
86
87   /************************************
88    * return child model option object
89    ***********************************/
90   getNextLevelObject(type?:string): any;
91
92   /***********************************************************
93    * open popup
94    * @param node - current ITrees node
95    * @param serviceModelId - service id
96    ************************************************************/
97   onClickAdd(node: ITreeNode, serviceModelId: string): void;
98
99   /***********************************************************
100    * get number of existing node instance
101    * @param node - current ITrees node
102    * @param serviceModelId - service id
103    ************************************************************/
104   getNodeCount(node: ITreeNode, serviceModelId: string): number;
105
106   /***********************************************************
107    * should show node icon
108    * @param node - current ITrees node
109    * @param serviceModelId - service id
110    ************************************************************/
111   showNodeIcons(node: ITreeNode, serviceModelId: string): AvailableNodeIcons;
112
113   /***********************************************************
114    * should return list of actions and there methods
115    * @param node - current ITrees node
116    * @param serviceModelId
117    ************************************************************/
118   getMenuAction(node: ITreeNode, serviceModelId: string): { [methodName: string]: { method: Function, visible: Function, enable: Function } };
119
120    /*******************************************************************************************
121    * should generate array of node information
122    * @param model - node model
123    * @param node - current ITrees node
124    *****************************************************************************************/
125   getInfo?(model, instance): ModelInformationItem[];
126 }