From 4b1ee385f51f6fe658f56e7a6b1a50a3262dcdd9 Mon Sep 17 00:00:00 2001
From: Reinder Kraaij <kraaij@astron.nl>
Date: Thu, 28 Dec 2023 22:50:51 +0100
Subject: [PATCH] remove wrong used vars and fragments

---
 .../tmss_webapp/src/components/DynamicScheduler.js   |  4 ++--
 .../tmss_webapp/src/components/JSONEditor/JEditor.js |  4 ++--
 .../frontend/tmss_webapp/src/routes/Cycle/edit.js    |  2 +-
 .../frontend/tmss_webapp/src/routes/Cycle/view.js    |  2 --
 .../frontend/tmss_webapp/src/routes/Project/list.js  |  4 ----
 .../frontend/tmss_webapp/src/routes/Project/view.js  |  6 ------
 .../routes/SystemEvent/existing.system.event.list.js |  4 ++--
 .../src/routes/SystemEvent/system.event.create.js    | 12 ++++--------
 8 files changed, 11 insertions(+), 27 deletions(-)

diff --git a/SAS/TMSS/frontend/tmss_webapp/src/components/DynamicScheduler.js b/SAS/TMSS/frontend/tmss_webapp/src/components/DynamicScheduler.js
index d27a81e9b3a..c443313b081 100644
--- a/SAS/TMSS/frontend/tmss_webapp/src/components/DynamicScheduler.js
+++ b/SAS/TMSS/frontend/tmss_webapp/src/components/DynamicScheduler.js
@@ -26,7 +26,7 @@ export default class DynamicScheduler extends Component {
     componentDidMount() {
         UtilService.getDynamicSchedulerStatus()
         .then(response => {
-            var status = false;
+            let status = false;
             if(response) {
                 status = response.value;
             }
@@ -35,7 +35,7 @@ export default class DynamicScheduler extends Component {
 
         UtilService.getFixedTimeSchedulerStatus()
         .then(response => {
-            var status = false;
+            let status = false;
             if(response) {
                 status = response.value;
             }
diff --git a/SAS/TMSS/frontend/tmss_webapp/src/components/JSONEditor/JEditor.js b/SAS/TMSS/frontend/tmss_webapp/src/components/JSONEditor/JEditor.js
index 8a907f8dcca..ced64426b80 100644
--- a/SAS/TMSS/frontend/tmss_webapp/src/components/JSONEditor/JEditor.js
+++ b/SAS/TMSS/frontend/tmss_webapp/src/components/JSONEditor/JEditor.js
@@ -1330,12 +1330,12 @@ function getFrequencyFromSubbandOutput(subbandArray,bandpassFilter) {
                     }
                     selectedStationsContent += '</div>';
                     // Remove existing child selected station label and div
-                    var stationListParentDiv = document.getElementsByName(path)[0].parentElement;
+                    let stationListParentDiv = document.getElementsByName(path)[0].parentElement;
                     while (stationListParentDiv.childElementCount > 2) {
                         stationListParentDiv.removeChild(stationListParentDiv.lastChild);
                     }
                     // Append new children to display selected stations
-                    var selectedStationsDiv = document.createElement('div');
+                    let selectedStationsDiv = document.createElement('div');
                     stationListParentDiv.appendChild(selectedStationsDiv);
                     selectedStationsDiv.outerHTML = selectedStationsContent;
                 }
diff --git a/SAS/TMSS/frontend/tmss_webapp/src/routes/Cycle/edit.js b/SAS/TMSS/frontend/tmss_webapp/src/routes/Cycle/edit.js
index 06889624e81..c8511e30dd7 100644
--- a/SAS/TMSS/frontend/tmss_webapp/src/routes/Cycle/edit.js
+++ b/SAS/TMSS/frontend/tmss_webapp/src/routes/Cycle/edit.js
@@ -300,7 +300,7 @@ export class CycleEdit extends Component {
         }
 
         if(this.state.cycle['start'] && this.state.cycle['stop']){
-            var isSameOrAfter = moment(this.state.cycle['stop']).isSameOrAfter(this.state.cycle['start']);
+            let isSameOrAfter = moment(this.state.cycle['stop']).isSameOrAfter(this.state.cycle['start']);
             if(!isSameOrAfter){
                 errors['stop'] = ` Stop date should be after Start date`;
                 validForm = false;
diff --git a/SAS/TMSS/frontend/tmss_webapp/src/routes/Cycle/view.js b/SAS/TMSS/frontend/tmss_webapp/src/routes/Cycle/view.js
index 4b61eb5ac8b..5f9974f2b68 100644
--- a/SAS/TMSS/frontend/tmss_webapp/src/routes/Cycle/view.js
+++ b/SAS/TMSS/frontend/tmss_webapp/src/routes/Cycle/view.js
@@ -103,7 +103,6 @@ export class CycleView extends Component {
                                          type: 'button',  actOn: 'click', props:{ callback: this.cancelView }}]}/>
                 { this.state.isLoading && <AppLoader /> }
                 { this.state.cycle &&
-                    <React.Fragment>
                         <div className="main-content">
                             <div className="p-grid">
                                 <label className="col-lg-2 col-md-2 col-sm-12">Name</label>
@@ -151,7 +150,6 @@ export class CycleView extends Component {
                             </div>
                             <ProjectList cycle={this.state.cycle.name}/>
                         </div>
-                    </React.Fragment>
                 }
                 </>: <AccessDenied/>}
             </React.Fragment>
diff --git a/SAS/TMSS/frontend/tmss_webapp/src/routes/Project/list.js b/SAS/TMSS/frontend/tmss_webapp/src/routes/Project/list.js
index 7ad7b80b0bd..245c29f3875 100644
--- a/SAS/TMSS/frontend/tmss_webapp/src/routes/Project/list.js
+++ b/SAS/TMSS/frontend/tmss_webapp/src/routes/Project/list.js
@@ -266,7 +266,6 @@ export class ProjectList extends Component {
             changedData.push(changedRow);
         }
         return (
-            <>
                 <div style={{ marginTop: '1em' }}>
                     <b>Do you want to change the status of selected Project(s)?</b>
                     <div style={{ marginTop: '1em' }}>                 
@@ -276,7 +275,6 @@ export class ProjectList extends Component {
                         </DataTable>                  
                     </div>
                 </div>
-            </>
         )
     }
 
@@ -290,7 +288,6 @@ export class ProjectList extends Component {
             changedData.push(row);
         }
         return (
-            <>
                 <div style={{ marginTop: '1em' }}>
                     <b></b>
                     <div style={{ marginTop: '1em' }}>                 
@@ -301,7 +298,6 @@ export class ProjectList extends Component {
                         </DataTable>                  
                     </div>
                 </div>
-            </>
         )
     }
 
diff --git a/SAS/TMSS/frontend/tmss_webapp/src/routes/Project/view.js b/SAS/TMSS/frontend/tmss_webapp/src/routes/Project/view.js
index a1bbfe3f34e..9ca514c5923 100644
--- a/SAS/TMSS/frontend/tmss_webapp/src/routes/Project/view.js
+++ b/SAS/TMSS/frontend/tmss_webapp/src/routes/Project/view.js
@@ -126,7 +126,6 @@ export class ProjectView extends Component {
         });
         
         return (
-            <>
                 <div style={{ marginTop: '1em' }}>
                     <b>Do you want to change the status of this project?</b>
                     <div style={{ marginTop: '1em' }}>                 
@@ -136,7 +135,6 @@ export class ProjectView extends Component {
                         </DataTable>                  
                     </div>
                 </div>
-            </>
         )
     }
 
@@ -150,7 +148,6 @@ export class ProjectView extends Component {
             changedData.push(row);
         }
         return (
-            <>
                 <div style={{ marginTop: '1em' }}>
                     <b></b>
                     <div style={{ marginTop: '1em' }}>                 
@@ -161,7 +158,6 @@ export class ProjectView extends Component {
                         </DataTable>                  
                     </div>
                 </div>
-            </>
         )
     }
 
@@ -278,7 +274,6 @@ export class ProjectView extends Component {
                                                 {icon:'fa-window-close',title: 'Click to Close Project View', type: 'button',  actOn: 'click', props:{ callback: this.cancelView }}]}/>
                         { this.state.isLoading && <AppLoader /> }
                         { this.state.project &&
-                            <React.Fragment>
                                 <div className="main-content">
                                     <div className="p-grid">
                                         <label className="col-lg-2 col-md-2 col-sm-12">Name</label>
@@ -363,7 +358,6 @@ export class ProjectView extends Component {
                                             allowRowSelection={true} ref={suList => {this.suList = suList}} />
                                     </div>
                                 </div>
-                            </React.Fragment>
                         }
                         {this.state.showStatusUpdateDialog &&
                             <div>
diff --git a/SAS/TMSS/frontend/tmss_webapp/src/routes/SystemEvent/existing.system.event.list.js b/SAS/TMSS/frontend/tmss_webapp/src/routes/SystemEvent/existing.system.event.list.js
index 608df1594f2..ef5309d977f 100644
--- a/SAS/TMSS/frontend/tmss_webapp/src/routes/SystemEvent/existing.system.event.list.js
+++ b/SAS/TMSS/frontend/tmss_webapp/src/routes/SystemEvent/existing.system.event.list.js
@@ -178,9 +178,9 @@ export class ExistingSystemEventList extends Component{
     async createSEFilterBySUBTime() {
         let filterQry = '';
         if (this.props.schedulingUnit.on_sky_stop_time) {
-            var startTime = new Date(this.props.schedulingUnit.on_sky_stop_time);
+            let  startTime = new Date(this.props.schedulingUnit.on_sky_stop_time);
             filterQry = 'start_before='+ moment(startTime).format("YYYY-MM-DDTHH:mm:ss")+".000Z&";
-            var stopTime = new Date(this.props.schedulingUnit.on_sky_start_time);
+            let stopTime = new Date(this.props.schedulingUnit.on_sky_start_time);
             stopTime.setDate(stopTime.getDate()-1);
             filterQry += 'stop_rangeornull_after='+ moment(stopTime).format("YYYY-MM-DDTHH:mm:ss")+".000Z";
         }
diff --git a/SAS/TMSS/frontend/tmss_webapp/src/routes/SystemEvent/system.event.create.js b/SAS/TMSS/frontend/tmss_webapp/src/routes/SystemEvent/system.event.create.js
index 1c8e5d55499..73e136f05fb 100644
--- a/SAS/TMSS/frontend/tmss_webapp/src/routes/SystemEvent/system.event.create.js
+++ b/SAS/TMSS/frontend/tmss_webapp/src/routes/SystemEvent/system.event.create.js
@@ -331,9 +331,9 @@ export class SystemEventCreate extends Component {
         }
 
         if (fieldName === 'duration' && this.tmpSystemevent && this.tmpSystemevent.duration) {
-            var values = this.tmpSystemevent.duration.split(' ');
-            var days = values[0];
-            var dValues = values[1].split(':');           
+            let values = this.tmpSystemevent.duration.split(' ');
+            let  days = values[0];
+            let  dValues = values[1].split(':');           
             delete errors['duration'];
             if ((days *1 )===0 && (dValues[0] * 1) === 0 && (dValues[1] * 1) === 0 && (dValues[2] * 1) === 0) {
                 validForm = false;
@@ -399,7 +399,7 @@ export class SystemEventCreate extends Component {
     setDurationOrEndValue = (key) => {
         if (key === 'start' || key === 'stop') {
             if (this.state.systemevent.start && this.state.systemevent.stop) {              
-                var delta = Math.abs(moment(this.state.systemevent.start) - moment(this.state.systemevent.stop)) / 1000;
+                let delta = Math.abs(moment(this.state.systemevent.start) - moment(this.state.systemevent.stop)) / 1000;
                 let tempDuration = UnitConverter.getSecsToDDHHmmss(delta);             
                 this.setDurationOrStopTime('duration', tempDuration);
             }   else if (key === 'start' && this.state.systemevent.start && this.state.systemevent.duration) {
@@ -709,7 +709,6 @@ export class SystemEventCreate extends Component {
                         }]} />
                 }
                 { this.state.isLoading ? <AppLoader /> :
-                    <>
                         <div className="addsystemevent" style={{width: this.props.systemevent?'100% !important':'auto'}}>
                             <div className="p-fluid" style={{marginTop: this.props.systemevent? '40px':'0px', marginBottom: "1em" }}>
                                 <div className="p-field p-grid">
@@ -927,16 +926,13 @@ export class SystemEventCreate extends Component {
                             </div>
 
                             {!this.props.systemevent &&
-                            <>
                             <div className="p-breadcrumb footer-long-div actions" >
                                 <FormActionbar createAnotherCallBack={this.setCreateAnother} createAnother={this.state.createAnother} 
                                 tooltip="Select checkbox to create another system event after saving this system event"
                                 onSubmit={this.saveSystemEvent} disableSaveBtn={!this.state.validEditor || !this.state.validForm} onCancel={this.checkIsDirty} />
                             </div>
-                            </>
                              }
                         </div>
-                    </>
                 }
 
                 {/* Dialog component to show messages and get input */}
-- 
GitLab