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

Fix dynamic inputs setting an input that is not defined

Oliver Günther3af14c83bd0b
diff --git a/frontend/src/app/features/work-packages/components/wp-single-view-tabs/activity-panel/activity-tab.component.ts b/frontend/src/app/features/work-packages/components/wp-single-view-tabs/activity-panel/activity-tab.component.ts
index d2dad252cda..36f6fdd58ff 100644
--- a/frontend/src/app/features/work-packages/components/wp-single-view-tabs/activity-panel/activity-tab.component.ts
+++ b/frontend/src/app/features/work-packages/components/wp-single-view-tabs/activity-panel/activity-tab.component.ts
@@ -26,7 +26,11 @@
// See COPYRIGHT and LICENSE files for more details.
//++
-import { ChangeDetectionStrategy, Component } from '@angular/core';
+import {
+ ChangeDetectionStrategy,
+ Component,
+ Input,
+} from '@angular/core';
import { WorkPackageResource } from 'core-app/features/hal/resources/work-package-resource';
import { trackByProperty } from 'core-app/shared/helpers/angular/tracking-functions';
import { ActivityPanelBaseController } from 'core-app/features/work-packages/components/wp-single-view-tabs/activity-panel/activity-base.controller';
@@ -37,7 +41,7 @@ import { ActivityPanelBaseController } from 'core-app/features/work-packages/com
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class WorkPackageActivityTabComponent extends ActivityPanelBaseController {
- public workPackage:WorkPackageResource;
+ @Input() public workPackage:WorkPackageResource;
public tabName = this.I18n.t('js.work_packages.tabs.activity');
diff --git a/frontend/src/app/features/work-packages/components/wp-single-view-tabs/files-tab/op-files-tab.component.ts b/frontend/src/app/features/work-packages/components/wp-single-view-tabs/files-tab/op-files-tab.component.ts
index ab1a0f6eabc..ef40fd2dcd0 100644
--- a/frontend/src/app/features/work-packages/components/wp-single-view-tabs/files-tab/op-files-tab.component.ts
+++ b/frontend/src/app/features/work-packages/components/wp-single-view-tabs/files-tab/op-files-tab.component.ts
@@ -26,7 +26,12 @@
// See COPYRIGHT and LICENSE files for more details.
//++
-import { ChangeDetectionStrategy, Component, OnInit } from '@angular/core';
+import {
+ ChangeDetectionStrategy,
+ Component,
+ Input,
+ OnInit,
+} from '@angular/core';
import { combineLatest, Observable } from 'rxjs';
import { map } from 'rxjs/operators';
@@ -45,7 +50,7 @@ import { IProjectStorage } from 'core-app/core/state/project-storages/project-st
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class WorkPackageFilesTabComponent implements OnInit {
- workPackage:WorkPackageResource;
+ @Input() workPackage:WorkPackageResource;
text = {
attachments: {
diff --git a/frontend/src/app/features/work-packages/components/wp-single-view-tabs/overview-tab/overview-tab.component.ts b/frontend/src/app/features/work-packages/components/wp-single-view-tabs/overview-tab/overview-tab.component.ts
index 35dab080b78..9bd66812ccd 100644
--- a/frontend/src/app/features/work-packages/components/wp-single-view-tabs/overview-tab/overview-tab.component.ts
+++ b/frontend/src/app/features/work-packages/components/wp-single-view-tabs/overview-tab/overview-tab.component.ts
@@ -26,7 +26,10 @@
// See COPYRIGHT and LICENSE files for more details.
//++
-import { Component } from '@angular/core';
+import {
+ Component,
+ Input,
+} from '@angular/core';
import { StateService } from '@uirouter/core';
import { WorkPackageResource } from 'core-app/features/hal/resources/work-package-resource';
import { I18nService } from 'core-app/core/i18n/i18n.service';
@@ -38,9 +41,9 @@ import { ApiV3Service } from 'core-app/core/apiv3/api-v3.service';
selector: 'wp-overview-tab',
})
export class WorkPackageOverviewTabComponent extends UntilDestroyedMixin {
- public workPackageId:string;
+ @Input() public workPackage:WorkPackageResource;
- public workPackage:WorkPackageResource;
+ public workPackageId:string;
public tabName = this.I18n.t('js.label_latest_activity');
diff --git a/frontend/src/app/features/work-packages/components/wp-single-view-tabs/relations-tab/relations-tab.component.ts b/frontend/src/app/features/work-packages/components/wp-single-view-tabs/relations-tab/relations-tab.component.ts
index f7c57185b6a..6a4acf1acb7 100644
--- a/frontend/src/app/features/work-packages/components/wp-single-view-tabs/relations-tab/relations-tab.component.ts
+++ b/frontend/src/app/features/work-packages/components/wp-single-view-tabs/relations-tab/relations-tab.component.ts
@@ -40,7 +40,7 @@ import { ApiV3Service } from 'core-app/core/apiv3/api-v3.service';
export class WorkPackageRelationsTabComponent extends UntilDestroyedMixin implements OnInit {
@Input() public workPackageId?:string;
- public workPackage:WorkPackageResource;
+ @Input() public workPackage:WorkPackageResource;
public constructor(readonly I18n:I18nService,
readonly $transition:Transition,
diff --git a/frontend/src/app/features/work-packages/components/wp-single-view-tabs/watchers-tab/watchers-tab.component.ts b/frontend/src/app/features/work-packages/components/wp-single-view-tabs/watchers-tab/watchers-tab.component.ts
index f1124ed3048..77977f10ae4 100644
--- a/frontend/src/app/features/work-packages/components/wp-single-view-tabs/watchers-tab/watchers-tab.component.ts
+++ b/frontend/src/app/features/work-packages/components/wp-single-view-tabs/watchers-tab/watchers-tab.component.ts
@@ -27,7 +27,12 @@
//++
import {
- ChangeDetectionStrategy, ChangeDetectorRef, Component, ElementRef, OnInit,
+ ChangeDetectionStrategy,
+ ChangeDetectorRef,
+ Component,
+ ElementRef,
+ Input,
+ OnInit,
} from '@angular/core';
import { Transition } from '@uirouter/core';
import { WorkPackageResource } from 'core-app/features/hal/resources/work-package-resource';
@@ -47,9 +52,9 @@ import { ApiV3Service } from 'core-app/core/apiv3/api-v3.service';
selector: 'wp-watchers-tab',
})
export class WorkPackageWatchersTabComponent extends UntilDestroyedMixin implements OnInit {
- public workPackageId:string;
+ @Input() public workPackage:WorkPackageResource;
- public workPackage:WorkPackageResource;
+ public workPackageId:string;
public trackByHref = trackByHref;
diff --git a/frontend/src/app/features/work-packages/components/wp-tabs/components/wp-tab-wrapper/wp-tab-wrapper.html b/frontend/src/app/features/work-packages/components/wp-tabs/components/wp-tab-wrapper/wp-tab-wrapper.html
index faf437a3be3..272692fd71a 100644
--- a/frontend/src/app/features/work-packages/components/wp-tabs/components/wp-tab-wrapper/wp-tab-wrapper.html
+++ b/frontend/src/app/features/work-packages/components/wp-tabs/components/wp-tab-wrapper/wp-tab-wrapper.html
@@ -1,7 +1,7 @@
<ng-container *ngIf="(ndcDynamicInputs$ | async) as ndcDynamicInputs">
<ndc-dynamic
*ngIf="ndcDynamicInputs.workPackage && ndcDynamicInputs.tab"
- [ndcDynamicComponent]="ndcDynamicInputs?.tab?.component"
- [ndcDynamicInputs]="ndcDynamicInputs">
+ [ndcDynamicComponent]="ndcDynamicInputs.tab.component"
+ [ndcDynamicInputs]="{ workPackage: ndcDynamicInputs.workPackage }">
</ndc-dynamic>
</ng-container>