mirror of
https://gitlab.silvrtree.co.uk/martind2000/nci.git
synced 2025-01-11 23:45:08 +00:00
50 lines
1.1 KiB
JavaScript
50 lines
1.1 KiB
JavaScript
'use strict';
|
|
|
|
define([
|
|
'react',
|
|
'react-router',
|
|
'reflux',
|
|
'app/actions/build',
|
|
'app/stores/build',
|
|
'app/components/terminal/terminal',
|
|
'templates/app/components/builds/view',
|
|
'app/components/common/index'
|
|
], function(
|
|
React, Router, Reflux, BuildActions, buildStore, TerminalComponent, template,
|
|
CommonComponents
|
|
) {
|
|
template = template.locals({
|
|
DateTime: CommonComponents.DateTime,
|
|
Duration: CommonComponents.Duration,
|
|
Scm: CommonComponents.Scm,
|
|
Terminal: TerminalComponent,
|
|
Link: Router.Link
|
|
});
|
|
|
|
var Component = React.createClass({
|
|
mixins: [Reflux.ListenerMixin],
|
|
statics: {
|
|
willTransitionTo: function(transition, params, query) {
|
|
BuildActions.read(Number(params.id));
|
|
}
|
|
},
|
|
componentDidMount: function() {
|
|
this.listenTo(buildStore, this.updateBuild);
|
|
},
|
|
updateBuild: function(build) {
|
|
if (!this.state.build && build) {
|
|
BuildActions.readTerminalOutput(build);
|
|
}
|
|
this.setState({build: build});
|
|
},
|
|
render: template,
|
|
getInitialState: function() {
|
|
return {
|
|
build: null
|
|
};
|
|
}
|
|
});
|
|
|
|
return Component;
|
|
});
|