Team dashboards (#14159)

This commit is contained in:
Jimmy Praet 2020-12-27 20:58:03 +01:00 committed by GitHub
parent 25f8970b2c
commit 40274b4a93
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 148 additions and 47 deletions

View file

@ -138,6 +138,7 @@ type SearchRepoOptions struct {
Keyword string
OwnerID int64
PriorityOwnerID int64
TeamID int64
OrderBy SearchOrderBy
Private bool // Include private repositories in results
StarredByID int64
@ -294,6 +295,10 @@ func SearchRepositoryCondition(opts *SearchRepoOptions) builder.Cond {
cond = cond.And(accessCond)
}
if opts.TeamID > 0 {
cond = cond.And(builder.In("`repository`.id", builder.Select("`team_repo`.repo_id").From("team_repo").Where(builder.Eq{"`team_repo`.team_id": opts.TeamID})))
}
if opts.Keyword != "" {
// separate keyword
var subQueryCond = builder.NewCond()