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
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
When resizing or drag&drop is disabled, we make use of fullCalendars "constraints" so that these restrictions are visually mapped in the calendar (e.g by cursor changes etc). It still needs to be determined whether we really want that from a UI perspective (see the comment in the code).
Henriette Darge3362e3dd13a9
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.tsindex 9ed194a9e85..65dd64fbc62 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@@ -325,6 +325,7 @@ export class TeamPlannerComponent extends UntilDestroyedMixin implements OnInit,resourceId: assignee,durationEditable: this.eventDurationEditable(workPackage),resourceEditable: this.eventResourceEditable(workPackage),+ constraint: this.eventConstaints(workPackage),title: workPackage.subject,start: this.wpStartDate(workPackage),end: this.wpEndDate(workPackage),@@ -400,6 +401,26 @@ export class TeamPlannerComponent extends UntilDestroyedMixin implements OnInit,return (wp.isLeaf || wp.scheduleManually) && schemaEditable && !this.calendar.isMilestone(wp);}+ // Todo: Evaluate whether we really want to use that from a UI perspective ¯\_(ツ)_/¯+ // When users have the right to change the assignee but cannot change the date (due to hierarchy for example),+ // they are forced to drag the wp to the exact same date in the others assignee row. This might be confusing.+ // Without these constraints however, users can drag the WP everywhere, thinking that they changed the date as well.+ // The WP then moves back to the original date when the calendar re-draws again. Also not optimal..+ private eventConstaints(wp:WorkPackageResource):{ [key:string]:string|string[] } {+ const constraints:{ [key:string]:string|string[] } = {};++ if (!this.eventDurationEditable(wp)) {+ constraints.start = this.wpStartDate(wp);+ constraints.end = this.wpEndDate(wp);+ }++ if (!this.eventResourceEditable(wp)) {+ constraints.resourceIds = [this.wpAssignee(wp)];+ }++ return constraints;+ }+private wpStartDate(wp:WorkPackageResource):string {return this.calendar.eventDate(wp, 'start');}