removing logics

This commit is contained in:
Ayush Kumar Sinha 2019-07-17 14:07:09 +05:30
parent f9bdada9cc
commit 638721e07e

View File

@ -12,51 +12,10 @@ class Commits extends React.Component {
this.props.loadBuildSets();
}
renderBsid = id => {
return <p key={id.bsid}>{id.bsid}</p>;
};
renderCommits = commit => {
let filteredBs = this.props.buildData
.map(obj => {
return obj;
})
.filter(item => item.sourcestamps[0].revision === commit.sha);
let BSID = filteredBs.map(id => {
return id.bsid;
});
console.log(BSID);
if (BSID) {
var filterBReq = [];
BSID.forEach(val => {
filterBReq.push(
this.props.bsid
.map(obj => {
return obj;
})
.filter(item => item.buildsetid === val)
);
});
var mergedBsID = [].concat.apply([], filterBReq);
var filterBuild = [];
mergedBsID.forEach(val => {
filterBuild.push(
this.props.build
.map(obj => {
return obj;
})
.filter(item => item.buildrequestid === val.buildrequestid)
);
});
var mergedBuild = [].concat.apply([], filterBuild);
console.log(mergedBsID);
console.log(mergedBuild);
}
return (
<div className='panel-margin' key={commit.sha}>
<CommitsCard commit={commit} />
{filteredBs.map(this.renderBsid)}
</div>
);
};
@ -117,16 +76,12 @@ class Commits extends React.Component {
}
}
// prettier-ignore
const mapStateToProps = ({ isLoading, commits, error, branch,page,buildData,bsid,build}) => ({
isLoading,
commits,
error,
branch,
page,
buildData,
bsid,
build
const mapStateToProps = ({ isLoading, commits, error, branch, page }) => ({
isLoading,
commits,
error,
branch,
page
});
const mapDispatchToProps = dispatch => ({