Skip to content

Commit

Permalink
Merge pull request #1228 from ProjectSidewalk/develop
Browse files Browse the repository at this point in the history
v4.4.1
  • Loading branch information
manaswisaha authored Mar 18, 2018
2 parents 4f97767 + 81befdb commit 7bb222f
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 20 deletions.
4 changes: 2 additions & 2 deletions app/models/daos/UserDAOImpl.scala
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ object UserDAOImpl {
| ON sidewalk.user.user_id = sidewalk.user_role.user_id
|INNER JOIN sidewalk.role
| ON sidewalk.role.role_id = sidewalk.user_role.role_id
|WHERE role.role in ('Owner', 'Administrator', 'Researcher')
|WHERE role.role IN ('Owner', 'Administrator', 'Researcher')
| AND audit_task.completed = true
""".stripMargin
)
Expand All @@ -257,7 +257,7 @@ object UserDAOImpl {
| ON sidewalk.user.user_id = sidewalk.user_role.user_id
|INNER JOIN sidewalk.role
| ON sidewalk.role.role_id = sidewalk.user_role.role_id
|WHERE role.role in ('Owner', 'Administrator', 'Researcher')
|WHERE role.role IN ('Owner', 'Administrator', 'Researcher')
""".stripMargin
)
}
Expand Down
2 changes: 1 addition & 1 deletion app/models/user/UserRoleTable.scala
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ object UserRoleTable {
}

def isResearcher(userId: UUID): Boolean = db.withSession { implicit session =>
getRole(userId) == "Researcher"
List("Researcher", "Administrator", "Owner").contains(getRole(userId))
}

def getUsersByType(userType: String): Query[UserTable, DBUser, Seq] = {
Expand Down
6 changes: 3 additions & 3 deletions app/views/admin/index.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -409,8 +409,8 @@ <h2>Onboarding Completion Time</h2>
<h2>Total Time Spent Auditing</h2>
<div class="col-lg-12">
<span>Standard Deviation (all users): </span><span id="all-audittimes-std"></span><br>
<span>Standard Deviation (registered users): </span><span id="reg-audittimes-std"></span><br>
<span>Standard Deviation (turker users): </span><span id="turker-audittimes-std"></span><br>
<span>Standard Deviation (registered users): </span><span id="reg-audittimes-std"></span><br>
<span>Standard Deviation (anon users): </span><span id="anon-audittimes-std"></span><br>
<span>
Note: An anonymous user is defined as an IP address that is associated with at least one completed audit task.
Expand All @@ -429,8 +429,8 @@ <h2>Missions Completed By Users</h2>
<div class="col-lg-12">
<p>
<span>Standard Deviation (all users): </span><span id="missions-std"></span><br>
<span>Standard Deviation (registered users): </span><span id="reg-missions-std"></span><br>
<span>Standard Deviation (turker users): </span><span id="turker-missions-std"></span><br>
<span>Standard Deviation (registered users): </span><span id="reg-missions-std"></span><br>
<span>Standard Deviation (anon users): </span><span id="anon-missions-std"></span><br>
<span>
Note: An anonymous user is defined as an IP address that is associated with at least one
Expand All @@ -447,8 +447,8 @@ <h2>Labels per User</h2>
<div class="col-lg-12">
<p>
<span>Standard Deviation (all users): </span><span id="all-labels-std"></span><br>
<span>Standard Deviation (registered users): </span><span id="reg-labels-std"></span><br>
<span>Standard Deviation (turker users): </span><span id="turker-labels-std"></span><br>
<span>Standard Deviation (registered users): </span><span id="reg-labels-std"></span><br>
<span>Standard Deviation (anon users): </span><span id="anon-labels-std"></span><br>
<span>
Note: An anonymous user is defined as an IP address that is associated with at least one
Expand Down
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import scalariform.formatter.preferences._

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

version := "4.4.0"
version := "4.4.1"

scalaVersion := "2.10.4"

Expand Down
25 changes: 12 additions & 13 deletions public/javascripts/Admin/src/Admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -1122,14 +1122,14 @@ function Admin(_, $, c3, turf, difficultRegionIds) {
count: regData[0][i].count,
user: regData[0][i].user_id,
is_researcher: regData[0][i].is_researcher
})
});
}
for (var i = 0; i < turkerData[0].length; i++) {
allData.push({
count: turkerData[0][i].count,
user: turkerData[0][i].user_id,
is_researcher: turkerData[0][i].is_researcher
})
});
}

