Skip to content
Snippets Groups Projects
Commit 8213da34 authored by Nithya's avatar Nithya
Browse files
Station Reset Issue fixed
parent c809e587
No related branches found
No related tags found
1 merge request!271Sprint-15 Front End Merge
...@@ -38,9 +38,21 @@ export default (props) => { ...@@ -38,9 +38,21 @@ export default (props) => {
useEffect(() => { useEffect(() => {
if (props.stationGroup && props.stationGroup.length) { if (props.stationGroup && props.stationGroup.length) {
getAllStations(); getAllStations();
} else {
reset();
} }
}, [props.stationGroup]); }, [props.stationGroup]);
// Restting the stations
const reset = () => {
setStations([]);
setSelectedStations([]);
setStationOptions([]);
setCustomStations([]);
setCustomStationsOptions([]);
setmissing_StationFieldsErrors([]);
};
/** /**
* Fetches all stations * Fetches all stations
*/ */
......
...@@ -384,19 +384,24 @@ export class SchedulingUnitCreate extends Component { ...@@ -384,19 +384,24 @@ export class SchedulingUnitCreate extends Component {
name: '', name: '',
description: '', description: '',
project: this.props.match.params.project || null, project: this.props.match.params.project || null,
scheduling_constraints_template_id: this.constraintTemplates[0].id scheduling_constraints_template_id: this.constraintTemplates[0].id,
}, },
projectDisabled: (this.props.match.params.project? true:false), projectDisabled: (this.props.match.params.project? true:false),
observStrategy: {}, observStrategy: {},
selectedStations:{},
paramsOutput: null, paramsOutput: null,
validEditor: false, validEditor: false,
validFields: {}, validFields: {},
constraintSchema: null, constraintSchema: null,
touched:false selectedStations: null,
touched:false,
stationGroup: []
}, () => { }, () => {
this.constraintStrategy(this.constraintTemplates[0]); this.constraintStrategy(this.constraintTemplates[0]);
}); });
this.state.editorFunction(); this.state.editorFunction();
} }
onUpdateStations = (state, selectedStations, missing_StationFieldsErrors, customSelectedStations) => { onUpdateStations = (state, selectedStations, missing_StationFieldsErrors, customSelectedStations) => {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment