From 36136617604da1cefa94fceefd39657e663721f6 Mon Sep 17 00:00:00 2001
From: Fanna Lautenbach <lautenbach@astron.nl>
Date: Tue, 15 Aug 2023 19:59:13 +0200
Subject: [PATCH] add group renderer to show styled week + add week to ui
 constant group

---
 .../tmss_webapp/src/layout/sass/_timeline.scss         |  6 ++++++
 .../routes/Timeline/helpers/timeline.item.helper.js    | 10 ++++++++++
 .../frontend/tmss_webapp/src/utils/ui.constants.js     |  2 +-
 3 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/SAS/TMSS/frontend/tmss_webapp/src/layout/sass/_timeline.scss b/SAS/TMSS/frontend/tmss_webapp/src/layout/sass/_timeline.scss
index 037a8012ff3..9a74629a14c 100644
--- a/SAS/TMSS/frontend/tmss_webapp/src/layout/sass/_timeline.scss
+++ b/SAS/TMSS/frontend/tmss_webapp/src/layout/sass/_timeline.scss
@@ -628,6 +628,12 @@
   }
 }
 
+.group-render-week {
+  color: var(--bluegray-500);
+  font-size: 13px;
+  margin-right: 1rem;
+}
+
 .p-multiselect-header .p-multiselect-close {
   position: absolute;
   margin-left: -45px;
diff --git a/SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/helpers/timeline.item.helper.js b/SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/helpers/timeline.item.helper.js
index 35a9d7d3c8e..220ddb6f202 100644
--- a/SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/helpers/timeline.item.helper.js
+++ b/SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/helpers/timeline.item.helper.js
@@ -137,6 +137,16 @@ export function itemRenderer({item, timelineContext, itemContext, getItemProps,
     }
 }
 
+export function groupRenderer({group}) {
+    const titleSplitOnWeek = group.title.split(":");
+    const week = titleSplitOnWeek[0]
+    const date = titleSplitOnWeek[1]
+    return <div>
+        <span className="group-render-week">{week}</span>
+        {date}
+    </div>;
+}
+
 function retrieveAntennaSetFromObservationTasks(suBlueprint) {
     // if (!suBlueprint.task_blueprints) //TODO: add test
     let antennaSet = "";
diff --git a/SAS/TMSS/frontend/tmss_webapp/src/utils/ui.constants.js b/SAS/TMSS/frontend/tmss_webapp/src/utils/ui.constants.js
index 5c223425ced..2eb6d742a0e 100644
--- a/SAS/TMSS/frontend/tmss_webapp/src/utils/ui.constants.js
+++ b/SAS/TMSS/frontend/tmss_webapp/src/utils/ui.constants.js
@@ -53,7 +53,7 @@ const UIConstants = {
     CALENDAR_DEFAULTDATE_FORMAT: 'YYYY-MM-DD',
     UTC_DATE_TIME_FORMAT: "YYYY-MM-DDTHH:mm:ss",
     UTC_DATE_TIME_MS_FORMAT: "YYYY-MM-DDTHH:mm:ss.SSSSS",
-    CALENDAR_GROUP_FORMAT: "MMM DD  - ddd",
+    CALENDAR_GROUP_FORMAT: "w: MMM DD - ddd",
     FILTER_MAP: {
         'AutoField': '',
         'CharFilter': '',
-- 
GitLab