var allStats = getSummaryStats(allData, "count");
Expand Down Expand Up @@ -1177,9 +1177,9 @@ function Admin(_, $, c3, turf, difficultRegionIds) {
var turkerFilteredChart = getVegaLiteHistogram(turkerData[0], turkerFilteredStats.mean, turkerFilteredStats.median, turkerFilteredHistOpts);
var anonChart = getVegaLiteHistogram(anonData[0], anonStats.mean, anonStats.median, anonHistOpts);

$("#missions-std").html((allStats.std).toFixed(2) + " Missions");
$("#reg-missions-std").html((regStats.std).toFixed(2) + " Missions");
$("#turker-missions-std").html((turkerStats.std).toFixed(2) + " Missions");
$("#missions-std").html((allFilteredStats.std).toFixed(2) + " Missions");
$("#reg-missions-std").html((regFilteredStats.std).toFixed(2) + " Missions");
$("#turker-missions-std").html((turkerFilteredStats.std).toFixed(2) + " Missions");
$("#anon-missions-std").html((anonStats.std).toFixed(2) + " Missions");

var combinedChart = {"hconcat": [allChart, turkerChart, regChart, anonChart]};
Expand Down Expand Up @@ -1215,14 +1215,14 @@ function Admin(_, $, c3, turf, difficultRegionIds) {
count: anonData[0][i].count,
user: anonData[0][i].ip_address,
is_researcher: anonData[0][i].is_researcher
})
});
}
for (var i = 0; i < regData[0].length; i++) {
allData.push({
count: regData[0][i].count,
user: regData[0][i].user_id,
is_researcher: regData[0][i].is_researcher
})
});
}
for (var i = 0; i < turkerData[0].length; i++) {
allData.push({
Expand Down Expand Up @@ -1277,9 +1277,9 @@ function Admin(_, $, c3, turf, difficultRegionIds) {
var turkerFilteredChart = getVegaLiteHistogram(turkerData[0], turkerFilteredStats.mean, turkerFilteredStats.median, turkerFilteredHistOpts);
var anonChart = getVegaLiteHistogram(anonData[0], anonStats.mean, anonStats.median, anonHistOpts);

$("#all-labels-std").html((allStats.std).toFixed(2) + " Labels");
$("#reg-labels-std").html((regStats.std).toFixed(2) + " Labels");
$("#turker-labels-std").html((turkerStats.std).toFixed(2) + " Labels");
$("#all-labels-std").html((allFilteredStats.std).toFixed(2) + " Labels");
$("#reg-labels-std").html((regFilteredStats.std).toFixed(2) + " Labels");
$("#turker-labels-std").html((turkerFilteredStats.std).toFixed(2) + " Labels");
$("#anon-labels-std").html((anonStats.std).toFixed(2) + " Labels");

var combinedChart = {"hconcat": [allChart, turkerChart, regChart, anonChart]};
Expand Down Expand Up @@ -1310,15 +1310,14 @@ function Admin(_, $, c3, turf, difficultRegionIds) {
var stats = getSummaryStats(data[0], "count");
var filteredStats = getSummaryStats(data[0], "count", {excludeResearchers:true});

$("#login-count-std").html((stats.std).toFixed(2) + " Logins");

var histOpts = {xAxisTitle:"# Logins per Registered User", binStep:5, xDomain:[0, stats.max]};
var histFilteredOpts = {xAxisTitle:"# Logins per Registered User", xDomain:[0, filteredStats.max],
excludeResearchers:true};

var chart = getVegaLiteHistogram(data[0], stats.mean, stats.median, histOpts);
var filteredChart = getVegaLiteHistogram(data[0], filteredStats.mean, filteredStats.median, histFilteredOpts);

$("#login-count-std").html((filteredStats.std).toFixed(2) + " Logins");
vega.embed("#login-count-chart", filteredChart, opt, function(error, results) {});

var checkbox = document.getElementById("login-count-include-researchers-checkbox").addEventListener("click", function(cb) {
Expand Down Expand Up @@ -1437,7 +1436,7 @@ function Admin(_, $, c3, turf, difficultRegionIds) {
self.toggleLayers = toggleLayers;
self.toggleAuditedStreetLayer = toggleAuditedStreetLayer;

$('.change-role').on('click', changeRole)
$('.change-role').on('click', changeRole);

return self;
}

0 comments on commit 7bb222f

Please sign in to comment.