mirror of
https://gitlab.silvrtree.co.uk/martind2000/nci.git
synced 2025-01-12 15:05:09 +00:00
34 lines
715 B
JavaScript
34 lines
715 B
JavaScript
'use strict';
|
|
|
|
define([
|
|
'underscore',
|
|
'react', 'react-router',
|
|
'app/stores/builds', 'reflux',
|
|
'templates/app/components/buildSidebar/index', 'app/components/common/index',
|
|
], function(
|
|
_,
|
|
React, Router,
|
|
buildsStore, Reflux,
|
|
template, CommonComponents
|
|
) {
|
|
template = template.locals(_({
|
|
Link: Router.Link
|
|
}).extend(CommonComponents));
|
|
|
|
return React.createClass({
|
|
mixins: [
|
|
Reflux.connectFilter(buildsStore, 'items', function(items) {
|
|
var projectName = this.props.projectName;
|
|
if (projectName) {
|
|
return _(items).filter(function(item) {
|
|
return item.project && item.project.name === projectName;
|
|
});
|
|
} else {
|
|
return items;
|
|
}
|
|
})
|
|
],
|
|
render: template
|
|
});
|
|
});
|