aboutsummaryrefslogtreecommitdiff
path: root/guix-data-service
diff options
context:
space:
mode:
authorDanjela Lura <danielaluraa@gmail.com>2020-06-24 14:15:16 +0200
committerChristopher Baines <mail@cbaines.net>2020-06-26 17:54:19 +0100
commitd442d408ee580e51faca26844deb5cabe3c971ac (patch)
tree873236e6cb719eea14bfc234896f0f61adac9a13 /guix-data-service
parent89aaf984ec5782666983bdfd6ab8d2997770bd2a (diff)
downloaddata-service-d442d408ee580e51faca26844deb5cabe3c971ac.tar
data-service-d442d408ee580e51faca26844deb5cabe3c971ac.tar.gz
Add locale values in the JSON response for the lint warnings page
Signed-off-by: Christopher Baines <mail@cbaines.net>
Diffstat (limited to 'guix-data-service')
-rw-r--r--guix-data-service/model/lint-warning.scm7
-rw-r--r--guix-data-service/web/revision/controller.scm10
-rw-r--r--guix-data-service/web/revision/html.scm4
3 files changed, 14 insertions, 7 deletions
diff --git a/guix-data-service/model/lint-warning.scm b/guix-data-service/model/lint-warning.scm
index e4bb1b1..6371772 100644
--- a/guix-data-service/model/lint-warning.scm
+++ b/guix-data-service/model/lint-warning.scm
@@ -63,15 +63,16 @@
(string-append "
SELECT DISTINCT ON (lint_warnings.id) lint_warnings.id,
lint_checkers.name, translated_lint_checker_descriptions.description,
- lint_checkers.network_dependent, packages.name, packages.version,
+ translated_lint_checker_descriptions.locale, lint_checkers.network_dependent,
+ packages.name, packages.version,
locations.file, locations.line, locations.column_number,
- lint_warning_messages.message
+ lint_warning_messages.message, lint_warning_messages.locale
FROM lint_warnings
INNER JOIN lint_checkers
ON lint_warnings.lint_checker_id = lint_checkers.id
INNER JOIN (
SELECT DISTINCT ON (lint_checkers.id) lint_checkers.id AS lint_checker_id,
- lint_checker_descriptions.description
+ lint_checker_descriptions.description, lint_checker_descriptions.locale
FROM guix_revision_lint_checkers
INNER JOIN guix_revisions
ON guix_revision_lint_checkers.guix_revision_id = guix_revisions.id
diff --git a/guix-data-service/web/revision/controller.scm b/guix-data-service/web/revision/controller.scm
index 08529be..2df5b99 100644
--- a/guix-data-service/web/revision/controller.scm
+++ b/guix-data-service/web/revision/controller.scm
@@ -1083,14 +1083,20 @@
. ,(list->vector
(map (match-lambda
((id lint-checker-name lint-checker-description
+ lint-checker-description-locale
lint-checker-network-dependent
package-name package-version
file line-number column-number
- message)
+ message message-locale)
`((package . ((name . ,package-name)
(version . ,package-version)))
,@(if (member "message" fields)
- `((message . ,message))
+ `((message . ,message)
+ (message-locale . ,message-locale))
+ '())
+ ,@(if (member "linter" fields)
+ `((lint-checker-description . ,lint-checker-description)
+ (lint-checker-description-locale . ,lint-checker-description-locale))
'())
,@(if (member "location" fields)
`((location . ((file . ,file)
diff --git a/guix-data-service/web/revision/html.scm b/guix-data-service/web/revision/html.scm
index cf34d5f..a22c38e 100644
--- a/guix-data-service/web/revision/html.scm
+++ b/guix-data-service/web/revision/html.scm
@@ -1945,10 +1945,10 @@ figure {
,@(let ((fields (assq-ref query-parameters 'field)))
(map
(match-lambda
- ((id lint-checker-name lint-checker-description
+ ((id lint-checker-name lint-checker-description lint-checker-description-locale
lint-checker-network-dependent
package-name package-version file line-number column-number
- message)
+ message message-locale)
`(tr
(td (a (@ (href ,(string-append
(string-join