diff --git a/app/controllers/TaskController.scala b/app/controllers/TaskController.scala index 03f231d8a1..9101b8496d 100644 --- a/app/controllers/TaskController.scala +++ b/app/controllers/TaskController.scala @@ -28,7 +28,8 @@ import play.api.{Logger, Play} import play.api.libs.json._ import play.api.mvc._ import scala.collection.mutable.ListBuffer -import scala.concurrent.{ExecutionContext, Future} +//import scala.concurrent.{ExecutionContext, Future} +import scala.concurrent.Future /** * Holds the HTTP requests associated with tasks submitted through the explore page. @@ -37,7 +38,7 @@ import scala.concurrent.{ExecutionContext, Future} */ class TaskController @Inject() (implicit val env: Environment[User, SessionAuthenticator]) extends Silhouette[User, SessionAuthenticator] with ProvidesHeader { - implicit val context: ExecutionContext = play.api.libs.concurrent.Execution.Implicits.defaultContext +// implicit val context: ExecutionContext = play.api.libs.concurrent.Execution.Implicits.defaultContext val gf: GeometryFactory = new GeometryFactory(new PrecisionModel(), 4326) case class TaskPostReturnValue(auditTaskId: Int, streetEdgeId: Int, mission: Option[Mission], @@ -402,10 +403,12 @@ class TaskController @Inject() (implicit val env: Environment[User, SessionAuthe val eligibleUser: Boolean = List("Registered", "Administrator", "Owner").contains(identity.get.role.getOrElse("")) val envType: String = Play.configuration.getString("environment-type").get if (newLabels.nonEmpty && envType == "prod" && eligibleUser) { - for { - timeSpent <- secondsAudited(identity.get.userId.toString, newLabels.map(_._1).min, newLabels.map(_._2).max) - scistarterResponse <- sendSciStarterContributions(identity.get.email, newLabels.length, timeSpent) - } yield scistarterResponse + val timeSpent: Float = secondsAudited(identity.get.userId.toString, newLabels.map(_._1).min, newLabels.map(_._2).max) + val scistarterResponse: Future[Int] = sendSciStarterContributions(identity.get.email, newLabels.length, timeSpent) +// for { +// timeSpent <- secondsAudited(identity.get.userId.toString, newLabels.map(_._1).min, newLabels.map(_._2).max) +// scistarterResponse <- sendSciStarterContributions(identity.get.email, newLabels.length, timeSpent) +// } yield scistarterResponse } Future.successful(Ok(Json.obj( diff --git a/app/models/audit/AuditTaskInteractionTable.scala b/app/models/audit/AuditTaskInteractionTable.scala index de7c5521be..85e1817d3a 100644 --- a/app/models/audit/AuditTaskInteractionTable.scala +++ b/app/models/audit/AuditTaskInteractionTable.scala @@ -273,8 +273,8 @@ object AuditTaskInteractionTable { * @param timeRangeEnd A timestamp representing the end of the time range; should be the time when a label was placed. * @return */ - def secondsAudited(userId: String, timeRangeStartLabelId: Int, timeRangeEnd: Timestamp): Future[Float] = db.withSession { implicit session => - Future { + def secondsAudited(userId: String, timeRangeStartLabelId: Int, timeRangeEnd: Timestamp): Float = db.withSession { implicit session => +// Future { Q.queryNA[Float]( s"""SELECT extract( epoch FROM SUM(diff) ) AS seconds_contributed |FROM ( @@ -292,6 +292,6 @@ object AuditTaskInteractionTable { |) "time_diffs" |WHERE diff < '00:05:00.000' AND diff > '00:00:00.000';""".stripMargin ).first - } +// } } } diff --git a/app/views/labelMap.scala.html b/app/views/labelMap.scala.html index f7aa5945f5..c1f5ed1a4a 100644 --- a/app/views/labelMap.scala.html +++ b/app/views/labelMap.scala.html @@ -238,17 +238,5 @@ }); }); } - - // Fully destroy label modal when it's closed to prevent weird behavior when opening another. - $(window).on('click', function(e) { - var modal = $("#labelModal"); - if (modal != null && !(modal.hasClass('in'))) { - modal.modal('hide'); - setTimeout(function() { - modal.remove(); - $('.modal-backdrop').remove(); - }, 200) - } - }); } diff --git a/build.sbt b/build.sbt index 8c228d0791..d29510fa13 100644 --- a/build.sbt +++ b/build.sbt @@ -2,7 +2,7 @@ import play.PlayScala name := """sidewalk-webpage""" -version := "7.19.7" +version := "7.19.8" scalaVersion := "2.10.7" diff --git a/conf/cityparams.conf b/conf/cityparams.conf index bf5f6f7749..34e7901252 100644 --- a/conf/cityparams.conf +++ b/conf/cityparams.conf @@ -96,7 +96,7 @@ city-params { burnaby = "private" teaneck-nj = "public" walla-walla-wa = "private" - st-louis-mo = "private" + st-louis-mo = "public" } launch-date { newberg-or = "2019-01-31" diff --git a/conf/evolutions/default/232.sql b/conf/evolutions/default/232.sql new file mode 100644 index 0000000000..8690420f88 --- /dev/null +++ b/conf/evolutions/default/232.sql @@ -0,0 +1,5 @@ +# --- !Ups +INSERT INTO version VALUES ('7.19.8', now(), 'St. Louis server is now public, attempting to fix crashing servers.'); + +# --- !Downs +DELETE FROM version WHERE version_id = '7.19.8'; diff --git a/public/javascripts/Admin/src/Admin.GSVLabelView.js b/public/javascripts/Admin/src/Admin.GSVLabelView.js index e109289333..37b4616b56 100644 --- a/public/javascripts/Admin/src/Admin.GSVLabelView.js +++ b/public/javascripts/Admin/src/Admin.GSVLabelView.js @@ -481,7 +481,10 @@ function AdminGSVLabelView(admin, source) { } function showLabel(labelId) { - _resetModal(); + // Reset modal when gsv panorama is not found.gi + if (self.panorama.panorama.getStatus() === "ZERO_RESULTS") { + _resetModal(); + } self.modal.modal({ 'show': true