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";
8 export class ConfigurationModelInfo implements ILevelNodeInfo{
9 constructor(private _dynamicInputsService : DynamicInputsService,
10 private _sharedTreeService : SharedTreeService){}
11 name: string = 'configurations';
12 type : string = 'Configuration';
13 typeName : string = 'C';
15 isEcompGeneratedNaming = () : boolean => true;
17 updateDynamicInputsDataFromModel = () : any => [];
19 getNextLevelObject = (): any => null;
21 getTooltip = () : string => 'Configuration';
23 getType = () : string => "Configuration";
25 /***********************************************************
26 * return configuration model
27 * @param configurationModelId - current Model id
28 * @param serviceHierarchy - serviceHierarchy
29 ************************************************************/
30 getModel = (configurationModelId : string, serviceHierarchy) : any =>{
31 if(!_.isNil(serviceHierarchy)){
32 if(!_.isNil(serviceHierarchy[this.name]) && !_.isNil(serviceHierarchy[this.name][configurationModelId])){
33 return serviceHierarchy[this.name][configurationModelId];
39 createInstanceTreeNode(instance: any, model: any, storeKey: string): any {return null;}
44 /***********************************************************
45 * return if instance has missing data
46 * @param instance - vnf instance
47 * @param dynamicInputs
48 * @param isEcompGeneratedNaming
49 ************************************************************/
50 hasMissingData(instance, dynamicInputs: any, isEcompGeneratedNaming: boolean): boolean {
51 return this._sharedTreeService.hasMissingData(instance, dynamicInputs, isEcompGeneratedNaming, []);
54 onClickAdd(node: ITreeNode, serviceModelId: string): void {
57 getNodeCount(node: ITreeNode, serviceModelId: string): number {
61 /***********************************************************
62 * should show node icon
63 * @param node - current ITrees node
64 * @param serviceModelId - service id
65 ************************************************************/
66 showNodeIcons(node: ITreeNode, serviceModelId: string): AvailableNodeIcons {
70 getMenuAction(node: ITreeNode, serviceModelId : string){
76 updatePosition(that , node, instanceId): void {
80 getNodePosition(instance): number {
84 onSelectedNode(node: ITreeNode): void {