Skip to content

Commit daa4e92

Browse files
committed
Support GitBucket 4.35.0
1 parent a6a4b89 commit daa4e92

File tree

5 files changed

+37
-32
lines changed

5 files changed

+37
-32
lines changed

build.sbt

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
organization := "io.github.gitbucket"
22
name := "gitbucket-gist-plugin"
3-
version := "4.19.0"
3+
version := "4.20.0"
44
scalaVersion := "2.13.3"
5-
gitbucketVersion := "4.34.0"
5+
gitbucketVersion := "4.35.0"
66

77
scalacOptions := Seq("-deprecation", "-feature", "-language:postfixOps")
88
javacOptions in compile ++= Seq("-target", "8", "-source", "8")

src/main/scala/Plugin.scala

+2-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ class Plugin extends gitbucket.core.plugin.Plugin {
4141
new Version("4.16.0"),
4242
new Version("4.17.0"),
4343
new Version("4.18.0"),
44-
new Version("4.19.0")
44+
new Version("4.19.0"),
45+
new Version("4.20.0")
4546
)
4647

4748
override def initialize(registry: PluginRegistry, context: ServletContext, settings: SystemSettings): Unit = {

src/main/scala/gitbucket/gist/controller/GistController.scala

+19-18
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ trait GistControllerBase extends ControllerBase {
211211
commits
212212
)
213213
}
214-
case Left(_) => NotFound
214+
case Left(_) => NotFound()
215215
}
216216
}
217217
}
@@ -231,10 +231,10 @@ trait GistControllerBase extends ControllerBase {
231231
defining(JGitUtil.getContentFromId(git, file.id, false).get){ bytes =>
232232
RawData(FileUtil.getMimeType(file.name, bytes), bytes)
233233
}
234-
} getOrElse NotFound
235-
} else Unauthorized
234+
} getOrElse NotFound()
235+
} else Unauthorized()
236236
}
237-
} else NotFound
237+
} else NotFound()
238238
}
239239

240240
get("/gist/:userName/:repoName/download/*"){
@@ -283,7 +283,7 @@ trait GistControllerBase extends ControllerBase {
283283
gists = result._1,
284284
createSnippet = createSnippet
285285
)
286-
} getOrElse NotFound
286+
} getOrElse NotFound()
287287
}
288288

289289
get("/gist/:userName"){
@@ -333,7 +333,7 @@ trait GistControllerBase extends ControllerBase {
333333

334334
redirect(s"/gist/${loginAccount.userName}/${repoName}")
335335

336-
} getOrElse NotFound
336+
} getOrElse NotFound()
337337
}
338338
})
339339

@@ -349,7 +349,7 @@ trait GistControllerBase extends ControllerBase {
349349
getForkedGists(userName, repoName),
350350
isEditable(userName, loginUserGroups)
351351
)
352-
} getOrElse NotFound
352+
} getOrElse NotFound()
353353
}
354354

355355
////////////////////////////////////////////////////////////////////////////////
@@ -366,15 +366,16 @@ trait GistControllerBase extends ControllerBase {
366366
helpers.markdown(
367367
markdown = params("content"),
368368
repository = RepositoryInfo(
369-
owner = userName,
370-
name = repoName,
371-
repository = null,
372-
issueCount = 0,
373-
pullCount = 0,
374-
forkedCount = 0,
375-
branchList = Nil,
376-
tags = Nil,
377-
managers = Nil
369+
owner = userName,
370+
name = repoName,
371+
repository = null,
372+
issueCount = 0,
373+
pullCount = 0,
374+
forkedCount = 0,
375+
milestoneCount = 0,
376+
branchList = Nil,
377+
tags = Nil,
378+
managers = Nil
378379
),
379380
branch = "master",
380381
enableWikiLink = false,
@@ -393,7 +394,7 @@ trait GistControllerBase extends ControllerBase {
393394
getGist(userName, repoName).map { gist =>
394395
registerGistComment(userName, repoName, form.content, loginAccount.userName)
395396
redirect(s"/gist/${userName}/${repoName}")
396-
} getOrElse NotFound
397+
} getOrElse NotFound()
397398
})
398399

399400
ajaxPost("/gist/:userName/:repoName/_comments/:commentId/_delete")(usersOnly {
@@ -431,7 +432,7 @@ trait GistControllerBase extends ControllerBase {
431432
)
432433
}
433434
}
434-
} getOrElse NotFound
435+
} getOrElse NotFound()
435436
})
436437

437438
ajaxPost("/gist/:userName/:repoName/_comments/:commentId/_update", commentForm)(usersOnly { form =>

src/main/scala/gitbucket/gist/model/Gist.scala

+13-10
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package gitbucket.gist.model
22

3+
import gitbucket.core.issues.milestones.html.milestone
4+
35
trait GistComponent { self: gitbucket.core.model.Profile =>
46
import profile.api._
57
import self._
@@ -16,7 +18,7 @@ trait GistComponent { self: gitbucket.core.model.Profile =>
1618
val originUserName = column[String]("ORIGIN_USER_NAME")
1719
val originRepositoryName = column[String]("ORIGIN_REPOSITORY_NAME")
1820
val mode = column[String]("MODE")
19-
def * = (userName, repositoryName, title, description, registeredDate, updatedDate, originUserName.?, originRepositoryName.?, mode) <> (Gist.tupled, Gist.unapply)
21+
def * = (userName, repositoryName, title, description, registeredDate, updatedDate, originUserName.?, originRepositoryName.?, mode).<>(Gist.tupled, Gist.unapply)
2022
}
2123
}
2224

@@ -33,15 +35,16 @@ case class Gist(
3335
){
3436
def toRepositoryInfo = {
3537
gitbucket.core.service.RepositoryService.RepositoryInfo(
36-
owner = userName,
37-
name = repositoryName,
38-
repository = null,
39-
issueCount = 0,
40-
pullCount = 0,
41-
forkedCount = 0,
42-
branchList = Nil,
43-
tags = Nil,
44-
managers = Nil
38+
owner = userName,
39+
name = repositoryName,
40+
repository = null,
41+
issueCount = 0,
42+
pullCount = 0,
43+
forkedCount = 0,
44+
milestoneCount = 0,
45+
branchList = Nil,
46+
tags = Nil,
47+
managers = Nil
4548
)
4649
}
4750
}

src/main/scala/gitbucket/gist/model/GistComment.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ trait GistCommentComponent { self: gitbucket.core.model.Profile =>
1616
val content = column[String]("CONTENT")
1717
val registeredDate = column[java.util.Date]("REGISTERED_DATE")
1818
val updatedDate = column[java.util.Date]("UPDATED_DATE")
19-
def * = (userName, repositoryName, commentId, commentedUserName, content, registeredDate, updatedDate) <> (GistComment.tupled, GistComment.unapply)
19+
def * = (userName, repositoryName, commentId, commentedUserName, content, registeredDate, updatedDate).<>(GistComment.tupled, GistComment.unapply)
2020
}
2121
}
2222

0 commit comments

Comments
 (0)