From 585ef0e9eeb756586e67b06d00d26d340e6e2360 Mon Sep 17 00:00:00 2001
From: Muthukrishnanmatriot
 <76949556+muthukrishnanmatriot@users.noreply.github.com>
Date: Mon, 10 Oct 2022 10:55:09 +0530
Subject: [PATCH] TMSS-1932 - updated code for task type bg color

---
 .../src/layout/sass/_timeline.scss            | 19 +++++++++++++++++++
 .../routes/Scheduling/ViewSchedulingUnit.js   |  8 +++++++-
 .../tmss_webapp/src/routes/Task/list.js       |  8 +++++++-
 .../src/shared/timeline.constants.js          |  6 ++++--
 4 files changed, 37 insertions(+), 4 deletions(-)

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 47b27c13dcc..8a56db2bd26 100644
--- a/SAS/TMSS/frontend/tmss_webapp/src/layout/sass/_timeline.scss
+++ b/SAS/TMSS/frontend/tmss_webapp/src/layout/sass/_timeline.scss
@@ -387,6 +387,25 @@
     color: white !important;
 }
 
+.task-observation {
+    background-color: #90EE90 !important;
+    color: white !important;
+}
+
+.task-pipeline {
+    background-color: #FED8B1 !important;
+    color: white !important;
+}
+
+.task-ingest {
+    background-color: #728FCE !important;
+    color: white !important;
+}
+
+.task-cleanup {
+    background-color: #FFCCCB !important;
+    color: white !important;
+}
 .su-error-icon,.su-scheduled-icon,.su-observed-icon,.su-unschedulable-icon {
     color: white !important;
 }
diff --git a/SAS/TMSS/frontend/tmss_webapp/src/routes/Scheduling/ViewSchedulingUnit.js b/SAS/TMSS/frontend/tmss_webapp/src/routes/Scheduling/ViewSchedulingUnit.js
index 7cfa0c575fb..5c8cfc61658 100644
--- a/SAS/TMSS/frontend/tmss_webapp/src/routes/Scheduling/ViewSchedulingUnit.js
+++ b/SAS/TMSS/frontend/tmss_webapp/src/routes/Scheduling/ViewSchedulingUnit.js
@@ -95,6 +95,7 @@ class ViewSchedulingUnit extends Component {
                 "ID",
                 "Control ID",
                 "Name",
+                "Task Type",
                 "Description",
                 "Short Description",
                 "Observation Start Time",
@@ -176,6 +177,11 @@ class ViewSchedulingUnit extends Component {
                 },
             }],
             optionalcolumns: [{
+                task_type: {
+                    name: "Task Type",
+                    showTag: true,
+                    tagClass: 'task-$dynamic$' //$dynamic$ will be replace with cell value
+                },
                 size: "Data size",
                 dataSizeOnDisk: "Data size on Disk",
                 subtaskContent: "Subtask Content",
@@ -744,7 +750,7 @@ class ViewSchedulingUnit extends Component {
         this.setState({taskDraftPermission : taskPermission[schedulingUnit.task_drafts[0].id]});
         let scheduletasklist = [];
         // Common keys for Task and Blueprint
-        let commonkeys = ['id', 'created_at', 'description', 'short_description' , 'name', 'tags', 'updated_at', 'url', 'do_cancel', 'relative_start_time', 'relative_stop_time', 'on_sky_start_time', 'on_sky_stop_time', 'process_start_time', 'process_stop_time', 'duration', 'status', 'obsolete'];
+        let commonkeys = ['id', 'created_at', 'description', 'short_description' , 'name', 'tags', 'updated_at', 'url', 'do_cancel', 'relative_start_time', 'relative_stop_time', 'on_sky_start_time', 'on_sky_stop_time', 'process_start_time', 'process_stop_time', 'duration', 'status', 'obsolete', 'task_type'];
         for (const task of schedulingUnit.task_drafts) {
             let scheduletask = {};
             scheduletask['tasktype'] = 'Draft';
diff --git a/SAS/TMSS/frontend/tmss_webapp/src/routes/Task/list.js b/SAS/TMSS/frontend/tmss_webapp/src/routes/Task/list.js
index ba08b16505e..2f999981ba0 100644
--- a/SAS/TMSS/frontend/tmss_webapp/src/routes/Task/list.js
+++ b/SAS/TMSS/frontend/tmss_webapp/src/routes/Task/list.js
@@ -66,6 +66,7 @@ export class TaskList extends Component {
                 "ID",
                 "Control ID",
                 "Name",
+                "Task Type",
                 "Description",
                 "Short Description",
                 "Observation Start Time",
@@ -177,6 +178,11 @@ export class TaskList extends Component {
                 },
             }],
             optionalcolumns: [{
+                task_type: {
+                    name: "Task Type",
+                    showTag: true,
+                    tagClass: 'task-$dynamic$' //$dynamic$ will be replace with cell value
+                },
                 size: {
                     name:"Data size [TB]"
                 },
@@ -345,7 +351,7 @@ export class TaskList extends Component {
 
     getFormattedTaskDraft(task) {
         // Common keys for Task and Blueprint
-        let commonkeys = ['id', 'created_at', 'description', 'short_description' , 'name', 'tags', 'updated_at', 'url', 'do_cancel', 'relative_start_time', 'relative_stop_time', 'on_sky_start_time', 'on_sky_stop_time', 'process_start_time', 'process_stop_time', 'duration', 'status',"obsolete"];
+        let commonkeys = ['id', 'created_at', 'description', 'short_description' , 'name', 'tags', 'updated_at', 'url', 'do_cancel', 'relative_start_time', 'relative_stop_time', 'on_sky_start_time', 'on_sky_stop_time', 'process_start_time', 'process_stop_time', 'duration', 'status','obsolete', 'task_type'];
         let scheduletask = {};
         scheduletask['tasktype'] = 'Draft';
         scheduletask['actionpath'] = '/task/view/draft/' + task['id'];
diff --git a/SAS/TMSS/frontend/tmss_webapp/src/shared/timeline.constants.js b/SAS/TMSS/frontend/tmss_webapp/src/shared/timeline.constants.js
index d1f3767b490..ff210134eb4 100644
--- a/SAS/TMSS/frontend/tmss_webapp/src/shared/timeline.constants.js
+++ b/SAS/TMSS/frontend/tmss_webapp/src/shared/timeline.constants.js
@@ -149,7 +149,9 @@ const TimelineConstants = {
             name: "Cancelled"
         },
         task_type: {
-            name: "Type"
+            name: "Task Type",
+            showTag: true,
+            tagClass: 'task-$dynamic$' //$dynamic$ will be replace with cell value
         },
         start_time: {
             name: "Start Time",
@@ -216,7 +218,7 @@ const TimelineConstants = {
         "Status",
         "Unschedulable Reason",
         "Cancelled",
-        "Type",
+        "Task Type",
         "Start Time",
         "End Time",
         "Duration (HH:mm:ss)",
-- 
GitLab