Skip to content

Commit

Permalink
changedcount calculation for starred candidate
Browse files Browse the repository at this point in the history
  • Loading branch information
suparna authored and shreel2015 committed Sep 11, 2017
1 parent b26b9f5 commit 983acd5
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,10 @@ export class TestReportComponent implements OnInit {
response => {
this.testAttendeeArray.forEach(k => k.starredCandidate = status);
[this.headerStarStatus, this.isAllCandidateStarred] = status ? ['star', true] : ['star_border', false];
if (status)
this.starredCandidateCount = this.testAttendeeArray.length;
else
this.starredCandidateCount = 0;
}
);
}
Expand All @@ -175,6 +179,10 @@ export class TestReportComponent implements OnInit {
response => {
this.testAttendeeArray.find(x => x.id === testAttendee.id).starredCandidate = !testAttendee.starredCandidate;
[this.headerStarStatus, this.isAllCandidateStarred] = this.testAttendeeArray.some(x => !x.starredCandidate) ? ['star_border', false] : ['star', true];
if (testAttendee.starredCandidate)
this.starredCandidateCount += 1;
else
this.starredCandidateCount -= 1;
}
);
}
Expand Down Expand Up @@ -825,6 +833,8 @@ export class TestReportComponent implements OnInit {
default:
this.unfinishedTestCount += 1;
}
if (attendee.starredCandidate)
this.starredCandidateCount += 1;
});
}
}

0 comments on commit 983acd5

Please sign in to comment.