Skip to content

Commit

Permalink
Merge branch 'master' into 1936-migrate-repo-sorter
Browse files Browse the repository at this point in the history
  • Loading branch information
chan-j-d committed Oct 28, 2023
2 parents d913ad1 + 00cf40d commit ce8ba5e
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions frontend/src/components/c-ramp.vue
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,15 @@ export default defineComponent({
}
const zoomUser = { ...user };
// Type cast here is unsafe
zoomUser.commits = user.dailyCommits as Commit[];
// Calculate total commit result insertion and deletion for the daily/weekly commit selected
zoomUser.commits = user.dailyCommits.map(
(dailyCommit) => ({
insertions: dailyCommit.commitResults.reduce((acc, currCommitResult) => acc + currCommitResult.insertions, 0),
deletions: dailyCommit.commitResults.reduce((acc, currCommitResult) => acc + currCommitResult.deletions, 0),
...dailyCommit,
commitResults: dailyCommit.commitResults.map((commitResult) => ({ ...commitResult, isOpen: true })),
}),
) as Commit[];
const info = {
zRepo: user.repoName,
Expand Down

0 comments on commit ce8ba5e

Please sign in to comment.