blob: b541beb3d708964154c574b574f2899dcfaa2f49 [file] [log] [blame]
Michael Landodd603392017-07-12 00:54:52 +03001/*-
2 * ============LICENSE_START=======================================================
3 * SDC
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
Piotr Darosz2c25cba2019-03-27 15:25:50 +01006 * Modifications Copyright (C) 2019 Nokia. All rights reserved.
Michael Landodd603392017-07-12 00:54:52 +03007 * ================================================================================
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
Idan Amit2c285722017-12-29 09:40:43 +020011 *
Michael Landodd603392017-07-12 00:54:52 +030012 * http://www.apache.org/licenses/LICENSE-2.0
Idan Amit2c285722017-12-29 09:40:43 +020013 *
Michael Landodd603392017-07-12 00:54:52 +030014 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
19 * ============LICENSE_END=========================================================
20 */
21
Michael Lando5b593492018-07-29 16:13:45 +030022import { BrowserModule } from '@angular/platform-browser';
23import { NgModule, APP_INITIALIZER } from '@angular/core';
24import { FormsModule } from '@angular/forms';
25import { forwardRef } from '@angular/core';
26import { AppComponent } from './app.component';
27import { UpgradeAdapter } from '@angular/upgrade';
28import { UpgradeModule } from '@angular/upgrade/static';
29import { SdcUiComponentsModule, SdcUiComponents } from "sdc-ui/lib/angular";
30import { PropertiesAssignmentModule } from './pages/properties-assignment/properties-assignment.module';
Talio09537852019-01-31 18:00:36 +020031import { PropertyCreatorModule } from './pages/properties-assignment/property-creator/property-creator.module';
Michael Landoed64b5e2017-06-09 03:19:04 +030032import {
Tal Gitelman51d50f02017-12-10 18:55:03 +020033 DataTypesServiceProvider, SharingServiceProvider, CookieServiceProvider, StateServiceFactory,
Michael Landoa5445102018-03-04 14:53:33 +020034 StateParamsServiceFactory, CacheServiceProvider, EventListenerServiceProvider, ScopeServiceFactory,
Michael Lando5b593492018-07-29 16:13:45 +030035 NotificationServiceProvider, ComponentFactoryProvider
Michael Landoed64b5e2017-06-09 03:19:04 +030036} from "./utils/ng1-upgraded-provider";
Michael Lando5b593492018-07-29 16:13:45 +030037import { ConfigService } from "./services/config.service";
38import { HttpModule } from '@angular/http';
39import { HttpService } from './services/http.service';
40import { AuthenticationService } from './services/authentication.service';
41import { Cookie2Service } from "./services/cookie.service";
42import { ComponentServiceNg2 } from "./services/component-services/component.service";
43import { ComponentServiceFactoryNg2 } from "./services/component-services/component.service.factory";
44import { ServiceServiceNg2 } from "./services/component-services/service.service";
45import { ComponentInstanceServiceNg2 } from "./services/component-instance-services/component-instance.service";
Arielkeaaf8012018-07-31 12:59:36 +030046import { WorkflowServiceNg2 } from './services/workflow.service';
miriame41ee9cb2019-03-04 13:49:15 +020047import {ToscaTypesServiceNg2} from "./services/tosca-types.service";
Michael Lando5b593492018-07-29 16:13:45 +030048import { ModalService } from "./services/modal.service";
49import { UiElementsModule } from "./components/ui/ui-elements.module";
50import { ConnectionWizardModule } from "./pages/connection-wizard/connection-wizard.module";
Arielkeaaf8012018-07-31 12:59:36 +030051import { InterfaceOperationModule } from "./pages/interface-operation/interface-operation.module";
52import { OperationCreatorModule } from "./pages/interface-operation/operation-creator/operation-creator.module";
Michael Lando5b593492018-07-29 16:13:45 +030053import { LayoutModule } from "./components/layout/layout.module";
54import { UserService } from "./services/user.service";
55import { DynamicComponentService } from "./services/dynamic-component.service";
56import { SdcConfig } from "./config/sdc-config.config";
57import { SdcMenu } from "./config/sdc-menu.config";
Tal Gitelman51d50f02017-12-10 18:55:03 +020058import { TranslateModule } from "./shared/translator/translate.module";
59import { TranslationServiceConfig } from "./config/translation.service.config";
Michael Lando5b593492018-07-29 16:13:45 +030060import { MultilineEllipsisModule } from "./shared/multiline-ellipsis/multiline-ellipsis.module";
61import { ServicePathCreatorModule } from './pages/service-path-creator/service-path-creator.module';
62import { ServicePathsListModule } from './pages/service-paths-list/service-paths-list.module';
63import { ServicePathModule } from 'app/ng2/components/logic/service-path/service-path.module';
64import { ServicePathSelectorModule } from 'app/ng2/components/logic/service-path-selector/service-path-selector.module';
ojasdubey4192e3c2019-03-18 14:15:03 +053065import { ServiceConsumptionModule } from 'app/ng2/components/logic/service-consumption/service-consumption.module';
66import { ServiceConsumptionCreatorModule } from './pages/service-consumption-editor/service-consumption-editor.module';
miriamec2ce9142019-02-13 15:17:26 +020067import {ServiceDependenciesModule} from 'app/ng2/components/logic/service-dependencies/service-dependencies.module';
68import {ServiceDependenciesEditorModule} from './pages/service-dependencies-editor/service-dependencies-editor.module';
Michael Lando5b593492018-07-29 16:13:45 +030069import { CompositionPanelModule } from 'app/ng2/pages/composition/panel/panel.module';
70import { WindowRef } from "./services/window.service";
71import {ArchiveService} from "./services/archive.service";
72import { ModalsHandlerProvider } from './utils/ng1-upgraded-provider';
Idan Amiteedaaf92018-01-31 13:27:33 +020073import {PluginFrameModule} from "./components/ui/plugin/plugin-frame.module";
74import {PluginsService} from "./services/plugins.service";
Idan Amit71904f22018-02-13 10:38:16 +020075import {EventBusService} from "./services/event-bus.service";
Michael Lando5b593492018-07-29 16:13:45 +030076import {GroupsService} from "./services/groups.service";
77import {PoliciesService} from "./services/policies.service";
78import {AutomatedUpgradeService} from "./pages/automated-upgrade/automated-upgrade.service";
79import {AutomatedUpgradeModule} from "./pages/automated-upgrade/automated-upgrade.module";
miriame41ee9cb2019-03-04 13:49:15 +020080import {RequirementsEditorModule} from "./pages/req-and-capabilities-editor/requirements-editor/requirements-editor.module"
81import {CapabilitiesEditorModule} from "./pages/req-and-capabilities-editor/capabilities-editor/capabilities-editor.module"
Piotr Darosz2c25cba2019-03-27 15:25:50 +010082import {GenericArtifactBrowserModule} from "./components/logic/generic-artifact-browser/generic-artifact-browser.module";
83import {GabService} from "./services/gab.service";
Toshimichi Fukuda51411ac2019-04-18 21:38:46 +090084import {DeclareListModule} from "./pages/properties-assignment/declare-list/declare-list.module"
Michael Landoed64b5e2017-06-09 03:19:04 +030085
86export const upgradeAdapter = new UpgradeAdapter(forwardRef(() => AppModule));
87
Michael Lando5b593492018-07-29 16:13:45 +030088export function configServiceFactory(config: ConfigService) {
Idan Amit2c285722017-12-29 09:40:43 +020089 return () => {
Idan Amitf1039ca2018-05-21 16:09:35 +030090 return Promise.all([
91 config.loadValidationConfiguration(),
92 config.loadPluginsConfiguration()
93 ]);
Idan Amit2c285722017-12-29 09:40:43 +020094 }
Michael Landoed64b5e2017-06-09 03:19:04 +030095}
96
Michael Landoed64b5e2017-06-09 03:19:04 +030097
98@NgModule({
99 declarations: [
Tal Gitelman51d50f02017-12-10 18:55:03 +0200100 AppComponent
Michael Landoed64b5e2017-06-09 03:19:04 +0300101 ],
102 imports: [
103 BrowserModule,
104 UpgradeModule,
105 FormsModule,
106 HttpModule,
Tal Gitelman51d50f02017-12-10 18:55:03 +0200107 LayoutModule,
108 TranslateModule,
Michael Lando5b593492018-07-29 16:13:45 +0300109 MultilineEllipsisModule,
Tal Gitelman51d50f02017-12-10 18:55:03 +0200110 UiElementsModule,
Michael Lando5b593492018-07-29 16:13:45 +0300111 CompositionPanelModule,
112 SdcUiComponentsModule,
113 AutomatedUpgradeModule,
Tal Gitelman51d50f02017-12-10 18:55:03 +0200114 //We need to import them here since we use them in angular1
115 ConnectionWizardModule,
Idan Amit5197c8b2018-01-15 14:31:42 +0200116 PropertiesAssignmentModule,
Talio09537852019-01-31 18:00:36 +0200117 PropertyCreatorModule,
Toshimichi Fukuda51411ac2019-04-18 21:38:46 +0900118 DeclareListModule,
Michael Landoa5445102018-03-04 14:53:33 +0200119 PluginFrameModule,
Arielk802bd2a2018-04-16 15:37:39 +0300120 InterfaceOperationModule,
121 OperationCreatorModule,
Michael Landoa5445102018-03-04 14:53:33 +0200122 ServicePathCreatorModule,
123 ServicePathsListModule,
124 ServicePathModule,
miriamec2ce9142019-02-13 15:17:26 +0200125 ServicePathSelectorModule,
ojasdubey4192e3c2019-03-18 14:15:03 +0530126 ServiceConsumptionModule,
127 ServiceConsumptionCreatorModule,
miriamec2ce9142019-02-13 15:17:26 +0200128 ServiceDependenciesModule,
miriame41ee9cb2019-03-04 13:49:15 +0200129 ServiceDependenciesEditorModule,
130 RequirementsEditorModule,
Piotr Darosz2c25cba2019-03-27 15:25:50 +0100131 CapabilitiesEditorModule,
132 GenericArtifactBrowserModule
Michael Landoed64b5e2017-06-09 03:19:04 +0300133 ],
134 exports: [],
Michael Lando5b593492018-07-29 16:13:45 +0300135 entryComponents: [
136 // *** sdc-ui components to be used as downgraded:
miriame41ee9cb2019-03-04 13:49:15 +0200137 SdcUiComponents.SvgIconComponent
Michael Lando5b593492018-07-29 16:13:45 +0300138 ],
Michael Landoed64b5e2017-06-09 03:19:04 +0300139 providers: [
Michael Lando5b593492018-07-29 16:13:45 +0300140 WindowRef,
Michael Landoed64b5e2017-06-09 03:19:04 +0300141 DataTypesServiceProvider,
142 SharingServiceProvider,
Michael Lando5b593492018-07-29 16:13:45 +0300143 ComponentFactoryProvider,
Michael Landoed64b5e2017-06-09 03:19:04 +0300144 CookieServiceProvider,
Tal Gitelman51d50f02017-12-10 18:55:03 +0200145 StateServiceFactory,
Michael Landoed64b5e2017-06-09 03:19:04 +0300146 StateParamsServiceFactory,
Michael Landoa5445102018-03-04 14:53:33 +0200147 ScopeServiceFactory,
Michael Landob3d48982017-06-11 14:22:02 +0300148 CacheServiceProvider,
149 EventListenerServiceProvider,
Michael Landoa5445102018-03-04 14:53:33 +0200150 NotificationServiceProvider,
Michael Lando5b593492018-07-29 16:13:45 +0300151 ModalsHandlerProvider,
Michael Landoed64b5e2017-06-09 03:19:04 +0300152 AuthenticationService,
153 Cookie2Service,
154 ConfigService,
155 ComponentServiceNg2,
Michael Landoa5445102018-03-04 14:53:33 +0200156 ComponentServiceFactoryNg2,
Tal Gitelman51d50f02017-12-10 18:55:03 +0200157 ModalService,
Michael Landoed64b5e2017-06-09 03:19:04 +0300158 ServiceServiceNg2,
Michael Lando5b593492018-07-29 16:13:45 +0300159 AutomatedUpgradeService,
Arielkeaaf8012018-07-31 12:59:36 +0300160 WorkflowServiceNg2,
miriame41ee9cb2019-03-04 13:49:15 +0200161 ToscaTypesServiceNg2,
Avi Zivf5854fd2017-07-31 15:50:46 +0300162 HttpService,
Tal Gitelman51d50f02017-12-10 18:55:03 +0200163 UserService,
Michael Landoa5445102018-03-04 14:53:33 +0200164 PoliciesService,
Michael Lando5b593492018-07-29 16:13:45 +0300165 GroupsService,
Michael Landoa5445102018-03-04 14:53:33 +0200166 DynamicComponentService,
Tal Gitelman51d50f02017-12-10 18:55:03 +0200167 SdcConfig,
Michael Lando5b593492018-07-29 16:13:45 +0300168 SdcMenu,
Michael Landoed64b5e2017-06-09 03:19:04 +0300169 ComponentInstanceServiceNg2,
Tal Gitelman51d50f02017-12-10 18:55:03 +0200170 TranslationServiceConfig,
Idan Amiteedaaf92018-01-31 13:27:33 +0200171 PluginsService,
Piotr Darosz2c25cba2019-03-27 15:25:50 +0100172 GabService,
Michael Lando5b593492018-07-29 16:13:45 +0300173 ArchiveService,
Idan Amit71904f22018-02-13 10:38:16 +0200174 EventBusService,
Michael Landoed64b5e2017-06-09 03:19:04 +0300175 {
176 provide: APP_INITIALIZER,
177 useFactory: configServiceFactory,
178 deps: [ConfigService],
179 multi: true
Tal Gitelmaned7e1c32017-06-29 19:30:00 +0300180 },
Michael Lando5b593492018-07-29 16:13:45 +0300181 ],
Michael Landoed64b5e2017-06-09 03:19:04 +0300182 bootstrap: [AppComponent]
183})
184
185
186export class AppModule {
Michael Lando5b593492018-07-29 16:13:45 +0300187 constructor(public upgrade: UpgradeModule, public eventBusService:EventBusService) {
Michael Landoed64b5e2017-06-09 03:19:04 +0300188
Michael Landoed64b5e2017-06-09 03:19:04 +0300189 }
190}