9c102069b86391496c4a092b87557f4f975b409d
[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 {ComponentInfoModel, 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 object instance
48    * @param modelId - The model id
49    * @param serviceHierarchy - The serviceHierarchy store
50    * @param instance - existing instance details
51    ************************************************************/
52   getModel(modelId: string, instance: any, serviceHierarchy): any;
53
54   /***********************************************************
55    * return dynamic inputs of current model
56    * @param currentModel - The model of current object
57    ************************************************************/
58   updateDynamicInputsDataFromModel(currentModel): any;
59
60   /***********************************************************
61    * return tree node instance
62    * @param instance - The model of current object
63    * @param model - The model of current object
64    * @param parentModel
65    * @param storeKey - instance storeKey if exist (for duplicate)
66    * @param serviceModelId
67    ************************************************************/
68   createInstanceTreeNode(instance: any, model: any, parentModel: any, storeKey: string, serviceModelId: string): any
69
70   /***********************************************************
71    * return if instance has some missing data
72    * @param instance - The instance of current object
73    * @param dynamicInputs
74    * @param isEcompGeneratedNaming - boolean
75    ************************************************************/
76   hasMissingData(instance, dynamicInputs: any, isEcompGeneratedNaming: boolean): boolean;
77
78   /************************
79    * return object tooltip
80    ************************/
81   getTooltip(): string;
82
83   /************************
84    * return object type
85    ************************/
86   getType(): string;
87
88   /************************************
89    * return child model option object
90    ***********************************/
91   getNextLevelObject(type?:string): any;
92
93   /***********************************************************
94    * open popup
95    * @param node - current ITrees node
96    * @param serviceModelId - service id
97    ************************************************************/
98   onClickAdd(node: ITreeNode, serviceModelId: string): void;
99
100   /***********************************************************
101    * get number of existing node instance
102    * @param node - current ITrees node
103    * @param serviceModelId - service id
104    ************************************************************/
105   getNodeCount(node: ITreeNode, serviceModelId: string): number;
106
107   /***********************************************************
108    * should show node icon
109    * @param node - current ITrees node
110    * @param serviceModelId - service id
111    ************************************************************/
112   showNodeIcons(node: ITreeNode, serviceModelId: string): AvailableNodeIcons;
113
114   /***********************************************************
115    * should return list of actions and there methods
116    * @param node - current ITrees node
117    * @param serviceModelId
118    ************************************************************/
119   getMenuAction(node: ITreeNode, serviceModelId: string): { [methodName: string]: { method: Function, visible: Function, enable: Function } };
120
121    /*******************************************************************************************
122    * should generate array of node information
123    * @param model - node model
124    * @param node - current ITrees node
125    *****************************************************************************************/
126   getInfo?(model, instance): ModelInformationItem[];
127 }