0d1a9aadeece33327246572e77b55507a0b2e939
[vid.git] /
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    * return configuration model
30    * @param configurationModelId - current Model id
31    * @param serviceHierarchy - serviceHierarchy
32    ************************************************************/
33   getModel = (configurationModelId : string, serviceHierarchy) : any =>{
34     if(!_.isNil(serviceHierarchy)){
35       if(!_.isNil(serviceHierarchy[this.name]) && !_.isNil(serviceHierarchy[this.name][configurationModelId])){
36         return serviceHierarchy[this.name][configurationModelId];
37       }
38     }
39     return {};
40   };
41
42   createInstanceTreeNode(instance: any, model: any, storeKey: string): any {return null;}
43
44   childNames: string[];
45
46   /***********************************************************
47    * return if instance has missing data
48    * @param instance - vnf instance
49    * @param dynamicInputs
50    * @param isEcompGeneratedNaming
51    ************************************************************/
52   hasMissingData(instance, dynamicInputs: any, isEcompGeneratedNaming: boolean): boolean {
53     return this._sharedTreeService.hasMissingData(instance, dynamicInputs, isEcompGeneratedNaming, []);
54   }
55
56   onClickAdd(node: ITreeNode, serviceModelId: string): void {
57   }
58
59   getNodeCount(node: ITreeNode, serviceModelId: string): number {
60     return 0;
61   }
62
63   /***********************************************************
64    * should show node icon
65    * @param node - current ITrees node
66    * @param serviceModelId - service id
67    ************************************************************/
68   showNodeIcons(node: ITreeNode, serviceModelId: string): AvailableNodeIcons {
69     return null;
70   }
71
72   getMenuAction(node: ITreeNode, serviceModelId : string){
73     return {
74
75     }
76   }
77
78   updatePosition(that , node, instanceId): void {
79     // TODO
80   }
81
82   getNodePosition(instance): number {
83     return null;
84   }
85
86   onSelectedNode(node: ITreeNode): void {
87   }
88
89   getInfo(model, instance): ModelInformationItem[] {
90     return [];
91   }
92
93 }