Skip to content

Commit

Permalink
Removed somewhat odd visibility fix
Browse files Browse the repository at this point in the history
  • Loading branch information
marcus-oscarsson committed Oct 16, 2023
1 parent 3e5ca93 commit 811e35f
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 65 deletions.
122 changes: 59 additions & 63 deletions ui/src/components/BeamlineActions/AnnotatedBeamlineActionDialog.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,67 +48,63 @@ export default function AnnotatedBeamlineActionDialog(props) {
</Button>
);
}

if (isDialogVisble) {
return (
<DraggableModal
id="beamlineActionOutput"
show={isDialogVisble}
onHide={handleOnHide}
defaultpos={defaultPosition}
>
<Modal.Header>
<Modal.Title>{actionName}</Modal.Title>
</Modal.Header>
<Modal.Body>
<Row className="py-2">
<Col className="col-md-4">
<div className={style.json_schema_form_container_with_submit}>
<JSForm
liveValidate
validator={validator}
schema={JSON.parse(actionSchema)}
onSubmit={({ formData }) => {
handleStartAction(actionId, formData);
}}
>
{getRunButton(isActionRunning)}
</JSForm>
</div>
</Col>
<Row className="py-2" />
</Row>
<Row className="py-2">
<Col>
<Plot1D
displayedPlotCallback={handleOnPlotDisplay}
plotId={plotId}
autoNext={isActionRunning}
/>
{actionMessages.length > 0 ? (
<Card>
{actionMessages.map((message) => (
// eslint-disable-next-line react/jsx-key
<p>{message.message}</p>
))}
</Card>
) : (
''
)}
</Col>
</Row>
</Modal.Body>
<Modal.Footer>
<Button
variant="outline-secondary"
onClick={handleOnHide}
disabled={isActionRunning}
>
Close window
</Button>
</Modal.Footer>
</DraggableModal>
);
}
return null;
return (
<DraggableModal
id="beamlineActionOutput"
show={isDialogVisble}
onHide={handleOnHide}
defaultpos={defaultPosition}
>
<Modal.Header>
<Modal.Title>{actionName}</Modal.Title>
</Modal.Header>
<Modal.Body>
<Row className="py-2">
<Col className="col-md-4">
<div className={style.json_schema_form_container_with_submit}>
<JSForm
liveValidate
validator={validator}
schema={JSON.parse(actionSchema)}
onSubmit={({ formData }) => {
handleStartAction(actionId, formData);
}}
>
{getRunButton(isActionRunning)}
</JSForm>
</div>
</Col>
<Row className="py-2" />
</Row>
<Row className="py-2">
<Col>
<Plot1D
displayedPlotCallback={handleOnPlotDisplay}
plotId={plotId}
autoNext={isActionRunning}
/>
{actionMessages.length > 0 ? (
<Card>
{actionMessages.map((message) => (
// eslint-disable-next-line react/jsx-key
<p>{message.message}</p>
))}
</Card>
) : (
''
)}
</Col>
</Row>
</Modal.Body>
<Modal.Footer>
<Button
variant="outline-secondary"
onClick={handleOnHide}
disabled={isActionRunning}
>
Close window
</Button>
</Modal.Footer>
</DraggableModal>
);
}
5 changes: 3 additions & 2 deletions ui/src/containers/BeamlineActionsContainer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,8 @@ class BeamlineActionsContainer extends React.Component {
handleOnPlotDisplay={this.newPlotDisplayed}
plotId={this.plotIdByAction[currentActionName]}
/>
) : (
) : null}
{this.props.currentAction.argument_type === 'JSONSchema' ? (
<AnnotatedBeamlineActionDialog
isDialogVisble={this.props.currentAction.show}
handleOnHide={this.hideOutput}
Expand All @@ -146,7 +147,7 @@ class BeamlineActionsContainer extends React.Component {
handleOnPlotDisplay={this.newPlotDisplayed}
plotId={this.plotIdByAction[currentActionName]}
/>
)}
) : null}
</>
);
}
Expand Down

0 comments on commit 811e35f

Please sign in to comment.