filtering build data based on sha using find()

This commit is contained in:
Ayush Kumar Sinha 2019-07-05 09:56:19 +05:30
parent d7ba9701de
commit 8ae50363cf

View File

@ -12,6 +12,12 @@ class Commits extends React.Component {
this.props.loadCommits();
}
renderCommits = commit => {
let filteredBs = this.props.buildData.buildSets
.map(obj => {
return obj;
})
.find(item => item.sourcestamps[0].revision === commit.sha);
// console.log('bsid:' + filteredBs.bsid + ' sha:' + filteredBs.sourcestamps[0].revision + 'commit:'+commit.sha);
return (
<div className='panel-margin' key={commit.sha}>
<CommitsCard commit={commit} />
@ -76,12 +82,13 @@ class Commits extends React.Component {
}
// prettier-ignore
const mapStateToProps = ({ isLoading, commits, error, branch,page }) => ({
const mapStateToProps = ({ isLoading, commits, error, branch,page,buildData}) => ({
isLoading,
commits,
error,
branch,
page
page,
buildData
});
const mapDispatchToProps = dispatch => ({