1 import {Injectable} from "@angular/core";
2 import {ILevelNodeInfo} from "./models/basic.model.info";
3 import {VnfModelInfo} from "./models/vnf/vnf.model.info";
4 import {NetworkModelInfo} from "./models/network/network.model.info";
5 import {ConfigurationModelInfo} from "./models/configuration/configuration.model.info";
6 import {DefaultDataGeneratorService} from "../../../shared/services/defaultDataServiceGenerator/default.data.generator.service";
7 import {DynamicInputsService} from "./dynamicInputs.service";
8 import {SharedTreeService} from "./shared.tree.service";
9 import {NgRedux} from "@angular-redux/store";
10 import {AppState} from "../../../shared/store/reducers";
11 import {DialogService} from "ng2-bootstrap-modal";
12 import {VnfPopupService} from "../../../shared/components/genericFormPopup/genericFormServices/vnf/vnf.popup.service";
13 import {NetworkPopupService} from "../../../shared/components/genericFormPopup/genericFormServices/network/network.popup.service";
14 import {VfModulePopupService} from "../../../shared/components/genericFormPopup/genericFormServices/vfModule/vfModule.popup.service";
15 import {VnfGroupingModelInfo} from "./models/vnfGrouping/vnfGrouping.model.info";
16 import {VnfGroupPopupService} from "../../../shared/components/genericFormPopup/genericFormServices/vnfGroup/vnfGroup.popup.service";
17 import {DuplicateService} from "../duplicate/duplicate.service";
18 import {IframeService} from "../../../shared/utils/iframe.service";
19 import {ComponentInfoService} from "../component-info/component-info.service";
20 import {PnfModelInfo} from "./models/pnf/pnf.model.info";
21 import {CollectionResourceModelInfo} from "./models/collectionResource/collectionResource.model.info";
22 import {AaiService} from "../../../shared/services/aaiService/aai.service";
23 import {VrfModelInfo} from "./models/vrf/vrf.model.info";
24 import {NetworkStepService} from "./models/vrf/vrfModal/networkStep/network.step.service";
25 import {VpnStepService} from "./models/vrf/vrfModal/vpnStep/vpn.step.service";
26 import {VfModuleUpgradePopupService} from "../../../shared/components/genericFormPopup/genericFormServices/vfModuleUpgrade/vfModule.upgrade.popuop.service";
27 import {FeatureFlagsService, Features} from "../../../shared/services/featureFlag/feature-flags.service";
28 import {ModalService} from "../../../shared/components/customModal/services/modal.service";
29 import {PnfPopupService} from "../../../shared/components/genericFormPopup/genericFormServices/pnf/pnf.popup.service";
30 import {PnfModelInfoExtended} from "./models/pnf/pnf.model.info.extended";
33 export class ObjectToTreeService {
34 constructor(private _defaultDataGeneratorService: DefaultDataGeneratorService,
35 private _dynamicInputsService: DynamicInputsService,
36 private _sharedTreeService: SharedTreeService,
37 private _dialogService: DialogService,
38 private _vnfPopupService: VnfPopupService,
39 private _pnfPopupService: PnfPopupService,
40 private _networkPopupService: NetworkPopupService,
41 private _vfModulePopupService: VfModulePopupService,
42 private _vfModuleUpgradePopupService: VfModuleUpgradePopupService,
43 private _vnfGroupPopupService: VnfGroupPopupService,
44 private _duplicateService: DuplicateService,
45 private _modalService: ModalService,
46 private _iframeService: IframeService,
47 private _componentInfoService: ComponentInfoService,
48 private _networkStepService: NetworkStepService,
49 private _vpnStepService: VpnStepService,
50 private _aaiService: AaiService,
51 private _featureFlagsService: FeatureFlagsService,
52 private _store: NgRedux<AppState>) {
56 /***********************************************************
57 * return all first optional first level of the model tree
58 ************************************************************/
59 getFirstLevelOptions(isALaCarte: boolean): ILevelNodeInfo[] {
60 if (FeatureFlagsService.getFlagState(Features.FLAG_EXTENDED_MACRO_PNF_CONFIG, this._store) === true && isALaCarte === false) {
61 return [new VnfModelInfo(this._dynamicInputsService, this._sharedTreeService, this._defaultDataGeneratorService, this._dialogService, this._vnfPopupService, this._vfModulePopupService, this._vfModuleUpgradePopupService, this._duplicateService, this._modalService, this._iframeService, this._componentInfoService, this._featureFlagsService, this._store)
62 , new NetworkModelInfo(this._dynamicInputsService, this._sharedTreeService, this._dialogService, this._networkPopupService, this._duplicateService, this._modalService, this._iframeService, this._featureFlagsService, this._store),
63 new PnfModelInfoExtended(this._store, this._sharedTreeService, this._dialogService, this._pnfPopupService),
64 new VrfModelInfo(this._store, this._sharedTreeService, this._dialogService, this._iframeService, this._featureFlagsService, this._networkStepService, this._vpnStepService),
65 new CollectionResourceModelInfo(this._store, this._sharedTreeService),
66 new ConfigurationModelInfo(this._dynamicInputsService, this._sharedTreeService),
67 new VnfGroupingModelInfo(this._dynamicInputsService, this._sharedTreeService, this._dialogService, this._vnfGroupPopupService, this._iframeService, this._aaiService, this._store)];
69 return [new VnfModelInfo(this._dynamicInputsService, this._sharedTreeService, this._defaultDataGeneratorService, this._dialogService, this._vnfPopupService, this._vfModulePopupService, this._vfModuleUpgradePopupService, this._duplicateService, this._modalService, this._iframeService, this._componentInfoService, this._featureFlagsService, this._store)
70 , new NetworkModelInfo(this._dynamicInputsService, this._sharedTreeService, this._dialogService, this._networkPopupService, this._duplicateService, this._modalService, this._iframeService, this._featureFlagsService, this._store),
71 new PnfModelInfo(this._sharedTreeService),
72 new VrfModelInfo(this._store, this._sharedTreeService, this._dialogService, this._iframeService, this._featureFlagsService, this._networkStepService, this._vpnStepService),
73 new CollectionResourceModelInfo(this._store, this._sharedTreeService),
74 new ConfigurationModelInfo(this._dynamicInputsService, this._sharedTreeService),
75 new VnfGroupingModelInfo(this._dynamicInputsService, this._sharedTreeService, this._dialogService, this._vnfGroupPopupService, this._iframeService, this._aaiService, this._store)];