Skip to content
This repository has been archived by the owner on Nov 12, 2019. It is now read-only.

Commit

Permalink
Add Run Locally button in Task Inspector webpage. (#155)
Browse files Browse the repository at this point in the history
* Add Run Locally button in Task Inspector

* Change in Run Locally on Task Inspector webpage

* Remove lint warning from taskinfo.jsx file

* Show Run Locally script on same page in Task Inspector

* Changes in Task Inspector webpage

* Change Run Locally button to toggleable
  • Loading branch information
GianaBhateja authored and eliperelman committed Oct 13, 2016
1 parent 4a25741 commit 9b1e8c0
Showing 1 changed file with 27 additions and 11 deletions.
38 changes: 27 additions & 11 deletions src/lib/ui/taskinfo.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { Table, Label } from 'react-bootstrap';
import { Button, Table, Label } from 'react-bootstrap';
import ConfirmAction from './confirmaction';
import LoanerButton from './loaner-button';
import _ from 'lodash';
Expand All @@ -15,6 +15,16 @@ const TaskInfo = React.createClass({
task: React.PropTypes.object.isRequired
},

getInitialState() {
return {
showRunLocallyScript: false
};
},

handleRunLocally() {
this.setState({ showRunLocallyScript: !this.state.showRunLocallyScript });
},

render() {
const { status, task } = this.props;
const taskStateLabel = {
Expand Down Expand Up @@ -200,18 +210,24 @@ const TaskInfo = React.createClass({
task={this.props.task}
taskId={status.taskId}
buttonStyle="default"
buttonSize="small" />
</td>
</tr>

<tr>
<td>Run Locally</td>
<td>
<Code language="bash">
{this.renderRunLocallyScript()}
</Code>
buttonSize="small" />&nbsp;
<Button type="submit" bsSize="small" bsStyle="default" onClick={this.handleRunLocally}>
Run Locally
</Button>
</td>
</tr>
{this.state.showRunLocallyScript ? (
<tr>
<td>Run Locally</td>
<td>
<Code language="bash">
{this.renderRunLocallyScript()}
</Code>
</td>
</tr>
) :
null
}
</tbody>
</Table>
</div>
Expand Down

0 comments on commit 9b1e8c0

Please sign in to comment.