From da46677ea290ce436795322a14d7de251958396e Mon Sep 17 00:00:00 2001 From: Mike Bryant Date: Tue, 20 Aug 2024 15:56:21 +0100 Subject: [PATCH] Fix a few deprecation warnings and silence warnings for HTML files --- .travis.yml | 2 +- build.sbt | 1 + modules/admin/app/controllers/users/UserProfiles.scala | 2 +- modules/admin/app/views/admin/authoritativeSet/list.scala.html | 2 +- modules/admin/app/views/admin/userProfile/search.scala.html | 2 +- modules/admin/conf/users.routes | 2 +- modules/portal/app/views/common/postambleScripts.scala.html | 2 +- test/integration/admin/EntityViewsSpec.scala | 2 +- 8 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index b1b736e837..9b9d064aac 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,6 @@ language: scala scala: - - 2.13.3 + - 2.13.14 jdk: openjdk8 diff --git a/build.sbt b/build.sbt index e192014d33..0f0b440661 100644 --- a/build.sbt +++ b/build.sbt @@ -162,6 +162,7 @@ val commonSettings = Seq( "-Ywarn-unused:imports", "-unchecked", "-deprecation", + "-Wconf:cat=unused-imports&site=.*views.html.*:s", // Silence import warnings in Play html files ), resolvers ++= additionalResolvers, diff --git a/modules/admin/app/controllers/users/UserProfiles.scala b/modules/admin/app/controllers/users/UserProfiles.scala index 999bdb8678..575b90d85a 100644 --- a/modules/admin/app/controllers/users/UserProfiles.scala +++ b/modules/admin/app/controllers/users/UserProfiles.scala @@ -211,7 +211,7 @@ case class UserProfiles @Inject()( Ok(views.html.admin.userProfile.list(request.page, request.params)) } - def `export`: Action[AnyContent] = AdminAction.async { implicit request => + def exportInfo: Action[AnyContent] = AdminAction.async { implicit request => for { accounts <- accounts.findAll(PageParams.empty.withoutLimit) users <- userDataApi.list[UserProfile](PageParams.empty.withoutLimit) diff --git a/modules/admin/app/views/admin/authoritativeSet/list.scala.html b/modules/admin/app/views/admin/authoritativeSet/list.scala.html index b26969f78a..4cf5434501 100644 --- a/modules/admin/app/views/admin/authoritativeSet/list.scala.html +++ b/modules/admin/app/views/admin/authoritativeSet/list.scala.html @@ -17,7 +17,7 @@

@Messages("pagination.displayingItems", page.offset + 1, page.offset + page. } { @views.html.admin.common.sidebarActions { user => @views.html.admin.common.sidebarAction(user.hasPermission(ContentTypes.AuthoritativeSet, PermissionType.Create)) { - + @Messages("authoritativeSet.create") diff --git a/modules/admin/app/views/admin/userProfile/search.scala.html b/modules/admin/app/views/admin/userProfile/search.scala.html index 2a8fa9946a..f15a4f3ce8 100644 --- a/modules/admin/app/views/admin/userProfile/search.scala.html +++ b/modules/admin/app/views/admin/userProfile/search.scala.html @@ -13,7 +13,7 @@ } @views.html.admin.common.sidebarAction(user.isAdmin) { - + @Messages("userProfile.export") diff --git a/modules/admin/conf/users.routes b/modules/admin/conf/users.routes index 235bdd8e2a..5c4f7f694e 100644 --- a/modules/admin/conf/users.routes +++ b/modules/admin/conf/users.routes @@ -2,7 +2,7 @@ GET / @controllers.users.UserProfiles.search(params: services.search.SearchParams ?= services.search.SearchParams.empty, paging: utils.PageParams ?= utils.PageParams.empty) GET /list @controllers.users.UserProfiles.list(paging: utils.PageParams ?= utils.PageParams.empty) -GET /export @controllers.users.UserProfiles.export() +GET /export @controllers.users.UserProfiles.exportInfo() GET /create @controllers.users.UserProfiles.createUser() POST /create @controllers.users.UserProfiles.createUserPost() GET /syncDb @controllers.users.UserProfiles.syncFromDbPost() diff --git a/modules/portal/app/views/common/postambleScripts.scala.html b/modules/portal/app/views/common/postambleScripts.scala.html index b024f10d8b..b391161581 100644 --- a/modules/portal/app/views/common/postambleScripts.scala.html +++ b/modules/portal/app/views/common/postambleScripts.scala.html @@ -5,5 +5,5 @@ } else { } - + @extra diff --git a/test/integration/admin/EntityViewsSpec.scala b/test/integration/admin/EntityViewsSpec.scala index 11b73fe273..10084cffbc 100644 --- a/test/integration/admin/EntityViewsSpec.scala +++ b/test/integration/admin/EntityViewsSpec.scala @@ -266,7 +266,7 @@ class EntityViewsSpec extends IntegrationTestRunner { } "allow exporting users" in new ITestApp { - val csv = FakeRequest(controllers.users.routes.UserProfiles.export()) + val csv = FakeRequest(controllers.users.routes.UserProfiles.exportInfo()) .withUser(privilegedUser).call() status(csv) must equalTo(OK) header(HeaderNames.CONTENT_DISPOSITION, csv) must beSome.which { s =>