From 74ab64547576efec87228831eb5b1b5f18b814a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0est=C3=A1k=20V=C3=ADt?= Date: Thu, 15 Jun 2017 17:30:15 +0200 Subject: [PATCH] Added list of all project, including those not included by the filter --- app/assets/css/main.css | 4 ++++ app/controllers/Statistics.scala | 10 ++++++++++ app/views/affectedProjects.scala.html | 6 ++++++ app/views/dependencyDetailsInner.scala.html | 14 +++++++++++++- conf/routes | 1 + 5 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 app/views/affectedProjects.scala.html diff --git a/app/assets/css/main.css b/app/assets/css/main.css index 7f94457..cddaead 100644 --- a/app/assets/css/main.css +++ b/app/assets/css/main.css @@ -238,4 +238,8 @@ h3.library-identification{ padding-left: 1em; font-family: 'Glyphicons Halflings'; content: "\e209"; +} + +.sublist{ + padding-left: 23px; } \ No newline at end of file diff --git a/app/controllers/Statistics.scala b/app/controllers/Statistics.scala index 5faa382..59f7733 100644 --- a/app/controllers/Statistics.scala +++ b/app/controllers/Statistics.scala @@ -312,6 +312,16 @@ class Statistics @Inject()( } } + def affectedProjects(depId: Hashes) = ReadAction.async { implicit req => + val (lastRefreshTime, resultsFuture) = projectReportsProvider.resultsForVersions(versions) + resultsFuture flatMap { case (successfulResults, failedResults) => + val selection = dependencyCheckReportsParser.parseReports(successfulResults, failedResults) + Future.successful(Ok(views.html.affectedProjects( + dep = selection.groupedDependenciesByHashes(depId) + )).withHeaders("Content-type" -> "text/plain; charset=utf-8")) + } + } + def allFiles(selectorOption: Option[String]) = ReadAction.async { implicit req => val (lastRefreshTime, resultsFuture) = projectReportsProvider.resultsForVersions(versions) resultsFuture flatMap { allResults => diff --git a/app/views/affectedProjects.scala.html b/app/views/affectedProjects.scala.html new file mode 100644 index 0000000..20f7dea --- /dev/null +++ b/app/views/affectedProjects.scala.html @@ -0,0 +1,6 @@ +@(dep: GroupedDependency) + diff --git a/app/views/dependencyDetailsInner.scala.html b/app/views/dependencyDetailsInner.scala.html index 118bd1b..38f1948 100644 --- a/app/views/dependencyDetailsInner.scala.html +++ b/app/views/dependencyDetailsInner.scala.html @@ -63,7 +63,19 @@ - +
+ + @if(selectorOption.isDefined){ + +
+ } +