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. |
| 6 | * ================================================================================ |
| 7 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 8 | * you may not use this file except in compliance with the License. |
| 9 | * You may obtain a copy of the License at |
Idan Amit | 2c28572 | 2017-12-29 09:40:43 +0200 | [diff] [blame] | 10 | * |
Michael Lando | dd60339 | 2017-07-12 00:54:52 +0300 | [diff] [blame] | 11 | * http://www.apache.org/licenses/LICENSE-2.0 |
Idan Amit | 2c28572 | 2017-12-29 09:40:43 +0200 | [diff] [blame] | 12 | * |
Michael Lando | dd60339 | 2017-07-12 00:54:52 +0300 | [diff] [blame] | 13 | * Unless required by applicable law or agreed to in writing, software |
| 14 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 16 | * See the License for the specific language governing permissions and |
| 17 | * limitations under the License. |
| 18 | * ============LICENSE_END========================================================= |
| 19 | */ |
| 20 | |
Michael Lando | 5b59349 | 2018-07-29 16:13:45 +0300 | [diff] [blame^] | 21 | import { BrowserModule } from '@angular/platform-browser'; |
| 22 | import { NgModule, APP_INITIALIZER } from '@angular/core'; |
| 23 | import { FormsModule } from '@angular/forms'; |
| 24 | import { forwardRef } from '@angular/core'; |
| 25 | import { AppComponent } from './app.component'; |
| 26 | import { UpgradeAdapter } from '@angular/upgrade'; |
| 27 | import { UpgradeModule } from '@angular/upgrade/static'; |
| 28 | import { SdcUiComponentsModule, SdcUiComponents } from "sdc-ui/lib/angular"; |
| 29 | import { PropertiesAssignmentModule } from './pages/properties-assignment/properties-assignment.module'; |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 30 | import { |
Tal Gitelman | 51d50f0 | 2017-12-10 18:55:03 +0200 | [diff] [blame] | 31 | DataTypesServiceProvider, SharingServiceProvider, CookieServiceProvider, StateServiceFactory, |
Michael Lando | a544510 | 2018-03-04 14:53:33 +0200 | [diff] [blame] | 32 | StateParamsServiceFactory, CacheServiceProvider, EventListenerServiceProvider, ScopeServiceFactory, |
Michael Lando | 5b59349 | 2018-07-29 16:13:45 +0300 | [diff] [blame^] | 33 | NotificationServiceProvider, ComponentFactoryProvider |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 34 | } from "./utils/ng1-upgraded-provider"; |
Michael Lando | 5b59349 | 2018-07-29 16:13:45 +0300 | [diff] [blame^] | 35 | import { ConfigService } from "./services/config.service"; |
| 36 | import { HttpModule } from '@angular/http'; |
| 37 | import { HttpService } from './services/http.service'; |
| 38 | import { AuthenticationService } from './services/authentication.service'; |
| 39 | import { Cookie2Service } from "./services/cookie.service"; |
| 40 | import { ComponentServiceNg2 } from "./services/component-services/component.service"; |
| 41 | import { ComponentServiceFactoryNg2 } from "./services/component-services/component.service.factory"; |
| 42 | import { ServiceServiceNg2 } from "./services/component-services/service.service"; |
| 43 | import { ComponentInstanceServiceNg2 } from "./services/component-instance-services/component-instance.service"; |
| 44 | import { ModalService } from "./services/modal.service"; |
| 45 | import { UiElementsModule } from "./components/ui/ui-elements.module"; |
| 46 | import { ConnectionWizardModule } from "./pages/connection-wizard/connection-wizard.module"; |
Arielk | 802bd2a | 2018-04-16 15:37:39 +0300 | [diff] [blame] | 47 | import {InterfaceOperationModule} from "./pages/interface-operation/interface-operation.module"; |
| 48 | import {OperationCreatorModule} from "./pages/interface-operation/operation-creator/operation-creator.module"; |
Michael Lando | 5b59349 | 2018-07-29 16:13:45 +0300 | [diff] [blame^] | 49 | import { LayoutModule } from "./components/layout/layout.module"; |
| 50 | import { UserService } from "./services/user.service"; |
| 51 | import { DynamicComponentService } from "./services/dynamic-component.service"; |
| 52 | import { SdcConfig } from "./config/sdc-config.config"; |
| 53 | import { SdcMenu } from "./config/sdc-menu.config"; |
Tal Gitelman | 51d50f0 | 2017-12-10 18:55:03 +0200 | [diff] [blame] | 54 | import { TranslateModule } from "./shared/translator/translate.module"; |
| 55 | import { TranslationServiceConfig } from "./config/translation.service.config"; |
Michael Lando | 5b59349 | 2018-07-29 16:13:45 +0300 | [diff] [blame^] | 56 | import { MultilineEllipsisModule } from "./shared/multiline-ellipsis/multiline-ellipsis.module"; |
| 57 | import { ServicePathCreatorModule } from './pages/service-path-creator/service-path-creator.module'; |
| 58 | import { ServicePathsListModule } from './pages/service-paths-list/service-paths-list.module'; |
| 59 | import { ServicePathModule } from 'app/ng2/components/logic/service-path/service-path.module'; |
| 60 | import { ServicePathSelectorModule } from 'app/ng2/components/logic/service-path-selector/service-path-selector.module'; |
| 61 | import { CompositionPanelModule } from 'app/ng2/pages/composition/panel/panel.module'; |
| 62 | import { WindowRef } from "./services/window.service"; |
| 63 | import {ArchiveService} from "./services/archive.service"; |
| 64 | import { ModalsHandlerProvider } from './utils/ng1-upgraded-provider'; |
Idan Amit | eedaaf9 | 2018-01-31 13:27:33 +0200 | [diff] [blame] | 65 | import {PluginFrameModule} from "./components/ui/plugin/plugin-frame.module"; |
| 66 | import {PluginsService} from "./services/plugins.service"; |
Idan Amit | 71904f2 | 2018-02-13 10:38:16 +0200 | [diff] [blame] | 67 | import {EventBusService} from "./services/event-bus.service"; |
Michael Lando | 5b59349 | 2018-07-29 16:13:45 +0300 | [diff] [blame^] | 68 | import {GroupsService} from "./services/groups.service"; |
| 69 | import {PoliciesService} from "./services/policies.service"; |
| 70 | import {AutomatedUpgradeService} from "./pages/automated-upgrade/automated-upgrade.service"; |
| 71 | import {AutomatedUpgradeModule} from "./pages/automated-upgrade/automated-upgrade.module"; |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 72 | |
| 73 | export const upgradeAdapter = new UpgradeAdapter(forwardRef(() => AppModule)); |
| 74 | |
Michael Lando | 5b59349 | 2018-07-29 16:13:45 +0300 | [diff] [blame^] | 75 | export function configServiceFactory(config: ConfigService) { |
Idan Amit | 2c28572 | 2017-12-29 09:40:43 +0200 | [diff] [blame] | 76 | return () => { |
Idan Amit | f1039ca | 2018-05-21 16:09:35 +0300 | [diff] [blame] | 77 | return Promise.all([ |
| 78 | config.loadValidationConfiguration(), |
| 79 | config.loadPluginsConfiguration() |
| 80 | ]); |
Idan Amit | 2c28572 | 2017-12-29 09:40:43 +0200 | [diff] [blame] | 81 | } |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 82 | } |
| 83 | |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 84 | |
| 85 | @NgModule({ |
| 86 | declarations: [ |
Tal Gitelman | 51d50f0 | 2017-12-10 18:55:03 +0200 | [diff] [blame] | 87 | AppComponent |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 88 | ], |
| 89 | imports: [ |
| 90 | BrowserModule, |
| 91 | UpgradeModule, |
| 92 | FormsModule, |
| 93 | HttpModule, |
Tal Gitelman | 51d50f0 | 2017-12-10 18:55:03 +0200 | [diff] [blame] | 94 | LayoutModule, |
| 95 | TranslateModule, |
Michael Lando | 5b59349 | 2018-07-29 16:13:45 +0300 | [diff] [blame^] | 96 | MultilineEllipsisModule, |
Tal Gitelman | 51d50f0 | 2017-12-10 18:55:03 +0200 | [diff] [blame] | 97 | UiElementsModule, |
Michael Lando | 5b59349 | 2018-07-29 16:13:45 +0300 | [diff] [blame^] | 98 | CompositionPanelModule, |
| 99 | SdcUiComponentsModule, |
| 100 | AutomatedUpgradeModule, |
Tal Gitelman | 51d50f0 | 2017-12-10 18:55:03 +0200 | [diff] [blame] | 101 | //We need to import them here since we use them in angular1 |
| 102 | ConnectionWizardModule, |
Idan Amit | 5197c8b | 2018-01-15 14:31:42 +0200 | [diff] [blame] | 103 | PropertiesAssignmentModule, |
Michael Lando | a544510 | 2018-03-04 14:53:33 +0200 | [diff] [blame] | 104 | PluginFrameModule, |
Arielk | 802bd2a | 2018-04-16 15:37:39 +0300 | [diff] [blame] | 105 | InterfaceOperationModule, |
| 106 | OperationCreatorModule, |
Michael Lando | a544510 | 2018-03-04 14:53:33 +0200 | [diff] [blame] | 107 | ServicePathCreatorModule, |
| 108 | ServicePathsListModule, |
| 109 | ServicePathModule, |
| 110 | ServicePathSelectorModule |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 111 | ], |
| 112 | exports: [], |
Michael Lando | 5b59349 | 2018-07-29 16:13:45 +0300 | [diff] [blame^] | 113 | entryComponents: [ |
| 114 | // *** sdc-ui components to be used as downgraded: |
| 115 | // SdcUiComponents.ButtonComponent |
| 116 | ], |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 117 | providers: [ |
Michael Lando | 5b59349 | 2018-07-29 16:13:45 +0300 | [diff] [blame^] | 118 | WindowRef, |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 119 | DataTypesServiceProvider, |
| 120 | SharingServiceProvider, |
Michael Lando | 5b59349 | 2018-07-29 16:13:45 +0300 | [diff] [blame^] | 121 | ComponentFactoryProvider, |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 122 | CookieServiceProvider, |
Tal Gitelman | 51d50f0 | 2017-12-10 18:55:03 +0200 | [diff] [blame] | 123 | StateServiceFactory, |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 124 | StateParamsServiceFactory, |
Michael Lando | a544510 | 2018-03-04 14:53:33 +0200 | [diff] [blame] | 125 | ScopeServiceFactory, |
Michael Lando | b3d4898 | 2017-06-11 14:22:02 +0300 | [diff] [blame] | 126 | CacheServiceProvider, |
| 127 | EventListenerServiceProvider, |
Michael Lando | a544510 | 2018-03-04 14:53:33 +0200 | [diff] [blame] | 128 | NotificationServiceProvider, |
Michael Lando | 5b59349 | 2018-07-29 16:13:45 +0300 | [diff] [blame^] | 129 | ModalsHandlerProvider, |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 130 | AuthenticationService, |
| 131 | Cookie2Service, |
| 132 | ConfigService, |
| 133 | ComponentServiceNg2, |
Michael Lando | a544510 | 2018-03-04 14:53:33 +0200 | [diff] [blame] | 134 | ComponentServiceFactoryNg2, |
Tal Gitelman | 51d50f0 | 2017-12-10 18:55:03 +0200 | [diff] [blame] | 135 | ModalService, |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 136 | ServiceServiceNg2, |
Michael Lando | 5b59349 | 2018-07-29 16:13:45 +0300 | [diff] [blame^] | 137 | AutomatedUpgradeService, |
Avi Ziv | f5854fd | 2017-07-31 15:50:46 +0300 | [diff] [blame] | 138 | HttpService, |
Tal Gitelman | 51d50f0 | 2017-12-10 18:55:03 +0200 | [diff] [blame] | 139 | UserService, |
Michael Lando | a544510 | 2018-03-04 14:53:33 +0200 | [diff] [blame] | 140 | PoliciesService, |
Michael Lando | 5b59349 | 2018-07-29 16:13:45 +0300 | [diff] [blame^] | 141 | GroupsService, |
Michael Lando | a544510 | 2018-03-04 14:53:33 +0200 | [diff] [blame] | 142 | DynamicComponentService, |
Tal Gitelman | 51d50f0 | 2017-12-10 18:55:03 +0200 | [diff] [blame] | 143 | SdcConfig, |
Michael Lando | 5b59349 | 2018-07-29 16:13:45 +0300 | [diff] [blame^] | 144 | SdcMenu, |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 145 | ComponentInstanceServiceNg2, |
Tal Gitelman | 51d50f0 | 2017-12-10 18:55:03 +0200 | [diff] [blame] | 146 | TranslationServiceConfig, |
Idan Amit | eedaaf9 | 2018-01-31 13:27:33 +0200 | [diff] [blame] | 147 | PluginsService, |
Michael Lando | 5b59349 | 2018-07-29 16:13:45 +0300 | [diff] [blame^] | 148 | ArchiveService, |
Idan Amit | 71904f2 | 2018-02-13 10:38:16 +0200 | [diff] [blame] | 149 | EventBusService, |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 150 | { |
| 151 | provide: APP_INITIALIZER, |
| 152 | useFactory: configServiceFactory, |
| 153 | deps: [ConfigService], |
| 154 | multi: true |
Tal Gitelman | ed7e1c3 | 2017-06-29 19:30:00 +0300 | [diff] [blame] | 155 | }, |
Michael Lando | 5b59349 | 2018-07-29 16:13:45 +0300 | [diff] [blame^] | 156 | ], |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 157 | bootstrap: [AppComponent] |
| 158 | }) |
| 159 | |
| 160 | |
| 161 | export class AppModule { |
Michael Lando | 5b59349 | 2018-07-29 16:13:45 +0300 | [diff] [blame^] | 162 | constructor(public upgrade: UpgradeModule, public eventBusService:EventBusService) { |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 163 | |
Michael Lando | ed64b5e | 2017-06-09 03:19:04 +0300 | [diff] [blame] | 164 | } |
| 165 | } |