Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#2054] Fix zoom view bug #2055

Merged
merged 16 commits into from
Oct 28, 2023
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
Loading