mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +00:00
120243: ng update @angular/core @angular/cli --force
This commit is contained in:

committed by
Yury Bondarenko

parent
16eb620f4f
commit
5e7b066af1
8862
package-lock.json
generated
8862
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
36
package.json
36
package.json
@@ -11,12 +11,10 @@
|
|||||||
"start:mirador:prod": "npm run build:mirador && npm run start:prod",
|
"start:mirador:prod": "npm run build:mirador && npm run start:prod",
|
||||||
"preserve": "npm run base-href",
|
"preserve": "npm run base-href",
|
||||||
"serve": "ts-node --project ./tsconfig.ts-node.json scripts/serve.ts",
|
"serve": "ts-node --project ./tsconfig.ts-node.json scripts/serve.ts",
|
||||||
"serve:ssr": "node dist/server/main",
|
|
||||||
"analyze": "webpack-bundle-analyzer dist/browser/stats.json",
|
"analyze": "webpack-bundle-analyzer dist/browser/stats.json",
|
||||||
"build": "ng build --configuration development",
|
"build": "ng build --configuration development",
|
||||||
"build:stats": "ng build --stats-json",
|
"build:stats": "ng build --stats-json",
|
||||||
"build:prod": "cross-env NODE_ENV=production npm run build:ssr",
|
"build:prod": "cross-env NODE_ENV=production npm run build:ssr",
|
||||||
"build:ssr": "ng build --configuration production && ng run dspace-angular:server:production",
|
|
||||||
"build:lint": "rimraf 'lint/dist/**/*.js' 'lint/dist/**/*.js.map' && tsc -b lint/tsconfig.json",
|
"build:lint": "rimraf 'lint/dist/**/*.js' 'lint/dist/**/*.js.map' && tsc -b lint/tsconfig.json",
|
||||||
"test": "ng test --source-map=true --watch=false --configuration test",
|
"test": "ng test --source-map=true --watch=false --configuration test",
|
||||||
"test:watch": "nodemon --exec \"ng test --source-map=true --watch=true --configuration test\"",
|
"test:watch": "nodemon --exec \"ng test --source-map=true --watch=true --configuration test\"",
|
||||||
@@ -98,19 +96,19 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@angular/animations": "^17.3.12",
|
"@angular/animations": "^18.2.12",
|
||||||
"@angular/cdk": "^17.3.10",
|
"@angular/cdk": "^17.3.10",
|
||||||
"@angular/common": "^17.3.12",
|
"@angular/common": "^18.2.12",
|
||||||
"@angular/compiler": "^17.3.12",
|
"@angular/compiler": "^18.2.12",
|
||||||
"@angular/core": "^17.3.12",
|
"@angular/core": "^18.2.12",
|
||||||
"@angular/forms": "^17.3.12",
|
"@angular/forms": "^18.2.12",
|
||||||
"@angular/localize": "^17.3.12",
|
"@angular/localize": "^18.2.12",
|
||||||
"@angular/platform-browser": "^17.3.12",
|
"@angular/platform-browser": "^18.2.12",
|
||||||
"@angular/platform-browser-dynamic": "^17.3.12",
|
"@angular/platform-browser-dynamic": "^18.2.12",
|
||||||
"@angular/platform-server": "^17.3.12",
|
"@angular/platform-server": "^18.2.12",
|
||||||
"@angular/router": "^17.3.12",
|
"@angular/router": "^18.2.12",
|
||||||
"@angular/ssr": "^17.3.11",
|
"@angular/ssr": "^18.2.12",
|
||||||
"@babel/runtime": "7.26.7",
|
"@babel/runtime": "7.26.0",
|
||||||
"@kolkov/ngx-gallery": "^2.0.1",
|
"@kolkov/ngx-gallery": "^2.0.1",
|
||||||
"@ng-bootstrap/ng-bootstrap": "^12.0.0",
|
"@ng-bootstrap/ng-bootstrap": "^12.0.0",
|
||||||
"@ng-dynamic-forms/core": "^16.0.0",
|
"@ng-dynamic-forms/core": "^16.0.0",
|
||||||
@@ -168,7 +166,7 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@angular-builders/custom-webpack": "~17.0.2",
|
"@angular-builders/custom-webpack": "~17.0.2",
|
||||||
"@angular-devkit/build-angular": "^17.3.11",
|
"@angular-devkit/build-angular": "^18.2.12",
|
||||||
"@angular-eslint/builder": "^18.4.1",
|
"@angular-eslint/builder": "^18.4.1",
|
||||||
"@angular-eslint/bundled-angular-compiler": "^18.4.1",
|
"@angular-eslint/bundled-angular-compiler": "^18.4.1",
|
||||||
"@angular-eslint/eslint-plugin": "^18.4.1",
|
"@angular-eslint/eslint-plugin": "^18.4.1",
|
||||||
@@ -176,9 +174,9 @@
|
|||||||
"@angular-eslint/schematics": "^18.4.1",
|
"@angular-eslint/schematics": "^18.4.1",
|
||||||
"@angular-eslint/template-parser": "^18.4.1",
|
"@angular-eslint/template-parser": "^18.4.1",
|
||||||
"@angular-eslint/utils": "^18.4.1",
|
"@angular-eslint/utils": "^18.4.1",
|
||||||
"@angular/cli": "^17.3.11",
|
"@angular/cli": "^18.2.12",
|
||||||
"@angular/compiler-cli": "^17.3.11",
|
"@angular/compiler-cli": "^18.2.12",
|
||||||
"@angular/language-service": "^17.3.12",
|
"@angular/language-service": "^18.2.12",
|
||||||
"@cypress/schematic": "^1.5.0",
|
"@cypress/schematic": "^1.5.0",
|
||||||
"@fortawesome/fontawesome-free": "^6.7.2",
|
"@fortawesome/fontawesome-free": "^6.7.2",
|
||||||
"@ngrx/store-devtools": "^17.1.1",
|
"@ngrx/store-devtools": "^17.1.1",
|
||||||
@@ -241,4 +239,4 @@
|
|||||||
"webpack-cli": "^5.1.4",
|
"webpack-cli": "^5.1.4",
|
||||||
"webpack-dev-server": "^4.15.1"
|
"webpack-dev-server": "^4.15.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
import { HttpClientTestingModule } from '@angular/common/http/testing';
|
import { provideHttpClientTesting } from '@angular/common/http/testing';
|
||||||
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
||||||
import {
|
import {
|
||||||
ComponentFixture,
|
ComponentFixture,
|
||||||
@@ -20,6 +20,7 @@ import { RawRestResponse } from 'src/app/core/dspace-rest/raw-rest-response.mode
|
|||||||
import { TranslateLoaderMock } from 'src/app/shared/mocks/translate-loader.mock';
|
import { TranslateLoaderMock } from 'src/app/shared/mocks/translate-loader.mock';
|
||||||
|
|
||||||
import { FilteredCollectionsComponent } from './filtered-collections.component';
|
import { FilteredCollectionsComponent } from './filtered-collections.component';
|
||||||
|
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
|
||||||
|
|
||||||
describe('FiltersComponent', () => {
|
describe('FiltersComponent', () => {
|
||||||
let component: FilteredCollectionsComponent;
|
let component: FilteredCollectionsComponent;
|
||||||
@@ -39,23 +40,22 @@ describe('FiltersComponent', () => {
|
|||||||
|
|
||||||
beforeEach(waitForAsync(() => {
|
beforeEach(waitForAsync(() => {
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [
|
schemas: [NO_ERRORS_SCHEMA],
|
||||||
NgbAccordionModule,
|
imports: [NgbAccordionModule,
|
||||||
TranslateModule.forRoot({
|
TranslateModule.forRoot({
|
||||||
loader: {
|
loader: {
|
||||||
provide: TranslateLoader,
|
provide: TranslateLoader,
|
||||||
useClass: TranslateLoaderMock,
|
useClass: TranslateLoaderMock,
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
HttpClientTestingModule,
|
FilteredCollectionsComponent],
|
||||||
FilteredCollectionsComponent,
|
providers: [
|
||||||
],
|
|
||||||
providers: [
|
|
||||||
FormBuilder,
|
FormBuilder,
|
||||||
DspaceRestService,
|
DspaceRestService,
|
||||||
],
|
provideHttpClient(withInterceptorsFromDi()),
|
||||||
schemas: [NO_ERRORS_SCHEMA],
|
provideHttpClientTesting(),
|
||||||
});
|
]
|
||||||
|
});
|
||||||
}));
|
}));
|
||||||
|
|
||||||
beforeEach(waitForAsync(() => {
|
beforeEach(waitForAsync(() => {
|
||||||
|
@@ -1,8 +1,5 @@
|
|||||||
import { HTTP_INTERCEPTORS } from '@angular/common/http';
|
import { HTTP_INTERCEPTORS, provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
|
||||||
import {
|
import { HttpTestingController, provideHttpClientTesting } from '@angular/common/http/testing';
|
||||||
HttpClientTestingModule,
|
|
||||||
HttpTestingController,
|
|
||||||
} from '@angular/common/http/testing';
|
|
||||||
import { TestBed } from '@angular/core/testing';
|
import { TestBed } from '@angular/core/testing';
|
||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
import { Store } from '@ngrx/store';
|
import { Store } from '@ngrx/store';
|
||||||
@@ -28,19 +25,21 @@ describe(`AuthInterceptor`, () => {
|
|||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [HttpClientTestingModule],
|
imports: [],
|
||||||
providers: [
|
providers: [
|
||||||
DspaceRestService,
|
DspaceRestService,
|
||||||
{ provide: AuthService, useValue: authServiceStub },
|
{ provide: AuthService, useValue: authServiceStub },
|
||||||
{ provide: Router, useClass: RouterStub },
|
{ provide: Router, useClass: RouterStub },
|
||||||
{
|
{
|
||||||
provide: HTTP_INTERCEPTORS,
|
provide: HTTP_INTERCEPTORS,
|
||||||
useClass: AuthInterceptor,
|
useClass: AuthInterceptor,
|
||||||
multi: true,
|
multi: true,
|
||||||
},
|
},
|
||||||
{ provide: Store, useValue: store },
|
{ provide: Store, useValue: store },
|
||||||
],
|
provideHttpClient(withInterceptorsFromDi()),
|
||||||
});
|
provideHttpClientTesting(),
|
||||||
|
]
|
||||||
|
});
|
||||||
|
|
||||||
service = TestBed.inject(DspaceRestService);
|
service = TestBed.inject(DspaceRestService);
|
||||||
httpMock = TestBed.inject(HttpTestingController);
|
httpMock = TestBed.inject(HttpTestingController);
|
||||||
|
@@ -1,13 +1,4 @@
|
|||||||
import {
|
import { HttpErrorResponse, HttpEvent, HttpHandler, HttpHeaders, HttpInterceptor, HttpRequest, HttpResponse, HttpResponseBase } from '@angular/common/http';
|
||||||
HttpErrorResponse,
|
|
||||||
HttpEvent,
|
|
||||||
HttpHandler,
|
|
||||||
HttpHeaders,
|
|
||||||
HttpInterceptor,
|
|
||||||
HttpRequest,
|
|
||||||
HttpResponse,
|
|
||||||
HttpResponseBase,
|
|
||||||
} from '@angular/common/http';
|
|
||||||
import {
|
import {
|
||||||
Injectable,
|
Injectable,
|
||||||
Injector,
|
Injector,
|
||||||
|
@@ -1,8 +1,4 @@
|
|||||||
import {
|
import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http';
|
||||||
HttpClient,
|
|
||||||
HttpHeaders,
|
|
||||||
HttpResponse,
|
|
||||||
} from '@angular/common/http';
|
|
||||||
import {
|
import {
|
||||||
Observable,
|
Observable,
|
||||||
of as observableOf,
|
of as observableOf,
|
||||||
|
@@ -1,8 +1,4 @@
|
|||||||
import {
|
import { HttpClient, HttpHeaders, HttpResponse } from '@angular/common/http';
|
||||||
HttpClient,
|
|
||||||
HttpHeaders,
|
|
||||||
HttpResponse,
|
|
||||||
} from '@angular/common/http';
|
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
import { map } from 'rxjs/operators';
|
import { map } from 'rxjs/operators';
|
||||||
|
@@ -1,7 +1,4 @@
|
|||||||
import {
|
import { HttpHeaders, HttpParams } from '@angular/common/http';
|
||||||
HttpHeaders,
|
|
||||||
HttpParams,
|
|
||||||
} from '@angular/common/http';
|
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
import {
|
import {
|
||||||
|
@@ -1,8 +1,4 @@
|
|||||||
import {
|
import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http';
|
||||||
HttpClient,
|
|
||||||
HttpHeaders,
|
|
||||||
HttpParams,
|
|
||||||
} from '@angular/common/http';
|
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { Store } from '@ngrx/store';
|
import { Store } from '@ngrx/store';
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
|
@@ -1,11 +1,5 @@
|
|||||||
import {
|
import { HttpErrorResponse, HttpHeaders, provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
|
||||||
HttpErrorResponse,
|
import { HttpTestingController, provideHttpClientTesting } from '@angular/common/http/testing';
|
||||||
HttpHeaders,
|
|
||||||
} from '@angular/common/http';
|
|
||||||
import {
|
|
||||||
HttpClientTestingModule,
|
|
||||||
HttpTestingController,
|
|
||||||
} from '@angular/common/http/testing';
|
|
||||||
import {
|
import {
|
||||||
inject,
|
inject,
|
||||||
TestBed,
|
TestBed,
|
||||||
@@ -33,9 +27,9 @@ describe('DspaceRestService', () => {
|
|||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [HttpClientTestingModule],
|
imports: [],
|
||||||
providers: [DspaceRestService],
|
providers: [DspaceRestService, provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting()]
|
||||||
});
|
});
|
||||||
|
|
||||||
dspaceRestService = TestBed.inject(DspaceRestService);
|
dspaceRestService = TestBed.inject(DspaceRestService);
|
||||||
httpMock = TestBed.inject(HttpTestingController);
|
httpMock = TestBed.inject(HttpTestingController);
|
||||||
|
@@ -1,10 +1,4 @@
|
|||||||
import {
|
import { HttpClient, HttpErrorResponse, HttpHeaders, HttpParams, HttpResponse } from '@angular/common/http';
|
||||||
HttpClient,
|
|
||||||
HttpErrorResponse,
|
|
||||||
HttpHeaders,
|
|
||||||
HttpParams,
|
|
||||||
HttpResponse,
|
|
||||||
} from '@angular/common/http';
|
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import {
|
import {
|
||||||
Observable,
|
Observable,
|
||||||
|
@@ -1,8 +1,5 @@
|
|||||||
import { HTTP_INTERCEPTORS } from '@angular/common/http';
|
import { HTTP_INTERCEPTORS, provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
|
||||||
import {
|
import { HttpTestingController, provideHttpClientTesting } from '@angular/common/http/testing';
|
||||||
HttpClientTestingModule,
|
|
||||||
HttpTestingController,
|
|
||||||
} from '@angular/common/http/testing';
|
|
||||||
import { TestBed } from '@angular/core/testing';
|
import { TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
import { REQUEST } from '../../../express.tokens';
|
import { REQUEST } from '../../../express.tokens';
|
||||||
@@ -21,17 +18,19 @@ describe('ForwardClientIpInterceptor', () => {
|
|||||||
clientIp = '1.2.3.4';
|
clientIp = '1.2.3.4';
|
||||||
|
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [HttpClientTestingModule],
|
imports: [],
|
||||||
providers: [
|
providers: [
|
||||||
DspaceRestService,
|
DspaceRestService,
|
||||||
{
|
{
|
||||||
provide: HTTP_INTERCEPTORS,
|
provide: HTTP_INTERCEPTORS,
|
||||||
useClass: ForwardClientIpInterceptor,
|
useClass: ForwardClientIpInterceptor,
|
||||||
multi: true,
|
multi: true,
|
||||||
},
|
},
|
||||||
{ provide: REQUEST, useValue: { get: () => undefined, connection: { remoteAddress: clientIp } } },
|
{ provide: REQUEST, useValue: { get: () => undefined, connection: { remoteAddress: clientIp } } },
|
||||||
],
|
provideHttpClient(withInterceptorsFromDi()),
|
||||||
});
|
provideHttpClientTesting(),
|
||||||
|
]
|
||||||
|
});
|
||||||
|
|
||||||
service = TestBed.inject(DspaceRestService);
|
service = TestBed.inject(DspaceRestService);
|
||||||
httpMock = TestBed.inject(HttpTestingController);
|
httpMock = TestBed.inject(HttpTestingController);
|
||||||
|
@@ -1,9 +1,4 @@
|
|||||||
import {
|
import { HttpEvent, HttpHandler, HttpInterceptor, HttpRequest } from '@angular/common/http';
|
||||||
HttpEvent,
|
|
||||||
HttpHandler,
|
|
||||||
HttpInterceptor,
|
|
||||||
HttpRequest,
|
|
||||||
} from '@angular/common/http';
|
|
||||||
import {
|
import {
|
||||||
Inject,
|
Inject,
|
||||||
Injectable,
|
Injectable,
|
||||||
|
@@ -1,8 +1,5 @@
|
|||||||
import { HTTP_INTERCEPTORS } from '@angular/common/http';
|
import { HTTP_INTERCEPTORS, provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
|
||||||
import {
|
import { HttpTestingController, provideHttpClientTesting } from '@angular/common/http/testing';
|
||||||
HttpClientTestingModule,
|
|
||||||
HttpTestingController,
|
|
||||||
} from '@angular/common/http/testing';
|
|
||||||
import { TestBed } from '@angular/core/testing';
|
import { TestBed } from '@angular/core/testing';
|
||||||
import { of } from 'rxjs';
|
import { of } from 'rxjs';
|
||||||
|
|
||||||
@@ -25,17 +22,19 @@ describe(`LocaleInterceptor`, () => {
|
|||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [HttpClientTestingModule],
|
imports: [],
|
||||||
providers: [
|
providers: [
|
||||||
DspaceRestService,
|
DspaceRestService,
|
||||||
{
|
{
|
||||||
provide: HTTP_INTERCEPTORS,
|
provide: HTTP_INTERCEPTORS,
|
||||||
useClass: LocaleInterceptor,
|
useClass: LocaleInterceptor,
|
||||||
multi: true,
|
multi: true,
|
||||||
},
|
},
|
||||||
{ provide: LocaleService, useValue: mockLocaleService },
|
{ provide: LocaleService, useValue: mockLocaleService },
|
||||||
],
|
provideHttpClient(withInterceptorsFromDi()),
|
||||||
});
|
provideHttpClientTesting(),
|
||||||
|
]
|
||||||
|
});
|
||||||
|
|
||||||
service = TestBed.inject(DspaceRestService);
|
service = TestBed.inject(DspaceRestService);
|
||||||
httpMock = TestBed.inject(HttpTestingController);
|
httpMock = TestBed.inject(HttpTestingController);
|
||||||
|
@@ -1,9 +1,4 @@
|
|||||||
import {
|
import { HttpEvent, HttpHandler, HttpInterceptor, HttpRequest } from '@angular/common/http';
|
||||||
HttpEvent,
|
|
||||||
HttpHandler,
|
|
||||||
HttpInterceptor,
|
|
||||||
HttpRequest,
|
|
||||||
} from '@angular/common/http';
|
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
import {
|
import {
|
||||||
|
@@ -1,8 +1,5 @@
|
|||||||
import { HTTP_INTERCEPTORS } from '@angular/common/http';
|
import { HTTP_INTERCEPTORS, provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
|
||||||
import {
|
import { HttpTestingController, provideHttpClientTesting } from '@angular/common/http/testing';
|
||||||
HttpClientTestingModule,
|
|
||||||
HttpTestingController,
|
|
||||||
} from '@angular/common/http/testing';
|
|
||||||
import { TestBed } from '@angular/core/testing';
|
import { TestBed } from '@angular/core/testing';
|
||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
import { StoreModule } from '@ngrx/store';
|
import { StoreModule } from '@ngrx/store';
|
||||||
@@ -39,24 +36,23 @@ describe('LogInterceptor', () => {
|
|||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [
|
imports: [StoreModule.forRoot(appReducers, storeModuleConfig)],
|
||||||
HttpClientTestingModule,
|
providers: [
|
||||||
StoreModule.forRoot(appReducers, storeModuleConfig),
|
|
||||||
],
|
|
||||||
providers: [
|
|
||||||
DspaceRestService,
|
DspaceRestService,
|
||||||
// LogInterceptor,
|
// LogInterceptor,
|
||||||
{
|
{
|
||||||
provide: HTTP_INTERCEPTORS,
|
provide: HTTP_INTERCEPTORS,
|
||||||
useClass: LogInterceptor,
|
useClass: LogInterceptor,
|
||||||
multi: true,
|
multi: true,
|
||||||
},
|
},
|
||||||
{ provide: CookieService, useValue: new CookieServiceMock() },
|
{ provide: CookieService, useValue: new CookieServiceMock() },
|
||||||
{ provide: Router, useValue: router },
|
{ provide: Router, useValue: router },
|
||||||
{ provide: CorrelationIdService, useClass: CorrelationIdService },
|
{ provide: CorrelationIdService, useClass: CorrelationIdService },
|
||||||
{ provide: UUIDService, useClass: UUIDService },
|
{ provide: UUIDService, useClass: UUIDService },
|
||||||
],
|
provideHttpClient(withInterceptorsFromDi()),
|
||||||
});
|
provideHttpClientTesting(),
|
||||||
|
]
|
||||||
|
});
|
||||||
|
|
||||||
service = TestBed.inject(DspaceRestService);
|
service = TestBed.inject(DspaceRestService);
|
||||||
httpMock = TestBed.inject(HttpTestingController);
|
httpMock = TestBed.inject(HttpTestingController);
|
||||||
|
@@ -1,9 +1,4 @@
|
|||||||
import {
|
import { HttpEvent, HttpHandler, HttpInterceptor, HttpRequest } from '@angular/common/http';
|
||||||
HttpEvent,
|
|
||||||
HttpHandler,
|
|
||||||
HttpInterceptor,
|
|
||||||
HttpRequest,
|
|
||||||
} from '@angular/common/http';
|
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
|
@@ -1,7 +1,4 @@
|
|||||||
import {
|
import { HttpHeaders, HttpParams } from '@angular/common/http';
|
||||||
HttpHeaders,
|
|
||||||
HttpParams,
|
|
||||||
} from '@angular/common/http';
|
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { ReplaceOperation } from 'fast-json-patch';
|
import { ReplaceOperation } from 'fast-json-patch';
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
|
@@ -1,7 +1,4 @@
|
|||||||
import {
|
import { HttpClient, HttpHeaders } from '@angular/common/http';
|
||||||
HttpClient,
|
|
||||||
HttpHeaders,
|
|
||||||
} from '@angular/common/http';
|
|
||||||
import { ReplaceOperation } from 'fast-json-patch';
|
import { ReplaceOperation } from 'fast-json-patch';
|
||||||
import {
|
import {
|
||||||
cold,
|
cold,
|
||||||
|
@@ -1,7 +1,4 @@
|
|||||||
import {
|
import { HttpClient, HttpHeaders } from '@angular/common/http';
|
||||||
HttpClient,
|
|
||||||
HttpHeaders,
|
|
||||||
} from '@angular/common/http';
|
|
||||||
import { waitForAsync } from '@angular/core/testing';
|
import { waitForAsync } from '@angular/core/testing';
|
||||||
import { Store } from '@ngrx/store';
|
import { Store } from '@ngrx/store';
|
||||||
import {
|
import {
|
||||||
|
@@ -1,7 +1,4 @@
|
|||||||
import {
|
import { HttpClient, HttpHeaders } from '@angular/common/http';
|
||||||
HttpClient,
|
|
||||||
HttpHeaders,
|
|
||||||
} from '@angular/common/http';
|
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { Store } from '@ngrx/store';
|
import { Store } from '@ngrx/store';
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
|
@@ -1,8 +1,5 @@
|
|||||||
import { HttpClient } from '@angular/common/http';
|
import { HttpClient, provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
|
||||||
import {
|
import { HttpTestingController, provideHttpClientTesting } from '@angular/common/http/testing';
|
||||||
HttpClientTestingModule,
|
|
||||||
HttpTestingController,
|
|
||||||
} from '@angular/common/http/testing';
|
|
||||||
import { TestBed } from '@angular/core/testing';
|
import { TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
import { RESTURLCombiner } from '../url-combiner/rest-url-combiner';
|
import { RESTURLCombiner } from '../url-combiner/rest-url-combiner';
|
||||||
@@ -17,9 +14,9 @@ describe(`BrowserXSRFService`, () => {
|
|||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [ HttpClientTestingModule ],
|
imports: [],
|
||||||
providers: [ BrowserXSRFService ],
|
providers: [BrowserXSRFService, provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting()]
|
||||||
});
|
});
|
||||||
httpClient = TestBed.inject(HttpClient);
|
httpClient = TestBed.inject(HttpClient);
|
||||||
httpTestingController = TestBed.inject(HttpTestingController);
|
httpTestingController = TestBed.inject(HttpTestingController);
|
||||||
service = TestBed.inject(BrowserXSRFService);
|
service = TestBed.inject(BrowserXSRFService);
|
||||||
|
@@ -1,12 +1,5 @@
|
|||||||
import {
|
import { HTTP_INTERCEPTORS, HttpHeaders, HttpXsrfTokenExtractor, provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
|
||||||
HTTP_INTERCEPTORS,
|
import { HttpTestingController, provideHttpClientTesting } from '@angular/common/http/testing';
|
||||||
HttpHeaders,
|
|
||||||
HttpXsrfTokenExtractor,
|
|
||||||
} from '@angular/common/http';
|
|
||||||
import {
|
|
||||||
HttpClientTestingModule,
|
|
||||||
HttpTestingController,
|
|
||||||
} from '@angular/common/http/testing';
|
|
||||||
import { TestBed } from '@angular/core/testing';
|
import { TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
import { CookieServiceMock } from '../../shared/mocks/cookie.service.mock';
|
import { CookieServiceMock } from '../../shared/mocks/cookie.service.mock';
|
||||||
@@ -35,18 +28,20 @@ describe(`XsrfInterceptor`, () => {
|
|||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [HttpClientTestingModule],
|
imports: [],
|
||||||
providers: [
|
providers: [
|
||||||
DspaceRestService,
|
DspaceRestService,
|
||||||
{
|
{
|
||||||
provide: HTTP_INTERCEPTORS,
|
provide: HTTP_INTERCEPTORS,
|
||||||
useClass: XsrfInterceptor,
|
useClass: XsrfInterceptor,
|
||||||
multi: true,
|
multi: true,
|
||||||
},
|
},
|
||||||
{ provide: HttpXsrfTokenExtractor, useValue: new HttpXsrfTokenExtractorMock(testToken) },
|
{ provide: HttpXsrfTokenExtractor, useValue: new HttpXsrfTokenExtractorMock(testToken) },
|
||||||
{ provide: CookieService, useValue: new CookieServiceMock() },
|
{ provide: CookieService, useValue: new CookieServiceMock() },
|
||||||
],
|
provideHttpClient(withInterceptorsFromDi()),
|
||||||
});
|
provideHttpClientTesting(),
|
||||||
|
]
|
||||||
|
});
|
||||||
|
|
||||||
service = TestBed.get(DspaceRestService);
|
service = TestBed.get(DspaceRestService);
|
||||||
httpMock = TestBed.get(HttpTestingController);
|
httpMock = TestBed.get(HttpTestingController);
|
||||||
|
@@ -1,12 +1,4 @@
|
|||||||
import {
|
import { HttpErrorResponse, HttpEvent, HttpHandler, HttpInterceptor, HttpRequest, HttpResponse, HttpXsrfTokenExtractor } from '@angular/common/http';
|
||||||
HttpErrorResponse,
|
|
||||||
HttpEvent,
|
|
||||||
HttpHandler,
|
|
||||||
HttpInterceptor,
|
|
||||||
HttpRequest,
|
|
||||||
HttpResponse,
|
|
||||||
HttpXsrfTokenExtractor,
|
|
||||||
} from '@angular/common/http';
|
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import {
|
import {
|
||||||
Observable,
|
Observable,
|
||||||
|
@@ -1,7 +1,4 @@
|
|||||||
import {
|
import { HttpTestingController, provideHttpClientTesting } from '@angular/common/http/testing';
|
||||||
HttpClientTestingModule,
|
|
||||||
HttpTestingController,
|
|
||||||
} from '@angular/common/http/testing';
|
|
||||||
import {
|
import {
|
||||||
DebugElement,
|
DebugElement,
|
||||||
NO_ERRORS_SCHEMA,
|
NO_ERRORS_SCHEMA,
|
||||||
@@ -25,6 +22,7 @@ import {
|
|||||||
import { LangConfig } from '../../../config/lang-config.interface';
|
import { LangConfig } from '../../../config/lang-config.interface';
|
||||||
import { LocaleService } from '../../core/locale/locale.service';
|
import { LocaleService } from '../../core/locale/locale.service';
|
||||||
import { LangSwitchComponent } from './lang-switch.component';
|
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
|
// 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.
|
// The translation module is instantiated with these bogus messages that we aren't using anyway.
|
||||||
@@ -83,15 +81,17 @@ describe('LangSwitchComponent', () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [HttpClientTestingModule, TranslateModule.forRoot({
|
schemas: [NO_ERRORS_SCHEMA],
|
||||||
loader: { provide: TranslateLoader, useClass: CustomLoader },
|
imports: [TranslateModule.forRoot({
|
||||||
|
loader: { provide: TranslateLoader, useClass: CustomLoader },
|
||||||
}), LangSwitchComponent],
|
}), LangSwitchComponent],
|
||||||
schemas: [NO_ERRORS_SCHEMA],
|
providers: [
|
||||||
providers: [
|
TranslateService,
|
||||||
TranslateService,
|
{ provide: LocaleService, useValue: getMockLocaleService() },
|
||||||
{ provide: LocaleService, useValue: getMockLocaleService() },
|
provideHttpClient(withInterceptorsFromDi()),
|
||||||
],
|
provideHttpClientTesting(),
|
||||||
}).compileComponents()
|
]
|
||||||
|
}).compileComponents()
|
||||||
.then(() => {
|
.then(() => {
|
||||||
translate = TestBed.inject(TranslateService);
|
translate = TestBed.inject(TranslateService);
|
||||||
translate.addLangs(mockConfig.languages.filter((langConfig: LangConfig) => langConfig.active === true).map((a) => a.code));
|
translate.addLangs(mockConfig.languages.filter((langConfig: LangConfig) => langConfig.active === true).map((a) => a.code));
|
||||||
@@ -166,15 +166,17 @@ describe('LangSwitchComponent', () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [HttpClientTestingModule, TranslateModule.forRoot({
|
schemas: [NO_ERRORS_SCHEMA],
|
||||||
loader: { provide: TranslateLoader, useClass: CustomLoader },
|
imports: [TranslateModule.forRoot({
|
||||||
|
loader: { provide: TranslateLoader, useClass: CustomLoader },
|
||||||
}), LangSwitchComponent],
|
}), LangSwitchComponent],
|
||||||
schemas: [NO_ERRORS_SCHEMA],
|
providers: [
|
||||||
providers: [
|
TranslateService,
|
||||||
TranslateService,
|
{ provide: LocaleService, useValue: getMockLocaleService() },
|
||||||
{ provide: LocaleService, useValue: getMockLocaleService() },
|
provideHttpClient(withInterceptorsFromDi()),
|
||||||
],
|
provideHttpClientTesting(),
|
||||||
}).compileComponents();
|
]
|
||||||
|
}).compileComponents();
|
||||||
translate = TestBed.inject(TranslateService);
|
translate = TestBed.inject(TranslateService);
|
||||||
translate.addLangs(mockConfig.languages.filter((MyLangConfig) => MyLangConfig.active === true).map((a) => a.code));
|
translate.addLangs(mockConfig.languages.filter((MyLangConfig) => MyLangConfig.active === true).map((a) => a.code));
|
||||||
translate.setDefaultLang('en');
|
translate.setDefaultLang('en');
|
||||||
|
@@ -1,7 +1,4 @@
|
|||||||
import {
|
import { HttpHeaders, HttpResponse } from '@angular/common/http';
|
||||||
HttpHeaders,
|
|
||||||
HttpResponse,
|
|
||||||
} from '@angular/common/http';
|
|
||||||
import { of as observableOf } from 'rxjs';
|
import { of as observableOf } from 'rxjs';
|
||||||
|
|
||||||
import { RestRequestMethod } from '../../../core/data/rest-request-method';
|
import { RestRequestMethod } from '../../../core/data/rest-request-method';
|
||||||
|
@@ -1,7 +1,4 @@
|
|||||||
import {
|
import { HttpClient, HttpHeaders } from '@angular/common/http';
|
||||||
HttpClient,
|
|
||||||
HttpHeaders,
|
|
||||||
} from '@angular/common/http';
|
|
||||||
import {
|
import {
|
||||||
Inject,
|
Inject,
|
||||||
Injectable,
|
Injectable,
|
||||||
|
@@ -1,8 +1,4 @@
|
|||||||
import {
|
import { HttpClient, provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
|
||||||
HttpClient,
|
|
||||||
provideHttpClient,
|
|
||||||
withInterceptorsFromDi,
|
|
||||||
} from '@angular/common/http';
|
|
||||||
import {
|
import {
|
||||||
APP_ID,
|
APP_ID,
|
||||||
APP_INITIALIZER,
|
APP_INITIALIZER,
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
import { DragDropModule } from '@angular/cdk/drag-drop';
|
import { DragDropModule } from '@angular/cdk/drag-drop';
|
||||||
import { CommonModule } from '@angular/common';
|
import { CommonModule } from '@angular/common';
|
||||||
import { HttpClientModule } from '@angular/common/http';
|
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
|
||||||
import { NgModule } from '@angular/core';
|
import { NgModule } from '@angular/core';
|
||||||
import { FormsModule } from '@angular/forms';
|
import { FormsModule } from '@angular/forms';
|
||||||
import { RouterModule } from '@angular/router';
|
import { RouterModule } from '@angular/router';
|
||||||
@@ -203,24 +203,19 @@ const DECLARATIONS = [
|
|||||||
SearchResultsSkeletonComponent,
|
SearchResultsSkeletonComponent,
|
||||||
];
|
];
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({ imports: [RootModule,
|
||||||
imports: [
|
CommonModule,
|
||||||
RootModule,
|
DragDropModule,
|
||||||
CommonModule,
|
FormsModule,
|
||||||
DragDropModule,
|
NgbModule,
|
||||||
FormsModule,
|
RouterModule,
|
||||||
HttpClientModule,
|
ScrollToModule,
|
||||||
NgbModule,
|
StoreModule,
|
||||||
RouterModule,
|
StoreRouterConnectingModule,
|
||||||
ScrollToModule,
|
TranslateModule,
|
||||||
StoreModule,
|
FormsModule,
|
||||||
StoreRouterConnectingModule,
|
NgxGalleryModule,
|
||||||
TranslateModule,
|
...DECLARATIONS], providers: [provideHttpClient(withInterceptorsFromDi())] })
|
||||||
FormsModule,
|
|
||||||
NgxGalleryModule,
|
|
||||||
...DECLARATIONS,
|
|
||||||
],
|
|
||||||
})
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This module serves as an index for all the components in this theme.
|
* This module serves as an index for all the components in this theme.
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
import { DragDropModule } from '@angular/cdk/drag-drop';
|
import { DragDropModule } from '@angular/cdk/drag-drop';
|
||||||
import { CommonModule } from '@angular/common';
|
import { CommonModule } from '@angular/common';
|
||||||
import { HttpClientModule } from '@angular/common/http';
|
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
|
||||||
import { NgModule } from '@angular/core';
|
import { NgModule } from '@angular/core';
|
||||||
import { FormsModule } from '@angular/forms';
|
import { FormsModule } from '@angular/forms';
|
||||||
import { RouterModule } from '@angular/router';
|
import { RouterModule } from '@angular/router';
|
||||||
@@ -15,23 +15,17 @@ import { RootModule } from '../../app/root.module';
|
|||||||
const DECLARATIONS = [
|
const DECLARATIONS = [
|
||||||
];
|
];
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({ declarations: DECLARATIONS, imports: [RootModule,
|
||||||
imports: [
|
CommonModule,
|
||||||
RootModule,
|
DragDropModule,
|
||||||
CommonModule,
|
FormsModule,
|
||||||
DragDropModule,
|
NgbModule,
|
||||||
FormsModule,
|
RouterModule,
|
||||||
HttpClientModule,
|
ScrollToModule,
|
||||||
NgbModule,
|
StoreModule,
|
||||||
RouterModule,
|
StoreRouterConnectingModule,
|
||||||
ScrollToModule,
|
TranslateModule,
|
||||||
StoreModule,
|
FormsModule], providers: [provideHttpClient(withInterceptorsFromDi())] })
|
||||||
StoreRouterConnectingModule,
|
|
||||||
TranslateModule,
|
|
||||||
FormsModule,
|
|
||||||
],
|
|
||||||
declarations: DECLARATIONS,
|
|
||||||
})
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This module serves as an index for all the components in this theme.
|
* This module serves as an index for all the components in this theme.
|
||||||
|
@@ -8,8 +8,8 @@
|
|||||||
"baseUrl": "./",
|
"baseUrl": "./",
|
||||||
"outDir": "./dist/out-tsc",
|
"outDir": "./dist/out-tsc",
|
||||||
"declaration": false,
|
"declaration": false,
|
||||||
"downlevelIteration": true,
|
|
||||||
"emitDecoratorMetadata": true,
|
"emitDecoratorMetadata": true,
|
||||||
|
"esModuleInterop": true,
|
||||||
"experimentalDecorators": true,
|
"experimentalDecorators": true,
|
||||||
"sourceMap": true,
|
"sourceMap": true,
|
||||||
"module": "es2020",
|
"module": "es2020",
|
||||||
@@ -20,7 +20,6 @@
|
|||||||
"strictNullChecks": false,
|
"strictNullChecks": false,
|
||||||
"skipDefaultLibCheck": true,
|
"skipDefaultLibCheck": true,
|
||||||
"pretty": true,
|
"pretty": true,
|
||||||
"allowSyntheticDefaultImports": true,
|
|
||||||
"target": "ES2022",
|
"target": "ES2022",
|
||||||
"typeRoots": [
|
"typeRoots": [
|
||||||
"node_modules/@types",
|
"node_modules/@types",
|
||||||
|
Reference in New Issue
Block a user