[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
05/10: Add default datetimes for compare-by-datetime
From: |
Christopher Baines |
Subject: |
05/10: Add default datetimes for compare-by-datetime |
Date: |
Sat, 21 Nov 2020 16:11:44 -0500 (EST) |
cbaines pushed a commit to branch master
in repository data-service.
commit 12f35c493b5cfb05ce236c4cba4cb16f915bcdb8
Author: Christopher Baines <mail@cbaines.net>
AuthorDate: Sat Nov 21 20:04:10 2020 +0000
Add default datetimes for compare-by-datetime
As this makes it easy to compare the current state of two branches.
---
guix-data-service/web/compare/controller.scm | 13 +++++++++----
guix-data-service/web/compare/html.scm | 4 ----
2 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/guix-data-service/web/compare/controller.scm
b/guix-data-service/web/compare/controller.scm
index 0445961..6c96d55 100644
--- a/guix-data-service/web/compare/controller.scm
+++ b/guix-data-service/web/compare/controller.scm
@@ -18,6 +18,7 @@
(define-module (guix-data-service web compare controller)
#:use-module (srfi srfi-1)
#:use-module (srfi srfi-11)
+ #:use-module (srfi srfi-19)
#:use-module (ice-9 match)
#:use-module (ice-9 vlist)
#:use-module (texinfo)
@@ -99,9 +100,11 @@
(parse-query-parameters
request
`((base_branch ,identity #:required)
- (base_datetime ,parse-datetime #:required)
+ (base_datetime ,parse-datetime
+ #:default ,(current-date))
(target_branch ,identity #:required)
- (target_datetime ,parse-datetime #:required)
+ (target_datetime ,parse-datetime
+ #:default ,(current-date))
(locale ,identity #:default "en_US.UTF-8")))))
(render-compare-by-datetime mime-types
parsed-query-parameters)))
@@ -139,9 +142,11 @@
(parse-query-parameters
request
`((base_branch ,identity #:required)
- (base_datetime ,parse-datetime #:required)
+ (base_datetime ,parse-datetime
+ #:default ,(current-date))
(target_branch ,identity #:required)
- (target_datetime ,parse-datetime #:required)
+ (target_datetime ,parse-datetime
+ #:default ,(current-date))
(system ,parse-system #:multi-value)
(target ,parse-target #:multi-value)
(build_status ,parse-build-status #:multi-value)
diff --git a/guix-data-service/web/compare/html.scm
b/guix-data-service/web/compare/html.scm
index 23cafaf..e5bbcfc 100644
--- a/guix-data-service/web/compare/html.scm
+++ b/guix-data-service/web/compare/html.scm
@@ -136,7 +136,6 @@
#:font-family "monospace")
(form-horizontal-control
"Base datetime" query-parameters
- #:required? #t
#:help-text "The date and time to compare from."
#:font-family "monospace")
(form-horizontal-control
@@ -146,7 +145,6 @@
#:font-family "monospace")
(form-horizontal-control
"Target datetime" query-parameters
- #:required? #t
#:help-text "The date and time to compare to."
#:font-family "monospace")))
(else
@@ -902,7 +900,6 @@ enough builds to determine a change")))
#:font-family "monospace")
,(form-horizontal-control
"Base datetime" query-parameters
- #:required? #t
#:help-text "The date and time to compare from."
#:font-family "monospace")
,(form-horizontal-control
@@ -912,7 +909,6 @@ enough builds to determine a change")))
#:font-family "monospace")
,(form-horizontal-control
"Target datetime" query-parameters
- #:required? #t
#:help-text "The date and time to compare to."
#:font-family "monospace")
,(form-horizontal-control
- branch master updated (3e15900 -> e93da1a), Christopher Baines, 2020/11/21
- 01/10: Avoid crashing when no compare arguments are provided, Christopher Baines, 2020/11/21
- 04/10: Improve the comparison page interface, Christopher Baines, 2020/11/21
- 02/10: Avoid errors in form-horizontal-control, Christopher Baines, 2020/11/21
- 03/10: Specify an invalid parameter message in parse-datetime, Christopher Baines, 2020/11/21
- 05/10: Add default datetimes for compare-by-datetime,
Christopher Baines <=
- 06/10: Fix some links on the compare page, Christopher Baines, 2020/11/21
- 09/10: Consolidate the package derivation comparison code, Christopher Baines, 2020/11/21
- 08/10: Start merging the package derivation comparison code, Christopher Baines, 2020/11/21
- 07/10: Extract out the compare form controls, Christopher Baines, 2020/11/21
- 10/10: Fix the JSON link on the compare package derivations page, Christopher Baines, 2020/11/21