header correction in Catalog UI component
[sdc.git] / catalog-ui / src / app / ng2 / app.module.ts
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
10  *
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  *
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
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';
30 import {
31     DataTypesServiceProvider, SharingServiceProvider, CookieServiceProvider, StateServiceFactory,
32     StateParamsServiceFactory, CacheServiceProvider, EventListenerServiceProvider, ScopeServiceFactory,
33     NotificationServiceProvider, ComponentFactoryProvider
34 } from "./utils/ng1-upgraded-provider";
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 { WorkflowServiceNg2 } from './services/workflow.service';
45 import { ModalService } from "./services/modal.service";
46 import { UiElementsModule } from "./components/ui/ui-elements.module";
47 import { ConnectionWizardModule } from "./pages/connection-wizard/connection-wizard.module";
48 import { InterfaceOperationModule } from "./pages/interface-operation/interface-operation.module";
49 import { OperationCreatorModule } from "./pages/interface-operation/operation-creator/operation-creator.module";
50 import { LayoutModule } from "./components/layout/layout.module";
51 import { UserService } from "./services/user.service";
52 import { DynamicComponentService } from "./services/dynamic-component.service";
53 import { SdcConfig } from "./config/sdc-config.config";
54 import { SdcMenu } from "./config/sdc-menu.config";
55 import { TranslateModule } from "./shared/translator/translate.module";
56 import { TranslationServiceConfig } from "./config/translation.service.config";
57 import { MultilineEllipsisModule } from "./shared/multiline-ellipsis/multiline-ellipsis.module";
58 import { ServicePathCreatorModule } from './pages/service-path-creator/service-path-creator.module';
59 import { ServicePathsListModule } from './pages/service-paths-list/service-paths-list.module';
60 import { ServicePathModule } from 'app/ng2/components/logic/service-path/service-path.module';
61 import { ServicePathSelectorModule } from 'app/ng2/components/logic/service-path-selector/service-path-selector.module';
62 import { CompositionPanelModule } from 'app/ng2/pages/composition/panel/panel.module';
63 import { WindowRef } from "./services/window.service";
64 import {ArchiveService} from "./services/archive.service";
65 import { ModalsHandlerProvider } from './utils/ng1-upgraded-provider';
66 import {PluginFrameModule} from "./components/ui/plugin/plugin-frame.module";
67 import {PluginsService} from "./services/plugins.service";
68 import {EventBusService} from "./services/event-bus.service";
69 import {GroupsService} from "./services/groups.service";
70 import {PoliciesService} from "./services/policies.service";
71 import {AutomatedUpgradeService} from "./pages/automated-upgrade/automated-upgrade.service";
72 import {AutomatedUpgradeModule} from "./pages/automated-upgrade/automated-upgrade.module";
73
74 export const upgradeAdapter = new UpgradeAdapter(forwardRef(() => AppModule));
75
76 export function configServiceFactory(config: ConfigService) {
77     return () => {
78         return Promise.all([
79             config.loadValidationConfiguration(),
80             config.loadPluginsConfiguration()
81         ]);
82     }
83 }
84
85
86 @NgModule({
87     declarations: [
88         AppComponent
89     ],
90     imports: [
91         BrowserModule,
92         UpgradeModule,
93         FormsModule,
94         HttpModule,
95         LayoutModule,
96         TranslateModule,
97         MultilineEllipsisModule,
98         UiElementsModule,
99         CompositionPanelModule,
100         SdcUiComponentsModule,
101         AutomatedUpgradeModule,
102         //We need to import them here since we use them in angular1
103         ConnectionWizardModule,
104         PropertiesAssignmentModule,
105         PluginFrameModule,
106         InterfaceOperationModule,
107         OperationCreatorModule,
108         ServicePathCreatorModule,
109         ServicePathsListModule,
110         ServicePathModule,
111         ServicePathSelectorModule
112     ],
113     exports: [],
114     entryComponents: [
115         // *** sdc-ui components to be used as downgraded:
116         // SdcUiComponents.ButtonComponent
117     ],
118     providers: [
119         WindowRef,
120         DataTypesServiceProvider,
121         SharingServiceProvider,
122         ComponentFactoryProvider,
123         CookieServiceProvider,
124         StateServiceFactory,
125         StateParamsServiceFactory,
126         ScopeServiceFactory,
127         CacheServiceProvider,
128         EventListenerServiceProvider,
129         NotificationServiceProvider,
130         ModalsHandlerProvider,
131         AuthenticationService,
132         Cookie2Service,
133         ConfigService,
134         ComponentServiceNg2,
135         ComponentServiceFactoryNg2,
136         ModalService,
137         ServiceServiceNg2,
138         AutomatedUpgradeService,
139         WorkflowServiceNg2,
140         HttpService,
141         UserService,
142         PoliciesService,
143         GroupsService,
144         DynamicComponentService,
145         SdcConfig,
146         SdcMenu,
147         ComponentInstanceServiceNg2,
148         TranslationServiceConfig,
149         PluginsService,
150         ArchiveService,
151         EventBusService,
152         {
153             provide: APP_INITIALIZER,
154             useFactory: configServiceFactory,
155             deps: [ConfigService],
156             multi: true
157         },
158     ],
159     bootstrap: [AppComponent]
160 })
161
162
163 export class AppModule {
164     constructor(public upgrade: UpgradeModule, public eventBusService:EventBusService) {
165
166     }
167 }