From 08ac2ae1c2f8c137265ed3888eb67bb32abde320 Mon Sep 17 00:00:00 2001 From: bom Date: Fri, 17 Jun 2022 09:56:16 +0200 Subject: [PATCH] Update browser.cljs to fit gitea --- package.json | 2 +- shadow-cljs.edn | 2 +- src/main/cljc/dda/c4k_gitea/gitea.cljc | 6 ++++-- src/main/cljs/dda/c4k_gitea/browser.cljs | 5 ++--- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 8608171..e448cda 100644 --- a/package.json +++ b/package.json @@ -30,4 +30,4 @@ "shadow-cljs": "^2.11.18", "source-map-support": "^0.5.19" } -} \ No newline at end of file +} diff --git a/shadow-cljs.edn b/shadow-cljs.edn index 7d5f145..7aadcbd 100644 --- a/shadow-cljs.edn +++ b/shadow-cljs.edn @@ -4,7 +4,7 @@ "src/test/cljc" "src/test/cljs" "src/test/resources"] - :dependencies [[org.domaindrivenarchitecture/c4k-common-cljs "2.0.3"] + :dependencies [[org.domaindrivenarchitecture/c4k-common-cljs "2.1.0"] [hickory "0.7.1"]] :builds {:frontend {:target :browser :modules {:main {:init-fn dda.c4k-gitea.browser/init}} diff --git a/src/main/cljc/dda/c4k_gitea/gitea.cljc b/src/main/cljc/dda/c4k_gitea/gitea.cljc index 2c7eda4..c1b0b07 100644 --- a/src/main/cljc/dda/c4k_gitea/gitea.cljc +++ b/src/main/cljc/dda/c4k_gitea/gitea.cljc @@ -13,12 +13,14 @@ (defmethod yaml/load-resource :gitea [resource-name] (case resource-name "gitea/appini-configmap.yaml" (rc/inline "gitea/appini-configmap.yaml") - "gitea/apini-env-configmap.yaml" (rc/inline "gitea/apini-env-configmap.yaml") + "gitea/appini-env-configmap.yaml" (rc/inline "gitea/appini-env-configmap.yaml") "gitea/deployment.yaml" (rc/inline "gitea/deployment.yaml") "gitea/ingress.yaml" (rc/inline "gitea/ingress.yaml") "gitea/services.yaml" (rc/inline "gitea/services.yaml") "gitea/volumes.yaml" (rc/inline "gitea/volumes.yaml") - (throw (js/Error. "Undefined Resource!")))) + (throw (js/Error. "Undefined Resource!"))))) + +#?(:cljs (defmethod yaml/load-as-edn :gitea [resource-name] (yaml/from-string (yaml/load-resource resource-name)))) diff --git a/src/main/cljs/dda/c4k_gitea/browser.cljs b/src/main/cljs/dda/c4k_gitea/browser.cljs index 954c216..2ff81e5 100644 --- a/src/main/cljs/dda/c4k_gitea/browser.cljs +++ b/src/main/cljs/dda/c4k_gitea/browser.cljs @@ -41,8 +41,7 @@ (br/generate-text-area "auth" "Your auth.edn:" "{:postgres-db-user \"gitea\" -:postgres-db-password \"gitea-db-password\" -:django-secret-key \"djangosecretkey\"}" +:postgres-db-password \"gitea-db-password\"}" "5")) [(br/generate-br)] (br/generate-button "generate-button" "Generate c4k yaml")))] @@ -72,7 +71,7 @@ (br/validate! "issuer" ::gitea/issuer :optional true :deserializer keyword) (br/validate! "postgres-data-volume-path" ::pgc/postgres-data-volume-path :optional true) (br/validate! "auth" core/auth? :deserializer edn/read-string) - (br/set-validated!)) + (br/set-form-validated!)) (defn add-validate-listener [name] (-> (br/get-element-by-id name)