NodeInfo::getModel expects the instance-model
[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 import {ComponentInfoType} from "../../../component-info/component-info-model";
8 import {ModelInformationItem} from "../../../../../shared/components/model-information/model-information.component";
9
10 export class ConfigurationModelInfo implements ILevelNodeInfo{
11   constructor(private _dynamicInputsService : DynamicInputsService,
12               private _sharedTreeService : SharedTreeService){}
13   name: string = 'configurations';
14   type : string = 'Configuration';
15   typeName : string = 'C';
16   componentInfoType = ComponentInfoType.CONFIGURATION;
17
18   isEcompGeneratedNaming = () : boolean => true;
19
20   updateDynamicInputsDataFromModel = () : any => [];
21
22   getNextLevelObject = (): any => null;
23
24   getTooltip = () : string => 'Configuration';
25
26   getType = () : string => "Configuration";
27
28   /***********************************************************
29    * @param instanceModel - The model of the instance (usually extracted from serviceHierarchy store)
30    ************************************************************/
31   getModel = (instanceModel: any) : any =>{
32     if (!_.isNil(instanceModel)) {
33       return instanceModel;
34     }
35     return {};
36   };
37
38   createInstanceTreeNode(instance: any, model: any, storeKey: string, serviceModelId: string): any {return null;}
39
40   childNames: string[];
41
42   /***********************************************************
43    * return if instance has missing data
44    * @param instance - vnf instance
45    * @param dynamicInputs
46    * @param isEcompGeneratedNaming
47    ************************************************************/
48   hasMissingData(instance, dynamicInputs: any, isEcompGeneratedNaming: boolean): boolean {
49     return this._sharedTreeService.hasMissingData(instance, dynamicInputs, isEcompGeneratedNaming, []);
50   }
51
52   onClickAdd(node: ITreeNode, serviceModelId: string): void {
53   }
54
55   getNodeCount(node: ITreeNode, serviceModelId: string): number {
56     return 0;
57   }
58
59   /***********************************************************
60    * should show node icon
61    * @param node - current ITrees node
62    * @param serviceModelId - service id
63    ************************************************************/
64   showNodeIcons(node: ITreeNode, serviceModelId: string): AvailableNodeIcons {
65     return null;
66   }
67
68   getMenuAction(node: ITreeNode, serviceModelId : string){
69     return {
70
71     }
72   }
73
74   updatePosition(that , node, instanceId): void {
75     // TODO
76   }
77
78   getNodePosition(instance): number {
79     return null;
80   }
81
82   onSelectedNode(node: ITreeNode): void {
83   }
84
85   getInfo(model, instance): ModelInformationItem[] {
86     return [];
87   }
88
89 }