-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Add "n commits" link to contributors in contributors graph page #29429
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
071184c
dc8533f
f20cd38
abdb275
d26364f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -66,12 +66,14 @@ export default { | |||||
totalStats: {}, | ||||||
sortedContributors: {}, | ||||||
repoLink: pageData.repoLink || [], | ||||||
repoBranch: pageData.repoDefaultBranch || [], | ||||||
type: pageData.contributionType, | ||||||
contributorsStats: [], | ||||||
xAxisStart: null, | ||||||
xAxisEnd: null, | ||||||
xAxisMin: null, | ||||||
xAxisMax: null, | ||||||
searchQuery: '', | ||||||
}), | ||||||
mounted() { | ||||||
this.fetchGraphData(); | ||||||
|
@@ -88,6 +90,9 @@ export default { | |||||
methods: { | ||||||
sortContributors() { | ||||||
const contributors = this.filterContributorWeeksByDateRange(); | ||||||
const min = new Date(this.xAxisMin).toISOString().split('T')[0]; | ||||||
const max = new Date(this.xAxisMax).toISOString().split('T')[0]; | ||||||
sahinakkaya marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
this.searchQuery = `${this.repoLink}/commits/branch/${this.repoBranch}/search?q=after:${min}, before:${max}, author:`; | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yup. Actually The There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There is no path escape function in JS, I think There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess "org/repo/branch/feature%2Fbranch" doesn't work. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, you can not pass There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
also, it looks really weird to construct the search query like this. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ideally we should use String(new URLSearchParams({foo: "bar", baz: "a b"}))
// 'foo=bar&baz=a+b' There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
yeah, it would. But I can't do that way because it is not something I decided. Gitea currently works the other way.
Yes. And it won't work if I accept your code suggestion. The spaces are important. As I said, this is how it works. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If it's existing API, I guess this weird format is okay, otherwise it would be a breaking change. Still we should ensure the individual paramters and path segments are encoded correctly. |
||||||
const criteria = `total_${this.type}`; | ||||||
this.sortedContributors = Object.values(contributors) | ||||||
.filter((contributor) => contributor[criteria] !== 0) | ||||||
|
@@ -162,7 +167,7 @@ export default { | |||||
// for details. | ||||||
user.max_contribution_type += 1; | ||||||
|
||||||
filteredData[key] = {...user, weeks: filteredWeeks}; | ||||||
filteredData[key] = {...user, weeks: filteredWeeks, email: key}; | ||||||
} | ||||||
|
||||||
return filteredData; | ||||||
|
@@ -384,7 +389,7 @@ export default { | |||||
{{ contributor.name }} | ||||||
</h4> | ||||||
<p class="gt-font-12 gt-df gt-gap-2"> | ||||||
<strong v-if="contributor.total_commits">{{ contributor.total_commits.toLocaleString() }} {{ locale.contributionType.commits }}</strong> | ||||||
<a v-if="contributor.total_commits" :href="searchQuery + contributor.email">{{ contributor.total_commits.toLocaleString() }} {{ locale.contributionType.commits }}</a> | ||||||
<strong v-if="contributor.total_additions" class="text green">{{ contributor.total_additions.toLocaleString() }}++ </strong> | ||||||
<strong v-if="contributor.total_deletions" class="text red"> | ||||||
{{ contributor.total_deletions.toLocaleString() }}--</strong> | ||||||
|
Uh oh!
There was an error while loading. Please reload this page.