summaryrefslogtreecommitdiffstats
path: root/web_src
diff options
context:
space:
mode:
authorGiteabot <teabot@gitea.io>2024-06-06 16:14:00 +0800
committerGitHub <noreply@github.com>2024-06-06 08:14:00 +0000
commitc07416b3d0b1772d6e00e26be92eb89fea1ddc57 (patch)
treee38462e3df9901c9401d5d51016aaa3d1f887a64 /web_src
parent875579cc658a58d045d9625e897e263e34280782 (diff)
downloadgitea-c07416b3d0b1772d6e00e26be92eb89fea1ddc57.tar.gz
gitea-c07416b3d0b1772d6e00e26be92eb89fea1ddc57.zip
Fix Activity Page Contributors dropdown (#31264) (#31269)
Backport #31264 by wxiaoguang Fix #31261 Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Diffstat (limited to 'web_src')
-rw-r--r--web_src/js/components/RepoContributors.vue21
-rw-r--r--web_src/js/features/contributors.js1
2 files changed, 11 insertions, 11 deletions
diff --git a/web_src/js/components/RepoContributors.vue b/web_src/js/components/RepoContributors.vue
index f7b05831e0..dec2599c0d 100644
--- a/web_src/js/components/RepoContributors.vue
+++ b/web_src/js/components/RepoContributors.vue
@@ -23,8 +23,6 @@ import {sleep} from '../utils.js';
import 'chartjs-adapter-dayjs-4/dist/chartjs-adapter-dayjs-4.esm';
import $ from 'jquery';
-const {pageData} = window.config;
-
const customEventListener = {
id: 'customEventListener',
afterEvent: (chart, args, opts) => {
@@ -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 {
<!-- Contribution type -->
<div class="ui dropdown jump" id="repo-contributors">
<div class="ui basic compact button">
- <span class="text">
- <span class="not-mobile">{{ locale.filterLabel }}&nbsp;</span><strong>{{ locale.contributionType[type] }}</strong>
- <svg-icon name="octicon-triangle-down" :size="14"/>
- </span>
+ <span class="not-mobile">{{ locale.filterLabel }}</span> <strong>{{ locale.contributionType[type] }}</strong>
+ <svg-icon name="octicon-triangle-down" :size="14"/>
</div>
<div class="menu">
- <div :class="['item', {'active': type === 'commits'}]">
+ <div :class="['item', {'selected': type === 'commits'}]" data-value="commits">
{{ locale.contributionType.commits }}
</div>
- <div :class="['item', {'active': type === 'additions'}]">
+ <div :class="['item', {'selected': type === 'additions'}]" data-value="additions">
{{ locale.contributionType.additions }}
</div>
- <div :class="['item', {'active': type === 'deletions'}]">
+ <div :class="['item', {'selected': type === 'deletions'}]" data-value="deletions">
{{ locale.contributionType.deletions }}
</div>
</div>
diff --git a/web_src/js/features/contributors.js b/web_src/js/features/contributors.js
index 1d9cba5b9b..79b3389fee 100644
--- a/web_src/js/features/contributors.js
+++ b/web_src/js/features/contributors.js
@@ -7,6 +7,7 @@ export async function initRepoContributors() {
const {default: RepoContributors} = await import(/* webpackChunkName: "contributors-graph" */'../components/RepoContributors.vue');
try {
const View = createApp(RepoContributors, {
+ repoLink: el.getAttribute('data-repo-link'),
locale: {
filterLabel: el.getAttribute('data-locale-filter-label'),
contributionType: {