adjust to the "return a hickup vector" convention

This commit is contained in:
jerger 2022-02-10 18:08:26 +01:00
parent 2d3e097703
commit 0a12bed545
2 changed files with 27 additions and 27 deletions

View file

@ -14,40 +14,40 @@
(defn generate-group
[name
content]
{:type :element
:tag :div
:attrs {:class "rounded border border-3 m-3 p-2"}
:content [{:type :element
:tag :b
:attrs {:style "z-index: 1; position: relative; top: -1.3rem;"}
:content name}
{:type :element
:tag :fieldset
:content content}]})
[{:type :element
:tag :div
:attrs {:class "rounded border border-3 m-3 p-2"}
:content [{:type :element
:tag :b
:attrs {:style "z-index: 1; position: relative; top: -1.3rem;"}
:content name}
{:type :element
:tag :fieldset
:content content}]}])
(defn generate-content []
(concat-vec
[(assoc
(br/generate-needs-validation) :content
(concat-vec
[(generate-group
"domain"
(concat-vec
(br/generate-input-field "fqdn" "Your fqdn:" "shynet.prod.meissa-gmbh.de")
(br/generate-input-field "issuer" "(Optional) Your issuer prod/staging:" "")))
(generate-group
"provider"
(concat-vec
(br/generate-input-field "ingress-type" "(Optional) Your ingress type (traefik/ngingx):" "traefik")
(br/generate-input-field "postgres-data-volume-path" "(Optional) Your postgres-data-volume-path:" "/var/postgres")))
(generate-group
"credentials"
(br/generate-text-area
"auth" "Your auth.edn:"
"{:postgres-db-user \"shynet\"
(generate-group
"domain"
(concat-vec
(br/generate-input-field "fqdn" "Your fqdn:" "shynet.prod.meissa-gmbh.de")
(br/generate-input-field "issuer" "(Optional) Your issuer prod/staging:" "")))
(generate-group
"provider"
(concat-vec
(br/generate-input-field "ingress-type" "(Optional) Your ingress type (traefik/ngingx):" "traefik")
(br/generate-input-field "postgres-data-volume-path" "(Optional) Your postgres-data-volume-path:" "/var/postgres")))
(generate-group
"credentials"
(br/generate-text-area
"auth" "Your auth.edn:"
"{:postgres-db-user \"shynet\"
:postgres-db-password \"shynet-db-password\"
:django-secret-key \"djangosecretkey\"}"
"5"))]
"5"))
[(br/generate-br)]
(br/generate-button "generate-button" "Generate c4k yaml")))]
(br/generate-output "c4k-shynet-output" "Your c4k deployment.yaml:" "25")))

View file

@ -7,5 +7,5 @@
(deftest should-generate-group
(is (= "<div class=\"rounded border border-3 m-3 p-2\"><b style=\"z-index: 1; position: relative; top: -1.3rem;\">id1</b><fieldset>content</fieldset></div>"
(hr/hickory-to-html
(apply hr/hickory-to-html
(cut/generate-group "id1" "content")))))