From 05f72c953e7d6c9e5ee7984b74fbc689734c7880 Mon Sep 17 00:00:00 2001 From: Clemens Geibel Date: Thu, 5 Aug 2021 13:47:06 +0200 Subject: [PATCH] Fixed frontend validation --- public/index.html | 4 ++-- src/main/cljc/dda/c4k_jira/jira.cljc | 1 + src/main/cljs/dda/c4k_jira/browser.cljs | 15 ++++++++------- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/public/index.html b/public/index.html index 2c5d168..0f0d145 100644 --- a/public/index.html +++ b/public/index.html @@ -26,12 +26,12 @@
-

+        

       
-

+        

       

diff --git a/src/main/cljc/dda/c4k_jira/jira.cljc b/src/main/cljc/dda/c4k_jira/jira.cljc index ec218da..bd52990 100644 --- a/src/main/cljc/dda/c4k_jira/jira.cljc +++ b/src/main/cljc/dda/c4k_jira/jira.cljc @@ -7,6 +7,7 @@ (s/def ::fqdn cm/fqdn-string?) (s/def ::issuer cm/letsencrypt-issuer?) +(s/def ::restic-repository string?) (s/def ::jira-data-volume-path string?) #?(:cljs diff --git a/src/main/cljs/dda/c4k_jira/browser.cljs b/src/main/cljs/dda/c4k_jira/browser.cljs index 332775a..c44164b 100644 --- a/src/main/cljs/dda/c4k_jira/browser.cljs +++ b/src/main/cljs/dda/c4k_jira/browser.cljs @@ -3,12 +3,13 @@ [clojure.tools.reader.edn :as edn] [dda.c4k-jira.core :as core] [dda.c4k-jira.jira :as jira] - [dda.c4k-common.browser :as br])) + [dda.c4k-common.browser :as br] + [dda.c4k-common.postgres :as pgc])) (defn config-from-document [] - (let [jira-data-volume-path (br/get-content-from-element "jira-data-volume-path" :optional true :deserializer keyword) - postgres-data-volume-path (br/get-content-from-element "postgres-data-volume-path" :optional true :deserializer keyword) - restic-repository (br/get-content-from-element "restic-repository" :optional true :deserializer keyword) + (let [jira-data-volume-path (br/get-content-from-element "jira-data-volume-path" :optional true) + postgres-data-volume-path (br/get-content-from-element "postgres-data-volume-path" :optional true) + restic-repository (br/get-content-from-element "restic-repository" :optional true) issuer (br/get-content-from-element "issuer" :optional true :deserializer keyword)] (merge {:fqdn (br/get-content-from-element "fqdn")} @@ -24,9 +25,9 @@ (defn validate-all! [] (br/validate! "fqdn" ::jira/fqdn) - (br/validate! "jira-data-volume-path" ::jira/jira-data-volume-path :optional true :deserializer keyword) - (br/validate! "postgres-data-volume-path" ::jira/jira-data-volume-path :optional true :deserializer keyword) - (br/validate! "restic-repository" ::jira/restic-repository :optional true :deserializer keyword) + (br/validate! "jira-data-volume-path" ::jira/jira-data-volume-path :optional true) + (br/validate! "postgres-data-volume-path" ::pgc/postgres-data-volume-path :optional true) + (br/validate! "restic-repository" ::jira/restic-repository :optional true) (br/validate! "issuer" ::jira/issuer :optional true :deserializer keyword) (br/validate! "auth" core/auth? :deserializer edn/read-string) (br/set-validated!))