diff --git a/src/app/admin/admin-reports/filtered-collections/filtered-collections.component.spec.ts b/src/app/admin/admin-reports/filtered-collections/filtered-collections.component.spec.ts index 7c6428c4dc..ae4df271ae 100644 --- a/src/app/admin/admin-reports/filtered-collections/filtered-collections.component.spec.ts +++ b/src/app/admin/admin-reports/filtered-collections/filtered-collections.component.spec.ts @@ -1,3 +1,7 @@ +import { + provideHttpClient, + withInterceptorsFromDi, +} from '@angular/common/http'; import { provideHttpClientTesting } from '@angular/common/http/testing'; import { NO_ERRORS_SCHEMA } from '@angular/core'; import { @@ -20,7 +24,6 @@ import { RawRestResponse } from 'src/app/core/dspace-rest/raw-rest-response.mode import { TranslateLoaderMock } from 'src/app/shared/mocks/translate-loader.mock'; import { FilteredCollectionsComponent } from './filtered-collections.component'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; describe('FiltersComponent', () => { let component: FilteredCollectionsComponent; @@ -40,22 +43,22 @@ describe('FiltersComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - schemas: [NO_ERRORS_SCHEMA], - imports: [NgbAccordionModule, + schemas: [NO_ERRORS_SCHEMA], + imports: [NgbAccordionModule, TranslateModule.forRoot({ - loader: { - provide: TranslateLoader, - useClass: TranslateLoaderMock, - }, + loader: { + provide: TranslateLoader, + useClass: TranslateLoaderMock, + }, }), FilteredCollectionsComponent], - providers: [ + providers: [ FormBuilder, DspaceRestService, provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), - ] -}); + ], + }); })); beforeEach(waitForAsync(() => { diff --git a/src/app/core/auth/auth.interceptor.spec.ts b/src/app/core/auth/auth.interceptor.spec.ts index ceb8e3bc59..b137b2713c 100644 --- a/src/app/core/auth/auth.interceptor.spec.ts +++ b/src/app/core/auth/auth.interceptor.spec.ts @@ -1,5 +1,12 @@ -import { HTTP_INTERCEPTORS, provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; -import { HttpTestingController, provideHttpClientTesting } from '@angular/common/http/testing'; +import { + HTTP_INTERCEPTORS, + provideHttpClient, + withInterceptorsFromDi, +} from '@angular/common/http'; +import { + HttpTestingController, + provideHttpClientTesting, +} from '@angular/common/http/testing'; import { TestBed } from '@angular/core/testing'; import { Router } from '@angular/router'; import { Store } from '@ngrx/store'; @@ -25,21 +32,21 @@ describe(`AuthInterceptor`, () => { beforeEach(() => { TestBed.configureTestingModule({ - imports: [], - providers: [ + imports: [], + providers: [ DspaceRestService, { provide: AuthService, useValue: authServiceStub }, { provide: Router, useClass: RouterStub }, { - provide: HTTP_INTERCEPTORS, - useClass: AuthInterceptor, - multi: true, + provide: HTTP_INTERCEPTORS, + useClass: AuthInterceptor, + multi: true, }, { provide: Store, useValue: store }, provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), - ] -}); + ], + }); service = TestBed.inject(DspaceRestService); httpMock = TestBed.inject(HttpTestingController); diff --git a/src/app/core/auth/auth.interceptor.ts b/src/app/core/auth/auth.interceptor.ts index becc03f046..d011d27059 100644 --- a/src/app/core/auth/auth.interceptor.ts +++ b/src/app/core/auth/auth.interceptor.ts @@ -1,4 +1,13 @@ -import { HttpErrorResponse, HttpEvent, HttpHandler, HttpHeaders, HttpInterceptor, HttpRequest, HttpResponse, HttpResponseBase } from '@angular/common/http'; +import { + HttpErrorResponse, + HttpEvent, + HttpHandler, + HttpHeaders, + HttpInterceptor, + HttpRequest, + HttpResponse, + HttpResponseBase, +} from '@angular/common/http'; import { Injectable, Injector, diff --git a/src/app/core/auth/server-auth-request.service.spec.ts b/src/app/core/auth/server-auth-request.service.spec.ts index ff7b661078..b119f6b3b7 100644 --- a/src/app/core/auth/server-auth-request.service.spec.ts +++ b/src/app/core/auth/server-auth-request.service.spec.ts @@ -1,4 +1,8 @@ -import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; +import { + HttpClient, + HttpHeaders, + HttpResponse, +} from '@angular/common/http'; import { Observable, of as observableOf, diff --git a/src/app/core/auth/server-auth-request.service.ts b/src/app/core/auth/server-auth-request.service.ts index 28b5566c15..5f1828c71c 100644 --- a/src/app/core/auth/server-auth-request.service.ts +++ b/src/app/core/auth/server-auth-request.service.ts @@ -1,4 +1,8 @@ -import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http'; +import { + HttpClient, + HttpHeaders, + HttpResponse, +} from '@angular/common/http'; import { Injectable } from '@angular/core'; import { Observable } from 'rxjs'; import { map } from 'rxjs/operators'; diff --git a/src/app/core/data/eperson-registration.service.ts b/src/app/core/data/eperson-registration.service.ts index 1b5c348c6d..90a3fab83a 100644 --- a/src/app/core/data/eperson-registration.service.ts +++ b/src/app/core/data/eperson-registration.service.ts @@ -1,4 +1,7 @@ -import { HttpHeaders, HttpParams } from '@angular/common/http'; +import { + HttpHeaders, + HttpParams, +} from '@angular/common/http'; import { Injectable } from '@angular/core'; import { Observable } from 'rxjs'; import { diff --git a/src/app/core/data/identifier-data.service.ts b/src/app/core/data/identifier-data.service.ts index a193f5aa96..502b1fe710 100644 --- a/src/app/core/data/identifier-data.service.ts +++ b/src/app/core/data/identifier-data.service.ts @@ -1,4 +1,8 @@ -import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http'; +import { + HttpClient, + HttpHeaders, + HttpParams, +} from '@angular/common/http'; import { Injectable } from '@angular/core'; import { Store } from '@ngrx/store'; import { Observable } from 'rxjs'; diff --git a/src/app/core/dspace-rest/dspace-rest.service.spec.ts b/src/app/core/dspace-rest/dspace-rest.service.spec.ts index 11f0ae94d1..04f44fc942 100644 --- a/src/app/core/dspace-rest/dspace-rest.service.spec.ts +++ b/src/app/core/dspace-rest/dspace-rest.service.spec.ts @@ -1,5 +1,13 @@ -import { HttpErrorResponse, HttpHeaders, provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; -import { HttpTestingController, provideHttpClientTesting } from '@angular/common/http/testing'; +import { + HttpErrorResponse, + HttpHeaders, + provideHttpClient, + withInterceptorsFromDi, +} from '@angular/common/http'; +import { + HttpTestingController, + provideHttpClientTesting, +} from '@angular/common/http/testing'; import { inject, TestBed, @@ -27,9 +35,13 @@ describe('DspaceRestService', () => { beforeEach(() => { TestBed.configureTestingModule({ - imports: [], - providers: [DspaceRestService, provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting()] -}); + imports: [], + providers: [ + DspaceRestService, + provideHttpClient(withInterceptorsFromDi()), + provideHttpClientTesting(), + ], + }); dspaceRestService = TestBed.inject(DspaceRestService); httpMock = TestBed.inject(HttpTestingController); diff --git a/src/app/core/dspace-rest/dspace-rest.service.ts b/src/app/core/dspace-rest/dspace-rest.service.ts index e32566043a..a75cef53bf 100644 --- a/src/app/core/dspace-rest/dspace-rest.service.ts +++ b/src/app/core/dspace-rest/dspace-rest.service.ts @@ -1,4 +1,10 @@ -import { HttpClient, HttpErrorResponse, HttpHeaders, HttpParams, HttpResponse } from '@angular/common/http'; +import { + HttpClient, + HttpErrorResponse, + HttpHeaders, + HttpParams, + HttpResponse, +} from '@angular/common/http'; import { Injectable } from '@angular/core'; import { Observable, diff --git a/src/app/core/forward-client-ip/forward-client-ip.interceptor.spec.ts b/src/app/core/forward-client-ip/forward-client-ip.interceptor.spec.ts index 159f129b3f..aa45ee5ee3 100644 --- a/src/app/core/forward-client-ip/forward-client-ip.interceptor.spec.ts +++ b/src/app/core/forward-client-ip/forward-client-ip.interceptor.spec.ts @@ -1,5 +1,12 @@ -import { HTTP_INTERCEPTORS, provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; -import { HttpTestingController, provideHttpClientTesting } from '@angular/common/http/testing'; +import { + HTTP_INTERCEPTORS, + provideHttpClient, + withInterceptorsFromDi, +} from '@angular/common/http'; +import { + HttpTestingController, + provideHttpClientTesting, +} from '@angular/common/http/testing'; import { TestBed } from '@angular/core/testing'; import { REQUEST } from '../../../express.tokens'; @@ -18,19 +25,19 @@ describe('ForwardClientIpInterceptor', () => { clientIp = '1.2.3.4'; TestBed.configureTestingModule({ - imports: [], - providers: [ + imports: [], + providers: [ DspaceRestService, { - provide: HTTP_INTERCEPTORS, - useClass: ForwardClientIpInterceptor, - multi: true, + provide: HTTP_INTERCEPTORS, + useClass: ForwardClientIpInterceptor, + multi: true, }, { provide: REQUEST, useValue: { get: () => undefined, connection: { remoteAddress: clientIp } } }, provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), - ] -}); + ], + }); service = TestBed.inject(DspaceRestService); httpMock = TestBed.inject(HttpTestingController); diff --git a/src/app/core/forward-client-ip/forward-client-ip.interceptor.ts b/src/app/core/forward-client-ip/forward-client-ip.interceptor.ts index b36c56752c..7fe4263d46 100644 --- a/src/app/core/forward-client-ip/forward-client-ip.interceptor.ts +++ b/src/app/core/forward-client-ip/forward-client-ip.interceptor.ts @@ -1,4 +1,9 @@ -import { HttpEvent, HttpHandler, HttpInterceptor, HttpRequest } from '@angular/common/http'; +import { + HttpEvent, + HttpHandler, + HttpInterceptor, + HttpRequest, +} from '@angular/common/http'; import { Inject, Injectable, diff --git a/src/app/core/locale/locale.interceptor.spec.ts b/src/app/core/locale/locale.interceptor.spec.ts index 52868efc0a..4731e109e5 100644 --- a/src/app/core/locale/locale.interceptor.spec.ts +++ b/src/app/core/locale/locale.interceptor.spec.ts @@ -1,5 +1,12 @@ -import { HTTP_INTERCEPTORS, provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; -import { HttpTestingController, provideHttpClientTesting } from '@angular/common/http/testing'; +import { + HTTP_INTERCEPTORS, + provideHttpClient, + withInterceptorsFromDi, +} from '@angular/common/http'; +import { + HttpTestingController, + provideHttpClientTesting, +} from '@angular/common/http/testing'; import { TestBed } from '@angular/core/testing'; import { of } from 'rxjs'; @@ -22,19 +29,19 @@ describe(`LocaleInterceptor`, () => { beforeEach(() => { TestBed.configureTestingModule({ - imports: [], - providers: [ + imports: [], + providers: [ DspaceRestService, { - provide: HTTP_INTERCEPTORS, - useClass: LocaleInterceptor, - multi: true, + provide: HTTP_INTERCEPTORS, + useClass: LocaleInterceptor, + multi: true, }, { provide: LocaleService, useValue: mockLocaleService }, provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), - ] -}); + ], + }); service = TestBed.inject(DspaceRestService); httpMock = TestBed.inject(HttpTestingController); diff --git a/src/app/core/locale/locale.interceptor.ts b/src/app/core/locale/locale.interceptor.ts index fea345604d..6dfa19485d 100644 --- a/src/app/core/locale/locale.interceptor.ts +++ b/src/app/core/locale/locale.interceptor.ts @@ -1,4 +1,9 @@ -import { HttpEvent, HttpHandler, HttpInterceptor, HttpRequest } from '@angular/common/http'; +import { + HttpEvent, + HttpHandler, + HttpInterceptor, + HttpRequest, +} from '@angular/common/http'; import { Injectable } from '@angular/core'; import { Observable } from 'rxjs'; import { diff --git a/src/app/core/log/log.interceptor.spec.ts b/src/app/core/log/log.interceptor.spec.ts index dda3052a03..021526f2e1 100644 --- a/src/app/core/log/log.interceptor.spec.ts +++ b/src/app/core/log/log.interceptor.spec.ts @@ -1,5 +1,12 @@ -import { HTTP_INTERCEPTORS, provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; -import { HttpTestingController, provideHttpClientTesting } from '@angular/common/http/testing'; +import { + HTTP_INTERCEPTORS, + provideHttpClient, + withInterceptorsFromDi, +} from '@angular/common/http'; +import { + HttpTestingController, + provideHttpClientTesting, +} from '@angular/common/http/testing'; import { TestBed } from '@angular/core/testing'; import { Router } from '@angular/router'; import { StoreModule } from '@ngrx/store'; @@ -36,14 +43,14 @@ describe('LogInterceptor', () => { beforeEach(() => { TestBed.configureTestingModule({ - imports: [StoreModule.forRoot(appReducers, storeModuleConfig)], - providers: [ + imports: [StoreModule.forRoot(appReducers, storeModuleConfig)], + providers: [ DspaceRestService, // LogInterceptor, { - provide: HTTP_INTERCEPTORS, - useClass: LogInterceptor, - multi: true, + provide: HTTP_INTERCEPTORS, + useClass: LogInterceptor, + multi: true, }, { provide: CookieService, useValue: new CookieServiceMock() }, { provide: Router, useValue: router }, @@ -51,8 +58,8 @@ describe('LogInterceptor', () => { { provide: UUIDService, useClass: UUIDService }, provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), - ] -}); + ], + }); service = TestBed.inject(DspaceRestService); httpMock = TestBed.inject(HttpTestingController); diff --git a/src/app/core/log/log.interceptor.ts b/src/app/core/log/log.interceptor.ts index d9c67f9628..bda408278f 100644 --- a/src/app/core/log/log.interceptor.ts +++ b/src/app/core/log/log.interceptor.ts @@ -1,4 +1,9 @@ -import { HttpEvent, HttpHandler, HttpInterceptor, HttpRequest } from '@angular/common/http'; +import { + HttpEvent, + HttpHandler, + HttpInterceptor, + HttpRequest, +} from '@angular/common/http'; import { Injectable } from '@angular/core'; import { Router } from '@angular/router'; import { Observable } from 'rxjs'; diff --git a/src/app/core/notifications/qa/events/quality-assurance-event-data.service.ts b/src/app/core/notifications/qa/events/quality-assurance-event-data.service.ts index b4db9d6361..7e6e888417 100644 --- a/src/app/core/notifications/qa/events/quality-assurance-event-data.service.ts +++ b/src/app/core/notifications/qa/events/quality-assurance-event-data.service.ts @@ -1,4 +1,7 @@ -import { HttpHeaders, HttpParams } from '@angular/common/http'; +import { + HttpHeaders, + HttpParams, +} from '@angular/common/http'; import { Injectable } from '@angular/core'; import { ReplaceOperation } from 'fast-json-patch'; import { Observable } from 'rxjs'; diff --git a/src/app/core/profile/researcher-profile-data.service.spec.ts b/src/app/core/profile/researcher-profile-data.service.spec.ts index bc6106fc8e..ccaa7063dd 100644 --- a/src/app/core/profile/researcher-profile-data.service.spec.ts +++ b/src/app/core/profile/researcher-profile-data.service.spec.ts @@ -1,4 +1,7 @@ -import { HttpClient, HttpHeaders } from '@angular/common/http'; +import { + HttpClient, + HttpHeaders, +} from '@angular/common/http'; import { ReplaceOperation } from 'fast-json-patch'; import { cold, diff --git a/src/app/core/submission/workspaceitem-data.service.spec.ts b/src/app/core/submission/workspaceitem-data.service.spec.ts index fa24bcc2d9..8837792a78 100644 --- a/src/app/core/submission/workspaceitem-data.service.spec.ts +++ b/src/app/core/submission/workspaceitem-data.service.spec.ts @@ -1,4 +1,7 @@ -import { HttpClient, HttpHeaders } from '@angular/common/http'; +import { + HttpClient, + HttpHeaders, +} from '@angular/common/http'; import { waitForAsync } from '@angular/core/testing'; import { Store } from '@ngrx/store'; import { diff --git a/src/app/core/submission/workspaceitem-data.service.ts b/src/app/core/submission/workspaceitem-data.service.ts index ef09ce5768..17aafaf651 100644 --- a/src/app/core/submission/workspaceitem-data.service.ts +++ b/src/app/core/submission/workspaceitem-data.service.ts @@ -1,4 +1,7 @@ -import { HttpClient, HttpHeaders } from '@angular/common/http'; +import { + HttpClient, + HttpHeaders, +} from '@angular/common/http'; import { Injectable } from '@angular/core'; import { Store } from '@ngrx/store'; import { Observable } from 'rxjs'; diff --git a/src/app/core/xsrf/browser-xsrf.service.spec.ts b/src/app/core/xsrf/browser-xsrf.service.spec.ts index 5a1875a759..9c67819741 100644 --- a/src/app/core/xsrf/browser-xsrf.service.spec.ts +++ b/src/app/core/xsrf/browser-xsrf.service.spec.ts @@ -1,5 +1,12 @@ -import { HttpClient, provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; -import { HttpTestingController, provideHttpClientTesting } from '@angular/common/http/testing'; +import { + HttpClient, + provideHttpClient, + withInterceptorsFromDi, +} from '@angular/common/http'; +import { + HttpTestingController, + provideHttpClientTesting, +} from '@angular/common/http/testing'; import { TestBed } from '@angular/core/testing'; import { RESTURLCombiner } from '../url-combiner/rest-url-combiner'; @@ -14,9 +21,13 @@ describe(`BrowserXSRFService`, () => { beforeEach(() => { TestBed.configureTestingModule({ - imports: [], - providers: [BrowserXSRFService, provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting()] -}); + imports: [], + providers: [ + BrowserXSRFService, + provideHttpClient(withInterceptorsFromDi()), + provideHttpClientTesting(), + ], + }); httpClient = TestBed.inject(HttpClient); httpTestingController = TestBed.inject(HttpTestingController); service = TestBed.inject(BrowserXSRFService); diff --git a/src/app/core/xsrf/xsrf.interceptor.spec.ts b/src/app/core/xsrf/xsrf.interceptor.spec.ts index 634593142a..b04958690b 100644 --- a/src/app/core/xsrf/xsrf.interceptor.spec.ts +++ b/src/app/core/xsrf/xsrf.interceptor.spec.ts @@ -1,5 +1,14 @@ -import { HTTP_INTERCEPTORS, HttpHeaders, HttpXsrfTokenExtractor, provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; -import { HttpTestingController, provideHttpClientTesting } from '@angular/common/http/testing'; +import { + HTTP_INTERCEPTORS, + HttpHeaders, + HttpXsrfTokenExtractor, + provideHttpClient, + withInterceptorsFromDi, +} from '@angular/common/http'; +import { + HttpTestingController, + provideHttpClientTesting, +} from '@angular/common/http/testing'; import { TestBed } from '@angular/core/testing'; import { CookieServiceMock } from '../../shared/mocks/cookie.service.mock'; @@ -28,20 +37,20 @@ describe(`XsrfInterceptor`, () => { beforeEach(() => { TestBed.configureTestingModule({ - imports: [], - providers: [ + imports: [], + providers: [ DspaceRestService, { - provide: HTTP_INTERCEPTORS, - useClass: XsrfInterceptor, - multi: true, + provide: HTTP_INTERCEPTORS, + useClass: XsrfInterceptor, + multi: true, }, { provide: HttpXsrfTokenExtractor, useValue: new HttpXsrfTokenExtractorMock(testToken) }, { provide: CookieService, useValue: new CookieServiceMock() }, provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), - ] -}); + ], + }); service = TestBed.get(DspaceRestService); httpMock = TestBed.get(HttpTestingController); diff --git a/src/app/core/xsrf/xsrf.interceptor.ts b/src/app/core/xsrf/xsrf.interceptor.ts index 3155d73fe5..91e780590b 100644 --- a/src/app/core/xsrf/xsrf.interceptor.ts +++ b/src/app/core/xsrf/xsrf.interceptor.ts @@ -1,4 +1,12 @@ -import { HttpErrorResponse, HttpEvent, HttpHandler, HttpInterceptor, HttpRequest, HttpResponse, HttpXsrfTokenExtractor } from '@angular/common/http'; +import { + HttpErrorResponse, + HttpEvent, + HttpHandler, + HttpInterceptor, + HttpRequest, + HttpResponse, + HttpXsrfTokenExtractor, +} from '@angular/common/http'; import { Injectable } from '@angular/core'; import { Observable, diff --git a/src/app/shared/lang-switch/lang-switch.component.spec.ts b/src/app/shared/lang-switch/lang-switch.component.spec.ts index 1f96be936e..80d9c83d91 100644 --- a/src/app/shared/lang-switch/lang-switch.component.spec.ts +++ b/src/app/shared/lang-switch/lang-switch.component.spec.ts @@ -1,4 +1,11 @@ -import { HttpTestingController, provideHttpClientTesting } from '@angular/common/http/testing'; +import { + provideHttpClient, + withInterceptorsFromDi, +} from '@angular/common/http'; +import { + HttpTestingController, + provideHttpClientTesting, +} from '@angular/common/http/testing'; import { DebugElement, NO_ERRORS_SCHEMA, @@ -22,7 +29,6 @@ import { import { LangConfig } from '../../../config/lang-config.interface'; import { LocaleService } from '../../core/locale/locale.service'; import { LangSwitchComponent } from './lang-switch.component'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; // This test is completely independent from any message catalogs or keys in the codebase // The translation module is instantiated with these bogus messages that we aren't using anyway. @@ -81,17 +87,17 @@ describe('LangSwitchComponent', () => { }; TestBed.configureTestingModule({ - schemas: [NO_ERRORS_SCHEMA], - imports: [TranslateModule.forRoot({ - loader: { provide: TranslateLoader, useClass: CustomLoader }, + schemas: [NO_ERRORS_SCHEMA], + imports: [TranslateModule.forRoot({ + loader: { provide: TranslateLoader, useClass: CustomLoader }, }), LangSwitchComponent], - providers: [ - TranslateService, - { provide: LocaleService, useValue: getMockLocaleService() }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), - ] -}).compileComponents() + providers: [ + TranslateService, + { provide: LocaleService, useValue: getMockLocaleService() }, + provideHttpClient(withInterceptorsFromDi()), + provideHttpClientTesting(), + ], + }).compileComponents() .then(() => { translate = TestBed.inject(TranslateService); translate.addLangs(mockConfig.languages.filter((langConfig: LangConfig) => langConfig.active === true).map((a) => a.code)); @@ -166,17 +172,17 @@ describe('LangSwitchComponent', () => { }; TestBed.configureTestingModule({ - schemas: [NO_ERRORS_SCHEMA], - imports: [TranslateModule.forRoot({ - loader: { provide: TranslateLoader, useClass: CustomLoader }, + schemas: [NO_ERRORS_SCHEMA], + imports: [TranslateModule.forRoot({ + loader: { provide: TranslateLoader, useClass: CustomLoader }, }), LangSwitchComponent], - providers: [ - TranslateService, - { provide: LocaleService, useValue: getMockLocaleService() }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), - ] -}).compileComponents(); + providers: [ + TranslateService, + { provide: LocaleService, useValue: getMockLocaleService() }, + provideHttpClient(withInterceptorsFromDi()), + provideHttpClientTesting(), + ], + }).compileComponents(); translate = TestBed.inject(TranslateService); translate.addLangs(mockConfig.languages.filter((MyLangConfig) => MyLangConfig.active === true).map((a) => a.code)); translate.setDefaultLang('en'); diff --git a/src/app/shared/mocks/dspace-rest/endpoint-mocking-rest.service.spec.ts b/src/app/shared/mocks/dspace-rest/endpoint-mocking-rest.service.spec.ts index 26e3733a36..84664b7b20 100644 --- a/src/app/shared/mocks/dspace-rest/endpoint-mocking-rest.service.spec.ts +++ b/src/app/shared/mocks/dspace-rest/endpoint-mocking-rest.service.spec.ts @@ -1,4 +1,7 @@ -import { HttpHeaders, HttpResponse } from '@angular/common/http'; +import { + HttpHeaders, + HttpResponse, +} from '@angular/common/http'; import { of as observableOf } from 'rxjs'; import { RestRequestMethod } from '../../../core/data/rest-request-method'; diff --git a/src/app/shared/mocks/dspace-rest/endpoint-mocking-rest.service.ts b/src/app/shared/mocks/dspace-rest/endpoint-mocking-rest.service.ts index acad4b764b..bfdbe4d6d7 100644 --- a/src/app/shared/mocks/dspace-rest/endpoint-mocking-rest.service.ts +++ b/src/app/shared/mocks/dspace-rest/endpoint-mocking-rest.service.ts @@ -1,4 +1,7 @@ -import { HttpClient, HttpHeaders } from '@angular/common/http'; +import { + HttpClient, + HttpHeaders, +} from '@angular/common/http'; import { Inject, Injectable, diff --git a/src/modules/app/browser-app.config.ts b/src/modules/app/browser-app.config.ts index f668b6a3c0..213b9de2f7 100644 --- a/src/modules/app/browser-app.config.ts +++ b/src/modules/app/browser-app.config.ts @@ -1,4 +1,8 @@ -import { HttpClient, provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; +import { + HttpClient, + provideHttpClient, + withInterceptorsFromDi, +} from '@angular/common/http'; import { APP_ID, APP_INITIALIZER, diff --git a/src/themes/custom/lazy-theme.module.ts b/src/themes/custom/lazy-theme.module.ts index 98d7561b8d..cd677847ce 100644 --- a/src/themes/custom/lazy-theme.module.ts +++ b/src/themes/custom/lazy-theme.module.ts @@ -1,6 +1,9 @@ import { DragDropModule } from '@angular/cdk/drag-drop'; import { CommonModule } from '@angular/common'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; +import { + provideHttpClient, + withInterceptorsFromDi, +} from '@angular/common/http'; import { NgModule } from '@angular/core'; import { FormsModule } from '@angular/forms'; import { RouterModule } from '@angular/router'; @@ -203,19 +206,24 @@ const DECLARATIONS = [ SearchResultsSkeletonComponent, ]; -@NgModule({ imports: [RootModule, - CommonModule, - DragDropModule, - FormsModule, - NgbModule, - RouterModule, - ScrollToModule, - StoreModule, - StoreRouterConnectingModule, - TranslateModule, - FormsModule, - NgxGalleryModule, - ...DECLARATIONS], providers: [provideHttpClient(withInterceptorsFromDi())] }) +@NgModule({ + imports: [RootModule, + CommonModule, + DragDropModule, + FormsModule, + NgbModule, + RouterModule, + ScrollToModule, + StoreModule, + StoreRouterConnectingModule, + TranslateModule, + FormsModule, + NgxGalleryModule, + ...DECLARATIONS], + providers: [ + provideHttpClient(withInterceptorsFromDi()), + ], +}) /** * This module serves as an index for all the components in this theme. diff --git a/src/themes/dspace/lazy-theme.module.ts b/src/themes/dspace/lazy-theme.module.ts index 51baf83081..8de71d14c8 100644 --- a/src/themes/dspace/lazy-theme.module.ts +++ b/src/themes/dspace/lazy-theme.module.ts @@ -1,6 +1,9 @@ import { DragDropModule } from '@angular/cdk/drag-drop'; import { CommonModule } from '@angular/common'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; +import { + provideHttpClient, + withInterceptorsFromDi, +} from '@angular/common/http'; import { NgModule } from '@angular/core'; import { FormsModule } from '@angular/forms'; import { RouterModule } from '@angular/router'; @@ -15,17 +18,25 @@ import { RootModule } from '../../app/root.module'; const DECLARATIONS = [ ]; -@NgModule({ declarations: DECLARATIONS, imports: [RootModule, - CommonModule, - DragDropModule, - FormsModule, - NgbModule, - RouterModule, - ScrollToModule, - StoreModule, - StoreRouterConnectingModule, - TranslateModule, - FormsModule], providers: [provideHttpClient(withInterceptorsFromDi())] }) +@NgModule({ + declarations: DECLARATIONS, + imports: [ + RootModule, + CommonModule, + DragDropModule, + FormsModule, + NgbModule, + RouterModule, + ScrollToModule, + StoreModule, + StoreRouterConnectingModule, + TranslateModule, + FormsModule, + ], + providers: [ + provideHttpClient(withInterceptorsFromDi()), + ], +}) /** * This module serves as an index for all the components in this theme.