X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=src%2Fapp%2FAppModule.ts;h=d260784bc1df36c64a278f5c3c5a56ba1f47d240;hb=1b17c432991a95035a1732426f0c11db57e511c9;hp=02fa73644016093caae2972c035b68ecdf20850d;hpb=3b4814aa2d3dec621dadb52f058ba95a3dc3a86a;p=osm%2FNG-UI.git diff --git a/src/app/AppModule.ts b/src/app/AppModule.ts index 02fa736..d260784 100644 --- a/src/app/AppModule.ts +++ b/src/app/AppModule.ts @@ -19,64 +19,70 @@ * @file Instance Module file */ import { CommonModule, LOCATION_INITIALIZED } from '@angular/common'; -import { HTTP_INTERCEPTORS, HttpClient, HttpClientModule } from '@angular/common/http'; +import { HttpClient, HttpClientModule, HTTP_INTERCEPTORS } from '@angular/common/http'; import { APP_INITIALIZER, Injector, NgModule } from '@angular/core'; import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { BrowserModule } from '@angular/platform-browser'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { RouterModule } from '@angular/router'; +import { CodemirrorModule } from '@ctrl/ngx-codemirror'; import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; +import { NgIdleKeepaliveModule } from '@ng-idle/keepalive'; +import { NgSelectModule } from '@ng-select/ng-select'; import { TranslateLoader, TranslateModule, TranslateService } from '@ngx-translate/core'; import { TranslateHttpLoader } from '@ngx-translate/http-loader'; import { NotifierModule, NotifierOptions } from 'angular-notifier'; -import { AuthInterceptorService } from 'AuthInterceptorService'; -import { HeaderComponent } from 'HeaderComponent'; -import { LayoutComponent } from 'LayoutComponent'; -import { Ng2SmartTableModule } from 'ng2-smart-table'; -import { RestService } from 'RestService'; -import { SidebarComponent } from 'SidebarComponent'; -import { AppComponent } from './AppComponent'; - -import { appRoutes } from './approutes.module'; - -import { DataService } from 'DataService'; -import { ProjectService } from 'ProjectService'; -import { SharedService } from 'SharedService'; - -import { CodemirrorModule } from '@ctrl/ngx-codemirror'; -import { NgSelectModule } from '@ng-select/ng-select'; - -import { NgIdleKeepaliveModule } from '@ng-idle/keepalive'; import { AuthenticationService } from 'AuthenticationService'; import { AuthGuardService } from 'AuthGuardService'; +import { AuthInterceptorService } from 'AuthInterceptorService'; import { BreadcrumbComponent } from 'BreadCrumb'; +import { ChangePasswordComponent } from 'ChangePasswordComponent'; +import { ChangePasswordModule } from 'ChangePasswordModule'; import { ComposePackages } from 'ComposePackages'; import { ConfirmationTopologyComponent } from 'ConfirmationTopology'; +import { DataService } from 'DataService'; import { DeleteComponent } from 'DeleteComponent'; import { DeviceCheckService } from 'DeviceCheckService'; import { GoToTopDirective } from 'GoToTopDirective'; +import { HeaderComponent } from 'HeaderComponent'; import { InstantiateNetSliceTemplateComponent } from 'InstantiateNetSliceTemplate'; import { InstantiateNsComponent } from 'InstantiateNs'; +import { LayoutComponent } from 'LayoutComponent'; import { LoaderModule } from 'LoaderModule'; import { LoginComponent } from 'LoginComponent'; import { NetsliceInstancesActionComponent } from 'NetsliceInstancesActionComponent'; import { NetslicePackagesActionComponent } from 'NetslicePackagesAction'; +import { Ng2SmartTableModule } from 'ng2-smart-table'; +import { ToastrModule } from 'ngx-toastr'; import { NSInstancesActionComponent } from 'NSInstancesActionComponent'; import { NsPackagesActionComponent } from 'NsPackagesAction'; +import { NsUpdateComponent } from 'NsUpdateComponent'; import { PageNotFoundComponent } from 'PageNotFound'; import { PDUInstancesActionComponent } from 'PDUInstancesActionComponent'; import { ProjectLinkComponent } from 'ProjectLinkComponent'; import { ProjectsActionComponent } from 'ProjectsAction'; +import { ProjectService } from 'ProjectService'; +import { RestService } from 'RestService'; +import { ScalingComponent } from 'ScalingComponent'; import { SDNControllerActionComponent } from 'SDNControllerActionComponent'; +import { SharedModule } from 'SharedModule'; +import { SharedService } from 'SharedService'; import { ShowInfoComponent } from 'ShowInfoComponent'; +import { SidebarComponent } from 'SidebarComponent'; +import { StartStopRebuildComponent } from 'StartStopRebuildComponent'; import { SwitchProjectComponent } from 'SwitchProjectComponent'; import { UsersActionComponent } from 'UsersActionComponent'; import { UserSettingsComponent } from 'UserSettingsComponent'; +import { VerticalScalingComponent } from 'VerticalScalingComponent'; import { VimAccountsActionComponent } from 'VimAccountsAction'; +import { VmMigrationComponent } from 'VmMigrationComponent'; import { VNFInstancesActionComponent } from 'VNFInstancesActionComponent'; import { VNFLinkComponent } from 'VNFLinkComponent'; import { VNFPackagesActionComponent } from 'VNFPackagesAction'; +import { WarningComponent } from 'WarningComponent'; import { WIMAccountsActionComponent } from 'WIMAccountsAction'; +import { AppComponent } from './AppComponent'; +import { appRoutes } from './approutes.module'; /** * Custom angular notifier options @@ -121,7 +127,14 @@ const customNotifierOptions: NotifierOptions = { PDUInstancesActionComponent, SDNControllerActionComponent, SwitchProjectComponent, - GoToTopDirective + GoToTopDirective, + ScalingComponent, + ChangePasswordComponent, + VmMigrationComponent, + NsUpdateComponent, + WarningComponent, + StartStopRebuildComponent, + VerticalScalingComponent ], imports: [ NotifierModule.withConfig(customNotifierOptions), @@ -143,9 +156,15 @@ const customNotifierOptions: NotifierOptions = { }), NgbModule, NgSelectModule, - RouterModule.forRoot(appRoutes, { useHash: false }), + RouterModule.forRoot(appRoutes, { useHash: false, relativeLinkResolution: 'legacy' }), NgIdleKeepaliveModule.forRoot(), - LoaderModule + LoaderModule, + SharedModule, + ChangePasswordModule, + ToastrModule.forRoot({ + timeOut: 500, + positionClass: 'toast-bottom-right' + }) ], providers: [ { @@ -167,32 +186,7 @@ const customNotifierOptions: NotifierOptions = { SharedService, DeviceCheckService ], - bootstrap: [AppComponent], - entryComponents: [ - VNFPackagesActionComponent, - NsPackagesActionComponent, - NSInstancesActionComponent, - VNFInstancesActionComponent, - VNFLinkComponent, - NetsliceInstancesActionComponent, - BreadcrumbComponent, - DeleteComponent, - NetslicePackagesActionComponent, - UsersActionComponent, - VimAccountsActionComponent, - ProjectsActionComponent, - ProjectLinkComponent, - UserSettingsComponent, - ShowInfoComponent, - InstantiateNetSliceTemplateComponent, - InstantiateNsComponent, - ConfirmationTopologyComponent, - ComposePackages, - WIMAccountsActionComponent, - PDUInstancesActionComponent, - SDNControllerActionComponent, - SwitchProjectComponent - ] + bootstrap: [AppComponent] }) /** Exporting a class @exports AppModule */ @@ -204,7 +198,7 @@ export class AppModule { /** * HttpLoaderFactory is for translate service of the application. */ -// tslint:disable:function-name +/* eslint-disable */ export function HttpLoaderFactory(http: HttpClient): TranslateHttpLoader { const now: number = new Date().getTime(); return new TranslateHttpLoader(http, './assets/i18n/', '.json?locale=' + now); @@ -212,15 +206,14 @@ export function HttpLoaderFactory(http: HttpClient): TranslateHttpLoader { /** * HttpLoaderFactory is for translate service of the application. */ -// tslint:disable:function-name export function appInitializerFactory(translate: TranslateService, injector: Injector): Object { - // tslint:disable-next-line: no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any return async (): Promise => { await injector.get(LOCATION_INITIALIZED, Promise.resolve(null)); translate.setDefaultLang('en'); const languageCode: string = localStorage.getItem('languageCode'); if (languageCode !== null && languageCode !== undefined && languageCode !== '') { - await translate.use(languageCode).toPromise().catch(() => { + await translate.use(languageCode).toPromise().catch((): void => { translate.setDefaultLang('en'); }); } else {