diff --git a/ui/src/containers/BeamlineActionsContainer.jsx b/ui/src/containers/BeamlineActionsContainer.jsx index 7b1174f8f..6b08ee6f8 100644 --- a/ui/src/containers/BeamlineActionsContainer.jsx +++ b/ui/src/containers/BeamlineActionsContainer.jsx @@ -1,18 +1,14 @@ import React from 'react'; import { connect } from 'react-redux'; import { bindActionCreators } from 'redux'; -import { startAction, +import { + startAction, stopAction, showActionOutput, hideActionOutput, - setArgumentValue } from '../actions/beamlineActions'; -import { Row, - Col, - Modal, - Dropdown, - Button, - Form, - Card} from 'react-bootstrap'; + setArgumentValue, +} from '../actions/beamlineActions'; +import { Row, Col, Modal, Dropdown, Button, Form, Card } from 'react-bootstrap'; import BeamlineActionControl from '../components/BeamlineActions/BeamlineActionControl'; import Plot1D from '../components/Plot1D'; import { RUNNING } from '../constants'; @@ -76,109 +72,137 @@ class BeamlineActionsContainer extends React.Component { const defaultDialogPosition = { x: -100, y: 100 }; return ( - - - - - Beamline Actions - - - {this.props.actionsList.map((cmd, i) => { - const cmdName = cmd.name; - const cmdUsername = cmd.username; - const cmdState = cmd.state; - let disabled = false; - if (currentActionRunning && (currentActionName !== cmdName)) { - disabled = true; - } - - return ( - -
-
{cmdUsername}
-
- -
- ); - })} -
-
- - + + + Beamline Actions + + + {this.props.actionsList.map((cmd, i) => { + const cmdName = cmd.name; + const cmdUsername = cmd.username; + const cmdState = cmd.state; + let disabled = false; + if (currentActionRunning && currentActionName !== cmdName) { + disabled = true; + } + + return ( + +
+
{cmdUsername}
+
+ +
+ ); + })} +
+
+ - - {this.props.currentAction.username} - - - - - { this.props.currentAction.arguments.map((arg, i) => + {this.props.currentAction.username} + + + + {this.props.currentAction.arguments.map((arg, i) => ( <> - {arg.name} - - { - this.props.setArgumentValue(currentActionName, - i, - e.target.value); - }} - /> - - - ) - } - - { currentActionRunning ? - : - } + + {arg.name} - -
- - { this.props.currentAction.messages.length > 0 ? ( - {this.props.currentAction.messages.map(message =>

{message.message}

)} -
) : '' } + + { + this.props.setArgumentValue( + currentActionName, + i, + e.target.value + ); + }} + /> + + + ))} + + {currentActionRunning ? ( + + ) : ( + + )} + +
+
+ + {this.props.currentAction.messages.length > 0 ? ( + + {this.props.currentAction.messages.map((message) => ( +

{message.message}

+ ))} +
+ ) : ( + '' + )}
-
+ ); } } function mapStateToProps(state) { return { - currentAction: state.beamline.currentBeamlineAction + currentAction: state.beamline.currentBeamlineAction, }; } @@ -203,7 +227,7 @@ function mapDispatchToProps(dispatch) { stopAction: bindActionCreators(stopAction, dispatch), showOutput: bindActionCreators(showActionOutput, dispatch), hideOutput: bindActionCreators(hideActionOutput, dispatch), - setArgumentValue: bindActionCreators(setArgumentValue, dispatch) + setArgumentValue: bindActionCreators(setArgumentValue, dispatch), }; } @@ -211,4 +235,3 @@ export default connect( mapStateToProps, mapDispatchToProps )(BeamlineActionsContainer); - diff --git a/ui/src/containers/BeamlineSetupContainer.jsx b/ui/src/containers/BeamlineSetupContainer.jsx index 7ceda9e35..cbbe199a5 100644 --- a/ui/src/containers/BeamlineSetupContainer.jsx +++ b/ui/src/containers/BeamlineSetupContainer.jsx @@ -17,7 +17,7 @@ import { find, filter } from 'lodash'; import { sendGetAllhardwareObjects, sendSetAttribute, - sendAbortCurrentAction + sendAbortCurrentAction, } from '../actions/beamline'; import { sendCommand } from '../actions/sampleChanger'; @@ -53,13 +53,14 @@ class BeamlineSetupContainer extends React.Component { const step = this.props.sampleview.motorSteps.beamstop_distance; if (motor !== undefined && motor.state !== 0) { - motorInputList.push(( + motorInputList.push(

Beamstop distance:

- )); + ); } if (motorInputList.length > 0) { - popover = ({motorInputList}); + popover = {motorInputList}; } return popover; } - createActuatorComponent() { const acts = []; @@ -95,8 +95,12 @@ class BeamlineSetupContainer extends React.Component { acts.push( - {uiprop.label}: - ); + + {uiprop.label}: + + ); components.push( - { beamline_attribute.readonly ? - ( + {beamline_attribute.readonly ? ( + ) - : - ( + ) : ( + ) - } + data={beamline_attribute} + onSave={this.setAttribute} + onCancel={this.onCancelHandler} + /> + )} ); } @@ -185,49 +200,47 @@ class BeamlineSetupContainer extends React.Component { return null; } - const uiprops = this.props.uiproperties.beamline_setup.components; - const uiprop_list = filter(uiprops, (o) => - o.value_type === 'MOTOR' || o.value_type === 'ACTUATOR' + const uiprop_list = filter( + uiprops, + (o) => o.value_type === 'MOTOR' || o.value_type === 'ACTUATOR' ); return ( - +