ukwa / w3act

w3act is an annotation and curation tool for building web archive collections
Apache License 2.0
19 stars 6 forks source link

Deselect All on Crawl Permissions page appears to be broken #675

Closed anjackson closed 1 year ago

anjackson commented 2 years ago

Start at https://www.webarchive.org.uk/act/crawlpermissions/list?organisation=-1

Click button, goes to https://www.webarchive.org.uk/act/crawlpermissions/list?organisation=&sel=deselectall

And throws the following error, presumably because the organisation=-1 is missing?

w3act_w3act.1.uuw5gmojc8d2@dev1    | 2022-05-18 13:37:21,097 [error] play - Cannot invoke the action, eventually got an error: java.lang.NumberFormatException: For input string: ""
w3act_w3act.1.uuw5gmojc8d2@dev1    | 2022-05-18 13:37:21,100 [error] application -
w3act_w3act.1.uuw5gmojc8d2@dev1    |
w3act_w3act.1.uuw5gmojc8d2@dev1    | ! @7nkf7cdcf - Internal server error, for (GET) [/act/crawlpermissions/list?organisation=&sel=deselectall] ->
w3act_w3act.1.uuw5gmojc8d2@dev1    |
w3act_w3act.1.uuw5gmojc8d2@dev1    | play.api.Application$$anon$1: Execution exception[[NumberFormatException: For input string: ""]]
w3act_w3act.1.uuw5gmojc8d2@dev1    |    at play.api.Application$class.handleError(Application.scala:296) ~[com.typesafe.play.play_2.11-2.3.10.jar:2.3.10]
w3act_w3act.1.uuw5gmojc8d2@dev1    |    at play.api.DefaultApplication.handleError(Application.scala:402) [com.typesafe.play.play_2.11-2.3.10.jar:2.3.10]
w3act_w3act.1.uuw5gmojc8d2@dev1    |    at play.core.server.netty.PlayDefaultUpstreamHandler$$anonfun$3$$anonfun$applyOrElse$4.apply(PlayDefaultUpstreamHandler.scala:320) [com.typesafe.play.play_2.11-2.3.10.jar
:2.3.10]
w3act_w3act.1.uuw5gmojc8d2@dev1    |    at play.core.server.netty.PlayDefaultUpstreamHandler$$anonfun$3$$anonfun$applyOrElse$4.apply(PlayDefaultUpstreamHandler.scala:320) [com.typesafe.play.play_2.11-2.3.10.jar
:2.3.10]
w3act_w3act.1.uuw5gmojc8d2@dev1    |    at scala.Option.map(Option.scala:145) [org.scala-lang.scala-library-2.11.1.jar:na]
w3act_w3act.1.uuw5gmojc8d2@dev1    | Caused by: java.lang.NumberFormatException: For input string: ""
w3act_w3act.1.uuw5gmojc8d2@dev1    |    at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65) ~[na:1.8.0_302]
w3act_w3act.1.uuw5gmojc8d2@dev1    |    at java.lang.Integer.parseInt(Integer.java:592) ~[na:1.8.0_302]
w3act_w3act.1.uuw5gmojc8d2@dev1    |    at java.lang.Integer.valueOf(Integer.java:766) ~[na:1.8.0_302]
w3act_w3act.1.uuw5gmojc8d2@dev1    |    at models.CrawlPermission.page(CrawlPermission.java:495) ~[w3act.w3act-2.3.3.jar:2.3.3]
w3act_w3act.1.uuw5gmojc8d2@dev1    |    at controllers.CrawlPermissionController.list(CrawlPermissionController.java:83) ~[w3act.w3act-2.3.3.jar:2.3.3]
crarugal commented 1 year ago

The deselection process does deselect all checked boxes, but it also reorders the list by a different criteria, which is probably not desired

For example, if we wanted to see all the outstanding queued licences for all the LDLs, it would present that list as ordered by "Created Date", by default: https://dev.webarchive.org.uk/act/crawlpermissions/list?organisation=-1&sel=deselectall

image

If the list is short, this isn't an issue, but it's usually the case that the outstanding list can be 100+ licences over a few pages of results. Currently, the deselection fix not only unticks the boxes, it also reorders the list so that results are ordered by the "Name" column, which doesn't preserve the initial order of the "Created Date"; some users may be confused by this.

The same list now deselected, but now also reordered by "Name": image

crarugal commented 1 year ago

Deselection works as expected, the order is retained, and the checkboxes are unchecked. Thanks Mindy