Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

7.19.8 #3555

Merged
merged 6 commits into from
May 28, 2024
Merged

7.19.8 #3555

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions app/controllers/TaskController.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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],
Expand Down Expand Up @@ -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(
Expand Down
6 changes: 3 additions & 3 deletions app/models/audit/AuditTaskInteractionTable.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand All @@ -292,6 +292,6 @@ object AuditTaskInteractionTable {
|) "time_diffs"
|WHERE diff < '00:05:00.000' AND diff > '00:00:00.000';""".stripMargin
).first
}
// }
}
}
12 changes: 0 additions & 12 deletions app/views/labelMap.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
});
</script>
}
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import play.PlayScala

name := """sidewalk-webpage"""

version := "7.19.7"
version := "7.19.8"

scalaVersion := "2.10.7"

Expand Down
2 changes: 1 addition & 1 deletion conf/cityparams.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
5 changes: 5 additions & 0 deletions conf/evolutions/default/232.sql
Original file line number Diff line number Diff line change
@@ -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';
5 changes: 4 additions & 1 deletion public/javascripts/Admin/src/Admin.GSVLabelView.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down