From 35447463babc219b1065e55b0d2a7d89b8c1204f Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Thu, 6 Jun 2024 10:28:33 +0800 Subject: [PATCH] Fix Activity Page Contributors dropdown (#31264) Fix #31261 (cherry picked from commit e728fd741be7848d476663eec1c9caaf34b46e61) --- routers/web/repo/contributors.go | 6 ------ templates/repo/contributors.tmpl | 1 + web_src/js/components/RepoContributors.vue | 21 ++++++++++----------- web_src/js/features/contributors.js | 1 + 4 files changed, 12 insertions(+), 17 deletions(-) diff --git a/routers/web/repo/contributors.go b/routers/web/repo/contributors.go index 5fda17469e..762fbf9379 100644 --- a/routers/web/repo/contributors.go +++ b/routers/web/repo/contributors.go @@ -19,14 +19,8 @@ const ( // Contributors render the page to show repository contributors graph func Contributors(ctx *context.Context) { ctx.Data["Title"] = ctx.Tr("repo.activity.navbar.contributors") - ctx.Data["PageIsActivity"] = true ctx.Data["PageIsContributors"] = true - - ctx.PageData["contributionType"] = "commits" - - ctx.PageData["repoLink"] = ctx.Repo.RepoLink - ctx.HTML(http.StatusOK, tplContributors) } diff --git a/templates/repo/contributors.tmpl b/templates/repo/contributors.tmpl index 4a258e5b70..f7f5d796f4 100644 --- a/templates/repo/contributors.tmpl +++ b/templates/repo/contributors.tmpl @@ -1,5 +1,6 @@ {{if .Permission.CanRead $.UnitTypeCode}}
{ @@ -59,14 +57,17 @@ export default { type: Object, required: true, }, + repoLink: { + type: String, + required: true, + }, }, data: () => ({ isLoading: false, errorText: '', totalStats: {}, sortedContributors: {}, - repoLink: pageData.repoLink || [], - type: pageData.contributionType, + type: 'commits', contributorsStats: [], xAxisStart: null, xAxisEnd: null, @@ -333,19 +334,17 @@ export default {