Michael Lando | dd60339 | 2017-07-12 00:54:52 +0300 | [diff] [blame] | 1 | /*- |
| 2 | * ============LICENSE_START======================================================= |
| 3 | * SDC |
| 4 | * ================================================================================ |
| 5 | * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. |
Piotr Darosz | 2c25cba | 2019-03-27 15:25:50 +0100 | [diff] [blame] | 6 | * Modifications Copyright (C) 2019 Nokia. All rights reserved. |
Michael Lando | dd60339 | 2017-07-12 00:54:52 +0300 | [diff] [blame] | 7 | * ================================================================================ |
| 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 Amit | 2c28572 | 2017-12-29 09:40:43 +0200 | [diff] [blame] | 11 | * |
Michael Lando | dd60339 | 2017-07-12 00:54:52 +0300 | [diff] [blame] | 12 | * http://www.apache.org/licenses/LICENSE-2.0 |
Idan Amit | 2c28572 | 2017-12-29 09:40:43 +0200 | [diff] [blame] | 13 | * |
Michael Lando | dd60339 | 2017-07-12 00:54:52 +0300 | [diff] [blame] | 14 | * 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 Lando | 5b59349 | 2018-07-29 16:13:45 +0300 | [diff] [blame] | 22 | import { BrowserModule } from '@angular/platform-browser'; |
| 23 | import { NgModule, APP_INITIALIZER } from '@angular/core'; |
| 24 | import { FormsModule } from '@angular/forms'; |
| 25 | import { forwardRef } from '@angular/core'; |
| 26 | import { AppComponent } from './app.component'; |
| 27 | import { UpgradeAdapter } from '@angular/upgrade'; |
| 28 | import { UpgradeModule } from '@angular/upgrade/static'; |
| 29 | import { SdcUiComponentsModule, SdcUiComponents } from "sdc-ui/lib/angular"; |
| 30 | import { PropertiesAssignmentModule } from './pages/properties-assignment/properties-assignment.module'; |
Talio | 0953785 | 2019-01-31 18:00:36 +0200 | [diff] [blame] | 31 | import { PropertyCreatorModule } from './pages/properties-assignment/property-creator/property-creator.module'; |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 32 | import { |
Tal Gitelman | 51d50f0 | 2017-12-10 18:55:03 +0200 | [diff] [blame] | 33 | DataTypesServiceProvider, SharingServiceProvider, CookieServiceProvider, StateServiceFactory, |
Michael Lando | a544510 | 2018-03-04 14:53:33 +0200 | [diff] [blame] | 34 | StateParamsServiceFactory, CacheServiceProvider, EventListenerServiceProvider, ScopeServiceFactory, |
Michael Lando | 5b59349 | 2018-07-29 16:13:45 +0300 | [diff] [blame] | 35 | NotificationServiceProvider, ComponentFactoryProvider |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 36 | } from "./utils/ng1-upgraded-provider"; |
Michael Lando | 5b59349 | 2018-07-29 16:13:45 +0300 | [diff] [blame] | 37 | import { ConfigService } from "./services/config.service"; |
| 38 | import { HttpModule } from '@angular/http'; |
| 39 | import { HttpService } from './services/http.service'; |
| 40 | import { AuthenticationService } from './services/authentication.service'; |
| 41 | import { Cookie2Service } from "./services/cookie.service"; |
| 42 | import { ComponentServiceNg2 } from "./services/component-services/component.service"; |
| 43 | import { ComponentServiceFactoryNg2 } from "./services/component-services/component.service.factory"; |
| 44 | import { ServiceServiceNg2 } from "./services/component-services/service.service"; |
| 45 | import { ComponentInstanceServiceNg2 } from "./services/component-instance-services/component-instance.service"; |
Arielk | eaaf801 | 2018-07-31 12:59:36 +0300 | [diff] [blame] | 46 | import { WorkflowServiceNg2 } from './services/workflow.service'; |
miriame | 41ee9cb | 2019-03-04 13:49:15 +0200 | [diff] [blame] | 47 | import {ToscaTypesServiceNg2} from "./services/tosca-types.service"; |
Michael Lando | 5b59349 | 2018-07-29 16:13:45 +0300 | [diff] [blame] | 48 | import { ModalService } from "./services/modal.service"; |
| 49 | import { UiElementsModule } from "./components/ui/ui-elements.module"; |
| 50 | import { ConnectionWizardModule } from "./pages/connection-wizard/connection-wizard.module"; |
Arielk | eaaf801 | 2018-07-31 12:59:36 +0300 | [diff] [blame] | 51 | import { InterfaceOperationModule } from "./pages/interface-operation/interface-operation.module"; |
| 52 | import { OperationCreatorModule } from "./pages/interface-operation/operation-creator/operation-creator.module"; |
Michael Lando | 5b59349 | 2018-07-29 16:13:45 +0300 | [diff] [blame] | 53 | import { LayoutModule } from "./components/layout/layout.module"; |
| 54 | import { UserService } from "./services/user.service"; |
| 55 | import { DynamicComponentService } from "./services/dynamic-component.service"; |
| 56 | import { SdcConfig } from "./config/sdc-config.config"; |
| 57 | import { SdcMenu } from "./config/sdc-menu.config"; |
Tal Gitelman | 51d50f0 | 2017-12-10 18:55:03 +0200 | [diff] [blame] | 58 | import { TranslateModule } from "./shared/translator/translate.module"; |
| 59 | import { TranslationServiceConfig } from "./config/translation.service.config"; |
Michael Lando | 5b59349 | 2018-07-29 16:13:45 +0300 | [diff] [blame] | 60 | import { MultilineEllipsisModule } from "./shared/multiline-ellipsis/multiline-ellipsis.module"; |
| 61 | import { ServicePathCreatorModule } from './pages/service-path-creator/service-path-creator.module'; |
| 62 | import { ServicePathsListModule } from './pages/service-paths-list/service-paths-list.module'; |
| 63 | import { ServicePathModule } from 'app/ng2/components/logic/service-path/service-path.module'; |
| 64 | import { ServicePathSelectorModule } from 'app/ng2/components/logic/service-path-selector/service-path-selector.module'; |
ojasdubey | 4192e3c | 2019-03-18 14:15:03 +0530 | [diff] [blame] | 65 | import { ServiceConsumptionModule } from 'app/ng2/components/logic/service-consumption/service-consumption.module'; |
| 66 | import { ServiceConsumptionCreatorModule } from './pages/service-consumption-editor/service-consumption-editor.module'; |
miriame | c2ce914 | 2019-02-13 15:17:26 +0200 | [diff] [blame] | 67 | import {ServiceDependenciesModule} from 'app/ng2/components/logic/service-dependencies/service-dependencies.module'; |
| 68 | import {ServiceDependenciesEditorModule} from './pages/service-dependencies-editor/service-dependencies-editor.module'; |
Michael Lando | 5b59349 | 2018-07-29 16:13:45 +0300 | [diff] [blame] | 69 | import { CompositionPanelModule } from 'app/ng2/pages/composition/panel/panel.module'; |
| 70 | import { WindowRef } from "./services/window.service"; |
| 71 | import {ArchiveService} from "./services/archive.service"; |
| 72 | import { ModalsHandlerProvider } from './utils/ng1-upgraded-provider'; |
Idan Amit | eedaaf9 | 2018-01-31 13:27:33 +0200 | [diff] [blame] | 73 | import {PluginFrameModule} from "./components/ui/plugin/plugin-frame.module"; |
| 74 | import {PluginsService} from "./services/plugins.service"; |
Idan Amit | 71904f2 | 2018-02-13 10:38:16 +0200 | [diff] [blame] | 75 | import {EventBusService} from "./services/event-bus.service"; |
Michael Lando | 5b59349 | 2018-07-29 16:13:45 +0300 | [diff] [blame] | 76 | import {GroupsService} from "./services/groups.service"; |
| 77 | import {PoliciesService} from "./services/policies.service"; |
| 78 | import {AutomatedUpgradeService} from "./pages/automated-upgrade/automated-upgrade.service"; |
| 79 | import {AutomatedUpgradeModule} from "./pages/automated-upgrade/automated-upgrade.module"; |
miriame | 41ee9cb | 2019-03-04 13:49:15 +0200 | [diff] [blame] | 80 | import {RequirementsEditorModule} from "./pages/req-and-capabilities-editor/requirements-editor/requirements-editor.module" |
| 81 | import {CapabilitiesEditorModule} from "./pages/req-and-capabilities-editor/capabilities-editor/capabilities-editor.module" |
Piotr Darosz | 2c25cba | 2019-03-27 15:25:50 +0100 | [diff] [blame] | 82 | import {GenericArtifactBrowserModule} from "./components/logic/generic-artifact-browser/generic-artifact-browser.module"; |
| 83 | import {GabService} from "./services/gab.service"; |
Toshimichi Fukuda | 51411ac | 2019-04-18 21:38:46 +0900 | [diff] [blame] | 84 | import {DeclareListModule} from "./pages/properties-assignment/declare-list/declare-list.module" |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 85 | |
| 86 | export const upgradeAdapter = new UpgradeAdapter(forwardRef(() => AppModule)); |
| 87 | |
Michael Lando | 5b59349 | 2018-07-29 16:13:45 +0300 | [diff] [blame] | 88 | export function configServiceFactory(config: ConfigService) { |
Idan Amit | 2c28572 | 2017-12-29 09:40:43 +0200 | [diff] [blame] | 89 | return () => { |
Idan Amit | f1039ca | 2018-05-21 16:09:35 +0300 | [diff] [blame] | 90 | return Promise.all([ |
| 91 | config.loadValidationConfiguration(), |
| 92 | config.loadPluginsConfiguration() |
| 93 | ]); |
Idan Amit | 2c28572 | 2017-12-29 09:40:43 +0200 | [diff] [blame] | 94 | } |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 95 | } |
| 96 | |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 97 | |
| 98 | @NgModule({ |
| 99 | declarations: [ |
Tal Gitelman | 51d50f0 | 2017-12-10 18:55:03 +0200 | [diff] [blame] | 100 | AppComponent |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 101 | ], |
| 102 | imports: [ |
| 103 | BrowserModule, |
| 104 | UpgradeModule, |
| 105 | FormsModule, |
| 106 | HttpModule, |
Tal Gitelman | 51d50f0 | 2017-12-10 18:55:03 +0200 | [diff] [blame] | 107 | LayoutModule, |
| 108 | TranslateModule, |
Michael Lando | 5b59349 | 2018-07-29 16:13:45 +0300 | [diff] [blame] | 109 | MultilineEllipsisModule, |
Tal Gitelman | 51d50f0 | 2017-12-10 18:55:03 +0200 | [diff] [blame] | 110 | UiElementsModule, |
Michael Lando | 5b59349 | 2018-07-29 16:13:45 +0300 | [diff] [blame] | 111 | CompositionPanelModule, |
| 112 | SdcUiComponentsModule, |
| 113 | AutomatedUpgradeModule, |
Tal Gitelman | 51d50f0 | 2017-12-10 18:55:03 +0200 | [diff] [blame] | 114 | //We need to import them here since we use them in angular1 |
| 115 | ConnectionWizardModule, |
Idan Amit | 5197c8b | 2018-01-15 14:31:42 +0200 | [diff] [blame] | 116 | PropertiesAssignmentModule, |
Talio | 0953785 | 2019-01-31 18:00:36 +0200 | [diff] [blame] | 117 | PropertyCreatorModule, |
Toshimichi Fukuda | 51411ac | 2019-04-18 21:38:46 +0900 | [diff] [blame] | 118 | DeclareListModule, |
Michael Lando | a544510 | 2018-03-04 14:53:33 +0200 | [diff] [blame] | 119 | PluginFrameModule, |
Arielk | 802bd2a | 2018-04-16 15:37:39 +0300 | [diff] [blame] | 120 | InterfaceOperationModule, |
| 121 | OperationCreatorModule, |
Michael Lando | a544510 | 2018-03-04 14:53:33 +0200 | [diff] [blame] | 122 | ServicePathCreatorModule, |
| 123 | ServicePathsListModule, |
| 124 | ServicePathModule, |
miriame | c2ce914 | 2019-02-13 15:17:26 +0200 | [diff] [blame] | 125 | ServicePathSelectorModule, |
ojasdubey | 4192e3c | 2019-03-18 14:15:03 +0530 | [diff] [blame] | 126 | ServiceConsumptionModule, |
| 127 | ServiceConsumptionCreatorModule, |
miriame | c2ce914 | 2019-02-13 15:17:26 +0200 | [diff] [blame] | 128 | ServiceDependenciesModule, |
miriame | 41ee9cb | 2019-03-04 13:49:15 +0200 | [diff] [blame] | 129 | ServiceDependenciesEditorModule, |
| 130 | RequirementsEditorModule, |
Piotr Darosz | 2c25cba | 2019-03-27 15:25:50 +0100 | [diff] [blame] | 131 | CapabilitiesEditorModule, |
| 132 | GenericArtifactBrowserModule |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 133 | ], |
| 134 | exports: [], |
Michael Lando | 5b59349 | 2018-07-29 16:13:45 +0300 | [diff] [blame] | 135 | entryComponents: [ |
| 136 | // *** sdc-ui components to be used as downgraded: |
miriame | 41ee9cb | 2019-03-04 13:49:15 +0200 | [diff] [blame] | 137 | SdcUiComponents.SvgIconComponent |
Michael Lando | 5b59349 | 2018-07-29 16:13:45 +0300 | [diff] [blame] | 138 | ], |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 139 | providers: [ |
Michael Lando | 5b59349 | 2018-07-29 16:13:45 +0300 | [diff] [blame] | 140 | WindowRef, |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 141 | DataTypesServiceProvider, |
| 142 | SharingServiceProvider, |
Michael Lando | 5b59349 | 2018-07-29 16:13:45 +0300 | [diff] [blame] | 143 | ComponentFactoryProvider, |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 144 | CookieServiceProvider, |
Tal Gitelman | 51d50f0 | 2017-12-10 18:55:03 +0200 | [diff] [blame] | 145 | StateServiceFactory, |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 146 | StateParamsServiceFactory, |
Michael Lando | a544510 | 2018-03-04 14:53:33 +0200 | [diff] [blame] | 147 | ScopeServiceFactory, |
Michael Lando | b3d4898 | 2017-06-11 14:22:02 +0300 | [diff] [blame] | 148 | CacheServiceProvider, |
| 149 | EventListenerServiceProvider, |
Michael Lando | a544510 | 2018-03-04 14:53:33 +0200 | [diff] [blame] | 150 | NotificationServiceProvider, |
Michael Lando | 5b59349 | 2018-07-29 16:13:45 +0300 | [diff] [blame] | 151 | ModalsHandlerProvider, |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 152 | AuthenticationService, |
| 153 | Cookie2Service, |
| 154 | ConfigService, |
| 155 | ComponentServiceNg2, |
Michael Lando | a544510 | 2018-03-04 14:53:33 +0200 | [diff] [blame] | 156 | ComponentServiceFactoryNg2, |
Tal Gitelman | 51d50f0 | 2017-12-10 18:55:03 +0200 | [diff] [blame] | 157 | ModalService, |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 158 | ServiceServiceNg2, |
Michael Lando | 5b59349 | 2018-07-29 16:13:45 +0300 | [diff] [blame] | 159 | AutomatedUpgradeService, |
Arielk | eaaf801 | 2018-07-31 12:59:36 +0300 | [diff] [blame] | 160 | WorkflowServiceNg2, |
miriame | 41ee9cb | 2019-03-04 13:49:15 +0200 | [diff] [blame] | 161 | ToscaTypesServiceNg2, |
Avi Ziv | f5854fd | 2017-07-31 15:50:46 +0300 | [diff] [blame] | 162 | HttpService, |
Tal Gitelman | 51d50f0 | 2017-12-10 18:55:03 +0200 | [diff] [blame] | 163 | UserService, |
Michael Lando | a544510 | 2018-03-04 14:53:33 +0200 | [diff] [blame] | 164 | PoliciesService, |
Michael Lando | 5b59349 | 2018-07-29 16:13:45 +0300 | [diff] [blame] | 165 | GroupsService, |
Michael Lando | a544510 | 2018-03-04 14:53:33 +0200 | [diff] [blame] | 166 | DynamicComponentService, |
Tal Gitelman | 51d50f0 | 2017-12-10 18:55:03 +0200 | [diff] [blame] | 167 | SdcConfig, |
Michael Lando | 5b59349 | 2018-07-29 16:13:45 +0300 | [diff] [blame] | 168 | SdcMenu, |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 169 | ComponentInstanceServiceNg2, |
Tal Gitelman | 51d50f0 | 2017-12-10 18:55:03 +0200 | [diff] [blame] | 170 | TranslationServiceConfig, |
Idan Amit | eedaaf9 | 2018-01-31 13:27:33 +0200 | [diff] [blame] | 171 | PluginsService, |
Piotr Darosz | 2c25cba | 2019-03-27 15:25:50 +0100 | [diff] [blame] | 172 | GabService, |
Michael Lando | 5b59349 | 2018-07-29 16:13:45 +0300 | [diff] [blame] | 173 | ArchiveService, |
Idan Amit | 71904f2 | 2018-02-13 10:38:16 +0200 | [diff] [blame] | 174 | EventBusService, |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 175 | { |
| 176 | provide: APP_INITIALIZER, |
| 177 | useFactory: configServiceFactory, |
| 178 | deps: [ConfigService], |
| 179 | multi: true |
Tal Gitelman | ed7e1c3 | 2017-06-29 19:30:00 +0300 | [diff] [blame] | 180 | }, |
Michael Lando | 5b59349 | 2018-07-29 16:13:45 +0300 | [diff] [blame] | 181 | ], |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 182 | bootstrap: [AppComponent] |
| 183 | }) |
| 184 | |
| 185 | |
| 186 | export class AppModule { |
Michael Lando | 5b59349 | 2018-07-29 16:13:45 +0300 | [diff] [blame] | 187 | constructor(public upgrade: UpgradeModule, public eventBusService:EventBusService) { |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 188 | |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 189 | } |
| 190 | } |