nci/static/js/app/components/builds/item.js

38 lines
877 B
JavaScript
Raw Normal View History

2015-05-07 21:55:40 +00:00
'use strict';
define([
2015-05-09 21:47:01 +00:00
'react', 'app/actions/project',
'app/actions/build', 'templates/app/components/builds/item',
2015-05-10 16:53:33 +00:00
'app/components/terminal/terminal',
2015-05-09 21:36:17 +00:00
'app/components/common/index'
2015-05-10 16:53:33 +00:00
], function(
React, ProjectActions, BuildActions, template,
TerminalComponent, CommonComponents
) {
2015-05-09 21:36:17 +00:00
template = template.locals({
2015-05-10 16:53:33 +00:00
DateTime: CommonComponents.DateTime,
Terminal: TerminalComponent
2015-05-09 21:36:17 +00:00
});
2015-05-07 21:55:40 +00:00
var Component = React.createClass({
2015-05-10 16:53:33 +00:00
getInitialState: function() {
return {
showTerminal: false
};
},
2015-05-09 21:47:01 +00:00
onRebuildProject: function(projectName) {
ProjectActions.run(projectName)
},
2015-05-10 16:53:33 +00:00
onShowTerminal: function(build) {
this.setState({showTerminal: !this.state.showTerminal});
BuildActions.readTerminalOutput(this.props.build.id);
},
2015-05-07 21:55:40 +00:00
onBuildSelect: function(buildId) {
console.log('on build select');
},
2015-05-09 21:36:17 +00:00
render: template
2015-05-07 21:55:40 +00:00
});
return Component;
});