mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-31 21:28:11 +09:00 
			
		
		
		
	Allow filtering issues by any assignee (#33343)
This is the opposite of the "No assignee" filter, it will match all issues that have at least one assignee. Before  After  --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
		| @@ -501,9 +501,9 @@ func buildIssueOverview(ctx *context.Context, unitType unit.Type) { | ||||
| 	case issues_model.FilterModeAll: | ||||
| 	case issues_model.FilterModeYourRepositories: | ||||
| 	case issues_model.FilterModeAssign: | ||||
| 		opts.AssigneeID = optional.Some(ctx.Doer.ID) | ||||
| 		opts.AssigneeID = strconv.FormatInt(ctx.Doer.ID, 10) | ||||
| 	case issues_model.FilterModeCreate: | ||||
| 		opts.PosterID = optional.Some(ctx.Doer.ID) | ||||
| 		opts.PosterID = strconv.FormatInt(ctx.Doer.ID, 10) | ||||
| 	case issues_model.FilterModeMention: | ||||
| 		opts.MentionedID = ctx.Doer.ID | ||||
| 	case issues_model.FilterModeReviewRequested: | ||||
| @@ -792,9 +792,9 @@ func getUserIssueStats(ctx *context.Context, ctxUser *user_model.User, filterMod | ||||
| 		case issues_model.FilterModeYourRepositories: | ||||
| 			openClosedOpts.AllPublic = false | ||||
| 		case issues_model.FilterModeAssign: | ||||
| 			openClosedOpts.AssigneeID = optional.Some(doerID) | ||||
| 			openClosedOpts.AssigneeID = strconv.FormatInt(doerID, 10) | ||||
| 		case issues_model.FilterModeCreate: | ||||
| 			openClosedOpts.PosterID = optional.Some(doerID) | ||||
| 			openClosedOpts.PosterID = strconv.FormatInt(doerID, 10) | ||||
| 		case issues_model.FilterModeMention: | ||||
| 			openClosedOpts.MentionID = optional.Some(doerID) | ||||
| 		case issues_model.FilterModeReviewRequested: | ||||
| @@ -816,8 +816,8 @@ func getUserIssueStats(ctx *context.Context, ctxUser *user_model.User, filterMod | ||||
|  | ||||
| 	// Below stats are for the left sidebar | ||||
| 	opts = opts.Copy(func(o *issue_indexer.SearchOptions) { | ||||
| 		o.AssigneeID = nil | ||||
| 		o.PosterID = nil | ||||
| 		o.AssigneeID = "" | ||||
| 		o.PosterID = "" | ||||
| 		o.MentionID = nil | ||||
| 		o.ReviewRequestedID = nil | ||||
| 		o.ReviewedID = nil | ||||
| @@ -827,11 +827,11 @@ func getUserIssueStats(ctx *context.Context, ctxUser *user_model.User, filterMod | ||||
| 	if err != nil { | ||||
| 		return nil, err | ||||
| 	} | ||||
| 	ret.AssignCount, err = issue_indexer.CountIssues(ctx, opts.Copy(func(o *issue_indexer.SearchOptions) { o.AssigneeID = optional.Some(doerID) })) | ||||
| 	ret.AssignCount, err = issue_indexer.CountIssues(ctx, opts.Copy(func(o *issue_indexer.SearchOptions) { o.AssigneeID = strconv.FormatInt(doerID, 10) })) | ||||
| 	if err != nil { | ||||
| 		return nil, err | ||||
| 	} | ||||
| 	ret.CreateCount, err = issue_indexer.CountIssues(ctx, opts.Copy(func(o *issue_indexer.SearchOptions) { o.PosterID = optional.Some(doerID) })) | ||||
| 	ret.CreateCount, err = issue_indexer.CountIssues(ctx, opts.Copy(func(o *issue_indexer.SearchOptions) { o.PosterID = strconv.FormatInt(doerID, 10) })) | ||||
| 	if err != nil { | ||||
| 		return nil, err | ||||
| 	} | ||||
|   | ||||
		Reference in New Issue
	
	Block a user