Issues: add Project filter to issues list and search (#22544)

Currently only a single project like milestone, not multiple like
labels.

Implements #14298

Code by @brechtvl

---------

Co-authored-by: Brecht Van Lommel <brecht@blender.org>
This commit is contained in:
techknowlogick 2023-01-28 22:45:29 -05:00 committed by GitHub
parent 2b1e47e2a2
commit e88b529b31
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 67 additions and 33 deletions

View file

@ -1572,6 +1572,7 @@ type IssueStatsOptions struct {
RepoID int64
Labels string
MilestoneID int64
ProjectID int64
AssigneeID int64
MentionedID int64
PosterID int64
@ -1650,6 +1651,11 @@ func getIssueStatsChunk(opts *IssueStatsOptions, issueIDs []int64) (*IssueStats,
sess.And("issue.milestone_id = ?", opts.MilestoneID)
}
if opts.ProjectID > 0 {
sess.Join("INNER", "project_issue", "issue.id = project_issue.issue_id").
And("project_issue.project_id=?", opts.ProjectID)
}
if opts.AssigneeID > 0 {
applyAssigneeCondition(sess, opts.AssigneeID)
}