Skip to content

Commit

Permalink
Solved the issue with compare all algorithms
Browse files Browse the repository at this point in the history
  • Loading branch information
pushpanjalip committed Oct 16, 2020
1 parent e80e826 commit 97aaca0
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/components/Leaderboard/LeaderboardTable/LeaderboardTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,22 @@ class LeaderboardTable extends React.Component<IProps, IState> {
event: React.ChangeEvent<HTMLInputElement>
) => {
if (event.target.checked) {
const newSelecteds = data.map((n) => n.id);
let newSelecteds = data.map((n) => {
if (n.evaluationJob !== 'null' && n.visualization !== null)
return n.id;
});
newSelecteds = newSelecteds.filter((el) => el !== undefined);
const compareItems = [];
this.props.submissions.filter((submission) => {
const index = newSelecteds.indexOf(submission.id);
if (index >= 0) {
compareItems.push(submission);
}
});
console.log('selected', newSelecteds);
this.setState({
selected: newSelecteds,
itemsToCompare: this.props.submissions,
itemsToCompare: compareItems,
});
return;
}
Expand Down

0 comments on commit 97aaca0

Please sign in to comment.