mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-07 22:15:51 +01:00
(refs #529)Mentioned filter
This commit is contained in:
@@ -24,6 +24,10 @@ trait DashboardControllerBase extends ControllerBase {
|
|||||||
searchIssues("created_by")
|
searchIssues("created_by")
|
||||||
})
|
})
|
||||||
|
|
||||||
|
get("/dashboard/issues/mentioned")(usersOnly {
|
||||||
|
searchIssues("mentioned")
|
||||||
|
})
|
||||||
|
|
||||||
get("/dashboard/pulls")(usersOnly {
|
get("/dashboard/pulls")(usersOnly {
|
||||||
searchPullRequests("created_by", None)
|
searchPullRequests("created_by", None)
|
||||||
})
|
})
|
||||||
@@ -32,6 +36,10 @@ trait DashboardControllerBase extends ControllerBase {
|
|||||||
searchPullRequests("created_by", None)
|
searchPullRequests("created_by", None)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
get("/dashboard/pulls/mentioned")(usersOnly {
|
||||||
|
searchPullRequests("mentioned", None)
|
||||||
|
})
|
||||||
|
|
||||||
get("/dashboard/pulls/public")(usersOnly {
|
get("/dashboard/pulls/public")(usersOnly {
|
||||||
searchPullRequests("not_created_by", None)
|
searchPullRequests("not_created_by", None)
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ trait IssuesService {
|
|||||||
* Returns the search result against issues.
|
* Returns the search result against issues.
|
||||||
*
|
*
|
||||||
* @param condition the search condition
|
* @param condition the search condition
|
||||||
* @param filterUser the filter user name (key is "all", "assigned", "created_by" or "not_created_by", value is the user name)
|
* @param filterUser the filter user name (key is "all", "assigned", "created_by", "not_created_by" or "mentioned", value is the user name)
|
||||||
* @param pullRequest if true then returns only pull requests, false then returns only issues.
|
* @param pullRequest if true then returns only pull requests, false then returns only issues.
|
||||||
* @param offset the offset for pagination
|
* @param offset the offset for pagination
|
||||||
* @param limit the limit for pagination
|
* @param limit the limit for pagination
|
||||||
@@ -175,6 +175,7 @@ trait IssuesService {
|
|||||||
(t1.assignedUserName === condition.assigned.get.bind, condition.assigned.isDefined) &&
|
(t1.assignedUserName === condition.assigned.get.bind, condition.assigned.isDefined) &&
|
||||||
(t1.openedUserName === condition.author.get.bind, condition.author.isDefined) &&
|
(t1.openedUserName === condition.author.get.bind, condition.author.isDefined) &&
|
||||||
(t1.pullRequest === pullRequest.bind) &&
|
(t1.pullRequest === pullRequest.bind) &&
|
||||||
|
// Label filter
|
||||||
(IssueLabels filter { t2 =>
|
(IssueLabels filter { t2 =>
|
||||||
(t2.byIssue(t1.userName, t1.repositoryName, t1.issueId)) &&
|
(t2.byIssue(t1.userName, t1.repositoryName, t1.issueId)) &&
|
||||||
(t2.labelId in
|
(t2.labelId in
|
||||||
@@ -183,11 +184,18 @@ trait IssuesService {
|
|||||||
(t3.labelName inSetBind condition.labels)
|
(t3.labelName inSetBind condition.labels)
|
||||||
} map(_.labelId)))
|
} map(_.labelId)))
|
||||||
} exists, condition.labels.nonEmpty) &&
|
} exists, condition.labels.nonEmpty) &&
|
||||||
(Repositories filter { t3 =>
|
// Visibility filter
|
||||||
(t3.byRepository(t1.userName, t1.repositoryName)) &&
|
(Repositories filter { t2 =>
|
||||||
(t3.isPrivate === (condition.visibility == Some("private")).bind)
|
(t2.byRepository(t1.userName, t1.repositoryName)) &&
|
||||||
|
(t2.isPrivate === (condition.visibility == Some("private")).bind)
|
||||||
} exists, condition.visibility.nonEmpty) &&
|
} exists, condition.visibility.nonEmpty) &&
|
||||||
(t1.userName inSetBind condition.groups, condition.groups.nonEmpty)
|
// Organization (group) filter
|
||||||
|
(t1.userName inSetBind condition.groups, condition.groups.nonEmpty) &&
|
||||||
|
// Mentioned filter
|
||||||
|
((t1.openedUserName === filterUser("mentioned").bind) || t1.assignedUserName === filterUser("mentioned").bind ||
|
||||||
|
(IssueComments filter { t2 =>
|
||||||
|
(t2.byIssue(t1.userName, t1.repositoryName, t1.issueId)) && (t2.commentedUserName === filterUser("mentioned").bind)
|
||||||
|
} exists), filterUser.get("mentioned").isDefined)
|
||||||
}
|
}
|
||||||
|
|
||||||
def createIssue(owner: String, repository: String, loginUser: String, title: String, content: Option[String],
|
def createIssue(owner: String, repository: String, loginUser: String, title: String, content: Option[String],
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
<ul class="nav nav-pills-group pull-left fill-width">
|
<ul class="nav nav-pills-group pull-left fill-width">
|
||||||
<li class="@if(filter == "created_by"){active} first"><a href="@path/dashboard/issues/created_by@condition.toURL">Created</a></li>
|
<li class="@if(filter == "created_by"){active} first"><a href="@path/dashboard/issues/created_by@condition.toURL">Created</a></li>
|
||||||
<li class="@if(filter == "assigned"){active}"><a href="@path/dashboard/issues/assigned@condition.toURL">Assigned</a></li>
|
<li class="@if(filter == "assigned"){active}"><a href="@path/dashboard/issues/assigned@condition.toURL">Assigned</a></li>
|
||||||
<li class="@if(filter == "mentioned"){active} last"><a href="@path/dashboard/mentioned/assigned@condition.toURL">Mentioned</a></li>
|
<li class="@if(filter == "mentioned"){active} last"><a href="@path/dashboard/issues/mentioned@condition.toURL">Mentioned</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
<table class="table table-bordered table-hover table-issues">
|
<table class="table table-bordered table-hover table-issues">
|
||||||
<tr>
|
<tr>
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
<ul class="nav nav-pills-group pull-left fill-width">
|
<ul class="nav nav-pills-group pull-left fill-width">
|
||||||
<li class="@if(filter == "created_by"){active} first"><a href="@path/dashboard/pulls/created_by@condition.toURL">Created</a></li>
|
<li class="@if(filter == "created_by"){active} first"><a href="@path/dashboard/pulls/created_by@condition.toURL">Created</a></li>
|
||||||
<li class="@if(filter == "assigned"){active}"><a href="@path/dashboard/pulls/assigned@condition.toURL">Assigned</a></li>
|
<li class="@if(filter == "assigned"){active}"><a href="@path/dashboard/pulls/assigned@condition.toURL">Assigned</a></li>
|
||||||
<li class="@if(filter == "mentioned"){active} last"><a href="@path/dashboard/mentioned/assigned@condition.toURL">Mentioned</a></li>
|
<li class="@if(filter == "mentioned"){active} last"><a href="@path/dashboard/pulls/mentioned@condition.toURL">Mentioned</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
<table class="table table-bordered table-hover table-issues">
|
<table class="table table-bordered table-hover table-issues">
|
||||||
<tr>
|
<tr>
|
||||||
|
|||||||
Reference in New Issue
Block a user