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

Remove external events now that events are reloaded

Oliver Günther189c7cddf1b7
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 f83ef188977..cb479f047d6 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
@@ -18,7 +18,6 @@ import {
import {
BehaviorSubject,
combineLatest,
- from,
Subject,
} from 'rxjs';
import {
@@ -362,9 +361,7 @@ export class TeamPlannerComponent extends UntilDestroyedMixin implements OnInit,
// DnD configuration
editable: true,
droppable: true,
- eventResize: (resizeInfo:EventResizeDoneArg) => {
- const updater = from(this.updateEvent(resizeInfo));
- },
+ eventResize: (resizeInfo:EventResizeDoneArg) => this.updateEvent(resizeInfo),
eventDragStart: (dragInfo:EventDragStartArg) => {
const { el } = dragInfo;
el.style.pointerEvents = 'none';
@@ -408,6 +405,8 @@ export class TeamPlannerComponent extends UntilDestroyedMixin implements OnInit,
this.viewLookup.destroyDetached();
+ this.removeExternalEvents();
+
successCallback(events);
},
failureCallback,
@@ -687,4 +686,16 @@ export class TeamPlannerComponent extends UntilDestroyedMixin implements OnInit,
this.showAddExistingPane.next(!this.showAddExistingPane.getValue());
(this.addExistingToggle.nativeElement as HTMLElement).blur();
}
+
+ private removeExternalEvents():void {
+ this
+ .ucCalendar
+ .getApi()
+ .getEvents()
+ .forEach((evt) => {
+ if (evt.id.includes('external')) {
+ evt.remove();
+ }
+ });
+ }
}