From ced6609d9ab75b42304df8888b1564a1a1795a5b Mon Sep 17 00:00:00 2001 From: Paul-Christian Volkmer Date: Tue, 5 Dec 2023 14:22:02 +0100 Subject: [PATCH] fix: add info severity to data quality report --- .../dnpm/etl/processor/monitoring/ReportService.kt | 1 + src/main/resources/static/style.css | 12 ++++++++++++ src/main/resources/templates/report.html | 1 + .../dnpm/etl/processor/services/ReportServiceTest.kt | 7 +++++-- 4 files changed, 19 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/dev/dnpm/etl/processor/monitoring/ReportService.kt b/src/main/kotlin/dev/dnpm/etl/processor/monitoring/ReportService.kt index ae36705..cc19d69 100644 --- a/src/main/kotlin/dev/dnpm/etl/processor/monitoring/ReportService.kt +++ b/src/main/kotlin/dev/dnpm/etl/processor/monitoring/ReportService.kt @@ -56,5 +56,6 @@ class ReportService( enum class Severity(@JsonValue val value: String) { ERROR("error"), WARNING("warning"), + INFO("info") } } \ No newline at end of file diff --git a/src/main/resources/static/style.css b/src/main/resources/static/style.css index 203ac56..73fa08a 100644 --- a/src/main/resources/static/style.css +++ b/src/main/resources/static/style.css @@ -1,6 +1,9 @@ :root { --table-border: rgba(96, 96, 96, 1); + --bg-blue: rgb(0, 74, 157); + --bg-blue-op: rgba(0, 74, 157, .35); + --bg-green: rgb(0, 128, 0); --bg-green-op: rgba(0, 128, 0, .35); @@ -181,6 +184,15 @@ td { font-family: monospace; } +td.bg-blue, th.bg-blue { + background: var(--bg-blue); + color: white; +} + +tr:has(td.bg-blue) { + background: var(--bg-blue-op); +} + td.bg-green, th.bg-green { background: var(--bg-green); color: white; diff --git a/src/main/resources/templates/report.html b/src/main/resources/templates/report.html index d9087bf..4aaad68 100644 --- a/src/main/resources/templates/report.html +++ b/src/main/resources/templates/report.html @@ -45,6 +45,7 @@ + [[ ${issue.severity} ]] [[ ${issue.severity} ]] [[ ${issue.severity} ]] [[ ${issue.message} ]] diff --git a/src/test/kotlin/dev/dnpm/etl/processor/services/ReportServiceTest.kt b/src/test/kotlin/dev/dnpm/etl/processor/services/ReportServiceTest.kt index 70efe2b..6f85f4e 100644 --- a/src/test/kotlin/dev/dnpm/etl/processor/services/ReportServiceTest.kt +++ b/src/test/kotlin/dev/dnpm/etl/processor/services/ReportServiceTest.kt @@ -41,6 +41,7 @@ class ReportServiceTest { { "patient": "4711", "issues": [ + { "severity": "info", "message": "Info Message" }, { "severity": "warning", "message": "Warning Message" }, { "severity": "error", "message": "Error Message" } ] @@ -50,8 +51,10 @@ class ReportServiceTest { val actual = this.reportService.deserialize(json) assertThat(actual).hasSize(2) - assertThat(actual[0].severity).isEqualTo(ReportService.Severity.WARNING) - assertThat(actual[0].message).isEqualTo("Warning Message") + assertThat(actual[0].severity).isEqualTo(ReportService.Severity.INFO) + assertThat(actual[0].message).isEqualTo("Info Message") + assertThat(actual[1].severity).isEqualTo(ReportService.Severity.WARNING) + assertThat(actual[1].message).isEqualTo("Warning Message") assertThat(actual[1].severity).isEqualTo(ReportService.Severity.ERROR) assertThat(actual[1].message).isEqualTo("Error Message") }