From 3eeebbc83be064e65138ee6f777e1eaf0e2b5931 Mon Sep 17 00:00:00 2001 From: Francis Lachapelle Date: Fri, 19 Aug 2022 10:07:14 -0400 Subject: [PATCH] fix(calendar(js)): destination calendars of new components Fixes #5581 --- UI/WebServerResources/js/Scheduler/ComponentController.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/UI/WebServerResources/js/Scheduler/ComponentController.js b/UI/WebServerResources/js/Scheduler/ComponentController.js index 5da26e917..caded216d 100644 --- a/UI/WebServerResources/js/Scheduler/ComponentController.js +++ b/UI/WebServerResources/js/Scheduler/ComponentController.js @@ -279,9 +279,14 @@ }; this.destinationCalendars = function () { - if (this.component.isErasable) + if (this.component.isNew) + // New component, return all writable calendars + return Calendar.$findAll(null, true); + else if (this.component.isErasable) + // Movable component, return all writable calendars including current one return Calendar.$findAll(null, true, this.component.pid); else + // Component can't be moved return [Calendar.$get(this.component.pid)]; };