Skip to content
Snippets Groups Projects
Commit 34aa2524 authored by Ramesh Kumar's avatar Ramesh Kumar
Browse files

Merge branch 'TMSS-378' into TMSS-402

parents ec07212f db06e7fb
No related branches found
No related tags found
1 merge request!271Sprint-15 Front End Merge
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
height: 50px; height: 50px;
padding: .7em 1.5em 0em 1.5em; padding: .7em 1.5em 0em 1.5em;
color: #ffffff; color: #ffffff;
z-index: 999; z-index: 2000;
right: 0; right: 0;
@include clearfix(); @include clearfix();
@include linear-gradient-left($topbarLeftBgColor,$topbarRightBgColor); @include linear-gradient-left($topbarLeftBgColor,$topbarRightBgColor);
......
...@@ -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) => {
...@@ -517,8 +522,8 @@ export class SchedulingUnitCreate extends Component { ...@@ -517,8 +522,8 @@ export class SchedulingUnitCreate extends Component {
</div> </div>
</div> </div>
<Stations <Stations
stationGroup={this.state.stationGroup} stationGroup={this.state.stationGroup}
onUpdateStations={this.onUpdateStations.bind(this)} onUpdateStations={this.onUpdateStations.bind(this)}
/> />
</div> </div>
{this.state.constraintSchema && <div className="p-fluid"> {this.state.constraintSchema && <div className="p-fluid">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment