blob: cd488d9cd1935c4a958b620fec592c0b75676896 [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";
Michael Landoed64b5e2017-06-09 03:19:04 +030084
85export const upgradeAdapter = new UpgradeAdapter(forwardRef(() => AppModule));
86
Michael Lando5b593492018-07-29 16:13:45 +030087export function configServiceFactory(config: ConfigService) {
Idan Amit2c285722017-12-29 09:40:43 +020088 return () => {
Idan Amitf1039ca2018-05-21 16:09:35 +030089 return Promise.all([
90 config.loadValidationConfiguration(),
91 config.loadPluginsConfiguration()
92 ]);
Idan Amit2c285722017-12-29 09:40:43 +020093 }
Michael Landoed64b5e2017-06-09 03:19:04 +030094}
95
Michael Landoed64b5e2017-06-09 03:19:04 +030096
97@NgModule({
98 declarations: [
Tal Gitelman51d50f02017-12-10 18:55:03 +020099 AppComponent
Michael Landoed64b5e2017-06-09 03:19:04 +0300100 ],
101 imports: [
102 BrowserModule,
103 UpgradeModule,
104 FormsModule,
105 HttpModule,
Tal Gitelman51d50f02017-12-10 18:55:03 +0200106 LayoutModule,
107 TranslateModule,
Michael Lando5b593492018-07-29 16:13:45 +0300108 MultilineEllipsisModule,
Tal Gitelman51d50f02017-12-10 18:55:03 +0200109 UiElementsModule,
Michael Lando5b593492018-07-29 16:13:45 +0300110 CompositionPanelModule,
111 SdcUiComponentsModule,
112 AutomatedUpgradeModule,
Tal Gitelman51d50f02017-12-10 18:55:03 +0200113 //We need to import them here since we use them in angular1
114 ConnectionWizardModule,
Idan Amit5197c8b2018-01-15 14:31:42 +0200115 PropertiesAssignmentModule,
Talio09537852019-01-31 18:00:36 +0200116 PropertyCreatorModule,
Michael Landoa5445102018-03-04 14:53:33 +0200117 PluginFrameModule,
Arielk802bd2a2018-04-16 15:37:39 +0300118 InterfaceOperationModule,
119 OperationCreatorModule,
Michael Landoa5445102018-03-04 14:53:33 +0200120 ServicePathCreatorModule,
121 ServicePathsListModule,
122 ServicePathModule,
miriamec2ce9142019-02-13 15:17:26 +0200123 ServicePathSelectorModule,
ojasdubey4192e3c2019-03-18 14:15:03 +0530124 ServiceConsumptionModule,
125 ServiceConsumptionCreatorModule,
miriamec2ce9142019-02-13 15:17:26 +0200126 ServiceDependenciesModule,
miriame41ee9cb2019-03-04 13:49:15 +0200127 ServiceDependenciesEditorModule,
128 RequirementsEditorModule,
Piotr Darosz2c25cba2019-03-27 15:25:50 +0100129 CapabilitiesEditorModule,
130 GenericArtifactBrowserModule
Michael Landoed64b5e2017-06-09 03:19:04 +0300131 ],
132 exports: [],
Michael Lando5b593492018-07-29 16:13:45 +0300133 entryComponents: [
134 // *** sdc-ui components to be used as downgraded:
miriame41ee9cb2019-03-04 13:49:15 +0200135 SdcUiComponents.SvgIconComponent
Michael Lando5b593492018-07-29 16:13:45 +0300136 ],
Michael Landoed64b5e2017-06-09 03:19:04 +0300137 providers: [
Michael Lando5b593492018-07-29 16:13:45 +0300138 WindowRef,
Michael Landoed64b5e2017-06-09 03:19:04 +0300139 DataTypesServiceProvider,
140 SharingServiceProvider,
Michael Lando5b593492018-07-29 16:13:45 +0300141 ComponentFactoryProvider,
Michael Landoed64b5e2017-06-09 03:19:04 +0300142 CookieServiceProvider,
Tal Gitelman51d50f02017-12-10 18:55:03 +0200143 StateServiceFactory,
Michael Landoed64b5e2017-06-09 03:19:04 +0300144 StateParamsServiceFactory,
Michael Landoa5445102018-03-04 14:53:33 +0200145 ScopeServiceFactory,
Michael Landob3d48982017-06-11 14:22:02 +0300146 CacheServiceProvider,
147 EventListenerServiceProvider,
Michael Landoa5445102018-03-04 14:53:33 +0200148 NotificationServiceProvider,
Michael Lando5b593492018-07-29 16:13:45 +0300149 ModalsHandlerProvider,
Michael Landoed64b5e2017-06-09 03:19:04 +0300150 AuthenticationService,
151 Cookie2Service,
152 ConfigService,
153 ComponentServiceNg2,
Michael Landoa5445102018-03-04 14:53:33 +0200154 ComponentServiceFactoryNg2,
Tal Gitelman51d50f02017-12-10 18:55:03 +0200155 ModalService,
Michael Landoed64b5e2017-06-09 03:19:04 +0300156 ServiceServiceNg2,
Michael Lando5b593492018-07-29 16:13:45 +0300157 AutomatedUpgradeService,
Arielkeaaf8012018-07-31 12:59:36 +0300158 WorkflowServiceNg2,
miriame41ee9cb2019-03-04 13:49:15 +0200159 ToscaTypesServiceNg2,
Avi Zivf5854fd2017-07-31 15:50:46 +0300160 HttpService,
Tal Gitelman51d50f02017-12-10 18:55:03 +0200161 UserService,
Michael Landoa5445102018-03-04 14:53:33 +0200162 PoliciesService,
Michael Lando5b593492018-07-29 16:13:45 +0300163 GroupsService,
Michael Landoa5445102018-03-04 14:53:33 +0200164 DynamicComponentService,
Tal Gitelman51d50f02017-12-10 18:55:03 +0200165 SdcConfig,
Michael Lando5b593492018-07-29 16:13:45 +0300166 SdcMenu,
Michael Landoed64b5e2017-06-09 03:19:04 +0300167 ComponentInstanceServiceNg2,
Tal Gitelman51d50f02017-12-10 18:55:03 +0200168 TranslationServiceConfig,
Idan Amiteedaaf92018-01-31 13:27:33 +0200169 PluginsService,
Piotr Darosz2c25cba2019-03-27 15:25:50 +0100170 GabService,
Michael Lando5b593492018-07-29 16:13:45 +0300171 ArchiveService,
Idan Amit71904f22018-02-13 10:38:16 +0200172 EventBusService,
Michael Landoed64b5e2017-06-09 03:19:04 +0300173 {
174 provide: APP_INITIALIZER,
175 useFactory: configServiceFactory,
176 deps: [ConfigService],
177 multi: true
Tal Gitelmaned7e1c32017-06-29 19:30:00 +0300178 },
Michael Lando5b593492018-07-29 16:13:45 +0300179 ],
Michael Landoed64b5e2017-06-09 03:19:04 +0300180 bootstrap: [AppComponent]
181})
182
183
184export class AppModule {
Michael Lando5b593492018-07-29 16:13:45 +0300185 constructor(public upgrade: UpgradeModule, public eventBusService:EventBusService) {
Michael Landoed64b5e2017-06-09 03:19:04 +0300186
Michael Landoed64b5e2017-06-09 03:19:04 +0300187 }
188}