mirror of
https://gitlab.silvrtree.co.uk/martind2000/nci.git
synced 2025-01-11 23:45:08 +00:00
33 lines
640 B
JavaScript
33 lines
640 B
JavaScript
'use strict';
|
|
|
|
define([
|
|
'react',
|
|
'reflux',
|
|
'underscore',
|
|
'./item',
|
|
'app/stores/builds',
|
|
'templates/app/components/builds/list'
|
|
], function(React, Reflux, _, Item, buildsStore, template) {
|
|
template = template.locals({
|
|
Item: Item
|
|
});
|
|
|
|
var Component = 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
|
|
});
|
|
|
|
return Component;
|
|
});
|