WEB-201 Merge angular-update-18 into dev to upgrade Angular from v17 to v18 (#2513)
This commit is contained in:
@@ -1,15 +0,0 @@
|
||||
import { TestBed, inject } from '@angular/core/testing';
|
||||
|
||||
import { AlertService } from './alert.service';
|
||||
|
||||
describe('AlertService', () => {
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
providers: [AlertService]
|
||||
});
|
||||
});
|
||||
|
||||
it('should be created', inject([AlertService], (service: AlertService) => {
|
||||
expect(service).toBeTruthy();
|
||||
}));
|
||||
});
|
||||
+40
-14
@@ -1,6 +1,12 @@
|
||||
/** Angular Imports */
|
||||
import { NgModule, Optional, SkipSelf } from '@angular/core';
|
||||
import { HTTP_INTERCEPTORS, HttpClient, HttpClientModule } from '@angular/common/http';
|
||||
import { NgModule, Optional, SkipSelf, Injector } from '@angular/core';
|
||||
import {
|
||||
HTTP_INTERCEPTORS,
|
||||
HttpClient,
|
||||
HttpHandler,
|
||||
provideHttpClient,
|
||||
withInterceptorsFromDi
|
||||
} from '@angular/common/http';
|
||||
import { RouteReuseStrategy, RouterModule } from '@angular/router';
|
||||
|
||||
/** Translation Imports */
|
||||
@@ -8,7 +14,7 @@ import { TranslateModule } from '@ngx-translate/core';
|
||||
|
||||
/** Custom Services */
|
||||
import { AuthenticationService } from './authentication/authentication.service';
|
||||
import { HttpService } from './http/http.service';
|
||||
import { HttpService, HTTP_DYNAMIC_INTERCEPTORS } from './http/http.service';
|
||||
import { HttpCacheService } from './http/http-cache.service';
|
||||
import { ProgressBarService } from './progress-bar/progress-bar.service';
|
||||
|
||||
@@ -41,12 +47,6 @@ import { ContentComponent } from './shell/content/content.component';
|
||||
* Main app shell components and singleton services should be here.
|
||||
*/
|
||||
@NgModule({
|
||||
imports: [
|
||||
SharedModule,
|
||||
HttpClientModule,
|
||||
TranslateModule,
|
||||
RouterModule
|
||||
],
|
||||
declarations: [
|
||||
ShellComponent,
|
||||
SidenavComponent,
|
||||
@@ -58,6 +58,11 @@ import { ContentComponent } from './shell/content/content.component';
|
||||
SharedModule // TO BE REMOVED: Once all components have replaced the core module import by shared module.
|
||||
|
||||
],
|
||||
imports: [
|
||||
SharedModule,
|
||||
TranslateModule,
|
||||
RouterModule
|
||||
],
|
||||
providers: [
|
||||
AuthenticationService,
|
||||
AuthenticationGuard,
|
||||
@@ -68,12 +73,32 @@ import { ContentComponent } from './shell/content/content.component';
|
||||
multi: true
|
||||
},
|
||||
HttpCacheService,
|
||||
ApiPrefixInterceptor,
|
||||
ErrorHandlerInterceptor,
|
||||
CacheInterceptor,
|
||||
{
|
||||
provide: HTTP_INTERCEPTORS,
|
||||
useClass: ApiPrefixInterceptor,
|
||||
multi: true
|
||||
},
|
||||
{
|
||||
provide: HTTP_INTERCEPTORS,
|
||||
useClass: ErrorHandlerInterceptor,
|
||||
multi: true
|
||||
},
|
||||
{
|
||||
provide: HTTP_INTERCEPTORS,
|
||||
useClass: CacheInterceptor,
|
||||
multi: true
|
||||
},
|
||||
{
|
||||
provide: HttpClient,
|
||||
useClass: HttpService
|
||||
useClass: HttpService,
|
||||
deps: [
|
||||
HttpHandler,
|
||||
Injector,
|
||||
[
|
||||
new Optional(),
|
||||
HTTP_DYNAMIC_INTERCEPTORS
|
||||
]
|
||||
]
|
||||
},
|
||||
ProgressBarService,
|
||||
{
|
||||
@@ -84,7 +109,8 @@ import { ContentComponent } from './shell/content/content.component';
|
||||
{
|
||||
provide: RouteReuseStrategy,
|
||||
useClass: RouteReusableStrategy
|
||||
}
|
||||
},
|
||||
provideHttpClient(withInterceptorsFromDi())
|
||||
]
|
||||
})
|
||||
export class CoreModule {
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
import { TestBed, inject } from '@angular/core/testing';
|
||||
|
||||
import { ProgressBarService } from './progress-bar.service';
|
||||
|
||||
describe('ProgressBarService', () => {
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
providers: [ProgressBarService]
|
||||
});
|
||||
});
|
||||
|
||||
it('should be created', inject([ProgressBarService], (service: ProgressBarService) => {
|
||||
expect(service).toBeTruthy();
|
||||
}));
|
||||
});
|
||||
@@ -1,24 +0,0 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { BreadcrumbComponent } from './breadcrumb.component';
|
||||
|
||||
describe('BreadcrumbComponent', () => {
|
||||
let component: BreadcrumbComponent;
|
||||
let fixture: ComponentFixture<BreadcrumbComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [BreadcrumbComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(BreadcrumbComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -1,24 +0,0 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { ContentComponent } from './content.component';
|
||||
|
||||
describe('ContentComponent', () => {
|
||||
let component: ContentComponent;
|
||||
let fixture: ComponentFixture<ContentComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ContentComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(ContentComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -1,24 +0,0 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { ShellComponent } from './shell.component';
|
||||
|
||||
describe('ShellComponent', () => {
|
||||
let component: ShellComponent;
|
||||
let fixture: ComponentFixture<ShellComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ShellComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(ShellComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -1,24 +0,0 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { SidenavComponent } from './sidenav.component';
|
||||
|
||||
describe('SidenavComponent', () => {
|
||||
let component: SidenavComponent;
|
||||
let fixture: ComponentFixture<SidenavComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [SidenavComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(SidenavComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -1,24 +0,0 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { ToolbarComponent } from './toolbar.component';
|
||||
|
||||
describe('ToolbarComponent', () => {
|
||||
let component: ToolbarComponent;
|
||||
let fixture: ComponentFixture<ToolbarComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ToolbarComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(ToolbarComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -1,7 +0,0 @@
|
||||
// import { Dates } from './dates';
|
||||
|
||||
// describe('Dates', () => {
|
||||
// it('should create an instance', () => {
|
||||
// expect(new Dates()).toBeTruthy();
|
||||
// });
|
||||
// });
|
||||
@@ -1,6 +1,6 @@
|
||||
import { DatePipe } from '@angular/common';
|
||||
import { Injectable } from '@angular/core';
|
||||
import * as moment from 'moment';
|
||||
import moment from 'moment';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
|
||||
Reference in New Issue
Block a user