11<script lang="ts">
22import {SvgIcon } from ' ../svg.ts' ;
3+ import dayjs from ' dayjs' ;
34import {
45 Chart ,
56 Title ,
@@ -27,6 +28,8 @@ import 'chartjs-adapter-dayjs-4/dist/chartjs-adapter-dayjs-4.esm';
2728import {fomanticQuery } from ' ../modules/fomantic/base.ts' ;
2829import type {Entries } from ' type-fest' ;
2930
31+ const {pageData} = window .config ;
32+
3033const customEventListener: Plugin = {
3134 id: ' customEventListener' ,
3235 afterEvent : (chart , args , opts ) => {
@@ -72,11 +75,13 @@ export default {
7275 totalStats: {} as Record <string , any >,
7376 sortedContributors: {} as Record <string , any >,
7477 type: ' commits' ,
78+ repoBranch: pageData .repoContributorsData .repoDefaultBranch ,
7579 contributorsStats: {} as Record <string , any >,
7680 xAxisStart: null ,
7781 xAxisEnd: null ,
7882 xAxisMin: null ,
7983 xAxisMax: null ,
84+ searchQuery: ' ' ,
8085 }),
8186 mounted() {
8287 this .fetchGraphData ();
@@ -93,6 +98,9 @@ export default {
9398 methods: {
9499 sortContributors() {
95100 const contributors = this .filterContributorWeeksByDateRange ();
101+ const min = dayjs (this .xAxisMin ).format (' YYYY-MM-DD' );
102+ const max = dayjs (this .xAxisMax ).format (' YYYY-MM-DD' );
103+ this .searchQuery = ` ${this .repoLink }/commits/branch/${this .repoBranch }/search?q=after:${min }, before:${max }, author: ` ;
96104 const criteria = ` total_${this .type } ` ;
97105 this .sortedContributors = Object .values (contributors )
98106 .filter ((contributor ) => contributor [criteria ] !== 0 )
@@ -167,7 +175,7 @@ export default {
167175 // for details.
168176 user .max_contribution_type += 1 ;
169177
170- filteredData [key ] = {... user , weeks: filteredWeeks };
178+ filteredData [key ] = {... user , weeks: filteredWeeks , email: key };
171179 }
172180
173181 return filteredData ;
@@ -389,7 +397,11 @@ export default {
389397 {{ contributor.name }}
390398 </h4 >
391399 <p class =" tw-text-12 tw-flex tw-gap-1" >
392- <strong v-if =" contributor.total_commits" >{{ contributor.total_commits.toLocaleString() }} {{ locale.contributionType.commits }}</strong >
400+ <strong v-if =" contributor.total_commits" >
401+ <a class =" silenced" :href =" searchQuery + contributor.email" >
402+ {{ contributor.total_commits.toLocaleString() }} {{ locale.contributionType.commits }}
403+ </a >
404+ </strong >
393405 <strong v-if =" contributor.total_additions" class =" text green" >{{ contributor.total_additions.toLocaleString() }}++ </strong >
394406 <strong v-if =" contributor.total_deletions" class =" text red" >
395407 {{ contributor.total_deletions.toLocaleString() }}--</strong >
0 commit comments