mirror of
https://gitlab.silvrtree.co.uk/martind2000/nci.git
synced 2025-01-12 15:35:09 +00:00
36 lines
785 B
JavaScript
36 lines
785 B
JavaScript
'use strict';
|
|
|
|
define([
|
|
'react', 'reflux',
|
|
'app/actions/project',
|
|
'app/actions/build',
|
|
'app/stores/project',
|
|
'app/components/builds/list',
|
|
'templates/app/components/projects/view/index'
|
|
], function(React, Reflux, ProjectActions, BuildActions,
|
|
projectStore, Builds, template
|
|
) {
|
|
template = template.locals({
|
|
Builds: Builds
|
|
});
|
|
|
|
return React.createClass({
|
|
mixins: [Reflux.ListenerMixin],
|
|
componentDidMount: function() {
|
|
ProjectActions.read({name: this.props.params.name});
|
|
BuildActions.readAll({projectName: this.props.params.name});
|
|
|
|
this.listenTo(projectStore, this.updateItem);
|
|
},
|
|
updateItem: function(project) {
|
|
this.setState({project: project});
|
|
},
|
|
getInitialState: function() {
|
|
return {
|
|
project: {}
|
|
}
|
|
},
|
|
render: template,
|
|
});
|
|
});
|