@@ -27,8 +27,7 @@ import {sleep} from '../utils.ts';
2727import ' chartjs-adapter-dayjs-4/dist/chartjs-adapter-dayjs-4.esm' ;
2828import {fomanticQuery } from ' ../modules/fomantic/base.ts' ;
2929import type {Entries } from ' type-fest' ;
30-
31- const {pageData} = window .config ;
30+ import {pathEscapeSegments } from ' ../utils/url.ts' ;
3231
3332const customEventListener: Plugin = {
3433 id: ' customEventListener' ,
@@ -68,14 +67,17 @@ export default {
6867 type: String ,
6968 required: true ,
7069 },
70+ repoDefaultBranchName: {
71+ type: String ,
72+ required: true ,
73+ },
7174 },
7275 data : () => ({
7376 isLoading: false ,
7477 errorText: ' ' ,
7578 totalStats: {} as Record <string , any >,
7679 sortedContributors: {} as Record <string , any >,
7780 type: ' commits' ,
78- repoBranch: pageData .repoContributorsData .repoDefaultBranch ,
7981 contributorsStats: {} as Record <string , any >,
8082 xAxisStart: null ,
8183 xAxisEnd: null ,
@@ -110,7 +112,7 @@ export default {
110112 const params = new URLSearchParams ({
111113 ' q' : ` after:${min }, before:${max }, author:${contributorEmail } ` ,
112114 });
113- return ` ${this .repoLink }/commits/branch/${this .repoBranch }/search?${params .toString ()} ` ;
115+ return ` ${this .repoLink }/commits/branch/${pathEscapeSegments ( this .repoDefaultBranchName ) }/search?${params .toString ()} ` ;
114116 },
115117
116118 async fetchGraphData() {
@@ -228,7 +230,7 @@ export default {
228230 };
229231 },
230232
231- updateOtherCharts({chart }: {chart: Chart }, reset ? : boolean = false ) {
233+ updateOtherCharts({chart }: {chart: Chart }, reset : boolean = false ) {
232234 const minVal = chart .options .scales .x .min ;
233235 const maxVal = chart .options .scales .x .max ;
234236 if (reset ) {
@@ -394,7 +396,7 @@ export default {
394396 <div class =" ui top attached header tw-flex tw-flex-1" >
395397 <b class =" ui right" >#{{ index + 1 }}</b >
396398 <a :href =" contributor.home_link" >
397- <img class =" ui avatar tw-align-middle" height =" 40" width =" 40" :src =" contributor.avatar_link" >
399+ <img class =" ui avatar tw-align-middle" height =" 40" width =" 40" :src =" contributor.avatar_link" alt = " {{ contributor.name }} " >
398400 </a >
399401 <div class =" tw-ml-2" >
400402 <a v-if =" contributor.home_link !== ''" :href =" contributor.home_link" ><h4 >{{ contributor.name }}</h4 ></a >
0 commit comments