mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 18:14:17 +00:00
Merge pull request #3717 from atmire/w2p-120243_Upgrade-to-Angular-v18
Upgrade to angular v18
This commit is contained in:
@@ -12,6 +12,13 @@ describe('Community List Page', () => {
|
|||||||
cy.get('[data-test="expand-button"]').click({ multiple: true });
|
cy.get('[data-test="expand-button"]').click({ multiple: true });
|
||||||
|
|
||||||
// Analyze <ds-community-list-page> for accessibility issues
|
// Analyze <ds-community-list-page> for accessibility issues
|
||||||
testA11y('ds-community-list-page');
|
testA11y('ds-community-list-page', {
|
||||||
|
rules: {
|
||||||
|
// When expanding a cdk node on the community-list page, the 'aria-posinset' property becomes 0.
|
||||||
|
// 0 is not a valid value for 'aria-posinset' so the test fails.
|
||||||
|
// see https://github.com/DSpace/dspace-angular/issues/4068
|
||||||
|
'aria-valid-attr-value': { enabled: false },
|
||||||
|
},
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
11538
package-lock.json
generated
11538
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
108
package.json
108
package.json
@@ -57,68 +57,62 @@
|
|||||||
"private": true,
|
"private": true,
|
||||||
"overrides": {
|
"overrides": {
|
||||||
"@kolkov/ngx-gallery": {
|
"@kolkov/ngx-gallery": {
|
||||||
"@angular/animations": "^17.3.11",
|
"@angular/animations": "^18.2.12",
|
||||||
"@angular/common": "^17.3.11",
|
"@angular/common": "^18.2.12",
|
||||||
"@angular/core": "^17.3.11"
|
"@angular/core": "^18.2.12"
|
||||||
},
|
},
|
||||||
"@ng-bootstrap/ng-bootstrap": {
|
"@ng-bootstrap/ng-bootstrap": {
|
||||||
"@angular/common": "^17.3.11",
|
"@angular/common": "^18.2.12",
|
||||||
"@angular/core": "^17.3.11",
|
"@angular/core": "^18.2.12",
|
||||||
"@angular/forms": "^17.3.11",
|
"@angular/forms": "^18.2.12",
|
||||||
"@angular/localize": "^17.3.11"
|
"@angular/localize": "^18.2.12"
|
||||||
},
|
},
|
||||||
"@ng-dynamic-forms/core": {
|
"@ng-dynamic-forms/core": {
|
||||||
"@angular/common": "^17.3.11",
|
"@angular/common": "^18.2.12",
|
||||||
"@angular/core": "^17.3.11",
|
"@angular/core": "^18.2.12",
|
||||||
"@angular/forms": "^17.3.11"
|
"@angular/forms": "^18.2.12"
|
||||||
},
|
},
|
||||||
"@ng-dynamic-forms/ui-ng-bootstrap": {
|
"@ng-dynamic-forms/ui-ng-bootstrap": {
|
||||||
"ngx-mask": "14.2.4",
|
"ngx-mask": "14.2.4",
|
||||||
"@ng-bootstrap/ng-bootstrap": "^12.0.0",
|
"@ng-bootstrap/ng-bootstrap": "^12.0.0",
|
||||||
"bootstrap": "^5.3"
|
"bootstrap": "^5.3"
|
||||||
},
|
},
|
||||||
"@ngtools/webpack": {
|
|
||||||
"@angular/compiler-cli": "^17.3.11",
|
|
||||||
"typescript": "~5.4.5"
|
|
||||||
},
|
|
||||||
"@nicky-lenaers/ngx-scroll-to": {
|
"@nicky-lenaers/ngx-scroll-to": {
|
||||||
"@angular/common": "^17.3.11",
|
"@angular/common": "^18.2.12",
|
||||||
"@angular/core": "^17.3.11"
|
"@angular/core": "^18.2.12"
|
||||||
},
|
},
|
||||||
"eslint-plugin-unused-imports": {
|
"eslint-plugin-unused-imports": {
|
||||||
"@typescript-eslint/eslint-plugin": "^7.2.0"
|
"@typescript-eslint/eslint-plugin": "^7.2.0"
|
||||||
},
|
},
|
||||||
"ng2-file-upload": {
|
|
||||||
"@angular/common": "^17.3.11",
|
|
||||||
"@angular/core": "^17.3.11"
|
|
||||||
},
|
|
||||||
"ngx-infinite-scroll": {
|
"ngx-infinite-scroll": {
|
||||||
"@angular/common": "^17.3.11",
|
"@angular/common": "^18.2.12",
|
||||||
"@angular/core": "^17.3.11"
|
"@angular/core": "^18.2.12"
|
||||||
}
|
},
|
||||||
|
"notistack": "3.0.1"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@angular/animations": "^17.3.12",
|
"@angular/animations": "^18.2.12",
|
||||||
"@angular/cdk": "^17.3.10",
|
"@angular/cdk": "^18.2.12",
|
||||||
"@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",
|
||||||
"@ng-dynamic-forms/ui-ng-bootstrap": "^16.0.0",
|
"@ng-dynamic-forms/ui-ng-bootstrap": "^16.0.0",
|
||||||
"@ngrx/effects": "^17.1.1",
|
"@ngrx/effects": "^18.1.1",
|
||||||
"@ngrx/router-store": "^17.1.1",
|
"@ngrx/operators": "^18.0.0",
|
||||||
"@ngrx/store": "^17.1.1",
|
"@ngrx/router-store": "^18.1.1",
|
||||||
"@ngx-translate/core": "^14.0.0",
|
"@ngrx/store": "^18.1.1",
|
||||||
|
"@ngx-translate/core": "^16.0.3",
|
||||||
"@nicky-lenaers/ngx-scroll-to": "^14.0.0",
|
"@nicky-lenaers/ngx-scroll-to": "^14.0.0",
|
||||||
"angulartics2": "^12.2.0",
|
"angulartics2": "^12.2.0",
|
||||||
"axios": "^1.7.9",
|
"axios": "^1.7.9",
|
||||||
@@ -152,12 +146,12 @@
|
|||||||
"mirador-dl-plugin": "^0.13.0",
|
"mirador-dl-plugin": "^0.13.0",
|
||||||
"mirador-share-plugin": "^0.16.0",
|
"mirador-share-plugin": "^0.16.0",
|
||||||
"morgan": "^1.10.0",
|
"morgan": "^1.10.0",
|
||||||
"ng2-file-upload": "5.0.0",
|
"ng2-file-upload": "7.0.1",
|
||||||
"ng2-nouislider": "^2.0.0",
|
"ng2-nouislider": "^2.0.0",
|
||||||
"ngx-infinite-scroll": "^16.0.0",
|
"ngx-infinite-scroll": "^18.0.0",
|
||||||
"ngx-pagination": "6.0.3",
|
"ngx-pagination": "6.0.3",
|
||||||
"ngx-skeleton-loader": "^9.0.0",
|
"ngx-skeleton-loader": "^9.0.0",
|
||||||
"ngx-ui-switch": "^14.1.0",
|
"ngx-ui-switch": "^15.0.0",
|
||||||
"nouislider": "^15.7.1",
|
"nouislider": "^15.7.1",
|
||||||
"orejime": "^2.3.1",
|
"orejime": "^2.3.1",
|
||||||
"pem": "1.14.8",
|
"pem": "1.14.8",
|
||||||
@@ -167,22 +161,22 @@
|
|||||||
"zone.js": "~0.14.10"
|
"zone.js": "~0.14.10"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@angular-builders/custom-webpack": "~17.0.2",
|
"@angular-builders/custom-webpack": "~18.0.0",
|
||||||
"@angular-devkit/build-angular": "^17.3.11",
|
"@angular-devkit/build-angular": "^18.2.12",
|
||||||
"@angular-eslint/builder": "^17.5.3",
|
"@angular-eslint/builder": "^18.4.1",
|
||||||
"@angular-eslint/bundled-angular-compiler": "^17.5.3",
|
"@angular-eslint/bundled-angular-compiler": "^18.4.1",
|
||||||
"@angular-eslint/eslint-plugin": "^17.5.3",
|
"@angular-eslint/eslint-plugin": "^18.4.1",
|
||||||
"@angular-eslint/eslint-plugin-template": "^17.5.3",
|
"@angular-eslint/eslint-plugin-template": "^18.4.1",
|
||||||
"@angular-eslint/schematics": "^17.5.3",
|
"@angular-eslint/schematics": "^18.4.1",
|
||||||
"@angular-eslint/template-parser": "^17.5.3",
|
"@angular-eslint/template-parser": "^18.4.1",
|
||||||
"@angular-eslint/utils": "^17.5.3",
|
"@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": "^18.1.1",
|
||||||
"@ngtools/webpack": "^16.2.16",
|
"@ngtools/webpack": "^18.2.12",
|
||||||
"@types/deep-freeze": "0.1.5",
|
"@types/deep-freeze": "0.1.5",
|
||||||
"@types/ejs": "^3.1.2",
|
"@types/ejs": "^3.1.2",
|
||||||
"@types/express": "^4.17.17",
|
"@types/express": "^4.17.17",
|
||||||
|
@@ -20,10 +20,10 @@ import 'reflect-metadata';
|
|||||||
|
|
||||||
/* eslint-disable import/no-namespace */
|
/* eslint-disable import/no-namespace */
|
||||||
import * as morgan from 'morgan';
|
import * as morgan from 'morgan';
|
||||||
import * as express from 'express';
|
import express from 'express';
|
||||||
import * as ejs from 'ejs';
|
import * as ejs from 'ejs';
|
||||||
import * as compression from 'compression';
|
import * as compression from 'compression';
|
||||||
import * as expressStaticGzip from 'express-static-gzip';
|
import expressStaticGzip from 'express-static-gzip';
|
||||||
/* eslint-enable import/no-namespace */
|
/* eslint-enable import/no-namespace */
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import LRU from 'lru-cache';
|
import LRU from 'lru-cache';
|
||||||
|
@@ -1,4 +1,8 @@
|
|||||||
import { HttpClientTestingModule } from '@angular/common/http/testing';
|
import {
|
||||||
|
provideHttpClient,
|
||||||
|
withInterceptorsFromDi,
|
||||||
|
} from '@angular/common/http';
|
||||||
|
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,
|
||||||
@@ -39,22 +43,21 @@ 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()),
|
||||||
|
provideHttpClientTesting(),
|
||||||
],
|
],
|
||||||
schemas: [NO_ERRORS_SCHEMA],
|
|
||||||
});
|
});
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
@@ -1,7 +1,11 @@
|
|||||||
import { HTTP_INTERCEPTORS } from '@angular/common/http';
|
|
||||||
import {
|
import {
|
||||||
HttpClientTestingModule,
|
HTTP_INTERCEPTORS,
|
||||||
|
provideHttpClient,
|
||||||
|
withInterceptorsFromDi,
|
||||||
|
} from '@angular/common/http';
|
||||||
|
import {
|
||||||
HttpTestingController,
|
HttpTestingController,
|
||||||
|
provideHttpClientTesting,
|
||||||
} from '@angular/common/http/testing';
|
} 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';
|
||||||
@@ -28,7 +32,7 @@ describe(`AuthInterceptor`, () => {
|
|||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [HttpClientTestingModule],
|
imports: [],
|
||||||
providers: [
|
providers: [
|
||||||
DspaceRestService,
|
DspaceRestService,
|
||||||
{ provide: AuthService, useValue: authServiceStub },
|
{ provide: AuthService, useValue: authServiceStub },
|
||||||
@@ -39,6 +43,8 @@ describe(`AuthInterceptor`, () => {
|
|||||||
multi: true,
|
multi: true,
|
||||||
},
|
},
|
||||||
{ provide: Store, useValue: store },
|
{ provide: Store, useValue: store },
|
||||||
|
provideHttpClient(withInterceptorsFromDi()),
|
||||||
|
provideHttpClientTesting(),
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
// eslint-disable-next-line import/no-namespace
|
// eslint-disable-next-line import/no-namespace
|
||||||
import * as deepFreeze from 'deep-freeze';
|
import deepFreeze from 'deep-freeze';
|
||||||
import { Operation } from 'fast-json-patch';
|
import { Operation } from 'fast-json-patch';
|
||||||
|
|
||||||
import { Item } from '../shared/item.model';
|
import { Item } from '../shared/item.model';
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
// eslint-disable-next-line import/no-namespace
|
// eslint-disable-next-line import/no-namespace
|
||||||
import * as deepFreeze from 'deep-freeze';
|
import deepFreeze from 'deep-freeze';
|
||||||
|
|
||||||
import { RestRequestMethod } from '../data/rest-request-method';
|
import { RestRequestMethod } from '../data/rest-request-method';
|
||||||
import { RemoveFromObjectCacheAction } from './object-cache.actions';
|
import { RemoveFromObjectCacheAction } from './object-cache.actions';
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
// eslint-disable-next-line import/no-namespace
|
// eslint-disable-next-line import/no-namespace
|
||||||
import * as deepFreeze from 'deep-freeze';
|
import deepFreeze from 'deep-freeze';
|
||||||
|
|
||||||
import { Relationship } from '../../shared/item-relationships/relationship.model';
|
import { Relationship } from '../../shared/item-relationships/relationship.model';
|
||||||
import { FieldChangeType } from './field-change-type.model';
|
import { FieldChangeType } from './field-change-type.model';
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
// eslint-disable-next-line import/no-namespace
|
// eslint-disable-next-line import/no-namespace
|
||||||
import * as deepFreeze from 'deep-freeze';
|
import deepFreeze from 'deep-freeze';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
RequestConfigureAction,
|
RequestConfigureAction,
|
||||||
|
@@ -1,10 +1,12 @@
|
|||||||
import {
|
import {
|
||||||
HttpErrorResponse,
|
HttpErrorResponse,
|
||||||
HttpHeaders,
|
HttpHeaders,
|
||||||
|
provideHttpClient,
|
||||||
|
withInterceptorsFromDi,
|
||||||
} from '@angular/common/http';
|
} from '@angular/common/http';
|
||||||
import {
|
import {
|
||||||
HttpClientTestingModule,
|
|
||||||
HttpTestingController,
|
HttpTestingController,
|
||||||
|
provideHttpClientTesting,
|
||||||
} from '@angular/common/http/testing';
|
} from '@angular/common/http/testing';
|
||||||
import {
|
import {
|
||||||
inject,
|
inject,
|
||||||
@@ -33,8 +35,12 @@ 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);
|
||||||
|
@@ -1,7 +1,11 @@
|
|||||||
import { HTTP_INTERCEPTORS } from '@angular/common/http';
|
|
||||||
import {
|
import {
|
||||||
HttpClientTestingModule,
|
HTTP_INTERCEPTORS,
|
||||||
|
provideHttpClient,
|
||||||
|
withInterceptorsFromDi,
|
||||||
|
} from '@angular/common/http';
|
||||||
|
import {
|
||||||
HttpTestingController,
|
HttpTestingController,
|
||||||
|
provideHttpClientTesting,
|
||||||
} from '@angular/common/http/testing';
|
} from '@angular/common/http/testing';
|
||||||
import { TestBed } from '@angular/core/testing';
|
import { TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
@@ -21,7 +25,7 @@ describe('ForwardClientIpInterceptor', () => {
|
|||||||
clientIp = '1.2.3.4';
|
clientIp = '1.2.3.4';
|
||||||
|
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [HttpClientTestingModule],
|
imports: [],
|
||||||
providers: [
|
providers: [
|
||||||
DspaceRestService,
|
DspaceRestService,
|
||||||
{
|
{
|
||||||
@@ -30,6 +34,8 @@ describe('ForwardClientIpInterceptor', () => {
|
|||||||
multi: true,
|
multi: true,
|
||||||
},
|
},
|
||||||
{ provide: REQUEST, useValue: { get: () => undefined, connection: { remoteAddress: clientIp } } },
|
{ provide: REQUEST, useValue: { get: () => undefined, connection: { remoteAddress: clientIp } } },
|
||||||
|
provideHttpClient(withInterceptorsFromDi()),
|
||||||
|
provideHttpClientTesting(),
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
// eslint-disable-next-line import/no-namespace
|
// eslint-disable-next-line import/no-namespace
|
||||||
import * as deepFreeze from 'deep-freeze';
|
import deepFreeze from 'deep-freeze';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
AddToIndexAction,
|
AddToIndexAction,
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
// eslint-disable-next-line import/no-namespace
|
// eslint-disable-next-line import/no-namespace
|
||||||
import * as deepFreeze from 'deep-freeze';
|
import deepFreeze from 'deep-freeze';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
CommitPatchOperationsAction,
|
CommitPatchOperationsAction,
|
||||||
|
@@ -1,7 +1,11 @@
|
|||||||
import { HTTP_INTERCEPTORS } from '@angular/common/http';
|
|
||||||
import {
|
import {
|
||||||
HttpClientTestingModule,
|
HTTP_INTERCEPTORS,
|
||||||
|
provideHttpClient,
|
||||||
|
withInterceptorsFromDi,
|
||||||
|
} from '@angular/common/http';
|
||||||
|
import {
|
||||||
HttpTestingController,
|
HttpTestingController,
|
||||||
|
provideHttpClientTesting,
|
||||||
} from '@angular/common/http/testing';
|
} 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,7 +29,7 @@ describe(`LocaleInterceptor`, () => {
|
|||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [HttpClientTestingModule],
|
imports: [],
|
||||||
providers: [
|
providers: [
|
||||||
DspaceRestService,
|
DspaceRestService,
|
||||||
{
|
{
|
||||||
@@ -34,6 +38,8 @@ describe(`LocaleInterceptor`, () => {
|
|||||||
multi: true,
|
multi: true,
|
||||||
},
|
},
|
||||||
{ provide: LocaleService, useValue: mockLocaleService },
|
{ provide: LocaleService, useValue: mockLocaleService },
|
||||||
|
provideHttpClient(withInterceptorsFromDi()),
|
||||||
|
provideHttpClientTesting(),
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@@ -1,7 +1,11 @@
|
|||||||
import { HTTP_INTERCEPTORS } from '@angular/common/http';
|
|
||||||
import {
|
import {
|
||||||
HttpClientTestingModule,
|
HTTP_INTERCEPTORS,
|
||||||
|
provideHttpClient,
|
||||||
|
withInterceptorsFromDi,
|
||||||
|
} from '@angular/common/http';
|
||||||
|
import {
|
||||||
HttpTestingController,
|
HttpTestingController,
|
||||||
|
provideHttpClientTesting,
|
||||||
} from '@angular/common/http/testing';
|
} 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';
|
||||||
@@ -39,10 +43,7 @@ describe('LogInterceptor', () => {
|
|||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [
|
imports: [StoreModule.forRoot(appReducers, storeModuleConfig)],
|
||||||
HttpClientTestingModule,
|
|
||||||
StoreModule.forRoot(appReducers, storeModuleConfig),
|
|
||||||
],
|
|
||||||
providers: [
|
providers: [
|
||||||
DspaceRestService,
|
DspaceRestService,
|
||||||
// LogInterceptor,
|
// LogInterceptor,
|
||||||
@@ -55,6 +56,8 @@ describe('LogInterceptor', () => {
|
|||||||
{ 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(),
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@@ -1,7 +1,11 @@
|
|||||||
import { HttpClient } from '@angular/common/http';
|
|
||||||
import {
|
import {
|
||||||
HttpClientTestingModule,
|
HttpClient,
|
||||||
|
provideHttpClient,
|
||||||
|
withInterceptorsFromDi,
|
||||||
|
} from '@angular/common/http';
|
||||||
|
import {
|
||||||
HttpTestingController,
|
HttpTestingController,
|
||||||
|
provideHttpClientTesting,
|
||||||
} from '@angular/common/http/testing';
|
} from '@angular/common/http/testing';
|
||||||
import { TestBed } from '@angular/core/testing';
|
import { TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
@@ -17,8 +21,12 @@ 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);
|
||||||
|
@@ -2,10 +2,12 @@ import {
|
|||||||
HTTP_INTERCEPTORS,
|
HTTP_INTERCEPTORS,
|
||||||
HttpHeaders,
|
HttpHeaders,
|
||||||
HttpXsrfTokenExtractor,
|
HttpXsrfTokenExtractor,
|
||||||
|
provideHttpClient,
|
||||||
|
withInterceptorsFromDi,
|
||||||
} from '@angular/common/http';
|
} from '@angular/common/http';
|
||||||
import {
|
import {
|
||||||
HttpClientTestingModule,
|
|
||||||
HttpTestingController,
|
HttpTestingController,
|
||||||
|
provideHttpClientTesting,
|
||||||
} from '@angular/common/http/testing';
|
} from '@angular/common/http/testing';
|
||||||
import { TestBed } from '@angular/core/testing';
|
import { TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
@@ -20,7 +22,7 @@ import { XsrfInterceptor } from './xsrf.interceptor';
|
|||||||
describe(`XsrfInterceptor`, () => {
|
describe(`XsrfInterceptor`, () => {
|
||||||
let service: DspaceRestService;
|
let service: DspaceRestService;
|
||||||
let httpMock: HttpTestingController;
|
let httpMock: HttpTestingController;
|
||||||
let cookieService: CookieService;
|
let cookieService: CookieServiceMock;
|
||||||
|
|
||||||
// mock XSRF token
|
// mock XSRF token
|
||||||
const testToken = 'test-token';
|
const testToken = 'test-token';
|
||||||
@@ -33,45 +35,52 @@ describe(`XsrfInterceptor`, () => {
|
|||||||
const mockStatusCode = 200;
|
const mockStatusCode = 200;
|
||||||
const mockStatusText = 'SUCCESS';
|
const mockStatusText = 'SUCCESS';
|
||||||
|
|
||||||
|
const testUrl = 'https://rest.com/server/api/core/items';
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
const tokenExtractor = new HttpXsrfTokenExtractorMock(testToken);
|
||||||
|
cookieService = new CookieServiceMock();
|
||||||
|
const interceptor = new XsrfInterceptor(tokenExtractor,cookieService as any);
|
||||||
|
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [HttpClientTestingModule],
|
imports: [],
|
||||||
providers: [
|
providers: [
|
||||||
DspaceRestService,
|
DspaceRestService,
|
||||||
{
|
{
|
||||||
provide: HTTP_INTERCEPTORS,
|
provide: HTTP_INTERCEPTORS,
|
||||||
useClass: XsrfInterceptor,
|
useValue: interceptor,
|
||||||
multi: true,
|
multi: true,
|
||||||
},
|
},
|
||||||
{ provide: HttpXsrfTokenExtractor, useValue: new HttpXsrfTokenExtractorMock(testToken) },
|
{ provide: HttpXsrfTokenExtractor, useValue: tokenExtractor },
|
||||||
{ provide: CookieService, useValue: new CookieServiceMock() },
|
{ provide: CookieService, useValue: cookieService },
|
||||||
|
provideHttpClient(withInterceptorsFromDi()),
|
||||||
|
provideHttpClientTesting(),
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
|
||||||
service = TestBed.get(DspaceRestService);
|
service = TestBed.get(DspaceRestService);
|
||||||
httpMock = TestBed.get(HttpTestingController);
|
httpMock = TestBed.get(HttpTestingController);
|
||||||
cookieService = TestBed.get(CookieService);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should change withCredentials to true at all times', (done) => {
|
it('should change withCredentials to true at all times', (done) => {
|
||||||
service.request(RestRequestMethod.POST, 'server/api/core/items', 'test', { withCredentials: false }).subscribe((response) => {
|
service.request(RestRequestMethod.POST, testUrl, 'test', { withCredentials: false }).subscribe((response) => {
|
||||||
expect(response).toBeTruthy();
|
expect(response).toBeTruthy();
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
|
|
||||||
const httpRequest = httpMock.expectOne('server/api/core/items');
|
const httpRequest = httpMock.expectOne(testUrl);
|
||||||
expect(httpRequest.request.withCredentials).toBeTrue();
|
expect(httpRequest.request.withCredentials).toBeTrue();
|
||||||
|
|
||||||
httpRequest.flush(mockPayload, { status: mockStatusCode, statusText: mockStatusText });
|
httpRequest.flush(mockPayload, { status: mockStatusCode, statusText: mockStatusText });
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should add an X-XSRF-TOKEN header when we are sending an HTTP POST request', (done) => {
|
it('should add an X-XSRF-TOKEN header when we are sending an HTTP POST request', (done) => {
|
||||||
service.request(RestRequestMethod.POST, 'server/api/core/items', 'test').subscribe((response) => {
|
service.request(RestRequestMethod.POST, testUrl, 'test').subscribe((response) => {
|
||||||
expect(response).toBeTruthy();
|
expect(response).toBeTruthy();
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
|
|
||||||
const httpRequest = httpMock.expectOne('server/api/core/items');
|
const httpRequest = httpMock.expectOne(testUrl);
|
||||||
|
|
||||||
expect(httpRequest.request.headers.has('X-XSRF-TOKEN')).toBeTrue();
|
expect(httpRequest.request.headers.has('X-XSRF-TOKEN')).toBeTrue();
|
||||||
expect(httpRequest.request.withCredentials).toBeTrue();
|
expect(httpRequest.request.withCredentials).toBeTrue();
|
||||||
@@ -83,12 +92,12 @@ describe(`XsrfInterceptor`, () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should NOT add an X-XSRF-TOKEN header when we are sending an HTTP GET request', (done) => {
|
it('should NOT add an X-XSRF-TOKEN header when we are sending an HTTP GET request', (done) => {
|
||||||
service.request(RestRequestMethod.GET, 'server/api/core/items').subscribe((response) => {
|
service.request(RestRequestMethod.GET, testUrl).subscribe((response) => {
|
||||||
expect(response).toBeTruthy();
|
expect(response).toBeTruthy();
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
|
|
||||||
const httpRequest = httpMock.expectOne('server/api/core/items');
|
const httpRequest = httpMock.expectOne(testUrl);
|
||||||
|
|
||||||
expect(httpRequest.request.headers.has('X-XSRF-TOKEN')).toBeFalse();
|
expect(httpRequest.request.headers.has('X-XSRF-TOKEN')).toBeFalse();
|
||||||
expect(httpRequest.request.withCredentials).toBeTrue();
|
expect(httpRequest.request.withCredentials).toBeTrue();
|
||||||
@@ -115,7 +124,7 @@ describe(`XsrfInterceptor`, () => {
|
|||||||
// Create a mock XSRF token to be returned in response within DSPACE-XSRF-TOKEN header
|
// Create a mock XSRF token to be returned in response within DSPACE-XSRF-TOKEN header
|
||||||
const mockNewXSRFToken = '123456789abcdefg';
|
const mockNewXSRFToken = '123456789abcdefg';
|
||||||
|
|
||||||
service.request(RestRequestMethod.GET, 'server/api/core/items').subscribe((response) => {
|
service.request(RestRequestMethod.GET, testUrl).subscribe((response) => {
|
||||||
expect(response).toBeTruthy();
|
expect(response).toBeTruthy();
|
||||||
|
|
||||||
// ensure mock data (added in below flush() call) is returned.
|
// ensure mock data (added in below flush() call) is returned.
|
||||||
@@ -135,7 +144,7 @@ describe(`XsrfInterceptor`, () => {
|
|||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
|
|
||||||
const httpRequest = httpMock.expectOne('server/api/core/items');
|
const httpRequest = httpMock.expectOne(testUrl);
|
||||||
|
|
||||||
// Flush & create mock response (including sending back a new XSRF token in header)
|
// Flush & create mock response (including sending back a new XSRF token in header)
|
||||||
httpRequest.flush(mockPayload, {
|
httpRequest.flush(mockPayload, {
|
||||||
@@ -153,7 +162,7 @@ describe(`XsrfInterceptor`, () => {
|
|||||||
const mockErrorText = 'Forbidden';
|
const mockErrorText = 'Forbidden';
|
||||||
const mockErrorMessage = 'CSRF token mismatch';
|
const mockErrorMessage = 'CSRF token mismatch';
|
||||||
|
|
||||||
service.request(RestRequestMethod.GET, 'server/api/core/items').subscribe({
|
service.request(RestRequestMethod.GET, testUrl).subscribe({
|
||||||
error: (error: unknown) => {
|
error: (error: unknown) => {
|
||||||
expect(error).toBeTruthy();
|
expect(error).toBeTruthy();
|
||||||
expect(error instanceof RequestError).toBeTrue();
|
expect(error instanceof RequestError).toBeTrue();
|
||||||
@@ -170,7 +179,7 @@ describe(`XsrfInterceptor`, () => {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const httpRequest = httpMock.expectOne('server/api/core/items');
|
const httpRequest = httpMock.expectOne(testUrl);
|
||||||
|
|
||||||
// Flush & create mock error response (including sending back a new XSRF token in header)
|
// Flush & create mock error response (including sending back a new XSRF token in header)
|
||||||
httpRequest.flush(mockErrorMessage, {
|
httpRequest.flush(mockErrorMessage, {
|
||||||
|
@@ -56,11 +56,9 @@ describe('ContextHelpToggleComponent', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('clicking the button should toggle context help icon visibility', fakeAsync(() => {
|
it('clicking the button should toggle context help icon visibility', fakeAsync(() => {
|
||||||
fixture.whenStable().then(() => {
|
|
||||||
fixture.debugElement.query(By.css('a')).nativeElement.click();
|
fixture.debugElement.query(By.css('a')).nativeElement.click();
|
||||||
tick();
|
tick();
|
||||||
expect(contextHelpService.toggleIcons).toHaveBeenCalled();
|
expect(contextHelpService.toggleIcons).toHaveBeenCalled();
|
||||||
});
|
|
||||||
}));
|
}));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@@ -4,10 +4,10 @@ import {
|
|||||||
NO_ERRORS_SCHEMA,
|
NO_ERRORS_SCHEMA,
|
||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
import {
|
import {
|
||||||
async,
|
|
||||||
ComponentFixture,
|
ComponentFixture,
|
||||||
inject,
|
inject,
|
||||||
TestBed,
|
TestBed,
|
||||||
|
waitForAsync,
|
||||||
} from '@angular/core/testing';
|
} from '@angular/core/testing';
|
||||||
import { ActivatedRoute } from '@angular/router';
|
import { ActivatedRoute } from '@angular/router';
|
||||||
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
|
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
|
||||||
@@ -86,7 +86,7 @@ describe('ProjectEntryImportModalComponent test suite', () => {
|
|||||||
const searchServiceStub: any = getMockSearchService();
|
const searchServiceStub: any = getMockSearchService();
|
||||||
|
|
||||||
|
|
||||||
beforeEach(async (() => {
|
beforeEach(waitForAsync (() => {
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [
|
imports: [
|
||||||
CommonModule,
|
CommonModule,
|
||||||
|
@@ -1,8 +1,8 @@
|
|||||||
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
||||||
import {
|
import {
|
||||||
async,
|
|
||||||
ComponentFixture,
|
ComponentFixture,
|
||||||
TestBed,
|
TestBed,
|
||||||
|
waitForAsync,
|
||||||
} from '@angular/core/testing';
|
} from '@angular/core/testing';
|
||||||
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
|
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
|
||||||
import { TranslateModule } from '@ngx-translate/core';
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
@@ -22,7 +22,7 @@ describe('SuggestionListElementComponent', () => {
|
|||||||
let scheduler: TestScheduler;
|
let scheduler: TestScheduler;
|
||||||
|
|
||||||
|
|
||||||
beforeEach(async(() => {
|
beforeEach(waitForAsync(() => {
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [
|
imports: [
|
||||||
TranslateModule.forRoot(),
|
TranslateModule.forRoot(),
|
||||||
|
@@ -1,8 +1,8 @@
|
|||||||
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
||||||
import {
|
import {
|
||||||
async,
|
|
||||||
ComponentFixture,
|
ComponentFixture,
|
||||||
TestBed,
|
TestBed,
|
||||||
|
waitForAsync,
|
||||||
} from '@angular/core/testing';
|
} from '@angular/core/testing';
|
||||||
import { ActivatedRoute } from '@angular/router';
|
import { ActivatedRoute } from '@angular/router';
|
||||||
import { TranslateModule } from '@ngx-translate/core';
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
@@ -31,7 +31,7 @@ describe('SuggestionsPopupComponent', () => {
|
|||||||
jasmine.createSpy('getNotificationSuggestionInterpolation').and.returnValue(mockNotificationInterpolation),
|
jasmine.createSpy('getNotificationSuggestionInterpolation').and.returnValue(mockNotificationInterpolation),
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(async(() => {
|
beforeEach(waitForAsync(() => {
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [TranslateModule.forRoot(), SuggestionsPopupComponent],
|
imports: [TranslateModule.forRoot(), SuggestionsPopupComponent],
|
||||||
providers: [
|
providers: [
|
||||||
|
@@ -1,8 +1,8 @@
|
|||||||
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
||||||
import {
|
import {
|
||||||
async,
|
|
||||||
ComponentFixture,
|
ComponentFixture,
|
||||||
TestBed,
|
TestBed,
|
||||||
|
waitForAsync,
|
||||||
} from '@angular/core/testing';
|
} from '@angular/core/testing';
|
||||||
|
|
||||||
import { QualityAssuranceEventsComponent } from '../../notifications/qa/events/quality-assurance-events.component';
|
import { QualityAssuranceEventsComponent } from '../../notifications/qa/events/quality-assurance-events.component';
|
||||||
@@ -12,7 +12,7 @@ describe('QualityAssuranceEventsPageComponent', () => {
|
|||||||
let component: QualityAssuranceEventsPageComponent;
|
let component: QualityAssuranceEventsPageComponent;
|
||||||
let fixture: ComponentFixture<QualityAssuranceEventsPageComponent>;
|
let fixture: ComponentFixture<QualityAssuranceEventsPageComponent>;
|
||||||
|
|
||||||
beforeEach(async(() => {
|
beforeEach(waitForAsync(() => {
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [QualityAssuranceEventsPageComponent],
|
imports: [QualityAssuranceEventsPageComponent],
|
||||||
schemas: [NO_ERRORS_SCHEMA],
|
schemas: [NO_ERRORS_SCHEMA],
|
||||||
|
@@ -1,8 +1,8 @@
|
|||||||
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
||||||
import {
|
import {
|
||||||
async,
|
|
||||||
ComponentFixture,
|
ComponentFixture,
|
||||||
TestBed,
|
TestBed,
|
||||||
|
waitForAsync,
|
||||||
} from '@angular/core/testing';
|
} from '@angular/core/testing';
|
||||||
import { ActivatedRoute } from '@angular/router';
|
import { ActivatedRoute } from '@angular/router';
|
||||||
|
|
||||||
@@ -14,7 +14,7 @@ describe('QualityAssuranceTopicsPageComponent', () => {
|
|||||||
let component: QualityAssuranceTopicsPageComponent;
|
let component: QualityAssuranceTopicsPageComponent;
|
||||||
let fixture: ComponentFixture<QualityAssuranceTopicsPageComponent>;
|
let fixture: ComponentFixture<QualityAssuranceTopicsPageComponent>;
|
||||||
|
|
||||||
beforeEach(async(() => {
|
beforeEach(waitForAsync(() => {
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [QualityAssuranceTopicsPageComponent],
|
imports: [QualityAssuranceTopicsPageComponent],
|
||||||
providers: [
|
providers: [
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
// eslint-disable-next-line import/no-namespace
|
// eslint-disable-next-line import/no-namespace
|
||||||
import * as deepFreeze from 'deep-freeze';
|
import deepFreeze from 'deep-freeze';
|
||||||
|
|
||||||
import { HostWindowResizeAction } from './host-window.actions';
|
import { HostWindowResizeAction } from './host-window.actions';
|
||||||
import { hostWindowReducer } from './search/host-window.reducer';
|
import { hostWindowReducer } from './search/host-window.reducer';
|
||||||
|
@@ -1,6 +1,10 @@
|
|||||||
import {
|
import {
|
||||||
HttpClientTestingModule,
|
provideHttpClient,
|
||||||
|
withInterceptorsFromDi,
|
||||||
|
} from '@angular/common/http';
|
||||||
|
import {
|
||||||
HttpTestingController,
|
HttpTestingController,
|
||||||
|
provideHttpClientTesting,
|
||||||
} from '@angular/common/http/testing';
|
} from '@angular/common/http/testing';
|
||||||
import {
|
import {
|
||||||
DebugElement,
|
DebugElement,
|
||||||
@@ -83,13 +87,15 @@ describe('LangSwitchComponent', () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [HttpClientTestingModule, TranslateModule.forRoot({
|
schemas: [NO_ERRORS_SCHEMA],
|
||||||
|
imports: [TranslateModule.forRoot({
|
||||||
loader: { provide: TranslateLoader, useClass: CustomLoader },
|
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(() => {
|
||||||
@@ -166,13 +172,15 @@ describe('LangSwitchComponent', () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [HttpClientTestingModule, TranslateModule.forRoot({
|
schemas: [NO_ERRORS_SCHEMA],
|
||||||
|
imports: [TranslateModule.forRoot({
|
||||||
loader: { provide: TranslateLoader, useClass: CustomLoader },
|
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);
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
// eslint-disable-next-line import/no-namespace
|
// eslint-disable-next-line import/no-namespace
|
||||||
import * as deepFreeze from 'deep-freeze';
|
import deepFreeze from 'deep-freeze';
|
||||||
|
|
||||||
import { initialMenusState } from './initial-menus-state';
|
import { initialMenusState } from './initial-menus-state';
|
||||||
import {
|
import {
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
// eslint-disable-next-line import/no-namespace
|
// eslint-disable-next-line import/no-namespace
|
||||||
import * as deepFreeze from 'deep-freeze';
|
import deepFreeze from 'deep-freeze';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
SearchFilterCollapseAction,
|
SearchFilterCollapseAction,
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
// eslint-disable-next-line import/no-namespace
|
// eslint-disable-next-line import/no-namespace
|
||||||
import * as deepFreeze from 'deep-freeze';
|
import deepFreeze from 'deep-freeze';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
SidebarCollapseAction,
|
SidebarCollapseAction,
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
// eslint-disable-next-line import/no-namespace
|
// eslint-disable-next-line import/no-namespace
|
||||||
import * as deepFreeze from 'deep-freeze';
|
import deepFreeze from 'deep-freeze';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
TruncatableCollapseAction,
|
TruncatableCollapseAction,
|
||||||
|
@@ -3,7 +3,7 @@ import {
|
|||||||
PipeTransform,
|
PipeTransform,
|
||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
// eslint-disable-next-line import/no-namespace
|
// eslint-disable-next-line import/no-namespace
|
||||||
import * as fileSize from 'filesize';
|
import fileSize from 'filesize';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Convert bytes into largest possible unit.
|
* Convert bytes into largest possible unit.
|
||||||
|
@@ -278,7 +278,7 @@ export class SystemWideAlertFormComponent implements OnInit {
|
|||||||
this.back();
|
this.back();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this.notificationsService.error(this.translateService.get(`${messagePrefix}.error`, response.errorMessage));
|
this.notificationsService.error(this.translateService.get(`${messagePrefix}.error`));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@@ -42,7 +42,7 @@ export const environment: BuildConfig = {
|
|||||||
port: 443,
|
port: 443,
|
||||||
// NOTE: Space is capitalized because 'namespace' is a reserved string in TypeScript
|
// NOTE: Space is capitalized because 'namespace' is a reserved string in TypeScript
|
||||||
nameSpace: '/api',
|
nameSpace: '/api',
|
||||||
baseUrl: 'https://rest.com/api',
|
baseUrl: 'https://rest.com/server',
|
||||||
},
|
},
|
||||||
|
|
||||||
actuators: {
|
actuators: {
|
||||||
|
@@ -1,6 +1,9 @@
|
|||||||
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';
|
||||||
@@ -204,12 +207,10 @@ const DECLARATIONS = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [RootModule,
|
||||||
RootModule,
|
|
||||||
CommonModule,
|
CommonModule,
|
||||||
DragDropModule,
|
DragDropModule,
|
||||||
FormsModule,
|
FormsModule,
|
||||||
HttpClientModule,
|
|
||||||
NgbModule,
|
NgbModule,
|
||||||
RouterModule,
|
RouterModule,
|
||||||
ScrollToModule,
|
ScrollToModule,
|
||||||
@@ -218,7 +219,9 @@ const DECLARATIONS = [
|
|||||||
TranslateModule,
|
TranslateModule,
|
||||||
FormsModule,
|
FormsModule,
|
||||||
NgxGalleryModule,
|
NgxGalleryModule,
|
||||||
...DECLARATIONS,
|
...DECLARATIONS],
|
||||||
|
providers: [
|
||||||
|
provideHttpClient(withInterceptorsFromDi()),
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@@ -1,6 +1,9 @@
|
|||||||
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';
|
||||||
@@ -16,12 +19,12 @@ const DECLARATIONS = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
|
declarations: DECLARATIONS,
|
||||||
imports: [
|
imports: [
|
||||||
RootModule,
|
RootModule,
|
||||||
CommonModule,
|
CommonModule,
|
||||||
DragDropModule,
|
DragDropModule,
|
||||||
FormsModule,
|
FormsModule,
|
||||||
HttpClientModule,
|
|
||||||
NgbModule,
|
NgbModule,
|
||||||
RouterModule,
|
RouterModule,
|
||||||
ScrollToModule,
|
ScrollToModule,
|
||||||
@@ -30,7 +33,9 @@ const DECLARATIONS = [
|
|||||||
TranslateModule,
|
TranslateModule,
|
||||||
FormsModule,
|
FormsModule,
|
||||||
],
|
],
|
||||||
declarations: DECLARATIONS,
|
providers: [
|
||||||
|
provideHttpClient(withInterceptorsFromDi()),
|
||||||
|
],
|
||||||
})
|
})
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -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