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

Use board-global card registry to handle focus

Oliver Günther8d0ecb4b3ed8
diff --git a/frontend/src/app/components/wp-card-view/wp-card-view.component.ts b/frontend/src/app/components/wp-card-view/wp-card-view.component.ts
index 1304938a690..c2eb747696f 100644
--- a/frontend/src/app/components/wp-card-view/wp-card-view.component.ts
+++ b/frontend/src/app/components/wp-card-view/wp-card-view.component.ts
@@ -147,7 +147,11 @@ export class WorkPackageCardViewComponent extends UntilDestroyedMixin implements
// Register event handlers for the cards
let registry = this.injector.get<any>(WorkPackageViewHandlerToken, CardViewHandlerRegistry);
- new registry(this.injector).attachTo(this);
+ if (registry instanceof CardViewHandlerRegistry) {
+ registry.attachTo(this);
+ } else {
+ new registry(this.injector).attachTo(this);
+ }
this.wpTableSelection.registerSelectAllListener(() => {
return this.cardView.renderedCards;
});
diff --git a/frontend/src/app/modules/boards/board/board-partitioned-page/board-partitioned-page.component.ts b/frontend/src/app/modules/boards/board/board-partitioned-page/board-partitioned-page.component.ts
index 83d867aa68f..fa6485b7131 100644
--- a/frontend/src/app/modules/boards/board/board-partitioned-page/board-partitioned-page.component.ts
+++ b/frontend/src/app/modules/boards/board/board-partitioned-page/board-partitioned-page.component.ts
@@ -24,6 +24,12 @@ import {UntilDestroyedMixin} from "core-app/helpers/angular/until-destroyed.mixi
import {QueryResource} from "core-app/modules/hal/resources/query-resource";
import {Ng2StateDeclaration} from "@uirouter/angular";
import {BoardFiltersService} from "core-app/modules/boards/board/board-filter/board-filters.service";
+import {WorkPackageViewHandlerToken} from "core-app/modules/work_packages/routing/wp-view-base/event-handling/event-handler-registry";
+import {CardViewHandlerRegistry} from "core-components/wp-card-view/event-handler/card-view-handler-registry";
+
+export function boardCardViewHandlerFactory(injector:Injector) {
+ return new CardViewHandlerRegistry(injector);
+}
@Component({
templateUrl: '/app/modules/work_packages/routing/partitioned-query-space-page/partitioned-query-space-page.component.html',
@@ -34,6 +40,7 @@ import {BoardFiltersService} from "core-app/modules/boards/board/board-filter/bo
providers: [
DragAndDropService,
BoardFiltersService,
+ { provide: WorkPackageViewHandlerToken, useFactory: boardCardViewHandlerFactory, deps: [Injector] },
]
})
export class BoardPartitionedPageComponent extends UntilDestroyedMixin {