From 354447037e0478cd2051bb9609315b5bed28aeff Mon Sep 17 00:00:00 2001 From: bom Date: Tue, 14 Sep 2021 13:59:40 +0200 Subject: [PATCH 1/3] bumped and use commons version --- project.clj | 2 +- shadow-cljs.edn | 2 +- src/main/cljs/dda/c4k_jira/browser.cljs | 32 ++++++++++++------------- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/project.clj b/project.clj index 3d0676e..b7f57b3 100644 --- a/project.clj +++ b/project.clj @@ -5,7 +5,7 @@ :url "https://www.apache.org/licenses/LICENSE-2.0.html"} :dependencies [[org.clojure/clojure "1.10.3"] [org.clojure/tools.reader "1.3.4"] - [org.domaindrivenarchitecture/c4k-common-clj "0.2.8"] + [org.domaindrivenarchitecture/c4k-common-clj "0.2.10"] [hickory "0.7.1"]] :target-path "target/%s/" :source-paths ["src/main/cljc" diff --git a/shadow-cljs.edn b/shadow-cljs.edn index 7e72179..a19fafb 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 "0.2.8"] + :dependencies [[org.domaindrivenarchitecture/c4k-common-cljs "0.2.10"] [hickory "0.7.1"]] :builds {:frontend {:target :browser :modules {:main {:init-fn dda.c4k-jira.browser/init}} diff --git a/src/main/cljs/dda/c4k_jira/browser.cljs b/src/main/cljs/dda/c4k_jira/browser.cljs index 4ce05b0..0d478fa 100644 --- a/src/main/cljs/dda/c4k_jira/browser.cljs +++ b/src/main/cljs/dda/c4k_jira/browser.cljs @@ -8,27 +8,27 @@ (defn generate-content [] - (into [] (concat [(assoc (generate-needs-validation) :content - (into [] (concat (generate-input-field "fqdn" "Your fqdn:" "jira-neu.prod.meissa-gmbh.de") - (generate-input-field "jira-data-volume-path" "(Optional) Your jira-data-volume-path:" "/var/jira") - (generate-input-field "postgres-data-volume-path" "(Optional) Your postgres-data-volume-path:" "/var/postgres") - (generate-input-field "restic-repository" "(Optional) Your restic-repository:" "restic-repository") - (generate-br) - (generate-input-field "issuer" "(Optional) Your issuer prod/staging:" "") - (generate-br) - (generate-br) - (generate-text-area "auth" "Your auth.edn:" "{:postgres-db-user \" jira \" + (into [] (concat [(assoc (br/generate-needs-validation) :content + (into [] (concat (br/generate-input-field "fqdn" "Your fqdn:" "jira-neu.prod.meissa-gmbh.de") + (br/generate-input-field "jira-data-volume-path" "(Optional) Your jira-data-volume-path:" "/var/jira") + (br/generate-input-field "postgres-data-volume-path" "(Optional) Your postgres-data-volume-path:" "/var/postgres") + (br/generate-input-field "restic-repository" "(Optional) Your restic-repository:" "restic-repository") + (br/generate-br) + (br/generate-input-field "issuer" "(Optional) Your issuer prod/staging:" "") + (br/generate-br) + (br/generate-br) + (br/generate-text-area "auth" "Your auth.edn:" "{:postgres-db-user \" jira \" :postgres-db-password \" jira-db-password \" :aws-access-key-id \" aws-id \" :aws-secret-access-key \" aws-secret \" :restic-password \" restic-password \"}" "5") - (generate-br) - (generate-br) - (generate-button "generate-button" "Generate c4k yaml"))))] - (generate-br) - (generate-br) - (generate-output "c4k-keycloak-output" "Your c4k deployment.yaml:" "25")))) + (br/generate-br) + (br/generate-br) + (br/generate-button "generate-button" "Generate c4k yaml"))))] + (br/generate-br) + (br/generate-br) + (br/generate-output "c4k-keycloak-output" "Your c4k deployment.yaml:" "25")))) (defn config-from-document [] (let [jira-data-volume-path (br/get-content-from-element "jira-data-volume-path" :optional true) From 8a4bce838a89e7e46dd17099dabafecaab33091d Mon Sep 17 00:00:00 2001 From: bom Date: Tue, 14 Sep 2021 15:02:13 +0200 Subject: [PATCH 2/3] finalizing html refactor --- public/index.html | 50 ------------------------- shadow-cljs.edn | 2 +- src/main/cljs/dda/c4k_jira/browser.cljs | 29 +++++++++----- 3 files changed, 20 insertions(+), 61 deletions(-) diff --git a/public/index.html b/public/index.html index 0f0d145..57b9887 100644 --- a/public/index.html +++ b/public/index.html @@ -12,56 +12,6 @@
-
- - -
-

-      
- - -
-

-      
- - -
-

-      
- - -
-

-      
-
- - -
-

-      
-

- - -
-

-      
-

- -


-
- - -
-
diff --git a/shadow-cljs.edn b/shadow-cljs.edn index a19fafb..887a7c9 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 "0.2.10"] + :dependencies [[org.domaindrivenarchitecture/c4k-common-cljs "0.3.1"] [hickory "0.7.1"]] :builds {:frontend {:target :browser :modules {:main {:init-fn dda.c4k-jira.browser/init}} diff --git a/src/main/cljs/dda/c4k_jira/browser.cljs b/src/main/cljs/dda/c4k_jira/browser.cljs index 0d478fa..d81db74 100644 --- a/src/main/cljs/dda/c4k_jira/browser.cljs +++ b/src/main/cljs/dda/c4k_jira/browser.cljs @@ -13,22 +13,30 @@ (br/generate-input-field "jira-data-volume-path" "(Optional) Your jira-data-volume-path:" "/var/jira") (br/generate-input-field "postgres-data-volume-path" "(Optional) Your postgres-data-volume-path:" "/var/postgres") (br/generate-input-field "restic-repository" "(Optional) Your restic-repository:" "restic-repository") - (br/generate-br) + [(br/generate-br)] (br/generate-input-field "issuer" "(Optional) Your issuer prod/staging:" "") - (br/generate-br) - (br/generate-br) + [(br/generate-br)] + [(br/generate-br)] (br/generate-text-area "auth" "Your auth.edn:" "{:postgres-db-user \" jira \" :postgres-db-password \" jira-db-password \" :aws-access-key-id \" aws-id \" :aws-secret-access-key \" aws-secret \" :restic-password \" restic-password \"}" - "5") - (br/generate-br) - (br/generate-br) - (br/generate-button "generate-button" "Generate c4k yaml"))))] - (br/generate-br) - (br/generate-br) - (br/generate-output "c4k-keycloak-output" "Your c4k deployment.yaml:" "25")))) + "5") + [(br/generate-br)] + [(br/generate-br)] + [(br/generate-button "generate-button" "Generate c4k yaml")])))] + [(br/generate-br) + (br/generate-br) + (br/generate-output "c4k-keycloak-output" "Your c4k deployment.yaml:" "25")]))) + +(defn generate-final + [] + {:type :element + :attrs {:class "container jumbotron"} + :tag :div + :content + (generate-content)}) (defn config-from-document [] (let [jira-data-volume-path (br/get-content-from-element "jira-data-volume-path" :optional true) @@ -61,6 +69,7 @@ (.addEventListener "blur" #(do (validate-all!))))) (defn init [] + (br/replace-element-content "container jumbotron" (generate-final)) (-> js/document (.getElementById "generate-button") (.addEventListener "click" From f0451ec086481b94f73de4d27202a312a7d77f92 Mon Sep 17 00:00:00 2001 From: bom Date: Tue, 14 Sep 2021 15:08:46 +0200 Subject: [PATCH 3/3] working browser replacement --- public/index.html | 5 ++--- src/main/cljs/dda/c4k_jira/browser.cljs | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/public/index.html b/public/index.html index 57b9887..6a4ed4a 100644 --- a/public/index.html +++ b/public/index.html @@ -3,7 +3,7 @@ - c4k-keycloak + c4k-jira @@ -11,8 +11,7 @@ -
-
+
diff --git a/src/main/cljs/dda/c4k_jira/browser.cljs b/src/main/cljs/dda/c4k_jira/browser.cljs index d81db74..054dda9 100644 --- a/src/main/cljs/dda/c4k_jira/browser.cljs +++ b/src/main/cljs/dda/c4k_jira/browser.cljs @@ -69,7 +69,7 @@ (.addEventListener "blur" #(do (validate-all!))))) (defn init [] - (br/replace-element-content "container jumbotron" (generate-final)) + (br/replace-element-content "app" (generate-final)) (-> js/document (.getElementById "generate-button") (.addEventListener "click"