merge from ecomp a88f0072 - Modern UI
[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
4 export interface ILevelNodeInfo {
5   /** Name of the key inside the serviceHierarchy object **/
6   name: string;
7
8   /** Type of the object**/
9   type: string;
10
11   /** Child name inside the of the serviceHierarchy object (if exist) **/
12   childName?: string;
13
14   /** Child type the of object (if exist) **/
15   childType?: string;
16
17   /** model type name **/
18   typeName?: string;
19
20   /** is instance failed **/
21   isFailed?: boolean;
22
23   /** number of failed **/
24   numberOfFailed?: number;
25
26   /***********************************************************
27    * return node position
28    * @param instance - instance
29    ************************************************************/
30   getNodePosition(instance, deepNodeName? : string) : number;
31
32   /***********************************************************
33    * return if user should provide instance name or not
34    * @param currentModel - The model of current object
35    * @param parentModel - The parent model of current object.
36    ************************************************************/
37   isEcompGeneratedNaming(currentModel, parentModel?): boolean;
38
39
40   /***********************
41    * update node position
42    ***********************/
43   updatePosition(node, that, instanceId, parentStoreKey?) : void;
44
45   /***********************************************************
46    * return object instance
47    * @param modelId - The model id
48    * @param serviceHierarchy - The serviceHierarchy store
49    * @param instance - existing instance details
50    ************************************************************/
51   getModel(modelId: string, instance: any, serviceHierarchy): 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    ************************************************************/
66   createInstanceTreeNode(instance: any, model: any, parentModel: any, storeKey: string): any
67
68   /***********************************************************
69    * return if instance has some missing data
70    * @param instance - The instance of current object
71    * @param dynamicInputs
72    * @param isEcompGeneratedNaming - boolean
73    ************************************************************/
74   hasMissingData(instance, dynamicInputs: any, isEcompGeneratedNaming: boolean): boolean;
75
76   /************************
77    * return object tooltip
78    ************************/
79   getTooltip(): string;
80
81   /************************
82    * return object type
83    ************************/
84   getType(): string;
85
86   /************************************
87    * return child model option object
88    ***********************************/
89   getNextLevelObject(): any;
90
91   /***********************************************************
92    * open popup
93    * @param node - current ITrees node
94    * @param serviceModelId - service id
95    ************************************************************/
96   onClickAdd(node: ITreeNode, serviceModelId: string): void;
97
98   /***********************************************************
99    * get number of existing node instance
100    * @param node - current ITrees node
101    * @param serviceModelId - service id
102    ************************************************************/
103   getNodeCount(node: ITreeNode, serviceModelId: string): number;
104
105   /***********************************************************
106    * should show node icon
107    * @param node - current ITrees node
108    * @param serviceModelId - service id
109    ************************************************************/
110   showNodeIcons(node: ITreeNode, serviceModelId: string): AvailableNodeIcons;
111
112   /***********************************************************
113    * should return list of actions and there methods
114    * @param node - current ITrees node
115    * @param serviceModelId
116    ************************************************************/
117   getMenuAction(node: ITreeNode, serviceModelId: string): { [methodName: string]: { method: Function, visible: Function, enable: Function } };
118
119
120   onSelectedNode(node : ITreeNode): void
121 }