aboutsummaryrefslogtreecommitdiffstats
path: root/vid-webpack-master/src/app/drawingBoard/service-planning/objectsToTree/models/basic.model.info.ts
blob: 51b6cfacbfb7f44c1d0e5b9521d64cd6faabbbfa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
import {ITreeNode} from "angular-tree-component/dist/defs/api";
import {AvailableNodeIcons} from "../../available-models-tree/available-models-tree.service";

export interface ILevelNodeInfo {
  /** Name of the key inside the serviceHierarchy object **/
  name: string;

  /** Type of the object**/
  type: string;

  /** Child name inside the of the serviceHierarchy object (if exist) **/
  childName?: string;

  /** Child type the of object (if exist) **/
  childType?: string;

  /** model type name **/
  typeName?: string;

  /** is instance failed **/
  isFailed?: boolean;

  /** number of failed **/
  numberOfFailed?: number;

  /***********************************************************
   * return node position
   * @param instance - instance
   ************************************************************/
  getNodePosition(instance, deepNodeName? : string) : number;

  /***********************************************************
   * return if user should provide instance name or not
   * @param currentModel - The model of current object
   * @param parentModel - The parent model of current object.
   ************************************************************/
  isEcompGeneratedNaming(currentModel, parentModel?): boolean;


  /***********************
   * update node position
   ***********************/
  updatePosition(node, that, instanceId, parentStoreKey?) : void;

  /***********************************************************
   * return object instance
   * @param modelId - The model id
   * @param serviceHierarchy - The serviceHierarchy store
   * @param instance - existing instance details
   ************************************************************/
  getModel(modelId: string, instance: any, serviceHierarchy): any;

  /***********************************************************
   * return dynamic inputs of current model
   * @param currentModel - The model of current object
   ************************************************************/
  updateDynamicInputsDataFromModel(currentModel): any;

  /***********************************************************
   * return tree node instance
   * @param instance - The model of current object
   * @param model - The model of current object
   * @param parentModel
   * @param storeKey - instance storeKey if exist (for duplicate)
   ************************************************************/
  createInstanceTreeNode(instance: any, model: any, parentModel: any, storeKey: string): any

  /***********************************************************
   * return if instance has some missing data
   * @param instance - The instance of current object
   * @param dynamicInputs
   * @param isEcompGeneratedNaming - boolean
   ************************************************************/
  hasMissingData(instance, dynamicInputs: any, isEcompGeneratedNaming: boolean): boolean;

  /************************
   * return object tooltip
   ************************/
  getTooltip(): string;

  /************************
   * return object type
   ************************/
  getType(): string;

  /************************************
   * return child model option object
   ***********************************/
  getNextLevelObject(): any;

  /***********************************************************
   * open popup
   * @param node - current ITrees node
   * @param serviceModelId - service id
   ************************************************************/
  onClickAdd(node: ITreeNode, serviceModelId: string): void;

  /***********************************************************
   * get number of existing node instance
   * @param node - current ITrees node
   * @param serviceModelId - service id
   ************************************************************/
  getNodeCount(node: ITreeNode, serviceModelId: string): number;

  /***********************************************************
   * should show node icon
   * @param node - current ITrees node
   * @param serviceModelId - service id
   ************************************************************/
  showNodeIcons(node: ITreeNode, serviceModelId: string): AvailableNodeIcons;

  /***********************************************************
   * should return list of actions and there methods
   * @param node - current ITrees node
   * @param serviceModelId
   ************************************************************/
  getMenuAction(node: ITreeNode, serviceModelId: string): { [methodName: string]: { method: Function, visible: Function, enable: Function } };


  onSelectedNode(node : ITreeNode): void
}