Skip to content

Commit b9e164d

Browse files
authored
Merge pull request DSpace#3717 from atmire/w2p-120243_Upgrade-to-Angular-v18
Upgrade to angular v18
2 parents aca1411 + c90b056 commit b9e164d

36 files changed

Lines changed: 6219 additions & 5590 deletions

File tree

cypress/e2e/community-list.cy.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,13 @@ describe('Community List Page', () => {
1212
cy.get('[data-test="expand-button"]').click({ multiple: true });
1313

1414
// Analyze <ds-community-list-page> for accessibility issues
15-
testA11y('ds-community-list-page');
15+
testA11y('ds-community-list-page', {
16+
rules: {
17+
// When expanding a cdk node on the community-list page, the 'aria-posinset' property becomes 0.
18+
// 0 is not a valid value for 'aria-posinset' so the test fails.
19+
// see https://github.com/DSpace/dspace-angular/issues/4068
20+
'aria-valid-attr-value': { enabled: false },
21+
},
22+
});
1623
});
1724
});

package-lock.json

Lines changed: 6008 additions & 5440 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 51 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -57,68 +57,62 @@
5757
"private": true,
5858
"overrides": {
5959
"@kolkov/ngx-gallery": {
60-
"@angular/animations": "^17.3.11",
61-
"@angular/common": "^17.3.11",
62-
"@angular/core": "^17.3.11"
60+
"@angular/animations": "^18.2.12",
61+
"@angular/common": "^18.2.12",
62+
"@angular/core": "^18.2.12"
6363
},
6464
"@ng-bootstrap/ng-bootstrap": {
65-
"@angular/common": "^17.3.11",
66-
"@angular/core": "^17.3.11",
67-
"@angular/forms": "^17.3.11",
68-
"@angular/localize": "^17.3.11"
65+
"@angular/common": "^18.2.12",
66+
"@angular/core": "^18.2.12",
67+
"@angular/forms": "^18.2.12",
68+
"@angular/localize": "^18.2.12"
6969
},
7070
"@ng-dynamic-forms/core": {
71-
"@angular/common": "^17.3.11",
72-
"@angular/core": "^17.3.11",
73-
"@angular/forms": "^17.3.11"
71+
"@angular/common": "^18.2.12",
72+
"@angular/core": "^18.2.12",
73+
"@angular/forms": "^18.2.12"
7474
},
7575
"@ng-dynamic-forms/ui-ng-bootstrap": {
7676
"ngx-mask": "14.2.4",
7777
"@ng-bootstrap/ng-bootstrap": "^12.0.0",
7878
"bootstrap": "^5.3"
7979
},
80-
"@ngtools/webpack": {
81-
"@angular/compiler-cli": "^17.3.11",
82-
"typescript": "~5.4.5"
83-
},
8480
"@nicky-lenaers/ngx-scroll-to": {
85-
"@angular/common": "^17.3.11",
86-
"@angular/core": "^17.3.11"
81+
"@angular/common": "^18.2.12",
82+
"@angular/core": "^18.2.12"
8783
},
8884
"eslint-plugin-unused-imports": {
8985
"@typescript-eslint/eslint-plugin": "^7.2.0"
9086
},
91-
"ng2-file-upload": {
92-
"@angular/common": "^17.3.11",
93-
"@angular/core": "^17.3.11"
94-
},
9587
"ngx-infinite-scroll": {
96-
"@angular/common": "^17.3.11",
97-
"@angular/core": "^17.3.11"
98-
}
88+
"@angular/common": "^18.2.12",
89+
"@angular/core": "^18.2.12"
90+
},
91+
"notistack": "3.0.1"
9992
},
10093
"dependencies": {
101-
"@angular/animations": "^17.3.12",
102-
"@angular/cdk": "^17.3.10",
103-
"@angular/common": "^17.3.12",
104-
"@angular/compiler": "^17.3.12",
105-
"@angular/core": "^17.3.12",
106-
"@angular/forms": "^17.3.12",
107-
"@angular/localize": "^17.3.12",
108-
"@angular/platform-browser": "^17.3.12",
109-
"@angular/platform-browser-dynamic": "^17.3.12",
110-
"@angular/platform-server": "^17.3.12",
111-
"@angular/router": "^17.3.12",
112-
"@angular/ssr": "^17.3.11",
113-
"@babel/runtime": "7.26.7",
94+
"@angular/animations": "^18.2.12",
95+
"@angular/cdk": "^18.2.12",
96+
"@angular/common": "^18.2.12",
97+
"@angular/compiler": "^18.2.12",
98+
"@angular/core": "^18.2.12",
99+
"@angular/forms": "^18.2.12",
100+
"@angular/localize": "^18.2.12",
101+
"@angular/platform-browser": "^18.2.12",
102+
"@angular/platform-browser-dynamic": "^18.2.12",
103+
"@angular/platform-server": "^18.2.12",
104+
"@angular/router": "^18.2.12",
105+
"@angular/ssr": "^18.2.12",
106+
"@babel/runtime": "7.26.0",
114107
"@kolkov/ngx-gallery": "^2.0.1",
115108
"@ng-bootstrap/ng-bootstrap": "^12.0.0",
116109
"@ng-dynamic-forms/core": "^16.0.0",
117110
"@ng-dynamic-forms/ui-ng-bootstrap": "^16.0.0",
118-
"@ngrx/effects": "^17.1.1",
119-
"@ngrx/router-store": "^17.1.1",
120-
"@ngrx/store": "^17.1.1",
121-
"@ngx-translate/core": "^14.0.0",
111+
"@ngrx/effects": "^18.1.1",
112+
"@ngrx/operators": "^18.0.0",
113+
"@ngrx/router-store": "^18.1.1",
114+
"@ngrx/store": "^18.1.1",
115+
"@ngx-translate/core": "^16.0.3",
122116
"@nicky-lenaers/ngx-scroll-to": "^14.0.0",
123117
"angulartics2": "^12.2.0",
124118
"axios": "^1.7.9",
@@ -152,12 +146,12 @@
152146
"mirador-dl-plugin": "^0.13.0",
153147
"mirador-share-plugin": "^0.16.0",
154148
"morgan": "^1.10.0",
155-
"ng2-file-upload": "5.0.0",
149+
"ng2-file-upload": "7.0.1",
156150
"ng2-nouislider": "^2.0.0",
157-
"ngx-infinite-scroll": "^16.0.0",
151+
"ngx-infinite-scroll": "^18.0.0",
158152
"ngx-pagination": "6.0.3",
159153
"ngx-skeleton-loader": "^9.0.0",
160-
"ngx-ui-switch": "^14.1.0",
154+
"ngx-ui-switch": "^15.0.0",
161155
"nouislider": "^15.7.1",
162156
"orejime": "^2.3.1",
163157
"pem": "1.14.8",
@@ -167,22 +161,22 @@
167161
"zone.js": "~0.14.10"
168162
},
169163
"devDependencies": {
170-
"@angular-builders/custom-webpack": "~17.0.2",
171-
"@angular-devkit/build-angular": "^17.3.11",
172-
"@angular-eslint/builder": "^17.5.3",
173-
"@angular-eslint/bundled-angular-compiler": "^17.5.3",
174-
"@angular-eslint/eslint-plugin": "^17.5.3",
175-
"@angular-eslint/eslint-plugin-template": "^17.5.3",
176-
"@angular-eslint/schematics": "^17.5.3",
177-
"@angular-eslint/template-parser": "^17.5.3",
178-
"@angular-eslint/utils": "^17.5.3",
179-
"@angular/cli": "^17.3.11",
180-
"@angular/compiler-cli": "^17.3.11",
181-
"@angular/language-service": "^17.3.12",
164+
"@angular-builders/custom-webpack": "~18.0.0",
165+
"@angular-devkit/build-angular": "^18.2.12",
166+
"@angular-eslint/builder": "^18.4.1",
167+
"@angular-eslint/bundled-angular-compiler": "^18.4.1",
168+
"@angular-eslint/eslint-plugin": "^18.4.1",
169+
"@angular-eslint/eslint-plugin-template": "^18.4.1",
170+
"@angular-eslint/schematics": "^18.4.1",
171+
"@angular-eslint/template-parser": "^18.4.1",
172+
"@angular-eslint/utils": "^18.4.1",
173+
"@angular/cli": "^18.2.12",
174+
"@angular/compiler-cli": "^18.2.12",
175+
"@angular/language-service": "^18.2.12",
182176
"@cypress/schematic": "^1.5.0",
183177
"@fortawesome/fontawesome-free": "^6.7.2",
184-
"@ngrx/store-devtools": "^17.1.1",
185-
"@ngtools/webpack": "^16.2.16",
178+
"@ngrx/store-devtools": "^18.1.1",
179+
"@ngtools/webpack": "^18.2.12",
186180
"@types/deep-freeze": "0.1.5",
187181
"@types/ejs": "^3.1.2",
188182
"@types/express": "^4.17.17",

server.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ import 'reflect-metadata';
2020

2121
/* eslint-disable import/no-namespace */
2222
import * as morgan from 'morgan';
23-
import * as express from 'express';
23+
import express from 'express';
2424
import * as ejs from 'ejs';
2525
import * as compression from 'compression';
26-
import * as expressStaticGzip from 'express-static-gzip';
26+
import expressStaticGzip from 'express-static-gzip';
2727
/* eslint-enable import/no-namespace */
2828
import axios from 'axios';
2929
import LRU from 'lru-cache';

src/app/admin/admin-reports/filtered-collections/filtered-collections.component.spec.ts

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
import { HttpClientTestingModule } from '@angular/common/http/testing';
1+
import {
2+
provideHttpClient,
3+
withInterceptorsFromDi,
4+
} from '@angular/common/http';
5+
import { provideHttpClientTesting } from '@angular/common/http/testing';
26
import { NO_ERRORS_SCHEMA } from '@angular/core';
37
import {
48
ComponentFixture,
@@ -39,22 +43,21 @@ describe('FiltersComponent', () => {
3943

4044
beforeEach(waitForAsync(() => {
4145
TestBed.configureTestingModule({
42-
imports: [
43-
NgbAccordionModule,
46+
schemas: [NO_ERRORS_SCHEMA],
47+
imports: [NgbAccordionModule,
4448
TranslateModule.forRoot({
4549
loader: {
4650
provide: TranslateLoader,
4751
useClass: TranslateLoaderMock,
4852
},
4953
}),
50-
HttpClientTestingModule,
51-
FilteredCollectionsComponent,
52-
],
54+
FilteredCollectionsComponent],
5355
providers: [
5456
FormBuilder,
5557
DspaceRestService,
58+
provideHttpClient(withInterceptorsFromDi()),
59+
provideHttpClientTesting(),
5660
],
57-
schemas: [NO_ERRORS_SCHEMA],
5861
});
5962
}));
6063

src/app/core/auth/auth.interceptor.spec.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1-
import { HTTP_INTERCEPTORS } from '@angular/common/http';
21
import {
3-
HttpClientTestingModule,
2+
HTTP_INTERCEPTORS,
3+
provideHttpClient,
4+
withInterceptorsFromDi,
5+
} from '@angular/common/http';
6+
import {
47
HttpTestingController,
8+
provideHttpClientTesting,
59
} from '@angular/common/http/testing';
610
import { TestBed } from '@angular/core/testing';
711
import { Router } from '@angular/router';
@@ -28,7 +32,7 @@ describe(`AuthInterceptor`, () => {
2832

2933
beforeEach(() => {
3034
TestBed.configureTestingModule({
31-
imports: [HttpClientTestingModule],
35+
imports: [],
3236
providers: [
3337
DspaceRestService,
3438
{ provide: AuthService, useValue: authServiceStub },
@@ -39,6 +43,8 @@ describe(`AuthInterceptor`, () => {
3943
multi: true,
4044
},
4145
{ provide: Store, useValue: store },
46+
provideHttpClient(withInterceptorsFromDi()),
47+
provideHttpClientTesting(),
4248
],
4349
});
4450

src/app/core/cache/object-cache.reducer.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// eslint-disable-next-line import/no-namespace
2-
import * as deepFreeze from 'deep-freeze';
2+
import deepFreeze from 'deep-freeze';
33
import { Operation } from 'fast-json-patch';
44

55
import { Item } from '../shared/item.model';

src/app/core/cache/server-sync-buffer.reducer.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// eslint-disable-next-line import/no-namespace
2-
import * as deepFreeze from 'deep-freeze';
2+
import deepFreeze from 'deep-freeze';
33

44
import { RestRequestMethod } from '../data/rest-request-method';
55
import { RemoveFromObjectCacheAction } from './object-cache.actions';

src/app/core/data/object-updates/object-updates.reducer.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// eslint-disable-next-line import/no-namespace
2-
import * as deepFreeze from 'deep-freeze';
2+
import deepFreeze from 'deep-freeze';
33

44
import { Relationship } from '../../shared/item-relationships/relationship.model';
55
import { FieldChangeType } from './field-change-type.model';

src/app/core/data/request.reducer.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// eslint-disable-next-line import/no-namespace
2-
import * as deepFreeze from 'deep-freeze';
2+
import deepFreeze from 'deep-freeze';
33

44
import {
55
RequestConfigureAction,

0 commit comments

Comments
 (0)