Skip to content

Commit

Permalink
Filter repositories
Browse files Browse the repository at this point in the history
  • Loading branch information
kasancode committed Mar 31, 2019
1 parent a473e54 commit 7196cb3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import org.scalatra.{Created, NotFound, UnprocessableEntity}
import java.util.Date

import gitbucket.core.model.{Label, Milestone, Priority}
import gitbucket.core.service.IssuesService.IssueSearchCondition

import scala.collection.mutable

Expand Down Expand Up @@ -119,22 +120,25 @@ trait labelKanbanControllerBase extends ControllerBase {
val groups = user :: getGroupsByUserName(user)
val repositories = getVisibleRepositories(context.loginAccount, withoutPhysicalInfo = true)
.filter(r =>
groups.contains(r.owner) ||
getCollaborators(r.owner, r.repository.repositoryName).exists(c => c._1.collaboratorName == user))
(groups.contains(r.owner) ||
getCollaborators(r.owner, r.repository.repositoryName).exists(c => c._1.collaboratorName == user)) &&
countIssue(IssueSearchCondition(), false, (r.owner, r.repository.repositoryName)) > 0
)

JsonFormat(
ApiDataSetKanban(
repositories.flatMap(repository =>
getOpenIssues(repository.owner, repository.name)
.map(issue =>
ApiIssueKanban.applySummary(
issue,
getIssueLabels(repository.owner, repository.name, issue.issueId),
prefix,
getPriorities(repository.owner, repository.name)
repositories
.flatMap(repository =>
getOpenIssues(repository.owner, repository.name)
.map(issue =>
ApiIssueKanban.applySummary(
issue,
getIssueLabels(repository.owner, repository.name, issue.issueId),
prefix,
getPriorities(repository.owner, repository.name)
)
)
)
)
)
,
createSummaryLanes(repositories),
createSummaryDummyLanes()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,7 @@
package io.github.gitbucket.labelkanban.service

import java.util.{Date,Calendar}
import gitbucket.core.model.{
Issue,
PullRequest,
IssueComment,
IssueLabel,
Label,
Account,
Repository,
CommitState,
Role,
Milestone
Issue
}
import gitbucket.core.model.Profile._
import gitbucket.core.model.Profile.profile.blockingApi._
Expand Down

0 comments on commit 7196cb3

Please sign in to comment.