Fix bug on showing inline comments in Pull Request.

This commit is contained in:
Shintaro Murakami
2014-12-28 20:04:11 +09:00
parent 837b1e44a7
commit 6e2b67ec0b
14 changed files with 47 additions and 30 deletions

View File

@@ -12,8 +12,10 @@ import util.StringUtil._
trait CommitsService {
def getCommitComments(owner: String, repository: String, commitId: String)(implicit s: Session) =
CommitComments filter (_.byCommit(owner, repository, commitId)) list
def getCommitComments(owner: String, repository: String, commitId: String, isInPR: Boolean)(implicit s: Session) =
CommitComments filter {
t => t.byCommit(owner, repository, commitId) && (t.isInPR === isInPR || isInPR)
} list
def getCommitComment(owner: String, repository: String, commentId: String)(implicit s: Session) =
if (commentId forall (_.isDigit))
@@ -24,7 +26,7 @@ trait CommitsService {
None
def createCommitComment(owner: String, repository: String, commitId: String, loginUser: String,
content: String, fileName: Option[String], oldLine: Option[Int], newLine: Option[Int])(implicit s: Session): Int =
content: String, fileName: Option[String], oldLine: Option[Int], newLine: Option[Int], isInPR: Boolean)(implicit s: Session): Int =
CommitComments.autoInc insert CommitComment(
userName = owner,
repositoryName = repository,
@@ -35,7 +37,8 @@ trait CommitsService {
oldLine = oldLine,
newLine = newLine,
registeredDate = currentDate,
updatedDate = currentDate)
updatedDate = currentDate,
isInPR = isInPR)
def updateCommitComment(commentId: Int, content: String)(implicit s: Session) =
CommitComments