mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 01:54:15 +00:00
120243: Fix lint issues after upgrade
This commit is contained in:

committed by
Yury Bondarenko

parent
ae32581d20
commit
d87b375a35
@@ -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;
|
||||
@@ -54,8 +57,8 @@ describe('FiltersComponent', () => {
|
||||
DspaceRestService,
|
||||
provideHttpClient(withInterceptorsFromDi()),
|
||||
provideHttpClientTesting(),
|
||||
]
|
||||
});
|
||||
],
|
||||
});
|
||||
}));
|
||||
|
||||
beforeEach(waitForAsync(() => {
|
||||
|
@@ -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';
|
||||
@@ -38,8 +45,8 @@ describe(`AuthInterceptor`, () => {
|
||||
{ provide: Store, useValue: store },
|
||||
provideHttpClient(withInterceptorsFromDi()),
|
||||
provideHttpClientTesting(),
|
||||
]
|
||||
});
|
||||
],
|
||||
});
|
||||
|
||||
service = TestBed.inject(DspaceRestService);
|
||||
httpMock = TestBed.inject(HttpTestingController);
|
||||
|
@@ -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,
|
||||
|
@@ -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,
|
||||
|
@@ -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';
|
||||
|
@@ -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 {
|
||||
|
@@ -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';
|
||||
|
@@ -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,
|
||||
@@ -28,8 +36,12 @@ describe('DspaceRestService', () => {
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [],
|
||||
providers: [DspaceRestService, provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting()]
|
||||
});
|
||||
providers: [
|
||||
DspaceRestService,
|
||||
provideHttpClient(withInterceptorsFromDi()),
|
||||
provideHttpClientTesting(),
|
||||
],
|
||||
});
|
||||
|
||||
dspaceRestService = TestBed.inject(DspaceRestService);
|
||||
httpMock = TestBed.inject(HttpTestingController);
|
||||
|
@@ -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,
|
||||
|
@@ -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';
|
||||
@@ -29,8 +36,8 @@ describe('ForwardClientIpInterceptor', () => {
|
||||
{ provide: REQUEST, useValue: { get: () => undefined, connection: { remoteAddress: clientIp } } },
|
||||
provideHttpClient(withInterceptorsFromDi()),
|
||||
provideHttpClientTesting(),
|
||||
]
|
||||
});
|
||||
],
|
||||
});
|
||||
|
||||
service = TestBed.inject(DspaceRestService);
|
||||
httpMock = TestBed.inject(HttpTestingController);
|
||||
|
@@ -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,
|
||||
|
@@ -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';
|
||||
|
||||
@@ -33,8 +40,8 @@ describe(`LocaleInterceptor`, () => {
|
||||
{ provide: LocaleService, useValue: mockLocaleService },
|
||||
provideHttpClient(withInterceptorsFromDi()),
|
||||
provideHttpClientTesting(),
|
||||
]
|
||||
});
|
||||
],
|
||||
});
|
||||
|
||||
service = TestBed.inject(DspaceRestService);
|
||||
httpMock = TestBed.inject(HttpTestingController);
|
||||
|
@@ -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 {
|
||||
|
@@ -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';
|
||||
@@ -51,8 +58,8 @@ describe('LogInterceptor', () => {
|
||||
{ provide: UUIDService, useClass: UUIDService },
|
||||
provideHttpClient(withInterceptorsFromDi()),
|
||||
provideHttpClientTesting(),
|
||||
]
|
||||
});
|
||||
],
|
||||
});
|
||||
|
||||
service = TestBed.inject(DspaceRestService);
|
||||
httpMock = TestBed.inject(HttpTestingController);
|
||||
|
@@ -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';
|
||||
|
@@ -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';
|
||||
|
@@ -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,
|
||||
|
@@ -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 {
|
||||
|
@@ -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';
|
||||
|
@@ -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';
|
||||
@@ -15,8 +22,12 @@ describe(`BrowserXSRFService`, () => {
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [],
|
||||
providers: [BrowserXSRFService, provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting()]
|
||||
});
|
||||
providers: [
|
||||
BrowserXSRFService,
|
||||
provideHttpClient(withInterceptorsFromDi()),
|
||||
provideHttpClientTesting(),
|
||||
],
|
||||
});
|
||||
httpClient = TestBed.inject(HttpClient);
|
||||
httpTestingController = TestBed.inject(HttpTestingController);
|
||||
service = TestBed.inject(BrowserXSRFService);
|
||||
|
@@ -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';
|
||||
@@ -40,8 +49,8 @@ describe(`XsrfInterceptor`, () => {
|
||||
{ provide: CookieService, useValue: new CookieServiceMock() },
|
||||
provideHttpClient(withInterceptorsFromDi()),
|
||||
provideHttpClientTesting(),
|
||||
]
|
||||
});
|
||||
],
|
||||
});
|
||||
|
||||
service = TestBed.get(DspaceRestService);
|
||||
httpMock = TestBed.get(HttpTestingController);
|
||||
|
@@ -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,
|
||||
|
@@ -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.
|
||||
@@ -90,8 +96,8 @@ describe('LangSwitchComponent', () => {
|
||||
{ provide: LocaleService, useValue: getMockLocaleService() },
|
||||
provideHttpClient(withInterceptorsFromDi()),
|
||||
provideHttpClientTesting(),
|
||||
]
|
||||
}).compileComponents()
|
||||
],
|
||||
}).compileComponents()
|
||||
.then(() => {
|
||||
translate = TestBed.inject(TranslateService);
|
||||
translate.addLangs(mockConfig.languages.filter((langConfig: LangConfig) => langConfig.active === true).map((a) => a.code));
|
||||
@@ -175,8 +181,8 @@ describe('LangSwitchComponent', () => {
|
||||
{ provide: LocaleService, useValue: getMockLocaleService() },
|
||||
provideHttpClient(withInterceptorsFromDi()),
|
||||
provideHttpClientTesting(),
|
||||
]
|
||||
}).compileComponents();
|
||||
],
|
||||
}).compileComponents();
|
||||
translate = TestBed.inject(TranslateService);
|
||||
translate.addLangs(mockConfig.languages.filter((MyLangConfig) => MyLangConfig.active === true).map((a) => a.code));
|
||||
translate.setDefaultLang('en');
|
||||
|
@@ -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';
|
||||
|
@@ -1,4 +1,7 @@
|
||||
import { HttpClient, HttpHeaders } from '@angular/common/http';
|
||||
import {
|
||||
HttpClient,
|
||||
HttpHeaders,
|
||||
} from '@angular/common/http';
|
||||
import {
|
||||
Inject,
|
||||
Injectable,
|
||||
|
@@ -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,
|
||||
|
@@ -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,7 +206,8 @@ const DECLARATIONS = [
|
||||
SearchResultsSkeletonComponent,
|
||||
];
|
||||
|
||||
@NgModule({ imports: [RootModule,
|
||||
@NgModule({
|
||||
imports: [RootModule,
|
||||
CommonModule,
|
||||
DragDropModule,
|
||||
FormsModule,
|
||||
@@ -215,7 +219,11 @@ const DECLARATIONS = [
|
||||
TranslateModule,
|
||||
FormsModule,
|
||||
NgxGalleryModule,
|
||||
...DECLARATIONS], providers: [provideHttpClient(withInterceptorsFromDi())] })
|
||||
...DECLARATIONS],
|
||||
providers: [
|
||||
provideHttpClient(withInterceptorsFromDi()),
|
||||
],
|
||||
})
|
||||
|
||||
/**
|
||||
* This module serves as an index for all the components in this theme.
|
||||
|
@@ -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,7 +18,10 @@ import { RootModule } from '../../app/root.module';
|
||||
const DECLARATIONS = [
|
||||
];
|
||||
|
||||
@NgModule({ declarations: DECLARATIONS, imports: [RootModule,
|
||||
@NgModule({
|
||||
declarations: DECLARATIONS,
|
||||
imports: [
|
||||
RootModule,
|
||||
CommonModule,
|
||||
DragDropModule,
|
||||
FormsModule,
|
||||
@@ -25,7 +31,12 @@ const DECLARATIONS = [
|
||||
StoreModule,
|
||||
StoreRouterConnectingModule,
|
||||
TranslateModule,
|
||||
FormsModule], providers: [provideHttpClient(withInterceptorsFromDi())] })
|
||||
FormsModule,
|
||||
],
|
||||
providers: [
|
||||
provideHttpClient(withInterceptorsFromDi()),
|
||||
],
|
||||
})
|
||||
|
||||
/**
|
||||
* This module serves as an index for all the components in this theme.
|
||||
|
Reference in New Issue
Block a user