From e728fd741be7848d476663eec1c9caaf34b46e61 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 --- 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 5fda17469..762fbf937 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 54e3e426a..6b8a63fe9 100644 --- a/templates/repo/contributors.tmpl +++ b/templates/repo/contributors.tmpl @@ -1,5 +1,6 @@ {{if .Permission.CanRead ctx.Consts.RepoUnitTypeCode}}
{ @@ -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 {