Commit fd16e0a8 authored by Björn Eyselein's avatar Björn Eyselein
Browse files

dependency updates

parent 2febe70f
{"name":"sbt","version":"1.5.5","bspVersion":"2.0.0-M5","languages":["scala"],"argv":["/usr/lib/jvm/java-11-openjdk/bin/java","-Xms100m","-Xmx100m","-classpath","/usr/share/sbt/bin/sbt-launch.jar","xsbt.boot.Boot","-bsp","--sbt-launch-jar=/usr/share/sbt/bin/sbt-launch.jar"]}
\ No newline at end of file
version = 2.7.5
align = more
maxColumn = 120
continuationIndent.defnSite = 2
assumeStandardLibraryStripMargin = true
......@@ -46,11 +46,11 @@ class AdminController @Inject()(cc: ControllerComponents, protected val tableDef
def onRead: Course => Future[Result] = { newCourse =>
tableDefs.futureInsertCourse(newCourse) map {
_ => Redirect(routes.AdminController.index())
_ => Redirect(routes.AdminController.index)
}
}
FormMappings.newCourseForm.bindFromRequest.fold(onError, onRead)
FormMappings.newCourseForm.bindFromRequest().fold(onError, onRead)
}
// Collections
......@@ -91,7 +91,7 @@ class AdminController @Inject()(cc: ControllerComponents, protected val tableDef
}
}
FormMappings.newCollectionForm.bindFromRequest.fold(onError, onRead)
FormMappings.newCollectionForm.bindFromRequest().fold(onError, onRead)
}
// Flashcards
......
......@@ -31,7 +31,7 @@ class HomeController @Inject()(cc: ControllerComponents, protected val tableDefs
def acceptDPS: EssentialAction = futureWithUser { user =>
implicit request =>
tableDefs.futureUserAcceptedDps(user).map {
_ => Redirect(routes.HomeController.index())
_ => Redirect(routes.HomeController.index)
}
}
......@@ -45,14 +45,14 @@ class HomeController @Inject()(cc: ControllerComponents, protected val tableDefs
def registerForCourse(courseId: Int): EssentialAction = futureWithUser { user =>
implicit request =>
tableDefs.futureRegisterUserForCourse(user.username, courseId).map {
_ => Redirect(controllers.routes.HomeController.registerForCoursesForm())
_ => Redirect(controllers.routes.HomeController.registerForCoursesForm)
}
}
def unregisterForCourse(courseId: Int): EssentialAction = futureWithUser { user =>
implicit request =>
tableDefs.futureUnregisterUserFromCourse(user.username, courseId).map {
_ => Redirect(controllers.routes.HomeController.registerForCoursesForm())
_ => Redirect(controllers.routes.HomeController.registerForCoursesForm)
}
}
......
......@@ -36,7 +36,7 @@ class LoginController @Inject()(cc: ControllerComponents, val dbConfigProvider:
tableDefs.futureInsertUser(newUser) flatMap {
case false => Future(BadRequest("Could not save user!"))
case true => tableDefs.futureSavePwHash(pwHash) map {
_ => Redirect(routes.LoginController.loginForm())
_ => Redirect(routes.LoginController.loginForm)
}
}
}
......@@ -53,12 +53,12 @@ class LoginController @Inject()(cc: ControllerComponents, val dbConfigProvider:
val onRead: LoginFormValues => Future[Result] = { credentials =>
tableDefs.futureUserByUserName(credentials.username) flatMap {
case None => Future(Redirect(controllers.routes.LoginController.registerForm()))
case None => Future(Redirect(controllers.routes.LoginController.registerForm))
case Some(user) => tableDefs.futurePwHashForUser(user) map {
case None => BadRequest("Cannot change password!")
case Some(userPassword) =>
if (credentials.password isBcrypted userPassword.pwHash) {
Redirect(controllers.routes.HomeController.index()).withSession(idName -> user.username)
Redirect(controllers.routes.HomeController.index).withSession(idName -> user.username)
} else {
Ok(views.html.forms.loginForm(FormMappings.loginValuesForm.fill(credentials)))
}
......@@ -74,7 +74,7 @@ class LoginController @Inject()(cc: ControllerComponents, val dbConfigProvider:
}
def logout: Action[AnyContent] = Action {
implicit request => Redirect(routes.LoginController.loginForm()).withNewSession
implicit request => Redirect(routes.LoginController.loginForm).withNewSession
}
def changePwForm: EssentialAction = futureWithUser { user =>
......@@ -109,7 +109,7 @@ class LoginController @Inject()(cc: ControllerComponents, val dbConfigProvider:
tableDefs.futureUpdatePwHashForUser(user, changePwFormValues.firstNewPw.bcrypt) map {
case false => ???
case true => Redirect(routes.HomeController.index())
case true => Redirect(routes.HomeController.index)
}
} else {
Future.successful(BadRequest(views.html.forms.changePwForm(user, FormMappings.changePwForm.fill(changePwFormValues), hasPw)))
......
......@@ -39,7 +39,7 @@ class LtiController @Inject()(cc: ControllerComponents, protected val tableDefs:
user <- selectOrInsertUser(ltiFormValues.username)
maybePw <- tableDefs.futurePwHashForUser(user)
} yield {
val baseRedirect = Redirect(routes.HomeController.index()).withSession(idName -> user.username)
val baseRedirect = Redirect(routes.HomeController.index).withSession(idName -> user.username)
if (maybePw.isEmpty) baseRedirect.flashing("no_pw_set" -> maybePw.isDefined.toString)
else baseRedirect
......
......@@ -18,7 +18,7 @@ trait Secured {
private def username(request: RequestHeader): Option[String] = request.session.get(idName)
private def onUnauthorized(request: RequestHeader): Result = Redirect(controllers.routes.LoginController.loginForm()).withNewSession
private def onUnauthorized(request: RequestHeader): Result = Redirect(controllers.routes.LoginController.loginForm).withNewSession
private def futureOnUnauthorized(request: RequestHeader): Future[Result] =
Future(onUnauthorized(request))
......
......@@ -45,7 +45,7 @@
<p>Mit dem Bestätigen der Einverständniserklärung erklären Sie, dass Sie die Datenschutzerklärung zur Kenntnis genommen haben und damit Einverstanden sind.</p>
</div>
<div class="card-action">
<a href="@routes.HomeController.acceptDPS()">Akzeptieren</a>
<a href="@routes.HomeController.acceptDPS">Akzeptieren</a>
</div>
</div>
</div>
......
......@@ -13,5 +13,5 @@
.
</p>
<p><a href="@routes.HomeController.index()">Zurück zur Kursübersicht</a></p>
<p><a href="@routes.HomeController.index">Zurück zur Kursübersicht</a></p>
}
......@@ -52,7 +52,7 @@
<div class="row">
<div class="col s12">
<a class="btn btn-large waves-effect waves-block @accentColor" href="@routes.HomeController.index()">
<a class="btn btn-large waves-effect waves-block @accentColor" href="@routes.HomeController.index">
Zu meinen Kursen</a>
</div>
</div>
......
......@@ -10,7 +10,7 @@
<h2 class="center-align">@title</h2>
@helper.form(routes.LoginController.register(), Symbol("class") -> "col s12") {
@helper.form(routes.LoginController.register, Symbol("class") -> "col s12") {
@helper.CSRF.formField
......
......@@ -42,7 +42,7 @@
@if(repeatCount == 0) {
<a class="grey-text">Wiederholen</a>
} else {
<a href="@routes.HomeController.repeat()">Wiederholen</a>
<a href="@routes.HomeController.repeat">Wiederholen</a>
}
</div>
</div>
......
......@@ -26,7 +26,7 @@
@endUrl = @{
maybeCourseAndColl match {
case None => {
routes.HomeController.index()
routes.HomeController.index
}
case Some((course, collection)) => {
routes.HomeController.collection(course.id, collection.id)
......@@ -74,7 +74,7 @@
<i class="material-icons left">record_voice_over</i> Frage vorlesen
</button>
<button class="btn waves-effect @primaryColor" id="checkSolutionBtn" data-href="@routes.ApiController.checkSolution()">
<button class="btn waves-effect @primaryColor" id="checkSolutionBtn" data-href="@routes.ApiController.checkSolution">
Lösung testen
</button>
......
......@@ -3,7 +3,7 @@
@(title: String, maybeUser: Option[User], scripts: Html = Html(""))(content: Html)
@leftNavigation = {
<li><a href="@routes.HomeController.index()">Startseite</a></li>
<li><a href="@routes.HomeController.index">Startseite</a></li>
}
@rightNavigation = {
......@@ -12,14 +12,14 @@
@maybeUser match {
case Some(user) => {
@if(user.isAdmin) {
<li><a href="@routes.AdminController.index()">Administration</a></li>
<li><a href="@routes.AdminController.index">Administration</a></li>
}
<li><a href="@routes.HomeController.userPage()">Nutzer: @user.username </a></li>
<li><a href="@routes.LoginController.logout()">Logout</a></li>
<li><a href="@routes.HomeController.userPage">Nutzer: @user.username </a></li>
<li><a href="@routes.LoginController.logout">Logout</a></li>
}
case None => {
<li><a href="@routes.LoginController.loginForm()">Login</a></li>
<li><a href="@routes.LoginController.registerForm()">Registrieren</a></li>
<li><a href="@routes.LoginController.loginForm">Login</a></li>
<li><a href="@routes.LoginController.registerForm">Registrieren</a></li>
}
}
}
......
......@@ -2,26 +2,26 @@
@(user: User, courses: Seq[Course])
@title = @{
s"Nutzer '${user.username}'"
}
@title = @{
s"Nutzer '${user.username}'"
}
@main(title, Some(user)) {
<h4 class="center-align">@title</h4>
@main(title, Some(user)) {
<h4 class="center-align">@title</h4>
<hr>
<hr>
<section>
<h5>Meine Kurse</h5>
@if(courses.nonEmpty) {
<ul class="collection">
@for(course <- courses) {
<li class="collection-item">@course.name</li>
}
</ul>
} else {
<p class="red-text">Sie sind noch nicht in einem Kurs registriert.</p>
<section>
<h5>Meine Kurse</h5>
@if(courses.nonEmpty) {
<ul class="collection">
@for(course <- courses) {
<li class="collection-item">@course.name</li>
}
</section>
</ul>
} else {
<p class="red-text">Sie sind noch nicht in einem Kurs registriert.</p>
}
</section>
}
}
......@@ -4,27 +4,27 @@ organization := "de.uniwue"
version := "1.0-SNAPSHOT"
lazy val root = (project in file(".")).enablePlugins(PlayScala)
.settings(packageName in Universal := s"${name.value}")
lazy val root = (project in file("."))
.enablePlugins(PlayScala)
.settings(Universal / packageName := s"${name.value}")
TwirlKeys.templateImports += "model.TemplateConsts._"
scalaVersion := "2.13.1"
scalaVersion := "2.13.6"
updateOptions := updateOptions.value.withCachedResolution(cachedResoluton = true)
// updateOptions := updateOptions.value.withCachedResolution(cachedResoluton = true)
val webJarDependencies = Seq(
// FIXME: remove jquery?!?
"org.webjars.npm" % "jquery" % "3.4.1",
"org.webjars.npm" % "types__jquery" % "3.3.31",
"org.webjars.npm" % "materialize-css" % "1.0.0",
"org.webjars.npm" % "jquery" % "3.6.0",
"org.webjars.npm" % "types__jquery" % "3.5.6",
"org.webjars.npm" % "materialize-css" % "1.0.0",
"org.webjars.npm" % "types__materialize-css" % "1.0.6"
)
dependencyOverrides ++= Seq(
"org.webjars.npm" % "types__sizzle" % "2.3.2",
"org.webjars.npm" % "types__cash" % "0.0.3",
"org.webjars.npm" % "types__cash" % "0.0.3"
)
PlayKeys.playDefaultPort := 9090
......@@ -33,24 +33,16 @@ libraryDependencies ++= webJarDependencies
libraryDependencies ++= Seq(
guice,
"org.scalatestplus.play" %% "scalatestplus-play" % "4.0.3" % Test,
"mysql" % "mysql-connector-java" % "8.0.17",
"org.scalatestplus.play" %% "scalatestplus-play" % "5.1.0" % Test,
"mysql" % "mysql-connector-java" % "8.0.26",
// Better enums for scala
"com.beachape" %% "enumeratum-play" % "1.5.16",
"com.beachape" %% "enumeratum-play-json" % "1.5.16",
"com.typesafe.play" %% "play-slick" % "4.0.2",
"com.typesafe.play" %% "play-slick-evolutions" % "4.0.2",
"com.github.t3hnar" %% "scala-bcrypt" % "4.1",
"com.beachape" %% "enumeratum-play" % "1.7.0",
"com.beachape" %% "enumeratum-play-json" % "1.7.0",
"com.typesafe.play" %% "play-slick" % "5.0.0",
"com.typesafe.play" %% "play-slick-evolutions" % "5.0.0",
"com.github.t3hnar" %% "scala-bcrypt" % "4.3.0",
// Betterfiles
"com.github.pathikrit" %% "better-files" % "3.8.0",
"org.apache.poi" % "poi" % "4.1.0",
"org.apache.poi" % "poi-ooxml" % "4.1.0"
"com.github.pathikrit" %% "better-files" % "3.9.1",
"org.apache.poi" % "poi" % "5.0.0",
"org.apache.poi" % "poi-ooxml" % "5.0.0"
)
......@@ -32,7 +32,7 @@ slick.dbs {
db {
driver = com.mysql.cj.jdbc.Driver
url = "jdbc:mysql://localhost/wuekabel?useSSL=false&serverTimezone=Europe/Berlin"
url = "jdbc:mysql://localhost:3906/wuekabel?useSSL=false&serverTimezone=Europe/Berlin"
user = "wuekabel"
password = "1234"
}
......
version: '3.3'
volumes:
db_volume: { }
services:
mariadb:
image: mariadb
restart: always
ports:
- "3906:3306"
volumes:
- type: volume
source: db_volume
target: /var/lib/mysql
- type: bind
source: ./other_resources/create_all.sql
target: /docker-entrypoint-initdb.d/00_create_all.sql
environment:
- MYSQL_RANDOM_ROOT_PASSWORD=yes
sbt.version=1.3.2
sbt.version=1.5.5
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.7.3")
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.8.8")
// Wart remover for scalac
addSbtPlugin("org.wartremover" % "sbt-wartremover" % "2.4.2")
// Sbt Updates
addSbtPlugin("com.timushev.sbt" % "sbt-updates" % "0.4.0")
// SCoverage for Scala
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.5.1")
addSbtPlugin("com.timushev.sbt" % "sbt-updates" % "0.5.3")
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment