From b5fe306b5c6afb93bada62c3f9680782c334bc8a Mon Sep 17 00:00:00 2001
From: Reinder Kraaij <kraaij@astron.nl>
Date: Tue, 14 Nov 2023 21:36:00 +0100
Subject: [PATCH] cleaning

---
 .../Timeline/helpers/toolbar/filters.helper.js  | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/helpers/toolbar/filters.helper.js b/SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/helpers/toolbar/filters.helper.js
index 6f5026f64f4..ca328828242 100644
--- a/SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/helpers/toolbar/filters.helper.js
+++ b/SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/helpers/toolbar/filters.helper.js
@@ -21,9 +21,9 @@ function splitElementPerDay(element, spanInDays, shouldShowOnSkyTimes) {
     const newElements = []
     for (let day = 0; day <= spanInDays; day++) {
         let newElement = { ...element }
+        
         const startTime = (shouldShowOnSkyTimes ? (element.on_sky_start_time ?? element.process_start_time) : element.process_start_time) ?? element.start_time
-        const endTime = (shouldShowOnSkyTimes ? (element.on_sky_stop_time ?? element.process_stop_time) : element.process_stop_time) ?? element.stop_time
-
+        const endTime = (shouldShowOnSkyTimes ? (element.on_sky_stop_time ?? element.process_stop_time) : element.process_stop_time) ?? element.stop_time        
         const { formattedStart, formattedEnd } = determineNewStartAndEnd(startTime, day, spanInDays, endTime);
 
         if (shouldShowOnSkyTimes) {
@@ -159,7 +159,6 @@ export function getTimelineItem(suBlueprint, displayDate, includeStationsInfo, i
         priority_queue: suBlueprint.priority_queue,
         priority_queue_group: suBlueprint.priority_queue + '#' + currentGrouping,
         unschedulable_reason: suBlueprint.unschedulable_reason,
-        
         id: `${suBlueprint.id}-${currentGroup}`,
         title: "",
         group: currentGroup,
@@ -218,18 +217,17 @@ export function getReservationItem(reservation, index, displayDate) {
     const startTime = moment(displayDate + ` ${moment(reservation.start_time).format('HH:mm:ss')}`);
     const endTime = moment(displayDate + ` ${moment(reservation.stop_time).format('HH:mm:ss')}`);
     const type = specificationsDoc?.activity?.type;
-    const group = moment(reservation.start_time).format(UIConstants.CALENDAR_GROUP_FORMAT);
     const blockColor = getReservationTypeColorIndex(specificationsDoc?.schedulability);
     const duration = reservation.duration ? UnitConverter.getSecsToHHmmss(reservation.duration) : "Unknown";
-    const stations = getStationsInfo(specificationsDoc?.resources?.specified_stations);
-
-
+    const stations = getStationsInfo(specificationsDoc?.resources?.stations);
+    const currentGroup = moment(reservation.start_time).format(UIConstants.CALENDAR_GROUP_FORMAT)
+    const currentGrouping = moment(reservation.start_time).format(UIConstants.CALENDAR_DEFAULTDATE_FORMAT)
     let timeLineRow = {
         id: reservation.id + "~" + index,
         reservationId: reservation.id,
         start_time: startTime,
         end_time: endTime,
-        group: group,
+        group: currentGroup,
         name: reservation.name,
         project: reservation.project_id,
 
@@ -248,9 +246,10 @@ export function getReservationItem(reservation, index, displayDate) {
         selectedBgColor: blockColor.bgColor,
         color: blockColor.color
     };
-    const currentGrouping = moment(timeLineRow.start_time).format(UIConstants.CALENDAR_DEFAULTDATE_FORMAT)
+    timeLineRow.specified_stations = reservation.stations;
     timeLineRow.name_group = timeLineRow.name + '#' + currentGrouping
     timeLineRow.project_group = timeLineRow.project + '#' + currentGrouping
+    timeLineRow.project_task_group = timeLineRow.project + '#' + currentGrouping ; // we do not have tasks, but we need to be visible.
     
 
 
-- 
GitLab