Allow Milestones to be moved to the drop zone as their date can be changed although their duration can't

pull/10376/head
Henriette Darge 3 years ago committed by Oliver Günther
parent 4d893587dd
commit 33b98588a8
  1. 8
      frontend/src/app/features/calendar/op-calendar.service.ts
  2. 10
      frontend/src/app/features/team-planner/team-planner/planner/team-planner.component.html
  3. 10
      frontend/src/app/features/team-planner/team-planner/planner/team-planner.component.ts

@ -243,10 +243,14 @@ export class OpCalendarService extends UntilDestroyedMixin {
return this.urlParams.cview as string|undefined;
}
public eventDurationEditable(wp:WorkPackageResource):boolean {
dateEditable(wp:WorkPackageResource):boolean {
const schema = this.schemaCache.of(wp);
const schemaEditable = schema.isAttributeEditable('startDate') && schema.isAttributeEditable('dueDate');
return (wp.isLeaf || wp.scheduleManually) && schemaEditable && !this.isMilestone(wp);
return (wp.isLeaf || wp.scheduleManually) && schemaEditable;
}
eventDurationEditable(wp:WorkPackageResource):boolean {
return this.dateEditable(wp) && !this.isMilestone(wp);
}
/**

@ -138,11 +138,11 @@
[class.op-team-planner--remove-dropzone_active]="dropzone.isHovering && dropzone.canDrop"
[class.op-team-planner--remove-dropzone_forbidden]="!dropzone.canDrop"
>
<span
*ngIf="dropzone.canDrop"
class="op-team-planner--dropzone-label"
[textContent]="text.drag_here_to_remove"
></span>
<span
*ngIf="dropzone.canDrop"
class="op-team-planner--dropzone-label"
[textContent]="text.drag_here_to_remove"
></span>
<span
*ngIf="!dropzone.canDrop"
class="op-team-planner--dropzone-label"

@ -122,13 +122,17 @@ export class TeamPlannerComponent extends UntilDestroyedMixin implements OnInit,
filter((dragging) => !!dragging),
map((dragging) => {
const workPackage = (dragging as EventDragStartArg).event.extendedProps.workPackage as WorkPackageResource;
const durationEditable = this.calendar.eventDurationEditable(workPackage);
const dateEditable = this.calendar.dateEditable(workPackage);
const resourceEditable = this.eventResourceEditable(workPackage);
return durationEditable && resourceEditable;
return dateEditable && resourceEditable;
}),
);
dropzone$ = combineLatest([this.draggingItem$, this.dropzoneHovered$, this.dropzoneAllowed$])
dropzone$ = combineLatest([
this.draggingItem$,
this.dropzoneHovered$,
this.dropzoneAllowed$,
])
.pipe(
map(([dragging, isHovering, canDrop]) => ({ dragging, isHovering, canDrop })),
);

Loading…
Cancel
Save