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";
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;
18 isEcompGeneratedNaming = () : boolean => true;
20 updateDynamicInputsDataFromModel = () : any => [];
22 getNextLevelObject = (): any => null;
24 getTooltip = () : string => 'Configuration';
26 getType = () : string => "Configuration";
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)) {
41 createInstanceTreeNode(instance: any, model: any, storeKey: string, serviceModelId: string): any {return null;}
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, []);
55 onClickAdd(node: ITreeNode, serviceModelId: string): void {
58 getNodeCount(node: ITreeNode, serviceModelId: string): number {
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 {
71 getMenuAction(node: ITreeNode, serviceModelId : string){
77 updatePosition(that , node, instanceId): void {
81 getNodePosition(instance): number {
85 onSelectedNode(node: ITreeNode): void {
88 getInfo(model, instance): ModelInformationItem[] {