guix-commits
[Top][All Lists]
Advanced

[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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]