mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
Add review requested filter on pull request overview (#13701)
* Add review requested filter on pull request overview #13682 fix formatting * add review_requested filter to /repos/issues/search API endpoint * only Approve and Reject status should supersede Request status * add support for team reviews * refactor: remove duplication of issue filtering conditions
This commit is contained in:
@@ -113,16 +113,17 @@ func issues(ctx *context.Context, milestoneID, projectID int64, isPullOption uti
|
||||
var err error
|
||||
viewType := ctx.Query("type")
|
||||
sortType := ctx.Query("sort")
|
||||
types := []string{"all", "your_repositories", "assigned", "created_by", "mentioned"}
|
||||
types := []string{"all", "your_repositories", "assigned", "created_by", "mentioned", "review_requested"}
|
||||
if !util.IsStringInSlice(viewType, types, true) {
|
||||
viewType = "all"
|
||||
}
|
||||
|
||||
var (
|
||||
assigneeID = ctx.QueryInt64("assignee")
|
||||
posterID int64
|
||||
mentionedID int64
|
||||
forceEmpty bool
|
||||
assigneeID = ctx.QueryInt64("assignee")
|
||||
posterID int64
|
||||
mentionedID int64
|
||||
reviewRequestedID int64
|
||||
forceEmpty bool
|
||||
)
|
||||
|
||||
if ctx.IsSigned {
|
||||
@@ -133,6 +134,8 @@ func issues(ctx *context.Context, milestoneID, projectID int64, isPullOption uti
|
||||
mentionedID = ctx.User.ID
|
||||
case "assigned":
|
||||
assigneeID = ctx.User.ID
|
||||
case "review_requested":
|
||||
reviewRequestedID = ctx.User.ID
|
||||
}
|
||||
}
|
||||
|
||||
@@ -169,14 +172,15 @@ func issues(ctx *context.Context, milestoneID, projectID int64, isPullOption uti
|
||||
issueStats = &models.IssueStats{}
|
||||
} else {
|
||||
issueStats, err = models.GetIssueStats(&models.IssueStatsOptions{
|
||||
RepoID: repo.ID,
|
||||
Labels: selectLabels,
|
||||
MilestoneID: milestoneID,
|
||||
AssigneeID: assigneeID,
|
||||
MentionedID: mentionedID,
|
||||
PosterID: posterID,
|
||||
IsPull: isPullOption,
|
||||
IssueIDs: issueIDs,
|
||||
RepoID: repo.ID,
|
||||
Labels: selectLabels,
|
||||
MilestoneID: milestoneID,
|
||||
AssigneeID: assigneeID,
|
||||
MentionedID: mentionedID,
|
||||
PosterID: posterID,
|
||||
ReviewRequestedID: reviewRequestedID,
|
||||
IsPull: isPullOption,
|
||||
IssueIDs: issueIDs,
|
||||
})
|
||||
if err != nil {
|
||||
ctx.ServerError("GetIssueStats", err)
|
||||
@@ -217,17 +221,18 @@ func issues(ctx *context.Context, milestoneID, projectID int64, isPullOption uti
|
||||
Page: pager.Paginater.Current(),
|
||||
PageSize: setting.UI.IssuePagingNum,
|
||||
},
|
||||
RepoIDs: []int64{repo.ID},
|
||||
AssigneeID: assigneeID,
|
||||
PosterID: posterID,
|
||||
MentionedID: mentionedID,
|
||||
MilestoneIDs: mileIDs,
|
||||
ProjectID: projectID,
|
||||
IsClosed: util.OptionalBoolOf(isShowClosed),
|
||||
IsPull: isPullOption,
|
||||
LabelIDs: labelIDs,
|
||||
SortType: sortType,
|
||||
IssueIDs: issueIDs,
|
||||
RepoIDs: []int64{repo.ID},
|
||||
AssigneeID: assigneeID,
|
||||
PosterID: posterID,
|
||||
MentionedID: mentionedID,
|
||||
ReviewRequestedID: reviewRequestedID,
|
||||
MilestoneIDs: mileIDs,
|
||||
ProjectID: projectID,
|
||||
IsClosed: util.OptionalBoolOf(isShowClosed),
|
||||
IsPull: isPullOption,
|
||||
LabelIDs: labelIDs,
|
||||
SortType: sortType,
|
||||
IssueIDs: issueIDs,
|
||||
})
|
||||
if err != nil {
|
||||
ctx.ServerError("Issues", err)
|
||||
|
Reference in New Issue
Block a user