add link adding to instance/show, add envs for neo4j connection

integration-tests
Josha von Gizycki 5 years ago
parent 59755dc041
commit 833347b198

@ -15,10 +15,15 @@
#"[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}" %))
(def conn
(let [env #(or (System/getenv %1) %2)
port (env "NEO4J_PORT" "7687")
host (env "NEO4J_HOST" "localhost")
user (env "NEO4J_USER" "neo4j")
pass (env "NEO4J_PASS" "b")]
(delay (db/connect
"bolt://localhost:7687"
"neo4j"
"b")))
(str "bolt://" host ":" port)
user
pass))))
(defmacro defquery [& args] `(db/defquery ~@args))

@ -45,7 +45,9 @@
:starred
(domain/is-starred! uuid
user-uuid))]
(view/show! instance req)))
(view/show! instance
(domain-schema/accessible-schemas! user-uuid)
req)))
(defn form! [uuid attrs]
(forms-inst/with-attributes attrs))

@ -61,7 +61,7 @@
[:td (prettify-dt (:updated_at instance))]
[:td (prettify-dt (:created_at instance))]])]]]))
(defn show! [instance req]
(defn show! [instance schemas req]
(view/layout!
:request req
:content
@ -158,7 +158,16 @@
[:td [:a {:href (path :instance-list
{:schema-uuid (:uuid schema)})}
(h (:name schema))]]
[:td (prettify-dt (:created_at link))]])]]])]))
[:td (prettify-dt (:created_at link))]])]]])
[:section.link-instance
[:h2 "Link Instance with Instance of Schema..."]
[:ul
(for [schema schemas]
[:li
[:a {:href (path :instance-link-selection
{:uuid (:uuid instance)
:schema-uuid (:uuid schema)})}
(h (:name schema))]])]]]))
(defn edit! [instance form form-data schemas req]
(view/layout!

Loading…
Cancel
Save