From 15cbe0263d589369bd18534c48c8965a9dd883af Mon Sep 17 00:00:00 2001
From: Ramesh Kumar <ramesh.p@matriotsolutions.com>
Date: Wed, 3 Mar 2021 18:14:32 +0530
Subject: [PATCH] TMSS-633: Max Number missing value set to 0 for default
 station groups, if not set.

---
 .../frontend/tmss_webapp/src/routes/Scheduling/Stations.js    | 4 ++--
 .../src/routes/Scheduling/excelview.schedulingset.js          | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/SAS/TMSS/frontend/tmss_webapp/src/routes/Scheduling/Stations.js b/SAS/TMSS/frontend/tmss_webapp/src/routes/Scheduling/Stations.js
index e9b02b411bf..2842a5e2d60 100644
--- a/SAS/TMSS/frontend/tmss_webapp/src/routes/Scheduling/Stations.js
+++ b/SAS/TMSS/frontend/tmss_webapp/src/routes/Scheduling/Stations.js
@@ -94,7 +94,7 @@ export default (props) => {
                 ...stationState,
                 [StationName]: {
                     stations: response.stations,
-                    missing_StationFields: missing_StationFields ? isNaN(missing_StationFields.max_nr_missing)? 0: missing_StationFields.max_nr_missing : ''
+                    missing_StationFields: missing_StationFields ? isNaN(missing_StationFields.max_nr_missing)? 0: missing_StationFields.max_nr_missing : '0'
                 },
                 Custom: {
                     stations: [...stationState['Custom'].stations, ...response.stations], 
@@ -272,7 +272,7 @@ export default (props) => {
                                                 className={(state[i] && state[i].error) ?'input-error':''}
                                                 tooltip="Max No. of Missing Stations" tooltipOptions={tooltipOptions} maxLength="128"
                                                 placeholder="Max No. of Missing Stations"
-                                                value={state[i] ? state[i].missing_StationFields : ''}
+                                                value={state[i] ? (state[i].missing_StationFields || 0) : '0'}
                                                 disabled={props.view}
                                                 onChange={(e) => setNoOfmissing_StationFields(i, e.target.value)}/>
                                             {(state[i] && state[i].error) && <span className="error-message">{state[i].missing_StationFields ? `Max. no of missing stations is ${state[i] ? state[i].stations.length : 0}` : 'Max. no of missing stations required'}</span>}
diff --git a/SAS/TMSS/frontend/tmss_webapp/src/routes/Scheduling/excelview.schedulingset.js b/SAS/TMSS/frontend/tmss_webapp/src/routes/Scheduling/excelview.schedulingset.js
index 9aeff323993..89e23b256b5 100644
--- a/SAS/TMSS/frontend/tmss_webapp/src/routes/Scheduling/excelview.schedulingset.js
+++ b/SAS/TMSS/frontend/tmss_webapp/src/routes/Scheduling/excelview.schedulingset.js
@@ -701,7 +701,7 @@ export class SchedulingSetCreate extends Component {
         if(this.state.defaultStationGroups){
             let stationValue = '';
             this.state.defaultStationGroups.map(stationGroup =>{
-                stationValue += stationGroup.stations+':'+stationGroup.max_nr_missing+"|";
+                stationValue += stationGroup.stations+':'+ (stationGroup.max_nr_missing || 0)+"|";
             })
             defaultCellValues['stations'] = stationValue;
         }
-- 
GitLab