diff options
author | Christopher Baines <mail@cbaines.net> | 2019-10-05 11:11:22 +0100 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2019-10-05 11:11:22 +0100 |
commit | 8019d2e6878908f40cb6b047f60d2e4fd3c6712e (patch) | |
tree | e698ccfe1dd6be5d592ee9cfac3674608951c942 | |
parent | 9fc6dd08e681ee8ce12c6d1d5036710d05b5e9db (diff) | |
download | data-service-8019d2e6878908f40cb6b047f60d2e4fd3c6712e.tar data-service-8019d2e6878908f40cb6b047f60d2e4fd3c6712e.tar.gz |
Add "No lint warning changes" message to compare page
-rw-r--r-- | guix-data-service/web/view/html.scm | 71 |
1 files changed, 37 insertions, 34 deletions
diff --git a/guix-data-service/web/view/html.scm b/guix-data-service/web/view/html.scm index 3005af6..1a4c984 100644 --- a/guix-data-service/web/view/html.scm +++ b/guix-data-service/web/view/html.scm @@ -1789,41 +1789,44 @@ (div (@ (class "col-sm-12")) (h2 "Lint warnings") - ,@(map - (match-lambda - (((package-name package-version) . warnings) - `((h4 ,package-name " (version: " ,package-version ")") - (table - (@ (class "table")) - (thead - (tr - (th "") - (th "Linter") - (th "Message"))) - (tbody - ,@(map (match-lambda - ((lint-checker-name - message - lint-checker-description - lint-checker-network-dependent - file line column-number ;; TODO Maybe use the location? - change) + ,@(if + (null? lint-warnings-data) + '((p "No lint warning changes")) + (map + (match-lambda + (((package-name package-version) . warnings) + `((h4 ,package-name " (version: " ,package-version ")") + (table + (@ (class "table")) + (thead + (tr + (th "") + (th "Linter") + (th "Message"))) + (tbody + ,@(map (match-lambda + ((lint-checker-name + message + lint-checker-description + lint-checker-network-dependent + file line column-number ;; TODO Maybe use the location? + change) - `(tr - (td (@ (class ,(if (string=? change "new") - "text-danger" - "text-success")) - (style "font-weight: bold")) - ,(if (string=? change "new") - "New warning" - "Resolved warning")) - (td (span (@ (style "font-family: monospace; display: block;")) - ,lint-checker-name) - (p (@ (style "font-size: small; margin: 6px 0 0px;")) - ,lint-checker-description)) - (td ,message)))) - warnings)))))) - lint-warnings-data))))))) + `(tr + (td (@ (class ,(if (string=? change "new") + "text-danger" + "text-success")) + (style "font-weight: bold")) + ,(if (string=? change "new") + "New warning" + "Resolved warning")) + (td (span (@ (style "font-family: monospace; display: block;")) + ,lint-checker-name) + (p (@ (style "font-size: small; margin: 6px 0 0px;")) + ,lint-checker-description)) + (td ,message)))) + warnings)))))) + lint-warnings-data)))))))) (define (compare/derivations query-parameters valid-systems |