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

[41119] Correctly block parents in team planner

Oliver Günther4785387bf61c
diff --git a/frontend/src/app/features/team-planner/team-planner/calendar-drag-drop.service.ts b/frontend/src/app/features/team-planner/team-planner/calendar-drag-drop.service.ts
index 98ede1dd67e..623b002b374 100644
--- a/frontend/src/app/features/team-planner/team-planner/calendar-drag-drop.service.ts
+++ b/frontend/src/app/features/team-planner/team-planner/calendar-drag-drop.service.ts
@@ -10,6 +10,7 @@ import { BehaviorSubject } from 'rxjs';
import { SchemaCacheService } from 'core-app/core/schemas/schema-cache.service';
import { AuthorisationService } from 'core-app/core/model-auth/model-auth.service';
import { I18nService } from 'core-app/core/i18n/i18n.service';
+import { OpCalendarService } from 'core-app/features/calendar/op-calendar.service';
@Injectable()
export class CalendarDragDropService {
@@ -27,6 +28,7 @@ export class CalendarDragDropService {
constructor(
readonly authorisation:AuthorisationService,
readonly schemaCache:SchemaCacheService,
+ readonly calendarService:OpCalendarService,
readonly I18n:I18nService,
) {
}
@@ -89,10 +91,7 @@ export class CalendarDragDropService {
return { disabled: true, reason: this.text.draggingDisabled.permissionDenied };
}
- const schema = this.schemaCache.of(workPackage);
- const schemaEditable = schema.isAttributeEditable('startDate') && schema.isAttributeEditable('dueDate');
-
- if (!schemaEditable) {
+ if (!this.calendarService.dateEditable(workPackage)) {
return { disabled: true, reason: this.text.draggingDisabled.fallback };
}
diff --git a/frontend/src/app/features/team-planner/team-planner/page/team-planner-page.component.ts b/frontend/src/app/features/team-planner/team-planner/page/team-planner-page.component.ts
index a861262a768..60ea610c42a 100644
--- a/frontend/src/app/features/team-planner/team-planner/page/team-planner-page.component.ts
+++ b/frontend/src/app/features/team-planner/team-planner/page/team-planner-page.component.ts
@@ -24,6 +24,7 @@ import {
import { teamPlannerEventAdded } from 'core-app/features/team-planner/team-planner/planner/team-planner.actions';
import { InjectField } from 'core-app/shared/helpers/angular/inject-field.decorator';
import { ActionsService } from 'core-app/core/state/actions/actions.service';
+import { OpCalendarService } from 'core-app/features/calendar/op-calendar.service';
@EffectHandler
@Component({
@@ -34,6 +35,7 @@ import { ActionsService } from 'core-app/core/state/actions/actions.service';
changeDetection: ChangeDetectionStrategy.OnPush,
providers: [
QueryParamListenerService,
+ OpCalendarService,
CalendarDragDropService,
],
})
diff --git a/frontend/src/app/features/team-planner/team-planner/planner/team-planner.component.ts b/frontend/src/app/features/team-planner/team-planner/planner/team-planner.component.ts
index fb22ec840e4..e48ba7c2dae 100644
--- a/frontend/src/app/features/team-planner/team-planner/planner/team-planner.component.ts
+++ b/frontend/src/app/features/team-planner/team-planner/planner/team-planner.component.ts
@@ -90,7 +90,6 @@ import { LoadingIndicatorService } from 'core-app/core/loading-indicator/loading
changeDetection: ChangeDetectionStrategy.OnPush,
providers: [
EventViewLookupService,
- OpCalendarService,
],
})
export class TeamPlannerComponent extends UntilDestroyedMixin implements OnInit, OnDestroy {