Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Update Angular CDK to v20

Alexander Brandon Coles43f44b1d1182
diff --git a/frontend/package-lock.json b/frontend/package-lock.json
index 78308ef7703..c13b7d8111c 100644
--- a/frontend/package-lock.json
+++ b/frontend/package-lock.json
@@ -10,7 +10,7 @@
"license": "GPLv3",
"dependencies": {
"@angular/animations": "^20.1.2",
- "@angular/cdk": "^19.2.19",
+ "@angular/cdk": "^20.1.2",
"@angular/cli": "^20.1.1",
"@angular/common": "^20.1.2",
"@angular/compiler": "^20.1.2",
@@ -1263,19 +1263,44 @@
}
},
"node_modules/@angular/cdk": {
- "version": "19.2.19",
- "resolved": "https://registry.npmjs.org/@angular/cdk/-/cdk-19.2.19.tgz",
- "integrity": "sha512-PCpJagurPBqciqcq4Z8+3OtKLb7rSl4w/qBJoIMua8CgnrjvA1i+SWawhdtfI1zlY8FSwhzLwXV0CmWWfFzQPg==",
+ "version": "20.1.2",
+ "resolved": "https://registry.npmjs.org/@angular/cdk/-/cdk-20.1.2.tgz",
+ "integrity": "sha512-mmQdXfC86FMnH6iZvXvEmHunQpp2KULfoMQ1KhIMzVEuAmHRpkct7onjLeGUqZ+VEXchRG7/gYkMKYQxtG8sag==",
+ "license": "MIT",
"dependencies": {
- "parse5": "^7.1.2",
+ "parse5": "^8.0.0",
"tslib": "^2.3.0"
},
"peerDependencies": {
- "@angular/common": "^19.0.0 || ^20.0.0",
- "@angular/core": "^19.0.0 || ^20.0.0",
+ "@angular/common": "^20.0.0 || ^21.0.0",
+ "@angular/core": "^20.0.0 || ^21.0.0",
"rxjs": "^6.5.3 || ^7.4.0"
}
},
+ "node_modules/@angular/cdk/node_modules/entities": {
+ "version": "6.0.1",
+ "resolved": "https://registry.npmjs.org/entities/-/entities-6.0.1.tgz",
+ "integrity": "sha512-aN97NXWF6AWBTahfVOIrB/NShkzi5H7F9r1s9mD3cDj4Ko5f2qhhVoYMibXF7GlLveb/D2ioWay8lxI97Ven3g==",
+ "license": "BSD-2-Clause",
+ "engines": {
+ "node": ">=0.12"
+ },
+ "funding": {
+ "url": "https://github.com/fb55/entities?sponsor=1"
+ }
+ },
+ "node_modules/@angular/cdk/node_modules/parse5": {
+ "version": "8.0.0",
+ "resolved": "https://registry.npmjs.org/parse5/-/parse5-8.0.0.tgz",
+ "integrity": "sha512-9m4m5GSgXjL4AjumKzq1Fgfp3Z8rsvjRNbnkVwfu2ImRqE5D0LnY2QfDen18FSY9C573YU5XxSapdHZTZ2WolA==",
+ "license": "MIT",
+ "dependencies": {
+ "entities": "^6.0.0"
+ },
+ "funding": {
+ "url": "https://github.com/inikulin/parse5?sponsor=1"
+ }
+ },
"node_modules/@angular/cli": {
"version": "20.1.1",
"resolved": "https://registry.npmjs.org/@angular/cli/-/cli-20.1.1.tgz",
@@ -27253,12 +27278,27 @@
}
},
"@angular/cdk": {
- "version": "19.2.19",
- "resolved": "https://registry.npmjs.org/@angular/cdk/-/cdk-19.2.19.tgz",
- "integrity": "sha512-PCpJagurPBqciqcq4Z8+3OtKLb7rSl4w/qBJoIMua8CgnrjvA1i+SWawhdtfI1zlY8FSwhzLwXV0CmWWfFzQPg==",
+ "version": "20.1.2",
+ "resolved": "https://registry.npmjs.org/@angular/cdk/-/cdk-20.1.2.tgz",
+ "integrity": "sha512-mmQdXfC86FMnH6iZvXvEmHunQpp2KULfoMQ1KhIMzVEuAmHRpkct7onjLeGUqZ+VEXchRG7/gYkMKYQxtG8sag==",
"requires": {
- "parse5": "^7.1.2",
+ "parse5": "^8.0.0",
"tslib": "^2.3.0"
+ },
+ "dependencies": {
+ "entities": {
+ "version": "6.0.1",
+ "resolved": "https://registry.npmjs.org/entities/-/entities-6.0.1.tgz",
+ "integrity": "sha512-aN97NXWF6AWBTahfVOIrB/NShkzi5H7F9r1s9mD3cDj4Ko5f2qhhVoYMibXF7GlLveb/D2ioWay8lxI97Ven3g=="
+ },
+ "parse5": {
+ "version": "8.0.0",
+ "resolved": "https://registry.npmjs.org/parse5/-/parse5-8.0.0.tgz",
+ "integrity": "sha512-9m4m5GSgXjL4AjumKzq1Fgfp3Z8rsvjRNbnkVwfu2ImRqE5D0LnY2QfDen18FSY9C573YU5XxSapdHZTZ2WolA==",
+ "requires": {
+ "entities": "^6.0.0"
+ }
+ }
}
},
"@angular/cli": {
diff --git a/frontend/package.json b/frontend/package.json
index 8fe49292fd8..238397d7ecf 100644
--- a/frontend/package.json
+++ b/frontend/package.json
@@ -64,7 +64,7 @@
},
"dependencies": {
"@angular/animations": "^20.1.2",
- "@angular/cdk": "^19.2.19",
+ "@angular/cdk": "^20.1.2",
"@angular/cli": "^20.1.1",
"@angular/common": "^20.1.2",
"@angular/compiler": "^20.1.2",
diff --git a/frontend/src/app/core/apiv3/api-v3.service.ts b/frontend/src/app/core/apiv3/api-v3.service.ts
index 9a89fa8dde5..4216518472c 100644
--- a/frontend/src/app/core/apiv3/api-v3.service.ts
+++ b/frontend/src/app/core/apiv3/api-v3.service.ts
@@ -28,7 +28,7 @@
import { Injectable, Injector } from '@angular/core';
import { ApiV3GettableResource, ApiV3ResourceCollection } from 'core-app/core/apiv3/paths/apiv3-resource';
-import { Constructor } from '@angular/cdk/table';
+import { Constructor } from 'core-app/core/util-types';
import { PathHelperService } from 'core-app/core/path-helper/path-helper.service';
import { ApiV3GridsPaths } from 'core-app/core/apiv3/endpoints/grids/apiv3-grids-paths';
import { ApiV3TimeEntriesPaths } from 'core-app/core/apiv3/endpoints/time-entries/apiv3-time-entries-paths';
diff --git a/frontend/src/app/core/apiv3/paths/apiv3-resource.ts b/frontend/src/app/core/apiv3/paths/apiv3-resource.ts
index 92c21f8bc89..d82ee6c0521 100644
--- a/frontend/src/app/core/apiv3/paths/apiv3-resource.ts
+++ b/frontend/src/app/core/apiv3/paths/apiv3-resource.ts
@@ -1,6 +1,6 @@
/* eslint-disable max-classes-per-file */
-import { Constructor } from '@angular/cdk/table';
+import { Constructor } from 'core-app/core/util-types';
import { Observable } from 'rxjs';
import { HttpClient } from '@angular/common/http';
diff --git a/frontend/src/app/core/apiv3/paths/path-resources.ts b/frontend/src/app/core/apiv3/paths/path-resources.ts
index 7a6b65b74f9..eda663d524d 100644
--- a/frontend/src/app/core/apiv3/paths/path-resources.ts
+++ b/frontend/src/app/core/apiv3/paths/path-resources.ts
@@ -1,4 +1,4 @@
-import { Constructor } from '@angular/cdk/table';
+import { Constructor } from 'core-app/core/util-types';
/**
* Simple resource collection to construct paths for RESTful resources.
diff --git a/frontend/src/app/core/util-types.ts b/frontend/src/app/core/util-types.ts
new file mode 100644
index 00000000000..50586990d8a
--- /dev/null
+++ b/frontend/src/app/core/util-types.ts
@@ -0,0 +1,30 @@
+//-- copyright
+// OpenProject is an open source project management software.
+// Copyright (C) the OpenProject GmbH
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License version 3.
+//
+// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
+// Copyright (C) 2006-2013 Jean-Philippe Lang
+// Copyright (C) 2010-2013 the ChiliProject Team
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
+// See COPYRIGHT and LICENSE files for more details.
+//++
+
+/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
+export type Constructor<T> = new (...args:any[]) => T;
diff --git a/frontend/src/app/features/bim/bcf/api/bcf-api-request.service.ts b/frontend/src/app/features/bim/bcf/api/bcf-api-request.service.ts
index afcd9de59c6..ae2e08ac51e 100644
--- a/frontend/src/app/features/bim/bcf/api/bcf-api-request.service.ts
+++ b/frontend/src/app/features/bim/bcf/api/bcf-api-request.service.ts
@@ -29,7 +29,7 @@
import { HttpClient, HttpErrorResponse, HttpParams } from '@angular/common/http';
import { Injector } from '@angular/core';
import { TypedJSON } from 'typedjson';
-import { Constructor } from '@angular/cdk/table';
+import { Constructor } from 'core-app/core/util-types';
import { Observable, throwError } from 'rxjs';
import {
HTTPClientHeaders,
diff --git a/frontend/src/app/features/bim/bcf/api/bcf-path-resources.ts b/frontend/src/app/features/bim/bcf/api/bcf-path-resources.ts
index ea009f26e3f..0f394582327 100644
--- a/frontend/src/app/features/bim/bcf/api/bcf-path-resources.ts
+++ b/frontend/src/app/features/bim/bcf/api/bcf-path-resources.ts
@@ -1,5 +1,5 @@
import { Injector } from '@angular/core';
-import { Constructor } from '@angular/cdk/table';
+import { Constructor } from 'core-app/core/util-types';
import { SimpleResource, SimpleResourceCollection } from 'core-app/core/apiv3/paths/path-resources';
export class BcfResourcePath extends SimpleResource {
diff --git a/frontend/src/app/features/work-packages/components/wp-table/external-configuration/external-query-configuration.service.ts b/frontend/src/app/features/work-packages/components/wp-table/external-configuration/external-query-configuration.service.ts
index 5dbe38ce212..af2f2204b9d 100644
--- a/frontend/src/app/features/work-packages/components/wp-table/external-configuration/external-query-configuration.service.ts
+++ b/frontend/src/app/features/work-packages/components/wp-table/external-configuration/external-query-configuration.service.ts
@@ -1,7 +1,7 @@
import {
ApplicationRef, ComponentFactoryResolver, Injectable, Injector,
} from '@angular/core';
-import { ComponentPortal, DomPortalOutlet, PortalInjector } from '@angular/cdk/portal';
+import { ComponentPortal, DomPortalOutlet } from '@angular/cdk/portal';
import { TransitionService } from '@uirouter/core';
import { FocusHelperService } from 'core-app/shared/directives/focus/focus-helper';
import {
@@ -20,7 +20,7 @@ export class ExternalQueryConfigurationService {
// And a reference to the actual portal host interface on top of the element
private _bodyPortalHost:DomPortalOutlet;
- constructor(private componentFactoryResolver:ComponentFactoryResolver,
+ constructor(
readonly FocusHelper:FocusHelperService,
private appRef:ApplicationRef,
private $transitions:TransitionService,
@@ -38,7 +38,6 @@ export class ExternalQueryConfigurationService {
this._bodyPortalHost = new DomPortalOutlet(
hostElement,
- this.componentFactoryResolver,
this.appRef,
this.injector,
);
@@ -81,14 +80,16 @@ export class ExternalQueryConfigurationService {
*
*/
private injectorFor(data:any) {
- const injectorTokens = new WeakMap();
// Pass the service because otherwise we're getting a cyclic dependency between the portal
// host service and the bound portal
data.service = this;
- injectorTokens.set(OpQueryConfigurationLocalsToken, data);
-
- return new PortalInjector(this.injector, injectorTokens);
+ return Injector.create({
+ providers: [
+ { provide: OpQueryConfigurationLocalsToken, useValue: data },
+ ],
+ parent: this.injector,
+ });
}
externalQueryConfigurationComponent():Class {
diff --git a/frontend/src/app/shared/components/fields/display/display-field.component.ts b/frontend/src/app/shared/components/fields/display/display-field.component.ts
index ba372dd7930..60f26277333 100644
--- a/frontend/src/app/shared/components/fields/display/display-field.component.ts
+++ b/frontend/src/app/shared/components/fields/display/display-field.component.ts
@@ -3,7 +3,7 @@ import { IFieldSchema } from 'core-app/shared/components/fields/field.base';
import { DisplayFieldService } from 'core-app/shared/components/fields/display/display-field.service';
import { HalResource } from 'core-app/features/hal/resources/hal-resource';
import { SchemaCacheService } from 'core-app/core/schemas/schema-cache.service';
-import { Constructor } from '@angular/cdk/table';
+import { Constructor } from 'core-app/core/util-types';
import { DisplayField } from 'core-app/shared/components/fields/display/display-field.module';
import { SchemaResource } from 'core-app/features/hal/resources/schema-resource';
diff --git a/frontend/src/app/shared/components/fields/edit/editing-portal/edit-form-portal.injector.ts b/frontend/src/app/shared/components/fields/edit/editing-portal/edit-form-portal.injector.ts
index d836d163409..3c7d4fec8ab 100644
--- a/frontend/src/app/shared/components/fields/edit/editing-portal/edit-form-portal.injector.ts
+++ b/frontend/src/app/shared/components/fields/edit/editing-portal/edit-form-portal.injector.ts
@@ -4,7 +4,6 @@ import {
OpEditingPortalHandlerToken,
OpEditingPortalSchemaToken,
} from 'core-app/shared/components/fields/edit/edit-field.component';
-import { PortalInjector } from '@angular/cdk/portal';
import { EditFieldHandler } from 'core-app/shared/components/fields/edit/editing-portal/edit-field-handler';
import { IFieldSchema } from 'core-app/shared/components/fields/field.base';
import { ResourceChangeset } from 'core-app/shared/components/fields/changeset/resource-changeset';
@@ -12,7 +11,7 @@ import { ResourceChangeset } from 'core-app/shared/components/fields/changeset/r
/**
* Creates an injector for the edit field portal to pass data into.
*
- * @returns {PortalInjector}
+ * @returns {Injector}
*/
export function createLocalInjector(
injector:Injector,
@@ -20,11 +19,12 @@ export function createLocalInjector(
fieldHandler:EditFieldHandler,
schema:IFieldSchema,
):Injector {
- const injectorTokens = new WeakMap();
-
- injectorTokens.set(OpEditingPortalChangesetToken, change);
- injectorTokens.set(OpEditingPortalHandlerToken, fieldHandler);
- injectorTokens.set(OpEditingPortalSchemaToken, schema);
-
- return new PortalInjector(injector, injectorTokens);
+ return Injector.create({
+ providers: [
+ { provide: OpEditingPortalChangesetToken, useValue: change },
+ { provide: OpEditingPortalHandlerToken, useValue: fieldHandler },
+ { provide: OpEditingPortalSchemaToken, useValue: schema },
+ ],
+ parent: injector,
+ });
}
diff --git a/frontend/src/app/shared/components/fields/edit/editing-portal/editing-portal-service.ts b/frontend/src/app/shared/components/fields/edit/editing-portal/editing-portal-service.ts
index 4762f201bb8..0993310435a 100644
--- a/frontend/src/app/shared/components/fields/edit/editing-portal/editing-portal-service.ts
+++ b/frontend/src/app/shared/components/fields/edit/editing-portal/editing-portal-service.ts
@@ -2,7 +2,7 @@
* A CDK portal implementation to wrap edit-fields in non-angular contexts.
*/
import {
- ApplicationRef, ComponentFactoryResolver, Injectable, Injector,
+ ApplicationRef, Injectable, Injector,
} from '@angular/core';
import { ComponentPortal, DomPortalOutlet } from '@angular/cdk/portal';
import { EditFormPortalComponent } from 'core-app/shared/components/fields/edit/editing-portal/edit-form-portal.component';
@@ -17,7 +17,6 @@ import { HalResourceEditFieldHandler } from 'core-app/shared/components/fields/e
@Injectable({ providedIn: 'root' })
export class EditingPortalService {
constructor(private readonly appRef:ApplicationRef,
- private readonly componentFactoryResolver:ComponentFactoryResolver,
private readonly pathHelper:PathHelperService) {
}
@@ -80,7 +79,6 @@ export class EditingPortalService {
private createDomOutlet(hostElement:HTMLElement, injector:Injector) {
return new DomPortalOutlet(
hostElement,
- this.componentFactoryResolver,
this.appRef,
injector,
);
diff --git a/frontend/src/app/shared/components/modal/modal.service.ts b/frontend/src/app/shared/components/modal/modal.service.ts
index eacdd7b1ad3..20cd2d8e480 100644
--- a/frontend/src/app/shared/components/modal/modal.service.ts
+++ b/frontend/src/app/shared/components/modal/modal.service.ts
@@ -26,7 +26,7 @@
// See COPYRIGHT and LICENSE files for more details.
//++
-import { ComponentType, PortalInjector } from '@angular/cdk/portal';
+import { ComponentType } from '@angular/cdk/portal';
import {
Injectable,
InjectionToken,
@@ -141,13 +141,15 @@ export class OpModalService {
* This allows callers to pass data into the newly created modal.
*/
private injectorFor(injector:Injector, data:Record<string, unknown>) {
- const injectorTokens = new WeakMap();
// Pass the service because otherwise we're getting a cyclic dependency between the portal
// host service and the bound portal
data.service = this;
- injectorTokens.set(OpModalLocalsToken, data);
-
- return new PortalInjector(injector, injectorTokens);
+ return Injector.create({
+ providers: [
+ { provide: OpModalLocalsToken, useValue: data },
+ ],
+ parent: injector,
+ });
}
}
diff --git a/frontend/src/app/shared/components/op-context-menu/op-context-menu.service.ts b/frontend/src/app/shared/components/op-context-menu/op-context-menu.service.ts
index 40e9d0ed7b9..734d9b887db 100644
--- a/frontend/src/app/shared/components/op-context-menu/op-context-menu.service.ts
+++ b/frontend/src/app/shared/components/op-context-menu/op-context-menu.service.ts
@@ -1,5 +1,5 @@
-import { ApplicationRef, ComponentFactoryResolver, Injectable, Injector } from '@angular/core';
-import { ComponentPortal, ComponentType, DomPortalOutlet, PortalInjector } from '@angular/cdk/portal';
+import { ApplicationRef, Injectable, Injector } from '@angular/core';
+import { ComponentPortal, ComponentType, DomPortalOutlet } from '@angular/cdk/portal';
import { TransitionService } from '@uirouter/core';
import { OpContextMenuHandler } from 'core-app/shared/components/op-context-menu/op-context-menu-handler';
import {
@@ -23,7 +23,6 @@ export class OPContextMenuService {
private isOpening = false;
constructor(
- private componentFactoryResolver:ComponentFactoryResolver,
readonly FocusHelper:FocusHelperService,
private appRef:ApplicationRef,
private $transitions:TransitionService,
@@ -41,7 +40,6 @@ export class OPContextMenuService {
this.bodyPortalHost = new DomPortalOutlet(
hostElement,
- this.componentFactoryResolver,
this.appRef,
this.injector,
);
@@ -140,16 +138,18 @@ export class OPContextMenuService {
* This allows callers to pass data into the newly created context menu component.
*
* @param {OpContextMenuLocalsMap} data
- * @returns {PortalInjector}
+ * @returns {Injector}
*/
private injectorFor(data:OpContextMenuLocalsMap) {
- const injectorTokens = new WeakMap();
// Pass the service because otherwise we're getting a cyclic dependency between the portal
// host service and the bound portal
data.service = this;
- injectorTokens.set(OpContextMenuLocalsToken, data);
-
- return new PortalInjector(this.injector, injectorTokens);
+ return Injector.create({
+ providers: [
+ { provide: OpContextMenuLocalsToken, useValue: data },
+ ],
+ parent: this.injector,
+ });
}
}