Merge branch 'dev' of https://lab.si.usi.ch/sa4-2020/the-sanmarinoes/frontend into frontend-userstory1-fil

This commit is contained in:
britea 2020-05-25 15:57:45 +02:00
commit 8cdd66f6d4

View file

@ -85,7 +85,7 @@ const CreateTrigger = (props) => {
const onChange = (e, val) => { const onChange = (e, val) => {
props.inputChange(val); props.inputChange(val);
setActiveOperand(hasOperand.has(props.devices[val.value].kind)); setActiveOperand(hasOperand.has(props.devices[val.value].kind));
setActiveThermostat(props.devices[val.value].kind === 'thermostat'); setActiveThermostat(props.devices[val.value].kind === 'thermostat' && props.condition);
if (operandsRef.current) operandsRef.current.setValue(''); if (operandsRef.current) operandsRef.current.setValue('');
if (valuesRef.current) valuesRef.current.inputRef.current.valueAsNumber = undefined; if (valuesRef.current) valuesRef.current.inputRef.current.valueAsNumber = undefined;
}; };
@ -773,6 +773,7 @@ class AutomationSaveModal extends Component {
); );
})} })}
<CreateTrigger <CreateTrigger
condition
devices={this.props.devices} devices={this.props.devices}
inputChange={this.onInputChangeCondition} inputChange={this.onInputChangeCondition}
/> />