Skip to content

Commit

Permalink
Typecast daily commits
Browse files Browse the repository at this point in the history
  • Loading branch information
jq1836 committed Sep 23, 2023
1 parent 06935b0 commit 844bf8e
Showing 1 changed file with 24 additions and 24 deletions.
48 changes: 24 additions & 24 deletions frontend/src/components/c-ramp.vue
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
<template lang="pug">
.ramp
template(v-if="tframe === 'commit'")
template(v-for="(slice, j) in user.commits")
template(v-for="(commit, k) in slice.commitResults")
a.ramp__slice(
draggable="false",
v-on:click="rampClick",
v-bind:href="getLink(commit)", target="_blank",
v-bind:title="getContributionMessage(slice, commit)",
v-bind:class="`ramp__slice--color${getRampColor(commit, slice)}`,\
template(v-if="tframe === 'commit'")
template(v-for="(slice, j) in user.commits")
template(v-for="(commit, k) in slice.commitResults")
a.ramp__slice(
draggable="false",
v-on:click="rampClick",
v-bind:href="getLink(commit)", target="_blank",
v-bind:title="getContributionMessage(slice, commit)",
v-bind:class="`ramp__slice--color${getRampColor(commit, slice)}`,\
!isBrokenLink(getLink(commit)) ? '' : 'broken-link'",
v-bind:style="{\
v-bind:style="{\
zIndex: user.commits.length - j,\
borderLeftWidth: `${getWidth(commit)}em`,\
right: `${((getSlicePos(slice.date)\
+ (getCommitPos(k, slice.commitResults.length))) * 100)}%`\
}"
)
)

template(v-else)
a(v-bind:href="getReportLink()", target="_blank")
.ramp__slice(
draggable="false",
v-for="(slice, j) in user.commits",
v-bind:title="getContributionMessage(slice, null)",
v-on:click="openTabZoom(user, slice, $event)",
v-bind:class="`ramp__slice--color${getSliceColor(slice)}`",
v-bind:style="{\
template(v-else)
a(v-bind:href="getReportLink()", target="_blank")
.ramp__slice(
draggable="false",
v-for="(slice, j) in user.commits",
v-bind:title="getContributionMessage(slice, null)",
v-on:click="openTabZoom(user, slice, $event)",
v-bind:class="`ramp__slice--color${getSliceColor(slice)}`",
v-bind:style="{\
zIndex: user.commits.length - j,\
borderLeftWidth: `${getWidth(slice)}em`,\
right: `${(getSlicePos(tframe === 'day' ? slice.date : slice.endDate) * 100)}%` \
}"
)
)
</template>

<script lang='ts'>
Expand Down Expand Up @@ -132,8 +132,8 @@ export default defineComponent({
}
let title = this.tframe === 'day'
? `[${slice.date}] Daily `
: `[${slice.date} till ${slice.endDate}] Weekly `;
? `[${slice.date}] Daily `
: `[${slice.date} till ${slice.endDate}] Weekly `;
title += `contribution: +${slice.insertions} -${slice.deletions} lines`;
return title;
},
Expand All @@ -145,7 +145,7 @@ export default defineComponent({
}
const zoomUser = { ...user };
zoomUser.commits = user.dailyCommits;
zoomUser.commits = user.dailyCommits as Commit[];
const info = {
zRepo: user.repoName,
Expand Down

0 comments on commit 844bf8e

Please sign in to comment.