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