diff --git a/app/assets/javascripts/test/snapshots/public/test-bundle/test/backend-snapshot-tests/timetracking.e2e.js.md b/app/assets/javascripts/test/snapshots/public/test-bundle/test/backend-snapshot-tests/timetracking.e2e.js.md index dfebc7ef7a7..1e06a28873a 100644 --- a/app/assets/javascripts/test/snapshots/public/test-bundle/test/backend-snapshot-tests/timetracking.e2e.js.md +++ b/app/assets/javascripts/test/snapshots/public/test-bundle/test/backend-snapshot-tests/timetracking.e2e.js.md @@ -23,6 +23,7 @@ Generated by [AVA](https://ava.li). finishedInstances: 0, openInstances: 19, paused: false, + priority: 100, projectName: 'Test_Project', totalInstances: 20, totalTasks: 2, diff --git a/app/assets/javascripts/test/snapshots/public/test-bundle/test/backend-snapshot-tests/timetracking.e2e.js.snap b/app/assets/javascripts/test/snapshots/public/test-bundle/test/backend-snapshot-tests/timetracking.e2e.js.snap index ac58535cfed..d46b42d3c16 100644 Binary files a/app/assets/javascripts/test/snapshots/public/test-bundle/test/backend-snapshot-tests/timetracking.e2e.js.snap and b/app/assets/javascripts/test/snapshots/public/test-bundle/test/backend-snapshot-tests/timetracking.e2e.js.snap differ diff --git a/app/controllers/ReportController.scala b/app/controllers/ReportController.scala index e03a809c597..829e7c5f496 100644 --- a/app/controllers/ReportController.scala +++ b/app/controllers/ReportController.scala @@ -19,6 +19,7 @@ object OpenTasksEntry { implicit val jsonFormat = Json.format[OpenTasksEntry] } case class ProjectProgressEntry(projectName: String, paused: Boolean, + priority: Long, totalTasks: Int, totalInstances: Int, openInstances: Int, @@ -40,7 +41,7 @@ class ReportDAO @Inject()(sqlClient: SQLClient, annotationDAO: AnnotationDAO)(im JOIN webknossos.user_experiences ue on ue._user = u._user ) - ,filteredProjects as (select p._id, p.name, p.paused + ,filteredProjects as (select p._id, p.name, p.paused, p.priority from webknossos.projects_ p JOIN webknossos.tasks_ t ON t._project = p._id @@ -49,7 +50,7 @@ class ReportDAO @Inject()(sqlClient: SQLClient, annotationDAO: AnnotationDAO)(im t.neededExperience_domain = ue.domain and t.neededExperience_value <= ue.value and not p.isblacklistedfromreport - group by p._id, p.name, p.paused) + group by p._id, p.name, p.paused, p.priority) ,projectModifiedTimes as (select p._id, MAX(a.modified) as modified from @@ -63,13 +64,14 @@ class ReportDAO @Inject()(sqlClient: SQLClient, annotationDAO: AnnotationDAO)(im p._id, p.name projectName, p.paused paused, + p.priority priority, count(t._id) totalTasks, sum(t.totalInstances) totalInstances, sum(t.openInstances) openInstances from filteredProjects p join webknossos.tasks_ t on p._id = t._project - group by p._id, p.name, p.paused) + group by p._id, p.name, p.paused, p.priority) ,s2 as (select p._id, count(a) activeInstances @@ -81,14 +83,14 @@ class ReportDAO @Inject()(sqlClient: SQLClient, annotationDAO: AnnotationDAO)(im ) - select s1.projectName, s1.paused, s1.totalTasks, s1.totalInstances, s1.openInstances, (s1.totalInstances - s1.openInstances - s2.activeInstances) finishedInstances, s2.activeInstances + select s1.projectName, s1.paused, s1.priority, s1.totalTasks, s1.totalInstances, s1.openInstances, (s1.totalInstances - s1.openInstances - s2.activeInstances) finishedInstances, s2.activeInstances from s1 join s2 on s1._id = s2._id join projectModifiedTimes pmt on s1._id = pmt._id where (not (s1.paused and s1.totalInstances = s1.openInstances)) and ((s1.openInstances > 0 and not s1.paused) or s2.activeInstances > 0 or pmt.modified > NOW() - INTERVAL '30 days') - """.as[(String, Boolean, Int, Int, Int, Int, Int)]) + """.as[(String, Boolean, Long, Int, Int, Int, Int, Int)]) } yield { - r.toList.map(row => ProjectProgressEntry(row._1, row._2, row._3, row._4, row._5, row._6, row._7)) + r.toList.map(row => ProjectProgressEntry(row._1, row._2, row._3, row._4, row._5, row._6, row._7, row._8)) } def getAssignmentsByProjectsFor(userId: ObjectId)(implicit ctx: DBAccessContext): Fox[Map[String, Int]] =